1 /* 2 * Motif 3 * 4 * Copyright (c) 1987-2012, The Open Group. All rights reserved. 5 * 6 * These libraries and programs are free software; you can 7 * redistribute them and/or modify them under the terms of the GNU 8 * Lesser General Public License as published by the Free Software 9 * Foundation; either version 2 of the License, or (at your option) 10 * any later version. 11 * 12 * These libraries and programs are distributed in the hope that 13 * they will be useful, but WITHOUT ANY WARRANTY; without even the 14 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 15 * PURPOSE. See the GNU Lesser General Public License for more 16 * details. 17 * 18 * You should have received a copy of the GNU Lesser General Public 19 * License along with these librararies and programs; if not, write 20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth 21 * Floor, Boston, MA 02110-1301 USA 22 */ 23 24 /************************************<+>************************************* 25 **************************************************************************** 26 ** 27 ** File: XmP.h 28 ** 29 ** Description: This include file contains the class and instance record 30 ** definitions for all meta classes. It also contains externs 31 ** for internally shared functions and defines for internally 32 ** shared values. 33 ** 34 **************************************************************************** 35 ************************************<+>*************************************/ 36 #ifndef _XmP_h 37 #define _XmP_h 38 39 #include <stdarg.h> 40 #include <Xm/Xm.h> 41 #include <X11/IntrinsicP.h> 42 #include <X11/ObjectP.h> 43 #include <Xm/ColorP.h> 44 #include <Xm/AccColorT.h> 45 46 47 #ifdef __cplusplus 48 extern "C" { 49 #endif 50 51 52 /*************************************************************************** 53 * 54 * Macros replacing toolkit macros so that gadgets are handled properly. 55 * 56 ***************************************************************************/ 57 58 /* Temporary hack until we can clean up our own code. ??? */ 59 #ifndef NO_XM_1_2_XTMACROS 60 #define XM_1_2_XTMACROS 1 61 #endif 62 63 #ifdef XM_1_2_XTMACROS 64 65 /* XtClass is a macro in IntrinsicP.h, but it does no casting 66 so removing this one would certainly generate warnings everywhere, 67 we can keep it */ 68 #ifdef XtClass 69 #undef XtClass 70 #endif 71 #define XtClass(widget) (((Object)(widget))->object.widget_class) 72 73 74 /* Exist in IntrinsicP.h, but does no casting, so removing this 75 one will probably generate a lot of warnings */ 76 #ifdef XtParent 77 #undef XtParent 78 #endif 79 #define XtParent(widget) (((Object)(widget))->object.parent) 80 81 82 /* The following routines exist in Xt, but do not accept Gadgets. */ 83 84 #ifdef XtDisplay 85 #undef XtDisplay 86 #endif 87 #define XtDisplay(widget) XtDisplayOfObject((Widget) widget) 88 89 #ifdef XtScreen 90 #undef XtScreen 91 #endif 92 #define XtScreen(widget) XtScreenOfObject((Widget) widget) 93 94 #ifdef XtWindow 95 #undef XtWindow 96 #endif 97 #define XtWindow(widget) XtWindowOfObject((Widget) widget) 98 99 100 /* The following macros are not provided by Xt */ 101 #define XtX(w) ((w)->core.x) 102 #define XtY(w) ((w)->core.y) 103 #define XtWidth(w) ((w)->core.width) 104 #define XtHeight(w) ((w)->core.height) 105 #define XtBorderWidth(w) ((w)->core.border_width) 106 #define XtBackground(w) ((w)->core.background_pixel) 107 #define XtCoreProc(w,proc) ((w)->core.widget_class->core_class.proc) 108 109 #endif /* XM_1_2_XTMACROS */ 110 111 112 /*********************************************************************** 113 * 114 * Miscellaneous SemiPrivate Defines 115 * 116 ***********************************************************************/ 117 118 /* new for the initialized gadget checking */ 119 #define XmNdotCache ".cache" 120 #define XmCDotCache ".Cache" 121 122 #define XmDELAYED_PIXMAP (XmUNSPECIFIED_PIXMAP - 1) 123 124 #define XmUNSPECIFIED (~0) 125 #define XmUNSPECIFIED_COUNT (~0) 126 127 128 /* Used by conversion routine in ResConvert.c, RepType.c, IconG.c, etc */ 129 130 #define _XM_CONVERTER_DONE( to_rtn, type, value, failure ) \ 131 { \ 132 static type buf ; \ 133 \ 134 if (to_rtn->addr) \ 135 { \ 136 if (to_rtn->size < sizeof(type)) \ 137 { \ 138 failure \ 139 to_rtn->size = sizeof(type); \ 140 return FALSE; \ 141 } \ 142 else \ 143 { \ 144 *((type *) (to_rtn->addr)) = value; \ 145 } \ 146 } \ 147 else \ 148 { \ 149 buf = value; \ 150 to_rtn->addr = (XPointer) &buf; \ 151 } \ 152 to_rtn->size = sizeof(type); \ 153 return TRUE; \ 154 } 155 156 157 158 /* defines needed for 3D visual enhancement of defaultButtonshadow and 159 * implementation of ToggleButton Indicatorsize. **/ 160 161 #define Xm3D_ENHANCE_PIXEL 2 162 #define XmINDICATOR_SHADOW_THICKNESS 2 163 164 #define XmINVALID_DIMENSION 0xFFFF 165 166 /*********************************************************************** 167 * 168 * Const stuff 169 * 170 ***********************************************************************/ 171 172 #ifndef XmConst 173 #if defined(__STDC__) || !defined( NO_CONST ) 174 #define XmConst const 175 #else 176 #define XmConst 177 #endif /* __STDC__ */ 178 #endif /* XmConst */ 179 180 181 /*********************************************************************** 182 * 183 * Status for menus 184 * 185 ***********************************************************************/ 186 187 /* Defines used for menu/button communication */ 188 enum{ XmMENU_POPDOWN, XmMENU_PROCESS_TREE, 189 XmMENU_TRAVERSAL, XmMENU_SHELL_POPDOWN, 190 XmMENU_CALLBACK, XmMENU_BUTTON, 191 XmMENU_CASCADING, XmMENU_SUBMENU, 192 XmMENU_ARM, XmMENU_DISARM, 193 XmMENU_BAR_CLEANUP, XmMENU_STATUS, 194 XmMENU_MEMWIDGET_UPDATE, XmMENU_BUTTON_POPDOWN, 195 XmMENU_RESTORE_EXCLUDED_TEAROFF_TO_TOPLEVEL_SHELL, 196 XmMENU_RESTORE_TEAROFF_TO_TOPLEVEL_SHELL, 197 XmMENU_RESTORE_TEAROFF_TO_MENUSHELL, 198 XmMENU_GET_LAST_SELECT_TOPLEVEL, 199 XmMENU_TEAR_OFF_ARM 200 } ; 201 202 203 204 #define XmMENU_TORN_BIT (1 << 0) 205 #define XmMENU_TEAR_OFF_SHELL_DESCENDANT_BIT (1 << 1) 206 #define XmMENU_POPUP_POSTED_BIT (1 << 2) 207 #define XmMENU_IN_DRAG_MODE_BIT (1 << 3) 208 209 #define XmIsTorn(mask) \ 210 (mask & XmMENU_TORN_BIT) 211 #define XmIsTearOffShellDescendant(mask) \ 212 (mask & XmMENU_TEAR_OFF_SHELL_DESCENDANT_BIT) 213 #define XmPopupPosted(mask) \ 214 (mask & XmMENU_POPUP_POSTED_BIT) 215 #define XmIsInDragMode(mask) \ 216 (mask & XmMENU_IN_DRAG_MODE_BIT) 217 218 typedef void (*XmMenuProc)( int, Widget, ...) ; 219 220 /*********************************************************************** 221 * 222 * Simple Menu Structure 223 * 224 ***********************************************************************/ 225 226 typedef struct _XmSimpleMenuRec { 227 int count; 228 int post_from_button; 229 XtCallbackProc callback; 230 XmStringTable label_string; 231 String *accelerator; 232 XmStringTable accelerator_text; 233 XmKeySymTable mnemonic; 234 XmStringCharSetTable mnemonic_charset; 235 XmButtonTypeTable button_type; 236 int button_set; 237 XmString option_label; 238 KeySym option_mnemonic; 239 } XmSimpleMenuRec, * XmSimpleMenu; 240 241 242 /* For MapEvent: _XmMatchBtnEvent */ 243 #define XmIGNORE_EVENTTYPE -1 244 245 /* Default minimum Toggle indicator dimension */ 246 #define XmDEFAULT_INDICATOR_DIM 9 247 248 249 250 251 252 /************************************************************************ 253 * 254 * SyntheticP.h 255 * 256 ************************************************************************/ 257 258 typedef enum{ XmSYNTHETIC_NONE, XmSYNTHETIC_LOAD } XmImportOperator ; 259 260 typedef void (*XmExportProc)( Widget, int, XtArgVal *) ; 261 typedef XmImportOperator (*XmImportProc)( Widget, int, XtArgVal *) ; 262 263 typedef struct _XmSyntheticResource 264 { 265 String resource_name; 266 Cardinal resource_size; 267 Cardinal resource_offset; 268 XmExportProc export_proc; 269 XmImportProc import_proc; 270 } XmSyntheticResource; 271 272 273 274 /*********************************************************************** 275 * 276 * ParProcP.h 277 * 278 ***********************************************************************/ 279 280 281 typedef struct 282 { 283 int process_type ; /* Common to all parent process records. */ 284 } XmParentProcessAnyRec ; 285 286 typedef struct 287 { 288 int process_type ; /* Common to all parent process records. */ 289 XEvent * event ; 290 int action ; 291 String * params ; 292 Cardinal * num_params ; 293 } XmParentInputActionRec ; 294 295 typedef union 296 { 297 XmParentProcessAnyRec any ; 298 XmParentInputActionRec input_action ; 299 } XmParentProcessDataRec, * XmParentProcessData ; 300 301 enum{ XmPARENT_PROCESS_ANY, XmINPUT_ACTION 302 } ; 303 enum{ XmPARENT_ACTIVATE, XmPARENT_CANCEL 304 } ; 305 #define XmRETURN XmPARENT_ACTIVATE /* For Motif 1.1 BC. */ 306 #define XmCANCEL XmPARENT_CANCEL /* For Motif 1.1 BC. */ 307 308 309 /*********************************************************************** 310 * 311 * BaselineP.h 312 * 313 ***********************************************************************/ 314 315 enum{ XmBASELINE_GET, XmBASELINE_SET 316 } ; 317 318 typedef struct _XmBaselineMargins 319 { 320 unsigned char get_or_set; 321 Dimension margin_top; 322 Dimension margin_bottom; 323 Dimension shadow; 324 Dimension highlight; 325 Dimension text_height; 326 Dimension margin_height; 327 } XmBaselineMargins; 328 329 330 typedef enum{ XmFOCUS_IN, XmFOCUS_OUT, XmENTER, XmLEAVE } XmFocusChange ; 331 332 typedef enum{ 333 XmNOT_NAVIGABLE, XmCONTROL_NAVIGABLE, 334 XmTAB_NAVIGABLE, XmDESCENDANTS_NAVIGABLE, 335 XmDESCENDANTS_TAB_NAVIGABLE 336 } XmNavigability ; 337 338 /*********************************************************************** 339 * 340 * Various proc types 341 * 342 ***********************************************************************/ 343 344 #define XmVoidProc XtProc 345 346 347 typedef Boolean (*XmParentProcessProc)( Widget, XmParentProcessData) ; 348 typedef void (*XmWidgetDispatchProc)( Widget, XEvent *, Mask) ; 349 typedef void (*XmGrabShellPopupProc)( Widget, Widget, XEvent *) ; 350 typedef void (*XmMenuPopupProc)( Widget, Widget, XEvent *) ; 351 typedef void (*XmMenuTraversalProc)( Widget, Widget, XmTraversalDirection) ; 352 typedef void (*XmResizeFlagProc)( 353 Widget, 354 #if NeedWidePrototypes 355 int) ; 356 #else 357 Boolean) ; 358 #endif /* NeedWidePrototypes */ 359 typedef void (*XmRealizeOutProc)( Widget, Mask *, XSetWindowAttributes *) ; 360 typedef Boolean (*XmVisualChangeProc)( Widget, Widget, Widget) ; 361 typedef void (*XmTraversalProc)( Widget, XtPointer, XtPointer, int) ; 362 typedef void (*XmFocusMovedProc)( Widget, XtPointer, XtPointer) ; 363 typedef void (*XmCacheCopyProc)( XtPointer, XtPointer, size_t) ; 364 typedef void (*XmGadgetCacheProc)( XtPointer) ; 365 typedef int (*XmCacheCompareProc)( XtPointer, XtPointer) ; 366 typedef Boolean (*XmWidgetBaselineProc)(Widget, Dimension **, int *); 367 typedef Boolean (*XmWidgetDisplayRectProc)(Widget, XRectangle *); 368 typedef void (*XmWidgetMarginsProc)(Widget, XmBaselineMargins *); 369 typedef XmNavigability (*XmWidgetNavigableProc)( Widget) ; 370 typedef void (*XmFocusChangeProc)(Widget, XmFocusChange); 371 typedef Boolean (*XmSpatialPlacementProc)(Widget, Widget, unsigned char); 372 typedef Boolean (*XmSpatialRemoveProc)(Widget, Widget); 373 typedef Boolean (*XmSpatialTestFitProc)(Widget, Widget, Position, Position); 374 375 376 /**************** 377 * 378 * Data structure for building a real translation table out of a 379 * virtual string. 380 * 381 ****************/ 382 383 typedef struct { 384 Modifiers mod; 385 char *key; 386 char *action; 387 } _XmBuildVirtualKeyStruct; 388 389 typedef struct _XmKeyBindingRec 390 { 391 KeySym keysym; 392 Modifiers modifiers; 393 } XmKeyBindingRec, *XmKeyBinding; 394 395 396 /*********************************************************************** 397 * 398 * Types shared by text widgets 399 * 400 ***********************************************************************/ 401 402 typedef enum { XmsdLeft, XmsdRight } XmTextScanDirection; 403 404 405 /* 406 * This struct is for support of Insert Selection targets. 407 */ 408 typedef struct { 409 Atom selection; 410 Atom target; 411 } _XmTextInsertPair; 412 413 typedef struct { 414 XmTextPosition position; /* Starting position. */ 415 XmHighlightMode mode; /* Highlighting mode for this position. */ 416 } _XmHighlightRec; 417 418 typedef struct { 419 Cardinal number; /* Number of different highlight areas. */ 420 Cardinal maximum; /* Number we've allocated space for. */ 421 _XmHighlightRec *list; /* Pointer to array of highlight data. */ 422 } _XmHighlightData; 423 424 typedef enum { XmDEST_SELECT, XmPRIM_SELECT } XmSelectType; 425 426 typedef struct { 427 Boolean done_status; /* completion status of insert selection */ 428 Boolean success_status; /* success status of insert selection */ 429 XmSelectType select_type; /* insert selection type */ 430 XSelectionRequestEvent *event; /* event that initiated the 431 insert selection */ 432 } _XmInsertSelect; 433 434 typedef struct { 435 XEvent *event; 436 String *params; 437 Cardinal *num_params; 438 } _XmTextActionRec; 439 440 typedef struct { 441 Widget widget; 442 XmTextPosition insert_pos; 443 int num_chars; 444 Time timestamp; 445 Boolean move; 446 } _XmTextDropTransferRec; 447 448 typedef struct { 449 XmTextPosition position; 450 Atom target; 451 Time time; 452 int num_chars; 453 int ref_count; 454 } _XmTextPrimSelect; 455 456 typedef struct { 457 Screen *screen; 458 XContext context; 459 unsigned char type; 460 } XmTextContextDataRec, *XmTextContextData; 461 462 enum {_XM_IS_DEST_CTX, _XM_IS_GC_DATA_CTX, _XM_IS_PIXMAP_CTX}; 463 464 #define XmTEXT_DRAG_ICON_WIDTH 64 465 #define XmTEXT_DRAG_ICON_HEIGHT 64 466 #define XmTEXT_DRAG_ICON_X_HOT 10 467 #define XmTEXT_DRAG_ICON_Y_HOT 4 468 469 470 /*********************************************************************** 471 * 472 * GeoUtilsP.h 473 * 474 ***********************************************************************/ 475 476 /* Defines used by geometry manager utilities */ 477 478 enum{ XmGET_ACTUAL_SIZE = 1, XmGET_PREFERRED_SIZE, 479 XmGEO_PRE_SET, XmGEO_POST_SET 480 } ; 481 482 /* Defaults for Geometry Utility defines are always 0. */ 483 enum{ XmGEO_EXPAND, XmGEO_CENTER, 484 XmGEO_PACK 485 } ; 486 enum{ XmGEO_PROPORTIONAL, XmGEO_AVERAGING, 487 XmGEO_WRAP 488 } ; 489 enum{ XmGEO_ROW_MAJOR, XmGEO_COLUMN_MAJOR 490 } ; 491 /* XmGEO_COLUMN_MAJOR is not yet supported. */ 492 493 494 typedef struct _XmGeoMatrixRec *XmGeoMatrix ; 495 typedef union _XmGeoMajorLayoutRec *XmGeoMajorLayout ; 496 typedef struct _XmKidGeometryRec 497 { 498 Widget kid; /* ptr to kid */ 499 XtWidgetGeometry box; /* kid geo box */ 500 } XmKidGeometryRec, *XmKidGeometry; 501 502 typedef void (*XmGeoArrangeProc)( XmGeoMatrix, 503 #if NeedWidePrototypes 504 int, int, 505 #else 506 Position, Position, 507 #endif /* NeedWidePrototypes */ 508 Dimension *, Dimension *) ; 509 typedef Boolean (*XmGeoExceptProc)( XmGeoMatrix ) ; 510 typedef void (*XmGeoExtDestructorProc)( XtPointer ) ; 511 typedef void (*XmGeoSegmentFixUpProc)( XmGeoMatrix, int, XmGeoMajorLayout, 512 XmKidGeometry) ; 513 514 typedef struct 515 { Boolean end ; /* Flag to mark end of rows. */ 516 XmGeoSegmentFixUpProc fix_up ;/* Used for non-ordinary layouts. */ 517 Dimension even_width ; /* If non-zero, set all boxes to same width.*/ 518 Dimension even_height ;/* If non-zero, set all boxes to same height*/ 519 Dimension min_height ; /* Minimum height, if stretch_height TRUE. */ 520 Boolean stretch_height ;/* Stretch height to fill vertically. */ 521 Boolean uniform_border ;/* Enforce on all kids this row, dflt F. */ 522 Dimension border ; /* Value to use if uniform_border set. */ 523 unsigned char fill_mode ; /* Possible values: XmGEO_PACK, XmGEO_CENTER,*/ 524 /* or XmGEO_EXPAND (default). */ 525 unsigned char fit_mode ; /* Method for fitting boxes into space, */ 526 /* XmGEO_PROPORTIONAL (dflt), XmGEO_AVERAGING, or XmGEO_WRAP.*/ 527 Boolean sticky_end ; /* Last box in row sticks to edge, dflt F. */ 528 Dimension space_above ; /* Between-line spacing, default 0. */ 529 Dimension space_end ; /* End spacing (XmGEO_CENTER), default 0. */ 530 Dimension space_between ; /* Internal spacing, default 0. */ 531 Dimension max_box_height ;/* Set during arrange routine. */ 532 Dimension boxes_width ; /* Set during arrange routine. */ 533 Dimension fill_width ; /* Set during arrange routine. */ 534 Dimension box_count ; /* Set during arrange routine. */ 535 } XmGeoRowLayoutRec, *XmGeoRowLayout ; 536 537 typedef struct 538 { Boolean end ; /* Flag to mark end of columns. */ 539 XmGeoSegmentFixUpProc fix_up ;/* Used for non-ordinary layouts. */ 540 Dimension even_height ;/* If non-zero, set all boxes to same height*/ 541 Dimension even_width ; /* If non-zero, set all boxes to same width.*/ 542 Dimension min_width ; /* Minimum width, if stretch_width TRUE. */ 543 Boolean stretch_width ;/* Stretch width to fill horizontally. */ 544 Boolean uniform_border ;/* Enforce on all kids this row, dflt F. */ 545 Dimension border ; /* Value to use if uniform_border set. */ 546 unsigned char fill_mode ; /* Possible values: XmGEO_PACK, XmGEO_CENTER,*/ 547 /* or XmGEO_EXPAND (default). */ 548 unsigned char fit_mode ; /* Method for fitting boxes into space, */ 549 /* XmGEO_PROPORTIONAL (dflt), XmGEO_AVERAGING, or XmGEO_WRAP.*/ 550 Boolean sticky_end ; /* Last box in row sticks to edge, dflt F. */ 551 Dimension space_left ; /* Between-column spacing, default 0. */ 552 Dimension space_end ; /* End spacing (XmGEO_CENTER), default 0. */ 553 Dimension space_between ; /* Internal spacing, default 0. */ 554 Dimension max_box_width ; /* Set during arrange routine. */ 555 Dimension boxes_height ; /* Set during arrange routine. */ 556 Dimension fill_height ; /* Set during arrange routine. */ 557 Dimension box_count ; /* Set during arrange routine. */ 558 } XmGeoColumnLayoutRec, *XmGeoColumnLayout ; 559 560 typedef union _XmGeoMajorLayoutRec 561 { 562 XmGeoRowLayoutRec row ; 563 XmGeoColumnLayoutRec col ; 564 } XmGeoMajorLayoutRec ; 565 566 typedef struct _XmGeoMatrixRec 567 { Widget composite ; /* Widget managing layout. */ 568 Widget instigator ; /* Widget initiating re-layout. */ 569 XtWidgetGeometry instig_request ;/* Geometry layout request of instigatr.*/ 570 XtWidgetGeometry parent_request ;/* Subsequent layout request to parent. */ 571 XtWidgetGeometry *in_layout ; /* Geo. of instig. in layout (after Get).*/ 572 XmKidGeometry boxes ;/* Array of boxes, lines separated by NULL record.*/ 573 XmGeoMajorLayout layouts ; /* Array of major_order format info. */ 574 Dimension margin_w ;/*Sum of margin, highlight, & shadow thickness.*/ 575 Dimension margin_h ;/*Sum of margin, highlight, & shadow thickness.*/ 576 Boolean stretch_boxes ; /* Set during arrange routine. */ 577 Boolean uniform_border ;/* Enforce on all kids, default FALSE. */ 578 Dimension border ; /* Value to use if uniform_border TRUE. */ 579 Dimension max_major ; /* Set during arrange routine. */ 580 Dimension boxes_minor ; /* Set during arrange routine. */ 581 Dimension fill_minor ; /* Set during arrange routine. */ 582 Dimension width ; /* Set during arrange routine. */ 583 Dimension height ; /* Set during arrange routine. */ 584 XmGeoExceptProc set_except ; 585 XmGeoExceptProc almost_except ; 586 XmGeoExceptProc no_geo_request ; 587 XtPointer extension ; 588 XmGeoExtDestructorProc ext_destructor ; 589 XmGeoArrangeProc arrange_boxes ;/* For user-defined arrangement routine. */ 590 unsigned char major_order ; 591 } XmGeoMatrixRec; 592 593 typedef XmGeoMatrix (*XmGeoCreateProc)( Widget, Widget, XtWidgetGeometry *) ; 594 595 /*********************************************************************** 596 * 597 * XmInheritP.h 598 * 599 ***********************************************************************/ 600 601 #define XmInheritCallbackProc ((XtCallbackProc) _XtInherit) 602 #define XmInheritTraversalProc ((XmTraversalProc) _XtInherit) 603 #define XmInheritParentProcess ((XmParentProcessProc) _XtInherit) 604 #define XmInheritWidgetProc ((XtWidgetProc) _XtInherit) 605 #define XmInheritMenuProc ((XmMenuProc) _XtInherit) 606 #define XmInheritTranslations XtInheritTranslations 607 #define XmInheritCachePart ((XmCacheClassPartPtr) _XtInherit) 608 #define XmInheritBaselineProc ((XmWidgetBaselineProc) _XtInherit) 609 #define XmInheritDisplayRectProc ((XmWidgetDisplayRectProc) _XtInherit) 610 #define XmInheritMarginsProc ((XmWidgetMarginsProc) _XtInherit) 611 #define XmInheritGeoMatrixCreate ((XmGeoCreateProc) _XtInherit) 612 #define XmInheritFocusMovedProc ((XmFocusMovedProc) _XtInherit) 613 #define XmInheritClass ((WidgetClass) &_XmInheritClass) 614 #define XmInheritInitializePrehook ((XtInitProc) _XtInherit) 615 #define XmInheritSetValuesPrehook ((XtSetValuesFunc) _XtInherit) 616 #define XmInheritGetValuesPrehook ((XtArgsProc) _XtInherit) 617 #define XmInheritInitializePosthook ((XtInitProc) _XtInherit) 618 #define XmInheritSetValuesPosthook ((XtSetValuesFunc) _XtInherit) 619 #define XmInheritGetValuesPosthook ((XtArgsProc) _XtInherit) 620 #define XmInheritSecObjectCreate ((XtInitProc) _XtInherit) 621 #define XmInheritGetSecResData ((XmGetSecResDataFunc) _XtInherit) 622 #define XmInheritInputDispatch ((XmWidgetDispatchProc) _XtInherit) 623 #define XmInheritVisualChange ((XmVisualChangeProc) _XtInherit) 624 #define XmInheritArmAndActivate ((XtActionProc) _XtInherit) 625 #define XmInheritActionProc ((XtActionProc) _XtInherit) 626 #define XmInheritFocusChange ((XmFocusChangeProc) _XtInherit) 627 #define XmInheritWidgetNavigable ((XmWidgetNavigableProc) _XtInherit) 628 #define XmInheritClassPartInitPrehook ((XtWidgetClassProc) _XtInherit) 629 #define XmInheritClassPartInitPosthook ((XtWidgetClassProc) _XtInherit) 630 #define XmInheritBorderHighlight ((XtWidgetProc) _XtInherit) 631 #define XmInheritBorderUnhighlight ((XtWidgetProc) _XtInherit) 632 633 634 /************************************************************************ 635 * 636 * Fast subclassing macros and definitions 637 * 638 ************************************************************************/ 639 /* WARNING: Application subclasses which choose to use fast 640 * subclassing must use only those bits between 641 * 192 (XmFIRST_APPLICATION_SUBCLASS_BIT) and 255. 642 * All other fast subclass bits are reserved for 643 * future use. Use of reserved fast subclass bits 644 * will cause binary compatibility breaks with 645 * future Motif versions. 646 */ 647 #define XmFIRST_APPLICATION_SUBCLASS_BIT 192 648 649 enum{ XmCASCADE_BUTTON_BIT = 1, XmCASCADE_BUTTON_GADGET_BIT, 650 XmCOMMAND_BOX_BIT, XmDIALOG_SHELL_BIT, 651 XmLIST_BIT, XmFORM_BIT, 652 XmTEXT_FIELD_BIT, XmGADGET_BIT, 653 XmLABEL_BIT, XmLABEL_GADGET_BIT, 654 XmMAIN_WINDOW_BIT, XmMANAGER_BIT, 655 XmMENU_SHELL_BIT, XmDRAWN_BUTTON_BIT, 656 XmPRIMITIVE_BIT, XmPUSH_BUTTON_BIT, 657 XmPUSH_BUTTON_GADGET_BIT, XmROW_COLUMN_BIT, 658 XmSCROLL_BAR_BIT, XmSCROLLED_WINDOW_BIT, 659 XmSELECTION_BOX_BIT, XmSEPARATOR_BIT, 660 XmSEPARATOR_GADGET_BIT, XmTEXT_BIT, 661 XmTOGGLE_BUTTON_BIT, XmTOGGLE_BUTTON_GADGET_BIT, 662 XmDROP_TRANSFER_BIT, XmDROP_SITE_MANAGER_BIT, 663 XmDISPLAY_BIT, XmSCREEN_BIT, 664 XmPRINT_SHELL_BIT, XmARROW_BUTTON_BIT, 665 XmARROW_BUTTON_GADGET_BIT, XmBULLETIN_BOARD_BIT, 666 XmDRAWING_AREA_BIT, XmFILE_SELECTION_BOX_BIT, 667 XmFRAME_BIT, XmMESSAGE_BOX_BIT, 668 XmSASH_BIT, XmSCALE_BIT, 669 XmPANED_WINDOW_BIT, XmVENDOR_SHELL_BIT, 670 XmCLIP_WINDOW_BIT, XmDRAG_ICON_BIT, 671 XmTEAROFF_BUTTON_BIT, XmDRAG_OVER_SHELL_BIT, 672 XmDRAG_CONTEXT_BIT, XmCONTAINER_BIT, 673 XmICONGADGET_BIT, XmNOTEBOOK_BIT, 674 XmCSTEXT_BIT, XmGRAB_SHELL_BIT, 675 XmCOMBO_BOX_BIT, XmSPINBOX_BIT, 676 XmICONHEADER_BIT, 677 678 XmBUTTONBOX_BIT, 679 XmDATAFIELD_BIT, 680 XmI18LIST_BIT, 681 XmEXT18LIST_BIT, 682 XmMULTI_LIST_BIT = XmEXT18LIST_BIT, 683 XmCOLORSELECTOR_BIT, 684 XmICONBOX_BIT, 685 XmICONBUTTON_BIT, 686 XmTABLE_BIT, 687 XmTABSTACK_BIT, 688 XmTREE_BIT, 689 XmTABBOX_BIT, 690 XmCOLUMN_BIT, 691 XmFONTSELECTOR_BIT, 692 XmCOMBINATION_BOX_2_BIT, 693 XmDROP_DOWN_BIT = XmCOMBINATION_BOX_2_BIT, 694 695 XmFAST_SUBCLASS_TAIL_BIT /* New entries precede this. */ 696 } ; 697 698 #define XmLAST_FAST_SUBCLASS_BIT (XmFAST_SUBCLASS_TAIL_BIT - 1) 699 700 701 #undef XmIsCascadeButton 702 #define XmIsCascadeButton(w) \ 703 (_XmIsFastSubclass(XtClass(w), XmCASCADE_BUTTON_BIT)) 704 705 #undef XmIsCascadeButtonGadget 706 #define XmIsCascadeButtonGadget(w) \ 707 (_XmIsFastSubclass(XtClass(w), XmCASCADE_BUTTON_GADGET_BIT)) 708 709 #undef XmIsClipWindow 710 #define XmIsClipWindow(w) \ 711 (_XmIsFastSubclass(XtClass(w), XmCLIP_WINDOW_BIT)) 712 713 #undef XmIsComboBox 714 #define XmIsComboBox(w) \ 715 (_XmIsFastSubclass(XtClass(w), XmCOMBO_BOX_BIT)) 716 717 #undef XmIsCommandBox 718 #define XmIsCommandBox(w) \ 719 (_XmIsFastSubclass(XtClass(w), XmCOMMAND_BOX_BIT)) 720 721 #undef XmIsContainer 722 #define XmIsContainer(w) \ 723 (_XmIsFastSubclass(XtClass(w), XmCONTAINER_BIT)) 724 725 #undef XmIsDialogShell 726 #define XmIsDialogShell(w) \ 727 (_XmIsFastSubclass(XtClass(w), XmDIALOG_SHELL_BIT)) 728 729 #undef XmIsDisplay 730 #define XmIsDisplay(w) \ 731 (_XmIsFastSubclass(XtClass(w), XmDISPLAY_BIT)) 732 733 #undef XmIsGrabShell 734 #define XmIsGrabShell(w) \ 735 (_XmIsFastSubclass(XtClass(w), XmGRAB_SHELL_BIT)) 736 737 #undef XmIsIconGadget 738 #define XmIsIconGadget(w) \ 739 (_XmIsFastSubclass(XtClass(w), XmICONGADGET_BIT)) 740 741 #undef XmIsList 742 #define XmIsList(w) \ 743 (_XmIsFastSubclass(XtClass(w), XmLIST_BIT)) 744 745 #undef XmIsForm 746 #define XmIsForm(w) \ 747 (_XmIsFastSubclass(XtClass(w), XmFORM_BIT)) 748 749 #undef XmIsTextField 750 #define XmIsTextField(w) \ 751 (_XmIsFastSubclass(XtClass(w), XmTEXT_FIELD_BIT)) 752 753 #undef XmIsGadget 754 #define XmIsGadget(w) \ 755 (_XmIsFastSubclass(XtClass(w), XmGADGET_BIT)) 756 757 #undef XmIsLabel 758 #define XmIsLabel(w) \ 759 (_XmIsFastSubclass(XtClass(w), XmLABEL_BIT)) 760 761 #undef XmIsLabelGadget 762 #define XmIsLabelGadget(w) \ 763 (_XmIsFastSubclass(XtClass(w), XmLABEL_GADGET_BIT)) 764 765 #undef XmIsMainWindow 766 #define XmIsMainWindow(w) \ 767 (_XmIsFastSubclass(XtClass(w), XmMAIN_WINDOW_BIT)) 768 769 #undef XmIsManager 770 #define XmIsManager(w) \ 771 (_XmIsFastSubclass(XtClass(w), XmMANAGER_BIT)) 772 773 #undef XmIsMenuShell 774 #define XmIsMenuShell(w) \ 775 (_XmIsFastSubclass(XtClass(w), XmMENU_SHELL_BIT)) 776 777 #undef XmIsNotebook 778 #define XmIsNotebook(w) \ 779 (_XmIsFastSubclass(XtClass(w), XmNOTEBOOK_BIT)) 780 781 #undef XmIsDragIcon 782 #define XmIsDragIcon(w) \ 783 (_XmIsFastSubclass(XtClass(w), XmDRAG_ICON_BIT)) 784 785 #undef XmIsDropSiteManager 786 #define XmIsDropSiteManager(w) \ 787 (_XmIsFastSubclass(XtClass(w), XmDROP_SITE_MANAGER_BIT)) 788 789 #undef XmIsDropTransfer 790 #define XmIsDropTransfer(w) \ 791 (_XmIsFastSubclass(XtClass(w), XmDROP_TRANSFER_BIT)) 792 793 #undef XmIsDragOverShell 794 #define XmIsDragOverShell(w) \ 795 (_XmIsFastSubclass(XtClass(w), XmDRAG_OVER_SHELL_BIT)) 796 797 #undef XmIsDragContext 798 #define XmIsDragContext(w) \ 799 (_XmIsFastSubclass(XtClass(w), XmDRAG_CONTEXT_BIT)) 800 801 #undef XmIsDrawnButton 802 #define XmIsDrawnButton(w) \ 803 (_XmIsFastSubclass(XtClass(w), XmDRAWN_BUTTON_BIT)) 804 805 #undef XmIsPrimitive 806 #define XmIsPrimitive(w) \ 807 (_XmIsFastSubclass(XtClass(w), XmPRIMITIVE_BIT)) 808 809 #undef XmIsPushButton 810 #define XmIsPushButton(w) \ 811 (_XmIsFastSubclass(XtClass(w), XmPUSH_BUTTON_BIT)) 812 813 #undef XmIsPushButtonGadget 814 #define XmIsPushButtonGadget(w) \ 815 (_XmIsFastSubclass(XtClass(w), XmPUSH_BUTTON_GADGET_BIT)) 816 817 #undef XmIsRowColumn 818 #define XmIsRowColumn(w) \ 819 (_XmIsFastSubclass(XtClass(w), XmROW_COLUMN_BIT)) 820 821 #undef XmIsScreen 822 #define XmIsScreen(w) \ 823 (_XmIsFastSubclass(XtClass(w), XmSCREEN_BIT)) 824 825 #undef XmIsScrollBar 826 #define XmIsScrollBar(w) \ 827 (_XmIsFastSubclass(XtClass(w), XmSCROLL_BAR_BIT)) 828 829 #undef XmIsScrolledWindow 830 #define XmIsScrolledWindow(w) \ 831 (_XmIsFastSubclass(XtClass(w), XmSCROLLED_WINDOW_BIT)) 832 833 #undef XmIsSelectionBox 834 #define XmIsSelectionBox(w) \ 835 (_XmIsFastSubclass(XtClass(w), XmSELECTION_BOX_BIT)) 836 837 #undef XmIsSeparator 838 #define XmIsSeparator(w) \ 839 (_XmIsFastSubclass(XtClass(w), XmSEPARATOR_BIT)) 840 841 #undef XmIsSeparatorGadget 842 #define XmIsSeparatorGadget(w) \ 843 (_XmIsFastSubclass(XtClass(w), XmSEPARATOR_GADGET_BIT)) 844 845 #undef XmIsSpinButton 846 #define XmIsSpinButton(w) \ 847 (_XmIsFastSubclass(XtClass(w), XmSPINBUTTON_BIT)) 848 849 #undef XmIsText 850 #define XmIsText(w) \ 851 (_XmIsFastSubclass(XtClass(w), XmTEXT_BIT)) 852 853 #undef XmIsTearOffButton 854 #define XmIsTearOffButton(w) \ 855 (_XmIsFastSubclass(XtClass(w), XmTEAROFF_BUTTON_BIT)) 856 857 #undef XmIsToggleButton 858 #define XmIsToggleButton(w) \ 859 (_XmIsFastSubclass(XtClass(w), XmTOGGLE_BUTTON_BIT)) 860 861 #undef XmIsToggleButtonGadget 862 #define XmIsToggleButtonGadget(w) \ 863 (_XmIsFastSubclass(XtClass(w), XmTOGGLE_BUTTON_GADGET_BIT)) 864 865 #undef XmIsPrintShell 866 #define XmIsPrintShell(w) \ 867 (_XmIsFastSubclass(XtClass(w), XmPRINT_SHELL_BIT)) 868 869 #undef XmIsArrowButton 870 #define XmIsArrowButton(w) \ 871 (_XmIsFastSubclass(XtClass(w), XmARROW_BUTTON_BIT)) 872 873 #undef XmIsArrowButtonGadget 874 #define XmIsArrowButtonGadget(w) \ 875 (_XmIsFastSubclass(XtClass(w), XmARROW_BUTTON_GADGET_BIT)) 876 877 #undef XmIsBulletinBoard 878 #define XmIsBulletinBoard(w) \ 879 (_XmIsFastSubclass(XtClass(w), XmBULLETIN_BOARD_BIT)) 880 881 #undef XmIsDrawingArea 882 #define XmIsDrawingArea(w) \ 883 (_XmIsFastSubclass(XtClass(w), XmDRAWING_AREA_BIT)) 884 885 #undef XmIsFileSelectionBox 886 #define XmIsFileSelectionBox(w) \ 887 (_XmIsFastSubclass(XtClass(w), XmFILE_SELECTION_BOX_BIT)) 888 889 #undef XmIsFrame 890 #define XmIsFrame(w) \ 891 (_XmIsFastSubclass(XtClass(w), XmFRAME_BIT)) 892 893 #undef XmIsMessageBox 894 #define XmIsMessageBox(w) \ 895 (_XmIsFastSubclass(XtClass(w), XmMESSAGE_BOX_BIT)) 896 897 #undef XmIsSash 898 #define XmIsSash(w) \ 899 (_XmIsFastSubclass(XtClass(w), XmSASH_BIT)) 900 901 #undef XmIsScale 902 #define XmIsScale(w) \ 903 (_XmIsFastSubclass(XtClass(w), XmSCALE_BIT)) 904 905 #undef XmIsPanedWindow 906 #define XmIsPanedWindow(w) \ 907 (_XmIsFastSubclass(XtClass(w), XmPANED_WINDOW_BIT)) 908 909 #undef XmIsCSText 910 #define XmIsCSText(w) \ 911 (_XmIsFastSubclass(XtClass(w), XmCSTEXT_BIT)) 912 913 #undef XmIsCombinationBox2 914 #define XmIsCombinationBox2(w) \ 915 (_XmIsFastSubclass(XtClass(w), XmCOMBINATION_BOX_2_BIT)) 916 917 #undef XmIsDropDown 918 #define XmIsDropDown(w) \ 919 (_XmIsFastSubclass(XtClass(w), XmDROP_DOWN_BIT)) 920 921 #undef XmIsExt18List 922 #define XmIsExt18List(w) \ 923 (_XmIsFastSubclass(XtClass(w), XmEXT18LIST_BIT)) 924 925 #undef XmIsMultiList 926 #define XmIsMultiList(w) \ 927 (_XmIsFastSubclass(XtClass(w), XmMULTI_LIST_BIT)) 928 929 930 /************************************************************************ 931 * 932 * ResolveP.h 933 * 934 ************************************************************************/ 935 936 937 /* Widget class indices used with XmPartOffset and XmField macros */ 938 939 #define XmObjectIndex 0 940 #define ObjectIndex XmObjectIndex 941 #define XmRectObjIndex (XmObjectIndex + 1) 942 #define RectObjIndex XmRectObjIndex 943 #define XmWindowObjIndex (XmRectObjIndex + 1) 944 #define WindowObjIndex XmWindowObjIndex 945 #define XmCoreIndex 0 946 #define CoreIndex XmCoreIndex 947 #define XmCompositeIndex (XmWindowObjIndex + 2) 948 #define CompositeIndex XmCompositeIndex 949 #define XmConstraintIndex (XmCompositeIndex + 1) 950 #define ConstraintIndex XmConstraintIndex 951 #define XmGadgetIndex (XmRectObjIndex + 1) 952 #define XmPrimitiveIndex (XmWindowObjIndex + 2) 953 #define XmManagerIndex (XmConstraintIndex + 1) 954 955 #define XmArrowBIndex (XmPrimitiveIndex + 1) 956 #define XmArrowButtonIndex XmArrowBIndex 957 #define XmLabelIndex (XmPrimitiveIndex + 1) 958 #define XmListIndex (XmPrimitiveIndex + 1) 959 #define XmScrollBarIndex (XmPrimitiveIndex + 1) 960 #define XmSeparatorIndex (XmPrimitiveIndex + 1) 961 #define XmTextIndex (XmPrimitiveIndex + 1) 962 #define XmTextFieldIndex (XmPrimitiveIndex + 1) 963 #define XmCSTextIndex (XmPrimitiveIndex + 1) 964 965 #define XmCascadeBIndex (XmLabelIndex + 1) 966 #define XmCascadeButtonIndex XmCascadeBIndex 967 #define XmDrawnBIndex (XmLabelIndex + 1) 968 #define XmDrawnButtonIndex XmDrawnBIndex 969 #define XmPushBIndex (XmLabelIndex + 1) 970 #define XmPushButtonIndex XmPushBIndex 971 #define XmToggleBIndex (XmLabelIndex + 1) 972 #define XmToggleButtonIndex XmToggleBIndex 973 #define XmTearOffButtonIndex (XmPushBIndex + 1) 974 975 #define XmArrowBGIndex (XmGadgetIndex + 1) 976 #define XmArrowButtonGadgetIndex XmArrowBGIndex 977 #define XmLabelGIndex (XmGadgetIndex + 1) 978 #define XmLabelGadgetIndex XmLabelGIndex 979 #define XmSeparatoGIndex (XmGadgetIndex + 1) 980 #define XmSeparatorGadgetIndex XmSeparatoGIndex 981 982 #define XmCascadeBGIndex (XmLabelGIndex + 1) 983 #define XmCascadeButtonGadgetIndex XmCascadeBGIndex 984 #define XmPushBGIndex (XmLabelGIndex + 1) 985 #define XmPushButtonGadgetIndex XmPushBGIndex 986 #define XmToggleBGIndex (XmLabelGIndex + 1) 987 #define XmToggleButtonGadgetIndex XmToggleBGIndex 988 #define XmIconGadgetIndex (XmGadgetIndex + 1) 989 990 #define XmBulletinBIndex (XmManagerIndex + 1) 991 #define XmBulletinBoardIndex XmBulletinBIndex 992 #define XmDrawingAIndex (XmManagerIndex + 1) 993 #define XmDrawingAreaIndex XmDrawingAIndex 994 #define XmClipWindowIndex (XmDrawingAIndex + 1) 995 #define XmFrameIndex (XmManagerIndex + 1) 996 #define XmPanedWIndex (XmManagerIndex + 1) 997 #define XmPanedWindowIndex XmPanedWIndex 998 #define XmSashIndex (XmPrimitiveIndex + 1) 999 #define XmRowColumnIndex (XmManagerIndex + 1) 1000 #define XmScaleIndex (XmManagerIndex + 1) 1001 #define XmScrolledWIndex (XmManagerIndex + 1) 1002 #define XmScrolledWindowIndex XmScrolledWIndex 1003 1004 #define XmFormIndex (XmBulletinBIndex + 1) 1005 #define XmMessageBIndex (XmBulletinBIndex + 1) 1006 #define XmMessageBoxIndex XmMessageBIndex 1007 #define XmSelectioBIndex (XmBulletinBIndex + 1) 1008 #define XmSelectionBoxIndex XmSelectioBIndex 1009 1010 #define XmMainWIndex (XmScrolledWIndex + 1) 1011 #define XmMainWindowIndex XmMainWIndex 1012 1013 #define XmCommandIndex (XmSelectioBIndex + 1) 1014 #define XmFileSBIndex (XmSelectioBIndex + 1) 1015 #define XmFileSelectionBoxIndex XmFileSBIndex 1016 1017 #define XmShellIndex (XmCompositeIndex + 1) 1018 #define ShellIndex XmShellIndex 1019 #define XmOverrideShellIndex (XmShellIndex + 1) 1020 #define OverrideShellIndex XmOverrideShellIndex 1021 #define XmWMShellIndex (XmShellIndex + 1) 1022 #define WMShellIndex XmWMShellIndex 1023 #define XmVendorShellIndex (XmWMShellIndex + 1) 1024 #define VendorShellIndex XmVendorShellIndex 1025 #define XmTransientShellIndex (XmVendorShellIndex + 1) 1026 #define TransientShellIndex XmTransientShellIndex 1027 #define XmTopLevelShellIndex (XmVendorShellIndex + 1) 1028 #define TopLevelShellIndex XmTopLevelShellIndex 1029 #define XmApplicationShellIndex (XmTopLevelShellIndex + 1) 1030 #define ApplicationShellIndex XmApplicationShellIndex 1031 #define XmGrabShellIndex (XmVendorShellIndex + 1) 1032 #define XmDisplayIndex (XmApplicationShellIndex + 1) 1033 1034 #define XmDialogSIndex (XmTransientShellIndex + 1) 1035 #define XmDialogShellIndex XmDialogSIndex 1036 #define XmMenuShellIndex (XmOverrideShellIndex + 1) 1037 1038 #define XmContainerIndex (XmManagerIndex + 1) 1039 #define XmNotebookIndex (XmManagerIndex + 1) 1040 #define XmSpinButtonIndex (XmManagerIndex + 1) 1041 #define XmComboBoxIndex (XmManagerIndex + 1) 1042 1043 #define XmDragIconIndex (XmRectObjIndex + 1) 1044 #define XmDropSiteManagerIndex (XmObjectIndex + 1) 1045 #define XmDropTransferIndex (XmObjectIndex + 1) 1046 #define XmDragOverShellIndex (XmVendorShellIndex + 1) 1047 #define XmDragContextIndex (XmCoreIndex + 1) 1048 1049 /* 1050 * XmOFFSETBITS is the number of bits used for the part offset within the 1051 * resource_offset field in the XmPartResource struct. XmOFFSETMASK is the 1052 * bitmask to mask for the part offset. 1053 */ 1054 #define XmOFFSETBITS (sizeof(Cardinal)*8/2) 1055 #define XmOFFSETMASK ((1<<XmOFFSETBITS)-1) 1056 1057 typedef struct _XmPartResource { 1058 String resource_name; /* Resource name */ 1059 String resource_class; /* Resource class */ 1060 String resource_type; /* Representation type desired */ 1061 Cardinal resource_size; /* Size in bytes of representation */ 1062 Cardinal resource_offset; /* Index within & offset within part */ 1063 String default_type; /* representation type of specified default */ 1064 XtPointer default_addr; /* Address of default resource */ 1065 } XmPartResource; 1066 1067 #if (defined(__STDC__) && !defined(UNIXCPP)) || defined(__cplusplus) || defined(ANSICPP) 1068 # define XmPartOffset(part, variable) \ 1069 ((part##Index) << XmOFFSETBITS) + XtOffsetOf( part##Part, variable) 1070 1071 # define XmConstraintPartOffset(part, variable) \ 1072 ((part##Index) << XmOFFSETBITS) + \ 1073 XtOffsetOf( part##ConstraintPart, variable) 1074 1075 # define XmGetPartOffset(r, offset) \ 1076 ((r)->resource_offset & XmOFFSETMASK) + \ 1077 (*(offset))[(r)->resource_offset >> XmOFFSETBITS] 1078 1079 # define XmField(widget, offsetrecord, part, variable, type) \ 1080 (*(type *)(((char *) (widget)) + offsetrecord[part##Index] + \ 1081 XtOffsetOf( part##Part, variable))) 1082 1083 # define XmConstraintField(widget, offsetrecord, part, variable, type) \ 1084 (*(type *)(((char *) (widget)->core.constraints) + \ 1085 offsetrecord[part##Index] + \ 1086 XtOffsetOf( part##ConstraintPart, variable))) 1087 #else 1088 # define XmPartOffset(part, variable) \ 1089 ((part/**/Index) << XmOFFSETBITS) + XtOffsetOf( part/**/Part, variable) 1090 1091 # define XmConstraintPartOffset(part, variable) \ 1092 ((part/**/Index) << XmOFFSETBITS) + \ 1093 XtOffsetOf( part/**/ConstraintPart, variable) 1094 1095 # define XmGetPartOffset(r, offset) \ 1096 ((r)->resource_offset & XmOFFSETMASK) + \ 1097 (*(offset))[(r)->resource_offset >> XmOFFSETBITS]; 1098 1099 # define XmField(widget, offsetrecord, part, variable, type) \ 1100 (*(type *)(((char *) (widget)) + offsetrecord[part/**/Index] + \ 1101 XtOffsetOf( part/**/Part, variable))) 1102 1103 # define XmConstraintField(widget, offsetrecord, part, variable, type) \ 1104 (*(type *)(((char *) (widget)->core.constraints) + \ 1105 offsetrecord[part/**/Index] + \ 1106 XtOffsetOf( part/**/ConstraintPart, variable))) 1107 #endif 1108 1109 /*********************************************************************** 1110 * 1111 * RegionP.h 1112 * 1113 * This structure must match the opaque libX Region structure. 1114 ***********************************************************************/ 1115 1116 typedef struct { 1117 short x1, x2, y1, y2; 1118 } XmRegionBox; 1119 1120 typedef struct _XmRegion { 1121 long size; 1122 long numRects; 1123 XmRegionBox *rects; 1124 XmRegionBox extents; 1125 } XmRegionRec, *XmRegion; 1126 1127 1128 /******** ResConvert.c ********/ 1129 1130 enum{ XmLABEL_FONTLIST = 1, XmBUTTON_FONTLIST, 1131 XmTEXT_FONTLIST 1132 } ; 1133 1134 enum { 1135 XmLABEL_RENDER_TABLE = 1, 1136 XmBUTTON_RENDER_TABLE, 1137 XmTEXT_RENDER_TABLE 1138 } ; 1139 1140 /**** Private Defines, Typedefs, and Function Declarations for XmString.c ****/ 1141 1142 /* For _XmStringIndexCacheTag() and _XmStringCacheTag() length. */ 1143 #define XmSTRING_TAG_STRLEN -1 1144 1145 /* For _XmStringGetNextTabWidth. EOS = End Of String. */ 1146 typedef enum { XmTAB_NEXT, XmTAB_NEWLINE, XmTAB_EOS } NextTabResult; 1147 1148 /******** End Private Function Declarations ********/ 1149 1150 /******** Traversal.c ********/ 1151 1152 #define XmTAB_ANY ((XmNavigationType) 255) 1153 #define XmNONE_OR_BC ((XmNavigationType) 254) 1154 1155 typedef struct _XmFocusMovedCallbackStruct{ 1156 int reason; 1157 XEvent *event; 1158 Boolean cont; 1159 Widget old_focus; 1160 Widget new_focus; 1161 unsigned char focus_policy; 1162 XmTraversalDirection direction; 1163 } XmFocusMovedCallbackStruct, *XmFocusMovedCallback; 1164 1165 typedef struct _XmFocusDataRec *XmFocusData; 1166 1167 1168 /******** ResInd.c ********/ 1169 1170 typedef enum { 1171 XmPARSE_ERROR, XmPARSE_NO_UNITS, XmPARSE_UNITS_OK 1172 } XmParseResult; 1173 1174 1175 1176 /******** Function Declarations for Xme ********/ 1177 1178 /* GadgetUtil.c */ 1179 extern void XmeRedisplayGadgets( 1180 Widget w, 1181 register XEvent *event, 1182 Region region) ; 1183 extern void XmeConfigureObject( 1184 Widget g, 1185 #if NeedWidePrototypes 1186 int x, 1187 int y, 1188 int width, 1189 int height, 1190 int border_width) ; 1191 #else 1192 Position x, 1193 Position y, 1194 Dimension width, 1195 Dimension height, 1196 Dimension border_width) ; 1197 #endif /* NeedWidePrototypes */ 1198 /* Traversal.c */ 1199 extern void XmeNavigChangeManaged( 1200 Widget wid) ; 1201 extern Boolean XmeFocusIsInShell( 1202 Widget wid) ; 1203 /* ResInd.c */ 1204 extern XmImportOperator XmeToHorizontalPixels( 1205 Widget widget, 1206 int offset, 1207 XtArgVal *value) ; 1208 extern XmImportOperator XmeToVerticalPixels( 1209 Widget widget, 1210 int offset, 1211 XtArgVal *value) ; 1212 extern void XmeFromHorizontalPixels( 1213 Widget widget, 1214 int offset, 1215 XtArgVal *value) ; 1216 extern void XmeFromVerticalPixels( 1217 Widget widget, 1218 int offset, 1219 XtArgVal *value) ; 1220 extern XmParseResult XmeParseUnits(String spec, int *unitType); 1221 /* DragIcon. c */ 1222 extern Widget XmeGetTextualDragIcon(Widget w) ; 1223 /* BulletinB.c */ 1224 extern Widget XmeCreateClassDialog( 1225 WidgetClass w_class, 1226 Widget ds_p, 1227 String name, 1228 ArgList bb_args, 1229 Cardinal bb_n ) ; 1230 /* ImageCache.c */ 1231 extern Boolean XmeGetPixmapData( 1232 Screen *screen, 1233 Pixmap pixmap, 1234 char **image_name, 1235 int *depth, 1236 Pixel *foreground, 1237 Pixel *background, 1238 int *hot_x, 1239 int *hot_y, 1240 unsigned int *width, 1241 unsigned int *height) ; 1242 extern Pixmap XmeGetMask( 1243 Screen *screen, 1244 char *image_name) ; 1245 /* VaSimple.c */ 1246 extern int XmeCountVaListSimple(va_list al); 1247 extern Widget XmeVLCreateWidget( 1248 char *name, 1249 WidgetClass wc, 1250 Widget parent, 1251 Boolean managed, 1252 va_list al, 1253 int count); 1254 /* VirtKeys.c */ 1255 extern int XmeVirtualToActualKeysyms( 1256 Display *dpy, 1257 KeySym virtKeysym, 1258 XmKeyBinding *actualKeyData) ; 1259 /* Screen.c */ 1260 extern Cursor XmeGetNullCursor(Widget w) ; 1261 extern void XmeQueryBestCursorSize( 1262 Widget w, 1263 Dimension *width, 1264 Dimension *height ); 1265 /* Xm.c */ 1266 extern void XmeWarning( Widget w, char *message ) ; 1267 /* ResConvert.c */ 1268 extern XmFontList XmeGetDefaultRenderTable( 1269 Widget w, 1270 #if NeedWidePrototypes 1271 unsigned int fontListType ); 1272 #else 1273 unsigned char fontListType ); 1274 #endif /* NeedWidePrototypes */ 1275 extern Boolean XmeNamesAreEqual( 1276 register char *in_str, 1277 register char *test_str ); 1278 /* Primitive.c */ 1279 extern void XmeResolvePartOffsets( 1280 WidgetClass w_class, 1281 XmOffsetPtr *offset, 1282 XmOffsetPtr *constraint_offset ) ; 1283 /* XmString.c */ 1284 extern Boolean XmeStringIsValid( XmString string ) ; 1285 extern void XmeSetWMShellTitle( 1286 XmString xmstr, 1287 Widget shell) ; 1288 extern XmIncludeStatus XmeGetDirection(XtPointer *in_out, 1289 XtPointer text_end, 1290 XmTextType type, 1291 XmStringTag locale_tag, 1292 XmParseMapping entry, 1293 int pattern_length, 1294 XmString *str_include, 1295 XtPointer call_data); 1296 extern XmIncludeStatus XmeGetNextCharacter(XtPointer *in_out, 1297 XtPointer text_end, 1298 XmTextType type, 1299 XmStringTag locale_tag, 1300 XmParseMapping entry, 1301 int pattern_length, 1302 XmString *str_include, 1303 XtPointer call_data); 1304 extern XmStringComponentType XmeStringGetComponent(_XmStringContext context, 1305 Boolean update_context, 1306 Boolean copy_data, 1307 unsigned int *length, 1308 XtPointer *value); 1309 /* XmFontList.c */ 1310 extern Boolean XmeRenderTableGetDefaultFont( 1311 XmFontList fontlist, 1312 XFontStruct **font_struct ) ; 1313 /* GMUtils.c */ 1314 extern XtGeometryResult XmeReplyToQueryGeometry( 1315 Widget widget, 1316 XtWidgetGeometry * intended, 1317 XtWidgetGeometry * desired) ; 1318 /* Color.c */ 1319 extern void XmeGetDefaultPixel( 1320 Widget widget, 1321 int type, 1322 int offset, 1323 XrmValue *value) ; 1324 /* Xmos.c */ 1325 extern String XmeGetHomeDirName(void) ; 1326 extern int XmeMicroSleep( 1327 long secs) ; 1328 extern XmString XmeGetLocalizedString( 1329 char *reserved, 1330 Widget widget, 1331 char *resource, 1332 String string) ; 1333 1334 extern void XmRenderTableGetDefaultFontExtents( 1335 XmRenderTable rendertable, 1336 int *height, 1337 int *ascent, 1338 int *descent) ; 1339 1340 /******** End Function Declarations for Xme ********/ 1341 1342 /******** ********/ 1343 1344 #ifdef __cplusplus 1345 } /* Close scope of 'extern "C"' declaration which encloses file. */ 1346 #endif 1347 1348 1349 1350 #include <Xm/BaseClassP.h> 1351 1352 1353 /*********************************************************************** 1354 * 1355 * Motif 1.2 BC compilation. 1356 * 1357 ***********************************************************************/ 1358 1359 #ifndef NO_XM_1_2_BC 1360 1361 /* 1362 * These routines have all been made obsolete by public Xme functions. 1363 * The declarations here are intended solely as an aid to porting, 1364 * and will be removed in a future release. All applications should 1365 * name the Xme methods directly. 1366 * 1367 * _XmVirtualToActualKeysym, _XmResizeObject, and _XmMoveObject have 1368 * Xme counterparts with slightly different semantics or parameters, 1369 * so a simple rename will not work for them. 1370 */ 1371 1372 #define _XmClearBorder XmeClearBorder 1373 #define _XmConfigureObject XmeConfigureObject 1374 #define _XmDrawArrow XmeDrawArrow 1375 #define _XmDrawDiamond XmeDrawDiamond 1376 #define _XmDrawSeparator XmeDrawSeparator 1377 #define _XmDrawShadows XmeDrawShadows 1378 #define _XmDrawSimpleHighlight XmeDrawHighlight 1379 #define _XmFontListGetDefaultFont XmeRenderTableGetDefaultFont 1380 #define _XmFromHorizontalPixels XmeFromHorizontalPixels 1381 #define _XmFromVerticalPixels XmeFromVerticalPixels 1382 #define _XmGMReplyToQueryGeometry XmeReplyToQueryGeometry 1383 #define _XmGetDefaultFontList XmeGetDefaultRenderTable 1384 #define _XmGetMaxCursorSize XmeQueryBestCursorSize 1385 #define _XmGetNullCursor XmeGetNullCursor 1386 #define _XmGetTextualDragIcon XmeGetTextualDragIcon 1387 #define _XmInputInGadget XmObjectAtPoint 1388 #define _XmMicroSleep XmeMicroSleep 1389 #define _XmNavigChangeManaged XmeNavigChangeManaged 1390 #define _XmOSGetHomeDirName XmeGetHomeDirName 1391 #define _XmOSGetLocalizedString XmeGetLocalizedString 1392 #define _XmRedisplayGadgets XmeRedisplayGadgets 1393 #define _XmStringIsXmString XmeStringIsValid 1394 #define _XmStringUpdateWMShellTitle XmeSetWMShellTitle 1395 #define _XmStringsAreEqual XmeNamesAreEqual 1396 #define _XmToHorizontalPixels XmeToHorizontalPixels 1397 #define _XmToVerticalPixels XmeToVerticalPixels 1398 #define _XmWarning XmeWarning 1399 1400 1401 /* 1402 * These routines are really undocumented and internal, but have been 1403 * used widely enough as data that they are preserved here for source 1404 * compatibility. 1405 */ 1406 1407 extern void _XmDestroyParentCallback( 1408 Widget w, 1409 XtPointer client_data, 1410 XtPointer call_data) ; 1411 1412 1413 /* 1414 * Use of these internal macros is sufficiently widespread that they 1415 * are still made available here for source compatibility. 1416 */ 1417 1418 /* The _XmCreateImage macro is used to create XImage with client 1419 * specific data for the bit and byte order. We still have to do the 1420 * following because XCreateImage will stuff here display specific 1421 * data and we want client specific values (i.e the bit orders we used 1422 * for creating the bitmap data in Motif) */ 1423 #define _XmCreateImage(IMAGE, DISPLAY, DATA, WIDTH, HEIGHT, BYTE_ORDER) {\ 1424 IMAGE = XCreateImage(DISPLAY,\ 1425 DefaultVisual(DISPLAY, DefaultScreen(DISPLAY)),\ 1426 1,\ 1427 XYBitmap,\ 1428 0,\ 1429 DATA,\ 1430 WIDTH, HEIGHT,\ 1431 8,\ 1432 (WIDTH+7) >> 3);\ 1433 IMAGE->byte_order = BYTE_ORDER;\ 1434 IMAGE->bitmap_unit = 8;\ 1435 IMAGE->bitmap_bit_order = LSBFirst;\ 1436 } 1437 1438 #endif /* NO_XM_1_2_BC */ 1439 1440 #if __GNUC__ 1441 # define XM_DEPRECATED __attribute__((__deprecated__)) 1442 # ifdef NO_WEAK_ALIASES 1443 # define XM_ALIAS(sym) 1444 # else 1445 # define XM_ALIAS(sym) __attribute__((__weak__,alias(#sym))) 1446 # endif 1447 #else 1448 # define XM_DEPRECATED 1449 # define XM_ALIAS(sym) 1450 #endif 1451 1452 #define FIX_1381 1453 1454 #endif /* _XmP_h */ 1455 /* DON'T ADD STUFF AFTER THIS #endif */ 1456