comparison src/macterm.h @ 65911:a86e9a781ba7

(mac_term_init): Add types to extern. (struct mac_output): Remove members mWP and pending_menu_activation. Put members scroll_bar_foreground_pixel and scroll_bar_background_pixel in #if 0. (FRAME_MAC_WINDOW, FRAME_X_WINDOW): Use window_desc.
author YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
date Sat, 08 Oct 2005 02:28:37 +0000
parents a5c9f3938a21
children 3d2a18d0f5dc 08b4dd6a6e87 5e2d3828e89f
comparison
equal deleted inserted replaced
65910:a53616277ba6 65911:a86e9a781ba7
37 #define BLUE16_FROM_ULONG(color) (BLUE_FROM_ULONG(color) * 0x101) 37 #define BLUE16_FROM_ULONG(color) (BLUE_FROM_ULONG(color) * 0x101)
38 38
39 #define BLACK_PIX_DEFAULT(f) RGB_TO_ULONG(0,0,0) 39 #define BLACK_PIX_DEFAULT(f) RGB_TO_ULONG(0,0,0)
40 #define WHITE_PIX_DEFAULT(f) RGB_TO_ULONG(255,255,255) 40 #define WHITE_PIX_DEFAULT(f) RGB_TO_ULONG(255,255,255)
41 41
42 #define FONT_WIDTH(f) ((f)->max_bounds.width) 42 #define FONT_WIDTH(f) ((f)->max_bounds.width)
43 #define FONT_HEIGHT(f) ((f)->ascent + (f)->descent) 43 #define FONT_HEIGHT(f) ((f)->ascent + (f)->descent)
44 #define FONT_BASE(f) ((f)->ascent) 44 #define FONT_BASE(f) ((f)->ascent)
45 #define FONT_DESCENT(f) ((f)->descent) 45 #define FONT_DESCENT(f) ((f)->descent)
46 46
47 #define FONT_MAX_WIDTH(f) FONT_WIDTH(f) /* fix later */ 47 #define FONT_MAX_WIDTH(f) FONT_WIDTH(f) /* fix later */
48 48
80 int n_planes; 80 int n_planes;
81 81
82 /* Whether the screen supports color */ 82 /* Whether the screen supports color */
83 int color_p; 83 int color_p;
84 84
85 #if 0
86 /* Number of bits per pixel on this screen. */
87 int n_cbits;
88 #endif
89
90 /* Dimensions of this screen. */ 85 /* Dimensions of this screen. */
91 int height, width; 86 int height, width;
92 #if 0
93 int height_in,width_in;
94 #endif
95 87
96 /* Mask of things that cause the mouse to be grabbed. */ 88 /* Mask of things that cause the mouse to be grabbed. */
97 int grabbed; 89 int grabbed;
98 90
99 #if 0 91 #if 0
109 Cursor vertical_scroll_bar_cursor; 101 Cursor vertical_scroll_bar_cursor;
110 102
111 /* Resource data base */ 103 /* Resource data base */
112 XrmDatabase xrdb; 104 XrmDatabase xrdb;
113 105
114 #if 0
115 /* color palette information. */
116 int has_palette;
117 struct w32_palette_entry * color_list;
118 unsigned num_colors;
119 HPALETTE palette;
120
121 /* deferred action flags checked when starting frame update. */
122 int regen_palette;
123
124 /* Keystroke that has been faked by Emacs and will be ignored when
125 received; value is reset after key is received. */
126 int faked_key;
127
128 #endif
129
130 /* A table of all the fonts we have already loaded. */ 106 /* A table of all the fonts we have already loaded. */
131 struct font_info *font_table; 107 struct font_info *font_table;
132 108
133 /* The current capacity of font_table. */ 109 /* The current capacity of font_table. */
134 int font_table_size; 110 int font_table_size;
135 111
136 /* The number of fonts actually stored in the font table.
137 font_table[n] is used and valid iff 0 <= n < n_fonts. 0 <=
138 n_fonts <= font_table_size. and font_table[i].name != 0. */
139 int n_fonts;
140
141 /* Minimum width over all characters in all fonts in font_table. */ 112 /* Minimum width over all characters in all fonts in font_table. */
142 int smallest_char_width; 113 int smallest_char_width;
143 114
144 /* Minimum font height over all fonts in font_table. */ 115 /* Minimum font height over all fonts in font_table. */
145 int smallest_font_height; 116 int smallest_font_height;
146 117
147 /* Reusable Graphics Context for drawing a cursor in a non-default face. */ 118 /* Reusable Graphics Context for drawing a cursor in a non-default face. */
148 GC scratch_cursor_gc; 119 GC scratch_cursor_gc;
149 120
150 /* These variables describe the range of text currently shown in its 121 /* These variables describe the range of text currently shown in its
151 mouse-face, together with the window they apply to. As long as 122 mouse-face, together with the window they apply to. As long as
152 the mouse stays within this range, we need not redraw anything on 123 the mouse stays within this range, we need not redraw anything on
153 its account. Rows and columns are glyph matrix positions in 124 its account. Rows and columns are glyph matrix positions in
154 MOUSE_FACE_WINDOW. */ 125 MOUSE_FACE_WINDOW. */
155 int mouse_face_beg_row, mouse_face_beg_col; 126 int mouse_face_beg_row, mouse_face_beg_col;
156 int mouse_face_beg_x, mouse_face_beg_y; 127 int mouse_face_beg_x, mouse_face_beg_y;
166 int mouse_face_deferred_gc; 137 int mouse_face_deferred_gc;
167 138
168 /* FRAME and X, Y position of mouse when last checked for 139 /* FRAME and X, Y position of mouse when last checked for
169 highlighting. X and Y can be negative or out of range for the frame. */ 140 highlighting. X and Y can be negative or out of range for the frame. */
170 struct frame *mouse_face_mouse_frame; 141 struct frame *mouse_face_mouse_frame;
171
172 int mouse_face_mouse_x, mouse_face_mouse_y; 142 int mouse_face_mouse_x, mouse_face_mouse_y;
173 143
174 /* Nonzero means defer mouse-motion highlighting. */ 144 /* Nonzero means defer mouse-motion highlighting. */
175 int mouse_face_defer; 145 int mouse_face_defer;
176 146
178 int mouse_face_hidden; 148 int mouse_face_hidden;
179 149
180 int mouse_face_image_state; 150 int mouse_face_image_state;
181 151
182 char *mac_id_name; 152 char *mac_id_name;
153
154 /* The number of fonts actually stored in the font table.
155 font_table[n] is used and valid iff 0 <= n < n_fonts. 0 <=
156 n_fonts <= font_table_size and font_table[i].name != 0. */
157 int n_fonts;
183 158
184 /* Pointer to bitmap records. */ 159 /* Pointer to bitmap records. */
185 struct mac_bitmap_record *bitmaps; 160 struct mac_bitmap_record *bitmaps;
186 161
187 /* Allocated size of bitmaps field. */ 162 /* Allocated size of bitmaps field. */
235 extern int unibyte_display_via_language_environment; 210 extern int unibyte_display_via_language_environment;
236 211
237 extern struct x_display_info *x_display_info_for_display P_ ((Display *)); 212 extern struct x_display_info *x_display_info_for_display P_ ((Display *));
238 extern struct x_display_info *x_display_info_for_name P_ ((Lisp_Object)); 213 extern struct x_display_info *x_display_info_for_name P_ ((Lisp_Object));
239 214
240 extern struct mac_display_info *mac_term_init (); 215 extern struct mac_display_info *mac_term_init P_ ((Lisp_Object, char *, char *));
241 216
242 extern Lisp_Object x_list_fonts P_ ((struct frame *, Lisp_Object, int, int)); 217 extern Lisp_Object x_list_fonts P_ ((struct frame *, Lisp_Object, int, int));
243 extern struct font_info *x_get_font_info P_ ((struct frame *f, int)); 218 extern struct font_info *x_get_font_info P_ ((struct frame *f, int));
244 extern struct font_info *x_load_font P_ ((struct frame *, char *, int)); 219 extern struct font_info *x_load_font P_ ((struct frame *, char *, int));
245 extern struct font_info *x_query_font P_ ((struct frame *, char *)); 220 extern struct font_info *x_query_font P_ ((struct frame *, char *));
260 struct x_output x_compatible; 235 struct x_output x_compatible;
261 236
262 /* Menubar "widget" handle. */ 237 /* Menubar "widget" handle. */
263 int menubar_widget; 238 int menubar_widget;
264 239
265 Window mWP; /* pointer to QuickDraw window */
266 FRAME_PTR mFP; /* points back to the frame struct */ 240 FRAME_PTR mFP; /* points back to the frame struct */
267
268 #if 0
269 int mNumCols; /* number of characters per column */
270 int mNumRows; /* number of characters per row */
271 int mLineHeight; /* height of one line of text in pixels */
272 int mCharWidth; /* width of one character in pixels */
273 int mHomeX; /* X pixel coordinate of lower left
274 corner of character at (0, 0) */
275 int mHomeY; /* Y pixel coordinate of lower left
276 corner of character at (0, 0) */
277 int mHighlight; /* current highlight state (0 = off). */
278 int mTermWinSize; /* num of lines from top of window
279 affected by ins_del_lines; set by
280 set_terminal_window. */
281 #endif /* 0 */
282
283 #if 0
284 /* stuffs used by xfaces.c */
285 struct face **param_faces;
286 int n_param_faces;
287 struct face **computed_faces;
288 int n_computed_faces;
289 int size_computed_faces;
290 #endif
291 241
292 /* Here are the Graphics Contexts for the default font. */ 242 /* Here are the Graphics Contexts for the default font. */
293 GC normal_gc; /* Normal video */ 243 GC normal_gc; /* Normal video */
294 GC reverse_gc; /* Reverse video */ 244 GC reverse_gc; /* Reverse video */
295 GC cursor_gc; /* cursor drawing */ 245 GC cursor_gc; /* cursor drawing */
320 unsigned long cursor_pixel; 270 unsigned long cursor_pixel;
321 unsigned long border_pixel; 271 unsigned long border_pixel;
322 unsigned long mouse_pixel; 272 unsigned long mouse_pixel;
323 unsigned long cursor_foreground_pixel; 273 unsigned long cursor_foreground_pixel;
324 274
275 #if 0
325 /* Foreground color for scroll bars. A value of -1 means use the 276 /* Foreground color for scroll bars. A value of -1 means use the
326 default (black for non-toolkit scroll bars). */ 277 default (black for non-toolkit scroll bars). */
327 unsigned long scroll_bar_foreground_pixel; 278 unsigned long scroll_bar_foreground_pixel;
328 279
329 /* Background color for scroll bars. A value of -1 means use the 280 /* Background color for scroll bars. A value of -1 means use the
330 default (background color of the frame for non-toolkit scroll 281 default (background color of the frame for non-toolkit scroll
331 bars). */ 282 bars). */
332 unsigned long scroll_bar_background_pixel; 283 unsigned long scroll_bar_background_pixel;
284 #endif
333 285
334 /* Descriptor for the cursor in use for this window. */ 286 /* Descriptor for the cursor in use for this window. */
335 Cursor text_cursor; 287 Cursor text_cursor;
336 Cursor nontext_cursor; 288 Cursor nontext_cursor;
337 Cursor modeline_cursor; 289 Cursor modeline_cursor;
355 /* The Mac control reference for the hourglass (progress indicator) 307 /* The Mac control reference for the hourglass (progress indicator)
356 shown at the upper-right corner of the window. */ 308 shown at the upper-right corner of the window. */
357 ControlRef hourglass_control; 309 ControlRef hourglass_control;
358 #endif 310 #endif
359 311
360 #if 0
361 DWORD dwStyle;
362 #endif
363
364 /* This is the Emacs structure for the display this frame is on. */ 312 /* This is the Emacs structure for the display this frame is on. */
365 /* struct w32_display_info *display_info; */ 313 /* struct w32_display_info *display_info; */
366 314
367 /* Nonzero means our parent is another application's window 315 /* Nonzero means our parent is another application's window
368 and was explicitly specified. */ 316 and was explicitly specified. */
374 /* Nonzero means menubar is currently active. */ 322 /* Nonzero means menubar is currently active. */
375 char menubar_active; 323 char menubar_active;
376 324
377 /* Nonzero means a menu command is being processed. */ 325 /* Nonzero means a menu command is being processed. */
378 char menu_command_in_progress; 326 char menu_command_in_progress;
379
380 /* Nonzero means menubar is about to become active, but should be
381 brought up to date first. */
382 volatile char pending_menu_activation;
383 327
384 /* Relief GCs, colors etc. */ 328 /* Relief GCs, colors etc. */
385 struct relief 329 struct relief
386 { 330 {
387 GC gc; 331 GC gc;
402 346
403 /* Return the X output data for frame F. */ 347 /* Return the X output data for frame F. */
404 #define FRAME_X_OUTPUT(f) ((f)->output_data.mac) 348 #define FRAME_X_OUTPUT(f) ((f)->output_data.mac)
405 349
406 /* Return the Mac window used for displaying data in frame F. */ 350 /* Return the Mac window used for displaying data in frame F. */
407 #define FRAME_MAC_WINDOW(f) ((f)->output_data.mac->mWP) 351 #define FRAME_MAC_WINDOW(f) ((f)->output_data.mac->window_desc)
408 #define FRAME_X_WINDOW(f) ((f)->output_data.mac->mWP) 352 #define FRAME_X_WINDOW(f) ((f)->output_data.mac->window_desc)
409 353
410 #define FRAME_FOREGROUND_PIXEL(f) ((f)->output_data.x->foreground_pixel) 354 #define FRAME_FOREGROUND_PIXEL(f) ((f)->output_data.x->foreground_pixel)
411 #define FRAME_BACKGROUND_PIXEL(f) ((f)->output_data.x->background_pixel) 355 #define FRAME_BACKGROUND_PIXEL(f) ((f)->output_data.x->background_pixel)
412 356
413 #define FRAME_FONT(f) ((f)->output_data.mac->font) 357 #define FRAME_FONT(f) ((f)->output_data.mac->font)
529 (SCROLL_BAR_UNPACK ((ptr)->control_handle_low, \ 473 (SCROLL_BAR_UNPACK ((ptr)->control_handle_low, \
530 (ptr)->control_handle_high, (int) id)) 474 (ptr)->control_handle_high, (int) id))
531 475
532 /* Return the inside width of a vertical scroll bar, given the outside 476 /* Return the inside width of a vertical scroll bar, given the outside
533 width. */ 477 width. */
534 #define VERTICAL_SCROLL_BAR_INSIDE_WIDTH(f,width) \ 478 #define VERTICAL_SCROLL_BAR_INSIDE_WIDTH(f, width) \
535 ((width) \ 479 ((width) \
536 - VERTICAL_SCROLL_BAR_LEFT_BORDER \ 480 - VERTICAL_SCROLL_BAR_LEFT_BORDER \
537 - VERTICAL_SCROLL_BAR_RIGHT_BORDER \ 481 - VERTICAL_SCROLL_BAR_RIGHT_BORDER \
538 - VERTICAL_SCROLL_BAR_WIDTH_TRIM * 2) 482 - VERTICAL_SCROLL_BAR_WIDTH_TRIM * 2)
539 483