IntrinsicP.h revision 339a7c43
1/*********************************************************** 2 3Copyright 1987, 1988, 1994, 1998 The Open Group 4 5Permission to use, copy, modify, distribute, and sell this software and its 6documentation for any purpose is hereby granted without fee, provided that 7the above copyright notice appear in all copies and that both that 8copyright notice and this permission notice appear in supporting 9documentation. 10 11The above copyright notice and this permission notice shall be included in 12all copies or substantial portions of the Software. 13 14THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 18AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 19CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 20 21Except as contained in this notice, the name of The Open Group shall not be 22used in advertising or otherwise to promote the sale, use or other dealings 23in this Software without prior written authorization from The Open Group. 24 25 26Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts. 27 28 All Rights Reserved 29 30Permission to use, copy, modify, and distribute this software and its 31documentation for any purpose and without fee is hereby granted, 32provided that the above copyright notice appear in all copies and that 33both that copyright notice and this permission notice appear in 34supporting documentation, and that the name of Digital not be 35used in advertising or publicity pertaining to distribution of the 36software without specific, written prior permission. 37 38DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING 39ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL 40DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR 41ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, 42WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, 43ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS 44SOFTWARE. 45 46******************************************************************/ 47 48#ifndef _XtintrinsicP_h 49#define _XtintrinsicP_h 50 51#include <X11/Intrinsic.h> 52 53/* 54 * Field sizes and offsets of XrmResource must match those of XtResource. 55 * Type long is used instead of XrmQuark here because XrmQuark and String 56 * are not the same size on all systems. 57 */ 58typedef struct { 59 long xrm_name; /* Resource name quark */ 60 long xrm_class; /* Resource class quark */ 61 long xrm_type; /* Resource representation type quark */ 62 Cardinal xrm_size; /* Size in bytes of representation */ 63 int xrm_offset; /* -offset-1 */ 64 long xrm_default_type; /* Default representation type quark */ 65 XtPointer xrm_default_addr; /* Default resource address */ 66} XrmResource, *XrmResourceList; 67 68typedef unsigned long XtVersionType; 69 70#define XT_VERSION 11 71#ifndef XT_REVISION 72#define XT_REVISION 6 73#endif 74#define XtVersion (XT_VERSION * 1000 + XT_REVISION) 75#define XtVersionDontCheck 0 76 77typedef void (*XtProc)( 78 void 79); 80 81typedef void (*XtWidgetClassProc)( 82 WidgetClass /* class */ 83); 84 85typedef void (*XtWidgetProc)( 86 Widget /* widget */ 87); 88 89typedef Boolean (*XtAcceptFocusProc)( 90 Widget /* widget */, 91 Time* /* time */ 92); 93 94typedef void (*XtArgsProc)( 95 Widget /* widget */, 96 ArgList /* args */, 97 Cardinal* /* num_args */ 98); 99 100typedef void (*XtInitProc)( 101 Widget /* request */, 102 Widget /* new */, 103 ArgList /* args */, 104 Cardinal* /* num_args */ 105); 106 107typedef Boolean (*XtSetValuesFunc)( 108 Widget /* old */, 109 Widget /* request */, 110 Widget /* new */, 111 ArgList /* args */, 112 Cardinal* /* num_args */ 113); 114 115typedef Boolean (*XtArgsFunc)( 116 Widget /* widget */, 117 ArgList /* args */, 118 Cardinal* /* num_args */ 119); 120 121typedef void (*XtAlmostProc)( 122 Widget /* old */, 123 Widget /* new */, 124 XtWidgetGeometry* /* request */, 125 XtWidgetGeometry* /* reply */ 126); 127 128typedef void (*XtExposeProc)( 129 Widget /* widget */, 130 XEvent* /* event */, 131 Region /* region */ 132); 133 134/* compress_exposure options*/ 135#define XtExposeNoCompress ((XtEnum)False) 136#define XtExposeCompressSeries ((XtEnum)True) 137#define XtExposeCompressMultiple 2 138#define XtExposeCompressMaximal 3 139 140/* modifiers */ 141#define XtExposeGraphicsExpose 0x10 142#define XtExposeGraphicsExposeMerged 0x20 143#define XtExposeNoExpose 0x40 144#define XtExposeNoRegion 0x80 145 146typedef void (*XtRealizeProc)( 147 Widget /* widget */, 148 XtValueMask* /* mask */, 149 XSetWindowAttributes* /* attributes */ 150); 151 152typedef XtGeometryResult (*XtGeometryHandler)( 153 Widget /* widget */, 154 XtWidgetGeometry* /* request */, 155 XtWidgetGeometry* /* reply */ 156); 157 158typedef void (*XtStringProc)( 159 Widget /* widget */, 160 String /* str */ 161); 162 163typedef struct { 164 String name; /* resource name */ 165 String type; /* representation type name */ 166 XtArgVal value; /* representation */ 167 int size; /* size of representation */ 168} XtTypedArg, *XtTypedArgList; 169 170typedef void (*XtAllocateProc)( 171 WidgetClass /* widget_class */, 172 Cardinal * /* constraint_size */, 173 Cardinal * /* more_bytes */, 174 ArgList /* args */, 175 Cardinal * /* num_args */, 176 XtTypedArgList /* typed_args */, 177 Cardinal * /* num_typed_args */, 178 Widget * /* widget_return */, 179 XtPointer * /* more_bytes_return */ 180); 181 182typedef void (*XtDeallocateProc)( 183 Widget /* widget */, 184 XtPointer /* more_bytes */ 185); 186 187struct _XtStateRec; /* Forward declare before use for C++ */ 188 189typedef struct _XtTMRec { 190 XtTranslations translations; /* private to Translation Manager */ 191 XtBoundActions proc_table; /* procedure bindings for actions */ 192 struct _XtStateRec *current_state; /* Translation Manager state ptr */ 193 unsigned long lastEventTime; 194} XtTMRec, *XtTM; 195 196#include <X11/CoreP.h> 197#include <X11/CompositeP.h> 198#include <X11/ConstrainP.h> 199#include <X11/ObjectP.h> 200#include <X11/RectObjP.h> 201 202#define XtDisplay(widget) DisplayOfScreen((widget)->core.screen) 203#define XtScreen(widget) ((widget)->core.screen) 204#define XtWindow(widget) ((widget)->core.window) 205 206#define XtClass(widget) ((widget)->core.widget_class) 207#define XtSuperclass(widget) (XtClass(widget)->core_class.superclass) 208#define XtIsRealized(object) (XtWindowOfObject(object) != None) 209#define XtParent(widget) ((widget)->core.parent) 210 211#undef XtIsRectObj 212extern Boolean XtIsRectObj(Widget); 213#define XtIsRectObj(obj) \ 214 (((Object)(obj))->object.widget_class->core_class.class_inited & 0x02) 215 216#undef XtIsWidget 217extern Boolean XtIsWidget(Widget); 218#define XtIsWidget(obj) \ 219 (((Object)(obj))->object.widget_class->core_class.class_inited & 0x04) 220 221#undef XtIsComposite 222extern Boolean XtIsComposite(Widget); 223#define XtIsComposite(obj) \ 224 (((Object)(obj))->object.widget_class->core_class.class_inited & 0x08) 225 226#undef XtIsConstraint 227extern Boolean XtIsConstraint(Widget); 228#define XtIsConstraint(obj) \ 229 (((Object)(obj))->object.widget_class->core_class.class_inited & 0x10) 230 231#undef XtIsShell 232extern Boolean XtIsShell(Widget); 233#define XtIsShell(obj) \ 234 (((Object)(obj))->object.widget_class->core_class.class_inited & 0x20) 235 236#undef XtIsWMShell 237extern Boolean XtIsWMShell(Widget); 238#define XtIsWMShell(obj) \ 239 (((Object)(obj))->object.widget_class->core_class.class_inited & 0x40) 240 241#undef XtIsTopLevelShell 242extern Boolean XtIsTopLevelShell(Widget); 243#define XtIsTopLevelShell(obj) \ 244 (((Object)(obj))->object.widget_class->core_class.class_inited & 0x80) 245 246#ifdef DEBUG 247#define XtCheckSubclass(w, widget_class_ptr, message) \ 248 if (!XtIsSubclass(((Widget)(w)), (widget_class_ptr))) { \ 249 String params[3]; \ 250 Cardinal num_params = 3; \ 251 params[0] = ((Widget)(w))->core.widget_class->core_class.class_name;\ 252 params[1] = (widget_class_ptr)->core_class.class_name; \ 253 params[2] = (message); \ 254 XtAppErrorMsg(XtWidgetToApplicationContext((Widget)(w)), \ 255 "subclassMismatch", "xtCheckSubclass", "XtToolkitError", \ 256 "Widget class %s found when subclass of %s expected: %s",\ 257 params, &num_params); \ 258 } 259#else 260#define XtCheckSubclass(w, widget_class, message) /* nothing */ 261#endif 262 263_XFUNCPROTOBEGIN 264 265extern Widget _XtWindowedAncestor( /* internal; implementation-dependent */ 266 Widget /* object */ 267); 268 269#if (defined(_WIN32) || defined(__CYGWIN__)) && !defined(LIBXT_COMPILATION) 270__declspec(dllimport) 271#else 272extern 273#endif 274void _XtInherit( 275 void 276); 277 278extern void _XtHandleFocus( 279 Widget /* widget */, 280 XtPointer /* client_data */, 281 XEvent * /* event */, 282 Boolean * /* cont */); 283 284extern void XtCreateWindow( 285 Widget /* widget */, 286 unsigned int /* window_class */, 287 Visual* /* visual */, 288 XtValueMask /* value_mask */, 289 XSetWindowAttributes* /* attributes */ 290); 291 292extern void XtResizeWidget( 293 Widget /* widget */, 294 _XtDimension /* width */, 295 _XtDimension /* height */, 296 _XtDimension /* border_width */ 297); 298 299extern void XtMoveWidget( 300 Widget /* widget */, 301 _XtPosition /* x */, 302 _XtPosition /* y */ 303); 304 305extern void XtConfigureWidget( 306 Widget /* widget */, 307 _XtPosition /* x */, 308 _XtPosition /* y */, 309 _XtDimension /* width */, 310 _XtDimension /* height */, 311 _XtDimension /* border_width */ 312); 313 314extern void XtResizeWindow( 315 Widget /* widget */ 316); 317 318extern void XtProcessLock( 319 void 320); 321 322extern void XtProcessUnlock( 323 void 324); 325 326_XFUNCPROTOEND 327 328#endif /* _XtIntrinsicP_h */ 329/* DON'T ADD STUFF AFTER THIS #endif */ 330