1 /* $Xorg: IntrinsicP.h,v 1.4 2001/02/09 02:03:55 xorgcvs Exp $ */
3 /***********************************************************
5 Copyright 1987, 1988, 1994, 1998 The Open Group
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
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
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.
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.
28 Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts.
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.
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
48 ******************************************************************/
51 #ifndef _XtintrinsicP_h
52 #define _XtintrinsicP_h
54 #include <X11/Intrinsic.h>
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.
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
;
71 typedef unsigned long XtVersionType
;
77 #define XtVersion (XT_VERSION * 1000 + XT_REVISION)
78 #define XtVersionDontCheck 0
80 typedef void (*XtProc
)(
84 typedef void (*XtWidgetClassProc
)(
85 WidgetClass
/* class */
88 typedef void (*XtWidgetProc
)(
92 typedef Boolean (*XtAcceptFocusProc
)(
97 typedef void (*XtArgsProc
)(
100 Cardinal
* /* num_args */
103 typedef void (*XtInitProc
)(
104 Widget
/* request */,
107 Cardinal
* /* num_args */
110 typedef Boolean (*XtSetValuesFunc
)(
112 Widget
/* request */,
115 Cardinal
* /* num_args */
118 typedef Boolean (*XtArgsFunc
)(
121 Cardinal
* /* num_args */
124 typedef void (*XtAlmostProc
)(
127 XtWidgetGeometry
* /* request */,
128 XtWidgetGeometry
* /* reply */
131 typedef void (*XtExposeProc
)(
137 /* compress_exposure options*/
138 #define XtExposeNoCompress ((XtEnum)False)
139 #define XtExposeCompressSeries ((XtEnum)True)
140 #define XtExposeCompressMultiple 2
141 #define XtExposeCompressMaximal 3
144 #define XtExposeGraphicsExpose 0x10
145 #define XtExposeGraphicsExposeMerged 0x20
146 #define XtExposeNoExpose 0x40
147 #define XtExposeNoRegion 0x80
149 typedef void (*XtRealizeProc
)(
151 XtValueMask
* /* mask */,
152 XSetWindowAttributes
* /* attributes */
155 typedef XtGeometryResult (*XtGeometryHandler
)(
157 XtWidgetGeometry
* /* request */,
158 XtWidgetGeometry
* /* reply */
161 typedef void (*XtStringProc
)(
167 String name
; /* resource name */
168 String type
; /* representation type name */
169 XtArgVal value
; /* representation */
170 int size
; /* size of representation */
171 } XtTypedArg
, *XtTypedArgList
;
173 typedef void (*XtAllocateProc
)(
174 WidgetClass
/* widget_class */,
175 Cardinal
* /* constraint_size */,
176 Cardinal
* /* more_bytes */,
178 Cardinal
* /* num_args */,
179 XtTypedArgList
/* typed_args */,
180 Cardinal
* /* num_typed_args */,
181 Widget
* /* widget_return */,
182 XtPointer
* /* more_bytes_return */
185 typedef void (*XtDeallocateProc
)(
187 XtPointer
/* more_bytes */
190 struct _XtStateRec
; /* Forward declare before use for C++ */
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
;
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>
205 #define XtDisplay(widget) DisplayOfScreen((widget)->core.screen)
206 #define XtScreen(widget) ((widget)->core.screen)
207 #define XtWindow(widget) ((widget)->core.window)
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)
215 extern Boolean
XtIsRectObj(Widget
);
216 #define XtIsRectObj(obj) \
217 (((Object)(obj))->object.widget_class->core_class.class_inited & 0x02)
220 extern Boolean
XtIsWidget(Widget
);
221 #define XtIsWidget(obj) \
222 (((Object)(obj))->object.widget_class->core_class.class_inited & 0x04)
225 extern Boolean
XtIsComposite(Widget
);
226 #define XtIsComposite(obj) \
227 (((Object)(obj))->object.widget_class->core_class.class_inited & 0x08)
229 #undef XtIsConstraint
230 extern Boolean
XtIsConstraint(Widget
);
231 #define XtIsConstraint(obj) \
232 (((Object)(obj))->object.widget_class->core_class.class_inited & 0x10)
235 extern Boolean
XtIsShell(Widget
);
236 #define XtIsShell(obj) \
237 (((Object)(obj))->object.widget_class->core_class.class_inited & 0x20)
240 extern Boolean
XtIsWMShell(Widget
);
241 #define XtIsWMShell(obj) \
242 (((Object)(obj))->object.widget_class->core_class.class_inited & 0x40)
244 #undef XtIsTopLevelShell
245 extern Boolean
XtIsTopLevelShell(Widget
);
246 #define XtIsTopLevelShell(obj) \
247 (((Object)(obj))->object.widget_class->core_class.class_inited & 0x80)
250 #define XtCheckSubclass(w, widget_class_ptr, message) \
251 if (!XtIsSubclass(((Widget)(w)), (widget_class_ptr))) { \
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); \
263 #define XtCheckSubclass(w, widget_class, message) /* nothing */
268 extern Widget
_XtWindowedAncestor( /* internal; implementation-dependent */
272 extern void _XtInherit(
276 extern void _XtHandleFocus(
278 XtPointer
/* client_data */,
279 XEvent
* /* event */,
280 Boolean
* /* cont */);
282 extern void XtCreateWindow(
284 unsigned int /* window_class */,
285 Visual
* /* visual */,
286 XtValueMask
/* value_mask */,
287 XSetWindowAttributes
* /* attributes */
290 extern void XtResizeWidget(
292 _XtDimension
/* width */,
293 _XtDimension
/* height */,
294 _XtDimension
/* border_width */
297 extern void XtMoveWidget(
303 extern void XtConfigureWidget(
307 _XtDimension
/* width */,
308 _XtDimension
/* height */,
309 _XtDimension
/* border_width */
312 extern void XtResizeWindow(
316 extern void XtProcessLock(
320 extern void XtProcessUnlock(
326 #endif /* _XtIntrinsicP_h */
327 /* DON'T ADD STUFF AFTER THIS #endif */