| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| 22 | |
| 23 | |
| 24 | |
| 25 | |
| 26 | |
| 27 | |
| 28 | |
| 29 | |
| 30 | |
| 31 | |
| 32 | |
| 33 | |
| 34 | |
| 35 | |
| 36 | |
| 37 | |
| 38 | |
| 39 | |
| 40 | |
| 41 | |
| 42 | |
| 43 | |
| 44 | |
| 45 | |
| 46 | |
| 47 | |
| 48 | #ifndef _XtintrinsicP_h |
| 49 | #define _XtintrinsicP_h |
| 50 | |
| 51 | #include <X11/Intrinsic.h> |
| 52 | |
| 53 | |
| 54 | |
| 55 | |
| 56 | |
| 57 | |
| 58 | typedef struct { |
| 59 | XtIntPtr xrm_name; |
| 60 | XtIntPtr xrm_class; |
| 61 | XtIntPtr xrm_type; |
| 62 | Cardinal xrm_size; |
| 63 | int xrm_offset; |
| 64 | XtIntPtr xrm_default_type; |
| 65 | XtPointer xrm_default_addr; |
| 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 |
| 88 | ); |
| 89 | |
| 90 | typedef void (*XtWidgetProc)( |
| 91 | Widget |
| 92 | ); |
| 93 | |
| 94 | typedef Boolean (*XtAcceptFocusProc)( |
| 95 | Widget , |
| 96 | Time* |
| 97 | ); |
| 98 | |
| 99 | typedef void (*XtArgsProc)( |
| 100 | Widget , |
| 101 | ArgList , |
| 102 | Cardinal* |
| 103 | ); |
| 104 | |
| 105 | typedef void (*XtInitProc)( |
| 106 | Widget , |
| 107 | Widget , |
| 108 | ArgList , |
| 109 | Cardinal* |
| 110 | ); |
| 111 | |
| 112 | typedef Boolean (*XtSetValuesFunc)( |
| 113 | Widget , |
| 114 | Widget , |
| 115 | Widget , |
| 116 | ArgList , |
| 117 | Cardinal* |
| 118 | ); |
| 119 | |
| 120 | typedef Boolean (*XtArgsFunc)( |
| 121 | Widget , |
| 122 | ArgList , |
| 123 | Cardinal* |
| 124 | ); |
| 125 | |
| 126 | typedef void (*XtAlmostProc)( |
| 127 | Widget , |
| 128 | Widget , |
| 129 | XtWidgetGeometry* , |
| 130 | XtWidgetGeometry* |
| 131 | ); |
| 132 | |
| 133 | typedef void (*XtExposeProc)( |
| 134 | Widget , |
| 135 | XEvent* , |
| 136 | Region |
| 137 | ); |
| 138 | |
| 139 | |
| 140 | #define XtExposeNoCompress ((XtEnum)False) |
| 141 | #define XtExposeCompressSeries ((XtEnum)True) |
| 142 | #define XtExposeCompressMultiple 2 |
| 143 | #define XtExposeCompressMaximal 3 |
| 144 | |
| 145 | |
| 146 | #define XtExposeGraphicsExpose 0x10 |
| 147 | #define XtExposeGraphicsExposeMerged 0x20 |
| 148 | #define XtExposeNoExpose 0x40 |
| 149 | #define XtExposeNoRegion 0x80 |
| 150 | |
| 151 | typedef void (*XtRealizeProc)( |
| 152 | Widget , |
| 153 | XtValueMask* , |
| 154 | XSetWindowAttributes* |
| 155 | ); |
| 156 | |
| 157 | typedef XtGeometryResult (*XtGeometryHandler)( |
| 158 | Widget , |
| 159 | XtWidgetGeometry* , |
| 160 | XtWidgetGeometry* |
| 161 | ); |
| 162 | |
| 163 | typedef void (*XtStringProc)( |
| 164 | Widget , |
| 165 | String |
| 166 | ); |
| 167 | |
| 168 | typedef struct { |
| 169 | String name; |
| 170 | String type; |
| 171 | XtArgVal value; |
| 172 | int size; |
| 173 | } XtTypedArg, *XtTypedArgList; |
| 174 | |
| 175 | typedef void (*XtAllocateProc)( |
| 176 | WidgetClass , |
| 177 | Cardinal * , |
| 178 | Cardinal * , |
| 179 | ArgList , |
| 180 | Cardinal * , |
| 181 | XtTypedArgList , |
| 182 | Cardinal * , |
| 183 | Widget * , |
| 184 | XtPointer * |
| 185 | ); |
| 186 | |
| 187 | typedef void (*XtDeallocateProc)( |
| 188 | Widget , |
| 189 | XtPointer |
| 190 | ); |
| 191 | |
| 192 | struct _XtStateRec; |
| 193 | |
| 194 | typedef struct _XtTMRec { |
| 195 | XtTranslations translations; |
| 196 | XtBoundActions proc_table; |
| 197 | struct _XtStateRec *current_state; |
| 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) |
| 266 | #endif |
| 267 | |
| 268 | _XFUNCPROTOBEGIN |
| 269 | |
| 270 | extern Widget _XtWindowedAncestor( |
| 271 | Widget |
| 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 , |
| 285 | XtPointer , |
| 286 | XEvent * , |
| 287 | Boolean * ); |
| 288 | |
| 289 | extern void XtCreateWindow( |
| 290 | Widget , |
| 291 | unsigned int , |
| 292 | Visual* , |
| 293 | XtValueMask , |
| 294 | XSetWindowAttributes* |
| 295 | ); |
| 296 | |
| 297 | extern void XtResizeWidget( |
| 298 | Widget , |
| 299 | _XtDimension , |
| 300 | _XtDimension , |
| 301 | _XtDimension |
| 302 | ); |
| 303 | |
| 304 | extern void XtMoveWidget( |
| 305 | Widget , |
| 306 | _XtPosition , |
| 307 | _XtPosition |
| 308 | ); |
| 309 | |
| 310 | extern void XtConfigureWidget( |
| 311 | Widget , |
| 312 | _XtPosition , |
| 313 | _XtPosition , |
| 314 | _XtDimension , |
| 315 | _XtDimension , |
| 316 | _XtDimension |
| 317 | ); |
| 318 | |
| 319 | extern void XtResizeWindow( |
| 320 | Widget |
| 321 | ); |
| 322 | |
| 323 | extern void XtProcessLock( |
| 324 | void |
| 325 | ); |
| 326 | |
| 327 | extern void XtProcessUnlock( |
| 328 | void |
| 329 | ); |
| 330 | |
| 331 | _XFUNCPROTOEND |
| 332 | |
| 333 | #endif |
| 334 | |