Source

XEmacs / src / glyphs.h

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
/* Generic glyph data structures + display tables
   Copyright (C) 1994 Board of Trustees, University of Illinois.
   Copyright (C) 1995, 1996 Ben Wing

This file is part of XEmacs.

XEmacs is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.

XEmacs is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
for more details.

You should have received a copy of the GNU General Public License
along with XEmacs; see the file COPYING.  If not, write to
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.  */

/* Synched up with: Not in FSF. */

#ifndef _XEMACS_GLYPHS_H_
#define _XEMACS_GLYPHS_H_

#include "specifier.h"

/*****************************************************************************
 *                            Image Instantiators                            *
 *****************************************************************************/

struct image_instantiator_methods;

/* Remember the distinction between image instantiator formats and
   image instance types.  Here's an approximate mapping:

  image instantiator format		image instance type
  -------------------------		-------------------
  nothing				nothing
  string				text
  formatted-string			text
  xbm					mono-pixmap, color-pixmap, pointer
  xpm					color-pixmap, mono-pixmap, pointer
  xface					mono-pixmap, color-pixmap, pointer
  gif					color-pixmap
  jpeg					color-pixmap
  png					color-pixmap
  tiff					color-pixmap
  cursor-font				pointer
  font					pointer
  subwindow				subwindow
  inherit				mono-pixmap
  autodetect				mono-pixmap, color-pixmap, pointer,
					  text
*/

typedef struct ii_keyword_entry_dynarr_type
{
  Dynarr_declare (struct ii_keyword_entry);
} Ii_keyword_entry_dynarr;

/* These are methods specific to a particular format of image instantiator
   (e.g. xpm, string, etc.). */

struct image_instantiator_methods
{
  Lisp_Object symbol;

  Ii_keyword_entry_dynarr *keywords;
  /* Implementation specific methods: */

  /* Validate method: Given an instantiator vector, signal an error if
     it's invalid for this image-instantiator format.  Note that this
     validation only occurs after all the keyword-specific validation
     has already been performed.  This is chiefly useful for making
     sure that certain required keywords are present. */
  void (*validate_method) (Lisp_Object instantiator);

  /* Normalize method: Given an instantiator, convert it to the form
     that should be used in a glyph, for devices of type CONSOLE_TYPE.
     Signal an error if conversion fails. */
  Lisp_Object (*normalize_method) (Lisp_Object instantiator,
				   Lisp_Object console_type);

  /* Possible-dest-types method: Return a mask indicating what dest types
     are compatible with this format. */
  int (*possible_dest_types_method) (void);

  /* Instantiate method: Given an instantiator and a partially
     filled-in image instance, complete the filling-in.  Return
     non-zero if the instantiation succeeds, 0 if it fails.
     This must be present. */
  void (*instantiate_method) (Lisp_Object image_instance,
			      Lisp_Object instantiator,
			      Lisp_Object pointer_fg,
			      Lisp_Object pointer_bg,
			      int dest_mask);
};

struct ii_keyword_entry
{
  Lisp_Object keyword;
  void (*validate) (Lisp_Object data);
  int multiple_p;
};

/***** Calling an image-instantiator method *****/

#define HAS_IIFORMAT_METH_P(mstruc, m) ((mstruc)->m##_method)
#define IIFORMAT_METH(mstruc, m, args) (((mstruc)->m##_method) args)

/* Call a void-returning specifier method, if it exists */
#define MAYBE_IIFORMAT_METH(mstruc, m, args)				     \
do {									     \
  struct image_instantiator_methods *_maybe_iiformat_meth_mstruc = (mstruc); \
  if (HAS_IIFORMAT_METH_P (_maybe_iiformat_meth_mstruc, m))		     \
    IIFORMAT_METH (_maybe_iiformat_meth_mstruc, m, args);		     \
} while (0)

MAC_DECLARE_EXTERN (struct image_instantiator_methods *,
		    MTiiformat_meth_or_given)

/* Call a specifier method, if it exists; otherwise return
   the specified value */

#define IIFORMAT_METH_OR_GIVEN(mstruc, m, args, given)		\
MAC_BEGIN							\
  MAC_DECLARE (struct image_instantiator_methods *,		\
	       MTiiformat_meth_or_given, mstruc)		\
  HAS_IIFORMAT_METH_P (MTiiformat_meth_or_given, m) ?		\
    IIFORMAT_METH (MTiiformat_meth_or_given, m, args) : (given)	\
