Mercurial > hg > xemacs-beta
comparison src/frame.c @ 4207:62d532188a28
[xemacs-hg @ 2007-10-03 10:06:39 by didierv]
Fix some other DEFAULT_INDEX == 0 assumptions
author | didierv |
---|---|
date | Wed, 03 Oct 2007 10:06:42 +0000 |
parents | 91950589598c |
children | 1bdc3bc255a4 |
comparison
equal
deleted
inserted
replaced
4206:a3e638b941b0 | 4207:62d532188a28 |
---|---|
178 static const struct memory_description expose_ignore_description_1 [] = { | 178 static const struct memory_description expose_ignore_description_1 [] = { |
179 { XD_LISP_OBJECT, offsetof (struct expose_ignore, next) }, | 179 { XD_LISP_OBJECT, offsetof (struct expose_ignore, next) }, |
180 { XD_END } | 180 { XD_END } |
181 }; | 181 }; |
182 | 182 |
183 DEFINE_LRECORD_IMPLEMENTATION ("expose-ignore", | 183 DEFINE_LRECORD_IMPLEMENTATION ("expose-ignore", |
184 expose_ignore, | 184 expose_ignore, |
185 1, /*dumpable-flag*/ | 185 1, /*dumpable-flag*/ |
186 0, 0, 0, 0, 0, | 186 0, 0, 0, 0, 0, |
187 expose_ignore_description_1, | 187 expose_ignore_description_1, |
188 struct expose_ignore); | 188 struct expose_ignore); |
189 #else /* not NEW_GC */ | 189 #else /* not NEW_GC */ |
190 extern const struct sized_memory_description expose_ignore_description; | 190 extern const struct sized_memory_description expose_ignore_description; |
191 | 191 |
237 { XD_BLOCK_ARRAY, offsetof (struct frame, desired_display_lines), | 237 { XD_BLOCK_ARRAY, offsetof (struct frame, desired_display_lines), |
238 4, { &display_line_dynarr_pointer_description } }, | 238 4, { &display_line_dynarr_pointer_description } }, |
239 | 239 |
240 { XD_BLOCK_PTR, offsetof (struct frame, framemeths), 1, | 240 { XD_BLOCK_PTR, offsetof (struct frame, framemeths), 1, |
241 { &console_methods_description } }, | 241 { &console_methods_description } }, |
242 { XD_UNION, offsetof (struct frame, frame_data), | 242 { XD_UNION, offsetof (struct frame, frame_data), |
243 XD_INDIRECT (0, 0), { &frame_data_description } }, | 243 XD_INDIRECT (0, 0), { &frame_data_description } }, |
244 { XD_END } | 244 { XD_END } |
245 }; | 245 }; |
246 | 246 |
247 static Lisp_Object | 247 static Lisp_Object |
283 write_fmt_string (printcharfun, " 0x%x>", frm->header.uid); | 283 write_fmt_string (printcharfun, " 0x%x>", frm->header.uid); |
284 } | 284 } |
285 | 285 |
286 DEFINE_LRECORD_IMPLEMENTATION ("frame", frame, | 286 DEFINE_LRECORD_IMPLEMENTATION ("frame", frame, |
287 0, /*dumpable-flag*/ | 287 0, /*dumpable-flag*/ |
288 mark_frame, print_frame, 0, 0, 0, | 288 mark_frame, print_frame, 0, 0, 0, |
289 frame_description, | 289 frame_description, |
290 struct frame); | 290 struct frame); |
291 | 291 |
292 static void | 292 static void |
293 nuke_all_frame_slots (struct frame *f) | 293 nuke_all_frame_slots (struct frame *f) |
476 { | 476 { |
477 Lisp_Object lissed = XCDR (kawnz); | 477 Lisp_Object lissed = XCDR (kawnz); |
478 if (!EQ (lissed, Qunbound)) | 478 if (!EQ (lissed, Qunbound)) |
479 DEVICE_FRAME_LIST (XDEVICE (XCAR (kawnz))) = lissed; | 479 DEVICE_FRAME_LIST (XDEVICE (XCAR (kawnz))) = lissed; |
480 return Qnil; | 480 return Qnil; |
481 } | 481 } |
482 | 482 |
483 DEFUN ("make-frame", Fmake_frame, 0, 2, "", /* | 483 DEFUN ("make-frame", Fmake_frame, 0, 2, "", /* |
484 Create and return a new frame, displaying the current buffer. | 484 Create and return a new frame, displaying the current buffer. |
485 Runs the functions listed in `create-frame-hook' after frame creation. | 485 Runs the functions listed in `create-frame-hook' after frame creation. |
486 | 486 |
530 { | 530 { |
531 /* We leave Vdefault_frame_name alone here so that it'll remain Qnil | 531 /* We leave Vdefault_frame_name alone here so that it'll remain Qnil |
532 in the dumped executable, and we can choose it at runtime. */ | 532 in the dumped executable, and we can choose it at runtime. */ |
533 name = build_string("XEmacs"); | 533 name = build_string("XEmacs"); |
534 } | 534 } |
535 else if (NILP (Vdefault_frame_name)) | 535 else if (NILP (Vdefault_frame_name)) |
536 { | 536 { |
537 if (egetenv ("USE_EMACS_AS_DEFAULT_APPLICATION_CLASS")) | 537 if (egetenv ("USE_EMACS_AS_DEFAULT_APPLICATION_CLASS")) |
538 { | 538 { |
539 Vdefault_frame_name = build_string ("emacs"); | 539 Vdefault_frame_name = build_string ("emacs"); |
540 } | 540 } |
541 else | 541 else |
542 { | 542 { |
543 Vdefault_frame_name = build_string ("XEmacs"); | 543 Vdefault_frame_name = build_string ("XEmacs"); |
544 } | 544 } |
545 } | 545 } |
546 | 546 |
547 if (NILP(name) && STRINGP(Vdefault_frame_name)) | 547 if (NILP(name) && STRINGP(Vdefault_frame_name)) |
548 { | 548 { |
587 update_frame_window_mirror (f); | 587 update_frame_window_mirror (f); |
588 | 588 |
589 if (initialized && !DEVICE_STREAM_P (d)) | 589 if (initialized && !DEVICE_STREAM_P (d)) |
590 { | 590 { |
591 if (!NILP (f->minibuffer_window)) | 591 if (!NILP (f->minibuffer_window)) |
592 reset_face_cachels (XWINDOW (f->minibuffer_window)); | 592 reset_face_cachels (XWINDOW (f->minibuffer_window)); |
593 reset_face_cachels (XWINDOW (f->root_window)); | 593 reset_face_cachels (XWINDOW (f->root_window)); |
594 } | 594 } |
595 | 595 |
596 /* If no frames on this device formerly existed, say this is the | 596 /* If no frames on this device formerly existed, say this is the |
597 first frame. It kind of assumes that frameless devices don't | 597 first frame. It kind of assumes that frameless devices don't |
683 first_frame_on_console)); | 683 first_frame_on_console)); |
684 | 684 |
685 if (!DEVICE_STREAM_P (d)) | 685 if (!DEVICE_STREAM_P (d)) |
686 { | 686 { |
687 /* Now initialise the gutters. This won't change the frame size, | 687 /* Now initialise the gutters. This won't change the frame size, |
688 but is needed as input to the layout that change_frame_size | 688 but is needed as input to the layout that change_frame_size |
689 will eventually do. Unfortunately gutter sizing code relies | 689 will eventually do. Unfortunately gutter sizing code relies |
690 on the frame in question being visible so we can't do this | 690 on the frame in question being visible so we can't do this |
691 earlier. */ | 691 earlier. */ |
692 init_frame_gutters (f); | 692 init_frame_gutters (f); |
693 | 693 |
694 change_frame_size (f, f->height, f->width, 0); | 694 change_frame_size (f, f->height, f->width, 0); |
695 } | 695 } |
696 | 696 |
1328 Possible values for WHICH-FRAMES are | 1328 Possible values for WHICH-FRAMES are |
1329 | 1329 |
1330 `visible' Consider only frames that are visible. | 1330 `visible' Consider only frames that are visible. |
1331 `iconic' Consider only frames that are iconic. | 1331 `iconic' Consider only frames that are iconic. |
1332 `invisible' Consider only frames that are invisible | 1332 `invisible' Consider only frames that are invisible |
1333 (this is different from iconic). | 1333 (this is different from iconic). |
1334 `visible-iconic' Consider frames that are visible or iconic. | 1334 `visible-iconic' Consider frames that are visible or iconic. |
1335 `invisible-iconic' Consider frames that are invisible or iconic. | 1335 `invisible-iconic' Consider frames that are invisible or iconic. |
1336 `nomini' Consider all frames except minibuffer-only ones. | 1336 `nomini' Consider all frames except minibuffer-only ones. |
1337 `visible-nomini' Like `visible' but omits minibuffer-only frames. | 1337 `visible-nomini' Like `visible' but omits minibuffer-only frames. |
1338 `iconic-nomini' Like `iconic' but omits minibuffer-only frames. | 1338 `iconic-nomini' Like `iconic' but omits minibuffer-only frames. |
1339 `invisible-nomini' Like `invisible' but omits minibuffer-only frames. | 1339 `invisible-nomini' Like `invisible' but omits minibuffer-only frames. |
1340 `visible-iconic-nomini' Like `visible-iconic' but omits minibuffer-only | 1340 `visible-iconic-nomini' Like `visible-iconic' but omits minibuffer-only |
1341 frames. | 1341 frames. |
1342 `invisible-iconic-nomini' Like `invisible-iconic' but omits minibuffer-only | 1342 `invisible-iconic-nomini' Like `invisible-iconic' but omits minibuffer-only |
1343 frames. | 1343 frames. |
1344 any other value Consider all frames. | 1344 any other value Consider all frames. |
1345 | 1345 |
1346 If WHICH-FRAMES is omitted, `nomini' is used. A value for WHICH-FRAMES | 1346 If WHICH-FRAMES is omitted, `nomini' is used. A value for WHICH-FRAMES |
1347 of 0 (a number) is treated like `iconic', for backwards compatibility. | 1347 of 0 (a number) is treated like `iconic', for backwards compatibility. |
1348 | 1348 |
1606 { | 1606 { |
1607 Lisp_Object next; | 1607 Lisp_Object next; |
1608 | 1608 |
1609 /* If this is a popup frame, select its parent if possible. | 1609 /* If this is a popup frame, select its parent if possible. |
1610 Otherwise, find another visible frame; if none, just take any frame. | 1610 Otherwise, find another visible frame; if none, just take any frame. |
1611 First try the same device, then the same console. */ | 1611 First try the same device, then the same console. */ |
1612 | 1612 |
1613 next = DEVMETH_OR_GIVEN (d, get_frame_parent, (f), Qnil); | 1613 next = DEVMETH_OR_GIVEN (d, get_frame_parent, (f), Qnil); |
1614 if (NILP (next) || EQ (next, frame) || ! FRAME_LIVE_P (XFRAME (next))) | 1614 if (NILP (next) || EQ (next, frame) || ! FRAME_LIVE_P (XFRAME (next))) |
1615 next = next_frame (frame, Qvisible, device); | 1615 next = next_frame (frame, Qvisible, device); |
1616 if (NILP (next) || EQ (next, frame)) | 1616 if (NILP (next) || EQ (next, frame)) |
2515 #if 0 | 2515 #if 0 |
2516 /* mly wants this, but it's not reasonable to change the name of a | 2516 /* mly wants this, but it's not reasonable to change the name of a |
2517 frame after it has been created, because the old name was used | 2517 frame after it has been created, because the old name was used |
2518 for resource lookup. */ | 2518 for resource lookup. */ |
2519 if (EQ (prop, Qname)) | 2519 if (EQ (prop, Qname)) |
2520 { | 2520 { |
2521 CHECK_STRING (val); | 2521 CHECK_STRING (val); |
2522 f->name = val; | 2522 f->name = val; |
2523 } | 2523 } |
2524 #endif /* 0 */ | 2524 #endif /* 0 */ |
2525 if (EQ (prop, Qminibuffer)) | 2525 if (EQ (prop, Qminibuffer)) |
2526 store_minibuf_frame_prop (f, val); | 2526 store_minibuf_frame_prop (f, val); |
2527 if (EQ (prop, Qunsplittable)) | 2527 if (EQ (prop, Qunsplittable)) |
2528 f->no_split = !NILP (val); | 2528 f->no_split = !NILP (val); |
2735 { | 2735 { |
2736 struct frame *f = decode_frame (frame); | 2736 struct frame *f = decode_frame (frame); |
2737 int height, pheight; | 2737 int height, pheight; |
2738 frame = wrap_frame (f); | 2738 frame = wrap_frame (f); |
2739 | 2739 |
2740 if (!window_system_pixelated_geometry (frame)) | 2740 if (!window_system_pixelated_geometry (frame)) |
2741 { | 2741 { |
2742 height = FRAME_HEIGHT (f); | 2742 height = FRAME_HEIGHT (f); |
2743 | 2743 |
2744 frame_conversion_internal (f, CHAR_TO_DISPLAYABLE_PIXEL, | 2744 frame_conversion_internal (f, CHAR_TO_DISPLAYABLE_PIXEL, |
2745 0, &pheight, 0, &height, 0); | 2745 0, &pheight, 0, &height, 0); |
2746 } | 2746 } |
2747 else | 2747 else |
2748 pheight = FRAME_PIXHEIGHT (f); | 2748 pheight = FRAME_PIXHEIGHT (f); |
2749 | 2749 |
2750 return make_int (pheight); | 2750 return make_int (pheight); |
2751 } | 2751 } |
2752 | 2752 |
2765 { | 2765 { |
2766 struct frame *f = decode_frame (frame); | 2766 struct frame *f = decode_frame (frame); |
2767 int width, pwidth; | 2767 int width, pwidth; |
2768 frame = wrap_frame (f); | 2768 frame = wrap_frame (f); |
2769 | 2769 |
2770 if (!window_system_pixelated_geometry (frame)) | 2770 if (!window_system_pixelated_geometry (frame)) |
2771 { | 2771 { |
2772 width = FRAME_WIDTH (f); | 2772 width = FRAME_WIDTH (f); |
2773 | 2773 |
2774 frame_conversion_internal (f, CHAR_TO_DISPLAYABLE_PIXEL, | 2774 frame_conversion_internal (f, CHAR_TO_DISPLAYABLE_PIXEL, |
2775 &pwidth, 0, &width, 0, 0); | 2775 &pwidth, 0, &width, 0, 0); |
2776 } | 2776 } |
2777 else | 2777 else |
2778 pwidth = FRAME_PIXWIDTH (f); | 2778 pwidth = FRAME_PIXWIDTH (f); |
2779 | 2779 |
2780 return make_int (pwidth); | 2780 return make_int (pwidth); |
2781 } | 2781 } |
2782 | 2782 |
2855 struct frame *f = decode_frame (frame); | 2855 struct frame *f = decode_frame (frame); |
2856 int pheight, width; | 2856 int pheight, width; |
2857 frame = wrap_frame (f); | 2857 frame = wrap_frame (f); |
2858 CHECK_INT (height); | 2858 CHECK_INT (height); |
2859 | 2859 |
2860 if (!window_system_pixelated_geometry (frame)) | 2860 if (!window_system_pixelated_geometry (frame)) |
2861 { | 2861 { |
2862 int h = XINT (height); | 2862 int h = XINT (height); |
2863 width = FRAME_WIDTH (f); | 2863 width = FRAME_WIDTH (f); |
2864 | 2864 |
2865 frame_conversion_internal (f, TOTAL_PIXEL_TO_CHAR, 0, &h, 0, &pheight, 0); | 2865 frame_conversion_internal (f, TOTAL_PIXEL_TO_CHAR, 0, &h, 0, &pheight, 0); |
2866 } | 2866 } |
2867 else | 2867 else |
2868 { | 2868 { |
2869 width = FRAME_PIXWIDTH (f); | 2869 width = FRAME_PIXWIDTH (f); |
2870 pheight = XINT (height); | 2870 pheight = XINT (height); |
2871 } | 2871 } |
2872 | 2872 |
2885 struct frame *f = decode_frame (frame); | 2885 struct frame *f = decode_frame (frame); |
2886 int pheight, width; | 2886 int pheight, width; |
2887 frame = wrap_frame (f); | 2887 frame = wrap_frame (f); |
2888 CHECK_INT (height); | 2888 CHECK_INT (height); |
2889 | 2889 |
2890 if (!window_system_pixelated_geometry (frame)) | 2890 if (!window_system_pixelated_geometry (frame)) |
2891 { | 2891 { |
2892 int h = XINT (height); | 2892 int h = XINT (height); |
2893 width = FRAME_WIDTH (f); | 2893 width = FRAME_WIDTH (f); |
2894 frame_conversion_internal (f, DISPLAYABLE_PIXEL_TO_CHAR, 0, &h, 0, &pheight, 0); | 2894 frame_conversion_internal (f, DISPLAYABLE_PIXEL_TO_CHAR, 0, &h, 0, &pheight, 0); |
2895 } | 2895 } |
2896 else | 2896 else |
2897 { | 2897 { |
2898 width = FRAME_PIXWIDTH (f); | 2898 width = FRAME_PIXWIDTH (f); |
2899 pheight = XINT (height); | 2899 pheight = XINT (height); |
2900 } | 2900 } |
2901 | 2901 |
3028 int pheight, pwidth; | 3028 int pheight, pwidth; |
3029 frame = wrap_frame (f); | 3029 frame = wrap_frame (f); |
3030 CHECK_INT (width); | 3030 CHECK_INT (width); |
3031 CHECK_INT (height); | 3031 CHECK_INT (height); |
3032 | 3032 |
3033 if (!window_system_pixelated_geometry (frame)) | 3033 if (!window_system_pixelated_geometry (frame)) |
3034 { | 3034 { |
3035 int w = XINT (width); | 3035 int w = XINT (width); |
3036 int h = XINT (height); | 3036 int h = XINT (height); |
3037 frame_conversion_internal (f, TOTAL_PIXEL_TO_CHAR, &w, &h, &pwidth, &pheight, 0); | 3037 frame_conversion_internal (f, TOTAL_PIXEL_TO_CHAR, &w, &h, &pwidth, &pheight, 0); |
3038 } | 3038 } |
3058 int pheight, pwidth; | 3058 int pheight, pwidth; |
3059 frame = wrap_frame (f); | 3059 frame = wrap_frame (f); |
3060 CHECK_INT (width); | 3060 CHECK_INT (width); |
3061 CHECK_INT (height); | 3061 CHECK_INT (height); |
3062 | 3062 |
3063 if (!window_system_pixelated_geometry (frame)) | 3063 if (!window_system_pixelated_geometry (frame)) |
3064 { | 3064 { |
3065 int w = XINT (width); | 3065 int w = XINT (width); |
3066 int h = XINT (height); | 3066 int h = XINT (height); |
3067 frame_conversion_internal (f, DISPLAYABLE_PIXEL_TO_CHAR, &w, &h, &pwidth, &pheight, 0); | 3067 frame_conversion_internal (f, DISPLAYABLE_PIXEL_TO_CHAR, &w, &h, &pwidth, &pheight, 0); |
3068 } | 3068 } |
3335 return; | 3335 return; |
3336 | 3336 |
3337 if (new_pixheight) | 3337 if (new_pixheight) |
3338 { | 3338 { |
3339 /* Adjust for gutters here so that we always get set | 3339 /* Adjust for gutters here so that we always get set |
3340 properly. */ | 3340 properly. */ |
3341 new_pixheight -= | 3341 new_pixheight -= |
3342 (FRAME_TOP_GUTTER_BOUNDS (f) | 3342 (FRAME_TOP_GUTTER_BOUNDS (f) |
3343 + FRAME_BOTTOM_GUTTER_BOUNDS (f)); | 3343 + FRAME_BOTTOM_GUTTER_BOUNDS (f)); |
3344 | 3344 |
3345 XWINDOW (FRAME_ROOT_WINDOW (f))->pixel_top | 3345 XWINDOW (FRAME_ROOT_WINDOW (f))->pixel_top |
3386 } | 3386 } |
3387 | 3387 |
3388 if (new_pixwidth) | 3388 if (new_pixwidth) |
3389 { | 3389 { |
3390 /* Adjust for gutters here so that we always get set | 3390 /* Adjust for gutters here so that we always get set |
3391 properly. */ | 3391 properly. */ |
3392 new_pixwidth -= | 3392 new_pixwidth -= |
3393 (FRAME_LEFT_GUTTER_BOUNDS (f) | 3393 (FRAME_LEFT_GUTTER_BOUNDS (f) |
3394 + FRAME_RIGHT_GUTTER_BOUNDS (f)); | 3394 + FRAME_RIGHT_GUTTER_BOUNDS (f)); |
3395 | 3395 |
3396 XWINDOW (FRAME_ROOT_WINDOW (f))->pixel_left = | 3396 XWINDOW (FRAME_ROOT_WINDOW (f))->pixel_left = |
3477 dl = &title_string_display_line; | 3477 dl = &title_string_display_line; |
3478 db = get_display_block_from_line (dl, TEXT); | 3478 db = get_display_block_from_line (dl, TEXT); |
3479 Dynarr_reset (db->runes); | 3479 Dynarr_reset (db->runes); |
3480 | 3480 |
3481 generate_formatted_string_db (format_str, Qnil, w, dl, db, findex, 0, | 3481 generate_formatted_string_db (format_str, Qnil, w, dl, db, findex, 0, |
3482 -1, type); | 3482 -1, type); |
3483 | 3483 |
3484 Dynarr_reset (title_string_ichar_dynarr); | 3484 Dynarr_reset (title_string_ichar_dynarr); |
3485 while (elt < Dynarr_length (db->runes)) | 3485 while (elt < Dynarr_length (db->runes)) |
3486 { | 3486 { |
3487 if (Dynarr_atp (db->runes, elt)->type == RUNE_CHAR) | 3487 if (Dynarr_atp (db->runes, elt)->type == RUNE_CHAR) |
3603 #ifndef PDUMP | 3603 #ifndef PDUMP |
3604 if (!initialized) | 3604 if (!initialized) |
3605 #endif | 3605 #endif |
3606 { | 3606 { |
3607 title_string_ichar_dynarr = Dynarr_new (Ichar); | 3607 title_string_ichar_dynarr = Dynarr_new (Ichar); |
3608 xzero (title_string_display_line); | 3608 DISPLAY_LINE_INIT (title_string_display_line); |
3609 } | 3609 } |
3610 } | 3610 } |
3611 | 3611 |
3612 void | 3612 void |
3613 syms_of_frame (void) | 3613 syms_of_frame (void) |