0
|
1 /* Generic object functions.
|
|
2 Copyright (C) 1995 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
|
|
24 #ifndef _XEMACS_OBJECTS_H_
|
|
25 #define _XEMACS_OBJECTS_H_
|
|
26
|
|
27 #include "specifier.h"
|
|
28
|
|
29 void finalose (void *ptr);
|
|
30
|
|
31 /*****************************************************************************
|
|
32 * Color Specifier Object *
|
|
33 *****************************************************************************/
|
|
34
|
|
35 struct color_specifier
|
|
36 {
|
|
37 Lisp_Object face; /* face this is attached to, or nil */
|
|
38 Lisp_Object face_property; /* property of that face */
|
|
39 };
|
|
40
|
|
41 #define COLOR_SPECIFIER_DATA(g) (SPECIFIER_TYPE_DATA (g, color))
|
|
42 #define COLOR_SPECIFIER_FACE(g) (COLOR_SPECIFIER_DATA (g)->face)
|
|
43 #define COLOR_SPECIFIER_FACE_PROPERTY(g) \
|
|
44 (COLOR_SPECIFIER_DATA (g)->face_property)
|
|
45
|
|
46 DECLARE_SPECIFIER_TYPE (color);
|
|
47 extern Lisp_Object Qcolor;
|
|
48 #define XCOLOR_SPECIFIER(x) XSPECIFIER_TYPE (x, color)
|
|
49 #define XSETCOLOR_SPECIFIER(x, p) XSETSPECIFIER_TYPE (x, p, color)
|
|
50 #define COLOR_SPECIFIERP(x) SPECIFIER_TYPEP (x, color)
|
|
51 #define CHECK_COLOR_SPECIFIER(x) CHECK_SPECIFIER_TYPE (x, color)
|
|
52 #define CONCHECK_COLOR_SPECIFIER(x) CONCHECK_SPECIFIER_TYPE (x, color)
|
|
53
|
|
54 void set_color_attached_to (Lisp_Object obj, Lisp_Object face,
|
|
55 Lisp_Object property);
|
|
56
|
|
57 /*****************************************************************************
|
|
58 * Font Specifier Object *
|
|
59 *****************************************************************************/
|
|
60
|
|
61 struct font_specifier
|
|
62 {
|
|
63 Lisp_Object face; /* face this is attached to, or nil */
|
|
64 Lisp_Object face_property; /* property of that face */
|
|
65 };
|
|
66
|
|
67 #define FONT_SPECIFIER_DATA(g) (SPECIFIER_TYPE_DATA (g, font))
|
|
68 #define FONT_SPECIFIER_FACE(g) (FONT_SPECIFIER_DATA (g)->face)
|
|
69 #define FONT_SPECIFIER_FACE_PROPERTY(g) \
|
|
70 (FONT_SPECIFIER_DATA (g)->face_property)
|
|
71
|
|
72 DECLARE_SPECIFIER_TYPE (font);
|
|
73 extern Lisp_Object Qfont;
|
|
74 #define XFONT_SPECIFIER(x) XSPECIFIER_TYPE (x, font)
|
|
75 #define XSETFONT_SPECIFIER(x, p) XSETSPECIFIER_TYPE (x, p, font)
|
|
76 #define FONT_SPECIFIERP(x) SPECIFIER_TYPEP (x, font)
|
|
77 #define CHECK_FONT_SPECIFIER(x) CHECK_SPECIFIER_TYPE (x, font)
|
|
78 #define CONCHECK_FONT_SPECIFIER(x) CONCHECK_SPECIFIER_TYPE (x, font)
|
|
79
|
|
80 void set_font_attached_to (Lisp_Object obj, Lisp_Object face,
|
|
81 Lisp_Object property);
|
|
82
|
|
83 /*****************************************************************************
|
|
84 * Face Boolean Specifier Object *
|
|
85 *****************************************************************************/
|
|
86
|
|
87 struct face_boolean_specifier
|
|
88 {
|
|
89 Lisp_Object face; /* face this is attached to, or nil */
|
|
90 Lisp_Object face_property; /* property of that face */
|
|
91 };
|
|
92
|
|
93 #define FACE_BOOLEAN_SPECIFIER_DATA(g) (SPECIFIER_TYPE_DATA (g, face_boolean))
|
|
94 #define FACE_BOOLEAN_SPECIFIER_FACE(g) (FACE_BOOLEAN_SPECIFIER_DATA (g)->face)
|
|
95 #define FACE_BOOLEAN_SPECIFIER_FACE_PROPERTY(g) \
|
|
96 (FACE_BOOLEAN_SPECIFIER_DATA (g)->face_property)
|
|
97
|
|
98 DECLARE_SPECIFIER_TYPE (face_boolean);
|
|
99 extern Lisp_Object Qface_boolean;
|
|
100 #define XFACE_BOOLEAN_SPECIFIER(x) XSPECIFIER_TYPE (x, face_boolean)
|
|
101 #define XSETFACE_BOOLEAN_SPECIFIER(x, p) \
|
|
102 XSETSPECIFIER_TYPE (x, p, face_boolean)
|
|
103 #define FACE_BOOLEAN_SPECIFIERP(x) SPECIFIER_TYPEP (x, face_boolean)
|
|
104 #define CHECK_FACE_BOOLEAN_SPECIFIER(x) \
|
|
105 CHECK_SPECIFIER_TYPE (x, face_boolean)
|
|
106 #define CONCHECK_FACE_BOOLEAN_SPECIFIER(x) \
|
|
107 CONCHECK_SPECIFIER_TYPE (x, face_boolean)
|
|
108
|
|
109 void set_face_boolean_attached_to (Lisp_Object obj, Lisp_Object face,
|
|
110 Lisp_Object property);
|
|
111
|
|
112 /****************************************************************************
|
|
113 * Color Instance Object *
|
|
114 ****************************************************************************/
|
|
115
|
|
116 DECLARE_LRECORD (color_instance, struct Lisp_Color_Instance);
|
|
117 #define XCOLOR_INSTANCE(x) \
|
|
118 XRECORD (x, color_instance, struct Lisp_Color_Instance)
|
|
119 #define XSETCOLOR_INSTANCE(x, p) XSETRECORD (x, p, color_instance)
|
|
120 #define COLOR_INSTANCEP(x) RECORDP (x, color_instance)
|
|
121 #define GC_COLOR_INSTANCEP(x) GC_RECORDP (x, color_instance)
|
|
122 #define CHECK_COLOR_INSTANCE(x) CHECK_RECORD (x, color_instance)
|
|
123 #define CONCHECK_COLOR_INSTANCE(x) CONCHECK_RECORD (x, color_instance)
|
|
124
|
|
125 Lisp_Object Fmake_color_instance (Lisp_Object name, Lisp_Object device,
|
|
126 Lisp_Object no_error);
|
|
127 Lisp_Object Fcolor_instance_p (Lisp_Object obj);
|
|
128 Lisp_Object Fcolor_instance_name (Lisp_Object obj);
|
|
129
|
|
130 extern Lisp_Object Vthe_null_color_instance;
|
|
131
|
|
132 struct Lisp_Color_Instance
|
|
133 {
|
|
134 struct lcrecord_header header;
|
|
135 Lisp_Object name;
|
|
136 Lisp_Object device;
|
|
137
|
|
138 /* console-type-specific data */
|
|
139 void *data;
|
|
140 };
|
|
141
|
2
|
142 #define COLOR_INSTANCE_NAME(c) ((c)->name)
|
0
|
143 #define COLOR_INSTANCE_DEVICE(c) ((c)->device)
|
|
144
|
|
145 /****************************************************************************
|
|
146 * Font Instance Object *
|
|
147 ****************************************************************************/
|
|
148
|
|
149 DECLARE_LRECORD (font_instance, struct Lisp_Font_Instance);
|
|
150 #define XFONT_INSTANCE(x) XRECORD (x, font_instance, struct Lisp_Font_Instance)
|
|
151 #define XSETFONT_INSTANCE(x, p) XSETRECORD (x, p, font_instance)
|
|
152 #define FONT_INSTANCEP(x) RECORDP (x, font_instance)
|
|
153 #define GC_FONT_INSTANCEP(x) GC_RECORDP (x, font_instance)
|
|
154 #define CHECK_FONT_INSTANCE(x) CHECK_RECORD (x, font_instance)
|
|
155 #define CONCHECK_FONT_INSTANCE(x) CONCHECK_RECORD (x, font_instance)
|
|
156
|
16
|
157
|
0
|
158 Lisp_Object Fmake_font_instance (Lisp_Object name, Lisp_Object device,
|
|
159 Lisp_Object no_error);
|
2
|
160 Lisp_Object Ffont_instance_p (Lisp_Object obj);
|
|
161 Lisp_Object Ffont_instance_name (Lisp_Object obj);
|
0
|
162 Lisp_Object Ffont_instance_truename (Lisp_Object obj);
|
|
163
|
|
164 extern Lisp_Object Vthe_null_font_instance;
|
|
165
|
|
166 struct Lisp_Font_Instance
|
|
167 {
|
|
168 struct lcrecord_header header;
|
|
169 Lisp_Object name;
|
|
170 Lisp_Object device;
|
|
171
|
|
172 unsigned short ascent; /* extracted from `font', or made up */
|
|
173 unsigned short descent;
|
|
174 unsigned short width;
|
|
175 unsigned short height;
|
|
176 char proportional_p;
|
|
177
|
|
178 /* console-type-specific data */
|
|
179 void *data;
|
|
180 };
|
|
181
|
2
|
182 #define FONT_INSTANCE_NAME(f) ((f)->name)
|
|
183 #define FONT_INSTANCE_DEVICE(f) ((f)->device)
|
|
184 #define FONT_INSTANCE_ASCENT(f) ((f)->ascent)
|
0
|
185 #define FONT_INSTANCE_DESCENT(f) ((f)->descent)
|
2
|
186 #define FONT_INSTANCE_WIDTH(f) ((f)->width)
|
|
187 #define FONT_INSTANCE_HEIGHT(f) ((f)->height)
|
0
|
188
|
|
189 #endif /* _XEMACS_OBJECTS_H_ */
|