diff options
| author | Gerd Moellmann | 1999-07-21 21:43:52 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 1999-07-21 21:43:52 +0000 |
| commit | 18082e2d154ba9c8c54732a15bdf05ee269c5922 (patch) | |
| tree | 989e8372339d39ae634b52516a5303594b6967d7 /src | |
| parent | 3b83d6312c4482c0f9106463886d9cd299403d66 (diff) | |
| download | emacs-18082e2d154ba9c8c54732a15bdf05ee269c5922.tar.gz emacs-18082e2d154ba9c8c54732a15bdf05ee269c5922.zip | |
(make_frame): Set n_current_toolbar_items to 0.
(syms_of_frame_1): Add Qtoolbar_lines.
(make_frame): Initialize toolbar members.
(make_frame): Initialize toolbar_window.
(frame-initialize): Set frame-creation-function to
tty-create-frame-with-faces.
(make_terminal_frame): Call init_frame_faces
unconditionally.
(make_frame): Call set_window_buffer instead of
Fset_window_buffer.
(make_frame): Initialze face cache with null.
(make_frame): Initialize face_cache.
(Fdelete_frame): Free it.
(Fdelete_frame): Use xfree instead of free.
(set_menu_bar_lines): Ditto.
(Fmake_terminal_frame): Ditto.
(make_frame): Initialize menu_bar_window to nil.
(make_frame): Remove CURSOR_X/Y.
(set_menu_bar_lines): Adjust matrices.
(make_frame): Initialize pools.
(make_frame): initialize DECODE_MODE_SPEC_BUFFER.
(Fmake_terminal_frame): Adjust glyphs.
(Fdelete_frame): Free glyphs.
(make_frame): Initialize matrix fields in frame.
Diffstat (limited to 'src')
| -rw-r--r-- | src/frame.c | 65 |
1 files changed, 42 insertions, 23 deletions
diff --git a/src/frame.c b/src/frame.c index 50c7ce0439a..2aba671db51 100644 --- a/src/frame.c +++ b/src/frame.c | |||
| @@ -84,6 +84,7 @@ Lisp_Object Qname; | |||
| 84 | Lisp_Object Qonly; | 84 | Lisp_Object Qonly; |
| 85 | Lisp_Object Qunsplittable; | 85 | Lisp_Object Qunsplittable; |
| 86 | Lisp_Object Qmenu_bar_lines; | 86 | Lisp_Object Qmenu_bar_lines; |
| 87 | Lisp_Object Qtoolbar_lines; | ||
| 87 | Lisp_Object Qwidth; | 88 | Lisp_Object Qwidth; |
| 88 | Lisp_Object Qx; | 89 | Lisp_Object Qx; |
| 89 | Lisp_Object Qw32; | 90 | Lisp_Object Qw32; |
| @@ -120,6 +121,8 @@ syms_of_frame_1 () | |||
| 120 | staticpro (&Qunsplittable); | 121 | staticpro (&Qunsplittable); |
| 121 | Qmenu_bar_lines = intern ("menu-bar-lines"); | 122 | Qmenu_bar_lines = intern ("menu-bar-lines"); |
| 122 | staticpro (&Qmenu_bar_lines); | 123 | staticpro (&Qmenu_bar_lines); |
| 124 | Qtoolbar_lines = intern ("toolbar-lines"); | ||
| 125 | staticpro (&Qtoolbar_lines); | ||
| 123 | Qwidth = intern ("width"); | 126 | Qwidth = intern ("width"); |
| 124 | staticpro (&Qwidth); | 127 | staticpro (&Qwidth); |
| 125 | Qx = intern ("x"); | 128 | Qx = intern ("x"); |
| @@ -200,6 +203,7 @@ set_menu_bar_lines (f, value, oldval) | |||
| 200 | FRAME_WINDOW_SIZES_CHANGED (f) = 1; | 203 | FRAME_WINDOW_SIZES_CHANGED (f) = 1; |
| 201 | FRAME_MENU_BAR_LINES (f) = nlines; | 204 | FRAME_MENU_BAR_LINES (f) = nlines; |
| 202 | set_menu_bar_lines_1 (f->root_window, nlines - olines); | 205 | set_menu_bar_lines_1 (f->root_window, nlines - olines); |
| 206 | adjust_glyphs (f); | ||
| 203 | } | 207 | } |
| 204 | } | 208 | } |
| 205 | 209 | ||
| @@ -277,10 +281,12 @@ make_frame (mini_p) | |||
| 277 | f = (struct frame *)vec; | 281 | f = (struct frame *)vec; |
| 278 | XSETFRAME (frame, f); | 282 | XSETFRAME (frame, f); |
| 279 | 283 | ||
| 280 | f->cursor_x = 0; | 284 | f->desired_matrix = 0; |
| 281 | f->cursor_y = 0; | 285 | f->current_matrix = 0; |
| 282 | f->current_glyphs = 0; | 286 | f->desired_pool = 0; |
| 283 | f->desired_glyphs = 0; | 287 | f->current_pool = 0; |
| 288 | f->glyphs_initialized_p = 0; | ||
| 289 | f->decode_mode_spec_buffer = 0; | ||
| 284 | f->visible = 0; | 290 | f->visible = 0; |
| 285 | f->async_visible = 0; | 291 | f->async_visible = 0; |
| 286 | f->output_data.nothing = 0; | 292 | f->output_data.nothing = 0; |
| @@ -300,6 +306,7 @@ make_frame (mini_p) | |||
| 300 | f->scroll_bars = Qnil; | 306 | f->scroll_bars = Qnil; |
| 301 | f->condemned_scroll_bars = Qnil; | 307 | f->condemned_scroll_bars = Qnil; |
| 302 | f->face_alist = Qnil; | 308 | f->face_alist = Qnil; |
| 309 | f->face_cache = NULL; | ||
| 303 | f->menu_bar_items = Qnil; | 310 | f->menu_bar_items = Qnil; |
| 304 | f->menu_bar_vector = Qnil; | 311 | f->menu_bar_vector = Qnil; |
| 305 | f->menu_bar_items_used = 0; | 312 | f->menu_bar_items_used = 0; |
| @@ -310,6 +317,11 @@ make_frame (mini_p) | |||
| 310 | #endif | 317 | #endif |
| 311 | f->namebuf = 0; | 318 | f->namebuf = 0; |
| 312 | f->title = Qnil; | 319 | f->title = Qnil; |
| 320 | f->menu_bar_window = Qnil; | ||
| 321 | f->toolbar_window = Qnil; | ||
| 322 | f->desired_toolbar_items = f->current_toolbar_items = Qnil; | ||
| 323 | f->desired_toolbar_string = f->current_toolbar_string = Qnil; | ||
| 324 | f->n_desired_toolbar_items = f->n_current_toolbar_items = 0; | ||
| 313 | 325 | ||
| 314 | root_window = make_window (); | 326 | root_window = make_window (); |
| 315 | if (mini_p) | 327 | if (mini_p) |
| @@ -357,18 +369,25 @@ make_frame (mini_p) | |||
| 357 | a space), try to find another one. */ | 369 | a space), try to find another one. */ |
| 358 | if (XSTRING (Fbuffer_name (buf))->data[0] == ' ') | 370 | if (XSTRING (Fbuffer_name (buf))->data[0] == ' ') |
| 359 | buf = Fother_buffer (buf, Qnil, Qnil); | 371 | buf = Fother_buffer (buf, Qnil, Qnil); |
| 360 | Fset_window_buffer (root_window, buf); | ||
| 361 | 372 | ||
| 373 | /* Use set_window_buffer, not Fset_window_buffer, and don't let | ||
| 374 | hooks be run by it. The reason is that the whole frame/window | ||
| 375 | arrangement is not yet fully intialized at this point. Windows | ||
| 376 | don't have the right size, glyph matrices aren't initialized | ||
| 377 | etc. Running Lisp functions at this point surely ends in a | ||
| 378 | SEGV. */ | ||
| 379 | set_window_buffer (root_window, buf, 0); | ||
| 362 | f->buffer_list = Fcons (buf, Qnil); | 380 | f->buffer_list = Fcons (buf, Qnil); |
| 363 | } | 381 | } |
| 364 | 382 | ||
| 365 | if (mini_p) | 383 | if (mini_p) |
| 366 | { | 384 | { |
| 367 | XWINDOW (mini_window)->buffer = Qt; | 385 | XWINDOW (mini_window)->buffer = Qt; |
| 368 | Fset_window_buffer (mini_window, | 386 | set_window_buffer (mini_window, |
| 369 | (NILP (Vminibuffer_list) | 387 | (NILP (Vminibuffer_list) |
| 370 | ? get_minibuffer (0) | 388 | ? get_minibuffer (0) |
| 371 | : Fcar (Vminibuffer_list))); | 389 | : Fcar (Vminibuffer_list)), |
| 390 | 0); | ||
| 372 | } | 391 | } |
| 373 | 392 | ||
| 374 | f->root_window = root_window; | 393 | f->root_window = root_window; |
| @@ -519,10 +538,10 @@ make_terminal_frame () | |||
| 519 | #ifdef MSDOS | 538 | #ifdef MSDOS |
| 520 | f->output_data.x = &the_only_x_display; | 539 | f->output_data.x = &the_only_x_display; |
| 521 | f->output_method = output_msdos_raw; | 540 | f->output_method = output_msdos_raw; |
| 522 | init_frame_faces (f); | ||
| 523 | #else /* not MSDOS */ | 541 | #else /* not MSDOS */ |
| 524 | f->output_data.nothing = 1; /* Nonzero means frame isn't deleted. */ | 542 | f->output_data.nothing = 1; /* Nonzero means frame isn't deleted. */ |
| 525 | #endif | 543 | #endif |
| 544 | init_frame_faces (f); | ||
| 526 | return f; | 545 | return f; |
| 527 | } | 546 | } |
| 528 | 547 | ||
| @@ -550,7 +569,7 @@ Note that changing the size of one terminal frame automatically affects all.") | |||
| 550 | f = make_terminal_frame (); | 569 | f = make_terminal_frame (); |
| 551 | change_frame_size (f, FRAME_HEIGHT (selected_frame), | 570 | change_frame_size (f, FRAME_HEIGHT (selected_frame), |
| 552 | FRAME_WIDTH (selected_frame), 0, 0); | 571 | FRAME_WIDTH (selected_frame), 0, 0); |
| 553 | remake_frame_glyphs (f); | 572 | adjust_glyphs (f); |
| 554 | calculate_costs (f); | 573 | calculate_costs (f); |
| 555 | XSETFRAME (frame, f); | 574 | XSETFRAME (frame, f); |
| 556 | Fmodify_frame_parameters (frame, Vdefault_frame_alist); | 575 | Fmodify_frame_parameters (frame, Vdefault_frame_alist); |
| @@ -1150,6 +1169,12 @@ but if the second optional argument FORCE is non-nil, you may do so.") | |||
| 1150 | x_clear_frame_selections (f); | 1169 | x_clear_frame_selections (f); |
| 1151 | #endif | 1170 | #endif |
| 1152 | 1171 | ||
| 1172 | /* Free glyphs. | ||
| 1173 | This function must be called before the window tree of the | ||
| 1174 | frame is deleted because windows contain dynamically allocated | ||
| 1175 | memory. */ | ||
| 1176 | free_glyphs (f); | ||
| 1177 | |||
| 1153 | /* Mark all the windows that used to be on FRAME as deleted, and then | 1178 | /* Mark all the windows that used to be on FRAME as deleted, and then |
| 1154 | remove the reference to them. */ | 1179 | remove the reference to them. */ |
| 1155 | delete_all_subwindows (XWINDOW (f->root_window)); | 1180 | delete_all_subwindows (XWINDOW (f->root_window)); |
| @@ -1165,23 +1190,17 @@ but if the second optional argument FORCE is non-nil, you may do so.") | |||
| 1165 | } | 1190 | } |
| 1166 | 1191 | ||
| 1167 | if (f->namebuf) | 1192 | if (f->namebuf) |
| 1168 | free (f->namebuf); | 1193 | xfree (f->namebuf); |
| 1169 | if (FRAME_CURRENT_GLYPHS (f)) | ||
| 1170 | free_frame_glyphs (f, FRAME_CURRENT_GLYPHS (f)); | ||
| 1171 | if (FRAME_DESIRED_GLYPHS (f)) | ||
| 1172 | free_frame_glyphs (f, FRAME_DESIRED_GLYPHS (f)); | ||
| 1173 | if (FRAME_TEMP_GLYPHS (f)) | ||
| 1174 | free_frame_glyphs (f, FRAME_TEMP_GLYPHS (f)); | ||
| 1175 | if (FRAME_INSERT_COST (f)) | 1194 | if (FRAME_INSERT_COST (f)) |
| 1176 | free (FRAME_INSERT_COST (f)); | 1195 | xfree (FRAME_INSERT_COST (f)); |
| 1177 | if (FRAME_DELETEN_COST (f)) | 1196 | if (FRAME_DELETEN_COST (f)) |
| 1178 | free (FRAME_DELETEN_COST (f)); | 1197 | xfree (FRAME_DELETEN_COST (f)); |
| 1179 | if (FRAME_INSERTN_COST (f)) | 1198 | if (FRAME_INSERTN_COST (f)) |
| 1180 | free (FRAME_INSERTN_COST (f)); | 1199 | xfree (FRAME_INSERTN_COST (f)); |
| 1181 | if (FRAME_DELETE_COST (f)) | 1200 | if (FRAME_DELETE_COST (f)) |
| 1182 | free (FRAME_DELETE_COST (f)); | 1201 | xfree (FRAME_DELETE_COST (f)); |
| 1183 | if (FRAME_MESSAGE_BUF (f)) | 1202 | if (FRAME_MESSAGE_BUF (f)) |
| 1184 | free (FRAME_MESSAGE_BUF (f)); | 1203 | xfree (FRAME_MESSAGE_BUF (f)); |
| 1185 | 1204 | ||
| 1186 | #ifdef HAVE_WINDOW_SYSTEM | 1205 | #ifdef HAVE_WINDOW_SYSTEM |
| 1187 | /* Free all fontset data. */ | 1206 | /* Free all fontset data. */ |