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