0
|
1 /* Generic glyph data structures + display tables
|
|
2 Copyright (C) 1994 Board of Trustees, University of Illinois.
|
|
3 Copyright (C) 1995, 1996 Ben Wing
|
|
4
|
|
5 This file is part of XEmacs.
|
|
6
|
|
7 XEmacs is free software; you can redistribute it and/or modify it
|
|
8 under the terms of the GNU General Public License as published by the
|
|
9 Free Software Foundation; either version 2, or (at your option) any
|
|
10 later version.
|
|
11
|
|
12 XEmacs is distributed in the hope that it will be useful, but WITHOUT
|
|
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
15 for more details.
|
|
16
|
|
17 You should have received a copy of the GNU General Public License
|
|
18 along with XEmacs; see the file COPYING. If not, write to
|
|
19 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
20 Boston, MA 02111-1307, USA. */
|
|
21
|
|
22 /* Synched up with: Not in FSF. */
|
|
23
|
398
|
24 #ifndef INCLUDED_glyphs_h_
|
|
25 #define INCLUDED_glyphs_h_
|
0
|
26
|
|
27 #include "specifier.h"
|
384
|
28 #include "gui.h"
|
0
|
29
|
272
|
30 /************************************************************************/
|
|
31 /* Image Instantiators */
|
|
32 /************************************************************************/
|
0
|
33
|
|
34 struct image_instantiator_methods;
|
|
35
|
|
36 /* Remember the distinction between image instantiator formats and
|
|
37 image instance types. Here's an approximate mapping:
|
|
38
|
272
|
39 image instantiator format image instance type
|
|
40 ------------------------- -------------------
|
|
41 nothing nothing
|
|
42 string text
|
|
43 formatted-string text
|
|
44 xbm mono-pixmap, color-pixmap, pointer
|
|
45 xpm color-pixmap, mono-pixmap, pointer
|
|
46 xface mono-pixmap, color-pixmap, pointer
|
|
47 gif color-pixmap
|
|
48 jpeg color-pixmap
|
|
49 png color-pixmap
|
|
50 tiff color-pixmap
|
384
|
51 bmp color-pixmap
|
272
|
52 cursor-font pointer
|
384
|
53 mswindows-resource pointer
|
272
|
54 font pointer
|
|
55 subwindow subwindow
|
|
56 inherit mono-pixmap
|
|
57 autodetect mono-pixmap, color-pixmap, pointer, text
|
398
|
58 button widget
|
|
59 edit-field widget
|
|
60 combo -box widget
|
|
61 progress-gauge widget
|
|
62 tab-control widget
|
|
63 tree-view widget
|
384
|
64 scrollbar widget
|
398
|
65 static widget
|
0
|
66 */
|
|
67
|
|
68 /* These are methods specific to a particular format of image instantiator
|
|
69 (e.g. xpm, string, etc.). */
|
|
70
|
185
|
71 typedef struct ii_keyword_entry ii_keyword_entry;
|
|
72 struct ii_keyword_entry
|
|
73 {
|
|
74 Lisp_Object keyword;
|
|
75 void (*validate) (Lisp_Object data);
|
|
76 int multiple_p;
|
398
|
77 int copy_p;
|
185
|
78 };
|
|
79
|
|
80 typedef struct
|
|
81 {
|
|
82 Dynarr_declare (ii_keyword_entry);
|
|
83 } ii_keyword_entry_dynarr;
|
|
84
|
398
|
85 extern const struct struct_description iim_description;
|
|
86
|
|
87 enum image_instance_geometry
|
|
88 {
|
|
89 IMAGE_GEOMETRY,
|
|
90 IMAGE_DESIRED_GEOMETRY,
|
|
91 IMAGE_MIN_GEOMETRY,
|
|
92 IMAGE_MAX_GEOMETRY,
|
|
93 IMAGE_UNSPECIFIED_GEOMETRY = ~0
|
|
94 };
|
|
95
|
|
96 #define WIDGET_BORDER_HEIGHT 4
|
|
97 #define WIDGET_BORDER_WIDTH 4
|
|
98
|
0
|
99 struct image_instantiator_methods
|
|
100 {
|
|
101 Lisp_Object symbol;
|
|
102
|
384
|
103 Lisp_Object device; /* sometimes used */
|
|
104
|
185
|
105 ii_keyword_entry_dynarr *keywords;
|
398
|
106 /* consoles this ii is supported on */
|
|
107 console_type_entry_dynarr *consoles;
|
0
|
108 /* Implementation specific methods: */
|
|
109
|
|
110 /* Validate method: Given an instantiator vector, signal an error if
|
|
111 it's invalid for this image-instantiator format. Note that this
|
|
112 validation only occurs after all the keyword-specific validation
|
|
113 has already been performed. This is chiefly useful for making
|
|
114 sure that certain required keywords are present. */
|
|
115 void (*validate_method) (Lisp_Object instantiator);
|
|
116
|
|
117 /* Normalize method: Given an instantiator, convert it to the form
|
|
118 that should be used in a glyph, for devices of type CONSOLE_TYPE.
|
|
119 Signal an error if conversion fails. */
|
|
120 Lisp_Object (*normalize_method) (Lisp_Object instantiator,
|
|
121 Lisp_Object console_type);
|
|
122
|
|
123 /* Possible-dest-types method: Return a mask indicating what dest types
|
|
124 are compatible with this format. */
|
|
125 int (*possible_dest_types_method) (void);
|
|
126
|
|
127 /* Instantiate method: Given an instantiator and a partially
|
|
128 filled-in image instance, complete the filling-in. Return
|
|
129 non-zero if the instantiation succeeds, 0 if it fails.
|
|
130 This must be present. */
|
|
131 void (*instantiate_method) (Lisp_Object image_instance,
|
|
132 Lisp_Object instantiator,
|
|
133 Lisp_Object pointer_fg,
|
|
134 Lisp_Object pointer_bg,
|
124
|
135 int dest_mask,
|
|
136 Lisp_Object domain);
|
384
|
137 /* Property method: Given an image instance, return device specific
|
|
138 properties. */
|
|
139 Lisp_Object (*property_method) (Lisp_Object image_instance,
|
|
140 Lisp_Object property);
|
|
141 /* Set-property method: Given an image instance, set device specific
|
|
142 properties. */
|
|
143 Lisp_Object (*set_property_method) (Lisp_Object image_instance,
|
|
144 Lisp_Object property,
|
|
145 Lisp_Object val);
|
398
|
146 /* Asynchronously update properties. */
|
|
147 void (*update_method) (Lisp_Object image_instance);
|
|
148
|
|
149 /* Find out the desired geometry, as given by disp, of this image
|
|
150 instance. Actual geometry is stored in the appropriate slots in the
|
|
151 image instance. */
|
|
152 void (*query_geometry_method) (Lisp_Object image_instance,
|
|
153 unsigned int* width, unsigned int* height,
|
|
154 enum image_instance_geometry disp,
|
|
155 Lisp_Object domain);
|
|
156
|
|
157 /* Layout the instance and its children bounded by the provided
|
|
158 dimensions. */
|
|
159 void (*layout_method) (Lisp_Object image_instance,
|
|
160 unsigned int width, unsigned int height,
|
|
161 Lisp_Object domain);
|
0
|
162 };
|
|
163
|
|
164 /***** Calling an image-instantiator method *****/
|
|
165
|
396
|
166 #define HAS_IIFORMAT_METH_P(mstruc, m) (((mstruc)->m##_method) != 0)
|
0
|
167 #define IIFORMAT_METH(mstruc, m, args) (((mstruc)->m##_method) args)
|
|
168
|
|
169 /* Call a void-returning specifier method, if it exists */
|
396
|
170 #define MAYBE_IIFORMAT_METH(mstruc, m, args) \
|
|
171 do { \
|
|
172 struct image_instantiator_methods *MIM_mstruc = (mstruc); \
|
|
173 if (MIM_mstruc && HAS_IIFORMAT_METH_P (MIM_mstruc, m)) \
|
|
174 IIFORMAT_METH (MIM_mstruc, m, args); \
|
0
|
175 } while (0)
|
|
176
|
396
|
177 #define MAYBE_IIFORMAT_DEVMETH(device, mstruc, m, args) \
|
|
178 do { \
|
|
179 struct image_instantiator_methods *MID_mstruc = \
|
|
180 decode_ii_device (device, mstruc); \
|
|
181 if (MID_mstruc) \
|
|
182 MAYBE_IIFORMAT_METH(MID_mstruc, m, args); \
|
384
|
183 } while (0)
|
|
184
|
|
185
|
0
|
186 /* Call a specifier method, if it exists; otherwise return
|
|
187 the specified value */
|
|
188
|
272
|
189 #define IIFORMAT_METH_OR_GIVEN(mstruc, m, args, given) \
|
|
190 (HAS_IIFORMAT_METH_P (mstruc, m) ? \
|
|
191 IIFORMAT_METH (mstruc, m, args) : (given))
|
0
|
192
|
|
193 /***** Defining new image-instantiator types *****/
|
|
194
|
185
|
195 #define DECLARE_IMAGE_INSTANTIATOR_FORMAT(format) \
|
0
|
196 extern struct image_instantiator_methods *format##_image_instantiator_methods
|
|
197
|
185
|
198 #define DEFINE_IMAGE_INSTANTIATOR_FORMAT(format) \
|
0
|
199 struct image_instantiator_methods *format##_image_instantiator_methods
|
|
200
|
384
|
201 #define INITIALIZE_IMAGE_INSTANTIATOR_FORMAT_NO_SYM(format, obj_name) \
|
185
|
202 do { \
|
|
203 format##_image_instantiator_methods = \
|
272
|
204 xnew_and_zero (struct image_instantiator_methods); \
|
185
|
205 format##_image_instantiator_methods->symbol = Q##format; \
|
384
|
206 format##_image_instantiator_methods->device = Qnil; \
|
185
|
207 format##_image_instantiator_methods->keywords = \
|
|
208 Dynarr_new (ii_keyword_entry); \
|
398
|
209 format##_image_instantiator_methods->consoles = \
|
|
210 Dynarr_new (console_type_entry); \
|
185
|
211 add_entry_to_image_instantiator_format_list \
|
|
212 (Q##format, format##_image_instantiator_methods); \
|
398
|
213 dumpstruct (&format##_image_instantiator_methods, \
|
|
214 &iim_description); \
|
185
|
215 } while (0)
|
0
|
216
|
384
|
217 #define INITIALIZE_IMAGE_INSTANTIATOR_FORMAT(format, obj_name) \
|
|
218 do { \
|
|
219 defsymbol (&Q##format, obj_name); \
|
398
|
220 INITIALIZE_IMAGE_INSTANTIATOR_FORMAT_NO_SYM(format, obj_name);\
|
384
|
221 } while (0)
|
|
222
|
0
|
223 /* Declare that image-instantiator format FORMAT has method M; used in
|
|
224 initialization routines */
|
|
225 #define IIFORMAT_HAS_METHOD(format, m) \
|
|
226 (format##_image_instantiator_methods->m##_method = format##_##m)
|
|
227
|
384
|
228 #define IIFORMAT_HAS_SHARED_METHOD(format, m, type) \
|
|
229 (format##_image_instantiator_methods->m##_method = type##_##m)
|
|
230
|
0
|
231 /* Declare that KEYW is a valid keyword for image-instantiator format
|
|
232 FORMAT. VALIDATE_FUN if a function that returns whether the data
|
|
233 is valid. The keyword may not appear more than once. */
|
398
|
234 #define IIFORMAT_VALID_GENERIC_KEYWORD(format, keyw, validate_fun, copy, multi) \
|
0
|
235 do { \
|
|
236 struct ii_keyword_entry entry; \
|
|
237 \
|
|
238 entry.keyword = keyw; \
|
|
239 entry.validate = validate_fun; \
|
398
|
240 entry.multiple_p = multi; \
|
|
241 entry.copy_p = copy; \
|
0
|
242 Dynarr_add (format##_image_instantiator_methods->keywords, \
|
|
243 entry); \
|
|
244 } while (0)
|
|
245
|
398
|
246 #define IIFORMAT_VALID_KEYWORD(format, keyw, validate_fun) \
|
|
247 IIFORMAT_VALID_GENERIC_KEYWORD(format, keyw, validate_fun, 1, 0)
|
|
248
|
0
|
249 /* Same as IIFORMAT_VALID_KEYWORD except that the keyword may
|
|
250 appear multiple times. */
|
398
|
251 #define IIFORMAT_VALID_MULTI_KEYWORD(format, keyw, validate_fun) \
|
|
252 IIFORMAT_VALID_GENERIC_KEYWORD(format, keyw, validate_fun, 1, 1)
|
|
253
|
|
254 /* Same as IIFORMAT_VALID_KEYWORD execpt that the argument is not
|
|
255 copied by the specifier functions. This is necessary for things
|
|
256 like callbacks etc. */
|
|
257 #define IIFORMAT_VALID_NONCOPY_KEYWORD(format, keyw, validate_fun) \
|
|
258 IIFORMAT_VALID_GENERIC_KEYWORD(format, keyw, validate_fun, 0, 0)
|
|
259
|
|
260 /* Declare that image-instantiator format FORMAT is supported on
|
|
261 CONSOLE type. */
|
|
262 #define IIFORMAT_VALID_CONSOLE(console, format) \
|
|
263 do { \
|
|
264 struct console_type_entry entry; \
|
|
265 \
|
|
266 entry.symbol = Q##console; \
|
|
267 entry.meths = console##_console_methods; \
|
|
268 Dynarr_add (format##_image_instantiator_methods->consoles, \
|
|
269 entry); \
|
0
|
270 } while (0)
|
|
271
|
404
|
272 #define IIFORMAT_VALID_CONSOLE2(con1, con2, format) \
|
|
273 IIFORMAT_VALID_CONSOLE (con1, format); \
|
|
274 IIFORMAT_VALID_CONSOLE (con2, format);
|
|
275
|
398
|
276 #define DEFINE_DEVICE_IIFORMAT(type, format) \
|
|
277 DECLARE_IMAGE_INSTANTIATOR_FORMAT(format); \
|
384
|
278 struct image_instantiator_methods *type##_##format##_image_instantiator_methods
|
|
279
|
398
|
280 #define INITIALIZE_DEVICE_IIFORMAT(type, format) \
|
|
281 do { \
|
|
282 type##_##format##_image_instantiator_methods = \
|
|
283 xnew_and_zero (struct image_instantiator_methods); \
|
384
|
284 type##_##format##_image_instantiator_methods->symbol = Q##format; \
|
|
285 type##_##format##_image_instantiator_methods->device = Q##type; \
|
|
286 type##_##format##_image_instantiator_methods->keywords = \
|
398
|
287 Dynarr_new (ii_keyword_entry); \
|
|
288 add_entry_to_device_ii_format_list \
|
384
|
289 (Q##type, Q##format, type##_##format##_image_instantiator_methods); \
|
398
|
290 IIFORMAT_VALID_CONSOLE(type,format); \
|
|
291 dumpstruct (&type##_##format##_image_instantiator_methods, \
|
|
292 &iim_description); \
|
384
|
293 } while (0)
|
|
294
|
|
295 /* Declare that image-instantiator format FORMAT has method M; used in
|
|
296 initialization routines */
|
|
297 #define IIFORMAT_HAS_DEVMETHOD(type, format, m) \
|
|
298 (type##_##format##_image_instantiator_methods->m##_method = type##_##format##_##m)
|
398
|
299 #define IIFORMAT_HAS_SHARED_DEVMETHOD(type, format, m, fromformat) \
|
|
300 (type##_##format##_image_instantiator_methods->m##_method = type##_##fromformat##_##m)
|
384
|
301
|
404
|
302 #define IIFORMAT_INHERITS_DEVMETHOD(type, from, format, m) \
|
|
303 (type##_##format##_image_instantiator_methods->m##_method = from##_##format##_##m)
|
|
304 #define IIFORMAT_INHERITS_SHARED_DEVMETHOD(type, from, format, m, fromformat) \
|
|
305 (type##_##format##_image_instantiator_methods->m##_method = from##_##fromformat##_##m)
|
|
306
|
384
|
307 struct image_instantiator_methods *
|
|
308 decode_device_ii_format (Lisp_Object device, Lisp_Object format,
|
|
309 Error_behavior errb);
|
|
310 struct image_instantiator_methods *
|
|
311 decode_image_instantiator_format (Lisp_Object format, Error_behavior errb);
|
|
312
|
0
|
313 void add_entry_to_image_instantiator_format_list (Lisp_Object symbol,
|
|
314 struct image_instantiator_methods *meths);
|
384
|
315 void add_entry_to_device_ii_format_list (Lisp_Object device, Lisp_Object symbol,
|
|
316 struct image_instantiator_methods *meths);
|
0
|
317 Lisp_Object find_keyword_in_vector (Lisp_Object vector,
|
|
318 Lisp_Object keyword);
|
|
319 Lisp_Object find_keyword_in_vector_or_given (Lisp_Object vector,
|
|
320 Lisp_Object keyword,
|
173
|
321 Lisp_Object default_);
|
380
|
322 Lisp_Object simple_image_type_normalize (Lisp_Object inst,
|
278
|
323 Lisp_Object console_type,
|
|
324 Lisp_Object image_type_tag);
|
|
325 Lisp_Object potential_pixmap_file_instantiator (Lisp_Object instantiator,
|
|
326 Lisp_Object file_keyword,
|
|
327 Lisp_Object data_keyword,
|
|
328 Lisp_Object console_type);
|
0
|
329 void check_valid_string (Lisp_Object data);
|
|
330 void check_valid_int (Lisp_Object data);
|
384
|
331 void check_valid_face (Lisp_Object data);
|
|
332 void check_valid_vector (Lisp_Object data);
|
398
|
333 void check_valid_item_list_1 (Lisp_Object items);
|
384
|
334
|
398
|
335 void initialize_subwindow_image_instance (Lisp_Image_Instance*);
|
384
|
336 void subwindow_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
|
|
337 Lisp_Object pointer_fg, Lisp_Object pointer_bg,
|
|
338 int dest_mask, Lisp_Object domain);
|
398
|
339 void widget_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
|
|
340 Lisp_Object pointer_fg, Lisp_Object pointer_bg,
|
|
341 int dest_mask, Lisp_Object domain);
|
|
342 void image_instance_query_geometry (Lisp_Object image_instance,
|
|
343 unsigned int* width, unsigned int* height,
|
|
344 enum image_instance_geometry disp,
|
|
345 Lisp_Object domain);
|
|
346 void image_instance_layout (Lisp_Object image_instance,
|
|
347 unsigned int width, unsigned int height,
|
|
348 Lisp_Object domain);
|
|
349 int invalidate_glyph_geometry_maybe (Lisp_Object glyph_or_ii, struct window* w);
|
384
|
350
|
0
|
351 DECLARE_DOESNT_RETURN (incompatible_image_types (Lisp_Object instantiator,
|
|
352 int given_dest_mask,
|
|
353 int desired_dest_mask));
|
398
|
354 DECLARE_DOESNT_RETURN (signal_image_error (const char *, Lisp_Object));
|
|
355 DECLARE_DOESNT_RETURN (signal_image_error_2 (const char *, Lisp_Object, Lisp_Object));
|
0
|
356
|
272
|
357 /************************************************************************/
|
|
358 /* Image Specifier Object */
|
|
359 /************************************************************************/
|
0
|
360
|
|
361 DECLARE_SPECIFIER_TYPE (image);
|
|
362 #define XIMAGE_SPECIFIER(x) XSPECIFIER_TYPE (x, image)
|
|
363 #define XSETIMAGE_SPECIFIER(x, p) XSETSPECIFIER_TYPE (x, p, image)
|
|
364 #define IMAGE_SPECIFIERP(x) SPECIFIER_TYPEP (x, image)
|
|
365 #define CHECK_IMAGE_SPECIFIER(x) CHECK_SPECIFIER_TYPE (x, image)
|
|
366 #define CONCHECK_IMAGE_SPECIFIER(x) CONCHECK_SPECIFIER_TYPE (x, image)
|
|
367
|
|
368 void set_image_attached_to (Lisp_Object obj, Lisp_Object face_or_glyph,
|
|
369 Lisp_Object property);
|
|
370
|
|
371 struct image_specifier
|
|
372 {
|
|
373 int allowed;
|
|
374 Lisp_Object attachee; /* face or glyph this is attached to, or nil */
|
|
375 Lisp_Object attachee_property;/* property of that face or glyph */
|
|
376 };
|
|
377
|
|
378 #define IMAGE_SPECIFIER_DATA(g) (SPECIFIER_TYPE_DATA (g, image))
|
|
379 #define IMAGE_SPECIFIER_ALLOWED(g) (IMAGE_SPECIFIER_DATA (g)->allowed)
|
|
380 #define IMAGE_SPECIFIER_ATTACHEE(g) (IMAGE_SPECIFIER_DATA (g)->attachee)
|
|
381 #define IMAGE_SPECIFIER_ATTACHEE_PROPERTY(g) \
|
|
382 (IMAGE_SPECIFIER_DATA (g)->attachee_property)
|
|
383
|
|
384 #define XIMAGE_SPECIFIER_ALLOWED(g) \
|
|
385 IMAGE_SPECIFIER_ALLOWED (XIMAGE_SPECIFIER (g))
|
|
386
|
272
|
387 /************************************************************************/
|
|
388 /* Image Instance Object */
|
|
389 /************************************************************************/
|
0
|
390
|
398
|
391 DECLARE_LRECORD (image_instance, Lisp_Image_Instance);
|
|
392 #define XIMAGE_INSTANCE(x) XRECORD (x, image_instance, Lisp_Image_Instance)
|
0
|
393 #define XSETIMAGE_INSTANCE(x, p) XSETRECORD (x, p, image_instance)
|
|
394 #define IMAGE_INSTANCEP(x) RECORDP (x, image_instance)
|
|
395 #define CHECK_IMAGE_INSTANCE(x) CHECK_RECORD (x, image_instance)
|
|
396 #define CONCHECK_IMAGE_INSTANCE(x) CONCHECK_RECORD (x, image_instance)
|
|
397
|
|
398 enum image_instance_type
|
|
399 {
|
|
400 IMAGE_UNKNOWN,
|
|
401 IMAGE_NOTHING,
|
|
402 IMAGE_TEXT,
|
|
403 IMAGE_MONO_PIXMAP,
|
|
404 IMAGE_COLOR_PIXMAP,
|
|
405 IMAGE_POINTER,
|
384
|
406 IMAGE_SUBWINDOW,
|
398
|
407 IMAGE_WIDGET,
|
|
408 IMAGE_LAYOUT
|
0
|
409 };
|
|
410
|
|
411 #define IMAGE_NOTHING_MASK (1 << 0)
|
|
412 #define IMAGE_TEXT_MASK (1 << 1)
|
|
413 #define IMAGE_MONO_PIXMAP_MASK (1 << 2)
|
|
414 #define IMAGE_COLOR_PIXMAP_MASK (1 << 3)
|
|
415 #define IMAGE_POINTER_MASK (1 << 4)
|
|
416 #define IMAGE_SUBWINDOW_MASK (1 << 5)
|
384
|
417 #define IMAGE_WIDGET_MASK (1 << 6)
|
398
|
418 #define IMAGE_LAYOUT_MASK (1 << 7)
|
0
|
419
|
|
420 #define IMAGE_INSTANCE_TYPE_P(ii, type) \
|
187
|
421 (IMAGE_INSTANCEP (ii) && XIMAGE_INSTANCE_TYPE (ii) == type)
|
0
|
422
|
187
|
423 #define NOTHING_IMAGE_INSTANCEP(ii) \
|
|
424 IMAGE_INSTANCE_TYPE_P (ii, IMAGE_NOTHING)
|
|
425 #define TEXT_IMAGE_INSTANCEP(ii) \
|
|
426 IMAGE_INSTANCE_TYPE_P (ii, IMAGE_TEXT)
|
|
427 #define MONO_PIXMAP_IMAGE_INSTANCEP(ii) \
|
|
428 IMAGE_INSTANCE_TYPE_P (ii, IMAGE_MONO_PIXMAP)
|
|
429 #define COLOR_PIXMAP_IMAGE_INSTANCEP(ii) \
|
|
430 IMAGE_INSTANCE_TYPE_P (ii, IMAGE_COLOR_PIXMAP)
|
|
431 #define POINTER_IMAGE_INSTANCEP(ii) \
|
|
432 IMAGE_INSTANCE_TYPE_P (ii, IMAGE_POINTER)
|
|
433 #define SUBWINDOW_IMAGE_INSTANCEP(ii) \
|
|
434 IMAGE_INSTANCE_TYPE_P (ii, IMAGE_SUBWINDOW)
|
384
|
435 #define WIDGET_IMAGE_INSTANCEP(ii) \
|
|
436 IMAGE_INSTANCE_TYPE_P (ii, IMAGE_WIDGET)
|
398
|
437 #define LAYOUT_IMAGE_INSTANCEP(ii) \
|
|
438 IMAGE_INSTANCE_TYPE_P (ii, IMAGE_LAYOUT)
|
0
|
439
|
187
|
440 #define CHECK_NOTHING_IMAGE_INSTANCE(x) do { \
|
|
441 CHECK_IMAGE_INSTANCE (x); \
|
|
442 if (!NOTHING_IMAGE_INSTANCEP (x)) \
|
|
443 x = wrong_type_argument (Qnothing_image_instance_p, (x)); \
|
|
444 } while (0)
|
0
|
445
|
187
|
446 #define CHECK_TEXT_IMAGE_INSTANCE(x) do { \
|
|
447 CHECK_IMAGE_INSTANCE (x); \
|
|
448 if (!TEXT_IMAGE_INSTANCEP (x)) \
|
|
449 x = wrong_type_argument (Qtext_image_instance_p, (x)); \
|
|
450 } while (0)
|
0
|
451
|
187
|
452 #define CHECK_MONO_PIXMAP_IMAGE_INSTANCE(x) do { \
|
|
453 CHECK_IMAGE_INSTANCE (x); \
|
|
454 if (!MONO_PIXMAP_IMAGE_INSTANCEP (x)) \
|
|
455 x = wrong_type_argument (Qmono_pixmap_image_instance_p, (x)); \
|
|
456 } while (0)
|
0
|
457
|
187
|
458 #define CHECK_COLOR_PIXMAP_IMAGE_INSTANCE(x) do { \
|
|
459 CHECK_IMAGE_INSTANCE (x); \
|
|
460 if (!COLOR_PIXMAP_IMAGE_INSTANCEP (x)) \
|
|
461 x = wrong_type_argument (Qcolor_pixmap_image_instance_p, (x)); \
|
|
462 } while (0)
|
0
|
463
|
187
|
464 #define CHECK_POINTER_IMAGE_INSTANCE(x) do { \
|
|
465 CHECK_IMAGE_INSTANCE (x); \
|
|
466 if (!POINTER_IMAGE_INSTANCEP (x)) \
|
|
467 x = wrong_type_argument (Qpointer_image_instance_p, (x)); \
|
|
468 } while (0)
|
|
469
|
|
470 #define CHECK_SUBWINDOW_IMAGE_INSTANCE(x) do { \
|
|
471 CHECK_IMAGE_INSTANCE (x); \
|
384
|
472 if (!SUBWINDOW_IMAGE_INSTANCEP (x) \
|
|
473 && !WIDGET_IMAGE_INSTANCEP (x)) \
|
187
|
474 x = wrong_type_argument (Qsubwindow_image_instance_p, (x)); \
|
|
475 } while (0)
|
0
|
476
|
384
|
477 #define CHECK_WIDGET_IMAGE_INSTANCE(x) do { \
|
|
478 CHECK_IMAGE_INSTANCE (x); \
|
|
479 if (!WIDGET_IMAGE_INSTANCEP (x)) \
|
|
480 x = wrong_type_argument (Qwidget_image_instance_p, (x)); \
|
|
481 } while (0)
|
|
482
|
398
|
483 #define CHECK_LAYOUT_IMAGE_INSTANCE(x) do { \
|
|
484 CHECK_IMAGE_INSTANCE (x); \
|
|
485 if (!LAYOUT_IMAGE_INSTANCEP (x)) \
|
|
486 x = wrong_type_argument (Qlayout_image_instance_p, (x)); \
|
|
487 } while (0)
|
|
488
|
0
|
489 struct Lisp_Image_Instance
|
|
490 {
|
|
491 struct lcrecord_header header;
|
|
492 Lisp_Object device;
|
|
493 Lisp_Object name;
|
398
|
494 /* The glyph from which we were instantiated. This is a weak
|
|
495 reference. */
|
|
496 Lisp_Object parent;
|
0
|
497 enum image_instance_type type;
|
398
|
498 unsigned int x_offset, y_offset; /* for layout purposes */
|
|
499 unsigned int width, height;
|
404
|
500 unsigned long display_hash; /* Hash value representing the structure
|
|
501 of the image_instance when it was
|
|
502 last displayed. */
|
398
|
503 unsigned int dirty : 1;
|
|
504 unsigned int size_changed : 1;
|
|
505 unsigned int text_changed : 1;
|
|
506 unsigned int layout_changed : 1;
|
404
|
507 unsigned int optimize_output : 1; /* For outputting layouts. */
|
398
|
508
|
0
|
509 union
|
187
|
510 {
|
|
511 struct
|
0
|
512 {
|
398
|
513 unsigned int descent;
|
187
|
514 Lisp_Object string;
|
|
515 } text;
|
|
516 struct
|
|
517 {
|
398
|
518 unsigned int depth;
|
|
519 unsigned int slice, maxslice, timeout;
|
187
|
520 Lisp_Object hotspot_x, hotspot_y; /* integer or Qnil */
|
|
521 Lisp_Object filename; /* string or Qnil */
|
|
522 Lisp_Object mask_filename; /* string or Qnil */
|
|
523 Lisp_Object fg, bg; /* foreground and background colors,
|
|
524 if this is a colorized mono-pixmap
|
|
525 or a pointer */
|
265
|
526 Lisp_Object auxdata; /* list or Qnil: any additional data
|
|
527 to be seen from lisp */
|
398
|
528 void* mask; /* mask that can be seen from all windowing systems */
|
187
|
529 } pixmap; /* used for pointers as well */
|
|
530 struct
|
|
531 {
|
384
|
532 Lisp_Object frame;
|
|
533 void* subwindow; /* specific devices can use this as necessary */
|
398
|
534 unsigned int being_displayed : 1; /* used to detect when needs to be unmapped */
|
|
535 unsigned int v_resize : 1; /* Whether the vsize is allowed to change. */
|
|
536 unsigned int h_resize : 1; /* Whether the hsize is allowed to change. */
|
|
537 unsigned int orientation : 1; /* Vertical or horizontal. */
|
|
538 unsigned int justification : 2; /* Left, right or center. */
|
|
539 /* Face for colors and font. We specify this here becuase we
|
|
540 want people to be able to put :face in the instantiator
|
|
541 spec. Using gyph-face is more inconvenient, although more
|
|
542 general. */
|
|
543 Lisp_Object face;
|
|
544 Lisp_Object type;
|
|
545 Lisp_Object props; /* properties or border*/
|
|
546 Lisp_Object items; /* a list of gui_items or children */
|
404
|
547 Lisp_Object pending_items; /* gui_items that should be displayed */
|
|
548 Lisp_Object width; /* dynamic width spec. */
|
|
549 Lisp_Object height; /* dynamic height spec. */
|
398
|
550 /* Change flags to augment dirty. */
|
|
551 unsigned int face_changed : 1;
|
|
552 unsigned int items_changed : 1;
|
187
|
553 } subwindow;
|
|
554 } u;
|
0
|
555
|
|
556 /* console-type- and image-type-specific data */
|
|
557 void *data;
|
|
558 };
|
|
559
|
398
|
560 /* Layout bit-fields. */
|
|
561 #define LAYOUT_HORIZONTAL 0
|
|
562 #define LAYOUT_VERTICAL 1
|
|
563
|
|
564 #define LAYOUT_JUSTIFY_LEFT 0
|
|
565 #define LAYOUT_JUSTIFY_RIGHT 1
|
|
566 #define LAYOUT_JUSTIFY_CENTER 2
|
|
567
|
406
|
568 #define IMAGE_INSTANCE_HASH_DEPTH 0
|
404
|
569
|
398
|
570 /* Accessor macros. */
|
0
|
571 #define IMAGE_INSTANCE_DEVICE(i) ((i)->device)
|
|
572 #define IMAGE_INSTANCE_NAME(i) ((i)->name)
|
398
|
573 #define IMAGE_INSTANCE_PARENT(i) ((i)->parent)
|
|
574 #define IMAGE_INSTANCE_GLYPH(i) (image_instance_parent_glyph(i))
|
0
|
575 #define IMAGE_INSTANCE_TYPE(i) ((i)->type)
|
398
|
576 #define IMAGE_INSTANCE_XOFFSET(i) ((i)->x_offset)
|
|
577 #define IMAGE_INSTANCE_YOFFSET(i) ((i)->y_offset)
|
|
578 #define IMAGE_INSTANCE_WIDTH(i) ((i)->width)
|
|
579 #define IMAGE_INSTANCE_HEIGHT(i) ((i)->height)
|
404
|
580 #define IMAGE_INSTANCE_DISPLAY_HASH(i) ((i)->display_hash)
|
398
|
581 #define IMAGE_INSTANCE_PIXMAP_TYPE_P(i) \
|
|
582 ((IMAGE_INSTANCE_TYPE (i) == IMAGE_MONO_PIXMAP) \
|
0
|
583 || (IMAGE_INSTANCE_TYPE (i) == IMAGE_COLOR_PIXMAP))
|
398
|
584 #define IMAGE_INSTANCE_DIRTYP(i) ((i)->dirty)
|
|
585 #define IMAGE_INSTANCE_NEEDS_LAYOUT(i) \
|
|
586 (IMAGE_INSTANCE_DIRTYP (i) && IMAGE_INSTANCE_LAYOUT_CHANGED (i))
|
|
587 #define IMAGE_INSTANCE_FACE(i) \
|
404
|
588 (GLYPHP (IMAGE_INSTANCE_GLYPH (i)) ? \
|
|
589 XGLYPH_FACE (IMAGE_INSTANCE_GLYPH (i)) : Qnil)
|
0
|
590
|
398
|
591 /* Changed flags */
|
|
592 #define IMAGE_INSTANCE_TEXT_CHANGED(i) ((i)->text_changed)
|
|
593 #define IMAGE_INSTANCE_SIZE_CHANGED(i) ((i)->size_changed)
|
|
594 #define IMAGE_INSTANCE_WIDGET_FACE_CHANGED(i) \
|
|
595 ((i)->u.subwindow.face_changed)
|
|
596 #define IMAGE_INSTANCE_WIDGET_ITEMS_CHANGED(i) \
|
|
597 ((i)->u.subwindow.items_changed)
|
404
|
598 #define IMAGE_INSTANCE_LAYOUT_CHANGED(i) ((i)->layout_changed)
|
|
599 #define IMAGE_INSTANCE_OPTIMIZE_OUTPUT(i) ((i)->optimize_output)
|
0
|
600
|
398
|
601 /* Text properties */
|
|
602 #define IMAGE_INSTANCE_TEXT_STRING(i) ((i)->u.text.string)
|
|
603 #define IMAGE_INSTANCE_TEXT_WIDTH(i) \
|
|
604 IMAGE_INSTANCE_WIDTH(i)
|
|
605 #define IMAGE_INSTANCE_TEXT_HEIGHT(i) \
|
|
606 IMAGE_INSTANCE_HEIGHT(i)
|
|
607 #define IMAGE_INSTANCE_TEXT_DESCENT(i) ((i)->u.text.descent)
|
|
608 #define IMAGE_INSTANCE_TEXT_ASCENT(i) \
|
|
609 (IMAGE_INSTANCE_TEXT_HEIGHT(i) - IMAGE_INSTANCE_TEXT_DESCENT(i))
|
|
610
|
|
611 /* Pixmap properties */
|
|
612 #define IMAGE_INSTANCE_PIXMAP_WIDTH(i) \
|
|
613 IMAGE_INSTANCE_WIDTH(i)
|
|
614 #define IMAGE_INSTANCE_PIXMAP_HEIGHT(i) \
|
|
615 IMAGE_INSTANCE_HEIGHT(i)
|
0
|
616 #define IMAGE_INSTANCE_PIXMAP_DEPTH(i) ((i)->u.pixmap.depth)
|
|
617 #define IMAGE_INSTANCE_PIXMAP_FILENAME(i) ((i)->u.pixmap.filename)
|
|
618 #define IMAGE_INSTANCE_PIXMAP_MASK_FILENAME(i) ((i)->u.pixmap.mask_filename)
|
|
619 #define IMAGE_INSTANCE_PIXMAP_HOTSPOT_X(i) ((i)->u.pixmap.hotspot_x)
|
|
620 #define IMAGE_INSTANCE_PIXMAP_HOTSPOT_Y(i) ((i)->u.pixmap.hotspot_y)
|
|
621 #define IMAGE_INSTANCE_PIXMAP_FG(i) ((i)->u.pixmap.fg)
|
|
622 #define IMAGE_INSTANCE_PIXMAP_BG(i) ((i)->u.pixmap.bg)
|
265
|
623 #define IMAGE_INSTANCE_PIXMAP_AUXDATA(i) ((i)->u.pixmap.auxdata)
|
398
|
624 #define IMAGE_INSTANCE_PIXMAP_MASK(i) ((i)->u.pixmap.mask)
|
|
625 #define IMAGE_INSTANCE_PIXMAP_SLICE(i) ((i)->u.pixmap.slice)
|
|
626 #define IMAGE_INSTANCE_PIXMAP_MAXSLICE(i) ((i)->u.pixmap.maxslice)
|
|
627 #define IMAGE_INSTANCE_PIXMAP_TIMEOUT(i) ((i)->u.pixmap.timeout)
|
0
|
628
|
398
|
629 /* Subwindow properties */
|
|
630 #define IMAGE_INSTANCE_SUBWINDOW_WIDTH(i) \
|
|
631 IMAGE_INSTANCE_WIDTH(i)
|
|
632 #define IMAGE_INSTANCE_SUBWINDOW_HEIGHT(i) \
|
|
633 IMAGE_INSTANCE_HEIGHT(i)
|
384
|
634 #define IMAGE_INSTANCE_SUBWINDOW_ID(i) ((i)->u.subwindow.subwindow)
|
|
635 #define IMAGE_INSTANCE_SUBWINDOW_FRAME(i) ((i)->u.subwindow.frame)
|
|
636 #define IMAGE_INSTANCE_SUBWINDOW_DISPLAYEDP(i) \
|
|
637 ((i)->u.subwindow.being_displayed)
|
398
|
638 #define IMAGE_INSTANCE_SUBWINDOW_V_RESIZEP(i) \
|
|
639 ((i)->u.subwindow.v_resize)
|
|
640 #define IMAGE_INSTANCE_SUBWINDOW_H_RESIZEP(i) \
|
|
641 ((i)->u.subwindow.h_resize)
|
|
642 #define IMAGE_INSTANCE_SUBWINDOW_ORIENT(i) \
|
|
643 ((i)->u.subwindow.orientation)
|
|
644 #define IMAGE_INSTANCE_SUBWINDOW_JUSTIFY(i) \
|
|
645 ((i)->u.subwindow.justification)
|
384
|
646
|
398
|
647 /* Widget properties */
|
384
|
648 #define IMAGE_INSTANCE_WIDGET_WIDTH(i) \
|
398
|
649 IMAGE_INSTANCE_WIDTH(i)
|
384
|
650 #define IMAGE_INSTANCE_WIDGET_HEIGHT(i) \
|
398
|
651 IMAGE_INSTANCE_HEIGHT(i)
|
404
|
652 #define IMAGE_INSTANCE_WIDGET_WIDTH_SUBR(i) ((i)->u.subwindow.width)
|
|
653 #define IMAGE_INSTANCE_WIDGET_HEIGHT_SUBR(i) ((i)->u.subwindow.height)
|
398
|
654 #define IMAGE_INSTANCE_WIDGET_TYPE(i) ((i)->u.subwindow.type)
|
|
655 #define IMAGE_INSTANCE_WIDGET_PROPS(i) ((i)->u.subwindow.props)
|
|
656 #define SET_IMAGE_INSTANCE_WIDGET_FACE(i,f) \
|
|
657 ((i)->u.subwindow.face = f)
|
|
658 #define IMAGE_INSTANCE_WIDGET_FACE(i) \
|
|
659 (!NILP ((i)->u.subwindow.face) ? (i)->u.subwindow.face : \
|
|
660 !NILP (IMAGE_INSTANCE_FACE (i)) ? IMAGE_INSTANCE_FACE (i) : \
|
|
661 Vwidget_face)
|
|
662 #define IMAGE_INSTANCE_WIDGET_ITEMS(i) ((i)->u.subwindow.items)
|
404
|
663 #define IMAGE_INSTANCE_WIDGET_PENDING_ITEMS(i) \
|
|
664 ((i)->u.subwindow.pending_items)
|
398
|
665 #define IMAGE_INSTANCE_WIDGET_ITEM(i) \
|
|
666 (CONSP (IMAGE_INSTANCE_WIDGET_ITEMS (i)) ? \
|
|
667 XCAR (IMAGE_INSTANCE_WIDGET_ITEMS (i)) : \
|
|
668 IMAGE_INSTANCE_WIDGET_ITEMS (i))
|
|
669 #define IMAGE_INSTANCE_WIDGET_TEXT(i) XGUI_ITEM (IMAGE_INSTANCE_WIDGET_ITEM (i))->name
|
|
670
|
|
671 /* Layout properties */
|
|
672 #define IMAGE_INSTANCE_LAYOUT_CHILDREN(i) ((i)->u.subwindow.items)
|
|
673 #define IMAGE_INSTANCE_LAYOUT_BORDER(i) ((i)->u.subwindow.props)
|
384
|
674
|
0
|
675 #define XIMAGE_INSTANCE_DEVICE(i) \
|
|
676 IMAGE_INSTANCE_DEVICE (XIMAGE_INSTANCE (i))
|
|
677 #define XIMAGE_INSTANCE_NAME(i) \
|
|
678 IMAGE_INSTANCE_NAME (XIMAGE_INSTANCE (i))
|
398
|
679 #define XIMAGE_INSTANCE_GLYPH(i) \
|
|
680 IMAGE_INSTANCE_GLYPH (XIMAGE_INSTANCE (i))
|
|
681 #define XIMAGE_INSTANCE_PARENT(i) \
|
|
682 IMAGE_INSTANCE_PARENT (XIMAGE_INSTANCE (i))
|
0
|
683 #define XIMAGE_INSTANCE_TYPE(i) \
|
|
684 IMAGE_INSTANCE_TYPE (XIMAGE_INSTANCE (i))
|
404
|
685 #define XIMAGE_INSTANCE_DISPLAY_HASH(i) \
|
|
686 IMAGE_INSTANCE_DISPLAY_HASH (XIMAGE_INSTANCE (i))
|
398
|
687 #define XIMAGE_INSTANCE_XOFFSET(i) \
|
|
688 IMAGE_INSTANCE_XOFFSET (XIMAGE_INSTANCE (i))
|
|
689 #define XIMAGE_INSTANCE_YOFFSET(i) \
|
|
690 IMAGE_INSTANCE_YOFFSET (XIMAGE_INSTANCE (i))
|
|
691 #define XIMAGE_INSTANCE_DIRTYP(i) \
|
|
692 IMAGE_INSTANCE_DIRTYP (XIMAGE_INSTANCE (i))
|
|
693 #define XIMAGE_INSTANCE_NEEDS_LAYOUT(i) \
|
|
694 IMAGE_INSTANCE_NEEDS_LAYOUT (XIMAGE_INSTANCE (i))
|
|
695 #define XIMAGE_INSTANCE_WIDTH(i) \
|
|
696 IMAGE_INSTANCE_WIDTH (XIMAGE_INSTANCE (i))
|
|
697 #define XIMAGE_INSTANCE_HEIGHT(i) \
|
|
698 IMAGE_INSTANCE_HEIGHT (XIMAGE_INSTANCE (i))
|
|
699 #define XIMAGE_INSTANCE_FACE(i) \
|
|
700 IMAGE_INSTANCE_FACE (XIMAGE_INSTANCE (i))
|
0
|
701
|
|
702 #define XIMAGE_INSTANCE_TEXT_STRING(i) \
|
|
703 IMAGE_INSTANCE_TEXT_STRING (XIMAGE_INSTANCE (i))
|
398
|
704 #define XIMAGE_INSTANCE_TEXT_WIDTH(i) \
|
|
705 IMAGE_INSTANCE_TEXT_WIDTH (XIMAGE_INSTANCE (i))
|
|
706 #define XIMAGE_INSTANCE_TEXT_HEIGHT(i) \
|
|
707 IMAGE_INSTANCE_TEXT_HEIGHT (XIMAGE_INSTANCE (i))
|
|
708 #define XIMAGE_INSTANCE_TEXT_ASCENT(i) \
|
|
709 IMAGE_INSTANCE_TEXT_ASCENT (XIMAGE_INSTANCE (i))
|
|
710 #define XIMAGE_INSTANCE_TEXT_DESCENT(i) \
|
|
711 IMAGE_INSTANCE_TEXT_DESCENT (XIMAGE_INSTANCE (i))
|
0
|
712
|
|
713 #define XIMAGE_INSTANCE_PIXMAP_WIDTH(i) \
|
|
714 IMAGE_INSTANCE_PIXMAP_WIDTH (XIMAGE_INSTANCE (i))
|
|
715 #define XIMAGE_INSTANCE_PIXMAP_HEIGHT(i) \
|
|
716 IMAGE_INSTANCE_PIXMAP_HEIGHT (XIMAGE_INSTANCE (i))
|
|
717 #define XIMAGE_INSTANCE_PIXMAP_DEPTH(i) \
|
|
718 IMAGE_INSTANCE_PIXMAP_DEPTH (XIMAGE_INSTANCE (i))
|
|
719 #define XIMAGE_INSTANCE_PIXMAP_FILENAME(i) \
|
|
720 IMAGE_INSTANCE_PIXMAP_FILENAME (XIMAGE_INSTANCE (i))
|
|
721 #define XIMAGE_INSTANCE_PIXMAP_MASK_FILENAME(i) \
|
|
722 IMAGE_INSTANCE_PIXMAP_MASK_FILENAME (XIMAGE_INSTANCE (i))
|
|
723 #define XIMAGE_INSTANCE_PIXMAP_HOTSPOT_X(i) \
|
|
724 IMAGE_INSTANCE_PIXMAP_HOTSPOT_X (XIMAGE_INSTANCE (i))
|
|
725 #define XIMAGE_INSTANCE_PIXMAP_HOTSPOT_Y(i) \
|
|
726 IMAGE_INSTANCE_PIXMAP_HOTSPOT_Y (XIMAGE_INSTANCE (i))
|
|
727 #define XIMAGE_INSTANCE_PIXMAP_FG(i) \
|
|
728 IMAGE_INSTANCE_PIXMAP_FG (XIMAGE_INSTANCE (i))
|
|
729 #define XIMAGE_INSTANCE_PIXMAP_BG(i) \
|
|
730 IMAGE_INSTANCE_PIXMAP_BG (XIMAGE_INSTANCE (i))
|
398
|
731 #define XIMAGE_INSTANCE_PIXMAP_MASK(i) \
|
|
732 IMAGE_INSTANCE_PIXMAP_MASK (XIMAGE_INSTANCE (i))
|
|
733 #define XIMAGE_INSTANCE_PIXMAP_SLICE(i) \
|
|
734 IMAGE_INSTANCE_PIXMAP_SLICE (XIMAGE_INSTANCE (i))
|
|
735 #define XIMAGE_INSTANCE_PIXMAP_MAXSLICE(i) \
|
|
736 IMAGE_INSTANCE_PIXMAP_MAXSLICE (XIMAGE_INSTANCE (i))
|
|
737 #define XIMAGE_INSTANCE_PIXMAP_TIMEOUT(i) \
|
|
738 IMAGE_INSTANCE_PIXMAP_TIMEOUT (XIMAGE_INSTANCE (i))
|
0
|
739
|
384
|
740 #define XIMAGE_INSTANCE_WIDGET_WIDTH(i) \
|
|
741 IMAGE_INSTANCE_WIDGET_WIDTH (XIMAGE_INSTANCE (i))
|
|
742 #define XIMAGE_INSTANCE_WIDGET_HEIGHT(i) \
|
|
743 IMAGE_INSTANCE_WIDGET_HEIGHT (XIMAGE_INSTANCE (i))
|
404
|
744 #define XIMAGE_INSTANCE_WIDGET_WIDTH_SUBR(i) \
|
|
745 IMAGE_INSTANCE_WIDGET_WIDTH_SUBR (XIMAGE_INSTANCE (i))
|
|
746 #define XIMAGE_INSTANCE_WIDGET_HEIGHT_SUBR(i) \
|
|
747 IMAGE_INSTANCE_WIDGET_HEIGHT_SUBR (XIMAGE_INSTANCE (i))
|
384
|
748 #define XIMAGE_INSTANCE_WIDGET_TYPE(i) \
|
|
749 IMAGE_INSTANCE_WIDGET_TYPE (XIMAGE_INSTANCE (i))
|
|
750 #define XIMAGE_INSTANCE_WIDGET_PROPS(i) \
|
|
751 IMAGE_INSTANCE_WIDGET_PROPS (XIMAGE_INSTANCE (i))
|
|
752 #define XIMAGE_INSTANCE_WIDGET_FACE(i) \
|
|
753 IMAGE_INSTANCE_WIDGET_FACE (XIMAGE_INSTANCE (i))
|
398
|
754 #define XSET_IMAGE_INSTANCE_WIDGET_FACE(i) \
|
|
755 SET_IMAGE_INSTANCE_WIDGET_FACE (XIMAGE_INSTANCE (i))
|
|
756 #define XIMAGE_INSTANCE_WIDGET_ITEM(i) \
|
|
757 IMAGE_INSTANCE_WIDGET_ITEM (XIMAGE_INSTANCE (i))
|
|
758 #define XIMAGE_INSTANCE_WIDGET_ITEMS(i) \
|
|
759 IMAGE_INSTANCE_WIDGET_ITEMS (XIMAGE_INSTANCE (i))
|
404
|
760 #define XIMAGE_INSTANCE_WIDGET_PENDING_ITEMS(i) \
|
|
761 IMAGE_INSTANCE_WIDGET_PENDING_ITEMS (XIMAGE_INSTANCE (i))
|
384
|
762 #define XIMAGE_INSTANCE_WIDGET_TEXT(i) \
|
|
763 IMAGE_INSTANCE_WIDGET_TEXT (XIMAGE_INSTANCE (i))
|
398
|
764
|
|
765 #define XIMAGE_INSTANCE_LAYOUT_CHILDREN(i) \
|
|
766 IMAGE_INSTANCE_LAYOUT_CHILDREN (XIMAGE_INSTANCE (i))
|
|
767 #define XIMAGE_INSTANCE_LAYOUT_BORDER(i) \
|
|
768 IMAGE_INSTANCE_LAYOUT_BORDER (XIMAGE_INSTANCE (i))
|
384
|
769
|
|
770 #define XIMAGE_INSTANCE_SUBWINDOW_WIDTH(i) \
|
|
771 IMAGE_INSTANCE_SUBWINDOW_WIDTH (XIMAGE_INSTANCE (i))
|
|
772 #define XIMAGE_INSTANCE_SUBWINDOW_HEIGHT(i) \
|
|
773 IMAGE_INSTANCE_SUBWINDOW_HEIGHT (XIMAGE_INSTANCE (i))
|
|
774 #define XIMAGE_INSTANCE_SUBWINDOW_ID(i) \
|
|
775 IMAGE_INSTANCE_SUBWINDOW_ID (XIMAGE_INSTANCE (i))
|
|
776 #define XIMAGE_INSTANCE_SUBWINDOW_FRAME(i) \
|
|
777 IMAGE_INSTANCE_SUBWINDOW_FRAME (XIMAGE_INSTANCE (i))
|
|
778 #define XIMAGE_INSTANCE_SUBWINDOW_DISPLAYEDP(i) \
|
|
779 IMAGE_INSTANCE_SUBWINDOW_DISPLAYEDP (XIMAGE_INSTANCE (i))
|
398
|
780 #define XIMAGE_INSTANCE_SUBWINDOW_ORIENT(i) \
|
|
781 IMAGE_INSTANCE_SUBWINDOW_ORIENT (XIMAGE_INSTANCE (i))
|
|
782 #define XIMAGE_INSTANCE_SUBWINDOW_JUSTIFY(i) \
|
|
783 IMAGE_INSTANCE_SUBWINDOW_JUSTIFY (XIMAGE_INSTANCE (i))
|
|
784
|
|
785 #define MARK_IMAGE_INSTANCE_CHANGED(i) \
|
|
786 (IMAGE_INSTANCE_DIRTYP (i) = 1);
|
384
|
787
|
288
|
788 #ifdef HAVE_XPM
|
|
789 Lisp_Object evaluate_xpm_color_symbols (void);
|
|
790 Lisp_Object pixmap_to_lisp_data (Lisp_Object name, int ok_if_data_invalid);
|
|
791 #endif /* HAVE_XPM */
|
|
792 #ifdef HAVE_WINDOW_SYSTEM
|
|
793 Lisp_Object bitmap_to_lisp_data (Lisp_Object name, int *xhot, int *yhot,
|
|
794 int ok_if_data_invalid);
|
398
|
795 int read_bitmap_data_from_file (const char *filename, unsigned int *width,
|
288
|
796 unsigned int *height, unsigned char **datap,
|
|
797 int *x_hot, int *y_hot);
|
|
798 Lisp_Object xbm_mask_file_munging (Lisp_Object alist, Lisp_Object file,
|
380
|
799 Lisp_Object mask_file,
|
288
|
800 Lisp_Object console_type);
|
|
801 #endif
|
|
802
|
272
|
803 /************************************************************************/
|
|
804 /* Glyph Object */
|
|
805 /************************************************************************/
|
0
|
806
|
|
807 enum glyph_type
|
|
808 {
|
|
809 GLYPH_UNKNOWN,
|
|
810 GLYPH_BUFFER,
|
|
811 GLYPH_POINTER,
|
|
812 GLYPH_ICON
|
|
813 };
|
|
814
|
|
815 struct Lisp_Glyph
|
|
816 {
|
|
817 struct lcrecord_header header;
|
|
818
|
|
819 enum glyph_type type;
|
|
820
|
|
821 /* specifiers: */
|
|
822 Lisp_Object image; /* the actual image */
|
|
823 Lisp_Object contrib_p; /* whether to figure into line height */
|
|
824 Lisp_Object baseline; /* percent above baseline */
|
|
825
|
|
826 Lisp_Object face; /* if non-nil, face to use when displaying */
|
|
827
|
|
828 Lisp_Object plist;
|
|
829 void (*after_change) (Lisp_Object glyph, Lisp_Object property,
|
|
830 Lisp_Object locale);
|
|
831
|
398
|
832 unsigned int dirty : 1; /* So that we can selectively
|
|
833 redisplay changed glyphs. */
|
|
834 };
|
|
835 typedef struct Lisp_Glyph Lisp_Glyph;
|
|
836
|
|
837 DECLARE_LRECORD (glyph, Lisp_Glyph);
|
|
838 #define XGLYPH(x) XRECORD (x, glyph, Lisp_Glyph)
|
0
|
839 #define XSETGLYPH(x, p) XSETRECORD (x, p, glyph)
|
|
840 #define GLYPHP(x) RECORDP (x, glyph)
|
|
841 #define CHECK_GLYPH(x) CHECK_RECORD (x, glyph)
|
|
842 #define CONCHECK_GLYPH(x) CONCHECK_RECORD (x, glyph)
|
|
843
|
187
|
844 #define CHECK_BUFFER_GLYPH(x) do { \
|
|
845 CHECK_GLYPH (x); \
|
|
846 if (XGLYPH (x)->type != GLYPH_BUFFER) \
|
|
847 x = wrong_type_argument (Qbuffer_glyph_p, (x)); \
|
|
848 } while (0)
|
0
|
849
|
187
|
850 #define CHECK_POINTER_GLYPH(x) do { \
|
|
851 CHECK_GLYPH (x); \
|
|
852 if (XGLYPH (x)->type != GLYPH_POINTER) \
|
|
853 x = wrong_type_argument (Qpointer_glyph_p, (x)); \
|
|
854 } while (0)
|
0
|
855
|
187
|
856 #define CHECK_ICON_GLYPH(x) do { \
|
|
857 CHECK_GLYPH (x); \
|
|
858 if (XGLYPH (x)->type != GLYPH_ICON) \
|
|
859 x = wrong_type_argument (Qicon_glyph_p, (x)); \
|
|
860 } while (0)
|
0
|
861
|
|
862 #define GLYPH_TYPE(g) ((g)->type)
|
|
863 #define GLYPH_IMAGE(g) ((g)->image)
|
|
864 #define GLYPH_CONTRIB_P(g) ((g)->contrib_p)
|
|
865 #define GLYPH_BASELINE(g) ((g)->baseline)
|
|
866 #define GLYPH_FACE(g) ((g)->face)
|
398
|
867 #define GLYPH_DIRTYP(g) ((g)->dirty)
|
0
|
868
|
|
869 #define XGLYPH_TYPE(g) GLYPH_TYPE (XGLYPH (g))
|
|
870 #define XGLYPH_IMAGE(g) GLYPH_IMAGE (XGLYPH (g))
|
|
871 #define XGLYPH_CONTRIB_P(g) GLYPH_CONTRIB_P (XGLYPH (g))
|
|
872 #define XGLYPH_BASELINE(g) GLYPH_BASELINE (XGLYPH (g))
|
|
873 #define XGLYPH_FACE(g) GLYPH_FACE (XGLYPH (g))
|
398
|
874 #define XGLYPH_DIRTYP(g) GLYPH_DIRTYP (XGLYPH (g))
|
0
|
875
|
398
|
876 #define MARK_GLYPH_CHANGED(g) (GLYPH_DIRTYP (g) = 1);
|
|
877
|
|
878 extern Lisp_Object Qxpm, Qxface, Qetched_in, Qetched_out, Qbevel_in, Qbevel_out;
|
288
|
879 extern Lisp_Object Q_data, Q_file, Q_color_symbols, Qconst_glyph_variable;
|
398
|
880 extern Lisp_Object Qxbm, Qedit_field, Qgroup, Qlabel, Qcombo_box, Qscrollbar;
|
|
881 extern Lisp_Object Qtree_view, Qtab_control, Qprogress_gauge, Q_border;
|
288
|
882 extern Lisp_Object Q_mask_file, Q_mask_data, Q_hotspot_x, Q_hotspot_y;
|
384
|
883 extern Lisp_Object Q_foreground, Q_background, Q_face, Q_descriptor, Q_group;
|
388
|
884 extern Lisp_Object Q_width, Q_height, Q_pixel_width, Q_pixel_height, Q_text;
|
406
|
885 extern Lisp_Object Q_items, Q_properties, Q_image, Qimage_conversion_error;
|
404
|
886 extern Lisp_Object Q_orientation, Qupdate_widget_instances;
|
406
|
887 extern Lisp_Object Qwidget_callback_current_channel;
|
272
|
888 extern Lisp_Object Vcontinuation_glyph, Vcontrol_arrow_glyph, Vhscroll_glyph;
|
|
889 extern Lisp_Object Vinvisible_text_glyph, Voctal_escape_glyph, Vtruncation_glyph;
|
0
|
890 extern Lisp_Object Vxemacs_logo;
|
|
891
|
406
|
892
|
398
|
893 unsigned short glyph_width (Lisp_Object glyph, Lisp_Object domain);
|
|
894 unsigned short glyph_ascent (Lisp_Object glyph, Lisp_Object domain);
|
|
895 unsigned short glyph_descent (Lisp_Object glyph, Lisp_Object domain);
|
|
896 unsigned short glyph_height (Lisp_Object glyph, Lisp_Object domain);
|
0
|
897 Lisp_Object glyph_baseline (Lisp_Object glyph, Lisp_Object domain);
|
|
898 Lisp_Object glyph_face (Lisp_Object glyph, Lisp_Object domain);
|
|
899 int glyph_contrib_p (Lisp_Object glyph, Lisp_Object domain);
|
|
900 Lisp_Object glyph_image_instance (Lisp_Object glyph,
|
|
901 Lisp_Object domain,
|
|
902 Error_behavior errb, int no_quit);
|
|
903 void file_or_data_must_be_present (Lisp_Object instantiator);
|
|
904 void data_must_be_present (Lisp_Object instantiator);
|
|
905 Lisp_Object make_string_from_file (Lisp_Object file);
|
|
906 Lisp_Object tagged_vector_to_alist (Lisp_Object vector);
|
|
907 Lisp_Object alist_to_tagged_vector (Lisp_Object tag, Lisp_Object alist);
|
|
908 void string_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
|
|
909 Lisp_Object pointer_fg, Lisp_Object pointer_bg,
|
124
|
910 int dest_mask, Lisp_Object domain);
|
0
|
911 Lisp_Object allocate_glyph (enum glyph_type type,
|
|
912 void (*after_change) (Lisp_Object glyph,
|
|
913 Lisp_Object property,
|
|
914 Lisp_Object locale));
|
398
|
915 void query_string_geometry ( Lisp_Object string, Lisp_Object face,
|
|
916 unsigned int* width, unsigned int* height,
|
|
917 unsigned int* descent, Lisp_Object domain);
|
|
918 Lisp_Object query_string_font (Lisp_Object string,
|
|
919 Lisp_Object face, Lisp_Object domain);
|
|
920 Lisp_Object add_glyph_animated_timeout (EMACS_INT tickms, Lisp_Object device);
|
|
921 void disable_glyph_animated_timeout (int i);
|
0
|
922
|
272
|
923 /************************************************************************/
|
|
924 /* Glyph Cachels */
|
|
925 /************************************************************************/
|
0
|
926
|
185
|
927 typedef struct glyph_cachel glyph_cachel;
|
0
|
928 struct glyph_cachel
|
|
929 {
|
|
930 Lisp_Object glyph;
|
|
931
|
398
|
932 unsigned int dirty :1; /* I'm copying faces here. I'm not
|
|
933 sure why we need two dirty
|
|
934 flags. Maybe because an image
|
|
935 instance can be dirty and so we
|
|
936 need to frob this in the same way
|
|
937 as other image instance properties. */
|
0
|
938 unsigned int updated :1;
|
398
|
939
|
0
|
940 unsigned short width;
|
|
941 unsigned short ascent;
|
|
942 unsigned short descent;
|
|
943 };
|
|
944
|
|
945 #define CONT_GLYPH_INDEX (glyph_index) 0
|
|
946 #define TRUN_GLYPH_INDEX (glyph_index) 1
|
|
947 #define HSCROLL_GLYPH_INDEX (glyph_index) 2
|
|
948 #define CONTROL_GLYPH_INDEX (glyph_index) 3
|
|
949 #define OCT_ESC_GLYPH_INDEX (glyph_index) 4
|
|
950 #define INVIS_GLYPH_INDEX (glyph_index) 5
|
|
951
|
272
|
952 #define GLYPH_CACHEL(window, index) \
|
0
|
953 Dynarr_atp (window->glyph_cachels, index)
|
272
|
954 #define GLYPH_CACHEL_GLYPH(window, index) \
|
0
|
955 Dynarr_atp (window->glyph_cachels, index)->glyph
|
272
|
956 #define GLYPH_CACHEL_WIDTH(window, index) \
|
0
|
957 Dynarr_atp (window->glyph_cachels, index)->width
|
272
|
958 #define GLYPH_CACHEL_ASCENT(window, index) \
|
0
|
959 Dynarr_atp (window->glyph_cachels, index)->ascent
|
272
|
960 #define GLYPH_CACHEL_DESCENT(window, index) \
|
0
|
961 Dynarr_atp (window->glyph_cachels, index)->descent
|
398
|
962 #define GLYPH_CACHEL_DIRTYP(window, index) \
|
|
963 Dynarr_atp (window->glyph_cachels, index)->dirty
|
0
|
964
|
398
|
965 void mark_glyph_cachels (glyph_cachel_dynarr *elements);
|
0
|
966 void mark_glyph_cachels_as_not_updated (struct window *w);
|
398
|
967 void mark_glyph_cachels_as_clean (struct window *w);
|
0
|
968 void reset_glyph_cachels (struct window *w);
|
398
|
969 glyph_index get_glyph_cachel_index (struct window *w, Lisp_Object glyph);
|
384
|
970
|
0
|
971 #ifdef MEMORY_USAGE_STATS
|
|
972 int compute_glyph_cachel_usage (glyph_cachel_dynarr *glyph_cachels,
|
|
973 struct overhead_stats *ovstats);
|
|
974 #endif /* MEMORY_USAGE_STATS */
|
|
975
|
272
|
976 /************************************************************************/
|
|
977 /* Display Tables */
|
|
978 /************************************************************************/
|
0
|
979
|
384
|
980 Lisp_Object display_table_entry (Emchar, Lisp_Object, Lisp_Object);
|
|
981 void get_display_tables (struct window *, face_index,
|
|
982 Lisp_Object *, Lisp_Object *);
|
|
983
|
|
984 /****************************************************************************
|
|
985 * Subwindow Object *
|
|
986 ****************************************************************************/
|
0
|
987
|
384
|
988 /* redisplay needs a per-frame cache of subwindows being displayed so
|
|
989 * that we known when to unmap them */
|
|
990 typedef struct subwindow_cachel subwindow_cachel;
|
|
991 struct subwindow_cachel
|
|
992 {
|
|
993 Lisp_Object subwindow;
|
398
|
994 unsigned int x, y;
|
|
995 unsigned int width, height;
|
|
996 unsigned int being_displayed : 1;
|
|
997 unsigned int updated : 1;
|
384
|
998 };
|
|
999
|
|
1000 typedef struct
|
|
1001 {
|
|
1002 Dynarr_declare (subwindow_cachel);
|
|
1003 } subwindow_cachel_dynarr;
|
|
1004
|
398
|
1005 void mark_subwindow_cachels (subwindow_cachel_dynarr *elements);
|
384
|
1006 void mark_subwindow_cachels_as_not_updated (struct frame *f);
|
|
1007 void reset_subwindow_cachels (struct frame *f);
|
|
1008 void unmap_subwindow (Lisp_Object subwindow);
|
398
|
1009 void map_subwindow (Lisp_Object subwindow, int x, int y,
|
|
1010 struct display_glyph_area *dga);
|
|
1011 int find_matching_subwindow (struct frame* f, int x, int y, int width, int height);
|
|
1012 void update_widget (Lisp_Object widget);
|
|
1013 void update_subwindow (Lisp_Object subwindow);
|
|
1014 Lisp_Object image_instance_parent_glyph (struct Lisp_Image_Instance*);
|
406
|
1015 int image_instance_changed (Lisp_Object image);
|
0
|
1016
|
398
|
1017 struct expose_ignore
|
|
1018 {
|
|
1019 unsigned int x, y;
|
|
1020 unsigned int width, height;
|
|
1021 struct expose_ignore *next;
|
|
1022 };
|
|
1023
|
|
1024 int check_for_ignored_expose (struct frame* f, int x, int y, int width, int height);
|
|
1025 extern int hold_ignored_expose_registration;
|
|
1026
|
|
1027 #endif /* INCLUDED_glyphs_h_ */
|