2 * Copyright (c) 1998 by The XFree86 Project, Inc.
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
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
17 * THE XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
18 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
19 * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 * Except as contained in this notice, the name of the XFree86 Project shall
23 * not be used in advertising or otherwise to promote the sale, use or other
24 * dealings in this Software without prior written authorization from the
31 #define XawMax(a, b) ((a) > (b) ? (a) : (b))
32 #define XawMin(a, b) ((a) < (b) ? (a) : (b))
33 #define XawAbs(a) ((a) < 0 ? -(a) : (a))
35 #define XawStackAlloc(size, stk_buffer) \
36 ((size) <= sizeof(stk_buffer) \
37 ? (XtPointer)(stk_buffer) \
38 : XtMalloc((unsigned)(size)))
40 #define XawStackFree(pointer, stk_buffer) \
42 if ((pointer) != (XtPointer)(stk_buffer)) \
43 XtFree((char *)pointer); \
47 #define XtX(w) (((RectObj)w)->rectangle.x)
50 #define XtY(w) (((RectObj)w)->rectangle.y)
53 #define XtWidth(w) (((RectObj)w)->rectangle.width)
56 #define XtHeight(w) (((RectObj)w)->rectangle.height)
59 #define XtBorderWidth(w) (((RectObj)w)->rectangle.border_width)
63 #define XAW_PRIV_VAR_PREFIX '$'
65 typedef Bool (*XawParseBooleanProc)(Widget, String, XEvent*, Bool*);
67 typedef struct _XawActionVarList XawActionVarList;
68 typedef struct _XawActionResList XawActionResList;
70 /* Boolean expressions */
71 Bool XawParseBoolean(Widget, String, XEvent*, Bool*);
72 Bool XawBooleanExpression(Widget, String, XEvent*);
75 void XawPrintActionErrorMsg(String, Widget, String*, Cardinal*);
76 XawActionResList *XawGetActionResList(WidgetClass);
77 XawActionVarList *XawGetActionVarList(Widget);
79 void XawSetValuesAction(Widget, XEvent*, String*, Cardinal*);
80 void XawGetValuesAction(Widget, XEvent*, String*, Cardinal*);
81 void XawDeclareAction(Widget, XEvent*, String*, Cardinal*);
82 void XawCallProcAction(Widget, XEvent*, String*, Cardinal*);
85 #define XAWDL_CONVERT_ERROR (XtPointer)-1
86 typedef struct _XawDL _XawDisplayList;
87 typedef struct _XawDLClass XawDLClass, XawDisplayListClass;
89 typedef void (*XawDisplayListProc)(Widget, XtPointer, XtPointer,
91 typedef void *(*XawDLArgsInitProc)(String, String*, Cardinal*,
92 Screen*, Colormap, int);
93 typedef void *(*XawDLDataInitProc)(String,
94 Screen*, Colormap, int);
95 typedef void (*XawDLArgsDestructor)(Display*, String, XtPointer,
97 typedef void (*XawDLDataDestructor)(Display*, String, XtPointer);
99 void XawRunDisplayList(Widget, _XawDisplayList*, XEvent*, Region);
100 void XawDisplayListInitialize(void);
102 _XawDisplayList *XawCreateDisplayList(String, Screen*, Colormap, int);
103 void XawDestroyDisplayList(_XawDisplayList*);
104 String XawDisplayListString(_XawDisplayList*);
105 XawDLClass *XawGetDisplayListClass(String);
106 XawDLClass *XawCreateDisplayListClass(String,
107 XawDLArgsInitProc, XawDLArgsDestructor,
108 XawDLDataInitProc, XawDLDataDestructor);
109 Bool XawDeclareDisplayListProc(XawDLClass*, String, XawDisplayListProc);
112 typedef struct _XawArgVal {
117 typedef struct _XawParams {
125 typedef struct _XawPixmap {
133 typedef Bool (*XawPixmapLoader)(XawParams*, Screen*, Colormap, int,
135 Dimension*, Dimension*);
136 Bool XawPixmapsInitialize(void);
137 Bool XawAddPixmapLoader(String, String, XawPixmapLoader);
138 XawPixmap *XawLoadPixmap(String, Screen*, Colormap, int);
139 XawPixmap *XawPixmapFromXPixmap(Pixmap, Screen*, Colormap, int);
140 XawParams *XawParseParamsString(String name);
141 void XawFreeParamsStruct(XawParams *params);
142 XawArgVal *XawFindArgVal(XawParams *params, String name);
143 void XawReshapeWidget(Widget, XawPixmap*);
147 void XawTypeToStringWarning(Display*, String);
150 int _XawGetPageSize(void);
152 #endif /* _XawPrivate_h */