Build Fix -- compatibility issue with newer autoconf
[sxemacs] / src / ui / objects.h
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 SXEmacs
6
7 SXEmacs is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
11
12 SXEmacs is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program.  If not, see <http://www.gnu.org/licenses/>. */
19
20
21 /* Synched up with: Not in FSF. */
22
23 #ifndef INCLUDED_objects_h_
24 #define INCLUDED_objects_h_
25
26 #include "specifier.h"
27
28 void finalose(void *ptr);
29
30 /*****************************************************************************
31  *                        Color Specifier Object                             *
32  *****************************************************************************/
33
34 struct color_specifier {
35         Lisp_Object face;       /* face this is attached to, or nil */
36         Lisp_Object face_property;      /* property of that face */
37 };
38
39 #define COLOR_SPECIFIER_DATA(g) SPECIFIER_TYPE_DATA (g, color)
40 #define COLOR_SPECIFIER_FACE(g) (COLOR_SPECIFIER_DATA (g)->face)
41 #define COLOR_SPECIFIER_FACE_PROPERTY(g) \
42   (COLOR_SPECIFIER_DATA (g)->face_property)
43
44 DECLARE_SPECIFIER_TYPE(color);
45 #define XCOLOR_SPECIFIER(x) XSPECIFIER_TYPE (x, color)
46 #define XSETCOLOR_SPECIFIER(x, p) XSETSPECIFIER_TYPE (x, p, color)
47 #define COLOR_SPECIFIERP(x) SPECIFIER_TYPEP (x, color)
48 #define CHECK_COLOR_SPECIFIER(x) CHECK_SPECIFIER_TYPE (x, color)
49 #define CONCHECK_COLOR_SPECIFIER(x) CONCHECK_SPECIFIER_TYPE (x, color)
50
51 void set_color_attached_to(Lisp_Object obj, Lisp_Object face,
52                            Lisp_Object property);
53
54 /*****************************************************************************
55  *                         Font Specifier Object                             *
56  *****************************************************************************/
57
58 struct font_specifier {
59         Lisp_Object face;       /* face this is attached to, or nil */
60         Lisp_Object face_property;      /* property of that face */
61 };
62
63 #define FONT_SPECIFIER_DATA(g) SPECIFIER_TYPE_DATA (g, font)
64 #define FONT_SPECIFIER_FACE(g) (FONT_SPECIFIER_DATA (g)->face)
65 #define FONT_SPECIFIER_FACE_PROPERTY(g) \
66   (FONT_SPECIFIER_DATA (g)->face_property)
67
68 DECLARE_SPECIFIER_TYPE(font);
69 #define XFONT_SPECIFIER(x) XSPECIFIER_TYPE (x, font)
70 #define XSETFONT_SPECIFIER(x, p) XSETSPECIFIER_TYPE (x, p, font)
71 #define FONT_SPECIFIERP(x) SPECIFIER_TYPEP (x, font)
72 #define CHECK_FONT_SPECIFIER(x) CHECK_SPECIFIER_TYPE (x, font)
73 #define CONCHECK_FONT_SPECIFIER(x) CONCHECK_SPECIFIER_TYPE (x, font)
74
75 void set_font_attached_to(Lisp_Object obj, Lisp_Object face,
76                           Lisp_Object property);
77
78 /*****************************************************************************
79  *                       Face Boolean Specifier Object                       *
80  *****************************************************************************/
81
82 struct face_boolean_specifier {
83         Lisp_Object face;       /* face this is attached to, or nil */
84         Lisp_Object face_property;      /* property of that face */
85 };
86
87 #define FACE_BOOLEAN_SPECIFIER_DATA(g) SPECIFIER_TYPE_DATA (g, face_boolean)
88 #define FACE_BOOLEAN_SPECIFIER_FACE(g) (FACE_BOOLEAN_SPECIFIER_DATA (g)->face)
89 #define FACE_BOOLEAN_SPECIFIER_FACE_PROPERTY(g) \
90   (FACE_BOOLEAN_SPECIFIER_DATA (g)->face_property)
91
92 DECLARE_SPECIFIER_TYPE(face_boolean);
93 extern Lisp_Object Qface_boolean;
94 #define XFACE_BOOLEAN_SPECIFIER(x) XSPECIFIER_TYPE (x, face_boolean)
95 #define XSETFACE_BOOLEAN_SPECIFIER(x, p) \
96   XSETSPECIFIER_TYPE (x, p, 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         struct lcrecord_header header;
116         Lisp_Object name;
117         Lisp_Object device;
118
119         /* console-type-specific data */
120         void *data;
121 };
122
123 DECLARE_LRECORD(color_instance, Lisp_Color_Instance);
124 #define XCOLOR_INSTANCE(x) XRECORD (x, color_instance, Lisp_Color_Instance)
125 #define XSETCOLOR_INSTANCE(x, p) XSETRECORD (x, p, color_instance)
126 #define COLOR_INSTANCEP(x) RECORDP (x, color_instance)
127 #define CHECK_COLOR_INSTANCE(x) CHECK_RECORD (x, color_instance)
128 #define CONCHECK_COLOR_INSTANCE(x) CONCHECK_RECORD (x, color_instance)
129
130 #define COLOR_INSTANCE_NAME(c)   ((c)->name)
131 #define COLOR_INSTANCE_DEVICE(c) ((c)->device)
132
133 /****************************************************************************
134  *                            Font Instance Object                          *
135  ****************************************************************************/
136
137 DECLARE_LRECORD(font_instance, Lisp_Font_Instance);
138 #define XFONT_INSTANCE(x) XRECORD (x, font_instance, Lisp_Font_Instance)
139 #define XSETFONT_INSTANCE(x, p) XSETRECORD (x, p, font_instance)
140 #define FONT_INSTANCEP(x) RECORDP (x, font_instance)
141 #define CHECK_FONT_INSTANCE(x) CHECK_RECORD (x, font_instance)
142 #define CONCHECK_FONT_INSTANCE(x) CONCHECK_RECORD (x, font_instance)
143
144 #ifdef MULE
145 int font_spec_matches_charset(struct device *d, Lisp_Object charset,
146                               const Bufbyte * nonreloc,
147                               Lisp_Object reloc, Bytecount offset,
148                               Bytecount length);
149 #endif
150
151 EXFUN(Fmake_font_instance, 3);
152 EXFUN(Ffont_instance_name, 1);
153 EXFUN(Ffont_instance_p, 1);
154 EXFUN(Ffont_instance_truename, 1);
155
156 extern Lisp_Object Vthe_null_font_instance;
157
158 struct Lisp_Font_Instance {
159         struct lcrecord_header header;
160         Lisp_Object name;
161         Lisp_Object device;
162
163         unsigned short ascent;  /* extracted from `font', or made up */
164         unsigned short descent;
165         unsigned short width;
166         unsigned short height;
167         int proportional_p;
168
169         /* console-type-specific data */
170         void *data;
171 };
172
173 #define FONT_INSTANCE_NAME(f)    ((f)->name)
174 #define FONT_INSTANCE_DEVICE(f)  ((f)->device)
175 #define FONT_INSTANCE_ASCENT(f)  ((f)->ascent)
176 #define FONT_INSTANCE_DESCENT(f) ((f)->descent)
177 #define FONT_INSTANCE_WIDTH(f)   ((f)->width)
178 #define FONT_INSTANCE_HEIGHT(f)  ((f)->height)
179
180 #endif                          /* INCLUDED_objects_h_ */