added new XOrg folders/makefiles
[openwrt/svn-archive/archive.git] / XOrg / headers / native / src / X11 / IntrinsicP.h
1 /* $Xorg: IntrinsicP.h,v 1.4 2001/02/09 02:03:55 xorgcvs Exp $ */
2
3 /***********************************************************
4
5 Copyright 1987, 1988, 1994, 1998 The Open Group
6
7 Permission to use, copy, modify, distribute, and sell this software and its
8 documentation for any purpose is hereby granted without fee, provided that
9 the above copyright notice appear in all copies and that both that
10 copyright notice and this permission notice appear in supporting
11 documentation.
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
20 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
23 Except as contained in this notice, the name of The Open Group shall not be
24 used in advertising or otherwise to promote the sale, use or other dealings
25 in this Software without prior written authorization from The Open Group.
26
27
28 Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts.
29
30 All Rights Reserved
31
32 Permission to use, copy, modify, and distribute this software and its
33 documentation for any purpose and without fee is hereby granted,
34 provided that the above copyright notice appear in all copies and that
35 both that copyright notice and this permission notice appear in
36 supporting documentation, and that the name of Digital not be
37 used in advertising or publicity pertaining to distribution of the
38 software without specific, written prior permission.
39
40 DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
41 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
42 DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
43 ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
44 WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
45 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
46 SOFTWARE.
47
48 ******************************************************************/
49 /* $XFree86$ */
50
51 #ifndef _XtintrinsicP_h
52 #define _XtintrinsicP_h
53
54 #include <X11/Intrinsic.h>
55
56 /*
57 * Field sizes and offsets of XrmResource must match those of XtResource.
58 * Type long is used instead of XrmQuark here because XrmQuark and String
59 * are not the same size on all systems.
60 */
61 typedef struct {
62 long xrm_name; /* Resource name quark */
63 long xrm_class; /* Resource class quark */
64 long xrm_type; /* Resource representation type quark */
65 Cardinal xrm_size; /* Size in bytes of representation */
66 int xrm_offset; /* -offset-1 */
67 long xrm_default_type; /* Default representation type quark */
68 XtPointer xrm_default_addr; /* Default resource address */
69 } XrmResource, *XrmResourceList;
70
71 typedef unsigned long XtVersionType;
72
73 #define XT_VERSION 11
74 #ifndef XT_REVISION
75 #define XT_REVISION 6
76 #endif
77 #define XtVersion (XT_VERSION * 1000 + XT_REVISION)
78 #define XtVersionDontCheck 0
79
80 typedef void (*XtProc)(
81 void
82 );
83
84 typedef void (*XtWidgetClassProc)(
85 WidgetClass /* class */
86 );
87
88 typedef void (*XtWidgetProc)(
89 Widget /* widget */
90 );
91
92 typedef Boolean (*XtAcceptFocusProc)(
93 Widget /* widget */,
94 Time* /* time */
95 );
96
97 typedef void (*XtArgsProc)(
98 Widget /* widget */,
99 ArgList /* args */,
100 Cardinal* /* num_args */
101 );
102
103 typedef void (*XtInitProc)(
104 Widget /* request */,
105 Widget /* new */,
106 ArgList /* args */,
107 Cardinal* /* num_args */
108 );
109
110 typedef Boolean (*XtSetValuesFunc)(
111 Widget /* old */,
112 Widget /* request */,
113 Widget /* new */,
114 ArgList /* args */,
115 Cardinal* /* num_args */
116 );
117
118 typedef Boolean (*XtArgsFunc)(
119 Widget /* widget */,
120 ArgList /* args */,
121 Cardinal* /* num_args */
122 );
123
124 typedef void (*XtAlmostProc)(
125 Widget /* old */,
126 Widget /* new */,
127 XtWidgetGeometry* /* request */,
128 XtWidgetGeometry* /* reply */
129 );
130
131 typedef void (*XtExposeProc)(
132 Widget /* widget */,
133 XEvent* /* event */,
134 Region /* region */
135 );
136
137 /* compress_exposure options*/
138 #define XtExposeNoCompress ((XtEnum)False)
139 #define XtExposeCompressSeries ((XtEnum)True)
140 #define XtExposeCompressMultiple 2
141 #define XtExposeCompressMaximal 3
142
143 /* modifiers */
144 #define XtExposeGraphicsExpose 0x10
145 #define XtExposeGraphicsExposeMerged 0x20
146 #define XtExposeNoExpose 0x40
147 #define XtExposeNoRegion 0x80
148
149 typedef void (*XtRealizeProc)(
150 Widget /* widget */,
151 XtValueMask* /* mask */,
152 XSetWindowAttributes* /* attributes */
153 );
154
155 typedef XtGeometryResult (*XtGeometryHandler)(
156 Widget /* widget */,
157 XtWidgetGeometry* /* request */,
158 XtWidgetGeometry* /* reply */
159 );
160
161 typedef void (*XtStringProc)(
162 Widget /* widget */,
163 String /* str */
164 );
165
166 typedef struct {
167 String name; /* resource name */
168 String type; /* representation type name */
169 XtArgVal value; /* representation */
170 int size; /* size of representation */
171 } XtTypedArg, *XtTypedArgList;
172
173 typedef void (*XtAllocateProc)(
174 WidgetClass /* widget_class */,
175 Cardinal * /* constraint_size */,
176 Cardinal * /* more_bytes */,
177 ArgList /* args */,
178 Cardinal * /* num_args */,
179 XtTypedArgList /* typed_args */,
180 Cardinal * /* num_typed_args */,
181 Widget * /* widget_return */,
182 XtPointer * /* more_bytes_return */
183 );
184
185 typedef void (*XtDeallocateProc)(
186 Widget /* widget */,
187 XtPointer /* more_bytes */
188 );
189
190 struct _XtStateRec; /* Forward declare before use for C++ */
191
192 typedef struct _XtTMRec {
193 XtTranslations translations; /* private to Translation Manager */
194 XtBoundActions proc_table; /* procedure bindings for actions */
195 struct _XtStateRec *current_state; /* Translation Manager state ptr */
196 unsigned long lastEventTime;
197 } XtTMRec, *XtTM;
198
199 #include <X11/CoreP.h>
200 #include <X11/CompositeP.h>
201 #include <X11/ConstrainP.h>
202 #include <X11/ObjectP.h>
203 #include <X11/RectObjP.h>
204
205 #define XtDisplay(widget) DisplayOfScreen((widget)->core.screen)
206 #define XtScreen(widget) ((widget)->core.screen)
207 #define XtWindow(widget) ((widget)->core.window)
208
209 #define XtClass(widget) ((widget)->core.widget_class)
210 #define XtSuperclass(widget) (XtClass(widget)->core_class.superclass)
211 #define XtIsRealized(object) (XtWindowOfObject(object) != None)
212 #define XtParent(widget) ((widget)->core.parent)
213
214 #undef XtIsRectObj
215 extern Boolean XtIsRectObj(Widget);
216 #define XtIsRectObj(obj) \
217 (((Object)(obj))->object.widget_class->core_class.class_inited & 0x02)
218
219 #undef XtIsWidget
220 extern Boolean XtIsWidget(Widget);
221 #define XtIsWidget(obj) \
222 (((Object)(obj))->object.widget_class->core_class.class_inited & 0x04)
223
224 #undef XtIsComposite
225 extern Boolean XtIsComposite(Widget);
226 #define XtIsComposite(obj) \
227 (((Object)(obj))->object.widget_class->core_class.class_inited & 0x08)
228
229 #undef XtIsConstraint
230 extern Boolean XtIsConstraint(Widget);
231 #define XtIsConstraint(obj) \
232 (((Object)(obj))->object.widget_class->core_class.class_inited & 0x10)
233
234 #undef XtIsShell
235 extern Boolean XtIsShell(Widget);
236 #define XtIsShell(obj) \
237 (((Object)(obj))->object.widget_class->core_class.class_inited & 0x20)
238
239 #undef XtIsWMShell
240 extern Boolean XtIsWMShell(Widget);
241 #define XtIsWMShell(obj) \
242 (((Object)(obj))->object.widget_class->core_class.class_inited & 0x40)
243
244 #undef XtIsTopLevelShell
245 extern Boolean XtIsTopLevelShell(Widget);
246 #define XtIsTopLevelShell(obj) \
247 (((Object)(obj))->object.widget_class->core_class.class_inited & 0x80)
248
249 #ifdef DEBUG
250 #define XtCheckSubclass(w, widget_class_ptr, message) \
251 if (!XtIsSubclass(((Widget)(w)), (widget_class_ptr))) { \
252 String params[3]; \
253 Cardinal num_params = 3; \
254 params[0] = ((Widget)(w))->core.widget_class->core_class.class_name;\
255 params[1] = (widget_class_ptr)->core_class.class_name; \
256 params[2] = (message); \
257 XtAppErrorMsg(XtWidgetToApplicationContext((Widget)(w)), \
258 "subclassMismatch", "xtCheckSubclass", "XtToolkitError", \
259 "Widget class %s found when subclass of %s expected: %s",\
260 params, &num_params); \
261 }
262 #else
263 #define XtCheckSubclass(w, widget_class, message) /* nothing */
264 #endif
265
266 _XFUNCPROTOBEGIN
267
268 extern Widget _XtWindowedAncestor( /* internal; implementation-dependent */
269 Widget /* object */
270 );
271
272 extern void _XtInherit(
273 void
274 );
275
276 extern void _XtHandleFocus(
277 Widget /* widget */,
278 XtPointer /* client_data */,
279 XEvent * /* event */,
280 Boolean * /* cont */);
281
282 extern void XtCreateWindow(
283 Widget /* widget */,
284 unsigned int /* window_class */,
285 Visual* /* visual */,
286 XtValueMask /* value_mask */,
287 XSetWindowAttributes* /* attributes */
288 );
289
290 extern void XtResizeWidget(
291 Widget /* widget */,
292 _XtDimension /* width */,
293 _XtDimension /* height */,
294 _XtDimension /* border_width */
295 );
296
297 extern void XtMoveWidget(
298 Widget /* widget */,
299 _XtPosition /* x */,
300 _XtPosition /* y */
301 );
302
303 extern void XtConfigureWidget(
304 Widget /* widget */,
305 _XtPosition /* x */,
306 _XtPosition /* y */,
307 _XtDimension /* width */,
308 _XtDimension /* height */,
309 _XtDimension /* border_width */
310 );
311
312 extern void XtResizeWindow(
313 Widget /* widget */
314 );
315
316 extern void XtProcessLock(
317 void
318 );
319
320 extern void XtProcessUnlock(
321 void
322 );
323
324 _XFUNCPROTOEND
325
326 #endif /* _XtIntrinsicP_h */
327 /* DON'T ADD STUFF AFTER THIS #endif */