Mercurial > hg > xemacs-beta
comparison src/glyphs.h @ 384:bbff43aa5eb7 r21-2-7
Import from CVS: tag r21-2-7
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:08:24 +0200 |
parents | 8626e4521993 |
children | aabb7f5b1c81 |
comparison
equal
deleted
inserted
replaced
383:6a50c6a581a5 | 384:bbff43aa5eb7 |
---|---|
23 | 23 |
24 #ifndef _XEMACS_GLYPHS_H_ | 24 #ifndef _XEMACS_GLYPHS_H_ |
25 #define _XEMACS_GLYPHS_H_ | 25 #define _XEMACS_GLYPHS_H_ |
26 | 26 |
27 #include "specifier.h" | 27 #include "specifier.h" |
28 #include "gui.h" | |
28 | 29 |
29 /************************************************************************/ | 30 /************************************************************************/ |
30 /* Image Instantiators */ | 31 /* Image Instantiators */ |
31 /************************************************************************/ | 32 /************************************************************************/ |
32 | 33 |
45 xface mono-pixmap, color-pixmap, pointer | 46 xface mono-pixmap, color-pixmap, pointer |
46 gif color-pixmap | 47 gif color-pixmap |
47 jpeg color-pixmap | 48 jpeg color-pixmap |
48 png color-pixmap | 49 png color-pixmap |
49 tiff color-pixmap | 50 tiff color-pixmap |
51 bmp color-pixmap | |
50 cursor-font pointer | 52 cursor-font pointer |
53 mswindows-resource pointer | |
51 font pointer | 54 font pointer |
52 subwindow subwindow | 55 subwindow subwindow |
53 inherit mono-pixmap | 56 inherit mono-pixmap |
54 autodetect mono-pixmap, color-pixmap, pointer, text | 57 autodetect mono-pixmap, color-pixmap, pointer, text |
58 button widget | |
59 edit widget | |
60 combo widget | |
61 scrollbar widget | |
62 static widget | |
55 */ | 63 */ |
56 | 64 |
57 /* These are methods specific to a particular format of image instantiator | 65 /* These are methods specific to a particular format of image instantiator |
58 (e.g. xpm, string, etc.). */ | 66 (e.g. xpm, string, etc.). */ |
59 | 67 |
71 } ii_keyword_entry_dynarr; | 79 } ii_keyword_entry_dynarr; |
72 | 80 |
73 struct image_instantiator_methods | 81 struct image_instantiator_methods |
74 { | 82 { |
75 Lisp_Object symbol; | 83 Lisp_Object symbol; |
84 | |
85 Lisp_Object device; /* sometimes used */ | |
76 | 86 |
77 ii_keyword_entry_dynarr *keywords; | 87 ii_keyword_entry_dynarr *keywords; |
78 /* Implementation specific methods: */ | 88 /* Implementation specific methods: */ |
79 | 89 |
80 /* Validate method: Given an instantiator vector, signal an error if | 90 /* Validate method: Given an instantiator vector, signal an error if |
102 Lisp_Object instantiator, | 112 Lisp_Object instantiator, |
103 Lisp_Object pointer_fg, | 113 Lisp_Object pointer_fg, |
104 Lisp_Object pointer_bg, | 114 Lisp_Object pointer_bg, |
105 int dest_mask, | 115 int dest_mask, |
106 Lisp_Object domain); | 116 Lisp_Object domain); |
117 /* Property method: Given an image instance, return device specific | |
118 properties. */ | |
119 Lisp_Object (*property_method) (Lisp_Object image_instance, | |
120 Lisp_Object property); | |
121 /* Set-property method: Given an image instance, set device specific | |
122 properties. */ | |
123 Lisp_Object (*set_property_method) (Lisp_Object image_instance, | |
124 Lisp_Object property, | |
125 Lisp_Object val); | |
107 }; | 126 }; |
108 | 127 |
109 /***** Calling an image-instantiator method *****/ | 128 /***** Calling an image-instantiator method *****/ |
110 | 129 |
111 #define HAS_IIFORMAT_METH_P(mstruc, m) ((mstruc)->m##_method) | 130 #define HAS_IIFORMAT_METH_P(mstruc, m) ((mstruc)->m##_method) |
112 #define IIFORMAT_METH(mstruc, m, args) (((mstruc)->m##_method) args) | 131 #define IIFORMAT_METH(mstruc, m, args) (((mstruc)->m##_method) args) |
113 | 132 |
114 /* Call a void-returning specifier method, if it exists */ | 133 /* Call a void-returning specifier method, if it exists */ |
115 #define MAYBE_IIFORMAT_METH(mstruc, m, args) do { \ | 134 #define MAYBE_IIFORMAT_METH(mstruc, m, args) \ |
116 struct image_instantiator_methods *maybe_iiformat_meth_mstruc = (mstruc); \ | 135 if (mstruc) \ |
117 if (HAS_IIFORMAT_METH_P (maybe_iiformat_meth_mstruc, m)) \ | 136 do { \ |
118 IIFORMAT_METH (maybe_iiformat_meth_mstruc, m, args); \ | 137 struct image_instantiator_methods *maybe_iiformat_meth_mstruc = (mstruc); \ |
119 } while (0) | 138 if (HAS_IIFORMAT_METH_P (maybe_iiformat_meth_mstruc, m)) \ |
139 IIFORMAT_METH (maybe_iiformat_meth_mstruc, m, args); \ | |
140 } while (0) | |
141 | |
142 #define MAYBE_IIFORMAT_DEVMETH(device, mstruc, m, args) \ | |
143 do { \ | |
144 struct image_instantiator_methods *_mstruc = decode_ii_device (device, mstruc); \ | |
145 if (_mstruc) \ | |
146 MAYBE_IIFORMAT_METH(_mstruc, m, args); \ | |
147 } while (0) | |
148 | |
120 | 149 |
121 /* Call a specifier method, if it exists; otherwise return | 150 /* Call a specifier method, if it exists; otherwise return |
122 the specified value */ | 151 the specified value */ |
123 | 152 |
124 #define IIFORMAT_METH_OR_GIVEN(mstruc, m, args, given) \ | 153 #define IIFORMAT_METH_OR_GIVEN(mstruc, m, args, given) \ |
131 extern struct image_instantiator_methods *format##_image_instantiator_methods | 160 extern struct image_instantiator_methods *format##_image_instantiator_methods |
132 | 161 |
133 #define DEFINE_IMAGE_INSTANTIATOR_FORMAT(format) \ | 162 #define DEFINE_IMAGE_INSTANTIATOR_FORMAT(format) \ |
134 struct image_instantiator_methods *format##_image_instantiator_methods | 163 struct image_instantiator_methods *format##_image_instantiator_methods |
135 | 164 |
136 #define INITIALIZE_IMAGE_INSTANTIATOR_FORMAT(format, obj_name) \ | 165 #define INITIALIZE_IMAGE_INSTANTIATOR_FORMAT_NO_SYM(format, obj_name) \ |
137 do { \ | 166 do { \ |
138 format##_image_instantiator_methods = \ | 167 format##_image_instantiator_methods = \ |
139 xnew_and_zero (struct image_instantiator_methods); \ | 168 xnew_and_zero (struct image_instantiator_methods); \ |
140 defsymbol (&Q##format, obj_name); \ | |
141 format##_image_instantiator_methods->symbol = Q##format; \ | 169 format##_image_instantiator_methods->symbol = Q##format; \ |
170 format##_image_instantiator_methods->device = Qnil; \ | |
142 format##_image_instantiator_methods->keywords = \ | 171 format##_image_instantiator_methods->keywords = \ |
143 Dynarr_new (ii_keyword_entry); \ | 172 Dynarr_new (ii_keyword_entry); \ |
144 add_entry_to_image_instantiator_format_list \ | 173 add_entry_to_image_instantiator_format_list \ |
145 (Q##format, format##_image_instantiator_methods); \ | 174 (Q##format, format##_image_instantiator_methods); \ |
146 } while (0) | 175 } while (0) |
147 | 176 |
177 #define INITIALIZE_IMAGE_INSTANTIATOR_FORMAT(format, obj_name) \ | |
178 do { \ | |
179 defsymbol (&Q##format, obj_name); \ | |
180 INITIALIZE_IMAGE_INSTANTIATOR_FORMAT_NO_SYM(format, obj_name); \ | |
181 } while (0) | |
182 | |
148 /* Declare that image-instantiator format FORMAT has method M; used in | 183 /* Declare that image-instantiator format FORMAT has method M; used in |
149 initialization routines */ | 184 initialization routines */ |
150 #define IIFORMAT_HAS_METHOD(format, m) \ | 185 #define IIFORMAT_HAS_METHOD(format, m) \ |
151 (format##_image_instantiator_methods->m##_method = format##_##m) | 186 (format##_image_instantiator_methods->m##_method = format##_##m) |
187 | |
188 #define IIFORMAT_HAS_SHARED_METHOD(format, m, type) \ | |
189 (format##_image_instantiator_methods->m##_method = type##_##m) | |
152 | 190 |
153 /* Declare that KEYW is a valid keyword for image-instantiator format | 191 /* Declare that KEYW is a valid keyword for image-instantiator format |
154 FORMAT. VALIDATE_FUN if a function that returns whether the data | 192 FORMAT. VALIDATE_FUN if a function that returns whether the data |
155 is valid. The keyword may not appear more than once. */ | 193 is valid. The keyword may not appear more than once. */ |
156 #define IIFORMAT_VALID_KEYWORD(format, keyw, validate_fun) \ | 194 #define IIFORMAT_VALID_KEYWORD(format, keyw, validate_fun) \ |
175 entry.multiple_p = 1; \ | 213 entry.multiple_p = 1; \ |
176 Dynarr_add (format##_image_instantiator_methods->keywords, \ | 214 Dynarr_add (format##_image_instantiator_methods->keywords, \ |
177 entry); \ | 215 entry); \ |
178 } while (0) | 216 } while (0) |
179 | 217 |
218 #define DEFINE_DEVICE_IIFORMAT(type, format)\ | |
219 struct image_instantiator_methods *type##_##format##_image_instantiator_methods | |
220 | |
221 #define INITIALIZE_DEVICE_IIFORMAT(type, format) \ | |
222 do { \ | |
223 type##_##format##_image_instantiator_methods = \ | |
224 xnew_and_zero (struct image_instantiator_methods); \ | |
225 type##_##format##_image_instantiator_methods->symbol = Q##format; \ | |
226 type##_##format##_image_instantiator_methods->device = Q##type; \ | |
227 type##_##format##_image_instantiator_methods->keywords = \ | |
228 Dynarr_new (ii_keyword_entry); \ | |
229 add_entry_to_device_ii_format_list \ | |
230 (Q##type, Q##format, type##_##format##_image_instantiator_methods); \ | |
231 } while (0) | |
232 | |
233 /* Declare that image-instantiator format FORMAT has method M; used in | |
234 initialization routines */ | |
235 #define IIFORMAT_HAS_DEVMETHOD(type, format, m) \ | |
236 (type##_##format##_image_instantiator_methods->m##_method = type##_##format##_##m) | |
237 | |
238 struct image_instantiator_methods * | |
239 decode_device_ii_format (Lisp_Object device, Lisp_Object format, | |
240 Error_behavior errb); | |
241 struct image_instantiator_methods * | |
242 decode_image_instantiator_format (Lisp_Object format, Error_behavior errb); | |
243 | |
180 void add_entry_to_image_instantiator_format_list (Lisp_Object symbol, | 244 void add_entry_to_image_instantiator_format_list (Lisp_Object symbol, |
245 struct image_instantiator_methods *meths); | |
246 void add_entry_to_device_ii_format_list (Lisp_Object device, Lisp_Object symbol, | |
181 struct image_instantiator_methods *meths); | 247 struct image_instantiator_methods *meths); |
182 Lisp_Object find_keyword_in_vector (Lisp_Object vector, | 248 Lisp_Object find_keyword_in_vector (Lisp_Object vector, |
183 Lisp_Object keyword); | 249 Lisp_Object keyword); |
184 Lisp_Object find_keyword_in_vector_or_given (Lisp_Object vector, | 250 Lisp_Object find_keyword_in_vector_or_given (Lisp_Object vector, |
185 Lisp_Object keyword, | 251 Lisp_Object keyword, |
191 Lisp_Object file_keyword, | 257 Lisp_Object file_keyword, |
192 Lisp_Object data_keyword, | 258 Lisp_Object data_keyword, |
193 Lisp_Object console_type); | 259 Lisp_Object console_type); |
194 void check_valid_string (Lisp_Object data); | 260 void check_valid_string (Lisp_Object data); |
195 void check_valid_int (Lisp_Object data); | 261 void check_valid_int (Lisp_Object data); |
262 void check_valid_face (Lisp_Object data); | |
263 void check_valid_vector (Lisp_Object data); | |
264 | |
265 void initialize_subwindow_image_instance (struct Lisp_Image_Instance*); | |
266 void subwindow_instantiate (Lisp_Object image_instance, Lisp_Object instantiator, | |
267 Lisp_Object pointer_fg, Lisp_Object pointer_bg, | |
268 int dest_mask, Lisp_Object domain); | |
269 | |
196 DECLARE_DOESNT_RETURN (incompatible_image_types (Lisp_Object instantiator, | 270 DECLARE_DOESNT_RETURN (incompatible_image_types (Lisp_Object instantiator, |
197 int given_dest_mask, | 271 int given_dest_mask, |
198 int desired_dest_mask)); | 272 int desired_dest_mask)); |
199 DECLARE_DOESNT_RETURN (signal_image_error (CONST char *, Lisp_Object)); | 273 DECLARE_DOESNT_RETURN (signal_image_error (CONST char *, Lisp_Object)); |
200 DECLARE_DOESNT_RETURN (signal_image_error_2 (CONST char *, Lisp_Object, Lisp_Object)); | 274 DECLARE_DOESNT_RETURN (signal_image_error_2 (CONST char *, Lisp_Object, Lisp_Object)); |
248 IMAGE_NOTHING, | 322 IMAGE_NOTHING, |
249 IMAGE_TEXT, | 323 IMAGE_TEXT, |
250 IMAGE_MONO_PIXMAP, | 324 IMAGE_MONO_PIXMAP, |
251 IMAGE_COLOR_PIXMAP, | 325 IMAGE_COLOR_PIXMAP, |
252 IMAGE_POINTER, | 326 IMAGE_POINTER, |
253 IMAGE_SUBWINDOW | 327 IMAGE_SUBWINDOW, |
328 IMAGE_WIDGET | |
254 }; | 329 }; |
255 | 330 |
256 #define IMAGE_NOTHING_MASK (1 << 0) | 331 #define IMAGE_NOTHING_MASK (1 << 0) |
257 #define IMAGE_TEXT_MASK (1 << 1) | 332 #define IMAGE_TEXT_MASK (1 << 1) |
258 #define IMAGE_MONO_PIXMAP_MASK (1 << 2) | 333 #define IMAGE_MONO_PIXMAP_MASK (1 << 2) |
259 #define IMAGE_COLOR_PIXMAP_MASK (1 << 3) | 334 #define IMAGE_COLOR_PIXMAP_MASK (1 << 3) |
260 #define IMAGE_POINTER_MASK (1 << 4) | 335 #define IMAGE_POINTER_MASK (1 << 4) |
261 #define IMAGE_SUBWINDOW_MASK (1 << 5) | 336 #define IMAGE_SUBWINDOW_MASK (1 << 5) |
337 #define IMAGE_WIDGET_MASK (1 << 6) | |
262 | 338 |
263 #define IMAGE_INSTANCE_TYPE_P(ii, type) \ | 339 #define IMAGE_INSTANCE_TYPE_P(ii, type) \ |
264 (IMAGE_INSTANCEP (ii) && XIMAGE_INSTANCE_TYPE (ii) == type) | 340 (IMAGE_INSTANCEP (ii) && XIMAGE_INSTANCE_TYPE (ii) == type) |
265 | 341 |
266 #define NOTHING_IMAGE_INSTANCEP(ii) \ | 342 #define NOTHING_IMAGE_INSTANCEP(ii) \ |
273 IMAGE_INSTANCE_TYPE_P (ii, IMAGE_COLOR_PIXMAP) | 349 IMAGE_INSTANCE_TYPE_P (ii, IMAGE_COLOR_PIXMAP) |
274 #define POINTER_IMAGE_INSTANCEP(ii) \ | 350 #define POINTER_IMAGE_INSTANCEP(ii) \ |
275 IMAGE_INSTANCE_TYPE_P (ii, IMAGE_POINTER) | 351 IMAGE_INSTANCE_TYPE_P (ii, IMAGE_POINTER) |
276 #define SUBWINDOW_IMAGE_INSTANCEP(ii) \ | 352 #define SUBWINDOW_IMAGE_INSTANCEP(ii) \ |
277 IMAGE_INSTANCE_TYPE_P (ii, IMAGE_SUBWINDOW) | 353 IMAGE_INSTANCE_TYPE_P (ii, IMAGE_SUBWINDOW) |
354 #define WIDGET_IMAGE_INSTANCEP(ii) \ | |
355 IMAGE_INSTANCE_TYPE_P (ii, IMAGE_WIDGET) | |
278 | 356 |
279 #define CHECK_NOTHING_IMAGE_INSTANCE(x) do { \ | 357 #define CHECK_NOTHING_IMAGE_INSTANCE(x) do { \ |
280 CHECK_IMAGE_INSTANCE (x); \ | 358 CHECK_IMAGE_INSTANCE (x); \ |
281 if (!NOTHING_IMAGE_INSTANCEP (x)) \ | 359 if (!NOTHING_IMAGE_INSTANCEP (x)) \ |
282 x = wrong_type_argument (Qnothing_image_instance_p, (x)); \ | 360 x = wrong_type_argument (Qnothing_image_instance_p, (x)); \ |
306 x = wrong_type_argument (Qpointer_image_instance_p, (x)); \ | 384 x = wrong_type_argument (Qpointer_image_instance_p, (x)); \ |
307 } while (0) | 385 } while (0) |
308 | 386 |
309 #define CHECK_SUBWINDOW_IMAGE_INSTANCE(x) do { \ | 387 #define CHECK_SUBWINDOW_IMAGE_INSTANCE(x) do { \ |
310 CHECK_IMAGE_INSTANCE (x); \ | 388 CHECK_IMAGE_INSTANCE (x); \ |
311 if (!SUBWINDOW_IMAGE_INSTANCEP (x)) \ | 389 if (!SUBWINDOW_IMAGE_INSTANCEP (x) \ |
390 && !WIDGET_IMAGE_INSTANCEP (x)) \ | |
312 x = wrong_type_argument (Qsubwindow_image_instance_p, (x)); \ | 391 x = wrong_type_argument (Qsubwindow_image_instance_p, (x)); \ |
392 } while (0) | |
393 | |
394 #define CHECK_WIDGET_IMAGE_INSTANCE(x) do { \ | |
395 CHECK_IMAGE_INSTANCE (x); \ | |
396 if (!WIDGET_IMAGE_INSTANCEP (x)) \ | |
397 x = wrong_type_argument (Qwidget_image_instance_p, (x)); \ | |
313 } while (0) | 398 } while (0) |
314 | 399 |
315 struct Lisp_Image_Instance | 400 struct Lisp_Image_Instance |
316 { | 401 { |
317 struct lcrecord_header header; | 402 struct lcrecord_header header; |
336 Lisp_Object auxdata; /* list or Qnil: any additional data | 421 Lisp_Object auxdata; /* list or Qnil: any additional data |
337 to be seen from lisp */ | 422 to be seen from lisp */ |
338 } pixmap; /* used for pointers as well */ | 423 } pixmap; /* used for pointers as well */ |
339 struct | 424 struct |
340 { | 425 { |
341 int dummy; /* #### fill in this structure */ | 426 Lisp_Object frame; |
427 unsigned int width, height; | |
428 void* subwindow; /* specific devices can use this as necessary */ | |
429 int being_displayed; /* used to detect when needs to be unmapped */ | |
430 struct | |
431 { | |
432 Lisp_Object face; /* foreground and background colors */ | |
433 Lisp_Object type; | |
434 Lisp_Object props; /* properties */ | |
435 struct gui_item gui_item; | |
436 } widget; /* widgets are subwindows */ | |
342 } subwindow; | 437 } subwindow; |
343 } u; | 438 } u; |
344 | 439 |
345 /* console-type- and image-type-specific data */ | 440 /* console-type- and image-type-specific data */ |
346 void *data; | 441 void *data; |
363 #define IMAGE_INSTANCE_PIXMAP_HOTSPOT_X(i) ((i)->u.pixmap.hotspot_x) | 458 #define IMAGE_INSTANCE_PIXMAP_HOTSPOT_X(i) ((i)->u.pixmap.hotspot_x) |
364 #define IMAGE_INSTANCE_PIXMAP_HOTSPOT_Y(i) ((i)->u.pixmap.hotspot_y) | 459 #define IMAGE_INSTANCE_PIXMAP_HOTSPOT_Y(i) ((i)->u.pixmap.hotspot_y) |
365 #define IMAGE_INSTANCE_PIXMAP_FG(i) ((i)->u.pixmap.fg) | 460 #define IMAGE_INSTANCE_PIXMAP_FG(i) ((i)->u.pixmap.fg) |
366 #define IMAGE_INSTANCE_PIXMAP_BG(i) ((i)->u.pixmap.bg) | 461 #define IMAGE_INSTANCE_PIXMAP_BG(i) ((i)->u.pixmap.bg) |
367 #define IMAGE_INSTANCE_PIXMAP_AUXDATA(i) ((i)->u.pixmap.auxdata) | 462 #define IMAGE_INSTANCE_PIXMAP_AUXDATA(i) ((i)->u.pixmap.auxdata) |
463 | |
464 #define IMAGE_INSTANCE_SUBWINDOW_WIDTH(i) ((i)->u.subwindow.width) | |
465 #define IMAGE_INSTANCE_SUBWINDOW_HEIGHT(i) ((i)->u.subwindow.height) | |
466 #define IMAGE_INSTANCE_SUBWINDOW_ID(i) ((i)->u.subwindow.subwindow) | |
467 #define IMAGE_INSTANCE_SUBWINDOW_FRAME(i) ((i)->u.subwindow.frame) | |
468 #define IMAGE_INSTANCE_SUBWINDOW_DISPLAYEDP(i) \ | |
469 ((i)->u.subwindow.being_displayed) | |
470 | |
471 #define IMAGE_INSTANCE_WIDGET_WIDTH(i) \ | |
472 IMAGE_INSTANCE_SUBWINDOW_WIDTH(i) | |
473 #define IMAGE_INSTANCE_WIDGET_HEIGHT(i) \ | |
474 IMAGE_INSTANCE_SUBWINDOW_HEIGHT(i) | |
475 #define IMAGE_INSTANCE_WIDGET_CALLBACK(i) \ | |
476 ((i)->u.subwindow.widget.gui_item.callback) | |
477 #define IMAGE_INSTANCE_WIDGET_TYPE(i) ((i)->u.subwindow.widget.type) | |
478 #define IMAGE_INSTANCE_WIDGET_PROPS(i) ((i)->u.subwindow.widget.props) | |
479 #define IMAGE_INSTANCE_WIDGET_FACE(i) ((i)->u.subwindow.widget.face) | |
480 #define IMAGE_INSTANCE_WIDGET_TEXT(i) ((i)->u.subwindow.widget.gui_item.name) | |
481 #define IMAGE_INSTANCE_WIDGET_ITEM(i) ((i)->u.subwindow.widget.gui_item) | |
368 | 482 |
369 #define XIMAGE_INSTANCE_DEVICE(i) \ | 483 #define XIMAGE_INSTANCE_DEVICE(i) \ |
370 IMAGE_INSTANCE_DEVICE (XIMAGE_INSTANCE (i)) | 484 IMAGE_INSTANCE_DEVICE (XIMAGE_INSTANCE (i)) |
371 #define XIMAGE_INSTANCE_NAME(i) \ | 485 #define XIMAGE_INSTANCE_NAME(i) \ |
372 IMAGE_INSTANCE_NAME (XIMAGE_INSTANCE (i)) | 486 IMAGE_INSTANCE_NAME (XIMAGE_INSTANCE (i)) |
393 #define XIMAGE_INSTANCE_PIXMAP_FG(i) \ | 507 #define XIMAGE_INSTANCE_PIXMAP_FG(i) \ |
394 IMAGE_INSTANCE_PIXMAP_FG (XIMAGE_INSTANCE (i)) | 508 IMAGE_INSTANCE_PIXMAP_FG (XIMAGE_INSTANCE (i)) |
395 #define XIMAGE_INSTANCE_PIXMAP_BG(i) \ | 509 #define XIMAGE_INSTANCE_PIXMAP_BG(i) \ |
396 IMAGE_INSTANCE_PIXMAP_BG (XIMAGE_INSTANCE (i)) | 510 IMAGE_INSTANCE_PIXMAP_BG (XIMAGE_INSTANCE (i)) |
397 | 511 |
512 #define XIMAGE_INSTANCE_WIDGET_WIDTH(i) \ | |
513 IMAGE_INSTANCE_WIDGET_WIDTH (XIMAGE_INSTANCE (i)) | |
514 #define XIMAGE_INSTANCE_WIDGET_HEIGHT(i) \ | |
515 IMAGE_INSTANCE_WIDGET_HEIGHT (XIMAGE_INSTANCE (i)) | |
516 #define XIMAGE_INSTANCE_WIDGET_CALLBACK(i) \ | |
517 IMAGE_INSTANCE_WIDGET_CALLBACK (XIMAGE_INSTANCE (i)) | |
518 #define XIMAGE_INSTANCE_WIDGET_TYPE(i) \ | |
519 IMAGE_INSTANCE_WIDGET_TYPE (XIMAGE_INSTANCE (i)) | |
520 #define XIMAGE_INSTANCE_WIDGET_PROPS(i) \ | |
521 IMAGE_INSTANCE_WIDGET_PROPS (XIMAGE_INSTANCE (i)) | |
522 #define XIMAGE_INSTANCE_WIDGET_FACE(i) \ | |
523 IMAGE_INSTANCE_WIDGET_FACE (XIMAGE_INSTANCE (i)) | |
524 #define XIMAGE_INSTANCE_WIDGET_TEXT(i) \ | |
525 IMAGE_INSTANCE_WIDGET_TEXT (XIMAGE_INSTANCE (i)) | |
526 #define XIMAGE_INSTANCE_WIDGET_ITEM(i) \ | |
527 IMAGE_INSTANCE_WIDGET_ITEM (XIMAGE_INSTANCE (i)) | |
528 | |
529 #define XIMAGE_INSTANCE_SUBWINDOW_WIDTH(i) \ | |
530 IMAGE_INSTANCE_SUBWINDOW_WIDTH (XIMAGE_INSTANCE (i)) | |
531 #define XIMAGE_INSTANCE_SUBWINDOW_HEIGHT(i) \ | |
532 IMAGE_INSTANCE_SUBWINDOW_HEIGHT (XIMAGE_INSTANCE (i)) | |
533 #define XIMAGE_INSTANCE_SUBWINDOW_ID(i) \ | |
534 IMAGE_INSTANCE_SUBWINDOW_ID (XIMAGE_INSTANCE (i)) | |
535 #define XIMAGE_INSTANCE_SUBWINDOW_FRAME(i) \ | |
536 IMAGE_INSTANCE_SUBWINDOW_FRAME (XIMAGE_INSTANCE (i)) | |
537 #define XIMAGE_INSTANCE_SUBWINDOW_DISPLAYEDP(i) \ | |
538 IMAGE_INSTANCE_SUBWINDOW_DISPLAYEDP (XIMAGE_INSTANCE (i)) | |
539 | |
398 #ifdef HAVE_XPM | 540 #ifdef HAVE_XPM |
399 Lisp_Object evaluate_xpm_color_symbols (void); | 541 Lisp_Object evaluate_xpm_color_symbols (void); |
400 Lisp_Object pixmap_to_lisp_data (Lisp_Object name, int ok_if_data_invalid); | 542 Lisp_Object pixmap_to_lisp_data (Lisp_Object name, int ok_if_data_invalid); |
401 #endif /* HAVE_XPM */ | 543 #endif /* HAVE_XPM */ |
402 #ifdef HAVE_WINDOW_SYSTEM | 544 #ifdef HAVE_WINDOW_SYSTEM |
478 #define XGLYPH_BASELINE(g) GLYPH_BASELINE (XGLYPH (g)) | 620 #define XGLYPH_BASELINE(g) GLYPH_BASELINE (XGLYPH (g)) |
479 #define XGLYPH_FACE(g) GLYPH_FACE (XGLYPH (g)) | 621 #define XGLYPH_FACE(g) GLYPH_FACE (XGLYPH (g)) |
480 | 622 |
481 extern Lisp_Object Qxpm; | 623 extern Lisp_Object Qxpm; |
482 extern Lisp_Object Q_data, Q_file, Q_color_symbols, Qconst_glyph_variable; | 624 extern Lisp_Object Q_data, Q_file, Q_color_symbols, Qconst_glyph_variable; |
483 extern Lisp_Object Qxbm; | 625 extern Lisp_Object Qxbm, Qedit, Qgroup, Qlabel, Qcombo, Qscrollbar; |
484 extern Lisp_Object Q_mask_file, Q_mask_data, Q_hotspot_x, Q_hotspot_y; | 626 extern Lisp_Object Q_mask_file, Q_mask_data, Q_hotspot_x, Q_hotspot_y; |
485 extern Lisp_Object Q_foreground, Q_background; | 627 extern Lisp_Object Q_foreground, Q_background, Q_face, Q_descriptor, Q_group; |
486 extern Lisp_Object Qimage_conversion_error; | 628 extern Lisp_Object Q_width, Q_height, Q_pixel_width, Q_pixel_height; |
629 extern Lisp_Object Q_items, Q_properties, Qimage_conversion_error; | |
487 extern Lisp_Object Vcontinuation_glyph, Vcontrol_arrow_glyph, Vhscroll_glyph; | 630 extern Lisp_Object Vcontinuation_glyph, Vcontrol_arrow_glyph, Vhscroll_glyph; |
488 extern Lisp_Object Vinvisible_text_glyph, Voctal_escape_glyph, Vtruncation_glyph; | 631 extern Lisp_Object Vinvisible_text_glyph, Voctal_escape_glyph, Vtruncation_glyph; |
489 extern Lisp_Object Vxemacs_logo; | 632 extern Lisp_Object Vxemacs_logo; |
490 | 633 |
491 unsigned short glyph_width (Lisp_Object glyph, Lisp_Object frame_face, | 634 unsigned short glyph_width (Lisp_Object glyph, Lisp_Object frame_face, |
517 int dest_mask, Lisp_Object domain); | 660 int dest_mask, Lisp_Object domain); |
518 Lisp_Object allocate_glyph (enum glyph_type type, | 661 Lisp_Object allocate_glyph (enum glyph_type type, |
519 void (*after_change) (Lisp_Object glyph, | 662 void (*after_change) (Lisp_Object glyph, |
520 Lisp_Object property, | 663 Lisp_Object property, |
521 Lisp_Object locale)); | 664 Lisp_Object locale)); |
665 Lisp_Object widget_face_font_info (Lisp_Object domain, Lisp_Object face, | |
666 int *height, int *width); | |
667 void widget_text_to_pixel_conversion (Lisp_Object domain, Lisp_Object face, | |
668 int th, int tw, | |
669 int* height, int* width); | |
522 | 670 |
523 /************************************************************************/ | 671 /************************************************************************/ |
524 /* Glyph Cachels */ | 672 /* Glyph Cachels */ |
525 /************************************************************************/ | 673 /************************************************************************/ |
526 | 674 |
555 | 703 |
556 void mark_glyph_cachels (glyph_cachel_dynarr *elements, | 704 void mark_glyph_cachels (glyph_cachel_dynarr *elements, |
557 void (*markobj) (Lisp_Object)); | 705 void (*markobj) (Lisp_Object)); |
558 void mark_glyph_cachels_as_not_updated (struct window *w); | 706 void mark_glyph_cachels_as_not_updated (struct window *w); |
559 void reset_glyph_cachels (struct window *w); | 707 void reset_glyph_cachels (struct window *w); |
708 | |
560 #ifdef MEMORY_USAGE_STATS | 709 #ifdef MEMORY_USAGE_STATS |
561 int compute_glyph_cachel_usage (glyph_cachel_dynarr *glyph_cachels, | 710 int compute_glyph_cachel_usage (glyph_cachel_dynarr *glyph_cachels, |
562 struct overhead_stats *ovstats); | 711 struct overhead_stats *ovstats); |
563 #endif /* MEMORY_USAGE_STATS */ | 712 #endif /* MEMORY_USAGE_STATS */ |
564 | 713 |
565 /************************************************************************/ | 714 /************************************************************************/ |
566 /* Display Tables */ | 715 /* Display Tables */ |
567 /************************************************************************/ | 716 /************************************************************************/ |
568 | 717 |
569 #define DISP_TABLE_SIZE 256 | 718 Lisp_Object display_table_entry (Emchar, Lisp_Object, Lisp_Object); |
570 #define DISP_CHAR_ENTRY(dp, c) ((c < (dp)->size) ? (dp)->contents[c] : Qnil) | 719 void get_display_tables (struct window *, face_index, |
571 | 720 Lisp_Object *, Lisp_Object *); |
572 struct Lisp_Vector *get_display_table (struct window *, face_index); | 721 |
722 /**************************************************************************** | |
723 * Subwindow Object * | |
724 ****************************************************************************/ | |
725 | |
726 /* redisplay needs a per-frame cache of subwindows being displayed so | |
727 * that we known when to unmap them */ | |
728 typedef struct subwindow_cachel subwindow_cachel; | |
729 struct subwindow_cachel | |
730 { | |
731 Lisp_Object subwindow; | |
732 int x, y; | |
733 int width, height; | |
734 int being_displayed; | |
735 int updated; | |
736 }; | |
737 | |
738 typedef struct | |
739 { | |
740 Dynarr_declare (subwindow_cachel); | |
741 } subwindow_cachel_dynarr; | |
742 | |
743 void mark_subwindow_cachels (subwindow_cachel_dynarr *elements, | |
744 void (*markobj) (Lisp_Object)); | |
745 void mark_subwindow_cachels_as_not_updated (struct frame *f); | |
746 void reset_subwindow_cachels (struct frame *f); | |
747 void unmap_subwindow (Lisp_Object subwindow); | |
748 void map_subwindow (Lisp_Object subwindow, int x, int y); | |
749 void update_frame_subwindows (struct frame *f); | |
573 | 750 |
574 #endif /* _XEMACS_GLYPHS_H_ */ | 751 #endif /* _XEMACS_GLYPHS_H_ */ |