1 /* $Xorg: IntrinsicI.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 ******************************************************************/
49 /* $XFree86: xc/lib/Xt/IntrinsicI.h,v 3.8 2001/12/14 19:56:25 dawes Exp $ */
51 #ifndef _XtintrinsicI_h
52 #define _XtintrinsicI_h
55 #include "IntrinsicP.h"
67 #include "TranslateI.h"
69 #define RectObjClassFlag 0x02
70 #define WidgetClassFlag 0x04
71 #define CompositeClassFlag 0x08
72 #define ConstraintClassFlag 0x10
73 #define ShellClassFlag 0x20
74 #define WMShellClassFlag 0x40
75 #define TopLevelClassFlag 0x80
78 * The following macros, though very handy, are not suitable for
79 * IntrinsicP.h as they violate the rule that arguments are to
80 * be evaluated exactly once.
83 #define XtDisplayOfObject(object) \
84 (XtIsWidget(object) ? (object)->core.screen->display : \
85 _XtIsHookObject(object) ? ((HookObject)(object))->hooks.screen->display : \
86 _XtWindowedAncestor(object)->core.screen->display)
88 #define XtScreenOfObject(object) \
89 (XtIsWidget(object) ? (object)->core.screen : \
90 _XtIsHookObject(object) ? ((HookObject)(object))->hooks.screen : \
91 _XtWindowedAncestor(object)->core.screen)
93 #define XtWindowOfObject(object) \
94 ((XtIsWidget(object) ? (object) : _XtWindowedAncestor(object)) \
97 #define XtIsManaged(object) \
98 (XtIsRectObj(object) ? (object)->core.managed : False)
100 #define XtIsSensitive(object) \
101 (XtIsRectObj(object) ? ((object)->core.sensitive && \
102 (object)->core.ancestor_sensitive) : False)
105 /****************************************************************
109 ****************************************************************/
111 #define _XBCOPYFUNC _XtBcopy
112 #include <X11/Xfuncs.h>
114 /* If the alignment characteristics of your machine are right, these may be
119 #define XtMemmove(dst, src, size) \
120 if ((char *)(dst) != (char *)(src)) { \
121 if (size == sizeof(int)) \
122 *((int *) (dst)) = *((int *) (src)); \
123 else if (size == sizeof(char)) \
124 *((char *) (dst)) = *((char *) (src)); \
125 else if (size == sizeof(short)) \
126 *((short *) (dst)) = *((short *) (src)); \
128 (void) memcpy((char *) (dst), (char *) (src), (int) (size)); \
131 #define XtBZero(dst, size) \
132 if (size == sizeof(int)) \
133 *((int *) (dst)) = 0; \
135 bzero((char *) (dst), (int) (size))
137 #define XtMemcmp(b1, b2, size) \
138 (size == sizeof(int) ? \
139 *((int *) (b1)) != *((int *) (b2)) \
140 : memcmp((char *) (b1), (char *) (b2), (int) (size)) \
145 #define XtMemmove(dst, src, size) \
146 if ((char *)(dst) != (char *)(src)) { \
147 (void) memcpy((char *) (dst), (char *) (src), (int) (size)); \
150 #define XtBZero(dst, size) \
151 bzero((char *) (dst), (int) (size))
153 #define XtMemcmp(b1, b2, size) \
154 memcmp((char *) (b1), (char *) (b2), (int) (size))
159 /****************************************************************
161 * Stack cache allocation/free
163 ****************************************************************/
165 #define XtStackAlloc(size, stack_cache_array) \
166 ((size) <= sizeof(stack_cache_array) \
167 ? (XtPointer)(stack_cache_array) \
168 : XtMalloc((unsigned)(size)))
170 #define XtStackFree(pointer, stack_cache_array) \
171 { if ((pointer) != ((XtPointer)(stack_cache_array))) XtFree(pointer); }
173 /***************************************************************
177 **************************************************************/
179 /* used by XtResolvePathname */
180 #ifndef XFILESEARCHPATHDEFAULT
181 #define XFILESEARCHPATHDEFAULT "/usr/lib/X11/%L/%T/%N%S:/usr/lib/X11/%l/%T/%N%S:/usr/lib/X11/%T/%N%S"
184 /* the following two were both "X Toolkit " prior to R4 */
185 #ifndef XTERROR_PREFIX
186 #define XTERROR_PREFIX ""
189 #ifndef XTWARNING_PREFIX
190 #define XTWARNING_PREFIX ""
194 #define ERRORDB "/usr/lib/X11/XtErrorDB"
197 extern String XtCXtToolkitError
;
199 extern void _XtAllocError(
200 String
/* alloc_type */
203 extern void _XtCompileResourceList(
204 XtResourceList
/* resources */,
205 Cardinal
/* num_resources */
208 extern XtGeometryResult
_XtMakeGeometryRequest(
210 XtWidgetGeometry
* /* request */,
211 XtWidgetGeometry
* /* reply_return */,
212 Boolean
* /* clear_rect_obj */
215 extern Boolean
_XtIsHookObject(
219 extern void _XtAddShellToHookObj(
224 extern void _XtGClistFree(Display
*dpy
, XtPerDisplay pd
);
226 /** GeoTattler stuff */
228 #ifdef XT_GEO_TATTLER
230 extern void _XtGeoTab (int);
231 extern void _XtGeoTrace (
234 ) _X_ATTRIBUTE_PRINTF(2,3);
236 #define CALLGEOTAT(f) f
238 #else /* XT_GEO_TATTLER */
240 #define CALLGEOTAT(f)
242 #endif /* XT_GEO_TATTLER */
244 #ifndef XTTRACEMEMORY
246 extern char* __XtMalloc (
249 extern char* __XtCalloc (
256 #define __XtMalloc XtMalloc
257 #define __XtCalloc XtCalloc
260 #endif /* _XtintrinsicI_h */
261 /* DON'T ADD STUFF AFTER THIS #endif */