Private.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 1998 by The XFree86 Project, Inc.
00003  *
00004  * Permission is hereby granted, free of charge, to any person obtaining a
00005  * copy of this software and associated documentation files (the "Software"),
00006  * to deal in the Software without restriction, including without limitation
00007  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
00008  * and/or sell copies of the Software, and to permit persons to whom the
00009  * Software is furnished to do so, subject to the following conditions:
00010  *
00011  * The above copyright notice and this permission notice shall be included in
00012  * all copies or substantial portions of the Software.
00013  *  
00014  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
00015  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00016  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
00017  * THE XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
00018  * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
00019  * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
00020  * SOFTWARE.
00021  *
00022  * Except as contained in this notice, the name of the XFree86 Project shall
00023  * not be used in advertising or otherwise to promote the sale, use or other
00024  * dealings in this Software without prior written authorization from the
00025  * XFree86 Project.
00026  */
00027 
00028 /* $XFree86: xc/lib/Xaw/Private.h,v 3.10 1999/06/06 08:48:07 dawes Exp $ */
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 /* Boolean expressions */
00073 Bool XawParseBoolean(Widget, String, XEvent*, Bool*);
00074 Bool XawBooleanExpression(Widget, String, XEvent*);
00075 
00076 /* actions */
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 /* display lists */
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 /* pixmaps */
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 /* OLDXAW */
00147 
00148 /* misc */
00149 void XawTypeToStringWarning(Display*, String);
00150 
00151 /* OS.c */
00152 int _XawGetPageSize(void);
00153 
00154 #endif /* _XawPrivate_h */

Generated on Mon May 8 16:47:49 2006 for xmonitors by  doxygen 1.4.2