428
|
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
|
440
|
24 #ifndef INCLUDED_objects_h_
|
|
25 #define INCLUDED_objects_h_
|
428
|
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 #define XCOLOR_SPECIFIER(x) XSPECIFIER_TYPE (x, color)
|
|
48 #define COLOR_SPECIFIERP(x) SPECIFIER_TYPEP (x, color)
|
|
49 #define CHECK_COLOR_SPECIFIER(x) CHECK_SPECIFIER_TYPE (x, color)
|
|
50 #define CONCHECK_COLOR_SPECIFIER(x) CONCHECK_SPECIFIER_TYPE (x, color)
|
|
51
|
|
52 void set_color_attached_to (Lisp_Object obj, Lisp_Object face,
|
|
53 Lisp_Object property);
|
|
54
|
|
55 /*****************************************************************************
|
|
56 * Font Specifier Object *
|
|
57 *****************************************************************************/
|
|
58
|
|
59 struct font_specifier
|
|
60 {
|
|
61 Lisp_Object face; /* face this is attached to, or nil */
|
|
62 Lisp_Object face_property; /* property of that face */
|
|
63 };
|
|
64
|
|
65 #define FONT_SPECIFIER_DATA(g) SPECIFIER_TYPE_DATA (g, font)
|
|
66 #define FONT_SPECIFIER_FACE(g) (FONT_SPECIFIER_DATA (g)->face)
|
|
67 #define FONT_SPECIFIER_FACE_PROPERTY(g) \
|
|
68 (FONT_SPECIFIER_DATA (g)->face_property)
|
|
69
|
|
70 DECLARE_SPECIFIER_TYPE (font);
|
|
71 #define XFONT_SPECIFIER(x) XSPECIFIER_TYPE (x, font)
|
|
72 #define FONT_SPECIFIERP(x) SPECIFIER_TYPEP (x, font)
|
|
73 #define CHECK_FONT_SPECIFIER(x) CHECK_SPECIFIER_TYPE (x, font)
|
|
74 #define CONCHECK_FONT_SPECIFIER(x) CONCHECK_SPECIFIER_TYPE (x, font)
|
|
75
|
|
76 void set_font_attached_to (Lisp_Object obj, Lisp_Object face,
|
|
77 Lisp_Object property);
|
|
78
|
|
79 /*****************************************************************************
|
|
80 * Face Boolean Specifier Object *
|
|
81 *****************************************************************************/
|
|
82
|
|
83 struct face_boolean_specifier
|
|
84 {
|
|
85 Lisp_Object face; /* face this is attached to, or nil */
|
|
86 Lisp_Object face_property; /* property of that face */
|
|
87 };
|
|
88
|
|
89 #define FACE_BOOLEAN_SPECIFIER_DATA(g) SPECIFIER_TYPE_DATA (g, face_boolean)
|
|
90 #define FACE_BOOLEAN_SPECIFIER_FACE(g) (FACE_BOOLEAN_SPECIFIER_DATA (g)->face)
|
|
91 #define FACE_BOOLEAN_SPECIFIER_FACE_PROPERTY(g) \
|
|
92 (FACE_BOOLEAN_SPECIFIER_DATA (g)->face_property)
|
|
93
|
|
94 DECLARE_SPECIFIER_TYPE (face_boolean);
|
|
95 extern Lisp_Object Qface_boolean;
|
|
96 #define XFACE_BOOLEAN_SPECIFIER(x) XSPECIFIER_TYPE (x, face_boolean)
|
|
97 #define FACE_BOOLEAN_SPECIFIERP(x) SPECIFIER_TYPEP (x, face_boolean)
|
|
98 #define CHECK_FACE_BOOLEAN_SPECIFIER(x) \
|
|
99 CHECK_SPECIFIER_TYPE (x, face_boolean)
|
|
100 #define CONCHECK_FACE_BOOLEAN_SPECIFIER(x) \
|
|
101 CONCHECK_SPECIFIER_TYPE (x, face_boolean)
|
|
102
|
|
103 void set_face_boolean_attached_to (Lisp_Object obj, Lisp_Object face,
|
|
104 Lisp_Object property);
|
|
105
|
|
106 /****************************************************************************
|
|
107 * Color Instance Object *
|
|
108 ****************************************************************************/
|
|
109
|
|
110 EXFUN (Fmake_color_instance, 3);
|
|
111
|
|
112 extern Lisp_Object Vthe_null_color_instance;
|
|
113
|
|
114 struct Lisp_Color_Instance
|
|
115 {
|
|
116 struct lcrecord_header header;
|
|
117 Lisp_Object name;
|
|
118 Lisp_Object device;
|
|
119
|
|
120 /* console-type-specific data */
|
|
121 void *data;
|
|
122 };
|
|
123
|
440
|
124 DECLARE_LRECORD (color_instance, Lisp_Color_Instance);
|
|
125 #define XCOLOR_INSTANCE(x) XRECORD (x, color_instance, Lisp_Color_Instance)
|
617
|
126 #define wrap_color_instance(p) wrap_record (p, color_instance)
|
440
|
127 #define COLOR_INSTANCEP(x) RECORDP (x, color_instance)
|
|
128 #define CHECK_COLOR_INSTANCE(x) CHECK_RECORD (x, color_instance)
|
|
129 #define CONCHECK_COLOR_INSTANCE(x) CONCHECK_RECORD (x, color_instance)
|
|
130
|
428
|
131 #define COLOR_INSTANCE_NAME(c) ((c)->name)
|
|
132 #define COLOR_INSTANCE_DEVICE(c) ((c)->device)
|
|
133
|
|
134 /****************************************************************************
|
|
135 * Font Instance Object *
|
|
136 ****************************************************************************/
|
|
137
|
440
|
138 DECLARE_LRECORD (font_instance, Lisp_Font_Instance);
|
|
139 #define XFONT_INSTANCE(x) XRECORD (x, font_instance, Lisp_Font_Instance)
|
617
|
140 #define wrap_font_instance(p) wrap_record (p, font_instance)
|
428
|
141 #define FONT_INSTANCEP(x) RECORDP (x, font_instance)
|
|
142 #define CHECK_FONT_INSTANCE(x) CHECK_RECORD (x, font_instance)
|
|
143 #define CONCHECK_FONT_INSTANCE(x) CONCHECK_RECORD (x, font_instance)
|
|
144
|
|
145 #ifdef MULE
|
|
146 int font_spec_matches_charset (struct device *d, Lisp_Object charset,
|
665
|
147 const Intbyte *nonreloc,
|
428
|
148 Lisp_Object reloc, Bytecount offset,
|
|
149 Bytecount length);
|
|
150 #endif
|
|
151
|
|
152 EXFUN (Fmake_font_instance, 3);
|
|
153 EXFUN (Ffont_instance_name, 1);
|
|
154 EXFUN (Ffont_instance_p, 1);
|
|
155 EXFUN (Ffont_instance_truename, 1);
|
|
156
|
|
157 extern Lisp_Object Vthe_null_font_instance;
|
|
158
|
|
159 struct Lisp_Font_Instance
|
|
160 {
|
|
161 struct lcrecord_header header;
|
|
162 Lisp_Object name;
|
|
163 Lisp_Object device;
|
|
164
|
|
165 unsigned short ascent; /* extracted from `font', or made up */
|
|
166 unsigned short descent;
|
|
167 unsigned short width;
|
|
168 unsigned short height;
|
|
169 int proportional_p;
|
|
170
|
|
171 /* console-type-specific data */
|
|
172 void *data;
|
|
173 };
|
|
174
|
|
175 #define FONT_INSTANCE_NAME(f) ((f)->name)
|
|
176 #define FONT_INSTANCE_DEVICE(f) ((f)->device)
|
|
177 #define FONT_INSTANCE_ASCENT(f) ((f)->ascent)
|
|
178 #define FONT_INSTANCE_DESCENT(f) ((f)->descent)
|
|
179 #define FONT_INSTANCE_WIDTH(f) ((f)->width)
|
|
180 #define FONT_INSTANCE_HEIGHT(f) ((f)->height)
|
|
181
|
440
|
182 #endif /* INCLUDED_objects_h_ */
|