MAC_END

/***** Defining new image-instantiator types *****/

#define DECLARE_IMAGE_INSTANTIATOR_FORMAT(format)			     \
extern struct image_instantiator_methods *format##_image_instantiator_methods

#define DEFINE_IMAGE_INSTANTIATOR_FORMAT(format)			\
struct image_instantiator_methods *format##_image_instantiator_methods

#define INITIALIZE_IMAGE_INSTANTIATOR_FORMAT(format, obj_name)	\
  do {								\
    format##_image_instantiator_methods =			\
      malloc_type_and_zero (struct image_instantiator_methods);	\
    defsymbol (&Q##format, obj_name);				\
    format##_image_instantiator_methods->symbol = Q##format;	\
    format##_image_instantiator_methods->keywords =		\
      Dynarr_new (struct ii_keyword_entry);			\
    add_entry_to_image_instantiator_format_list			\
      (Q##format, format##_image_instantiator_methods);		\
  } while (0)

/* Declare that image-instantiator format FORMAT has method M; used in
   initialization routines */
#define IIFORMAT_HAS_METHOD(format, m) \
  (format##_image_instantiator_methods->m##_method = format##_##m)

/* Declare that KEYW is a valid keyword for image-instantiator format
   FORMAT.  VALIDATE_FUN if a function that returns whether the data
   is valid.  The keyword may not appear more than once. */
#define IIFORMAT_VALID_KEYWORD(format, keyw, validate_fun)	\
  do {								\
    struct ii_keyword_entry entry;				\
								\
    entry.keyword = keyw;					\
    entry.validate = validate_fun;				\
    entry.multiple_p = 0;					\
    Dynarr_add (format##_image_instantiator_methods->keywords,	\
		entry);						\
  } while (0)

/* Same as IIFORMAT_VALID_KEYWORD except that the keyword may
   appear multiple times. */
#define IIFORMAT_VALID_MULTI_KEYWORD(format, keyword, validate_fun)	\
  do {									\
    struct ii_keyword_entry entry;					\
									\
    entry.keyword = keyword;						\
    entry.validate = validate_fun;					\
    entry.multiple_p = 1;						\
    Dynarr_add (format##_image_instantiator_methods->keywords,		\
		entry);							\
  } while (0)

extern Lisp_Object Q_data, Q_file;

void add_entry_to_image_instantiator_format_list (Lisp_Object symbol,
			struct image_instantiator_methods *meths);
Lisp_Object find_keyword_in_vector (Lisp_Object vector,
				    Lisp_Object keyword);
Lisp_Object find_keyword_in_vector_or_given (Lisp_Object vector,
					     Lisp_Object keyword,
					     Lisp_Object defalt);
void check_valid_string (Lisp_Object data);
void check_valid_int (Lisp_Object data);
DECLARE_DOESNT_RETURN (incompatible_image_types (Lisp_Object instantiator,
                                                 int given_dest_mask,
                                                 int desired_dest_mask));

/*****************************************************************************
 *                          Image Specifier Object                           *
 *****************************************************************************/

DECLARE_SPECIFIER_TYPE (image);
extern Lisp_Object Qimage;
#define XIMAGE_SPECIFIER(x) XSPECIFIER_TYPE (x, image)
#define XSETIMAGE_SPECIFIER(x, p) XSETSPECIFIER_TYPE (x, p, image)
#define IMAGE_SPECIFIERP(x) SPECIFIER_TYPEP (x, image)
#define CHECK_IMAGE_SPECIFIER(x) CHECK_SPECIFIER_TYPE (x, image)
#define CONCHECK_IMAGE_SPECIFIER(x) CONCHECK_SPECIFIER_TYPE (x, image)

void set_image_attached_to (Lisp_Object obj, Lisp_Object face_or_glyph,
			    Lisp_Object property);

struct image_specifier
{
  int allowed;
  Lisp_Object attachee;		/* face or glyph this is attached to, or nil */
  Lisp_Object attachee_property;/* property of that face or glyph */
};

#define IMAGE_SPECIFIER_DATA(g) (SPECIFIER_TYPE_DATA (g, image))
#define IMAGE_SPECIFIER_ALLOWED(g) (IMAGE_SPECIFIER_DATA (g)->allowed)
#define IMAGE_SPECIFIER_ATTACHEE(g) (IMAGE_SPECIFIER_DATA (g)->attachee)
#define IMAGE_SPECIFIER_ATTACHEE_PROPERTY(g) \
  (IMAGE_SPECIFIER_DATA (g)->attachee_property)

#define XIMAGE_SPECIFIER_ALLOWED(g) \
  IMAGE_SPECIFIER_ALLOWED (XIMAGE_SPECIFIER (g))

/*****************************************************************************
 *                           Image Instance Object                           *
 *****************************************************************************/

DECLARE_LRECORD (image_instance, struct Lisp_Image_Instance);
#define XIMAGE_INSTANCE(x) \
  XRECORD (x, image_instance, struct Lisp_Image_Instance)
#define XSETIMAGE_INSTANCE(x, p) XSETRECORD (x, p, image_instance)
#define IMAGE_INSTANCEP(x) RECORDP (x, image_instance)
#define GC_IMAGE_INSTANCEP(x) GC_RECORDP (x, image_instance)
#define CHECK_IMAGE_INSTANCE(x) CHECK_RECORD (x, image_instance)
#define CONCHECK_IMAGE_INSTANCE(x) CONCHECK_RECORD (x, image_instance)

enum image_instance_type
{
  IMAGE_UNKNOWN,
  IMAGE_NOTHING,
  IMAGE_TEXT,
  IMAGE_MONO_PIXMAP,
  IMAGE_COLOR_PIXMAP,
  IMAGE_POINTER,
  IMAGE_SUBWINDOW
};

#define IMAGE_NOTHING_MASK (1 << 0)
#define IMAGE_TEXT_MASK (1 << 1)
#define IMAGE_MONO_PIXMAP_MASK (1 << 2)
#define IMAGE_COLOR_PIXMAP_MASK (1 << 3)
#define IMAGE_POINTER_MASK (1 << 4)
#define IMAGE_SUBWINDOW_MASK (1 << 5)

extern Lisp_Object Qnothing_image_instance_p, Qtext_image_instance_p;
extern Lisp_Object Qmono_pixmap_image_instance_p;
extern Lisp_Object Qcolor_pixmap_image_instance_p;
extern Lisp_Object Qpointer_image_instance_p;
extern Lisp_Object Qsubwindow_image_instance_p;

#define IMAGE_INSTANCE_TYPE_P(ii, type) \
  (IMAGE_INSTANCEP (ii) && XIMAGE_INSTANCE_TYPE (ii) == type)

#define NOTHING_IMAGE_INSTANCEP(ii) IMAGE_INSTANCE_TYPE_P (ii, IMAGE_NOTHING)
#define TEXT_IMAGE_INSTANCEP(ii) IMAGE_INSTANCE_TYPE_P (ii, IMAGE_TEXT)
#define MONO_PIXMAP_IMAGE_INSTANCEP(ii) \
  IMAGE_INSTANCE_TYPE_P (ii, IMAGE_MONO_PIXMAP)
#define COLOR_PIXMAP_IMAGE_INSTANCEP(ii) \
  IMAGE_INSTANCE_TYPE_P (ii, IMAGE_COLOR_PIXMAP)
#define POINTER_IMAGE_INSTANCEP(ii) IMAGE_INSTANCE_TYPE_P (ii, IMAGE_POINTER)
#define SUBWINDOW_IMAGE_INSTANCEP(ii) \
  IMAGE_INSTANCE_TYPE_P (ii, IMAGE_SUBWINDOW)

#define CHECK_NOTHING_IMAGE_INSTANCE(x)					\
  do { CHECK_IMAGE_INSTANCE (x);					\
       if (!NOTHING_IMAGE_INSTANCEP (x))				\
	 x = wrong_type_argument (Qnothing_image_instance_p, (x));	\
     } while (0)

#define CHECK_TEXT_IMAGE_INSTANCE(x)					\
  do { CHECK_IMAGE_INSTANCE (x);					\
       if (!TEXT_IMAGE_INSTANCEP (x))					\
	 x = wrong_type_argument (Qtext_image_instance_p, (x));		\
     } while (0)

#define CHECK_MONO_PIXMAP_IMAGE_INSTANCE(x)				\
  do { CHECK_IMAGE_INSTANCE (x);					\
       if (!MONO_PIXMAP_IMAGE_INSTANCEP (x))				\
	 x = wrong_type_argument (Qmono_pixmap_image_instance_p, (x));	\
     } while (0)

#define CHECK_COLOR_PIXMAP_IMAGE_INSTANCE(x)				\
  do { CHECK_IMAGE_INSTANCE (x);					\
       if (!COLOR_PIXMAP_IMAGE_INSTANCEP (x))				\
	 x = wrong_type_argument (Qcolor_pixmap_image_instance_p, (x));	\
     } while (0)

#define CHECK_POINTER_IMAGE_INSTANCE(x)					\
  do { CHECK_IMAGE_INSTANCE (x);					\
       if (!POINTER_IMAGE_INSTANCEP (x))				\
	 x = wrong_type_argument (Qpointer_image_instance_p, (x));	\
     } while (0)

#define CHECK_SUBWINDOW_IMAGE_INSTANCE(x)				\
  do { CHECK_IMAGE_INSTANCE (x);					\
       if (!SUBWINDOW_IMAGE_INSTANCEP (x))				\
	 x = wrong_type_argument (Qsubwindow_image_instance_p, (x));	\
     } while (0)

struct Lisp_Image_Instance
{
  struct lcrecord_header header;
  Lisp_Object device;
  Lisp_Object name;
  enum image_instance_type type;
  union
    {
      struct
	{
	  Lisp_Object string;
	} text;
      struct
	{
	  int width, height, depth;
	  Lisp_Object hotspot_x, hotspot_y; /* integer or Qnil */
	  Lisp_Object filename; /* string or Qnil */
	  Lisp_Object mask_filename; /* string or Qnil */
	  Lisp_Object fg, bg; /* foreground and background colors,
				 if this is a colorized mono-pixmap
				 or a pointer */
	} pixmap; /* used for pointers as well */
      struct
	{
	  int dummy; /* #### fill in this structure */
	} subwindow;
    } u;

  /* console-type- and image-type-specific data */
  void *data;
};

#define IMAGE_INSTANCE_DEVICE(i) ((i)->device)
#define IMAGE_INSTANCE_NAME(i) ((i)->name)
#define IMAGE_INSTANCE_TYPE(i) ((i)->type)
#define IMAGE_INSTANCE_PIXMAP_TYPE_P(i)					\
 ((IMAGE_INSTANCE_TYPE (i) == IMAGE_MONO_PIXMAP)			\
  || (IMAGE_INSTANCE_TYPE (i) == IMAGE_COLOR_PIXMAP))

#define IMAGE_INSTANCE_TEXT_STRING(i) ((i)->u.text.string)

#define IMAGE_INSTANCE_PIXMAP_WIDTH(i) ((i)->u.pixmap.width)
#define IMAGE_INSTANCE_PIXMAP_HEIGHT(i) ((i)->u.pixmap.height)
#define IMAGE_INSTANCE_PIXMAP_DEPTH(i) ((i)->u.pixmap.depth)
#define IMAGE_INSTANCE_PIXMAP_FILENAME(i) ((i)->u.pixmap.filename)
#define IMAGE_INSTANCE_PIXMAP_MASK_FILENAME(i) ((i)->u.pixmap.mask_filename)
#define IMAGE_INSTANCE_PIXMAP_HOTSPOT_X(i) ((i)->u.pixmap.hotspot_x)
#define IMAGE_INSTANCE_PIXMAP_HOTSPOT_Y(i) ((i)->u.pixmap.hotspot_y)
#define IMAGE_INSTANCE_PIXMAP_FG(i) ((i)->u.pixmap.fg)
#define IMAGE_INSTANCE_PIXMAP_BG(i) ((i)->u.pixmap.bg)

#define XIMAGE_INSTANCE_DEVICE(i) \
  IMAGE_INSTANCE_DEVICE (XIMAGE_INSTANCE (i))
#define XIMAGE_INSTANCE_NAME(i) \
  IMAGE_INSTANCE_NAME (XIMAGE_INSTANCE (i))
#define XIMAGE_INSTANCE_TYPE(i) \
  IMAGE_INSTANCE_TYPE (XIMAGE_INSTANCE (i))

#define XIMAGE_INSTANCE_TEXT_STRING(i) \
  IMAGE_INSTANCE_TEXT_STRING (XIMAGE_INSTANCE (i))

#define XIMAGE_INSTANCE_PIXMAP_WIDTH(i) \
  IMAGE_INSTANCE_PIXMAP_WIDTH (XIMAGE_INSTANCE (i))
#define XIMAGE_INSTANCE_PIXMAP_HEIGHT(i) \
  IMAGE_INSTANCE_PIXMAP_HEIGHT (XIMAGE_INSTANCE (i))
#define XIMAGE_INSTANCE_PIXMAP_DEPTH(i) \
  IMAGE_INSTANCE_PIXMAP_DEPTH (XIMAGE_INSTANCE (i))
#define XIMAGE_INSTANCE_PIXMAP_FILENAME(i) \
  IMAGE_INSTANCE_PIXMAP_FILENAME (XIMAGE_INSTANCE (i))
#define XIMAGE_INSTANCE_PIXMAP_MASK_FILENAME(i) \
  IMAGE_INSTANCE_PIXMAP_MASK_FILENAME (XIMAGE_INSTANCE (i))
#define XIMAGE_INSTANCE_PIXMAP_HOTSPOT_X(i) \
  IMAGE_INSTANCE_PIXMAP_HOTSPOT_X (XIMAGE_INSTANCE (i))
#define XIMAGE_INSTANCE_PIXMAP_HOTSPOT_Y(i) \
  IMAGE_INSTANCE_PIXMAP_HOTSPOT_Y (XIMAGE_INSTANCE (i))
#define XIMAGE_INSTANCE_PIXMAP_FG(i) \
  IMAGE_INSTANCE_PIXMAP_FG (XIMAGE_INSTANCE (i))
#define XIMAGE_INSTANCE_PIXMAP_BG(i) \
  IMAGE_INSTANCE_PIXMAP_BG (XIMAGE_INSTANCE (i))

/*****************************************************************************
 *                              Glyph Object                                 *
 *****************************************************************************/

enum glyph_type
{
  GLYPH_UNKNOWN,
  GLYPH_BUFFER,
  GLYPH_POINTER,
  GLYPH_ICON
};

struct Lisp_Glyph
{
  struct lcrecord_header header;

  enum glyph_type type;

  /* specifiers: */
  Lisp_Object image;		/* the actual image */
  Lisp_Object contrib_p;	/* whether to figure into line height */
  Lisp_Object baseline;		/* percent above baseline */

  Lisp_Object face;		/* if non-nil, face to use when displaying */

  Lisp_Object plist;
  void (*after_change) (Lisp_Object glyph, Lisp_Object property,
			Lisp_Object locale);
};

DECLARE_LRECORD (glyph, struct Lisp_Glyph);
#define XGLYPH(x) XRECORD (x, glyph, struct Lisp_Glyph)
#define XSETGLYPH(x, p) XSETRECORD (x, p, glyph)
#define GLYPHP(x) RECORDP (x, glyph)
#define GC_GLYPHP(x) GC_RECORDP (x, glyph)
#define CHECK_GLYPH(x) CHECK_RECORD (x, glyph)
#define CONCHECK_GLYPH(x) CONCHECK_RECORD (x, glyph)

extern Lisp_Object Qbuffer_glyph_p, Qpointer_glyph_p, Qicon_glyph_p;

#define CHECK_BUFFER_GLYPH(x)						\
  do { CHECK_GLYPH (x);							\
       if (XGLYPH (x)->type != GLYPH_BUFFER)				\
	 x = wrong_type_argument (Qbuffer_glyph_p, (x));		\
     } while (0)

#define CHECK_POINTER_GLYPH(x)						\
  do { CHECK_GLYPH (x);							\
       if (XGLYPH (x)->type != GLYPH_POINTER)				\
	 x = wrong_type_argument (Qpointer_glyph_p, (x));		\
     } while (0)

#define CHECK_ICON_GLYPH(x)						\
  do { CHECK_GLYPH (x);							\
       if (XGLYPH (x)->type != GLYPH_ICON)				\
	 x = wrong_type_argument (Qicon_glyph_p, (x));			\
     } while (0)

#define GLYPH_TYPE(g) ((g)->type)
#define GLYPH_IMAGE(g) ((g)->image)
#define GLYPH_CONTRIB_P(g) ((g)->contrib_p)
#define GLYPH_BASELINE(g) ((g)->baseline)
#define GLYPH_FACE(g) ((g)->face)

#define XGLYPH_TYPE(g) GLYPH_TYPE (XGLYPH (g))
#define XGLYPH_IMAGE(g) GLYPH_IMAGE (XGLYPH (g))
#define XGLYPH_CONTRIB_P(g) GLYPH_CONTRIB_P (XGLYPH (g))
#define XGLYPH_BASELINE(g) GLYPH_BASELINE (XGLYPH (g))
#define XGLYPH_FACE(g) GLYPH_FACE (XGLYPH (g))

extern Lisp_Object Vtruncation_glyph, Vcontinuation_glyph, Voctal_escape_glyph;
extern Lisp_Object Vcontrol_arrow_glyph, Vinvisible_text_glyph, Vhscroll_glyph;
extern Lisp_Object Vxemacs_logo;

unsigned short glyph_width (Lisp_Object glyph, Lisp_Object frame_face,
			    face_index window_findex,
			    Lisp_Object window);
unsigned short glyph_ascent (Lisp_Object glyph,  Lisp_Object frame_face,
			     face_index window_findex,
			     Lisp_Object window);
unsigned short glyph_descent (Lisp_Object glyph,
			      Lisp_Object frame_face,
			      face_index window_findex,
			      Lisp_Object window);
unsigned short glyph_height (Lisp_Object glyph,  Lisp_Object frame_face,
			     face_index window_findex,
			     Lisp_Object window);
Lisp_Object glyph_baseline (Lisp_Object glyph, Lisp_Object domain);
Lisp_Object glyph_face (Lisp_Object glyph, Lisp_Object domain);
int glyph_contrib_p (Lisp_Object glyph, Lisp_Object domain);
Lisp_Object glyph_image_instance (Lisp_Object glyph,
				  Lisp_Object domain,
				  Error_behavior errb, int no_quit);
void file_or_data_must_be_present (Lisp_Object instantiator);
void data_must_be_present (Lisp_Object instantiator);
Lisp_Object make_string_from_file (Lisp_Object file);
Lisp_Object tagged_vector_to_alist (Lisp_Object vector);
Lisp_Object alist_to_tagged_vector (Lisp_Object tag, Lisp_Object alist);
void string_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
			 Lisp_Object pointer_fg, Lisp_Object pointer_bg,
			 int dest_mask);
Lisp_Object allocate_glyph (enum glyph_type type,
			    void (*after_change) (Lisp_Object glyph,
						  Lisp_Object property,
						  Lisp_Object locale));

/*****************************************************************************
 *                          Glyph Cachels                             	     *
 *****************************************************************************/

struct glyph_cachel
{
  Lisp_Object glyph;

  unsigned int updated :1;
  unsigned short width;
  unsigned short ascent;
  unsigned short descent;
};

#define CONT_GLYPH_INDEX	(glyph_index) 0
#define TRUN_GLYPH_INDEX	(glyph_index) 1
#define HSCROLL_GLYPH_INDEX	(glyph_index) 2
#define CONTROL_GLYPH_INDEX	(glyph_index) 3
#define OCT_ESC_GLYPH_INDEX	(glyph_index) 4
#define INVIS_GLYPH_INDEX	(glyph_index) 5

#define GLYPH_CACHEL(window, index)				\
  Dynarr_atp (window->glyph_cachels, index)
#define GLYPH_CACHEL_GLYPH(window, index)			\
  Dynarr_atp (window->glyph_cachels, index)->glyph
#define GLYPH_CACHEL_WIDTH(window, index)			\
  Dynarr_atp (window->glyph_cachels, index)->width
#define GLYPH_CACHEL_ASCENT(window, index)			\
  Dynarr_atp (window->glyph_cachels, index)->ascent
#define GLYPH_CACHEL_DESCENT(window, index)			\
  Dynarr_atp (window->glyph_cachels, index)->descent

void mark_glyph_cachels (glyph_cachel_dynarr *elements,
			 void (*markobj) (Lisp_Object));
void mark_glyph_cachels_as_not_updated (struct window *w);
void reset_glyph_cachels (struct window *w);
#ifdef MEMORY_USAGE_STATS
int compute_glyph_cachel_usage (glyph_cachel_dynarr *glyph_cachels,
				struct overhead_stats *ovstats);
#endif /* MEMORY_USAGE_STATS */

/*****************************************************************************
 *                             Display Tables                                *
 *****************************************************************************/

#define DISP_TABLE_SIZE	256
#define DISP_CHAR_ENTRY(dp, c)	((dp)->contents[c])

struct Lisp_Vector *get_display_table (struct window *, face_index);

#endif /* _XEMACS_GLYPHS_H_ */
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.