1 /***********************************************************
3 Copyright 1987, 1988, 1994, 1998 The Open Group
5 Permission to use, copy, modify, distribute, and sell this software and its
6 documentation for any purpose is hereby granted without fee, provided that
7 the above copyright notice appear in all copies and that both that
8 copyright notice and this permission notice appear in supporting
11 The above copyright notice and this permission notice shall be included in
12 all copies or substantial portions of the Software.
14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
18 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
19 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 Except as contained in this notice, the name of The Open Group shall not be
22 used in advertising or otherwise to promote the sale, use or other dealings
23 in this Software without prior written authorization from The Open Group.
26 Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts.
30 Permission to use, copy, modify, and distribute this software and its
31 documentation for any purpose and without fee is hereby granted,
32 provided that the above copyright notice appear in all copies and that
33 both that copyright notice and this permission notice appear in
34 supporting documentation, and that the name of Digital not be
35 used in advertising or publicity pertaining to distribution of the
36 software without specific, written prior permission.
38 DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
39 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
40 DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
41 ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
42 WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
43 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
46 ******************************************************************/
48 #ifndef _XtintrinsicI_h
49 #define _XtintrinsicI_h
52 #include "IntrinsicP.h"
64 #include "TranslateI.h"
66 #define RectObjClassFlag 0x02
67 #define WidgetClassFlag 0x04
68 #define CompositeClassFlag 0x08
69 #define ConstraintClassFlag 0x10
70 #define ShellClassFlag 0x20
71 #define WMShellClassFlag 0x40
72 #define TopLevelClassFlag 0x80
75 * The following macros, though very handy, are not suitable for
76 * IntrinsicP.h as they violate the rule that arguments are to
77 * be evaluated exactly once.
80 #define XtDisplayOfObject(object) \
81 (XtIsWidget(object) ? (object)->core.screen->display : \
82 _XtIsHookObject(object) ? ((HookObject)(object))->hooks.screen->display : \
83 _XtWindowedAncestor(object)->core.screen->display)
85 #define XtScreenOfObject(object) \
86 (XtIsWidget(object) ? (object)->core.screen : \
87 _XtIsHookObject(object) ? ((HookObject)(object))->hooks.screen : \
88 _XtWindowedAncestor(object)->core.screen)
90 #define XtWindowOfObject(object) \
91 ((XtIsWidget(object) ? (object) : _XtWindowedAncestor(object)) \
94 #define XtIsManaged(object) \
95 (XtIsRectObj(object) ? (object)->core.managed : False)
97 #define XtIsSensitive(object) \
98 (XtIsRectObj(object) ? ((object)->core.sensitive && \
99 (object)->core.ancestor_sensitive) : False)
102 /****************************************************************
106 ****************************************************************/
108 #define _XBCOPYFUNC _XtBcopy
109 #include <X11/Xfuncs.h>
111 /* If the alignment characteristics of your machine are right, these may be
116 #define XtMemmove(dst, src, size) \
117 if ((char *)(dst) != (char *)(src)) { \
118 if (size == sizeof(int)) \
119 *((int *) (dst)) = *((int *) (src)); \
120 else if (size == sizeof(char)) \
121 *((char *) (dst)) = *((char *) (src)); \
122 else if (size == sizeof(short)) \
123 *((short *) (dst)) = *((short *) (src)); \
125 (void) memcpy((char *) (dst), (char *) (src), (int) (size)); \
128 #define XtBZero(dst, size) \
129 if (size == sizeof(int)) \
130 *((int *) (dst)) = 0; \
132 bzero((char *) (dst), (int) (size))
134 #define XtMemcmp(b1, b2, size) \
135 (size == sizeof(int) ? \
136 *((int *) (b1)) != *((int *) (b2)) \
137 : memcmp((char *) (b1), (char *) (b2), (int) (size)) \
142 #define XtMemmove(dst, src, size) \
143 if ((char *)(dst) != (char *)(src)) { \
144 (void) memcpy((char *) (dst), (char *) (src), (int) (size)); \
147 #define XtBZero(dst, size) \
148 bzero((char *) (dst), (int) (size))
150 #define XtMemcmp(b1, b2, size) \
151 memcmp((char *) (b1), (char *) (b2), (int) (size))
156 /****************************************************************
158 * Stack cache allocation/free
160 ****************************************************************/
162 #define XtStackAlloc(size, stack_cache_array) \
163 ((size) <= sizeof(stack_cache_array) \
164 ? (XtPointer)(stack_cache_array) \
165 : XtMalloc((unsigned)(size)))
167 #define XtStackFree(pointer, stack_cache_array) \
168 { if ((pointer) != ((XtPointer)(stack_cache_array))) XtFree(pointer); }
170 /***************************************************************
174 **************************************************************/
176 /* used by XtResolvePathname */
177 #ifndef XFILESEARCHPATHDEFAULT
178 #define XFILESEARCHPATHDEFAULT "/usr/lib/X11/%L/%T/%N%S:/usr/lib/X11/%l/%T/%N%S:/usr/lib/X11/%T/%N%S"
181 /* the following two were both "X Toolkit " prior to R4 */
182 #ifndef XTERROR_PREFIX
183 #define XTERROR_PREFIX ""
186 #ifndef XTWARNING_PREFIX
187 #define XTWARNING_PREFIX ""
191 #define ERRORDB "/usr/lib/X11/XtErrorDB"
196 extern String XtCXtToolkitError;
198 extern void _XtAllocError(
199 String /* alloc_type */
202 extern void _XtCompileResourceList(
203 XtResourceList /* resources */,
204 Cardinal /* num_resources */
207 extern XtGeometryResult _XtMakeGeometryRequest(
209 XtWidgetGeometry* /* request */,
210 XtWidgetGeometry* /* reply_return */,
211 Boolean* /* clear_rect_obj */
214 extern Boolean _XtIsHookObject(
218 extern void _XtAddShellToHookObj(
223 extern void _XtGClistFree(Display *dpy, XtPerDisplay pd);
225 /** GeoTattler stuff */
227 #ifdef XT_GEO_TATTLER
229 extern void _XtGeoTab (int);
230 extern void _XtGeoTrace (
233 ) _X_ATTRIBUTE_PRINTF(2,3);
235 #define CALLGEOTAT(f) f
237 #else /* XT_GEO_TATTLER */
239 #define CALLGEOTAT(f)
241 #endif /* XT_GEO_TATTLER */
243 #ifndef XTTRACEMEMORY
245 extern char* __XtMalloc (
248 extern char* __XtCalloc (
255 #define __XtMalloc XtMalloc
256 #define __XtCalloc XtCalloc
261 #endif /* _XtintrinsicI_h */
262 /* DON'T ADD STUFF AFTER THIS #endif */