home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / include / Xm / XmP.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-06-30  |  86.5 KB  |  2,587 lines

  1. /* 
  2.  * (c) Copyright 1989, 1990, 1991, 1992, 1993 OPEN SOFTWARE FOUNDATION, INC. 
  3.  * ALL RIGHTS RESERVED 
  4. */ 
  5. /* 
  6.  * Motif Release 1.2.3
  7. */ 
  8. /*   $RCSfile: XmP.h,v $ $Revision: 10.1 $ $Date: 1994/02/03 16:01:18 $ */
  9. /*
  10. *  (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 HEWLETT-PACKARD COMPANY */
  11. /************************************<+>*************************************
  12.  ****************************************************************************
  13.  **
  14.  **   File:        XmP.h
  15.  **
  16.  **   Description: This include file contains the class and instance record
  17.  **                definitions for all meta classes.  It also contains externs
  18.  **                for internally shared functions and defines for internally 
  19.  **                shared values.
  20.  **
  21.  ****************************************************************************
  22.  ************************************<+>*************************************/
  23. #ifndef _XmP_h
  24. #define _XmP_h
  25.  
  26. #include <Xm/Xm.h>
  27. #include <X11/IntrinsicP.h>
  28.  
  29.  
  30. #ifdef __cplusplus
  31. extern "C" {
  32. #endif
  33.  
  34.  
  35. /***************************************************************************
  36.  *  Macros replacing toolkit macros so that gadgets are handled properly. 
  37.  ***************************************************************************/
  38.  
  39. #ifdef XtName
  40. #undef XtName
  41. #endif
  42. #define XtName(widget) XrmQuarkToString (((Object)(widget))->object.xrm_name)
  43.  
  44. #ifdef XtDisplay
  45. #undef XtDisplay
  46. #endif
  47. #define XtDisplay(widget)                        \
  48.    (XtIsWidget(widget)         ?                    \
  49.       ((Widget)(widget))->core.screen->display :            \
  50.       ((Object)(widget))->object.parent->core.screen->display)
  51.  
  52. #ifdef XtScreen
  53. #undef XtScreen
  54. #endif
  55. #define XtScreen(widget) (XtIsWidget(widget)  ?        \
  56.              ((Widget)(widget))->core.screen   :    \
  57.              ((Object)(widget))->object.parent->core.screen)
  58.  
  59. #ifdef XtWindow
  60. #undef XtWindow
  61. #endif
  62. #define XtWindow(widget) (XtIsWidget(widget)  ?            \
  63.              ((Widget)(widget))->core.window   :        \
  64.              ((Object)(widget))->object.parent->core.window)
  65.  
  66. #ifdef XtClass
  67. #undef XtClass
  68. #endif
  69. #define XtClass(widget)    (((Object)(widget))->object.widget_class)
  70.  
  71. #ifdef XtSuperclass
  72. #undef XtSuperclass
  73. #endif
  74. #define XtSuperclass(widget) (XtClass(widget)->core_class.superclass)
  75.  
  76.  
  77. #ifdef XtIsRealized
  78. #undef XtIsRealized
  79. #endif
  80. #define XtIsRealized(widget) (XtWindow((Widget)widget) != None)
  81.  
  82. #ifdef XtIsManaged
  83. #undef XtIsManaged
  84. #endif
  85. #define XtIsManaged(widget)                     \
  86.   (XtIsRectObj(widget) ? (((RectObj)(widget))->rectangle.managed) : False)
  87.  
  88.  
  89. #ifdef XtIsSensitive
  90. #undef XtIsSensitive
  91. #endif
  92. #define XtIsSensitive(widget)                     \
  93.   ((!XtIsRectObj(widget)) ? False :                 \
  94.    (((RectObj)(widget))->rectangle.sensitive &&         \
  95.     ((RectObj)(widget))->rectangle.ancestor_sensitive))
  96.  
  97. #ifdef XtParent
  98. #undef XtParent
  99. #endif
  100. #define XtParent(widget) (((Object)(widget))->object.parent)
  101.  
  102. #define XtX(w)         ((w)->core.x)
  103. #define XtY(w)         ((w)->core.y)
  104. #define XtWidth(w)     ((w)->core.width)
  105. #define XtHeight(w)     ((w)->core.height)
  106. #define XtBorderWidth(w) ((w)->core.border_width)
  107. #define XtBackground(w)     ((w)->core.background_pixel)
  108. #define XtSensitive(w)     ((w)->core.sensitive && (w)->core.ancestor_sensitive) 
  109.  
  110. #define XtCoreProc(w,proc) ((w)->core.widget_class->core_class.proc)
  111.  
  112.  
  113. /***********************************************************************
  114.  *
  115.  * Miscellaneous Private Defines
  116.  *
  117.  ***********************************************************************/
  118.  
  119. #ifndef XmConst
  120. #if (defined(__STDC__) && __STDC__)  ||  !defined( NO_CONST )
  121. #define XmConst const
  122. #else
  123. #define XmConst
  124. #endif /* __STDC__ */
  125. #endif /* XmConst */
  126.  
  127.  
  128. /* Defines used for menu/button communication */
  129. enum{    XmMENU_POPDOWN,            XmMENU_PROCESS_TREE,
  130.     XmMENU_TRAVERSAL,        XmMENU_SHELL_POPDOWN,
  131.     XmMENU_CALLBACK,        XmMENU_BUTTON,
  132.     XmMENU_CASCADING,        XmMENU_SUBMENU,
  133.     XmMENU_ARM,            XmMENU_DISARM,
  134.     XmMENU_BAR_CLEANUP,        XmMENU_STATUS,
  135.     XmMENU_MEMWIDGET_UPDATE,    XmMENU_BUTTON_POPDOWN,
  136.     XmMENU_RESTORE_EXCLUDED_TEAROFF_TO_TOPLEVEL_SHELL,
  137.     XmMENU_RESTORE_TEAROFF_TO_TOPLEVEL_SHELL,
  138.     XmMENU_RESTORE_TEAROFF_TO_MENUSHELL,
  139.     XmMENU_GET_LAST_SELECT_TOPLEVEL,
  140.     XmMENU_TEAR_OFF_ARM
  141.     } ;
  142.  
  143. /***********************************************************************
  144.  *
  145.  * Status for menus
  146.  *
  147.  ***********************************************************************/
  148.  
  149. #define XmMENU_TORN_BIT                         (1 << 0)
  150. #define XmMENU_TEAR_OFF_SHELL_DESCENDANT_BIT    (1 << 1)
  151. #define XmMENU_POPUP_POSTED_BIT            (1 << 2)
  152.  
  153. #define XmIsTorn(mask)                          (mask & XmMENU_TORN_BIT)
  154. #define XmIsTearOffShellDescendant(mask)        (mask & XmMENU_TEAR_OFF_SHELL_DESCENDANT_BIT)
  155. #define XmPopupPosted(mask)                (mask & XmMENU_POPUP_POSTED_BIT)
  156.  
  157.  
  158. #ifdef _NO_PROTO
  159. typedef void (*XmMenuProc)() ;
  160. #else
  161. typedef void (*XmMenuProc)( int, Widget, ...) ;
  162. #endif
  163.  
  164. /***********************************************************************
  165.  *
  166.  * Simple Menu Structure
  167.  *
  168.  ***********************************************************************/
  169.  
  170. typedef struct _XmSimpleMenuRec {
  171.     int count;
  172.     int post_from_button;
  173.     XtCallbackProc callback;
  174.     XmStringTable label_string;
  175.     String *accelerator;
  176.     XmStringTable accelerator_text;
  177.     XmKeySymTable mnemonic;
  178.     XmStringCharSetTable mnemonic_charset;
  179.     XmButtonTypeTable button_type;
  180.     int button_set;
  181.     XmString option_label;
  182.         KeySym option_mnemonic;
  183. } XmSimpleMenuRec, * XmSimpleMenu;
  184.  
  185.  
  186. /* For MapEvent: _XmMatchBtnEvent */
  187. #define XmIGNORE_EVENTTYPE      -1
  188.  
  189. /* Default minimum Toggle indicator dimension */
  190. #define XmDEFAULT_INDICATOR_DIM   9
  191.  
  192. /************************************************************************
  193.  * defines needed for 3D visual enhancement of defaultButtonshadow and
  194.  *  implementation of ToggleButton Indicatorsize.
  195.  ************************************************************************/
  196.  
  197. #define Xm3D_ENHANCE_PIXEL        2
  198. #define XmDEFAULT_TOP_MARGIN        0
  199. #define XmDEFAULT_BOTTOM_MARGIN        0
  200.  
  201.  
  202.  
  203. /************************************************************************
  204.  *
  205.  *  Resource definition function and structure used by Primitive, Gadget
  206.  *  and Manager to define there get values hook processing lists
  207.  *
  208.  ************************************************************************/
  209.  
  210. typedef enum{ XmSYNTHETIC_NONE, XmSYNTHETIC_LOAD } XmImportOperator ;
  211.  
  212. #ifdef _NO_PROTO
  213. typedef void (*XmExportProc)();
  214. typedef XmImportOperator (*XmImportProc)();
  215. #else
  216. typedef void (*XmExportProc)( Widget, int, XtArgVal *) ;
  217. typedef XmImportOperator (*XmImportProc)( Widget, int, XtArgVal *) ;
  218. #endif
  219.  
  220. typedef struct _XmSyntheticResource
  221. {
  222.    String   resource_name;
  223.    Cardinal resource_size;
  224.    Cardinal resource_offset;
  225.    XmExportProc export_proc;
  226.    XmImportProc import_proc;
  227. } XmSyntheticResource;
  228.  
  229.  
  230. /*  Structure and defines for parent process data */
  231.  
  232. typedef struct
  233. {
  234.    int          process_type ;  /* Common to all parent process records. */
  235.    } XmParentProcessAnyRec ;
  236.  
  237. typedef struct
  238.    int          process_type ;  /* Common to all parent process records. */
  239.    XEvent *     event ;
  240.    int          action ;
  241.    String *     params ;
  242.    Cardinal *   num_params ;
  243. } XmParentInputActionRec ;
  244.  
  245. typedef union
  246. {
  247.    XmParentProcessAnyRec  any ;
  248.    XmParentInputActionRec input_action ;
  249. } XmParentProcessDataRec, * XmParentProcessData ;
  250.  
  251. enum{   XmPARENT_PROCESS_ANY,  XmINPUT_ACTION
  252.     } ;
  253. enum{    XmPARENT_ACTIVATE,        XmPARENT_CANCEL
  254.     } ;
  255. #define XmRETURN XmPARENT_ACTIVATE       /* For Motif 1.1 BC. */
  256. #define XmCANCEL XmPARENT_CANCEL         /* For Motif 1.1 BC. */
  257.  
  258.  
  259. #define XmINVALID_DIMENSION (0xFFFF)
  260.  
  261. enum{    XmBASELINE_GET,            XmBASELINE_SET
  262.     } ;
  263.  
  264. typedef struct _XmBaselineMargins
  265. {
  266.   unsigned char get_or_set;
  267.   Dimension margin_top;
  268.   Dimension margin_bottom;
  269.   Dimension shadow;
  270.   Dimension highlight;
  271.   Dimension text_height;
  272.   Dimension margin_height;
  273. } XmBaselineMargins;
  274.  
  275.  
  276. typedef enum{ XmFOCUS_IN, XmFOCUS_OUT, XmENTER, XmLEAVE } XmFocusChange ;
  277.  
  278. typedef enum{
  279.         XmNOT_NAVIGABLE,                XmCONTROL_NAVIGABLE,
  280.     XmTAB_NAVIGABLE,                XmDESCENDANTS_NAVIGABLE,
  281.     XmDESCENDANTS_TAB_NAVIGABLE
  282.   } XmNavigability ;
  283.  
  284. #define XmVoidProc      XtProc
  285.  
  286. #ifdef _NO_PROTO
  287.  
  288. typedef Boolean (*XmParentProcessProc)() ;
  289. typedef void (*XmWidgetDispatchProc)() ;
  290. typedef void (*XmMenuPopupProc)() ;
  291. typedef void (*XmMenuTraversalProc)() ;
  292. typedef void (*XmResizeFlagProc)() ;
  293. typedef void (*XmRealizeOutProc)() ;
  294. typedef Boolean (*XmVisualChangeProc)();  /* returns TRUE if redisplay */
  295. typedef void (*XmTraversalProc)();
  296. typedef void (*XmFocusMovedProc)() ;
  297. typedef void (*XmCacheCopyProc)() ;
  298. typedef void (*XmGadgetCacheProc)() ;
  299. typedef int (*XmCacheCompareProc)() ;
  300. typedef Boolean (*XmWidgetBaselineProc)();
  301. typedef Boolean (*XmWidgetDisplayRectProc)();
  302. typedef void (*XmWidgetMarginsProc)();
  303. typedef XmNavigability (*XmWidgetNavigableProc)() ;
  304. typedef void (*XmFocusChangeProc)() ;
  305.  
  306. #else
  307.  
  308. typedef Boolean (*XmParentProcessProc)( Widget, XmParentProcessData) ;
  309. typedef void (*XmWidgetDispatchProc)( Widget, XEvent *, Mask) ;
  310. typedef void (*XmMenuPopupProc)( Widget, Widget, XEvent *) ;
  311. typedef void (*XmMenuTraversalProc)( Widget, Widget, XmTraversalDirection) ;
  312. typedef void (*XmResizeFlagProc)(
  313.             Widget,
  314. #if NeedWidePrototypes
  315.             int) ;
  316. #else
  317.             Boolean) ;
  318. #endif /* NeedWidePrototypes */
  319. typedef void (*XmRealizeOutProc)( Widget, Mask *, XSetWindowAttributes *) ;
  320. typedef Boolean (*XmVisualChangeProc)( Widget, Widget, Widget) ;
  321. typedef void (*XmTraversalProc)( Widget, XtPointer, XtPointer, int) ;
  322. typedef void (*XmFocusMovedProc)( Widget, XtPointer, XtPointer) ;
  323. typedef void (*XmCacheCopyProc)( XtPointer, XtPointer, size_t) ;
  324. typedef void (*XmGadgetCacheProc)( XtPointer) ;
  325. typedef int (*XmCacheCompareProc)( XtPointer, XtPointer) ;
  326. typedef Boolean (*XmWidgetBaselineProc)(Widget, Dimension **, int *);
  327. typedef Boolean (*XmWidgetDisplayRectProc)(Widget, XRectangle *);
  328. typedef void (*XmWidgetMarginsProc)(Widget, XmBaselineMargins *);
  329. typedef XmNavigability (*XmWidgetNavigableProc)( Widget) ;
  330. typedef void (*XmFocusChangeProc)(Widget, XmFocusChange);
  331. #endif
  332.  
  333.  
  334. /****************
  335.  *
  336.  * Data structure for building a real translation table out of a 
  337.  * virtual string.
  338.  *
  339.  ****************/
  340.  typedef struct {
  341.      Modifiers mod;
  342.      char      *key;
  343.      char      *action;
  344.   } _XmBuildVirtualKeyStruct;
  345.               
  346. /***********************************************************************
  347.  *
  348.  * Types shared by Text and TextField widgets
  349.  *
  350.  ***********************************************************************/
  351.  
  352. /*
  353.  * This struct is for support of Insert Selection targets.
  354.  */
  355. typedef struct {
  356.     Atom selection;
  357.     Atom target;
  358. } _XmTextInsertPair;
  359.  
  360. typedef struct {
  361.     XmTextPosition position;    /* Starting position. */
  362.     XmHighlightMode mode;       /* Highlighting mode for this position. */
  363. } _XmHighlightRec;
  364.  
  365. typedef struct {
  366.     Cardinal number;            /* Number of different highlight areas. */
  367.     Cardinal maximum;           /* Number we've allocated space for. */
  368.     _XmHighlightRec *list;      /* Pointer to array of highlight data. */
  369. } _XmHighlightData;
  370.  
  371. typedef enum { XmDEST_SELECT, XmPRIM_SELECT } XmSelectType;
  372.  
  373. typedef struct {
  374.     Boolean done_status;    /* completion status of insert selection */
  375.     Boolean success_status;    /* success status of insert selection */
  376.     XmSelectType select_type;    /* insert selection type */
  377.     XSelectionRequestEvent *event; /* event that initiated the
  378.                       insert selection */
  379. } _XmInsertSelect;
  380.  
  381. typedef struct {
  382.     XEvent *event;
  383.     String *params;
  384.     Cardinal *num_params;
  385. } _XmTextActionRec;
  386.  
  387. typedef struct {
  388.     Widget widget;
  389.     XmTextPosition insert_pos;
  390.     int num_chars;
  391.     Time timestamp;
  392.     Boolean move;
  393. } _XmTextDropTransferRec;
  394.  
  395. typedef struct {
  396.     XmTextPosition position;
  397.     Atom target;
  398.     Time time;
  399.     int num_chars;
  400.     int ref_count;
  401. } _XmTextPrimSelect;
  402.  
  403. typedef struct {
  404.     Screen *screen;
  405.     XContext context;
  406.     unsigned char type;
  407. } XmTextContextDataRec, *XmTextContextData;
  408.  
  409. enum {_XM_IS_DEST_CTX, _XM_IS_GC_DATA_CTX, _XM_IS_PIXMAP_CTX};
  410.  
  411. #define XmTEXT_DRAG_ICON_WIDTH 64
  412. #define XmTEXT_DRAG_ICON_HEIGHT 64
  413. #define XmTEXT_DRAG_ICON_X_HOT 10
  414. #define XmTEXT_DRAG_ICON_Y_HOT 4
  415.  
  416.  
  417. /***********************************************************************
  418.  *
  419.  * Types and functions for Geometry Utilities
  420.  *
  421.  ***********************************************************************/
  422.  
  423. /* Defines used by geometry manager utilities */
  424.  
  425. enum{    XmGET_ACTUAL_SIZE = 1,        XmGET_PREFERRED_SIZE,
  426.     XmGEO_PRE_SET,            XmGEO_POST_SET
  427.     } ;
  428.  
  429. /* Defaults for Geometry Utility defines are always 0.
  430. */
  431. /* Fill Mode - How to fit into existing larger space than needed */
  432. enum{    XmGEO_EXPAND,            XmGEO_CENTER,
  433.     XmGEO_PACK
  434.     } ;
  435. /* Fit Mode - How to fit into existing too small a space */
  436. enum{    XmGEO_PROPORTIONAL,        XmGEO_AVERAGING,
  437.     XmGEO_WRAP
  438.     } ;
  439. enum{    XmGEO_ROW_MAJOR,        XmGEO_COLUMN_MAJOR
  440.     } ;
  441. /* XmGEO_COLUMN_MAJOR is not yet supported. */
  442.  
  443. #ifdef WINTIF
  444. #define BTN_ROW     0x80    /* Fit mode flag -> to handle row specially */
  445. #endif  /* WINTIF */
  446.  
  447. typedef struct _XmGeoMatrixRec *XmGeoMatrix ;
  448. typedef union _XmGeoMajorLayoutRec *XmGeoMajorLayout ;
  449. typedef struct _XmKidGeometryRec
  450. {
  451.     Widget   kid;                /* ptr to kid */
  452.     XtWidgetGeometry    box;            /* kid geo box */
  453. } XmKidGeometryRec, *XmKidGeometry;
  454.  
  455. #ifdef _NO_PROTO
  456. typedef void (*XmGeoArrangeProc)() ;
  457. typedef Boolean (*XmGeoExceptProc)() ;
  458. typedef void (*XmGeoExtDestructorProc)() ;
  459. typedef void (*XmGeoSegmentFixUpProc)() ;
  460. #else
  461. typedef void (*XmGeoArrangeProc)( XmGeoMatrix,
  462. #if NeedWidePrototypes
  463.                  int, int,
  464. #else
  465.                  Position, Position,
  466. #endif /* NeedWidePrototypes */
  467.                  Dimension *, Dimension *) ;
  468. typedef Boolean (*XmGeoExceptProc)( XmGeoMatrix ) ;
  469. typedef void (*XmGeoExtDestructorProc)( XtPointer ) ;
  470. typedef void (*XmGeoSegmentFixUpProc)( XmGeoMatrix, int, XmGeoMajorLayout,
  471.                                                                XmKidGeometry) ;
  472. #endif
  473.  
  474. typedef struct
  475. {   Boolean         end ;        /* Flag to mark end of rows.                */
  476.     XmGeoSegmentFixUpProc fix_up ;/* Used for non-ordinary layouts.          */
  477.     Dimension       even_width ; /* If non-zero, set all boxes to same width.*/
  478.     Dimension       even_height ;/* If non-zero, set all boxes to same height*/
  479.     Dimension       min_height ; /* Minimum height, if stretch_height TRUE.  */
  480.     Boolean         stretch_height ;/* Stretch height to fill vertically.    */
  481.     Boolean         uniform_border ;/* Enforce on all kids this row, dflt F. */
  482.     Dimension       border ;        /* Value to use if uniform_border set.   */
  483.     unsigned char   fill_mode ; /* Possible values: XmGEO_PACK, XmGEO_CENTER,*/
  484.                 /*   or XmGEO_EXPAND (default).              */
  485.     unsigned char   fit_mode ;  /* Method for fitting boxes into space,      */
  486.                 /* XmGEO_PROPORTIONAL (dflt), XmGEO_AVERAGING, or XmGEO_WRAP.*/
  487.     Boolean         sticky_end ;  /* Last box in row sticks to edge, dflt F. */
  488.     Dimension       space_above ; /* Between-line spacing, default 0.        */
  489.     Dimension       space_end ;   /* End spacing (XmGEO_CENTER), default 0.  */
  490.     Dimension       space_between ; /* Internal spacing, default 0.          */
  491.     Dimension       max_box_height ;/* Set during arrange routine.           */
  492.     Dimension       boxes_width ;   /* Set during arrange routine.           */
  493.     Dimension       fill_width ;    /* Set during arrange routine.           */
  494.     Dimension       box_count ;     /* Set during arrange routine.           */
  495.     } XmGeoRowLayoutRec, *XmGeoRowLayout ;
  496.  
  497. typedef struct
  498. {   Boolean         end ;        /* Flag to mark end of columns.             */
  499.     XmGeoSegmentFixUpProc fix_up ;/* Used for non-ordinary layouts.          */
  500.     Dimension       even_height ;/* If non-zero, set all boxes to same height*/
  501.     Dimension       even_width ; /* If non-zero, set all boxes to same width.*/
  502.     Dimension       min_width ;  /* Minimum width, if stretch_width TRUE.  */
  503.     Boolean         stretch_width ;/* Stretch width to fill horizontally.    */
  504.     Boolean         uniform_border ;/* Enforce on all kids this row, dflt F. */
  505.     Dimension       border ;        /* Value to use if uniform_border set.   */
  506.     unsigned char   fill_mode ; /* Possible values: XmGEO_PACK, XmGEO_CENTER,*/
  507.                 /*   or XmGEO_EXPAND (default).              */
  508.     unsigned char   fit_mode ;  /* Method for fitting boxes into space,      */
  509.                 /* XmGEO_PROPORTIONAL (dflt), XmGEO_AVERAGING, or XmGEO_WRAP.*/
  510.     Boolean         sticky_end ;  /* Last box in row sticks to edge, dflt F. */
  511.     Dimension       space_left ;  /* Between-column spacing, default 0.      */
  512.     Dimension       space_end ;   /* End spacing (XmGEO_CENTER), default 0.  */
  513.     Dimension       space_between ; /* Internal spacing, default 0.          */
  514.     Dimension       max_box_width ; /* Set during arrange routine.           */
  515.     Dimension       boxes_height ;  /* Set during arrange routine.           */
  516.     Dimension       fill_height ;   /* Set during arrange routine.           */
  517.     Dimension       box_count ;     /* Set during arrange routine.           */
  518.     } XmGeoColumnLayoutRec, *XmGeoColumnLayout ;
  519.  
  520. typedef union _XmGeoMajorLayoutRec
  521. {
  522.   XmGeoRowLayoutRec row ;
  523.   XmGeoColumnLayoutRec col ;
  524. } XmGeoMajorLayoutRec ;
  525.  
  526. typedef struct _XmGeoMatrixRec
  527. {   Widget          composite ;     /* Widget managing layout.               */
  528.     Widget          instigator ;    /* Widget initiating re-layout.          */
  529.     XtWidgetGeometry instig_request ;/* Geometry layout request of instigatr.*/
  530.     XtWidgetGeometry parent_request ;/* Subsequent layout request to parent. */
  531.     XtWidgetGeometry *in_layout ;   /* Geo. of instig. in layout (after Get).*/
  532.     XmKidGeometry   boxes ;/* Array of boxes, lines separated by NULL record.*/
  533.     XmGeoMajorLayout layouts ;      /* Array of major_order format info.     */
  534.     Dimension       margin_w ;/*Sum of margin, highlight, & shadow thickness.*/
  535.     Dimension       margin_h ;/*Sum of margin, highlight, & shadow thickness.*/
  536.     Boolean         stretch_boxes ; /* Set during arrange routine.           */
  537.     Boolean         uniform_border ;/* Enforce on all kids, default FALSE.   */
  538.     Dimension       border ;        /* Value to use if uniform_border TRUE.  */
  539.     Dimension       max_major ;     /* Set during arrange routine.           */
  540.     Dimension       boxes_minor ;   /* Set during arrange routine.           */
  541.     Dimension       fill_minor ;    /* Set during arrange routine.           */
  542.     Dimension       width ;         /* Set during arrange routine.           */
  543.     Dimension       height ;        /* Set during arrange routine.           */
  544.     XmGeoExceptProc set_except ;
  545.     XmGeoExceptProc almost_except ;
  546.     XmGeoExceptProc no_geo_request ;
  547.     XtPointer       extension ;
  548.     XmGeoExtDestructorProc ext_destructor ;
  549.     XmGeoArrangeProc arrange_boxes ;/* For user-defined arrangement routine. */
  550.     unsigned char   major_order ;
  551.     } XmGeoMatrixRec;
  552.  
  553. #ifdef _NO_PROTO
  554. typedef XmGeoMatrix (*XmGeoCreateProc)() ;
  555. #else
  556. typedef XmGeoMatrix (*XmGeoCreateProc)( Widget, Widget, XtWidgetGeometry *) ;
  557. #endif
  558.  
  559.  
  560. #define XmInheritCallbackProc ((XtCallbackProc) _XtInherit)
  561. #define XmInheritTraversalProc ((XmTraversalProc) _XtInherit)
  562. #define XmInheritParentProcess ((XmParentProcessProc) _XtInherit)
  563. #define XmInheritWidgetProc ((XtWidgetProc) _XtInherit)
  564. #define XmInheritMenuProc ((XmMenuProc) _XtInherit)
  565. #define XmInheritTranslations XtInheritTranslations
  566. #define XmInheritCachePart    ((XmCacheClassPartPtr) _XtInherit)
  567. #define XmInheritBaselineProc ((XmWidgetBaselineProc) _XtInherit)
  568. #define XmInheritDisplayRectProc ((XmWidgetDisplayRectProc) _XtInherit)
  569. #define XmInheritMarginsProc ((XmWidgetMarginsProc) _XtInherit)
  570. #define XmInheritGeoMatrixCreate ((XmGeoCreateProc) _XtInherit)
  571. #define XmInheritFocusMovedProc ((XmFocusMovedProc) _XtInherit)
  572. #define XmInheritClass           ((WidgetClass) &_XmInheritClass)
  573. #define XmInheritInitializePrehook ((XtInitProc) _XtInherit)
  574. #define XmInheritSetValuesPrehook  ((XtSetValuesFunc) _XtInherit)
  575. #define XmInheritGetValuesPrehook  ((XtArgsProc) _XtInherit)
  576. #define XmInheritInitializePosthook ((XtInitProc) _XtInherit)
  577. #define XmInheritSetValuesPosthook  ((XtSetValuesFunc) _XtInherit)
  578. #define XmInheritGetValuesPosthook  ((XtArgsProc) _XtInherit)
  579. #define XmInheritSecObjectCreate   ((XtInitProc) _XtInherit)
  580. #define XmInheritGetSecResData       ((XmGetSecResDataFunc) _XtInherit)
  581. #define XmInheritInputDispatch       ((XmWidgetDispatchProc) _XtInherit)
  582. #define XmInheritVisualChange       ((XmVisualChangeProc) _XtInherit)
  583. #define XmInheritArmAndActivate       ((XtActionProc) _XtInherit)
  584. #define XmInheritActionProc       ((XtActionProc) _XtInherit)
  585. #define XmInheritFocusChange       ((XmFocusChangeProc) _XtInherit)
  586. #define XmInheritWidgetNavigable   ((XmWidgetNavigableProc) _XtInherit)
  587. #define XmInheritClassPartInitPrehook ((XtWidgetClassProc) _XtInherit)
  588. #define XmInheritClassPartInitPosthook ((XtWidgetClassProc) _XtInherit)
  589. #define XmInheritBorderHighlight   ((XtWidgetProc) _XtInherit)
  590. #define XmInheritBorderUnhighlight   ((XtWidgetProc) _XtInherit)
  591.  
  592. /*  XtInheritFocusMovedProc is provided for backwards compatibility.
  593.  *  Its use is deprecated.
  594.  */
  595. #define XtInheritFocusMovedProc XmInheritFocusMovedProc
  596.  
  597. /************************************************************************
  598.  *
  599.  *  Fast subclassing macros and definitions
  600.  *
  601.  ************************************************************************/
  602. /* WARNING:  Application subclasses which choose to use fast
  603.  *           subclassing must use only those bits between
  604.  *           192 (XmFIRST_APPLICATION_SUBCLASS_BIT) and 255.
  605.  *           All other fast subclass bits are reserved for
  606.  *           future use.  Use of reserved fast subclass bits
  607.  *           will cause binary compatibility breaks with
  608.  *           future Motif versions.
  609.  */
  610. #define XmFIRST_APPLICATION_SUBCLASS_BIT    192
  611.  
  612. enum{    XmCASCADE_BUTTON_BIT = 1,    XmCASCADE_BUTTON_GADGET_BIT,
  613.     XmCOMMAND_BOX_BIT,        XmDIALOG_SHELL_BIT,
  614.     XmLIST_BIT,            XmFORM_BIT,
  615.     XmTEXT_FIELD_BIT,        XmGADGET_BIT,
  616.     XmLABEL_BIT,            XmLABEL_GADGET_BIT,
  617.     XmMAIN_WINDOW_BIT,        XmMANAGER_BIT,
  618.     XmMENU_SHELL_BIT,        XmDRAWN_BUTTON_BIT,
  619.     XmPRIMITIVE_BIT,        XmPUSH_BUTTON_BIT,
  620.     XmPUSH_BUTTON_GADGET_BIT,    XmROW_COLUMN_BIT,
  621.     XmSCROLL_BAR_BIT,        XmSCROLLED_WINDOW_BIT,
  622.     XmSELECTION_BOX_BIT,        XmSEPARATOR_BIT,
  623.     XmSEPARATOR_GADGET_BIT,        XmTEXT_BIT,
  624.     XmTOGGLE_BUTTON_BIT,        XmTOGGLE_BUTTON_GADGET_BIT,
  625.     XmDROP_TRANSFER_BIT,
  626.     /* 28 is available */
  627.     XmDROP_SITE_MANAGER_BIT,  /* This is 29. */
  628.     XmDISPLAY_BIT, XmSCREEN_BIT,
  629.     XmARROW_BUTTON_BIT = 32,
  630.     XmARROW_BUTTON_GADGET_BIT,    XmBULLETIN_BOARD_BIT,
  631.     XmDRAWING_AREA_BIT,        XmFILE_SELECTION_BOX_BIT,
  632.     XmFRAME_BIT,            XmMESSAGE_BOX_BIT,
  633.     XmSASH_BIT,            XmSCALE_BIT,
  634.     XmPANED_WINDOW_BIT,        XmVENDOR_SHELL_BIT,
  635.     XmCLIP_WINDOW_BIT,              XmDRAG_ICON_BIT,
  636.         XmTEAROFF_BUTTON_BIT,           XmDRAG_OVER_SHELL_BIT,
  637.         XmDRAG_CONTEXT_BIT,
  638.  
  639.     XmFAST_SUBCLASS_TAIL_BIT /* New entries precede this. */
  640.     } ;
  641.  
  642. #define XmLAST_FAST_SUBCLASS_BIT (XmFAST_SUBCLASS_TAIL_BIT - 1) 
  643.  
  644.  
  645. #undef XmIsCascadeButton
  646. #define XmIsCascadeButton(w)  \
  647.   (_XmIsFastSubclass(XtClass(w), XmCASCADE_BUTTON_BIT))
  648.  
  649. #undef XmIsCascadeButtonGadget
  650. #define XmIsCascadeButtonGadget(w)  \
  651.   (_XmIsFastSubclass(XtClass(w), XmCASCADE_BUTTON_GADGET_BIT))
  652.  
  653. #undef XmIsCommandBox
  654. #define XmIsCommandBox(w)  \
  655.   (_XmIsFastSubclass(XtClass(w), XmCOMMAND_BOX_BIT))
  656.  
  657. #undef XmIsDialogShell
  658. #define XmIsDialogShell(w)  \
  659.   (_XmIsFastSubclass(XtClass(w), XmDIALOG_SHELL_BIT))
  660.  
  661. #undef XmIsDisplay
  662. #define XmIsDisplay(w)  \
  663.   (_XmIsFastSubclass(XtClass(w), XmDISPLAY_BIT))
  664.  
  665. #undef XmIsList
  666. #define XmIsList(w)  \
  667.   (_XmIsFastSubclass(XtClass(w), XmLIST_BIT))
  668.  
  669. #undef XmIsForm
  670. #define XmIsForm(w)  \
  671.   (_XmIsFastSubclass(XtClass(w), XmFORM_BIT))
  672.  
  673. #undef XmIsTextField
  674. #define XmIsTextField(w)  \
  675.   (_XmIsFastSubclass(XtClass(w), XmTEXT_FIELD_BIT))
  676.  
  677. #undef XmIsGadget
  678. #define XmIsGadget(w)  \
  679.   (_XmIsFastSubclass(XtClass(w), XmGADGET_BIT))
  680.  
  681. #undef XmIsLabel
  682. #define XmIsLabel(w)  \
  683.   (_XmIsFastSubclass(XtClass(w), XmLABEL_BIT))
  684.  
  685. #undef XmIsLabelGadget
  686. #define XmIsLabelGadget(w)  \
  687.   (_XmIsFastSubclass(XtClass(w), XmLABEL_GADGET_BIT))
  688.  
  689. #undef XmIsMainWindow
  690. #define XmIsMainWindow(w)  \
  691.   (_XmIsFastSubclass(XtClass(w), XmMAIN_WINDOW_BIT))
  692.  
  693. #undef XmIsManager
  694. #define XmIsManager(w)  \
  695.   (_XmIsFastSubclass(XtClass(w), XmMANAGER_BIT))
  696.  
  697. #undef XmIsMenuShell
  698. #define XmIsMenuShell(w)  \
  699.   (_XmIsFastSubclass(XtClass(w), XmMENU_SHELL_BIT))
  700.  
  701. #undef XmIsDragIcon
  702. #define XmIsDragIcon(w)  \
  703.   (_XmIsFastSubclass(XtClass(w), XmDRAG_ICON_BIT))
  704.  
  705. #undef XmIsDropSiteManager
  706. #define XmIsDropSiteManager(w)  \
  707.   (_XmIsFastSubclass(XtClass(w), XmDROP_SITE_MANAGER_BIT))
  708.  
  709. #undef XmIsDropTransfer
  710. #define XmIsDropTransfer(w)  \
  711.   (_XmIsFastSubclass(XtClass(w), XmDROP_TRANSFER_BIT))
  712.  
  713. #undef XmIsDragOverShell
  714. #define XmIsDragOverShell(w)  \
  715.   (_XmIsFastSubclass(XtClass(w), XmDRAG_OVER_SHELL_BIT))
  716.  
  717. #undef XmIsDragContext
  718. #define XmIsDragContext(w)  \
  719.   (_XmIsFastSubclass(XtClass(w), XmDRAG_CONTEXT_BIT))
  720.  
  721. #undef XmIsDrawnButton
  722. #define XmIsDrawnButton(w)  \
  723.   (_XmIsFastSubclass(XtClass(w), XmDRAWN_BUTTON_BIT))
  724.  
  725. #undef XmIsPrimitive
  726. #define XmIsPrimitive(w)  \
  727.   (_XmIsFastSubclass(XtClass(w), XmPRIMITIVE_BIT))
  728.  
  729. #undef XmIsPushButton
  730. #define XmIsPushButton(w)  \
  731.   (_XmIsFastSubclass(XtClass(w), XmPUSH_BUTTON_BIT))
  732.  
  733. #undef XmIsPushButtonGadget
  734. #define XmIsPushButtonGadget(w)  \
  735.   (_XmIsFastSubclass(XtClass(w), XmPUSH_BUTTON_GADGET_BIT))
  736.  
  737. #undef XmIsRowColumn
  738. #define XmIsRowColumn(w)  \
  739.   (_XmIsFastSubclass(XtClass(w), XmROW_COLUMN_BIT))
  740.  
  741. #undef XmIsScreen
  742. #define XmIsScreen(w)  \
  743.   (_XmIsFastSubclass(XtClass(w), XmSCREEN_BIT))
  744.  
  745. #undef XmIsScrollBar
  746. #define XmIsScrollBar(w)  \
  747.   (_XmIsFastSubclass(XtClass(w), XmSCROLL_BAR_BIT))
  748.  
  749. #undef XmIsScrolledWindow
  750. #define XmIsScrolledWindow(w)  \
  751.   (_XmIsFastSubclass(XtClass(w), XmSCROLLED_WINDOW_BIT))
  752.  
  753. #undef XmIsSelectionBox
  754. #define XmIsSelectionBox(w)  \
  755.   (_XmIsFastSubclass(XtClass(w), XmSELECTION_BOX_BIT))
  756.  
  757. #undef XmIsSeparator
  758. #define XmIsSeparator(w)  \
  759.   (_XmIsFastSubclass(XtClass(w), XmSEPARATOR_BIT))
  760.  
  761. #undef XmIsSeparatorGadget
  762. #define XmIsSeparatorGadget(w)  \
  763.   (_XmIsFastSubclass(XtClass(w), XmSEPARATOR_GADGET_BIT))
  764.  
  765. #undef XmIsText
  766. #define XmIsText(w)  \
  767.   (_XmIsFastSubclass(XtClass(w), XmTEXT_BIT))
  768.  
  769. #undef XmIsTearOffButton
  770. #define XmIsTearOffButton(w)  \
  771.   (_XmIsFastSubclass(XtClass(w), XmTEAROFF_BUTTON_BIT))
  772.  
  773. #undef XmIsToggleButton
  774. #define XmIsToggleButton(w)  \
  775.   (_XmIsFastSubclass(XtClass(w), XmTOGGLE_BUTTON_BIT))
  776.  
  777. #undef XmIsToggleButtonGadget
  778. #define XmIsToggleButtonGadget(w)  \
  779.   (_XmIsFastSubclass(XtClass(w), XmTOGGLE_BUTTON_GADGET_BIT))
  780.  
  781. #undef XmIsArrowButton
  782. #define XmIsArrowButton(w)  \
  783.   (_XmIsFastSubclass(XtClass(w), XmARROW_BUTTON_BIT))
  784.  
  785. #undef XmIsArrowButtonGadget
  786. #define XmIsArrowButtonGadget(w)  \
  787.   (_XmIsFastSubclass(XtClass(w), XmARROW_BUTTON_GADGET_BIT))
  788.  
  789. #undef XmIsBulletinBoard
  790. #define XmIsBulletinBoard(w)  \
  791.   (_XmIsFastSubclass(XtClass(w), XmBULLETIN_BOARD_BIT))
  792.  
  793. #undef XmIsDrawingArea
  794. #define XmIsDrawingArea(w)  \
  795.   (_XmIsFastSubclass(XtClass(w), XmDRAWING_AREA_BIT))
  796.  
  797. #undef XmIsFileSelectionBox
  798. #define XmIsFileSelectionBox(w)  \
  799.   (_XmIsFastSubclass(XtClass(w), XmFILE_SELECTION_BOX_BIT))
  800.  
  801. #undef XmIsFrame
  802. #define XmIsFrame(w)  \
  803.   (_XmIsFastSubclass(XtClass(w), XmFRAME_BIT))
  804.  
  805. #undef XmIsMessageBox
  806. #define XmIsMessageBox(w)  \
  807.   (_XmIsFastSubclass(XtClass(w), XmMESSAGE_BOX_BIT))
  808.  
  809. #undef XmIsSash
  810. #define XmIsSash(w)  \
  811.   (_XmIsFastSubclass(XtClass(w), XmSASH_BIT))
  812.  
  813. #undef XmIsScale
  814. #define XmIsScale(w)  \
  815.   (_XmIsFastSubclass(XtClass(w), XmSCALE_BIT))
  816.  
  817. #undef XmIsPanedWindow
  818. #define XmIsPanedWindow(w)  \
  819.   (_XmIsFastSubclass(XtClass(w), XmPANED_WINDOW_BIT))
  820.  
  821.  
  822. /************************************************************************
  823.  *
  824.  *  Defines and macros for the XmResolvePart function
  825.  *
  826.  ************************************************************************/
  827.  
  828. /*  Widget class indices used with XmPartOffset and XmField macros  */
  829.  
  830. #define XmObjectIndex         0
  831. #define ObjectIndex         XmObjectIndex
  832. #define XmRectObjIndex        (XmObjectIndex + 1)
  833. #define RectObjIndex        XmRectObjIndex
  834. #define XmWindowObjIndex    (XmRectObjIndex + 1)
  835. #define WindowObjIndex        XmWindowObjIndex
  836. #define XmCoreIndex         0
  837. #define CoreIndex         XmCoreIndex
  838. #define XmCompositeIndex     (XmWindowObjIndex + 2)
  839. #define CompositeIndex         XmCompositeIndex
  840. #define XmConstraintIndex     (XmCompositeIndex + 1)
  841. #define ConstraintIndex     XmConstraintIndex
  842. #define XmGadgetIndex         (XmRectObjIndex + 1)
  843. #define XmPrimitiveIndex     (XmWindowObjIndex + 2)
  844. #define XmManagerIndex         (XmConstraintIndex + 1)
  845.  
  846. #define XmArrowBIndex        (XmPrimitiveIndex + 1)
  847. #define XmArrowButtonIndex    XmArrowBIndex
  848. #define XmLabelIndex        (XmPrimitiveIndex + 1)
  849. #define XmListIndex        (XmPrimitiveIndex + 1)
  850. #define XmScrollBarIndex    (XmPrimitiveIndex + 1)
  851. #define XmSeparatorIndex    (XmPrimitiveIndex + 1)
  852. #define XmTextIndex        (XmPrimitiveIndex + 1)
  853.  
  854. #define XmCascadeBIndex        (XmLabelIndex + 1)
  855. #define XmCascadeButtonIndex    XmCascadeBIndex
  856. #define XmDrawnBIndex        (XmLabelIndex + 1)
  857. #define XmDrawnButtonIndex    XmDrawnBIndex
  858. #define XmPushBIndex        (XmLabelIndex + 1)
  859. #define XmPushButtonIndex    XmPushBIndex
  860. #define XmToggleBIndex        (XmLabelIndex + 1)
  861. #define XmToggleButtonIndex    XmToggleBIndex
  862. #define XmTearOffButtonIndex    (XmPushBIndex + 1)
  863.  
  864. #define XmArrowBGIndex        (XmGadgetIndex + 1)
  865. #define XmArrowButtonGadgetIndex XmArrowBGIndex
  866. #define XmLabelGIndex        (XmGadgetIndex + 1)
  867. #define XmLabelGadgetIndex    XmLabelGIndex
  868. #define XmSeparatoGIndex    (XmGadgetIndex + 1)
  869. #define XmSeparatorGadgetIndex    XmSeparatoGIndex
  870.  
  871. #define XmCascadeBGIndex    (XmLabelGIndex + 1)
  872. #define XmCascadeButtonGadgetIndex XmCascadeBGIndex
  873. #define XmPushBGIndex        (XmLabelGIndex + 1)
  874. #define XmPushButtonGadgetIndex    XmPushBGIndex
  875. #define XmToggleBGIndex        (XmLabelGIndex + 1)
  876. #define XmToggleButtonGadgetIndex XmToggleBGIndex
  877.  
  878. #define XmBulletinBIndex    (XmManagerIndex + 1)
  879. #define XmBulletinBoardIndex    XmBulletinBIndex
  880. #define XmDrawingAIndex        (XmManagerIndex + 1)
  881. #define XmDrawingAreaIndex    XmDrawingAIndex
  882. #define XmFrameIndex        (XmManagerIndex + 1)
  883. #define XmPanedWIndex        (XmManagerIndex + 1)
  884. #define XmPanedWindowIndex    XmPanedWIndex
  885. #define XmSashIndex        (XmPrimitiveIndex + 1)
  886. #define XmRowColumnIndex    (XmManagerIndex + 1)
  887. #define XmScaleIndex        (XmManagerIndex + 1)
  888. #define XmScrolledWIndex    (XmManagerIndex + 1)
  889. #define XmScrolledWindowIndex    XmScrolledWIndex
  890.  
  891. #define XmFormIndex        (XmBulletinBIndex + 1)
  892. #define XmMessageBIndex        (XmBulletinBIndex + 1)
  893. #define XmMessageBoxIndex    XmMessageBIndex
  894. #define XmSelectioBIndex    (XmBulletinBIndex + 1)
  895. #define XmSelectionBoxIndex    XmSelectioBIndex
  896.  
  897. #define XmMainWIndex        (XmScrolledWIndex + 1)
  898. #define XmMainWindowIndex    XmMainWIndex
  899.  
  900. #define XmCommandIndex        (XmSelectioBIndex + 1)
  901. #define XmFileSBIndex        (XmSelectioBIndex + 1)
  902. #define XmFileSelectionBoxIndex    XmFileSBIndex
  903.  
  904. #define XmShellIndex         (XmCompositeIndex + 1)
  905. #define ShellIndex         XmShellIndex
  906. #define XmOverrideShellIndex     (XmShellIndex + 1)
  907. #define OverrideShellIndex     XmOverrideShellIndex
  908. #define XmWMShellIndex         (XmShellIndex + 1)
  909. #define WMShellIndex         XmWMShellIndex
  910. #define XmVendorShellIndex     (XmWMShellIndex + 1)
  911. #define VendorShellIndex     XmVendorShellIndex
  912. #define XmTransientShellIndex    (XmVendorShellIndex + 1)
  913. #define TransientShellIndex    XmTransientShellIndex
  914. #define XmTopLevelShellIndex     (XmVendorShellIndex + 1)
  915. #define TopLevelShellIndex     XmTopLevelShellIndex
  916. #define XmApplicationShellIndex (XmTopLevelShellIndex + 1)
  917. #define ApplicationShellIndex     XmApplicationShellIndex
  918. #define XmDisplayIndex        (XmApplicationShellIndex + 1)
  919.  
  920. #define XmDialogSIndex        (XmTransientShellIndex + 1)
  921. #define XmDialogShellIndex    XmDialogSIndex
  922. #define XmMenuShellIndex    (XmOverrideShellIndex + 1)
  923.  
  924. #define XmDragIconIndex        (XmRectObjIndex + 1)
  925. #define XmDropSiteManagerIndex  (XmObjectIndex + 1)
  926. #define XmDropTransferIndex    (XmObjectIndex + 1)
  927. #define XmDragOverShellIndex    (XmVendorShellIndex + 1)
  928. #define XmDragContextIndex    (XmCoreIndex + 1)
  929.  
  930. #define XmLONGBITS (sizeof(long) * 8)
  931. #define XmHALFLONGBITS (XmLONGBITS/2)
  932.  
  933. typedef struct _XmPartResource {
  934.     String     resource_name;    /* Resource name                */
  935.     String     resource_class;    /* Resource class                */
  936.     String     resource_type;    /* Representation type desired            */
  937.     Cardinal   resource_size;    /* Size in bytes of representation        */
  938.     Cardinal   resource_offset;    /* Index within & offset within part         */
  939.     String     default_type;    /* representation type of specified default */
  940.     XtPointer  default_addr;       /* Address of default resource            */
  941. } XmPartResource;
  942.  
  943. #if defined(__STDC__) && __STDC__ && !defined(UNIXCPP)
  944. # define XmPartOffset(part, variable) \
  945.         ((part##Index) << XmHALFLONGBITS) + XtOffsetOf( part##Part, variable)
  946.  
  947. # define XmConstraintPartOffset(part, variable) \
  948.         ((part##Index) << XmHALFLONGBITS) + \
  949.     XtOffsetOf( part##ConstraintPart, variable)
  950.  
  951. # define XmGetPartOffset(r, offset) \
  952.        ((r)->resource_offset & 0xffff) + \
  953.     (*(offset))[(r)->resource_offset >> XmHALFLONGBITS];
  954.  
  955. # define XmField(widget, offsetrecord, part, variable, type) \
  956.     (*(type *)(((char *) (widget)) + offsetrecord[part##Index] + \
  957.         XtOffsetOf( part##Part, variable)))
  958.  
  959. # define XmConstraintField(widget, offsetrecord, part, variable, type) \
  960.     (*(type *)(((char *) (widget)->core.constraints) + \
  961.     offsetrecord[part##Index] + \
  962.     XtOffsetOf( part##ConstraintPart, variable)))
  963. #else
  964. # define XmPartOffset(part, variable) \
  965.         ((part/**/Index) << XmHALFLONGBITS) + XtOffsetOf( part/**/Part, variable)
  966.  
  967. # define XmConstraintPartOffset(part, variable) \
  968.         ((part/**/Index) << XmHALFLONGBITS) + \
  969.     XtOffsetOf( part/**/ConstraintPart, variable)
  970.  
  971. # define XmGetPartOffset(r, offset) \
  972.        ((r)->resource_offset & 0xffff) + \
  973.     (*(offset))[(r)->resource_offset >> XmHALFLONGBITS];
  974.  
  975. # define XmField(widget, offsetrecord, part, variable, type) \
  976.     (*(type *)(((char *) (widget)) + offsetrecord[part/**/Index] + \
  977.     XtOffsetOf( part/**/Part, variable)))
  978.  
  979. # define XmConstraintField(widget, offsetrecord, part, variable, type) \
  980.     (*(type *)(((char *) (widget)->core.constraints) + \
  981.     offsetrecord[part/**/Index] + \
  982.     XtOffsetOf( part/**/ConstraintPart, variable)))
  983. #endif
  984.  
  985. /***********************************************************************
  986.  *
  987.  * XmRegion structure
  988.  *
  989.  *  This structure must match the opaque libX Region structure.
  990.  ***********************************************************************/
  991.  
  992. typedef struct {
  993.     short x1, x2, y1, y2;
  994. } XmRegionBox;
  995.  
  996. typedef struct _XmRegion {
  997.     long    size;
  998.     long    numRects;
  999.     XmRegionBox    *rects;
  1000.     XmRegionBox    extents;
  1001. } XmRegionRec, *XmRegion;
  1002.  
  1003.  
  1004. /********    Private Function Declarations for GadgetUtil.c    ********/
  1005. #ifdef _NO_PROTO
  1006.  
  1007. extern XmGadget _XmInputInGadget() ;
  1008. extern XmGadget _XmInputForGadget() ;
  1009. extern void _XmConfigureObject() ;
  1010. extern void _XmResizeObject() ;
  1011. extern void _XmMoveObject() ;
  1012. extern void _XmRedisplayGadgets() ;
  1013. extern void _XmDispatchGadgetInput() ;
  1014. extern Time __XmGetDefaultTime() ;
  1015.  
  1016. #else
  1017.  
  1018. extern XmGadget _XmInputInGadget( 
  1019.                         Widget cw,
  1020.                         register int x,
  1021.                         register int y) ;
  1022. extern XmGadget _XmInputForGadget( 
  1023.                         Widget cw,
  1024.                         int x,
  1025.                         int y) ;
  1026. extern void _XmConfigureObject( 
  1027.                         Widget g,
  1028. #if NeedWidePrototypes
  1029.                         int x,
  1030.                         int y,
  1031.                         int width,
  1032.                         int height,
  1033.                         int border_width) ;
  1034. #else
  1035.                         Position x,
  1036.                         Position y,
  1037.                         Dimension width,
  1038.                         Dimension height,
  1039.                         Dimension border_width) ;
  1040. #endif /* NeedWidePrototypes */
  1041. extern void _XmResizeObject( 
  1042.                         Widget g,
  1043. #if NeedWidePrototypes
  1044.                         int width,
  1045.                         int height,
  1046.                         int border_width) ;
  1047. #else
  1048.                         Dimension width,
  1049.                         Dimension height,
  1050.                         Dimension border_width) ;
  1051. #endif /* NeedWidePrototypes */
  1052. extern void _XmMoveObject( 
  1053.                         Widget g,
  1054. #if NeedWidePrototypes
  1055.                         int x,
  1056.                         int y) ;
  1057. #else
  1058.                         Position x,
  1059.                         Position y) ;
  1060. #endif /* NeedWidePrototypes */
  1061. extern void _XmRedisplayGadgets( 
  1062.                         Widget w,
  1063.                         register XEvent *event,
  1064.                         Region region) ;
  1065. extern void _XmDispatchGadgetInput( 
  1066.                         Widget g,
  1067.                         XEvent *event,
  1068.                         Mask mask) ;
  1069. extern Time __XmGetDefaultTime(Widget, XEvent*) ;
  1070.  
  1071. #endif /* _NO_PROTO */
  1072. /********    End Private Function Declarations    ********/
  1073.  
  1074. /******** _XmCreateImage ********/
  1075.  
  1076. /* The _XmCreateImage macro is used to create XImage with client
  1077.    specific data for the bit and byte order.
  1078.    We still have to do the following because XCreateImage
  1079.    will stuff here display specific data and we want 
  1080.    client specific values (i.e the bit orders we used for 
  1081.    creating the bitmap data in Motif) -- BUG 4262 */
  1082. /* Used in Motif 1.2 in DragIcon.c, MessageB.c, ReadImage.c and
  1083.    ImageCache.c */
  1084.  
  1085. #define _XmCreateImage(IMAGE, DISPLAY, DATA, WIDTH, HEIGHT, BYTE_ORDER) {\
  1086.     IMAGE = XCreateImage(DISPLAY,\
  1087.              DefaultVisual(DISPLAY, DefaultScreen(DISPLAY)),\
  1088.              1,\
  1089.              XYBitmap,\
  1090.              0,\
  1091.              DATA,\
  1092.              WIDTH, HEIGHT,\
  1093.              8,\
  1094.              (WIDTH+7) >> 3);\
  1095.     IMAGE->byte_order = BYTE_ORDER;\
  1096.     IMAGE->bitmap_unit = 8;\
  1097.     IMAGE->bitmap_bit_order = LSBFirst;\
  1098. }
  1099.  
  1100. /********    Private Function Declarations for ImageCache.c    ********/
  1101. #ifdef _NO_PROTO
  1102.  
  1103. extern Boolean _XmInstallImage() ;
  1104. extern Boolean _XmInstallImageWithScreen() ;
  1105. extern Boolean _XmGetImage() ;
  1106. extern Boolean _XmGetPixmapData() ;
  1107. extern Pixmap _XmGetPixmap() ;
  1108. extern Boolean _XmInstallPixmap() ;
  1109.  
  1110. #else
  1111.  
  1112. extern Boolean _XmInstallImage( 
  1113.                         XImage *image,
  1114.                         char *image_name,
  1115.                         int hot_x,
  1116.                         int hot_y) ;
  1117. extern Boolean _XmInstallImageWithScreen( 
  1118.                         XImage *image,
  1119.                         Screen * screen,
  1120.                         char *image_name,
  1121.                         int hot_x,
  1122.                         int hot_y) ;
  1123. extern Boolean _XmGetImage( 
  1124.                         Screen *screen,
  1125.                         char *image_name,
  1126.                         XImage **image) ;
  1127. extern Boolean _XmGetPixmapData( 
  1128.                         Screen *screen,
  1129.                         Pixmap pixmap,
  1130.                         char **image_name,
  1131.                         int *depth,
  1132.                         Pixel *foreground,
  1133.                         Pixel *background,
  1134.                         int *hot_x,
  1135.                         int *hot_y,
  1136.                         unsigned int *width,
  1137.                         unsigned int *height) ;
  1138. extern Pixmap _XmGetPixmap( 
  1139.                         Screen *screen,
  1140.                         char *image_name,
  1141.                         int depth,
  1142.                         Pixel foreground,
  1143.                         Pixel background) ;
  1144. extern Boolean _XmInstallPixmap( 
  1145.                         Pixmap pixmap,
  1146.                         Screen *screen,
  1147.                         char *image_name,
  1148.                         Pixel foreground,
  1149.                         Pixel background) ;
  1150.  
  1151. #endif /* _NO_PROTO */
  1152. /********    End Private Function Declarations    ********/
  1153.  
  1154. /********    Private Function Declarations for MapEvents.c    ********/
  1155. #ifdef _NO_PROTO
  1156.  
  1157. extern Boolean _XmMapBtnEvent() ;
  1158. extern Boolean _XmMapKeyEvent() ;
  1159. extern Boolean _XmMatchBtnEvent() ;
  1160. extern Boolean _XmMatchKeyEvent() ;
  1161.  
  1162. #else
  1163.  
  1164. extern Boolean _XmMapBtnEvent( 
  1165.                         register String str,
  1166.                         int *eventType,
  1167.                         unsigned int *button,
  1168.                         unsigned int *modifiers) ;
  1169. extern Boolean _XmMapKeyEvent( 
  1170.                         register String str,
  1171.                         int *eventType,
  1172.                         unsigned *keysym,
  1173.                         unsigned int *modifiers) ;
  1174. extern Boolean _XmMatchBtnEvent( 
  1175.                         XEvent *event,
  1176.                         int eventType,
  1177.                         unsigned int button,
  1178.                         unsigned int modifiers) ;
  1179. extern Boolean _XmMatchKeyEvent( 
  1180.                         XEvent *event,
  1181.                         int eventType,
  1182.                         unsigned int key,
  1183.                         unsigned int modifiers) ;
  1184.  
  1185. #endif /* _NO_PROTO */
  1186. /********    End Private Function Declarations    ********/
  1187.  
  1188. /********    Private Function Declarations for ReadImage.c    ********/
  1189. #ifdef _NO_PROTO
  1190.  
  1191. extern XImage * _XmGetImageFromFile() ;
  1192. extern XImage * _XmGetImageAndHotSpotFromFile() ;
  1193. extern void _XmGetImageAndHotSpotAndMaskFromFile() ;
  1194.  
  1195. #else
  1196.  
  1197. extern XImage * _XmGetImageFromFile( 
  1198.                         char *filename) ;
  1199. extern XImage * _XmGetImageAndHotSpotFromFile( 
  1200.                         char *filename,
  1201.                         int *hot_x,
  1202.                         int *hot_y,
  1203.                         Screen *screen,
  1204.                         int    depth) ;
  1205. extern void _XmGetImageAndHotSpotAndMaskFromFile( 
  1206.                         char *filename,
  1207.                         int *hot_x,
  1208.                         int *hot_y,
  1209.                         XImage ** image,
  1210.                         XImage ** mask,
  1211.                         Screen *screen,
  1212.                         int    depth) ;
  1213.  
  1214. #endif /* _NO_PROTO */
  1215. /********    End Private Function Declarations    ********/
  1216.  
  1217. #ifndef NO_IXI_XPM3_ADD
  1218. /********    Private Function Declarations for xpm.c    ********/
  1219. #ifdef _NO_PROTO
  1220.  
  1221. extern int  _XmReadPixmapDataFromFile() ;
  1222. extern int  _XmGetPixmapImageFromData() ;
  1223.  
  1224. #else
  1225.  
  1226. extern int  _XmReadPixmapDataFromFile(
  1227.               Screen * screen,
  1228.               char * filename,
  1229.               int depth,
  1230.               XImage ** image_return,
  1231.               XImage ** shapeimage_return,
  1232.               int * hot_x,
  1233.               int * hot_y ) ;
  1234.  
  1235. int _XmGetPixmapImageFromData(
  1236.         Screen  *screen,
  1237.         char    **data,
  1238.         int     depth,
  1239.         XImage  **pImage,
  1240.         XImage  **pMask,
  1241.         int     * pHot_x,
  1242.         int     * pHot_y );
  1243. #endif /* _NO_PROTO */
  1244. /********    End Private Function Declarations    ********/
  1245. #endif /* NO_IXI_XPM3_ADD */
  1246.  
  1247. /********    ResConvert.c    ********/
  1248.  
  1249. enum{    XmLABEL_FONTLIST = 1,        XmBUTTON_FONTLIST,
  1250.     XmTEXT_FONTLIST
  1251.     } ;
  1252.  
  1253. /********    Private Function Declarations for ResConvert.c    ********/
  1254. #ifdef _NO_PROTO
  1255.  
  1256. extern void _XmRegisterConverters() ;
  1257. extern void _XmWarning() ;
  1258. extern Boolean _XmStringsAreEqual() ;
  1259. extern XmFontList _XmGetDefaultFontList() ;
  1260. extern char * _XmConvertCSToString() ;
  1261. extern Boolean _XmCvtXmStringToCT() ;
  1262.  
  1263. #else
  1264.  
  1265. extern void _XmRegisterConverters( void ) ;
  1266. extern void _XmWarning( 
  1267.                         Widget w,
  1268.                         char *message) ;
  1269. extern Boolean _XmStringsAreEqual( 
  1270.                         register char *in_str,
  1271.                         register char *test_str) ;
  1272. extern XmFontList _XmGetDefaultFontList( 
  1273.                         Widget w,
  1274. #if NeedWidePrototypes
  1275.                         unsigned int fontListType) ;
  1276. #else
  1277.                         unsigned char fontListType) ;
  1278. #endif /* NeedWidePrototypes */
  1279. extern char * _XmConvertCSToString( 
  1280.                         XmString cs) ;
  1281. extern Boolean _XmCvtXmStringToCT( 
  1282.                         XrmValue *from,
  1283.                         XrmValue *to) ;
  1284.  
  1285. #endif /* _NO_PROTO */
  1286. /********    End Private Function Declarations    ********/
  1287.  
  1288. /********    Private Function Declarations for ResInd.c    ********/
  1289. #ifdef _NO_PROTO
  1290.  
  1291. extern void _XmBuildResources() ;
  1292. extern void _XmInitializeSyntheticResources() ;
  1293. extern void _XmPrimitiveGetValuesHook() ;
  1294. extern void _XmGadgetGetValuesHook() ;
  1295. extern void _XmManagerGetValuesHook() ;
  1296. extern void _XmExtGetValuesHook() ;
  1297. extern void _XmExtImportArgs() ;
  1298. extern void _XmPrimitiveImportArgs() ;
  1299. extern void _XmGadgetImportArgs() ;
  1300. extern void _XmGadgetImportSecondaryArgs() ;
  1301. extern void _XmManagerImportArgs() ;
  1302.  
  1303. extern int _XmConvertUnits() ;
  1304. extern XmImportOperator _XmToHorizontalPixels() ;
  1305. extern XmImportOperator _XmToVerticalPixels() ;
  1306. extern void _XmFromHorizontalPixels() ;
  1307. extern void _XmFromVerticalPixels() ;
  1308. extern void _XmSortResourceList() ;
  1309. extern void _XmUnitTypeDefault() ;
  1310. extern unsigned char _XmGetUnitType() ;
  1311.  
  1312. #else
  1313.  
  1314. extern void _XmBuildResources( 
  1315.                         XmSyntheticResource **wc_resources_ptr,
  1316.                         int *wc_num_resources_ptr,
  1317.                         XmSyntheticResource *sc_resources,
  1318.                         int sc_num_resources) ;
  1319. extern void _XmInitializeSyntheticResources( 
  1320.                         XmSyntheticResource *resources,
  1321.                         int num_resources) ;
  1322. extern void _XmPrimitiveGetValuesHook( 
  1323.                         Widget w,
  1324.                         ArgList args,
  1325.                         Cardinal *num_args) ;
  1326. extern void _XmGadgetGetValuesHook( 
  1327.                         Widget w,
  1328.                         ArgList args,
  1329.                         Cardinal *num_args) ;
  1330. extern void _XmManagerGetValuesHook( 
  1331.                         Widget w,
  1332.                         ArgList args,
  1333.                         Cardinal *num_args) ;
  1334. extern void _XmExtGetValuesHook( 
  1335.                         Widget w,
  1336.                         ArgList args,
  1337.                         Cardinal *num_args) ;
  1338. extern void _XmExtImportArgs( 
  1339.                         Widget w,
  1340.                         ArgList args,
  1341.                         Cardinal *num_args) ;
  1342. extern void _XmPrimitiveImportArgs( 
  1343.                         Widget w,
  1344.                         ArgList args,
  1345.                         Cardinal *num_args) ;
  1346. extern void _XmGadgetImportArgs( 
  1347.                         Widget w,
  1348.                         ArgList args,
  1349.                         Cardinal *num_args) ;
  1350. extern void _XmGadgetImportSecondaryArgs( 
  1351.                         Widget w,
  1352.                         ArgList args,
  1353.                         Cardinal *num_args) ;
  1354. extern void _XmManagerImportArgs( 
  1355.                         Widget w,
  1356.                         ArgList args,
  1357.                         Cardinal *num_args) ;
  1358. extern int _XmConvertUnits( 
  1359.                         Screen *screen,
  1360.                         int dimension,
  1361.                         register int from_type,
  1362.                         register int from_val,
  1363.                         register int to_type) ;
  1364. extern XmImportOperator _XmToHorizontalPixels( 
  1365.                         Widget widget,
  1366.                         int offset,
  1367.                         XtArgVal *value) ;
  1368. extern XmImportOperator _XmToVerticalPixels( 
  1369.                         Widget widget,
  1370.                         int offset,
  1371.                         XtArgVal *value) ;
  1372. extern void _XmFromHorizontalPixels( 
  1373.                         Widget widget,
  1374.                         int offset,
  1375.                         XtArgVal *value) ;
  1376. extern void _XmFromVerticalPixels( 
  1377.                         Widget widget,
  1378.                         int offset,
  1379.                         XtArgVal *value) ;
  1380. extern void _XmSortResourceList( 
  1381.                         XrmResource *list[],
  1382.                         Cardinal len) ;
  1383. extern void _XmUnitTypeDefault( 
  1384.                         Widget widget,
  1385.                         int offset,
  1386.                         XrmValue *value) ;
  1387. extern unsigned char _XmGetUnitType( 
  1388.                         Widget widget) ;
  1389.  
  1390. #endif /* _NO_PROTO */
  1391. /********    End Private Function Declarations    ********/
  1392.  
  1393. /********    Private Function Declarations for UniqueEvnt.c    ********/
  1394. #ifdef _NO_PROTO
  1395.  
  1396. extern Boolean _XmIsEventUnique() ;
  1397. extern void _XmRecordEvent() ;
  1398.  
  1399. #else
  1400.  
  1401. extern Boolean _XmIsEventUnique( 
  1402.                         XEvent *event) ;
  1403. extern void _XmRecordEvent( 
  1404.                         XEvent *event) ;
  1405.  
  1406. #endif /* _NO_PROTO */
  1407. /********    End Private Function Declarations    ********/
  1408.  
  1409. /********    Visual.c    ********/
  1410. /* For the default color calculation and caching */
  1411.  
  1412. #define XmLOOK_AT_SCREEN          (1<<0)
  1413. #define XmLOOK_AT_CMAP            (1<<1)
  1414. #define XmLOOK_AT_BACKGROUND      (1<<2)
  1415. #define XmLOOK_AT_FOREGROUND      (1<<3)
  1416. #define XmLOOK_AT_TOP_SHADOW      (1<<4)
  1417. #define XmLOOK_AT_BOTTOM_SHADOW   (1<<5)
  1418. #define XmLOOK_AT_SELECT          (1<<6)
  1419.  
  1420. #define XmBACKGROUND     ((unsigned char) (1<<0))
  1421. #define XmFOREGROUND     ((unsigned char) (1<<1))
  1422. #define XmTOP_SHADOW     ((unsigned char) (1<<2))
  1423. #define XmBOTTOM_SHADOW  ((unsigned char) (1<<3))
  1424. #define XmSELECT         ((unsigned char) (1<<4))
  1425.  
  1426. /*  Structure used to hold color schemes  */
  1427. typedef struct _XmColorData
  1428. {  Screen * screen;
  1429.    Colormap color_map;
  1430.    unsigned char allocated;
  1431.    XColor background;
  1432.    XColor foreground;
  1433.    XColor top_shadow;
  1434.    XColor bottom_shadow;
  1435.    XColor select;
  1436. } XmColorData;
  1437.  
  1438. typedef unsigned long XmColorDataIndex;
  1439.  
  1440. /********    Private Function Declarations for Visual.c    ********/
  1441. #ifdef _NO_PROTO
  1442.  
  1443. extern void _XmRegisterPixmapConverters() ;
  1444. extern char * _XmGetBGPixmapName() ;
  1445. extern void _XmClearBGPixmapName() ;
  1446. extern void _XmForegroundColorDefault() ;
  1447. extern void _XmHighlightColorDefault() ;
  1448. extern void _XmBackgroundColorDefault() ;
  1449. extern void _XmTopShadowColorDefault() ;
  1450. extern void _XmBottomShadowColorDefault() ;
  1451. extern void _XmSelectColorDefault() ;
  1452. extern void _XmPrimitiveTopShadowPixmapDefault() ;
  1453. extern void _XmManagerTopShadowPixmapDefault() ;
  1454. extern void _XmPrimitiveHighlightPixmapDefault() ;
  1455. extern void _XmManagerHighlightPixmapDefault() ;
  1456. extern void _XmGetDefaultThresholdsForScreen() ;
  1457. extern String _XmGetDefaultBackgroundColorSpec() ;
  1458. extern void _XmSetDefaultBackgroundColorSpec() ;
  1459. extern XmColorDataIndex _XmGetDefaultColorsIndex() ;
  1460. extern XmColorData * _XmGetDefaultColors() ;
  1461. extern Boolean _XmSearchColorCache() ;
  1462. extern Boolean _XmSearchColorCacheIndex() ;
  1463. extern XmColorDataIndex _XmAddToColorCacheIndex() ;
  1464. extern XmColorData * _XmAddToColorCache() ;
  1465. extern Pixel _XmBlackPixel() ;
  1466. extern Pixel _XmWhitePixel() ;
  1467. extern Pixel _XmAccessColorDataIndex() ;
  1468. extern Pixel _XmAccessColorData() ;
  1469. extern XmColorData * _XmGetColors() ;
  1470. extern XmColorDataIndex _XmGetColorsIndex() ;
  1471. extern XmColorData * _XmGetColorDataFromIndex();
  1472.  
  1473. #else
  1474.  
  1475. extern void _XmRegisterPixmapConverters( void ) ;
  1476. extern char * _XmGetBGPixmapName( void ) ;
  1477. extern void _XmClearBGPixmapName( void ) ;
  1478. extern void _XmForegroundColorDefault( 
  1479.                         Widget widget,
  1480.                         int offset,
  1481.                         XrmValue *value) ;
  1482. extern void _XmHighlightColorDefault( 
  1483.                         Widget widget,
  1484.                         int offset,
  1485.                         XrmValue *value) ;
  1486. extern void _XmBackgroundColorDefault( 
  1487.                         Widget widget,
  1488.                         int offset,
  1489.                         XrmValue *value) ;
  1490. extern void _XmTopShadowColorDefault( 
  1491.                         Widget widget,
  1492.                         int offset,
  1493.                         XrmValue *value) ;
  1494. extern void _XmBottomShadowColorDefault( 
  1495.                         Widget widget,
  1496.                         int offset,
  1497.                         XrmValue *value) ;
  1498. extern void _XmSelectColorDefault( 
  1499.                         Widget widget,
  1500.                         int offset,
  1501.                         XrmValue *value) ;
  1502. extern void _XmPrimitiveTopShadowPixmapDefault( 
  1503.                         Widget widget,
  1504.                         int offset,
  1505.                         XrmValue *value) ;
  1506. extern void _XmManagerTopShadowPixmapDefault( 
  1507.                         Widget widget,
  1508.                         int offset,
  1509.                         XrmValue *value) ;
  1510. extern void _XmPrimitiveHighlightPixmapDefault( 
  1511.                         Widget widget,
  1512.                         int offset,
  1513.                         XrmValue *value) ;
  1514. extern void _XmManagerHighlightPixmapDefault( 
  1515.                         Widget widget,
  1516.                         int offset,
  1517.                         XrmValue *value) ;
  1518. extern void _XmGetDefaultThresholdsForScreen( 
  1519.                         Screen *screen) ;
  1520. extern String _XmGetDefaultBackgroundColorSpec( 
  1521.                         Screen *screen) ;
  1522. extern void _XmSetDefaultBackgroundColorSpec( 
  1523.                         Screen *screen,
  1524.                         String new_color_spec) ;
  1525. extern XmColorData * _XmGetDefaultColors( 
  1526.                         Screen *screen,
  1527.                         Colormap color_map) ;
  1528. extern XmColorDataIndex _XmGetDefaultColorsIndex( 
  1529.                         Screen *screen,
  1530.                         Colormap color_map) ;
  1531. extern Boolean _XmSearchColorCache( 
  1532.                         unsigned int which,
  1533.                         XmColorData *values,
  1534.                         XmColorData **ret) ;
  1535. extern Boolean _XmSearchColorCacheIndex( 
  1536.                         unsigned int which,
  1537.                         XmColorData *values,
  1538.                         XmColorDataIndex *ret) ;
  1539. extern XmColorData * _XmAddToColorCache( 
  1540.                         XmColorData *new_rec) ;
  1541. extern XmColorDataIndex _XmAddToColorCacheIndex( 
  1542.                         XmColorData *new_rec) ;
  1543. extern Pixel _XmBlackPixel( 
  1544.                         Screen *screen,
  1545.                         Colormap colormap,
  1546.                         XColor blackcolor) ;
  1547. extern Pixel _XmWhitePixel( 
  1548.                         Screen *screen,
  1549.                         Colormap colormap,
  1550.                         XColor whitecolor) ;
  1551. extern Pixel _XmAccessColorData( 
  1552.                         XmColorData * cd,
  1553. #if NeedWidePrototypes
  1554.                         unsigned int which) ;
  1555. #else
  1556.                         unsigned char which) ;
  1557. #endif /* NeedWidePrototypes */
  1558. extern Pixel _XmAccessColorDataIndex( 
  1559.                         XmColorDataIndex cdi,
  1560. #if NeedWidePrototypes
  1561.                         unsigned int which) ;
  1562. #else
  1563.                         unsigned char which) ;
  1564. #endif /* NeedWidePrototypes */
  1565. extern XmColorData * _XmGetColors( 
  1566.                         Screen *screen,
  1567.                         Colormap color_map,
  1568.                         Pixel background) ;
  1569. extern XmColorDataIndex _XmGetColorsIndex( 
  1570.                         Screen *screen,
  1571.                         Colormap color_map,
  1572.                         Pixel background) ;
  1573. extern XmColorData * _XmGetColorDataFromIndex( XmColorDataIndex cdi ); 
  1574.  
  1575. #endif /* _NO_PROTO */
  1576. /********    End Private Function Declarations    ********/
  1577.  
  1578. /********    Private Function Declarations for XmString.c    ********/
  1579. #ifdef _NO_PROTO
  1580.  
  1581. extern XFontStruct * _XmGetFirstFont() ;
  1582. extern Boolean _XmFontListGetDefaultFont() ;
  1583. extern Boolean _XmFontListSearch() ;
  1584. extern Boolean _XmStringIsXmString() ;
  1585. extern Boolean _XmStringInitContext() ;
  1586. extern Boolean _XmStringGetNextSegment() ;
  1587. extern void _XmStringFreeContext() ;
  1588. extern Dimension _XmStringWidth() ;
  1589. extern Dimension _XmStringHeight() ;
  1590. extern void _XmStringExtent() ;
  1591. extern Boolean _XmStringEmpty() ;
  1592. extern void _XmStringDraw() ;
  1593. extern void _XmStringDrawImage() ;
  1594. extern void _XmStringDrawUnderline() ;
  1595. extern void _XmStringDrawMnemonic() ;
  1596. extern _XmString _XmStringCreate() ;
  1597. extern void _XmStringFree() ;
  1598. extern char * _XmStringGetCurrentCharset() ;
  1599. extern char * _XmCharsetCanonicalize() ;
  1600. extern void _XmStringUpdate() ;
  1601. extern _XmString _XmStringCopy() ;
  1602. extern Boolean _XmStringByteCompare() ;
  1603. extern Boolean _XmStringHasSubstring() ;
  1604. extern XmString _XmStringCreateExternal() ;
  1605. extern Dimension _XmStringBaseline() ;
  1606. extern int _XmStringLineCount() ;
  1607. extern char * _XmStringGetTextConcat() ;
  1608. extern Boolean _XmStringIsCurrentCharset() ;
  1609. extern Boolean _XmStringSingleSegment() ;
  1610. extern void _XmStringUpdateWMShellTitle() ;
  1611.  
  1612. #else
  1613.  
  1614. extern XFontStruct * _XmGetFirstFont( 
  1615.                         XmFontListEntry entry) ;
  1616. extern Boolean _XmFontListGetDefaultFont( 
  1617.                         XmFontList fontlist,
  1618.                         XFontStruct **font_struct) ;
  1619. extern Boolean _XmFontListSearch( 
  1620.                         XmFontList fontlist,
  1621.                         XmStringCharSet charset,
  1622.                         short *indx,
  1623.                         XFontStruct **font_struct) ;
  1624. extern Boolean _XmStringIsXmString( 
  1625.                         XmString string) ;
  1626. extern Boolean _XmStringInitContext( 
  1627.                         _XmStringContext *context,
  1628.                         _XmString string) ;
  1629. extern Boolean _XmStringGetNextSegment( 
  1630.                         _XmStringContext context,
  1631.                         XmStringCharSet *charset,
  1632.                         XmStringDirection *direction,
  1633.                         char **text,
  1634.                         short *char_count,
  1635.                         Boolean *separator) ;
  1636. extern void _XmStringFreeContext( 
  1637.                         _XmStringContext context) ;
  1638. extern Dimension _XmStringWidth( 
  1639.                         XmFontList fontlist,
  1640.                         _XmString string) ;
  1641. extern Dimension _XmStringHeight( 
  1642.                         XmFontList fontlist,
  1643.                         _XmString string) ;
  1644. extern void _XmStringExtent( 
  1645.                         XmFontList fontlist,
  1646.                         _XmString string,
  1647.                         Dimension *width,
  1648.                         Dimension *height) ;
  1649. extern Boolean _XmStringEmpty( 
  1650.                         _XmString string) ;
  1651. extern void _XmStringDraw( 
  1652.                         Display *d,
  1653.                         Window w,
  1654.                         XmFontList fontlist,
  1655.                         _XmString string,
  1656.                         GC gc,
  1657. #if NeedWidePrototypes
  1658.                         int x,
  1659.                         int y,
  1660.                         int width,
  1661.                         unsigned int align,
  1662.                         unsigned int lay_dir,
  1663. #else
  1664.                         Position x,
  1665.                         Position y,
  1666.                         Dimension width,
  1667.                         unsigned char align,
  1668.                         unsigned char lay_dir,
  1669. #endif /* NeedWidePrototypes */
  1670.                         XRectangle *clip) ;
  1671. extern void _XmStringDrawImage( 
  1672.                         Display *d,
  1673.                         Window w,
  1674.                         XmFontList fontlist,
  1675.                         _XmString string,
  1676.                         GC gc,
  1677. #if NeedWidePrototypes
  1678.                         int x,
  1679.                         int y,
  1680.                         int width,
  1681.                         unsigned int align,
  1682.                         unsigned int lay_dir,
  1683. #else
  1684.                         Position x,
  1685.                         Position y,
  1686.                         Dimension width,
  1687.                         unsigned char align,
  1688.                         unsigned char lay_dir,
  1689. #endif /* NeedWidePrototypes */
  1690.                         XRectangle *clip) ;
  1691. extern void _XmStringDrawUnderline( 
  1692.                         Display *d,
  1693.                         Window w,
  1694.                         XmFontList f,
  1695.                         _XmString s,
  1696.                         GC gc,
  1697. #if NeedWidePrototypes
  1698.                         int x,
  1699.                         int y,
  1700.                         int width,
  1701.                         unsigned int align,
  1702.                         unsigned int lay_dir,
  1703. #else
  1704.                         Position x,
  1705.                         Position y,
  1706.                         Dimension width,
  1707.                         unsigned char align,
  1708.                         unsigned char lay_dir,
  1709. #endif /* NeedWidePrototypes */
  1710.                         XRectangle *clip,
  1711.                         _XmString u) ;
  1712. extern void _XmStringDrawMnemonic( 
  1713.                         Display *d,
  1714.                         Window w,
  1715.                         XmFontList fontlist,
  1716.                         _XmString string,
  1717.                         GC gc,
  1718. #if NeedWidePrototypes
  1719.                         int x,
  1720.                         int y,
  1721.                         int width,
  1722.                         unsigned int align,
  1723.                         unsigned int lay_dir,
  1724. #else
  1725.                         Position x,
  1726.                         Position y,
  1727.                         Dimension width,
  1728.                         unsigned char align,
  1729.                         unsigned char lay_dir,
  1730. #endif /* NeedWidePrototypes */
  1731.                         XRectangle *clip,
  1732.                         String mnemonic,
  1733.                         XmStringCharSet charset) ;
  1734. extern _XmString _XmStringCreate( 
  1735.                         XmString cs) ;
  1736. extern void _XmStringFree( 
  1737.                         _XmString string) ;
  1738. extern char * _XmStringGetCurrentCharset( void ) ;
  1739. extern char * _XmCharsetCanonicalize( 
  1740.                         String charset) ;
  1741. extern void _XmStringUpdate( 
  1742.                         XmFontList fontlist,
  1743.                         _XmString string) ;
  1744. extern _XmString _XmStringCopy( 
  1745.                         _XmString string) ;
  1746. extern Boolean _XmStringByteCompare( 
  1747.                         _XmString a,
  1748.                         _XmString b) ;
  1749. extern Boolean _XmStringHasSubstring( 
  1750.                         _XmString string,
  1751.                         _XmString substring) ;
  1752. extern XmString _XmStringCreateExternal( 
  1753.                         XmFontList fontlist,
  1754.                         _XmString cs) ;
  1755. extern Dimension _XmStringBaseline( 
  1756.                         XmFontList fontlist,
  1757.                         _XmString string) ;
  1758. extern int _XmStringLineCount( 
  1759.                         _XmString string) ;
  1760. extern char * _XmStringGetTextConcat( 
  1761.                         XmString string) ;
  1762. extern Boolean _XmStringIsCurrentCharset(
  1763.             XmStringCharSet c) ;
  1764. extern Boolean _XmStringSingleSegment(
  1765.             XmString str,
  1766.             char **pTextOut,
  1767.             XmStringCharSet *pCharsetOut ) ;
  1768. extern void _XmStringUpdateWMShellTitle(
  1769.             XmString xmstr,
  1770.             Widget shell) ;
  1771. #endif /* _NO_PROTO */
  1772. /********    End Private Function Declarations    ********/
  1773. #ifdef _XmDEBUG_XMSTRING
  1774. #ifdef _NO_PROTO
  1775. extern void _Xm_dump_fontlist() ;
  1776. extern void _Xm_dump_fontlist_cache() ;
  1777. extern void _Xm_dump_external() ;
  1778. extern void _Xm_dump_internal() ;
  1779. #else /* _NO_PROTO */
  1780. extern void _Xm_dump_fontlist( 
  1781.                         XmFontList f) ;
  1782. extern void _Xm_dump_fontlist_cache( void ) ;
  1783. extern void _Xm_dump_external( 
  1784.                         XmString cs) ;
  1785. extern void _Xm_dump_internal( 
  1786.                         _XmString string) ;
  1787. #endif /* _NO_PROTO */
  1788. #endif /* _XmDEBUG_XMSTRING */
  1789.  
  1790. /********    Traversal.c    ********/
  1791.  
  1792. #define XmTAB_ANY    ((XmNavigationType) 255)
  1793. #define XmNONE_OR_BC    ((XmNavigationType) 254)
  1794.  
  1795. typedef struct _XmFocusMovedCallbackStruct{
  1796.     int     reason;
  1797.     XEvent      *event;
  1798.     Boolean     cont;
  1799.     Widget    old_focus;
  1800.     Widget    new_focus;
  1801.     unsigned char focus_policy;
  1802. } XmFocusMovedCallbackStruct, *XmFocusMovedCallback;
  1803.  
  1804. typedef struct _XmFocusDataRec *XmFocusData;
  1805.  
  1806. /********    Private Function Declarations for Traversal.c    ********/
  1807. #ifdef _NO_PROTO
  1808.  
  1809. extern XmFocusData _XmCreateFocusData() ;
  1810. extern void _XmDestroyFocusData() ;
  1811. extern void _XmSetActiveTabGroup() ;
  1812. extern Widget _XmGetActiveItem() ;
  1813. extern void _XmNavigInitialize() ;
  1814. extern Boolean _XmNavigSetValues() ;
  1815. extern void _XmNavigChangeManaged() ;
  1816. extern void _XmNavigResize() ;
  1817. extern void _XmValidateFocus() ;
  1818. extern void _XmNavigDestroy() ;
  1819. extern Boolean _XmCallFocusMoved() ;
  1820. extern Boolean _XmMgrTraversal() ;
  1821. extern void _XmClearFocusPath() ;
  1822. extern Boolean _XmFocusIsHere() ;
  1823. extern void _XmProcessTraversal() ;
  1824. extern unsigned char _XmGetFocusPolicy() ;
  1825. extern Widget _XmFindTopMostShell() ;
  1826. extern void _XmFocusModelChanged() ;
  1827. extern Boolean _XmGrabTheFocus() ;
  1828. extern XmFocusData _XmGetFocusData() ;
  1829. extern Boolean _XmCreateVisibilityRect() ;
  1830. extern void _XmSetRect() ;
  1831. extern int _XmIntersectRect() ;
  1832. extern int _XmEmptyRect() ;
  1833. extern void _XmClearRect() ;
  1834. extern Boolean _XmIsNavigable() ;
  1835. extern void _XmWidgetFocusChange() ;
  1836. extern Widget _XmNavigate() ;
  1837. extern Widget _XmFindTabGroup ();
  1838. extern Widget _XmFindNextTabGroup() ;
  1839. extern Widget _XmFindPrevTabGroup() ;
  1840. extern void _XmSetInitialOfTabGroup() ;
  1841. extern void _XmResetTravGraph() ;
  1842. extern Boolean _XmFocusIsInShell() ;
  1843. extern Boolean _XmShellIsExclusive() ;
  1844. extern Widget _XmGetFirstFocus() ;
  1845.  
  1846. #else
  1847.  
  1848. extern XmFocusData _XmCreateFocusData( void ) ;
  1849. extern void _XmDestroyFocusData( 
  1850.                         XmFocusData focusData) ;
  1851. extern void _XmSetActiveTabGroup( 
  1852.                         XmFocusData focusData,
  1853.                         Widget tabGroup) ;
  1854. extern Widget _XmGetActiveItem( 
  1855.                         Widget w) ;
  1856. extern void _XmNavigInitialize( 
  1857.                         Widget request,
  1858.                         Widget new_wid,
  1859.                         ArgList args,
  1860.                         Cardinal *num_args) ;
  1861. extern Boolean _XmNavigSetValues( 
  1862.                         Widget current,
  1863.                         Widget request,
  1864.                         Widget new_wid,
  1865.                         ArgList args,
  1866.                         Cardinal *num_args) ;
  1867. extern void _XmNavigChangeManaged( 
  1868.                         Widget wid) ;
  1869. extern void _XmNavigResize( 
  1870.                         Widget wid) ;
  1871. extern void _XmValidateFocus( 
  1872.                         Widget wid) ;
  1873. extern void _XmNavigDestroy( 
  1874.                         Widget wid) ;
  1875. extern Boolean _XmCallFocusMoved( 
  1876.                         Widget old,
  1877.                         Widget new_wid,
  1878.                         XEvent *event) ;
  1879. extern Boolean _XmMgrTraversal( 
  1880.                         Widget wid,
  1881.                         XmTraversalDirection direction) ;
  1882. extern void _XmClearFocusPath( 
  1883.                         Widget wid) ;
  1884. extern Boolean _XmFocusIsHere( 
  1885.                         Widget w) ;
  1886. extern void _XmProcessTraversal( 
  1887.                         Widget w,
  1888.                         XmTraversalDirection dir,
  1889. #if NeedWidePrototypes
  1890.                         int check) ;
  1891. #else
  1892.                         Boolean check) ;
  1893. #endif /* NeedWidePrototypes */
  1894. extern unsigned char _XmGetFocusPolicy( 
  1895.                         Widget w) ;
  1896. extern Widget _XmFindTopMostShell( 
  1897.                         Widget w) ;
  1898. extern void _XmFocusModelChanged( 
  1899.                         Widget wid,
  1900.                         XtPointer client_data,
  1901.                         XtPointer call_data) ;
  1902. extern Boolean _XmGrabTheFocus( 
  1903.                         Widget w,
  1904.                         XEvent *event) ;
  1905. extern XmFocusData _XmGetFocusData( 
  1906.                         Widget wid) ;
  1907. extern Boolean _XmCreateVisibilityRect( 
  1908.                         Widget w,
  1909.                         XRectangle *rectPtr) ;
  1910. extern void _XmSetRect( 
  1911.                         register XRectangle *rect,
  1912.                         Widget w) ;
  1913. extern int _XmIntersectRect( 
  1914.                         register XRectangle *srcRectA,
  1915.                         register Widget widget,
  1916.                         register XRectangle *dstRect) ;
  1917. extern int _XmEmptyRect( 
  1918.                         register XRectangle *r) ;
  1919. extern void _XmClearRect( 
  1920.                         register XRectangle *r) ;
  1921. extern Boolean _XmIsNavigable( 
  1922.                         Widget wid) ;
  1923. extern void _XmWidgetFocusChange( 
  1924.                         Widget wid,
  1925.                         XmFocusChange change) ;
  1926. extern Widget _XmNavigate( 
  1927.                         Widget wid,
  1928.                         XmTraversalDirection direction) ;
  1929. extern Widget _XmFindTabGroup (Widget w);
  1930. extern Widget _XmFindNextTabGroup( 
  1931.                         Widget wid) ;
  1932. extern Widget _XmFindPrevTabGroup( 
  1933.                         Widget wid) ;
  1934. extern void _XmSetInitialOfTabGroup( 
  1935.                         Widget tab_group,
  1936.                         Widget init_focus) ;
  1937. extern void _XmResetTravGraph( 
  1938.                         Widget wid) ;
  1939. extern Boolean _XmFocusIsInShell( 
  1940.                         Widget wid) ;
  1941. extern Boolean _XmShellIsExclusive( 
  1942.                         Widget wid) ;
  1943. extern Widget _XmGetFirstFocus( 
  1944.                         Widget wid) ;
  1945.  
  1946. #endif /* _NO_PROTO */
  1947. /********    End Private Function Declarations    ********/
  1948.  
  1949. /********    Private Function Declarations for TravAct.c    ********/
  1950. #ifdef _NO_PROTO
  1951.  
  1952. extern void _XmTrackShellFocus() ;
  1953. extern void _XmPrimitiveEnter() ;
  1954. extern void _XmPrimitiveLeave() ;
  1955. extern void _XmPrimitiveUnmap() ;
  1956. extern void _XmPrimitiveFocusInInternal() ;
  1957. extern void _XmPrimitiveFocusOut() ;
  1958. extern void _XmPrimitiveFocusIn() ;
  1959. extern void _XmEnterGadget() ;
  1960. extern void _XmLeaveGadget() ;
  1961. extern void _XmFocusInGadget() ;
  1962. extern void _XmFocusOutGadget() ;
  1963. extern void _XmManagerEnter() ;
  1964. extern void _XmManagerLeave() ;
  1965. extern void _XmManagerFocusInInternal() ;
  1966. extern void _XmManagerFocusIn() ;
  1967. extern void _XmManagerFocusOut() ;
  1968. extern void _XmManagerUnmap() ;
  1969.  
  1970. #else
  1971.  
  1972. extern void _XmTrackShellFocus( 
  1973.                         Widget widget,
  1974.                         XtPointer client_data,
  1975.                         XEvent *event,
  1976.                         Boolean *dontSwallow) ;
  1977. extern void _XmPrimitiveEnter( 
  1978.                         Widget wid,
  1979.                         XEvent *event,
  1980.                         String *params,
  1981.                         Cardinal *num_params) ;
  1982. extern void _XmPrimitiveLeave( 
  1983.                         Widget wid,
  1984.                         XEvent *event,
  1985.                         String *params,
  1986.                         Cardinal *num_params) ;
  1987. extern void _XmPrimitiveUnmap( 
  1988.                         Widget pw,
  1989.                         XEvent *event,
  1990.                         String *params,
  1991.                         Cardinal *num_params) ;
  1992. extern void _XmPrimitiveFocusInInternal( 
  1993.                         Widget wid,
  1994.                         XEvent *event,
  1995.                         String *params,
  1996.                         Cardinal *num_params) ;
  1997. extern void _XmPrimitiveFocusOut( 
  1998.                         Widget wid,
  1999.                         XEvent *event,
  2000.                         String *params,
  2001.                         Cardinal *num_params) ;
  2002. extern void _XmPrimitiveFocusIn( 
  2003.                         Widget pw,
  2004.                         XEvent *event,
  2005.                         String *params,
  2006.                         Cardinal *num_params) ;
  2007. extern void _XmEnterGadget( 
  2008.                         Widget wid,
  2009.                         XEvent *event,
  2010.                         String *params,
  2011.                         Cardinal *num_params) ;
  2012. extern void _XmLeaveGadget( 
  2013.                         Widget wid,
  2014.                         XEvent *event,
  2015.                         String *params,
  2016.                         Cardinal *num_params) ;
  2017. extern void _XmFocusInGadget( 
  2018.                         Widget wid,
  2019.                         XEvent *event,
  2020.                         String *params,
  2021.                         Cardinal *num_params) ;
  2022. extern void _XmFocusOutGadget( 
  2023.                         Widget wid,
  2024.                         XEvent *event,
  2025.                         String *params,
  2026.                         Cardinal *num_params) ;
  2027. extern void _XmManagerEnter( 
  2028.                         Widget wid,
  2029.                         XEvent *event_in,
  2030.                         String *params,
  2031.                         Cardinal *num_params) ;
  2032. extern void _XmManagerLeave( 
  2033.                         Widget wid,
  2034.                         XEvent *event_in,
  2035.                         String *params,
  2036.                         Cardinal *num_params) ;
  2037. extern void _XmManagerFocusInInternal( 
  2038.                         Widget wid,
  2039.                         XEvent *event,
  2040.                         String *params,
  2041.                         Cardinal *num_params) ;
  2042. extern void _XmManagerFocusIn( 
  2043.                         Widget mw,
  2044.                         XEvent *event,
  2045.                         String *params,
  2046.                         Cardinal *num_params) ;
  2047. extern void _XmManagerFocusOut( 
  2048.                         Widget wid,
  2049.                         XEvent *event,
  2050.                         String *params,
  2051.                         Cardinal *num_params) ;
  2052. extern void _XmManagerUnmap( 
  2053.                         Widget mw,
  2054.                         XEvent *event,
  2055.                         String *params,
  2056.                         Cardinal *num_params) ;
  2057.  
  2058. #endif /* _NO_PROTO */
  2059. /********    End Private Function Declarations    ********/
  2060.  
  2061. /********    Private Function Declarations for GeoUtils.c    ********/
  2062. #ifdef _NO_PROTO
  2063.  
  2064. extern XtGeometryResult _XmHandleQueryGeometry() ;
  2065. extern XtGeometryResult _XmHandleGeometryManager() ;
  2066. extern void _XmHandleSizeUpdate() ;
  2067. extern XmGeoMatrix _XmGeoMatrixAlloc() ;
  2068. extern void _XmGeoMatrixFree() ;
  2069. extern Boolean _XmGeoSetupKid() ;
  2070. extern void _XmGeoMatrixGet() ;
  2071. extern void _XmGeoMatrixSet() ;
  2072. extern void _XmGeoAdjustBoxes() ;
  2073. extern void _XmGeoGetDimensions() ;
  2074. extern void _XmGeoArrangeBoxes() ;
  2075. extern Dimension _XmGeoBoxesSameWidth() ;
  2076. extern Dimension _XmGeoBoxesSameHeight() ;
  2077. extern void _XmSeparatorFix() ;
  2078. extern void _XmMenuBarFix() ;
  2079. extern void _XmGeoLoadValues() ;
  2080. extern int _XmGeoCount_kids() ;
  2081. extern XmKidGeometry _XmGetKidGeo() ;
  2082. extern void _XmGeoClearRectObjAreas() ;
  2083. extern void _XmSetKidGeo() ;
  2084. extern Boolean _XmGeometryEqual() ;
  2085. extern Boolean _XmGeoReplyYes() ;
  2086. extern XtGeometryResult _XmMakeGeometryRequest() ;
  2087.  
  2088. #else
  2089.  
  2090. extern XtGeometryResult _XmHandleQueryGeometry( 
  2091.                         Widget wid,
  2092.                         XtWidgetGeometry *intended,
  2093.                         XtWidgetGeometry *desired,
  2094. #if NeedWidePrototypes
  2095.                         unsigned int policy,
  2096. #else
  2097.                         unsigned char policy,
  2098. #endif /* NeedWidePrototypes */
  2099.                         XmGeoCreateProc createMatrix) ;
  2100. extern XtGeometryResult _XmHandleGeometryManager( 
  2101.                         Widget wid,
  2102.                         Widget instigator,
  2103.                         XtWidgetGeometry *desired,
  2104.                         XtWidgetGeometry *allowed,
  2105. #if NeedWidePrototypes
  2106.                         unsigned int policy,
  2107. #else
  2108.                         unsigned char policy,
  2109. #endif /* NeedWidePrototypes */
  2110.                         XmGeoMatrix *cachePtr,
  2111.                         XmGeoCreateProc createMatrix) ;
  2112. extern void _XmHandleSizeUpdate( 
  2113.                         Widget wid,
  2114. #if NeedWidePrototypes
  2115.                         unsigned int policy,
  2116. #else
  2117.                         unsigned char policy,
  2118. #endif /* NeedWidePrototypes */
  2119.                         XmGeoCreateProc createMatrix) ;
  2120. extern XmGeoMatrix _XmGeoMatrixAlloc( 
  2121.                         unsigned int numRows,
  2122.                         unsigned int numBoxes,
  2123.                         unsigned int extSize) ;
  2124. extern void _XmGeoMatrixFree( 
  2125.                         XmGeoMatrix geo_spec) ;
  2126. extern Boolean _XmGeoSetupKid( 
  2127.                         XmKidGeometry geo,
  2128.                         Widget kidWid) ;
  2129. extern void _XmGeoMatrixGet( 
  2130.                         XmGeoMatrix geoSpec,
  2131.                         int geoType) ;
  2132. extern void _XmGeoMatrixSet( 
  2133.                         XmGeoMatrix geoSpec) ;
  2134. extern void _XmGeoAdjustBoxes( 
  2135.                         XmGeoMatrix geoSpec) ;
  2136. extern void _XmGeoGetDimensions( 
  2137.                         XmGeoMatrix geoSpec) ;
  2138. extern void _XmGeoArrangeBoxes( 
  2139.                         XmGeoMatrix geoSpec,
  2140. #if NeedWidePrototypes
  2141.                         int x,
  2142.                         int y,
  2143. #else
  2144.                         Position x,
  2145.                         Position y,
  2146. #endif /* NeedWidePrototypes */
  2147.                         Dimension *pW,
  2148.                         Dimension *pH) ;
  2149. extern Dimension _XmGeoBoxesSameWidth( 
  2150.                         XmKidGeometry rowPtr,
  2151. #if NeedWidePrototypes
  2152.                         int width) ;
  2153. #else
  2154.                         Dimension width) ;
  2155. #endif /* NeedWidePrototypes */
  2156. extern Dimension _XmGeoBoxesSameHeight( 
  2157.                         XmKidGeometry rowPtr,
  2158. #if NeedWidePrototypes
  2159.                         int height) ;
  2160. #else
  2161.                         Dimension height) ;
  2162. #endif /* NeedWidePrototypes */
  2163. extern void _XmSeparatorFix( 
  2164.                         XmGeoMatrix geoSpec,
  2165.                         int action,
  2166.                         XmGeoMajorLayout layoutPtr,
  2167.                         XmKidGeometry rowPtr) ;
  2168. extern void _XmMenuBarFix( 
  2169.                         XmGeoMatrix geoSpec,
  2170.                         int action,
  2171.                         XmGeoMajorLayout layoutPtr,
  2172.                         XmKidGeometry rowPtr) ;
  2173. extern void _XmGeoLoadValues( 
  2174.                         Widget wid,
  2175.                         int geoType,
  2176.                         Widget instigator,
  2177.                         XtWidgetGeometry *request,
  2178.                         XtWidgetGeometry *geoResult) ;
  2179. extern int _XmGeoCount_kids( 
  2180.                         register CompositeWidget c) ;
  2181. extern XmKidGeometry _XmGetKidGeo( 
  2182.                         Widget wid,
  2183.                         Widget instigator,
  2184.                         XtWidgetGeometry *request,
  2185.                         int uniform_border,
  2186. #if NeedWidePrototypes
  2187.                         int border,
  2188. #else
  2189.                         Dimension border,
  2190. #endif /* NeedWidePrototypes */
  2191.                         int uniform_width_margins,
  2192.                         int uniform_height_margins,
  2193.                         Widget help,
  2194.                         int geo_type) ;
  2195. extern void _XmGeoClearRectObjAreas( 
  2196.                         RectObj r,
  2197.                         XWindowChanges *old) ;
  2198. extern void _XmSetKidGeo( 
  2199.                         XmKidGeometry kg,
  2200.                         Widget instigator) ;
  2201. extern Boolean _XmGeometryEqual( 
  2202.                         Widget wid,
  2203.                         XtWidgetGeometry *geoA,
  2204.                         XtWidgetGeometry *geoB) ;
  2205. extern Boolean _XmGeoReplyYes( 
  2206.                         Widget wid,
  2207.                         XtWidgetGeometry *desired,
  2208.                         XtWidgetGeometry *response) ;
  2209. extern XtGeometryResult _XmMakeGeometryRequest( 
  2210.                         Widget w,
  2211.                         XtWidgetGeometry *geom) ;
  2212.  
  2213. #endif /* _NO_PROTO */
  2214. /********    End Private Function Declarations    ********/
  2215.  
  2216. /********    Private Function Declarations for Dest.c    ********/
  2217. #ifdef _NO_PROTO
  2218.  
  2219. extern void _XmSetDestination() ;
  2220.  
  2221. #else
  2222.  
  2223. extern void _XmSetDestination( 
  2224.                         Display *dpy,
  2225.                         Widget w) ;
  2226.  
  2227. #endif /* _NO_PROTO */
  2228. /********    End Private Function Declarations    ********/
  2229.  
  2230. /********    Private Function Declarations for XmIm.c    ********/
  2231. #ifdef _NO_PROTO
  2232.  
  2233. extern void _XmImChangeManaged() ;
  2234. extern void _XmImRealize() ;
  2235. extern void _XmImResize() ;
  2236. extern void _XmImRedisplay() ;
  2237.  
  2238. #else
  2239.  
  2240. extern void _XmImChangeManaged( 
  2241.                         Widget vw) ;
  2242. extern void _XmImRealize( 
  2243.                         Widget vw) ;
  2244. extern void _XmImResize( 
  2245.                         Widget vw) ;
  2246. extern void _XmImRedisplay( 
  2247.                         Widget vw) ;
  2248.  
  2249. #endif /* _NO_PROTO */
  2250. /********    End Private Function Declarations    ********/
  2251.  
  2252. /********    Private Function Declarations for DragBS.c   ********/
  2253. #ifdef _NO_PROTO
  2254.  
  2255. extern void _XmInitAtomPairs() ;
  2256. extern void _XmInitTargetsTable() ;
  2257. extern Cardinal _XmIndexToTargets() ;
  2258. extern Cardinal _XmTargetsToIndex() ;
  2259. extern Atom _XmAllocMotifAtom() ;
  2260. extern void _XmFreeMotifAtom() ;
  2261. extern void _XmDestroyMotifWindow() ;
  2262. extern Window _XmGetDragProxyWindow() ;
  2263.  
  2264. #else
  2265.  
  2266. extern void _XmInitAtomPairs( 
  2267.                         Display *display) ;
  2268. extern void _XmInitTargetsTable( 
  2269.                         Display *display) ;
  2270. extern Cardinal _XmIndexToTargets( 
  2271.                         Widget shell,
  2272.                         Cardinal t_index,
  2273.                         Atom **targetsRtn) ;
  2274. extern Cardinal _XmTargetsToIndex( 
  2275.                         Widget shell,
  2276.                         Atom *targets,
  2277.                         Cardinal numTargets) ;
  2278. extern Atom _XmAllocMotifAtom( 
  2279.                         Widget shell,
  2280.                         Time time) ;
  2281. extern void _XmFreeMotifAtom( 
  2282.                         Widget shell,
  2283.                         Atom atom) ;
  2284. extern void _XmDestroyMotifWindow( 
  2285.                         Display *dpy) ;
  2286. extern Window _XmGetDragProxyWindow(
  2287.             Display *display) ;
  2288.  
  2289. #endif /* _NO_PROTO */
  2290. /********    End Private Function Declarations    ********/
  2291.  
  2292. /********    Private Function Declarations for DragOverS.c    ********/
  2293. #ifdef _NO_PROTO
  2294.  
  2295. extern void _XmDragOverHide() ;
  2296. extern void _XmDragOverShow() ;
  2297. extern void _XmDragOverMove() ;
  2298. extern void _XmDragOverChange() ;
  2299. extern void _XmDragOverFinish() ;
  2300. extern Cursor _XmDragOverGetActiveCursor() ;
  2301. extern void _XmDragOverSetInitialPosition() ;
  2302.  
  2303. #else
  2304.  
  2305. extern void _XmDragOverHide( 
  2306.                         Widget w,
  2307. #if NeedWidePrototypes
  2308.                         int clipOriginX,
  2309.                         int clipOriginY,
  2310. #else
  2311.                         Position clipOriginX,
  2312.                         Position clipOriginY,
  2313. #endif /* NeedWidePrototypes */
  2314.                         XmRegion clipRegion) ;
  2315. extern void _XmDragOverShow( 
  2316.                         Widget w,
  2317. #if NeedWidePrototypes
  2318.                         int clipOriginX,
  2319.                         int clipOriginY,
  2320. #else
  2321.                         Position clipOriginX,
  2322.                         Position clipOriginY,
  2323. #endif /* NeedWidePrototypes */
  2324.                         XmRegion clipRegion) ;
  2325. extern void _XmDragOverMove( 
  2326.                         Widget w,
  2327. #if NeedWidePrototypes
  2328.                         int x,
  2329.                         int y) ;
  2330. #else
  2331.                         Position x,
  2332.                         Position y) ;
  2333. #endif /* NeedWidePrototypes */
  2334. extern void _XmDragOverChange( 
  2335.                         Widget w,
  2336. #if NeedWidePrototypes
  2337.                         unsigned int dropSiteStatus) ;
  2338. #else
  2339.                         unsigned char dropSiteStatus) ;
  2340. #endif /* NeedWidePrototypes */
  2341. extern void _XmDragOverFinish( 
  2342.                         Widget w,
  2343. #if NeedWidePrototypes
  2344.                         unsigned int completionStatus) ;
  2345. #else
  2346.                         unsigned char completionStatus) ;
  2347. #endif /* NeedWidePrototypes */
  2348.  
  2349. extern Cursor _XmDragOverGetActiveCursor(
  2350.             Widget w) ;
  2351. extern void _XmDragOverSetInitialPosition(
  2352.             Widget w,
  2353. #if NeedWidePrototypes
  2354.             int initialX,
  2355.             int initialY) ;
  2356. #else
  2357.             Position initialX,
  2358.             Position initialY) ;
  2359. #endif /* NeedWidePrototypes */
  2360.  
  2361. #endif /* _NO_PROTO */
  2362. /********    End Private Function Declarations    ********/
  2363.  
  2364. /********    Private Function Declarations for Region.c    ********/
  2365. #ifdef _NO_PROTO
  2366.  
  2367. extern XmRegion _XmRegionCreate() ;
  2368. extern XmRegion _XmRegionCreateSize() ;
  2369. extern void _XmRegionComputeExtents() ;
  2370. extern void _XmRegionGetExtents() ;
  2371. extern void _XmRegionUnionRectWithRegion() ;
  2372. extern void _XmRegionIntersectRectWithRegion() ;
  2373. extern long _XmRegionGetNumRectangles() ;
  2374. extern void _XmRegionGetRectangles() ;
  2375. extern void _XmRegionSetGCRegion() ;
  2376. extern void _XmRegionDestroy() ;
  2377. extern void _XmRegionOffset() ;
  2378. extern void _XmRegionIntersect() ;
  2379. extern void _XmRegionUnion() ;
  2380. extern void _XmRegionSubtract() ;
  2381. extern Boolean _XmRegionIsEmpty() ;
  2382. extern Boolean _XmRegionEqual() ;
  2383. extern Boolean _XmRegionPointInRegion() ;
  2384. extern void _XmRegionClear() ;
  2385. extern void _XmRegionShrink() ;
  2386. extern void _XmRegionDrawShadow() ;
  2387.  
  2388. #else
  2389.  
  2390. extern XmRegion _XmRegionCreate( void ) ;
  2391. extern XmRegion _XmRegionCreateSize(
  2392.             long size) ;
  2393. extern void _XmRegionComputeExtents(
  2394.             XmRegion r) ;
  2395. extern void _XmRegionGetExtents( 
  2396.                         XmRegion r,
  2397.                         XRectangle *rect) ;
  2398. extern void _XmRegionUnionRectWithRegion( 
  2399.                         XRectangle *rect,
  2400.                         XmRegion source,
  2401.                         XmRegion dest) ;
  2402. extern void _XmRegionIntersectRectWithRegion( 
  2403.                         XRectangle *rect,
  2404.                         XmRegion source,
  2405.                         XmRegion dest) ;
  2406. extern long _XmRegionGetNumRectangles(
  2407.             XmRegion r) ;
  2408. extern void _XmRegionGetRectangles( 
  2409.                         XmRegion r,
  2410.                         XRectangle **rects,
  2411.                         long *nrects) ;
  2412. extern void _XmRegionSetGCRegion( 
  2413.                         Display *dpy,
  2414.                         GC gc,
  2415.             int x_origin,
  2416.             int y_origin,
  2417.                         XmRegion r) ;
  2418. extern void _XmRegionDestroy( 
  2419.                         XmRegion r) ;
  2420. extern void _XmRegionOffset( 
  2421.                         XmRegion pRegion,
  2422.                         int x,
  2423.                         int y) ;
  2424. extern void _XmRegionIntersect( 
  2425.                         XmRegion reg1,
  2426.                         XmRegion reg2,
  2427.                         XmRegion newReg) ;
  2428. extern void _XmRegionUnion( 
  2429.                         XmRegion reg1,
  2430.                         XmRegion reg2,
  2431.                         XmRegion newReg) ;
  2432. extern void _XmRegionSubtract( 
  2433.                         XmRegion regM,
  2434.                         XmRegion regS,
  2435.                         XmRegion regD) ;
  2436. extern Boolean _XmRegionIsEmpty( 
  2437.                         XmRegion r) ;
  2438. extern Boolean _XmRegionEqual( 
  2439.                         XmRegion r1,
  2440.                         XmRegion r2) ;
  2441. extern Boolean _XmRegionPointInRegion( 
  2442.                         XmRegion pRegion,
  2443.                         int x,
  2444.                         int y) ;
  2445. extern void _XmRegionClear(
  2446.             XmRegion r ) ;
  2447. extern void _XmRegionShrink(
  2448.             XmRegion r,
  2449.             int dx,
  2450.                         int dy) ;
  2451. extern void _XmRegionDrawShadow(
  2452.             Display    *display,
  2453.             Drawable d,
  2454.             GC top_gc,
  2455.             GC bottom_gc,
  2456.             XmRegion region,
  2457. #if NeedWidePrototypes
  2458.             int border_thick,
  2459.             int shadow_thick,
  2460. #else
  2461.             Dimension border_thick,
  2462.             Dimension shadow_thick,
  2463. #endif /* NeedWidePrototypes */
  2464.             unsigned int shadow_type ) ;
  2465.  
  2466. #endif /* _NO_PROTO */
  2467. /********    End Private Function Declarations    ********/
  2468.  
  2469. /********    Private Function Declarations for DragUnder.c    ********/
  2470. #ifdef _NO_PROTO
  2471.  
  2472. extern void _XmDragUnderAnimation() ;
  2473.  
  2474. #else
  2475.  
  2476. extern void _XmDragUnderAnimation( 
  2477.                         Widget w,
  2478.                         XtPointer clientData,
  2479.                         XtPointer callData) ;
  2480.  
  2481. #endif /* _NO_PROTO */
  2482. /********    End Private Function Declarations    ********/
  2483.  
  2484. /********        ********/
  2485.  
  2486. #ifdef __cplusplus
  2487. }  /* Close scope of 'extern "C"' declaration which encloses file. */
  2488. #endif
  2489.  
  2490. #ifdef XM_1_1_BC
  2491.  
  2492. /* The following symbols are OBSOLETE and SHOULD NOT be used.
  2493.  * They are provided here as a source compatibilibity convenience,
  2494.  * to support the transition to the Motif 1.2 source environment.
  2495.  */
  2496.  
  2497. #define XmVPANED_BIT            XmPANED_WINDOW_BIT
  2498.  
  2499. #define LOOK_AT_SCREEN          (1<<0)
  2500. #define LOOK_AT_CMAP            (1<<1)
  2501. #define LOOK_AT_BACKGROUND      (1<<2)
  2502. #define LOOK_AT_FOREGROUND      (1<<3)
  2503. #define LOOK_AT_TOP_SHADOW      (1<<4)
  2504. #define LOOK_AT_BOTTOM_SHADOW   (1<<5)
  2505. #define LOOK_AT_SELECT          (1<<6)
  2506.  
  2507. #define XmStrlen(s)      ((s) ? strlen(s) : 0)
  2508.  
  2509. #define DEFAULT_INDICATOR_DIM   9
  2510.  
  2511. #ifndef MAX
  2512. #define MAX(x,y)    ((x) > (y) ? (x) : (y))
  2513. #endif
  2514.  
  2515. #define RX(r)            (((RectObj) r)->rectangle.x)
  2516. #define RY(r)            (((RectObj) r)->rectangle.y)
  2517. #define RWidth(r)        (((RectObj) r)->rectangle.width)
  2518. #define RHeight(r)        (((RectObj) r)->rectangle.height)
  2519. #define RBorder(r)        (((RectObj) r)->rectangle.border_width)
  2520.  
  2521. #define GMode(g)        ((g)->request_mode)
  2522. #define IsX(g)            (GMode (g) & CWX)
  2523. #define IsY(g)            (GMode (g) & CWY)
  2524. #define IsWidth(g)        (GMode (g) & CWWidth)
  2525. #define IsHeight(g)        (GMode (g) & CWHeight)
  2526. #define IsBorder(g)        (GMode (g) & CWBorderWidth)
  2527. #define IsWidthHeight(g)    ((GMode (g) & CWWidth) || (GMode (g) & CWHeight))
  2528.  
  2529. #define MAXDIMENSION    ((1 << 31)-1)
  2530.  
  2531. #define Max(x, y)    (((x) > (y)) ? (x) : (y))
  2532. #define Min(x, y)    (((x) < (y)) ? (x) : (y))
  2533. #define AssignMax(x, y)    if ((y) > (x)) x = (y)
  2534. #define AssignMin(x, y)    if ((y) < (x)) x = (y)
  2535.  
  2536. #define DIALOG_SUFFIX "_popup"
  2537. #define DIALOG_SUFFIX_SIZE 6
  2538.  
  2539. #define XM_3D_ENHANCE_PIXEL 2
  2540. #define XM_DEFAULT_TOP_MARGIN 0
  2541. #define XM_DEFAULT_BOTTOM_MARGIN 0
  2542.  
  2543. externalref WidgetClass xmWorldObjectClass;
  2544. externalref WidgetClass xmDesktopObjectClass;
  2545. externalref WidgetClass xmDisplayObjectClass;
  2546. externalref WidgetClass xmScreenObjectClass;
  2547.  
  2548.  
  2549. #ifndef _XmNO_BC_INCL
  2550.  
  2551. #include <Xm/VendorSP.h>
  2552. #include <Xm/ManagerP.h>
  2553. #include <Xm/PrimitiveP.h>
  2554. #include <Xm/GadgetP.h>
  2555.  
  2556. #endif /* _XmNO_BC_INCL */
  2557.  
  2558. #endif /* XM_1_1_BC */
  2559.  
  2560.  
  2561. #include <Xm/BaseClassP.h>              /* To support fast subclass macros. */
  2562.  
  2563. #ifndef NO_IXI_XPM3_ADD
  2564.  
  2565. /* IXI added to support xpm3 loading */
  2566. /* Minimal information required by ReadImage.c */
  2567.  
  2568. /* Return ErrorStatus codes:
  2569.  * null     if full success
  2570.  * positive if partial success
  2571.  * negative if failure
  2572.  */
  2573.  
  2574. #define XpmIsXBitmap     2      /* pd@ixi Mon Apr 19 17:04:30 1993 */
  2575. #define XpmColorError    1
  2576. #define XpmSuccess       0
  2577. #define XpmOpenFailed   -1
  2578. #define XpmFileInvalid  -2
  2579. #define XpmNoMemory     -3
  2580. #define XpmColorFailed  -4
  2581.  
  2582. #endif /* NO_IXI_XPM3_ADD */
  2583.  
  2584. #endif /* _XmP_h */
  2585. /* DON'T ADD STUFF AFTER THIS #endif */
  2586.