00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef _XawPrivate_h
00031 #define _XawPrivate_h
00032
00033 #define XawMax(a, b) ((a) > (b) ? (a) : (b))
00034 #define XawMin(a, b) ((a) < (b) ? (a) : (b))
00035 #define XawAbs(a) ((a) < 0 ? -(a) : (a))
00036
00037 #define XawStackAlloc(size, stk_buffer) \
00038 ((size) <= sizeof(stk_buffer) \
00039 ? (XtPointer)(stk_buffer) \
00040 : XtMalloc((unsigned)(size)))
00041
00042 #define XawStackFree(pointer, stk_buffer) \
00043 do { \
00044 if ((pointer) != (XtPointer)(stk_buffer)) \
00045 XtFree((char *)pointer); \
00046 } while (0)
00047
00048 #ifndef XtX
00049 #define XtX(w) (((RectObj)w)->rectangle.x)
00050 #endif
00051 #ifndef XtY
00052 #define XtY(w) (((RectObj)w)->rectangle.y)
00053 #endif
00054 #ifndef XtWidth
00055 #define XtWidth(w) (((RectObj)w)->rectangle.width)
00056 #endif
00057 #ifndef XtHeight
00058 #define XtHeight(w) (((RectObj)w)->rectangle.height)
00059 #endif
00060 #ifndef XtBorderWidth
00061 #define XtBorderWidth(w) (((RectObj)w)->rectangle.border_width)
00062 #endif
00063
00064 #ifndef OLDXAW
00065 #define XAW_PRIV_VAR_PREFIX '$'
00066
00067 typedef Bool (*XawParseBooleanProc)(Widget, String, XEvent*, Bool*);
00068
00069 typedef struct _XawActionVarList XawActionVarList;
00070 typedef struct _XawActionResList XawActionResList;
00071
00072
00073 Bool XawParseBoolean(Widget, String, XEvent*, Bool*);
00074 Bool XawBooleanExpression(Widget, String, XEvent*);
00075
00076
00077 void XawPrintActionErrorMsg(String, Widget, String*, Cardinal*);
00078 XawActionResList *XawGetActionResList(WidgetClass);
00079 XawActionVarList *XawGetActionVarList(Widget);
00080
00081 void XawSetValuesAction(Widget, XEvent*, String*, Cardinal*);
00082 void XawGetValuesAction(Widget, XEvent*, String*, Cardinal*);
00083 void XawDeclareAction(Widget, XEvent*, String*, Cardinal*);
00084 void XawCallProcAction(Widget, XEvent*, String*, Cardinal*);
00085
00086
00087 #define XAWDL_CONVERT_ERROR (XtPointer)-1
00088 typedef struct _XawDL _XawDisplayList;
00089 typedef struct _XawDLClass XawDLClass, XawDisplayListClass;
00090
00091 typedef void (*XawDisplayListProc)(Widget, XtPointer, XtPointer,
00092 XEvent*, Region);
00093 typedef void *(*XawDLArgsInitProc)(String, String*, Cardinal*,
00094 Screen*, Colormap, int);
00095 typedef void *(*XawDLDataInitProc)(String,
00096 Screen*, Colormap, int);
00097 typedef void (*XawDLArgsDestructor)(Display*, String, XtPointer,
00098 String*, Cardinal*);
00099 typedef void (*XawDLDataDestructor)(Display*, String, XtPointer);
00100
00101 void XawRunDisplayList(Widget, _XawDisplayList*, XEvent*, Region);
00102 void XawDisplayListInitialize(void);
00103
00104 _XawDisplayList *XawCreateDisplayList(String, Screen*, Colormap, int);
00105 void XawDestroyDisplayList(_XawDisplayList*);
00106 String XawDisplayListString(_XawDisplayList*);
00107 XawDLClass *XawGetDisplayListClass(String);
00108 XawDLClass *XawCreateDisplayListClass(String,
00109 XawDLArgsInitProc, XawDLArgsDestructor,
00110 XawDLDataInitProc, XawDLDataDestructor);
00111 Bool XawDeclareDisplayListProc(XawDLClass*, String, XawDisplayListProc);
00112
00113
00114 typedef struct _XawArgVal {
00115 String name;
00116 String value;
00117 } XawArgVal;
00118
00119 typedef struct _XawParams {
00120 String name;
00121 String type;
00122 String ext;
00123 XawArgVal **args;
00124 Cardinal num_args;
00125 } XawParams;
00126
00127 typedef struct _XawPixmap {
00128 String name;
00129 Pixmap pixmap;
00130 Pixmap mask;
00131 Dimension width;
00132 Dimension height;
00133 } XawPixmap;
00134
00135 typedef Bool (*XawPixmapLoader)(XawParams*, Screen*, Colormap, int,
00136 Pixmap*, Pixmap*,
00137 Dimension*, Dimension*);
00138 Bool XawPixmapsInitialize(void);
00139 Bool XawAddPixmapLoader(String, String, XawPixmapLoader);
00140 XawPixmap *XawLoadPixmap(String, Screen*, Colormap, int);
00141 XawPixmap *XawPixmapFromXPixmap(Pixmap, Screen*, Colormap, int);
00142 XawParams *XawParseParamsString(String name);
00143 void XawFreeParamsStruct(XawParams *params);
00144 XawArgVal *XawFindArgVal(XawParams *params, String name);
00145 void XawReshapeWidget(Widget, XawPixmap*);
00146 #endif
00147
00148
00149 void XawTypeToStringWarning(Display*, String);
00150
00151
00152 int _XawGetPageSize(void);
00153
00154 #endif