This source file includes following definitions.
- fset_buffer_list
- fset_buried_buffer_list
- fset_condemned_scroll_bars
- fset_face_hash_table
- fset_parent_frame
- fset_focus_frame
- fset_icon_name
- fset_menu_bar_items
- fset_menu_bar_vector
- fset_menu_bar_window
- fset_name
- fset_param_alist
- fset_root_window
- fset_scroll_bars
- fset_selected_window
- fset_old_selected_window
- fset_title
- fset_tab_bar_items
- fset_tab_bar_window
- fset_current_tab_bar_string
- fset_desired_tab_bar_string
- fset_tool_bar_items
- fset_tool_bar_position
- fset_tool_bar_window
- fset_current_tool_bar_string
- fset_desired_tool_bar_string
- NUMVAL
- default_pixels_per_inch_x
- default_pixels_per_inch_y
- SET_FRAME_VISIBLE
- SET_FRAME_ICONIFIED
- window_system_available
- frame_dimension
- FRAME_FRINGE_COLS
- FRAME_LEFT_FRINGE_WIDTH
- FRAME_RIGHT_FRINGE_WIDTH
- FRAME_TOTAL_FRINGE_WIDTH
- FRAME_CHILD_FRAME_BORDER_WIDTH
- FRAME_INTERNAL_BORDER_WIDTH
- FRAME_RIGHT_DIVIDER_WIDTH
- FRAME_BOTTOM_DIVIDER_WIDTH
- FACE_FROM_ID
- FACE_FROM_ID_OR_NULL
- IMAGE_FROM_ID
- IMAGE_OPT_FROM_ID
- gui_set_bitmap_icon
- flush_frame
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 #ifndef EMACS_FRAME_H
20 #define EMACS_FRAME_H
21
22 #include "termhooks.h"
23 #include "window.h"
24
25 INLINE_HEADER_BEGIN
26
27 enum vertical_scroll_bar_type
28 {
29 vertical_scroll_bar_none,
30 vertical_scroll_bar_left,
31 vertical_scroll_bar_right
32 };
33
34 #ifdef HAVE_WINDOW_SYSTEM
35
36 enum fullscreen_type
37 {
38 FULLSCREEN_NONE,
39 FULLSCREEN_WIDTH = 0x1,
40 FULLSCREEN_HEIGHT = 0x2,
41 FULLSCREEN_BOTH = 0x3,
42 FULLSCREEN_MAXIMIZED = 0x4,
43 #ifdef HAVE_NTGUI
44 FULLSCREEN_WAIT = 0x8
45 #endif
46 };
47
48 enum z_group
49 {
50 z_group_none,
51 z_group_above,
52 z_group_below,
53 z_group_above_suspended,
54 };
55
56 enum internal_border_part
57 {
58 INTERNAL_BORDER_NONE,
59 INTERNAL_BORDER_LEFT_EDGE,
60 INTERNAL_BORDER_TOP_LEFT_CORNER,
61 INTERNAL_BORDER_TOP_EDGE,
62 INTERNAL_BORDER_TOP_RIGHT_CORNER,
63 INTERNAL_BORDER_RIGHT_EDGE,
64 INTERNAL_BORDER_BOTTOM_RIGHT_CORNER,
65 INTERNAL_BORDER_BOTTOM_EDGE,
66 INTERNAL_BORDER_BOTTOM_LEFT_CORNER,
67 };
68
69 #ifdef NS_IMPL_COCOA
70 enum ns_appearance_type
71 {
72 ns_appearance_system_default,
73 ns_appearance_aqua,
74 ns_appearance_vibrant_dark
75 };
76 #endif
77 #endif
78
79
80
81 struct frame
82 {
83 union vectorlike_header header;
84
85
86
87
88
89
90 Lisp_Object name;
91
92
93
94 Lisp_Object icon_name;
95
96
97
98 Lisp_Object title;
99
100 #if defined (HAVE_WINDOW_SYSTEM)
101
102 Lisp_Object parent_frame;
103 #endif
104
105
106
107 Lisp_Object last_mouse_device;
108
109
110
111
112
113
114
115
116
117
118
119
120 Lisp_Object focus_frame;
121
122
123
124
125 Lisp_Object root_window;
126
127
128
129
130
131
132 Lisp_Object selected_window;
133
134
135
136 Lisp_Object old_selected_window;
137
138
139
140
141
142 Lisp_Object minibuffer_window;
143
144
145
146
147 Lisp_Object param_alist;
148
149
150
151
152
153
154
155
156 Lisp_Object scroll_bars;
157 Lisp_Object condemned_scroll_bars;
158
159
160
161
162
163
164 Lisp_Object menu_bar_items;
165
166
167 Lisp_Object face_hash_table;
168
169
170
171
172 Lisp_Object menu_bar_vector;
173
174
175 Lisp_Object buffer_predicate;
176
177
178 Lisp_Object buffer_list;
179
180
181
182 Lisp_Object buried_buffer_list;
183
184 #if defined (HAVE_X_WINDOWS) && ! defined (USE_X_TOOLKIT) && ! defined (USE_GTK)
185
186
187 Lisp_Object menu_bar_window;
188 #endif
189
190 #if defined (HAVE_WINDOW_SYSTEM)
191
192 Lisp_Object tab_bar_window;
193
194
195 Lisp_Object desired_tab_bar_string;
196 Lisp_Object current_tab_bar_string;
197 #endif
198
199 #if defined (HAVE_WINDOW_SYSTEM) && ! defined (HAVE_EXT_TOOL_BAR)
200
201 Lisp_Object tool_bar_window;
202
203
204 Lisp_Object desired_tool_bar_string;
205 Lisp_Object current_tool_bar_string;
206 #endif
207
208 #ifdef USE_GTK
209
210
211 Lisp_Object tool_bar_position;
212 #endif
213
214 #if defined (HAVE_XFT) || defined (HAVE_FREETYPE)
215
216 Lisp_Object font_data;
217 #endif
218
219
220 Lisp_Object tab_bar_items;
221
222
223 Lisp_Object tool_bar_items;
224
225
226
227 struct face_cache *face_cache;
228
229
230 int last_tab_bar_item;
231
232 #if defined (HAVE_WINDOW_SYSTEM) && ! defined (HAVE_EXT_TOOL_BAR)
233
234 int last_tool_bar_item;
235 #endif
236
237
238 int menu_bar_items_used;
239
240 #if defined (USE_X_TOOLKIT) || defined (HAVE_NTGUI)
241
242
243
244 char *namebuf;
245 #endif
246
247 #ifdef USE_X_TOOLKIT
248
249 char *shell_position;
250 #endif
251
252
253 struct glyph_pool *current_pool;
254 struct glyph_pool *desired_pool;
255 struct glyph_matrix *desired_matrix;
256 struct glyph_matrix *current_matrix;
257
258
259
260
261
262 bool_bf glyphs_initialized_p : 1;
263
264
265
266 bool_bf resized_p : 1;
267
268
269
270
271 bool_bf default_face_done_p : 1;
272
273
274
275 bool_bf already_hscrolled_p : 1;
276
277
278 bool_bf updated_p : 1;
279
280 #if defined (HAVE_WINDOW_SYSTEM)
281
282
283 bool_bf minimize_tab_bar_window_p : 1;
284 #endif
285
286 #if defined (HAVE_WINDOW_SYSTEM) && ! defined (HAVE_EXT_TOOL_BAR)
287
288
289 bool_bf minimize_tool_bar_window_p : 1;
290 #endif
291
292 #ifdef HAVE_EXT_TOOL_BAR
293
294 bool_bf external_tool_bar : 1;
295 #endif
296
297
298
299 bool_bf fonts_changed : 1;
300
301
302 bool_bf cursor_type_changed : 1;
303
304
305 bool_bf redisplay : 1;
306
307 #ifdef HAVE_EXT_MENU_BAR
308
309 bool_bf external_menu_bar : 1;
310 #endif
311
312
313
314
315
316
317
318
319
320
321
322
323
324 unsigned visible : 2;
325
326
327
328 bool_bf iconified : 1;
329
330
331
332 bool_bf garbaged : 1;
333
334
335
336 bool_bf wants_modeline : 1;
337
338
339 bool_bf auto_raise : 1;
340
341
342 bool_bf auto_lower : 1;
343
344
345 bool_bf no_split : 1;
346
347
348
349
350
351 bool_bf explicit_name : 1;
352
353
354
355
356
357
358
359
360 bool_bf window_change : 1;
361
362
363
364 bool_bf window_state_change : 1;
365
366
367
368 bool_bf mouse_moved : 1;
369
370
371 bool_bf pointer_invisible : 1;
372
373
374
375 bool_bf frozen_window_starts : 1;
376
377
378
379
380 ENUM_BF (output_method) output_method : 3;
381
382 #ifdef HAVE_WINDOW_SYSTEM
383
384 bool_bf tooltip : 1;
385
386
387 ENUM_BF (fullscreen_type) want_fullscreen : 4;
388
389
390
391 ENUM_BF (vertical_scroll_bar_type) vertical_scroll_bar_type : 2;
392
393
394 bool_bf horizontal_scroll_bars : 1;
395
396
397 bool_bf undecorated : 1;
398
399 #ifndef HAVE_NTGUI
400
401 bool_bf override_redirect : 1;
402 #endif
403
404
405 bool_bf skip_taskbar : 1;
406
407
408
409 bool_bf no_focus_on_map : 1;
410
411
412
413 bool_bf no_accept_focus : 1;
414
415
416 ENUM_BF (z_group) z_group : 2;
417
418
419
420 bool_bf no_special_glyphs : 1;
421 #endif
422
423
424
425 bool_bf can_set_window_size : 1;
426
427
428 bool_bf after_make_frame : 1;
429
430
431
432
433
434
435
436
437 bool_bf tab_bar_redisplayed : 1;
438 bool_bf tab_bar_resized : 1;
439
440
441
442
443
444
445
446
447 bool_bf tool_bar_redisplayed : 1;
448 bool_bf tool_bar_resized : 1;
449
450
451 bool_bf inhibit_horizontal_resize : 1;
452 bool_bf inhibit_vertical_resize : 1;
453
454
455 bool_bf face_change : 1;
456
457
458
459 bool_bf inhibit_clear_image_cache : 1;
460
461
462
463
464 bool_bf new_size_p : 1;
465
466
467
468 bool_bf was_invisible : 1;
469
470
471
472
473
474 bool_bf select_mini_window_flag : 1;
475
476
477
478
479
480
481
482 int change_stamp;
483
484
485
486
487
488
489 ptrdiff_t number_of_windows;
490
491
492 int tab_bar_lines;
493
494
495 int tab_bar_height;
496
497 int n_tab_bar_rows;
498 int n_tab_bar_items;
499
500
501 int tool_bar_lines;
502
503
504 int tool_bar_height;
505
506 int n_tool_bar_rows;
507 int n_tool_bar_items;
508
509
510 char *decode_mode_spec_buffer;
511
512
513
514 int *insert_line_cost;
515
516 int *delete_line_cost;
517
518 int *insert_n_lines_cost;
519
520 int *delete_n_lines_cost;
521
522
523
524 int text_cols, text_lines;
525
526 int text_width, text_height;
527
528
529
530 int total_cols, total_lines;
531
532 int pixel_width, pixel_height;
533
534
535 int new_width, new_height;
536
537
538 int left_pos, top_pos;
539
540
541 int win_gravity;
542
543
544 int size_hint_flags;
545
546
547 int border_width;
548
549
550
551 int child_frame_border_width;
552
553
554
555
556 int internal_border_width;
557
558
559 int right_divider_width, bottom_divider_width;
560
561
562 int left_fringe_width, right_fringe_width;
563
564
565
566 int fringe_cols;
567
568
569 int menu_bar_lines;
570
571
572 int menu_bar_height;
573
574
575 int column_width;
576
577
578 int line_height;
579
580
581
582 struct terminal *terminal;
583
584
585
586
587 union output_data
588 {
589 struct tty_output *tty;
590 struct x_output *x;
591 struct w32_output *w32;
592 struct ns_output *ns;
593 struct pgtk_output *pgtk;
594 struct haiku_output *haiku;
595 }
596 output_data;
597
598
599 struct font_driver_list *font_driver_list;
600
601 #if defined (HAVE_X_WINDOWS)
602
603 int wait_event_type;
604 #endif
605
606
607
608 enum text_cursor_kinds desired_cursor;
609
610
611 int cursor_width;
612
613
614
615 enum text_cursor_kinds blink_off_cursor;
616
617
618 int blink_off_cursor_width;
619
620
621
622
623
624
625 int config_scroll_bar_width;
626 int config_scroll_bar_cols;
627
628
629
630
631
632
633 int config_scroll_bar_height;
634 int config_scroll_bar_lines;
635
636
637 intmax_t cost_calculation_baud_rate;
638
639
640
641
642
643 double alpha[2];
644
645
646 double alpha_background;
647
648
649
650
651 double gamma;
652
653
654 int extra_line_spacing;
655
656
657 unsigned long background_pixel;
658 unsigned long foreground_pixel;
659
660 #ifdef NS_IMPL_COCOA
661
662 enum ns_appearance_type ns_appearance;
663 bool_bf ns_transparent_titlebar;
664 #endif
665 } GCALIGNED_STRUCT;
666
667
668
669 INLINE void
670 fset_buffer_list (struct frame *f, Lisp_Object val)
671 {
672 f->buffer_list = val;
673 }
674 INLINE void
675 fset_buried_buffer_list (struct frame *f, Lisp_Object val)
676 {
677 f->buried_buffer_list = val;
678 }
679 INLINE void
680 fset_condemned_scroll_bars (struct frame *f, Lisp_Object val)
681 {
682 f->condemned_scroll_bars = val;
683 }
684 INLINE void
685 fset_face_hash_table (struct frame *f, Lisp_Object val)
686 {
687 f->face_hash_table = val;
688 }
689 #if defined (HAVE_WINDOW_SYSTEM)
690 INLINE void
691 fset_parent_frame (struct frame *f, Lisp_Object val)
692 {
693 f->parent_frame = val;
694 }
695 #endif
696 INLINE void
697 fset_focus_frame (struct frame *f, Lisp_Object val)
698 {
699 f->focus_frame = val;
700 }
701 INLINE void
702 fset_icon_name (struct frame *f, Lisp_Object val)
703 {
704 f->icon_name = val;
705 }
706 INLINE void
707 fset_menu_bar_items (struct frame *f, Lisp_Object val)
708 {
709 f->menu_bar_items = val;
710 }
711 INLINE void
712 fset_menu_bar_vector (struct frame *f, Lisp_Object val)
713 {
714 f->menu_bar_vector = val;
715 }
716 #if defined (HAVE_X_WINDOWS) && ! defined (USE_X_TOOLKIT) && ! defined (USE_GTK)
717 INLINE void
718 fset_menu_bar_window (struct frame *f, Lisp_Object val)
719 {
720 f->menu_bar_window = val;
721 }
722 #endif
723 INLINE void
724 fset_name (struct frame *f, Lisp_Object val)
725 {
726 f->name = val;
727 }
728 INLINE void
729 fset_param_alist (struct frame *f, Lisp_Object val)
730 {
731 f->param_alist = val;
732 }
733 INLINE void
734 fset_root_window (struct frame *f, Lisp_Object val)
735 {
736 f->root_window = val;
737 }
738 INLINE void
739 fset_scroll_bars (struct frame *f, Lisp_Object val)
740 {
741 f->scroll_bars = val;
742 }
743 INLINE void
744 fset_selected_window (struct frame *f, Lisp_Object val)
745 {
746 f->selected_window = val;
747 }
748 INLINE void
749 fset_old_selected_window (struct frame *f, Lisp_Object val)
750 {
751 f->old_selected_window = val;
752 }
753 INLINE void
754 fset_title (struct frame *f, Lisp_Object val)
755 {
756 f->title = val;
757 }
758 INLINE void
759 fset_tab_bar_items (struct frame *f, Lisp_Object val)
760 {
761 f->tab_bar_items = val;
762 }
763 #if defined (HAVE_WINDOW_SYSTEM)
764 INLINE void
765 fset_tab_bar_window (struct frame *f, Lisp_Object val)
766 {
767 f->tab_bar_window = val;
768 }
769 INLINE void
770 fset_current_tab_bar_string (struct frame *f, Lisp_Object val)
771 {
772 f->current_tab_bar_string = val;
773 }
774 INLINE void
775 fset_desired_tab_bar_string (struct frame *f, Lisp_Object val)
776 {
777 f->desired_tab_bar_string = val;
778 }
779 #endif
780 INLINE void
781 fset_tool_bar_items (struct frame *f, Lisp_Object val)
782 {
783 f->tool_bar_items = val;
784 }
785 #ifdef USE_GTK
786 INLINE void
787 fset_tool_bar_position (struct frame *f, Lisp_Object val)
788 {
789 f->tool_bar_position = val;
790 }
791 #endif
792 #if defined (HAVE_WINDOW_SYSTEM) && ! defined (HAVE_EXT_TOOL_BAR)
793 INLINE void
794 fset_tool_bar_window (struct frame *f, Lisp_Object val)
795 {
796 f->tool_bar_window = val;
797 }
798 INLINE void
799 fset_current_tool_bar_string (struct frame *f, Lisp_Object val)
800 {
801 f->current_tool_bar_string = val;
802 }
803 INLINE void
804 fset_desired_tool_bar_string (struct frame *f, Lisp_Object val)
805 {
806 f->desired_tool_bar_string = val;
807 }
808 #endif
809
810 INLINE double
811 NUMVAL (Lisp_Object x)
812 {
813 return NUMBERP (x) ? XFLOATINT (x) : -1;
814 }
815
816 INLINE double
817 default_pixels_per_inch_x (void)
818 {
819 Lisp_Object v = (CONSP (Vdisplay_pixels_per_inch)
820 ? XCAR (Vdisplay_pixels_per_inch)
821 : Vdisplay_pixels_per_inch);
822 return NUMVAL (v) > 0 ? NUMVAL (v) : 72.0;
823 }
824
825 INLINE double
826 default_pixels_per_inch_y (void)
827 {
828 Lisp_Object v = (CONSP (Vdisplay_pixels_per_inch)
829 ? XCDR (Vdisplay_pixels_per_inch)
830 : Vdisplay_pixels_per_inch);
831 return NUMVAL (v) > 0 ? NUMVAL (v) : 72.0;
832 }
833
834 #define FRAME_KBOARD(f) ((f)->terminal->kboard)
835
836
837 #define FRAME_IMAGE_CACHE(F) ((F)->terminal->image_cache)
838
839 #define XFRAME(p) \
840 (eassert (FRAMEP (p)), XUNTAG (p, Lisp_Vectorlike, struct frame))
841 #define XSETFRAME(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_FRAME))
842
843
844 #define WINDOW_FRAME(w) ((w)->frame)
845
846
847 #define FRAME_INITIAL_P(f) ((f)->output_method == output_initial)
848 #define FRAME_TERMCAP_P(f) ((f)->output_method == output_termcap)
849 #define FRAME_X_P(f) ((f)->output_method == output_x_window)
850 #ifndef HAVE_NTGUI
851 #define FRAME_W32_P(f) false
852 #else
853 #define FRAME_W32_P(f) ((f)->output_method == output_w32)
854 #endif
855 #ifndef MSDOS
856 #define FRAME_MSDOS_P(f) false
857 #else
858 #define FRAME_MSDOS_P(f) ((f)->output_method == output_msdos_raw)
859 #endif
860 #ifndef HAVE_NS
861 #define FRAME_NS_P(f) false
862 #else
863 #define FRAME_NS_P(f) ((f)->output_method == output_ns)
864 #endif
865 #ifndef HAVE_PGTK
866 #define FRAME_PGTK_P(f) false
867 #else
868 #define FRAME_PGTK_P(f) ((f)->output_method == output_pgtk)
869 #endif
870 #ifndef HAVE_HAIKU
871 #define FRAME_HAIKU_P(f) false
872 #else
873 #define FRAME_HAIKU_P(f) ((f)->output_method == output_haiku)
874 #endif
875
876
877
878 #ifdef HAVE_X_WINDOWS
879 #define FRAME_WINDOW_P(f) FRAME_X_P (f)
880 #endif
881 #ifdef HAVE_NTGUI
882 #define FRAME_WINDOW_P(f) FRAME_W32_P (f)
883 #endif
884 #ifdef HAVE_NS
885 #define FRAME_WINDOW_P(f) FRAME_NS_P(f)
886 #endif
887 #ifdef HAVE_PGTK
888 #define FRAME_WINDOW_P(f) FRAME_PGTK_P(f)
889 #endif
890 #ifdef HAVE_HAIKU
891 #define FRAME_WINDOW_P(f) FRAME_HAIKU_P (f)
892 #endif
893 #ifndef FRAME_WINDOW_P
894 #define FRAME_WINDOW_P(f) ((void) (f), false)
895 #endif
896
897
898
899 #ifdef HAVE_WINDOW_SYSTEM
900
901 #define FRAME_RES_X(f) \
902 (eassert (FRAME_WINDOW_P (f)), FRAME_DISPLAY_INFO (f)->resx)
903 #define FRAME_RES_Y(f) \
904 (eassert (FRAME_WINDOW_P (f)), FRAME_DISPLAY_INFO (f)->resy)
905
906 #else
907
908
909
910 #define FRAME_RES_X(f) default_pixels_per_inch_x ()
911 #define FRAME_RES_Y(f) default_pixels_per_inch_y ()
912
913 #endif
914
915
916
917
918
919 #ifdef HAVE_WINDOW_SYSTEM
920 # define MOUSE_HL_INFO(F) \
921 (FRAME_WINDOW_P(F) \
922 ? &FRAME_DISPLAY_INFO(F)->mouse_highlight \
923 : &(F)->output_data.tty->display_info->mouse_highlight)
924 #else
925 # define MOUSE_HL_INFO(F) \
926 (&(F)->output_data.tty->display_info->mouse_highlight)
927 #endif
928
929
930 #define FRAME_LIVE_P(f) ((f)->terminal != 0)
931
932
933 #define FRAME_MINIBUF_ONLY_P(f) \
934 EQ (FRAME_ROOT_WINDOW (f), FRAME_MINIBUF_WINDOW (f))
935
936
937
938 #define FRAME_HAS_MINIBUF_P(f) \
939 (WINDOWP (f->minibuffer_window) \
940 && XFRAME (XWINDOW (f->minibuffer_window)->frame) == f)
941
942
943 #if defined HAVE_NS
944 # define FRAME_SCALE_FACTOR(f) (FRAME_NS_P (f) ? ns_frame_scale_factor (f) : 1)
945 #elif defined HAVE_PGTK
946 # define FRAME_SCALE_FACTOR(f) (FRAME_PGTK_P (f) ? pgtk_frame_scale_factor (f) : 1)
947 #else
948 # define FRAME_SCALE_FACTOR(f) 1
949 #endif
950
951
952
953 #define FRAME_PIXEL_WIDTH(f) ((f)->pixel_width)
954 #define FRAME_PIXEL_HEIGHT(f) ((f)->pixel_height)
955 #define FRAME_TOTAL_COLS(f) ((f)->total_cols)
956 #define FRAME_TOTAL_LINES(f) ((f)->total_lines)
957
958
959
960 #define FRAME_TEXT_WIDTH(f) (f)->text_width
961 #define FRAME_TEXT_HEIGHT(f) (f)->text_height
962 #define FRAME_COLS(f) ((f)->text_cols)
963 #define FRAME_LINES(f) ((f)->text_lines)
964
965
966 #ifdef HAVE_EXT_MENU_BAR
967 #define FRAME_EXTERNAL_MENU_BAR(f) (f)->external_menu_bar
968 #else
969 #define FRAME_EXTERNAL_MENU_BAR(f) false
970 #endif
971
972
973 #define FRAME_MENU_BAR_LINES(f) (f)->menu_bar_lines
974 #define FRAME_MENU_BAR_HEIGHT(f) (f)->menu_bar_height
975
976
977 #define FRAME_TAB_BAR_LINES(f) (f)->tab_bar_lines
978 #define FRAME_TAB_BAR_HEIGHT(f) (f)->tab_bar_height
979
980
981 #ifdef HAVE_EXT_TOOL_BAR
982 #define FRAME_EXTERNAL_TOOL_BAR(f) (f)->external_tool_bar
983 #else
984 #define FRAME_EXTERNAL_TOOL_BAR(f) false
985 #endif
986
987
988 #ifdef USE_GTK
989 #define FRAME_TOOL_BAR_POSITION(f) (f)->tool_bar_position
990 #else
991 #define FRAME_TOOL_BAR_POSITION(f) ((void) (f), Qtop)
992 #endif
993
994
995 #define FRAME_TOOL_BAR_LINES(f) (f)->tool_bar_lines
996 #define FRAME_TOOL_BAR_HEIGHT(f) (f)->tool_bar_height
997
998
999 #define FRAME_TOP_MARGIN(F) \
1000 (FRAME_MENU_BAR_LINES (F) \
1001 + FRAME_TAB_BAR_LINES (F) \
1002 + FRAME_TOOL_BAR_LINES (F))
1003
1004
1005 #define FRAME_TOP_MARGIN_HEIGHT(F) \
1006 (FRAME_MENU_BAR_HEIGHT (F) \
1007 + FRAME_TAB_BAR_HEIGHT (F) \
1008 + FRAME_TOOL_BAR_HEIGHT (F))
1009
1010
1011 #define FRAME_VISIBLE_P(f) (f)->visible
1012
1013
1014 #define FRAME_OBSCURED_P(f) ((f)->visible > 1)
1015
1016
1017 #define FRAME_ICONIFIED_P(f) (f)->iconified
1018
1019
1020 #define SET_FRAME_GARBAGED(f) \
1021 (frame_garbaged = true, fset_redisplay (f), f->garbaged = true)
1022
1023
1024 #define FRAME_GARBAGED_P(f) (f)->garbaged
1025
1026
1027 #define FRAME_NO_SPLIT_P(f) (f)->no_split
1028
1029
1030 #define FRAME_WANTS_MODELINE_P(f) (f)->wants_modeline
1031
1032
1033
1034 #define FRAME_WINDOWS_FROZEN(f) (f)->frozen_window_starts
1035
1036
1037
1038 #define FRAME_WINDOW_CHANGE(f) (f)->window_change
1039
1040
1041
1042 #define FRAME_WINDOW_STATE_CHANGE(f) (f)->window_state_change
1043
1044
1045 #define FRAME_MINIBUF_WINDOW(f) f->minibuffer_window
1046
1047
1048 #define FRAME_ROOT_WINDOW(f) f->root_window
1049
1050
1051 #define FRAME_SELECTED_WINDOW(f) f->selected_window
1052
1053 #define FRAME_OLD_SELECTED_WINDOW(f) f->old_selected_window
1054
1055 #define FRAME_INSERT_COST(f) (f)->insert_line_cost
1056 #define FRAME_DELETE_COST(f) (f)->delete_line_cost
1057 #define FRAME_INSERTN_COST(f) (f)->insert_n_lines_cost
1058 #define FRAME_DELETEN_COST(f) (f)->delete_n_lines_cost
1059 #define FRAME_FOCUS_FRAME(f) f->focus_frame
1060
1061 #ifdef HAVE_WINDOW_SYSTEM
1062
1063
1064 #define FRAME_VERTICAL_SCROLL_BAR_TYPE(f) ((f)->vertical_scroll_bar_type)
1065 #define FRAME_HAS_VERTICAL_SCROLL_BARS(f) \
1066 ((f)->vertical_scroll_bar_type != vertical_scroll_bar_none)
1067 #define FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT(f) \
1068 ((f)->vertical_scroll_bar_type == vertical_scroll_bar_left)
1069 #define FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT(f) \
1070 ((f)->vertical_scroll_bar_type == vertical_scroll_bar_right)
1071 #else
1072
1073 #define FRAME_VERTICAL_SCROLL_BAR_TYPE(f) \
1074 ((void) (f), vertical_scroll_bar_none)
1075 #define FRAME_HAS_VERTICAL_SCROLL_BARS(f) ((void) (f), 0)
1076 #define FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT(f) ((void) (f), 0)
1077 #define FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT(f) ((void) (f), 0)
1078 #endif
1079
1080 #if defined (HAVE_WINDOW_SYSTEM)
1081 #define FRAME_UNDECORATED(f) ((f)->undecorated)
1082 #ifdef HAVE_NTGUI
1083 #define FRAME_OVERRIDE_REDIRECT(f) ((void) (f), 0)
1084 #else
1085 #define FRAME_OVERRIDE_REDIRECT(f) ((f)->override_redirect)
1086 #endif
1087 #define FRAME_PARENT_FRAME(f) \
1088 (NILP ((f)->parent_frame) \
1089 ? NULL \
1090 : XFRAME ((f)->parent_frame))
1091 #define FRAME_SKIP_TASKBAR(f) ((f)->skip_taskbar)
1092 #define FRAME_NO_FOCUS_ON_MAP(f) ((f)->no_focus_on_map)
1093 #define FRAME_NO_ACCEPT_FOCUS(f) ((f)->no_accept_focus)
1094 #define FRAME_NO_SPECIAL_GLYPHS(f) ((f)->no_special_glyphs)
1095 #define FRAME_Z_GROUP(f) ((f)->z_group)
1096 #define FRAME_Z_GROUP_NONE(f) ((f)->z_group == z_group_none)
1097 #define FRAME_Z_GROUP_ABOVE(f) ((f)->z_group == z_group_above)
1098 #define FRAME_Z_GROUP_ABOVE_SUSPENDED(f) \
1099 ((f)->z_group == z_group_above_suspended)
1100 #define FRAME_Z_GROUP_BELOW(f) ((f)->z_group == z_group_below)
1101 #define FRAME_TOOLTIP_P(f) ((f)->tooltip)
1102 #ifdef NS_IMPL_COCOA
1103 #define FRAME_NS_APPEARANCE(f) ((f)->ns_appearance)
1104 #define FRAME_NS_TRANSPARENT_TITLEBAR(f) ((f)->ns_transparent_titlebar)
1105 #endif
1106 #else
1107 #define FRAME_UNDECORATED(f) ((void) (f), 0)
1108 #define FRAME_OVERRIDE_REDIRECT(f) ((void) (f), 0)
1109 #define FRAME_PARENT_FRAME(f) ((void) (f), NULL)
1110 #define FRAME_SKIP_TASKBAR(f) ((void) (f), 0)
1111 #define FRAME_NO_FOCUS_ON_MAP(f) ((void) (f), 0)
1112 #define FRAME_NO_ACCEPT_FOCUS(f) ((void) (f), 0)
1113 #define FRAME_NO_SPECIAL_GLYPHS(f) ((void) (f), 0)
1114 #define FRAME_Z_GROUP(f) ((void) (f), z_group_none)
1115 #define FRAME_Z_GROUP_NONE(f) ((void) (f), true)
1116 #define FRAME_Z_GROUP_ABOVE(f) ((void) (f), false)
1117 #define FRAME_Z_GROUP_BELOW(f) ((void) (f), false)
1118 #define FRAME_TOOLTIP_P(f) ((void) f, false)
1119 #endif
1120
1121
1122 #if USE_HORIZONTAL_SCROLL_BARS
1123 #define FRAME_HAS_HORIZONTAL_SCROLL_BARS(f) \
1124 ((f)->horizontal_scroll_bars)
1125 #else
1126 #define FRAME_HAS_HORIZONTAL_SCROLL_BARS(f) ((void) (f), 0)
1127 #endif
1128
1129
1130
1131
1132 #define FRAME_CONFIG_SCROLL_BAR_WIDTH(f) ((f)->config_scroll_bar_width)
1133
1134
1135
1136
1137 #define FRAME_CONFIG_SCROLL_BAR_HEIGHT(f) ((f)->config_scroll_bar_height)
1138
1139
1140
1141
1142 #define FRAME_CONFIG_SCROLL_BAR_COLS(f) ((f)->config_scroll_bar_cols)
1143
1144
1145
1146
1147 #define FRAME_CONFIG_SCROLL_BAR_LINES(f) ((f)->config_scroll_bar_lines)
1148
1149
1150 #define FRAME_LEFT_SCROLL_BAR_AREA_WIDTH(f) \
1151 (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT (f) \
1152 ? FRAME_CONFIG_SCROLL_BAR_WIDTH (f) \
1153 : 0)
1154
1155
1156 #define FRAME_RIGHT_SCROLL_BAR_AREA_WIDTH(f) \
1157 (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT (f) \
1158 ? FRAME_CONFIG_SCROLL_BAR_WIDTH (f) \
1159 : 0)
1160
1161
1162
1163
1164
1165 #define FRAME_LEFT_SCROLL_BAR_COLS(f) \
1166 (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT (f) \
1167 ? FRAME_CONFIG_SCROLL_BAR_COLS (f) \
1168 : 0)
1169
1170
1171
1172
1173
1174 #define FRAME_RIGHT_SCROLL_BAR_COLS(f) \
1175 (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT (f) \
1176 ? FRAME_CONFIG_SCROLL_BAR_COLS (f) \
1177 : 0)
1178
1179
1180
1181 #define FRAME_SCROLL_BAR_AREA_WIDTH(f) \
1182 (FRAME_HAS_VERTICAL_SCROLL_BARS (f) \
1183 ? FRAME_CONFIG_SCROLL_BAR_WIDTH (f) \
1184 : 0)
1185
1186
1187
1188 #define FRAME_SCROLL_BAR_AREA_HEIGHT(f) \
1189 (FRAME_HAS_HORIZONTAL_SCROLL_BARS (f) \
1190 ? FRAME_CONFIG_SCROLL_BAR_HEIGHT (f) \
1191 : 0)
1192
1193
1194 #define FRAME_SCROLL_BAR_COLS(f) \
1195 (FRAME_HAS_VERTICAL_SCROLL_BARS (f) \
1196 ? FRAME_CONFIG_SCROLL_BAR_COLS (f) \
1197 : 0)
1198
1199
1200 #define FRAME_SCROLL_BAR_LINES(f) \
1201 (FRAME_HAS_HORIZONTAL_SCROLL_BARS (f) \
1202 ? FRAME_CONFIG_SCROLL_BAR_LINES (f) \
1203 : 0)
1204
1205
1206 #define FRAME_CURSOR_X_LIMIT(f) \
1207 (FRAME_COLS (f) + FRAME_LEFT_SCROLL_BAR_COLS (f))
1208
1209
1210 #define FRAME_SCROLL_BARS(f) (f->scroll_bars)
1211 #define FRAME_CONDEMNED_SCROLL_BARS(f) (f->condemned_scroll_bars)
1212
1213 #define FRAME_MENU_BAR_ITEMS(f) (f->menu_bar_items)
1214 #define FRAME_COST_BAUD_RATE(f) ((f)->cost_calculation_baud_rate)
1215
1216 #define FRAME_DESIRED_CURSOR(f) ((f)->desired_cursor)
1217 #define FRAME_BLINK_OFF_CURSOR(f) ((f)->blink_off_cursor)
1218 #define FRAME_CURSOR_WIDTH(f) ((f)->cursor_width)
1219 #define FRAME_BLINK_OFF_CURSOR_WIDTH(f) ((f)->blink_off_cursor_width)
1220
1221 #define FRAME_FOREGROUND_PIXEL(f) ((f)->foreground_pixel)
1222 #define FRAME_BACKGROUND_PIXEL(f) ((f)->background_pixel)
1223
1224
1225 #define FRAME_FACE_CACHE(F) (F)->face_cache
1226
1227
1228
1229
1230
1231 #define FRAME_MESSAGE_BUF_SIZE(f) (((int) FRAME_COLS (f)) * 4)
1232
1233 #define CHECK_FRAME(x) \
1234 CHECK_TYPE (FRAMEP (x), Qframep, x)
1235
1236 #define CHECK_LIVE_FRAME(x) \
1237 CHECK_TYPE (FRAMEP (x) && FRAME_LIVE_P (XFRAME (x)), Qframe_live_p, x)
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250 #define FOR_EACH_FRAME(list_var, frame_var) \
1251 for ((list_var) = Vframe_list; \
1252 (CONSP (list_var) \
1253 && (frame_var = XCAR (list_var), true)); \
1254 list_var = XCDR (list_var))
1255
1256
1257 #define FRAME_MOUSE_UPDATE(frame) \
1258 do { \
1259 Mouse_HLInfo *hlinfo = MOUSE_HL_INFO (frame); \
1260 if (frame == hlinfo->mouse_face_mouse_frame) \
1261 { \
1262 block_input (); \
1263 note_mouse_highlight (hlinfo->mouse_face_mouse_frame, \
1264 hlinfo->mouse_face_mouse_x, \
1265 hlinfo->mouse_face_mouse_y); \
1266 unblock_input (); \
1267 } \
1268 } while (false)
1269
1270
1271 #define AUTO_FRAME_ARG(name, parameter, value) \
1272 AUTO_LIST1 (name, AUTO_CONS_EXPR (parameter, value))
1273
1274
1275 extern bool frame_garbaged;
1276
1277
1278
1279
1280
1281 INLINE void
1282 SET_FRAME_VISIBLE (struct frame *f, int v)
1283 {
1284 eassert (0 <= v && v <= 2);
1285 if (v)
1286 {
1287 if (v == 1 && f->visible != 1)
1288 redisplay_other_windows ();
1289 if (FRAME_GARBAGED_P (f))
1290 frame_garbaged = true;
1291 }
1292 f->visible = v;
1293 }
1294
1295
1296 INLINE void
1297 SET_FRAME_ICONIFIED (struct frame *f, int i)
1298 {
1299 #ifdef HAVE_WINDOW_SYSTEM
1300 Lisp_Object frame;
1301 #endif
1302
1303 eassert (0 <= (i) && (i) <= 1);
1304
1305 f->iconified = i;
1306
1307 #ifdef HAVE_WINDOW_SYSTEM
1308
1309
1310
1311
1312 XSETFRAME (frame, f);
1313
1314 if (FRAME_WINDOW_P (f))
1315 gui_consider_frame_title (frame);
1316 #endif
1317 }
1318
1319 extern Lisp_Object selected_frame;
1320 extern Lisp_Object old_selected_frame;
1321
1322 extern int frame_default_tab_bar_height;
1323
1324 #ifndef HAVE_EXT_TOOL_BAR
1325 extern int frame_default_tool_bar_height;
1326 #endif
1327
1328 #ifdef HAVE_WINDOW_SYSTEM
1329 # define WINDOW_SYSTEM_RETURN
1330 #else
1331 # define WINDOW_SYSTEM_RETURN _Noreturn ATTRIBUTE_COLD
1332 #endif
1333
1334 extern WINDOW_SYSTEM_RETURN struct frame *
1335 decode_window_system_frame (Lisp_Object);
1336 extern struct frame *decode_live_frame (Lisp_Object);
1337 extern struct frame *decode_any_frame (Lisp_Object);
1338 extern struct frame *make_initial_frame (void);
1339 extern struct frame *make_frame (bool);
1340 #ifdef HAVE_WINDOW_SYSTEM
1341 extern struct frame *make_minibuffer_frame (void);
1342 extern struct frame *make_frame_without_minibuffer (Lisp_Object,
1343 struct kboard *,
1344 Lisp_Object);
1345 extern bool display_available (void);
1346 #endif
1347
1348 INLINE bool
1349 window_system_available (struct frame *f)
1350 {
1351 #ifdef HAVE_WINDOW_SYSTEM
1352 return f ? FRAME_WINDOW_P (f) || FRAME_MSDOS_P (f) : display_available ();
1353 #else
1354 return false;
1355 #endif
1356 }
1357
1358 extern WINDOW_SYSTEM_RETURN void check_window_system (struct frame *);
1359 extern void frame_make_pointer_invisible (struct frame *);
1360 extern void frame_make_pointer_visible (struct frame *);
1361 extern Lisp_Object delete_frame (Lisp_Object, Lisp_Object);
1362 extern bool frame_inhibit_resize (struct frame *, bool, Lisp_Object);
1363 extern void adjust_frame_size (struct frame *, int, int, int, bool,
1364 Lisp_Object);
1365 extern Lisp_Object mouse_position (bool);
1366 extern void frame_size_history_plain (struct frame *, Lisp_Object);
1367 extern void frame_size_history_extra (struct frame *, Lisp_Object,
1368 int, int, int, int, int, int);
1369 extern Lisp_Object Vframe_list;
1370
1371
1372
1373
1374 #define SELECTED_FRAME() \
1375 ((FRAMEP (selected_frame) \
1376 && FRAME_LIVE_P (XFRAME (selected_frame))) \
1377 ? XFRAME (selected_frame) \
1378 : (emacs_abort (), (struct frame *) 0))
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388 #define FRAME_LINE_HEIGHT(F) ((F)->line_height)
1389
1390
1391
1392 #define FRAME_COLUMN_WIDTH(F) ((F)->column_width)
1393
1394
1395
1396 INLINE int
1397 frame_dimension (int x)
1398 {
1399 #ifdef HAVE_WINDOW_SYSTEM
1400 return x;
1401 #else
1402 return 0;
1403 #endif
1404 }
1405
1406
1407
1408
1409
1410
1411 INLINE int
1412 FRAME_FRINGE_COLS (struct frame *f)
1413 {
1414 return frame_dimension (f->fringe_cols);
1415 }
1416
1417
1418
1419 INLINE int
1420 FRAME_LEFT_FRINGE_WIDTH (struct frame *f)
1421 {
1422 return frame_dimension (f->left_fringe_width);
1423 }
1424 INLINE int
1425 FRAME_RIGHT_FRINGE_WIDTH (struct frame *f)
1426 {
1427 return frame_dimension (f->right_fringe_width);
1428 }
1429
1430
1431
1432 INLINE int
1433 FRAME_TOTAL_FRINGE_WIDTH (struct frame *f)
1434 {
1435 return FRAME_LEFT_FRINGE_WIDTH (f) + FRAME_RIGHT_FRINGE_WIDTH (f);
1436 }
1437
1438 INLINE int
1439 FRAME_CHILD_FRAME_BORDER_WIDTH (struct frame *f)
1440 {
1441 return frame_dimension (f->child_frame_border_width);
1442 }
1443
1444
1445
1446
1447 INLINE int
1448 FRAME_INTERNAL_BORDER_WIDTH (struct frame *f)
1449 {
1450 #ifdef HAVE_WINDOW_SYSTEM
1451 return (FRAME_PARENT_FRAME(f)
1452 ? (FRAME_CHILD_FRAME_BORDER_WIDTH(f) >= 0
1453 ? FRAME_CHILD_FRAME_BORDER_WIDTH(f)
1454 : frame_dimension (f->internal_border_width))
1455 : frame_dimension (f->internal_border_width));
1456 #else
1457 return frame_dimension (f->internal_border_width);
1458 #endif
1459 }
1460
1461
1462 INLINE int
1463 FRAME_RIGHT_DIVIDER_WIDTH (struct frame *f)
1464 {
1465 return frame_dimension (f->right_divider_width);
1466 }
1467
1468 INLINE int
1469 FRAME_BOTTOM_DIVIDER_WIDTH (struct frame *f)
1470 {
1471 return frame_dimension (f->bottom_divider_width);
1472 }
1473
1474
1475
1476 INLINE struct face *
1477 FACE_FROM_ID (struct frame *f, int id)
1478 {
1479 eassert (0 <= id && id < FRAME_FACE_CACHE (f)->used);
1480 return FRAME_FACE_CACHE (f)->faces_by_id[id];
1481 }
1482
1483
1484
1485
1486 INLINE struct face *
1487 FACE_FROM_ID_OR_NULL (struct frame *f, int id)
1488 {
1489 int used = FRAME_FACE_CACHE (f)->used;
1490 eassume (0 <= used);
1491 return 0 <= id && id < used ? FRAME_FACE_CACHE (f)->faces_by_id[id] : NULL;
1492 }
1493
1494 #ifdef HAVE_WINDOW_SYSTEM
1495
1496
1497
1498 INLINE struct image *
1499 IMAGE_FROM_ID (struct frame *f, int id)
1500 {
1501 eassert (0 <= id && id < FRAME_IMAGE_CACHE (f)->used);
1502 return FRAME_IMAGE_CACHE (f)->images[id];
1503 }
1504
1505
1506
1507
1508 INLINE struct image *
1509 IMAGE_OPT_FROM_ID (struct frame *f, int id)
1510 {
1511 int used = FRAME_IMAGE_CACHE (f)->used;
1512 eassume (0 <= used);
1513 return 0 <= id && id < used ? FRAME_IMAGE_CACHE (f)->images[id] : NULL;
1514 }
1515 #endif
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528 #define FRAME_PIXEL_X_FROM_CANON_X(F, X) \
1529 ((int) (XFLOATINT (X) * FRAME_COLUMN_WIDTH (F)))
1530
1531
1532
1533
1534 #define FRAME_PIXEL_Y_FROM_CANON_Y(F, Y) \
1535 ((int) (XFLOATINT (Y) * FRAME_LINE_HEIGHT (F)))
1536
1537
1538
1539
1540
1541 #define FRAME_CANON_X_FROM_PIXEL_X(F, X) \
1542 ((X) % FRAME_COLUMN_WIDTH (F) != 0 \
1543 ? make_float ((double) (X) / FRAME_COLUMN_WIDTH (F)) \
1544 : make_fixnum ((X) / FRAME_COLUMN_WIDTH (F)))
1545
1546
1547
1548
1549
1550 #define FRAME_CANON_Y_FROM_PIXEL_Y(F, Y) \
1551 ((Y) % FRAME_LINE_HEIGHT (F) \
1552 ? make_float ((double) (Y) / FRAME_LINE_HEIGHT (F)) \
1553 : make_fixnum ((Y) / FRAME_LINE_HEIGHT (F)))
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563 #define FRAME_LINE_TO_PIXEL_Y(f, row) \
1564 (((row) < FRAME_TOP_MARGIN (f) ? 0 : FRAME_INTERNAL_BORDER_WIDTH (f)) \
1565 + (row) * FRAME_LINE_HEIGHT (f))
1566
1567 #define FRAME_COL_TO_PIXEL_X(f, col) \
1568 (FRAME_INTERNAL_BORDER_WIDTH (f) \
1569 + (col) * FRAME_COLUMN_WIDTH (f))
1570
1571
1572
1573 #define FRAME_TEXT_COLS_TO_PIXEL_WIDTH(f, cols) \
1574 ((cols) * FRAME_COLUMN_WIDTH (f) \
1575 + FRAME_SCROLL_BAR_AREA_WIDTH (f) \
1576 + FRAME_TOTAL_FRINGE_WIDTH (f) \
1577 + 2 * FRAME_INTERNAL_BORDER_WIDTH (f))
1578
1579 #define FRAME_TEXT_LINES_TO_PIXEL_HEIGHT(f, lines) \
1580 ((lines) * FRAME_LINE_HEIGHT (f) \
1581 + FRAME_TOP_MARGIN_HEIGHT (f) \
1582 + FRAME_SCROLL_BAR_AREA_HEIGHT (f) \
1583 + 2 * FRAME_INTERNAL_BORDER_WIDTH (f))
1584
1585
1586
1587 #define FRAME_PIXEL_Y_TO_LINE(f, y) \
1588 (((y) < FRAME_TOP_MARGIN_HEIGHT (f) \
1589 ? (y) \
1590 : ((y) < (FRAME_TOP_MARGIN_HEIGHT (f) \
1591 + FRAME_INTERNAL_BORDER_WIDTH (f)) \
1592 ? (y) - (FRAME_TOP_MARGIN_HEIGHT (f) \
1593 + FRAME_INTERNAL_BORDER_WIDTH (f) \
1594 \
1595 + FRAME_LINE_HEIGHT (f) - 1) \
1596 : (y) - FRAME_INTERNAL_BORDER_WIDTH (f))) \
1597 / FRAME_LINE_HEIGHT (f))
1598
1599 #define FRAME_PIXEL_X_TO_COL(f, x) \
1600 (((x) - FRAME_INTERNAL_BORDER_WIDTH (f)) \
1601 / FRAME_COLUMN_WIDTH (f))
1602
1603
1604
1605 #define FRAME_PIXEL_WIDTH_TO_TEXT_COLS(f, width) \
1606 (((width) \
1607 - FRAME_TOTAL_FRINGE_WIDTH (f) \
1608 - FRAME_SCROLL_BAR_AREA_WIDTH (f) \
1609 - 2 * FRAME_INTERNAL_BORDER_WIDTH (f)) \
1610 / FRAME_COLUMN_WIDTH (f))
1611
1612 #define FRAME_PIXEL_HEIGHT_TO_TEXT_LINES(f, height) \
1613 (((height) \
1614 - FRAME_TOP_MARGIN_HEIGHT (f) \
1615 - FRAME_SCROLL_BAR_AREA_HEIGHT (f) \
1616 - 2 * FRAME_INTERNAL_BORDER_WIDTH (f)) \
1617 / FRAME_LINE_HEIGHT (f))
1618
1619
1620
1621 #define FRAME_TEXT_TO_PIXEL_WIDTH(f, width) \
1622 ((width) \
1623 + FRAME_SCROLL_BAR_AREA_WIDTH (f) \
1624 + FRAME_TOTAL_FRINGE_WIDTH (f) \
1625 + 2 * FRAME_INTERNAL_BORDER_WIDTH (f))
1626
1627 #define FRAME_TEXT_TO_PIXEL_HEIGHT(f, height) \
1628 ((height) \
1629 + FRAME_TOP_MARGIN_HEIGHT (f) \
1630 + FRAME_SCROLL_BAR_AREA_HEIGHT (f) \
1631 + 2 * FRAME_INTERNAL_BORDER_WIDTH (f))
1632
1633
1634
1635 #define FRAME_PIXEL_TO_TEXT_WIDTH(f, width) \
1636 ((width) \
1637 - FRAME_SCROLL_BAR_AREA_WIDTH (f) \
1638 - FRAME_TOTAL_FRINGE_WIDTH (f) \
1639 - 2 * FRAME_INTERNAL_BORDER_WIDTH (f))
1640
1641 #define FRAME_PIXEL_TO_TEXT_HEIGHT(f, height) \
1642 ((height) \
1643 - FRAME_TOP_MARGIN_HEIGHT (f) \
1644 - FRAME_SCROLL_BAR_AREA_HEIGHT (f) \
1645 - 2 * FRAME_INTERNAL_BORDER_WIDTH (f))
1646
1647 #define FRAME_INNER_WIDTH(f) \
1648 (FRAME_PIXEL_WIDTH (f) \
1649 - 2 * FRAME_INTERNAL_BORDER_WIDTH (f))
1650
1651 #define FRAME_INNER_HEIGHT(f) \
1652 (FRAME_PIXEL_HEIGHT (f) \
1653 - FRAME_TOP_MARGIN_HEIGHT (f) \
1654 - 2 * FRAME_INTERNAL_BORDER_WIDTH (f))
1655
1656
1657 #define FRAME_SMALLEST_CHAR_WIDTH(f) \
1658 FRAME_DISPLAY_INFO (f)->smallest_char_width
1659
1660
1661 #define FRAME_SMALLEST_FONT_HEIGHT(f) \
1662 FRAME_DISPLAY_INFO (f)->smallest_font_height
1663
1664
1665
1666
1667
1668 #ifdef HAVE_WINDOW_SYSTEM
1669
1670
1671 #define EMACS_CLASS "Emacs"
1672
1673 extern void gui_set_frame_parameters_1 (struct frame *, Lisp_Object, bool);
1674 extern void gui_set_frame_parameters (struct frame *, Lisp_Object);
1675 extern void gui_set_fullscreen (struct frame *, Lisp_Object, Lisp_Object);
1676 extern void gui_set_line_spacing (struct frame *, Lisp_Object, Lisp_Object);
1677 extern void gui_set_screen_gamma (struct frame *, Lisp_Object, Lisp_Object);
1678 extern void gui_set_font (struct frame *, Lisp_Object, Lisp_Object);
1679 extern void gui_set_font_backend (struct frame *, Lisp_Object, Lisp_Object);
1680 extern void gui_set_left_fringe (struct frame *, Lisp_Object, Lisp_Object);
1681 extern void gui_set_right_fringe (struct frame *, Lisp_Object, Lisp_Object);
1682 extern void gui_set_border_width (struct frame *, Lisp_Object, Lisp_Object);
1683 extern void gui_set_right_divider_width (struct frame *, Lisp_Object,
1684 Lisp_Object);
1685 extern void gui_set_bottom_divider_width (struct frame *, Lisp_Object,
1686 Lisp_Object);
1687 extern void gui_set_visibility (struct frame *, Lisp_Object, Lisp_Object);
1688 extern void gui_set_autoraise (struct frame *, Lisp_Object, Lisp_Object);
1689 extern void gui_set_autolower (struct frame *, Lisp_Object, Lisp_Object);
1690 extern void gui_set_unsplittable (struct frame *, Lisp_Object, Lisp_Object);
1691 extern void gui_set_vertical_scroll_bars (struct frame *, Lisp_Object, Lisp_Object);
1692 extern void gui_set_horizontal_scroll_bars (struct frame *, Lisp_Object, Lisp_Object);
1693 extern void gui_set_scroll_bar_width (struct frame *, Lisp_Object, Lisp_Object);
1694 extern void gui_set_scroll_bar_height (struct frame *, Lisp_Object, Lisp_Object);
1695
1696 extern long gui_figure_window_size (struct frame *, Lisp_Object, bool, bool);
1697
1698 extern void gui_set_alpha (struct frame *, Lisp_Object, Lisp_Object);
1699 extern void gui_set_alpha_background (struct frame *, Lisp_Object, Lisp_Object);
1700 extern void gui_set_no_special_glyphs (struct frame *, Lisp_Object, Lisp_Object);
1701
1702 extern void validate_x_resource_name (void);
1703
1704 extern Lisp_Object gui_display_get_resource (Display_Info *,
1705 Lisp_Object attribute,
1706 Lisp_Object class,
1707 Lisp_Object component,
1708 Lisp_Object subclass);
1709
1710 extern void set_frame_menubar (struct frame *f, bool deep_p);
1711 extern void frame_set_mouse_pixel_position (struct frame *f, int pix_x, int pix_y);
1712 extern void free_frame_menubar (struct frame *);
1713 extern bool frame_ancestor_p (struct frame *af, struct frame *df);
1714 extern enum internal_border_part frame_internal_border_part (struct frame *f, int x, int y);
1715
1716 #if defined HAVE_X_WINDOWS
1717 extern void x_wm_set_icon_position (struct frame *, int, int);
1718 #if !defined USE_X_TOOLKIT
1719 extern const char *x_get_resource_string (const char *, const char *);
1720 #endif
1721 extern void x_sync (struct frame *);
1722 #endif
1723
1724 #if !defined (HAVE_NS) && !defined (HAVE_PGTK)
1725
1726
1727
1728 INLINE void
1729 gui_set_bitmap_icon (struct frame *f)
1730 {
1731 Lisp_Object obj = assq_no_quit (Qicon_type, f->param_alist);
1732
1733 if (CONSP (obj) && !NILP (XCDR (obj))
1734 && FRAME_TERMINAL (f)->set_bitmap_icon_hook)
1735 FRAME_TERMINAL (f)->set_bitmap_icon_hook (f, XCDR (obj));
1736 }
1737
1738 #endif
1739 #endif
1740
1741 INLINE void
1742 flush_frame (struct frame *f)
1743 {
1744 struct redisplay_interface *rif = FRAME_RIF (f);
1745
1746 if (rif && rif->flush_display)
1747 rif->flush_display (f);
1748 }
1749
1750
1751
1752
1753
1754 #ifdef HAVE_WINDOW_SYSTEM
1755
1756 struct MonitorInfo {
1757 Emacs_Rectangle geom, work;
1758 int mm_width, mm_height;
1759 char *name;
1760 #ifdef HAVE_PGTK
1761 double scale_factor;
1762 #endif
1763 };
1764
1765 extern void free_monitors (struct MonitorInfo *monitors, int n_monitors);
1766 extern Lisp_Object make_monitor_attribute_list (struct MonitorInfo *monitors,
1767 int n_monitors,
1768 int primary_monitor,
1769 Lisp_Object monitor_frames,
1770 const char *source);
1771
1772 #endif
1773
1774
1775 INLINE_HEADER_END
1776
1777
1778
1779
1780 #if ! USE_HORIZONTAL_SCROLL_BARS && GNUC_PREREQ (4, 6, 0)
1781 # pragma GCC diagnostic ignored "-Wsuggest-attribute=const"
1782 #endif
1783
1784 #endif