annotate src/glyphs-x.h @ 428:3ecd8885ac67 r21-2-22

Import from CVS: tag r21-2-22
author cvs
date Mon, 13 Aug 2007 11:28:15 +0200
parents
children 8de8e3f6228a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1 /* X-specific glyphs and related.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2 Copyright (C) 1993, 1994 Free Software Foundation, Inc.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3 Copyright (C) 1995 Board of Trustees, University of Illinois.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4 Copyright (C) 1995, 1996 Ben Wing
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5 Copyright (C) 1995 Sun Microsystems, Inc.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
6
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
7 This file is part of XEmacs.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
8
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
9 XEmacs is free software; you can redistribute it and/or modify it
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
10 under the terms of the GNU General Public License as published by the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
11 Free Software Foundation; either version 2, or (at your option) any
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
12 later version.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
13
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
14 XEmacs is distributed in the hope that it will be useful, but WITHOUT
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
16 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
17 for more details.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
18
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
19 You should have received a copy of the GNU General Public License
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
20 along with XEmacs; see the file COPYING. If not, write to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
21 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
22 Boston, MA 02111-1307, USA. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
23
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
24 /* Synched up with: Not in FSF. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
25
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
26 #ifndef _XEMACS_GLYPHS_X_H_
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
27 #define _XEMACS_GLYPHS_X_H_
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
28
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
29 #include "glyphs.h"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
30
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
31 #ifdef HAVE_X_WINDOWS
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
32
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
33 #include "xintrinsic.h"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
34 #include "../lwlib/lwlib.h"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
35
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
36 /****************************************************************************
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
37 * Image-Instance Object *
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
38 ****************************************************************************/
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
39
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
40 struct x_image_instance_data
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
41 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
42 Pixmap* pixmaps;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
43 Cursor cursor;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
44
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
45 /* If depth>0, then that means that other colors were allocated when
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
46 this pixmap was loaded. These are they; we need to free them when
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
47 finalizing the image instance. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
48 Colormap colormap;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
49 unsigned long *pixels;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
50 int npixels;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
51
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
52 /* Should we hang on to the extra info from the XpmAttributes, like
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
53 the textual color table and the comments? Is that useful? */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
54 };
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
55
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
56 #define X_IMAGE_INSTANCE_DATA(i) ((struct x_image_instance_data *) (i)->data)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
57
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
58 #define IMAGE_INSTANCE_X_PIXMAP(i) (X_IMAGE_INSTANCE_DATA (i)->pixmaps[0])
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
59 #define IMAGE_INSTANCE_X_PIXMAP_SLICE(i,slice) \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
60 (X_IMAGE_INSTANCE_DATA (i)->pixmaps[slice])
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
61 #define IMAGE_INSTANCE_X_PIXMAP_SLICES(i) \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
62 (X_IMAGE_INSTANCE_DATA (i)->pixmaps)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
63 #define IMAGE_INSTANCE_X_MASK(i) \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
64 (Pixmap)(IMAGE_INSTANCE_PIXMAP_MASK (i))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
65 #define IMAGE_INSTANCE_X_CURSOR(i) (X_IMAGE_INSTANCE_DATA (i)->cursor)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
66 #define IMAGE_INSTANCE_X_COLORMAP(i) (X_IMAGE_INSTANCE_DATA (i)->colormap)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
67 #define IMAGE_INSTANCE_X_PIXELS(i) (X_IMAGE_INSTANCE_DATA (i)->pixels)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
68 #define IMAGE_INSTANCE_X_NPIXELS(i) (X_IMAGE_INSTANCE_DATA (i)->npixels)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
69
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
70 #define XIMAGE_INSTANCE_X_PIXMAP(i) \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
71 IMAGE_INSTANCE_X_PIXMAP (XIMAGE_INSTANCE (i))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
72 #define XIMAGE_INSTANCE_X_PIXMAP_SLICES(i) \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
73 IMAGE_INSTANCE_X_PIXMAP_SLICES (XIMAGE_INSTANCE (i))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
74 #define XIMAGE_INSTANCE_X_PIXMAP_SLICE(i) \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
75 IMAGE_INSTANCE_X_PIXMAP_SLICE (XIMAGE_INSTANCE (i))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
76 #define XIMAGE_INSTANCE_X_MASK(i) \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
77 IMAGE_INSTANCE_X_MASK (XIMAGE_INSTANCE (i))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
78 #define XIMAGE_INSTANCE_X_CURSOR(i) \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
79 IMAGE_INSTANCE_X_CURSOR (XIMAGE_INSTANCE (i))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
80 #define XIMAGE_INSTANCE_X_PIXELS(i) \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
81 IMAGE_INSTANCE_X_PIXELS (XIMAGE_INSTANCE (i))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
82 #define XIMAGE_INSTANCE_X_NPIXELS(i) \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
83 IMAGE_INSTANCE_X_NPIXELS (XIMAGE_INSTANCE (i))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
84
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
85 /****************************************************************************
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
86 * Subwindow Object *
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
87 ****************************************************************************/
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
88
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
89 struct x_subwindow_data
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
90 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
91 union
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
92 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
93 struct
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
94 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
95 Display *display;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
96 Window parent_window;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
97 Window clip_window;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
98 } sub;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
99 struct
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
100 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
101 Widget clip_window;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
102 Position x_offset;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
103 Position y_offset;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
104 LWLIB_ID id;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
105 } wid;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
106 } data;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
107 };
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
108
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
109 #define X_SUBWINDOW_INSTANCE_DATA(i) ((struct x_subwindow_data *) (i)->data)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
110
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
111 #define IMAGE_INSTANCE_X_SUBWINDOW_DISPLAY(i) \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
112 (X_SUBWINDOW_INSTANCE_DATA (i)->data.sub.display)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
113 #define IMAGE_INSTANCE_X_SUBWINDOW_PARENT(i) \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
114 (X_SUBWINDOW_INSTANCE_DATA (i)->data.sub.parent_window)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
115 #define IMAGE_INSTANCE_X_CLIPWINDOW(i) \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
116 (X_SUBWINDOW_INSTANCE_DATA (i)->data.sub.clip_window)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
117 #define IMAGE_INSTANCE_X_WIDGET_XOFFSET(i) \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
118 (X_SUBWINDOW_INSTANCE_DATA (i)->data.wid.x_offset)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
119 #define IMAGE_INSTANCE_X_WIDGET_YOFFSET(i) \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
120 (X_SUBWINDOW_INSTANCE_DATA (i)->data.wid.y_offset)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
121 #define IMAGE_INSTANCE_X_WIDGET_LWID(i) \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
122 (X_SUBWINDOW_INSTANCE_DATA (i)->data.wid.id)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
123 #define IMAGE_INSTANCE_X_CLIPWIDGET(i) \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
124 (X_SUBWINDOW_INSTANCE_DATA (i)->data.wid.clip_window)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
125 #define XIMAGE_INSTANCE_X_SUBWINDOW_PARENT(i) \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
126 IMAGE_INSTANCE_X_SUBWINDOW_PARENT (XIMAGE_INSTANCE (i))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
127 #define XIMAGE_INSTANCE_X_SUBWINDOW_DISPLAY(i) \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
128 IMAGE_INSTANCE_X_SUBWINDOW_DISPLAY (XIMAGE_INSTANCE (i))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
129 #define XIMAGE_INSTANCE_X_WIDGET_XOFFSET(i) \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
130 IMAGE_INSTANCE_X_WIDGET_XOFFSET (XIMAGE_INSTANCE (i))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
131 #define XIMAGE_INSTANCE_X_WIDGET_YOFFSET(i) \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
132 IMAGE_INSTANCE_X_WIDGET_YOFFSET (XIMAGE_INSTANCE (i))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
133 #define XIMAGE_INSTANCE_X_WIDGET_LWID(i) \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
134 IMAGE_INSTANCE_X_WIDGET_LWID (XIMAGE_INSTANCE (i))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
135 #define XIMAGE_INSTANCE_X_CLIPWIDGET(i) \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
136 IMAGE_INSTANCE_X_CLIPWIDGET (XIMAGE_INSTANCE (i))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
137 #define XIMAGE_INSTANCE_X_CLIPWINDOW(i) \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
138 IMAGE_INSTANCE_X_CLIPWINDOW (XIMAGE_INSTANCE (i))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
139 #define IMAGE_INSTANCE_X_SUBWINDOW_ID(i) \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
140 ((Window) IMAGE_INSTANCE_SUBWINDOW_ID (i))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
141 #define IMAGE_INSTANCE_X_WIDGET_ID(i) \
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
142 ((Widget) IMAGE_INSTANCE_SUBWINDOW_ID (i))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
143
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
144 #endif /* HAVE_X_WINDOWS */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
145 #endif /* _XEMACS_GLYPHS_X_H_ */