mi32/xdefns.h

Go to the documentation of this file.
00001 /**
00002  * mi32/xdefns.h - Definitions for MicroImages library functions which use X toolkit
00003  *
00004  * \if NODOC
00005  * $Log: xdefns.h_v $
00006  * Revision 3.743  2006/06/02 14:51:08  scowan
00007  * Removed checkDiskSpace prototype.
00008  *
00009  * Revision 3.742  2006/05/04 15:53:59  dwilliss
00010  * added a button row flag
00011  *
00012  * Revision 3.741  2006/03/07 17:07:51  mju
00013  * Add mxPopupAndWait.
00014  *
00015  * Revision 3.740  2006/01/09 14:22:09  mju
00016  * Remove unused prototype.
00017  *
00018  * Revision 3.739  2006/01/04 21:32:55  mju
00019  * Deprecate mxSaveAsTextFile.
00020  *
00021  * Revision 3.738  2006/01/04 18:29:34  mju
00022  * Deprecate fns using legacy filename and rvcgeninfo.
00023  *
00024  * Revision 3.737  2005/12/05 16:45:21  mju
00025  * Don't include mdlg hdr if no_deprecated.
00026  *
00027  * Revision 3.736  2005/11/18 14:43:41  mju
00028  * Add delegate to mxCreateMenuFile for special items.
00029  *
00030  * Revision 3.735  2005/10/11 14:19:04  mju
00031  * Fix rastype_float64 value.
00032  *
00033  * Revision 3.734  2005/10/05 22:41:59  scowan
00034  * Removed unused prototypes.
00035  *
00036  * Revision 3.733  2005/10/05 20:18:09  scowan
00037  * Removed unused function prototype.
00038  *
00039  * Revision 3.732  2005/09/15 17:04:10  mju
00040  * Fix unref parm warning.
00041  *
00042  * Revision 3.731  2005/09/12 19:10:16  scowan
00043  * Changed a prototype to take a objitem.
00044  *
00045  * Revision 3.730  2005/08/18 16:18:42  dwilliss
00046  * Overloaded a func and deprecated the old version
00047  *
00048  * Revision 3.729  2005/08/02 22:10:55  scowan
00049  * Removed unused function.
00050  *
00051  * Revision 3.728  2005/07/28 17:03:32  scowan
00052  * Removed comment line.
00053  *
00054  * Revision 3.727  2005/05/12 19:41:29  dwilliss
00055  * New prototype
00056  *
00057  * Revision 3.726  2005/03/31 18:23:23  mju
00058  * Add MxSetFocusToWidget.
00059  *
00060  * Revision 3.725  2005/03/31 16:57:22  fileserver!dwilliss
00061  * Rename one of our types to MIUNICODE because it conflicted with a Microsoft #define
00062  *
00063  * Revision 3.724  2005/03/24 16:22:42  dwilliss
00064  * new proto
00065  *
00066  * Revision 3.723  2005/03/15 18:43:25  mju
00067  * Remove mapprojparm decl.
00068  *
00069  * Revision 3.722  2005/03/07 16:47:36  dwilliss
00070  * Added a prototype
00071  *
00072  * Revision 3.721  2005/02/17 15:17:22  mju
00073  * Add defaults for unused parms in saveDrawable/SnapshotToRaster.
00074  *
00075  * Revision 3.720  2005/01/20 18:34:30  scowan
00076  * Changed mx select element function parameters.
00077  *
00078  * Revision 3.719  2005/01/18 15:57:50  mju
00079  * Add iconid variants for mxCreateIcon...
00080  *
00081  * Revision 3.717  2005/01/14 23:57:57  dwilliss
00082  * RASTYPE constants switched around to be the same as RVC::IMAGE::CELLTYPE
00083  * Eliminated 2-bit raster type
00084  *
00085  * Revision 3.716  2005/01/10 18:00:16  mju
00086  * Remove group.key variant for msgLineSetTimer.
00087  *
00088  * Revision 3.715  2005/01/10 17:53:19  mju
00089  * Use mistring for mxtitleSetString so can use textid.
00090  *
00091  * Revision 3.714  2005/01/10 16:02:29  mju
00092  * Add dft for msglinesettimer.
00093  *
00094  * Revision 3.713  2005/01/07 16:35:31  mju
00095  * Rmv mxMsgLineSetString as unused.
00096  *
00097  * Revision 3.712  2005/01/04 15:24:28  mju
00098  * Remove mxtitleSetStringExt.
00099  *
00100  * Revision 3.711  2005/01/03 16:23:49  mju
00101  * Add ifdefs for deprecation.
00102  *
00103  * Revision 3.710  2004/10/21 16:57:26  mju
00104  * Use msys fn to get appcontext in mxXtTimeOutAdd.
00105  *
00106  * Revision 3.709  2004/10/15 20:56:39  mju
00107  * In mxToggleButtonSetState force values to true/false when call xm version.
00108  *
00109  * Revision 3.708  2004/10/14 20:14:03  dwilliss
00110  * Added 2 new option menu functions to wrap Motif ones
00111  *
00112  * Revision 3.707  2004/07/15 19:28:50  mju
00113  * Use region2d for region generation functions.
00114  *
00115  * Revision 3.706  2004/07/14 22:56:15  dwilliss
00116  * another dregion bites the dust!
00117  *
00118  * Revision 3.705  2004/07/14 22:14:13  dwilliss
00119  * mx setup floodparms callback now takes a REGION2D, not a dregion.
00120  *
00121  * Revision 3.699  2004/06/30 21:08:09  mju
00122  * Don't include coordop, just forward-declare what we actually need.
00123  *
00124  * Revision 3.696  2004/06/16 17:47:47  dwilliss
00125  * Added MxPopupMenuAddParent
00126  *
00127  * Revision 3.693  2004/06/02 15:18:56  dwilliss
00128  * MxCreateXmStringUC now takes optional style parameter
00129  *
00130  * Revision 3.692  2004/05/25 19:28:04  dwilliss
00131  * Added an optional parameter to the MxStringXxx functions
00132  *
00133  * Revision 3.691  2004/04/14 21:47:49  mju
00134  * Add MxMENU_NOCENTERLABEL.
00135  *
00136  * Revision 3.690  2004/04/08 22:16:18  scowan
00137  * Removed prototypes of mx texts style form functions.
00138  *
00139  * Revision 3.689  2004/03/11 21:12:25  mju
00140  * Change comment for mxToolTip fn replacement.
00141  *
00142  * Revision 3.687  2004/03/05 16:03:44  dwilliss
00143  * Added parameter to MxStringExtents to clear up confusion about what height
00144  * was returned (even though it was CLEARLY DOCUMENTED!) Now you have to tell
00145  * it what you want.  You have a choice and it's not optional.
00146  *
00147  * Revision 3.686  2004/03/01 15:15:30  mju
00148  * Deprecate more legacy functions.
00149  * Show replacements for most deprecated items.
00150  *
00151  * Revision 3.685  2004/02/26 16:54:53  mju
00152  * Deprecate old style editor functions.
00153  *
00154  * Revision 3.681  2004/02/02 17:54:17  mju
00155  * Add xmstr.SetFromWidget.
00156  *
00157  * Revision 3.680  2004/01/06 14:29:39  mju
00158  * Remove getXServerFont as not used.
00159  *
00160  * Revision 3.677  2003/12/19 21:25:42  mju
00161  * mtTextGetSmString should be inline.
00162  *
00163  * Revision 3.676  2003/12/19 17:15:03  dwilliss
00164  * added a new prototype for a new tooltip func
00165  *
00166  * Revision 3.675  2003/12/19 14:20:44  mju
00167  * Remove obsolete mtTextSetXeTextString.
00168  *
00169  * Revision 3.674  2003/12/18 13:42:42  mju
00170  * Remove deprecated stuff.
00171  *
00172  * Revision 3.673  2003/12/15 23:55:11  dwilliss
00173  * Added tool tip function to show an MGD image
00174  *
00175  * Revision 3.672  2003/12/15 21:02:07  dwilliss
00176  * Added a proto
00177  *
00178  * Revision 3.671  2003/11/19 21:50:26  mju
00179  * Add MxCreateLabel using MISTRING.
00180  *
00181  * Revision 3.670  2003/11/11 22:54:36  dwilliss
00182  * Overloaded version of MxGetDBFields that takes MISTRING/FILEPATH
00183  *
00184  * Revision 3.667  2003/11/05 20:50:30  mju
00185  * Restore XMSTR ctor/op= from MIUNICODE const*.
00186  *
00187  * Revision 3.665  2003/11/05 14:44:00  mju
00188  * Add mxGetColorPixel, setWidgetColor.
00189  *
00190  * Revision 3.661  2003/11/03 14:41:26  mju
00191  * Add MxMsgLineSetText, make SetString/SetTextID call it.
00192  *
00193  * Revision 3.659  2003/10/31 22:12:09  mju
00194  * Remove almost all Mxc color toolkit fns as colormapped displays no longer supported.
00195  *
00196  * Revision 3.658  2003/10/31 16:33:38  mju
00197  * Remove mxFindClosestStdColor.
00198  *
00199  * Revision 3.657  2003/10/31 16:21:52  mju
00200  * Delete obsolete prototypes.
00201  *
00202  * Revision 3.656  2003/10/31 16:02:42  mju
00203  * Remove old metadata attachment fn.
00204  *
00205  * Revision 3.655  2003/10/30 20:25:33  scowan
00206  * Changed check disk space prototype to take a filepath and a int 64.
00207  *
00208  * Revision 3.654  2003/10/22 16:33:09  mju
00209  * Remove mxGeorefMakeImplied prototype.
00210  *
00211  * Revision 3.653  2003/10/22 15:44:11  mju
00212  * Remove mxDisplayMessageCode prototypes.
00213  *
00214  * Revision 3.652  2003/10/17 14:52:50  mju
00215  * Deprecate MxPopupYNC.
00216  *
00217  * Revision 3.648  2003/10/09 15:27:23  scowan
00218  * Added text id support for xm str class.
00219  *
00220  * Revision 3.646  2003/10/08 16:42:14  mju
00221  * Add MxMsgLineSetTimer variant using textid.
00222  *
00223  * Revision 3.645  2003/09/22 19:57:03  scowan
00224  * removed old recover rvc function prototype.
00225  *
00226  * Revision 3.643  2003/09/15 13:49:56  fileserver!dwilliss
00227  * Doxygen
00228  *
00229  * \endif
00230 **/
00231 
00232 #if !defined(INC_MI32_XDEFNS_H) && (!defined(WIN32_NATIVE) || defined(GENERATING_DOXYGEN_OUTPUT))
00233 
00234 #define  INC_MI32_XDEFNS_H
00235 
00236 #define  NoXmMessageDialogTypes  //!<  So don't allow XmDIALOG_ERROR, WARNING, etc 
00237 
00238 #ifndef  INC_MI32_STDDEFNS_H
00239    #include <mi32/stddefns.h>
00240 #endif
00241 
00242 #ifndef  _XLIB_H_
00243    #include <X11/Xlib.h>
00244 #endif
00245 
00246 #ifndef  _XUTIL_H
00247    #include <X11/Xutil.h>
00248 #endif
00249 
00250 #ifdef EDITRES
00251    #include <X11/Xmu/Editres.h>
00252 #endif
00253 
00254 #ifndef  _Xm_h
00255    #include <Xm/Xm.h>
00256 #endif
00257 #ifndef  _XmToggle_h
00258    #include <Xm/ToggleB.h>
00259 #endif
00260 
00261 #ifndef  INC_MI32_MSTATUSW_H
00262    #include <mi32/mstatusw.h>
00263 #endif
00264 #if !defined(INC_MI32_MDLG_H) && !defined(NO_DEPRECATED)
00265    // Deprecated inclusion as usually MGUI-only code won't build for non-X because xdefns not included
00266    #include <mi32/mdlg.h>
00267 #endif
00268 #ifndef  INC_MI32_MCB_H
00269    #include <mi32/mcb.h>
00270 #endif
00271 
00272 #ifndef  INC_MI32_DISPINFO_H
00273    #include <mi32/dispinfo.h>
00274 #endif
00275 
00276 #ifndef INC_MI32_ELEMTYPE_H
00277    #include <mi32/elemtype.h>
00278 #endif
00279 
00280 #ifndef  INC_MI32_COLOR_H
00281    #include <mi32/color.h>
00282 #endif
00283 
00284 #ifndef  INC_MI32_TEXTBASE_H
00285    #include <mi32/textbase.h>    //! For TEXTBASEORIGIN
00286 #endif
00287 
00288 #ifndef  INC_MI32_LATLONFM_H
00289    #include <mi32/latlonfm.h>    //! For DEGTOSTRFLAGS
00290 #endif
00291 
00292 #ifndef  INC_MI32_MSYS_H
00293    #include <mi32/msys.h>
00294 #endif
00295 
00296 #ifndef  INC_MI32_SIMPLEAR_H
00297    #include <mi32/simplear.h>
00298 #endif
00299 
00300 #ifndef  INC_RVC_OBJTYPE_H
00301    #include <rvc/objtype.h>
00302 #endif
00303 
00304 #ifndef INC_MI32_FIXEDSTR_H
00305    #include <mi32/fixedstr.h>
00306 #endif
00307 
00308 #ifndef  INC_MI32_HELPID_H
00309    #include <mi32/helpid.h>
00310 #endif
00311 
00312 #ifndef  INC_MI32_MG2ENUMS_H
00313    #include <mi32/mg2enums.h> 
00314 #endif
00315 
00316 #ifndef  INC_MI32_TEXTID_H
00317    #include <mi32/textid.h>
00318 #endif
00319 
00320 #ifndef  INC_MI32_ICONID_H
00321    #include <mi32/iconid.h>
00322 #endif
00323 
00324 #ifdef index
00325 #undef index
00326 #endif
00327 
00328 //! Forward declarations
00329 
00330 union ANYRASTVALUE;
00331 struct BITMAPPATTHDR;
00332 class REGION2D;
00333 struct COLMAPINFO;
00334 struct HISTORGB;
00335 struct MICONSTRUCT;
00336 struct RGNELEMLIST;
00337 struct RVCRASTINFO;
00338 struct RVCTABLEINFO;
00339 struct TABLEFIELD;
00340 struct TEXTSTYLE;
00341 struct TRANSPARM;
00342 struct MTIMER;
00343 class TRANS2D_MAPGEN;
00344 struct UNITCONV;
00345 struct TEXTMETRICS;
00346 class FILEPATH;
00347 class XTARGS;
00348 
00349 
00350 #ifndef USE_NEW_MGD
00351 #define USE_NEW_MGD
00352 #endif
00353 
00354 
00355 namespace MGD {
00356 class DEVICE;
00357 class DEVICE_BINARY;
00358 }
00359 typedef MGD::DEVICE MGD_DISPLAY;
00360 
00361 namespace RVC {
00362 class OBJITEM;
00363 typedef FIXEDSTRING<16> OBJECTNAME;
00364 typedef FIXEDSTRING<64> OBJECTDESC;
00365 }
00366 
00367 namespace SPATREF {
00368 class COORDREFSYS;
00369 }
00370 
00371 /*----------------------------------------------------------------------------*/
00372 /*    Helper macros                                                           */
00373 /*----------------------------------------------------------------------------*/
00374 
00375 #define  XtSetArgI(arg,c,n,v) ((void)(arg[c].name=(char*)(n),arg[c].value=(XtArgVal)(v),c++))
00376 
00377    // The sizeof operators are used to ensure that the size of the variable where
00378    // userData will be stored is at least as large as a pointer.  Normally the
00379    // expression inside the [] evaluates to 1.  mju 1994-05-10
00380 #define  MxGetUserData(w,p)   { Arg _mxgetuserdataarg[sizeof(*p)-sizeof(void*)+1]; XtSetArg(_mxgetuserdataarg[0],XmNuserData,p); XtGetValues(w,_mxgetuserdataarg,1); }
00381 
00382 #define  MxAddEditResHandler(shell) XtAddEventHandler(shell, (EventMask) 0, True, _XEditResCheckMessages, NULL)
00383 
00384 //! Macros for defining class methods to add Xt callbacks / event handlers
00385 #define  MXXTCB_ADD(_clsname)       inline void MxXtCallbackAdd (Widget w, const char *name, void (*f)(Widget,_clsname*,void*)) { XtAddCallback(w,(name),reinterpret_cast<XtCallbackProc>(f),this); }
00386 #define  MXXTCB_REMOVE(_clsname)    inline void MxXtCallbackRemove (Widget w, const char *name, void (*f)(Widget,_clsname*,void*)) { XtRemoveCallback(w,(name),reinterpret_cast<XtCallbackProc>(f),this); }
00387 #define  MXXTEH_ADD(_clsname)       inline void MxXtEventHandlerAdd (Widget w, EventMask emask, void (*f)(Widget,_clsname*,XEvent*,Boolean*), bool nmi=false) { XtAddEventHandler(w,(emask),(Boolean)(nmi),reinterpret_cast<XtEventHandler>(f),this); }
00388 #define  MXXTEH_REMOVE(_clsname)    inline void MxXtEventHandlerRemove (Widget w, EventMask emask, void (*f)(Widget,_clsname*,XEvent*,Boolean*), bool nmi=false) { XtRemoveEventHandler(w,(emask),(Boolean)(nmi),reinterpret_cast<XtEventHandler>(f),this); }
00389 #define  MXXTTO_ADD(_clsname)       inline XtIntervalId MxXtTimeOutAdd (Widget, unsigned long delay, void (*f)(_clsname*,XtIntervalId*)) { return(XtAppAddTimeOut(MsysAppGetXContext(),(delay),reinterpret_cast<XtTimerCallbackProc>(f),this)); }
00390 
00391 
00392 /*----------------------------------------------------------------------------*/
00393 
00394 extern "C" {
00395 
00396 extern int _MxShadowThickness;   //!<  Shadow thickness for widgets that have shadows 
00397 extern int _MxSpaceNarrow;       //!<  Narrow spacing (eg, inside Frame) between widgets 
00398 extern int _MxSpaceNormal;       //!<  Normal spacing between widgets 
00399 extern int _MxSpaceWide;         //!<  Wide spacing between widgets 
00400 
00401 }  //! extern "C"
00402 
00403 /*----------------------------------------------------------------------------*/
00404 /*    Definitions for EditColor                                               */
00405 /*----------------------------------------------------------------------------*/
00406 
00407 #define  EDITCOLOR_AllowTransp      0x0002 //!< Allows transparency toggle
00408 #define  EDITCOLOR_AllowTransPct    0x0004 //!< Allows setting of transparency 0-100%
00409 
00410 struct EDITCOLORINFO {
00411    COLOR color;
00412    Pixel pixel;               //!< Pixel value to use on PseudoColor displays
00413    UINT8 CanChangeColor;      //!< Set if colormap entry for pixel value is writable
00414    UINT8 AllowTransparent;    //!< Allow this color to be set to "transparent"
00415    UINT8 DefaultSelected;     //!< Default to having this item 'selected'
00416    UINT8 spare;
00417    char *name;                //!< Name for color, will be translated through resource file
00418    };
00419 
00420 
00421 /*----------------------------------------------------------------------------*/
00422 /*    Menu Item definitions                                                   */
00423 /*----------------------------------------------------------------------------*/
00424 
00425 struct MENUITEM {
00426    mutable char *label;          //!< Label for the item, if "-" a separator will be generated, NULL to indicate end of array.
00427    unsigned long flags;          //!< Must be same size as pointer for proper alignment on the DEC Alpha
00428    XtCallbackProc callback;      //!< Callback function; NULL if none
00429    void *callback_data;          //!< client_data for callback()
00430    const char *help;             //!< Help id
00431    const MENUITEM *subitems;     //!< Submenu items; NULL if none
00432    void *userdata;               //!< Used to set userData resource if NULL passed to MxCreateMenuBar
00433    UINT32 icid;                  //!< Interface Component ID for customization
00434    mutable Widget widget;        //!< Widget created for this menu item
00435    Widget *pwidget;              //!< If non-NULL, pointed-to value will be set to widget when created
00436    };
00437 
00438 struct MENUBARITEM {
00439    mutable char *label;          //!< Label for the item, NULL to indicate end of array.
00440    const MENUITEM *items;        //!< First pulldown menu items, NULL to indicate end.
00441    Widget *widget_list;          //!< Array of widgets to save into
00442    mutable Widget widget;        //!< Widget created for this menu bar item
00443    const char *help;             //!< Help id
00444    UINT32 icid;                  //!< Interface Component ID for customization
00445    Widget *pwidget;              //!< If non-NULL, pointed-to value will be set to widget when created
00446    };
00447 
00448 #define MxMENU_SELECTED          0x0001
00449 #define MxMENU_ONE_OF_MANY       0x0002   //!< radio button gadget
00450 #define MxMENU_TOGGLE            0x0004   //!< single ToggleButtonGadget
00451 #define MxMENU_DISABLED          0x0008   //!< button is initially not "Sensitive"
00452 #define MxMENU_LABEL             0x0010   //!< Just a label
00453 #define MxMENU_FORCENAME         0x0020   //!< Set labelString resource to label value so doesn't read from resource file
00454 #define MxMENU_LABELMIUNICODE    0x0040   //!< Label is a pointer to a MIUNICODE string
00455 #define MxMENU_IGNORE            0x0080   //!< Ignore this item, don't put on menu
00456 #define MxMENU_NOGADGET          0x0100   //!< Don't use "gadget" for this item
00457 #define MxMENU_NOCENTERLABEL     0x0200   //!< Don't center if label
00458 #define MxMENU_PROGRAMMER        0x0400   //!< Item only appears on "Programmer" systems
00459 #define MxMENU_NOCHGCBDATA       0x0800   //!< Don't change callback_data for this item
00460 #define MxMENU_FREELABEL         0x1000   //!< Free label field after item created
00461 #define MxMENU_NOCUSTOMSUBMENU   0x2000   //!< Don't show submenu when customizing
00462 
00463 
00464 enum MxEDITMENUFLAGS {  //! Flags for MxEditMenuCreate
00465    MxEDITMENUFLAG_None =         0x0000,
00466    MxEDITMENUFLAG_NoSearch =     0x0001,
00467    MxEDITMENUFLAG_NoReplace =    0x0002,
00468    MxEDITMENUFLAG_NoInsertFile = 0x0004,
00469    MxEDITMENUFLAG_AllowFormat =  0x0008   //!< For if widgit is WYSIWYG
00470    };
00471 DEFINE_ENUM_OPERATORS(MxEDITMENUFLAGS);
00472 
00473 /*----------------------------------------------------------------------------*/
00474 /*    Definitions used by MxCreateButtonRow                                   */
00475 /*----------------------------------------------------------------------------*/
00476 
00477 struct BUTTONITEM {
00478    char *label;                  //!< the label for the item
00479    UINT32 flags;                 //!< see below
00480    XtCallbackProc callback;      //!< Callback function; NULL if none
00481    void *callback_data;          //!< client_data for callback() if NULL passed to MxCreateButtonRow
00482    const char *help;             //!< Help id
00483    void *userdata;               //!< Used to set userData resource if NULL passed to MxCreateButtonRow
00484    mutable Widget pbwidget;      //!< Widget created
00485    const char *IconName;         //!< name of the bitmap fill pattern to use for the icon (16 chars max)
00486    const char *ClassName;        //!< if not NULL, will override "class" passed to MxCreateIconButtonXXXX
00487    UINT32 icid;                  //!< Interface Component ID for customization
00488    const MIUNICODE *ToolTip;        //!< ToolTip string for override
00489    Pixel BackgroundPixel;        //!< Background color of icon if MxBUTTON_BACKGROUND_PIXEL is set
00490    Widget *pwidget;              //!< If non-NULL, pointed-to value will be set to widget when created
00491    };
00492 
00493 #define  MxBUTTON_DISABLED          0x0001   //!< Button is initially not "Sensitive"
00494 #define  MxBUTTON_TOGGLE            0x0002   //!< Create toggle (radio or checkbox) button
00495 #define  MxBUTTON_NOINDICATOR       0x0004   //!< Don't show indicator
00496 #define  MxBUTTON_SELECTED          0x0008   //!< Toggle button initially selected
00497 #define  MxBUTTON_ONE_OF_MANY       0x0010   //!< Use one-of-many indicator, enforce radio behavior
00498 #define  MxBUTTON_DEFAULT           0x0020   //!< Button gets default border (Not implemented)
00499 #define  MxBUTTON_MULTI_CLICK       0x0040   //!< Button allows multiple clicks in rapid succession
00500 #define  MxBUTTON_IGNORE            0x0080   //!< Ignore this entry in the BUTTONITEM array
00501 #define  MxBUTTON_PROGRAMMER        0x0100   //!< Don't display button unless in Programmer mode
00502 #define  MxBUTTON_NOMANAGE          0x0200   //!< Don't manage button when created (RowColumn button-rows only)
00503 #define  MxBUTTON_ICON_MENU         0x0400   //!< Create icon popup menu for button, callback_data points to MENUITEM*
00504 #define  MxBUTTON_ICON_MENU_FILE    0x0800   //!< Create icon popup menu for button, callback_data points to menu file name
00505 #define  MxBUTTON_BACKGROUND_PIXEL  0x1000   //!< Use BackgroundPixel from ButtonItem
00506 #define  MxBUTTON_NOCUSTOMSUBMENU   0x2000   //!< Don't show submenu when customizing
00507 #define MxBUTTON_FORCENAME          0x4000   //!< Set labelString resource to label value so doesn't read from resource file
00508 #define MxBUTTON_LABELMIUNICODE        0x8000   //!< Label is a pointer to a MIUNICODE string (implies FORCENAME)
00509 
00510 #define  MxBUTTONROW_NoIcons     0x0001   //!< Don't create and use icons for this button row (passed in flags for MxCreateIconButtonRow()
00511 #define  MxBUTTONROW_RowColumn   0x0002   //!< Use RowColumn for button-row instead of form
00512 #define  MxBUTTONROW_XmiPane  0x0004   //!< Use XmiPane for button-row instead of form
00513 
00514 /*----------------------------------------------------------------------------*/
00515 /*    TABPAGE definitions                                                     */
00516 /*----------------------------------------------------------------------------*/
00517 
00518 typedef void (*TABPAGEFUNC) (Widget, int, void*);
00519 
00520 struct MxTABPAGEITEM {
00521    char *label;
00522    UINT32 flags;
00523    TABPAGEFUNC  create;
00524    TABPAGEFUNC  activate;
00525    TABPAGEFUNC  deactivate;
00526    TABPAGEFUNC  destroy;
00527    void *pageUserData;
00528    };
00529 
00530 #define  MxTABPAGE_DISABLED      0x0001   //!< TabPage is initially disabled
00531 #define  MxTABPAGE_FreeLabel     0x0002   //!< TabPage will free the allocated label 
00532 #define  MxTABPAGE_LabelUnicode  0x0004   //!< Label is pointer to Unicode string
00533 
00534 /*----------------------------------------------------------------------------*/
00535 /*    Flags for MxCreateIcon...                                               */
00536 /*----------------------------------------------------------------------------*/
00537 
00538 #define MXICON_Stippled             MICONFLAG_Stippled
00539 #define MXICON_DefaultBackground    MICONFLAG_DefaultBackground
00540 #define MXICON_StippledSelected     MICONFLAG_StippledSelected
00541 #define MXICON_Size16               MICONFLAG_Size16
00542 #define MXICON_Size32               MICONFLAG_Size32
00543 #define MXICON_NoDarkenSelected     MICONFLAG_NoDarkenSelected
00544 
00545 /* Flags for MxSelectIcon() */
00546 
00547 #define  SELICON_Resize          0x01        //!<  Resize icons smaller than specified minimum size 
00548 
00549 
00550 /*----------------------------------------------------------------------------*/
00551 /*    Flags used by MxPopupGet... and MxCreateDouble() etc...                 */
00552 /*----------------------------------------------------------------------------*/
00553 
00554 #define GET_NoMin             (0x00000011)   //! Don't use or show
00555 #define GET_NoMax             (0x00000022)
00556 #define GET_NoRange           (0x00000033)
00557 #define GET_NoDft             (0x00000004)
00558 #define GET_InvValid          (0x00000008)   //! For GetString
00559 #define GET_AllowCancel       (0x00000001)   //! For MxPopupYNC
00560 #define GET_AllowYesAll       (0x00000002)   //! For MxPopupYNC
00561 #define GET_RastValRGB16UINT2 (0x00000008)   //! For MxPromptRastValCreate
00562 #define GET_RangeMask         (0xFFFFFFFC)
00563 
00564 #define GET_NoShowMin         (0x00000010)   //! Use, but don't show
00565 #define GET_NoShowMax         (0x00000020)
00566 #define GET_NoShowRange       (0x00000030)   //! Obsolete
00567 #define GET_ShowUnitLabel     (0x00000040)   //! Show "unit" label
00568 #define GET_ShowRange         (0x00000080)   //! Set if want range displayed
00569 
00570 #define GET_NoCancel          (0x00000100)
00571 #define GET_LabelTop          (0x00000200)   //! label on top of text widget 
00572 #define GET_DftRet            (0x00000400)   //! retval contains default
00573 #define GET_AddOne            (0x00000800)   //! Add 1 before showing dft/range
00574 
00575 #define GET_DegsNS            (0x00000000)   //! For Lat/Lon prompt (yes, this is zero)
00576 #define GET_DegsEW            (0x00001000)   //! For Lat/Lon prompt
00577 #define GET_ToUpper           (0x00002000)   //! Convert characters to upper case as entered
00578 #define GET_DetectNULL        (0x00004000)   //! Treat 7FFF as empty string (for databases)
00579 #define GET_BlankZero         (0x00008000)   //! Show 0 values as blank
00580 #define GET_RightJustify      (0x00010000)   //! Right justify within field
00581 #define GET_OutputOnly        (0x00020000)   //! Output-only prompt
00582 #define GET_PromptGiven       (0x00040000)   //! For DBQueryEdit Only
00583 #define GET_DegsNoDir         (0x00080000)   //! For Lat/Lon "range" prompt, don't show direction
00584 #define GET_NoManage          (0x00100000)
00585 #define GET_NoForm            (0x00200000)   //! For MxCreatePrompt...
00586 #define GET_PopupForceStr     (0x00400000)   //! In MxPopup... use specified string instead of doing lookup
00587 #define GET_HasScale          (0x00800000)   //! Put "Scale" widget in prompt
00588 #define GET_Degs360EW         (0x01000000)   //! For Longitude allow entry/display of W360 to E360
00589 #define GET_Unicode           (0x02000000)   //! Make string widget Unicode
00590 #define GET_PromptUnicode     (0x04000000)   //! Prompt string is really (MIUNICODE*)
00591 #define GET_LeftJustify       (0x08000000)   //! Left justify numeric value within field
00592 #define GET_UseLogScale       (0x20000000)   //! Set if want logarithmic scale, must set GET_HasScale also
00593 #define GET_Password          (0x40000000)   //! Show "*"'s in text widget
00594 
00595 #define  MxPromptRastValCR_ValueChanged   0x0001
00596 
00597 #define  MxPromptCR_ValueChanged       0x00000001  //!<  User has changed prompt value 
00598 #define  MxPromptCR_ValueChangeDrag    0x00000002  //!<  User dragging prompt scale slider 
00599 #define  MxPromptCR_Activate           0x00000004  //!<  User pressed <Enter> while in prompt 
00600 
00601 struct MxPromptCallbackStruct {
00602    UINT32 reason;                   //!<  Callback reason 
00603    Widget prompt;                   //!<  Prompt widget 
00604    void *value;                     //!<  Pointer to prompt value 
00605    };
00606 
00607 typedef void (*MxPromptCallbackFunc)(MxPromptCallbackStruct*, void*);
00608 
00609 #define  MXPRMTCB_ADD(_clsname)     inline void MxPromptCallbackAdd (Widget w, void (*f)(MxPromptCallbackStruct*,_clsname*), UINT32 flags = MxPromptCR_ValueChanged) const { MxPromptAddCallback(w,reinterpret_cast<MxPromptCallbackFunc>(f),(void*)this,(flags)); }
00610 #define  MXPRMTCB_REMOVE(_clsname)  inline void MxPromptCallbackRemove (Widget w, void (*f)(MxPromptCallbackStruct*,_clsname*), UINT32 flags) const { MxPromptRemoveCallback(w,reinterpret_cast<MxPromptCallbackFunc>(f),(void*)this,(flags)); }
00611 
00612    /* Prompt field types */
00613 #define MXPROMPT_ASTRING   0     //!<  ASCII string 
00614 #define MXPROMPT_USTRING   1     //!<  Unicode string 
00615 #define MXPROMPT_ACHAR     2     //!<  Single ASCII character 
00616 #define MXPROMPT_UCHAR     3     //!<  Single Unicode character 
00617 #define MXPROMPT_DOUBLE    10    //!<  64-bit floating-point 
00618 #define MXPROMPT_FLOAT     11    //!<  32-bit floating-point 
00619 #define MXPROMPT_UINT32    12    //!<  Unsigned 32-bit number 
00620 #define MXPROMPT_INT32     13    //!<  Signed 32-bit number 
00621 #define MXPROMPT_UINT16    14    //!<  Unsigned 16-bit number 
00622 #define MXPROMPT_INT16     15    //!<  Signed 16-bit number 
00623 #define MXPROMPT_UINT8     16    //!<  Unsigned 8-bit number 
00624 #define MXPROMPT_INT8      17    //!<  Signed 8-bit number 
00625 #define MXPROMPT_LATLON    18    //!<  Latitude or Longitude stored as double 
00626 
00627 /*----------------------------------------------------------------------------*/
00628 /*    Flags for MxGetPattern                                                  */
00629 /*----------------------------------------------------------------------------*/
00630 
00631 enum GETPATTERNFLAGS {
00632    GETPATTERN_None =       0x00,
00633    GETPATTERN_NewOK =      0x01, //!< Allow new pattern to be created
00634    GETPATTERN_IconMode =   0x02, //!< Don't replicate bitmap samples
00635    GETPATTERN_OnlyOne =    0x04, //!< Only allow one icon in the user set
00636    GETPATTERN_TitleEdit =  0x08  //!< Use "edit" title instead of "select" title
00637    };
00638 DEFINE_ENUM_OPERATORS(GETPATTERNFLAGS);
00639 
00640 /*----------------------------------------------------------------------------*/
00641 /*    Flags for MxCreateRastTypeOptionMenu                                    */
00642 /*----------------------------------------------------------------------------*/
00643 
00644 // These must be same as RVC::IMAGE::CELLTYPE
00645 #define RASTYPE_binary        0x00000001     //!<   one bit (binary)             
00646 #define RASTYPE_1bit          0x00000001     //!<   one bit (binary)             
00647 #define RASTYPE_4bit          0x00000002     //!<   four bit integer             
00648 #define RASTYPE_unsigned8     0x00000004     //!<   unsigned 8 bit integer       
00649 #define RASTYPE_unsigned32    0x00000008     //!<   32 bit unsigned integer      
00650 #define RASTYPE_unsigned16    0x00000010     //!<   unsigned 16 bit integer      
00651 #define RASTYPE_signed8       0x00000040     //!<   signed 8 bit integer         
00652 #define RASTYPE_signed16      0x00000080     //!<   signed 16 bit integer        
00653 #define RASTYPE_signed32      0x00000100     //!<   32 bit signed integer        
00654 #define RASTYPE_float32       0x00000400     //!<   32 bit floating point        
00655 #define RASTYPE_float64       0x00000800     //!<   64 bit floating point        
00656 #define RASTYPE_complexri     0x00004000     //!<   complex real/imaginary       
00657 #define RASTYPE_complexmp     0x00008000     //!<   complex magnitude/phase      
00658 #define RASTYPE_rgb_packed16  0x00010000     //!<   16 bit packed rgb            
00659 #define RASTYPE_bgr_packed16  0x00020000     //!<   16 bit packed bgr            
00660 #define RASTYPE_rgb_packed24  0x00040000     //!<   24 bit packed rgb            
00661 #define RASTYPE_bgr_packed24  0x00080000     //!<   24 bit packed bgr            
00662 #define RASTYPE_all           0x000FFFFF     //!<   ALL datatypes                
00663 #define RASTYPE_no_rgb        ~(RASTYPE_rgb_packed16|RASTYPE_bgr_packed16|RASTYPE_rgb_packed24|RASTYPE_bgr_packed24)
00664 
00665 #define RASTYPE_no_complex    ~(RASTYPE_complexri|RASTYPE_complexmp)
00666 #define RASTYPE_no_bin        ~(RASTYPE_binary)
00667 #define RASTYPE_no_2          ~(0)
00668 #define RASTYPE_no_4          ~(RASTYPE_4bit)
00669 #define RASTYPE_no_lessthan8  ~(RASTYPE_binary|RASTYPE_4bit)
00670 #define RASTYPE_signed        (RASTYPE_signed8|RASTYPE_signed16|RASTYPE_signed32)
00671 #define RASTYPE_unsigned      (RASTYPE_unsigned8|RASTYPE_unsigned16|RASTYPE_unsigned32)
00672 
00673 #define RASTYPE_float         (RASTYPE_float32| RASTYPE_float64)
00674 #define RASTYPE_dimmed        0x00100000     //!<   dim non_selected types       
00675 #define RASTYPE_omit          0x00200000     //!<   omit non_selected types      
00676 #define RASTYPE_none_dimmed   0x000FFFFF     //!<   do not dim any of the items  
00677 
00678 /*----------------------------------------------------------------------------*/
00679 /*    Values by MxPositionWindowRel                                           */
00680 /*----------------------------------------------------------------------------*/
00681 
00682 enum MxRELPOSN {
00683    MxRELPOSN_Default =        0,
00684    MxRELPOSN_AutoLeftRight =  1,
00685    MxRELPOSN_RightTop =       2,
00686    MxRELPOSN_LeftTop =        3,
00687    MxRELPOSN_RightCenter =    4,
00688    MxRELPOSN_LeftCenter =     5,
00689    MxRELPOSN_RightBottom =    6,
00690    MxRELPOSN_LeftBottom =     7,
00691    MxRELPOSN_TopLeft =        8,
00692    MxRELPOSN_BottomLeft =     9,
00693    MxRELPOSN_TopCenter =      10,
00694    MxRELPOSN_BottomCenter =   11,
00695    MxRELPOSN_TopRight =       12,
00696    MxRELPOSN_BottomRight =    13,
00697    MxRELPOSN_MatchBottom =    14,
00698    MxRELPOSN_MatchTop =       15,
00699    MxRELPOSN_MatchLeft =      16,
00700    MxRELPOSN_MatchRight =     17
00701    };
00702 
00703 /*----------------------------------------------------------------------------*/
00704 /*    Values used by MxLockWindowSize()                                       */
00705 /*----------------------------------------------------------------------------*/
00706 
00707 #define  MxLOCKSIZE_MinHeight    0x1
00708 #define  MxLOCKSIZE_MinWidth     0x2
00709 #define  MxLOCKSIZE_MaxHeight    0x4
00710 #define  MxLOCKSIZE_MaxWidth     0x8
00711 #define  MxLOCKSIZE_Min          (MxLOCKSIZE_MinHeight | MxLOCKSIZE_MinWidth)
00712 #define  MxLOCKSIZE_Max          (MxLOCKSIZE_MaxHeight | MxLOCKSIZE_MaxWidth)
00713 #define  MxLOCKSIZE_MinMax       (MxLOCKSIZE_Min | MxLOCKSIZE_Max)
00714 
00715 /*----------------------------------------------------------------------------*/
00716 /*    Values used by MxCreatePathSelector                                     */
00717 /*----------------------------------------------------------------------------*/
00718 
00719 #define  MxPATHSEL_AllowFiles    0x0002   //!<  Allow files to be specified in path 
00720 
00721 /*----------------------------------------------------------------------------*/
00722 /*    Definitions used by MxEditStyle...()                                    */
00723 /*----------------------------------------------------------------------------*/
00724 
00725 #define  EDITSTYLE_Default                0x00000001  //!<  Only editing the "default" style 
00726 #define  EDITSTYLE_CAD                    0x00000002  //!<  Editing CAD styles 
00727 #define  EDITSTYLE_OKCancel               0x00000004  //!<  Add OK/Cancel butons 
00728 #define  EDITSTYLE_SingleType             0x00000008  //!<  Only allow editing of specified style type 
00729 #define  EDITSTYLE_NoRenameStyles         0x00000010  //!<  Don't allow styles to be renamed 
00730 #define  EDITSTYLE_NoNewDelStyles         0x00000020  //!<  Don't allow styles to be created or deleted 
00731 #define  EDITSTYLE_NoElemHeight           0x00000040  //!<  Don't include "Use element height" togglebutton 
00732 #define  EDITSTYLE_AllowTextHTML          0x00000080  //!<  Allow HTML text formatting options 
00733 #define  EDITSTYLE_AllowTextSpecialFormat 0x00000100  //!<  Allow "Special Format" options for text styles 
00734 #define  EDITSTYLE_NoScaleToNone          0x00000200  //!<  Scaling to "none" not allowed 
00735 #define  EDITSTYLE_NoTypeButtons          0x00000400  //!<  Don't include buttons for switching style type 
00736 #define  EDITSTYLE_NoScaleToLayout        0x00000800  //!<  Don't allow scaling to "layout" 
00737 #define  EDITSTYLE_NoScaleOptions         0x00001000  //!<  Don't give user options for scale-to 
00738 #define  EDITSTYLE_NoSymbolNone           0x00002000  //!<  Don't allow "no symbol" option 
00739 #define  EDITSTYLE_AllowTextVertAlignment 0x00004000  //!<  Add option for text vertical alignment 
00740 #define  EDITSTYLE_SymbolForceSquare      0x00008000  //!< Force symbol "width" to match "height"
00741 #define  EDITSTYLE_NoSample               0x00010000  //!< No not show "sample"
00742 #define  EDITSTYLE_NoWordWrap             0x00020000  //!< Disallow setting word wrap
00743 #define  EDITSTYLE_ForceWordWrap          0x00040000  //!< Force word wrap
00744 #define  EDITSTYLE_NoBlockWidth           0x00080000  //!< Don't allow setting block width
00745 #define  EDITSTYLE_NoAdvanced             0x00100000  //!< Don't allow advanced button
00746 
00747 /*----------------------------------------------------------------------------*/
00748 /*    Values used by MxSetupXYDigRefInfo                                      */
00749 /*----------------------------------------------------------------------------*/
00750 
00751 #define MxXYD_NoChangeProj    0x00000001
00752 
00753 /*----------------------------------------------------------------------------*/
00754 /*    Class for double-click handling                                         */
00755 /*----------------------------------------------------------------------------*/
00756 
00757 class DOUBLECLICKTEST {
00758    public:
00759 
00760       //! Constructor
00761       DOUBLECLICKTEST (
00762          ):
00763          m_State(0),
00764          m_Interval(400),
00765          m_StartTime(0)
00766          { }
00767 
00768       //! Destructor
00769       ~DOUBLECLICKTEST (
00770          ) { }
00771 
00772       //! Reset to initial state
00773       void Reset (
00774          ) { m_State = 0; }
00775 
00776       //! Set interval
00777       void SetInterval (
00778          INT32 Interval                   //!< Interval in milliseconds
00779          ) { m_Interval = Interval; }
00780 
00781       //! Test if event results in double-click
00782       bool TestEvent (
00783          const XEvent *event              //!< Event to check
00784          );
00785 
00786    private:
00787       #ifndef GENERATING_DOXYGEN_OUTPUT
00788       UINT8 m_State;          //!< State for double-click testing
00789       INT32 m_Interval;       //!< Interval in milliseconds
00790       UINT32 m_StartTime;     //!< Starting event time
00791       #endif // GENERATING_DOXYGEN_OUTPUT
00792    };
00793 
00794 
00795 /*----------------------------------------------------------------------------*/
00796 /*    Misc constants                                                          */
00797 /*----------------------------------------------------------------------------*/
00798 
00799 #define  MxCOLORSEL_EditTranspPct   0x0001   //!<  Allow transparency percentage to be set in MxColorSel... 
00800 
00801 #if !defined(DEPRECATE_GROUPKEY) && !defined(DEPRECATE_OLDHELP)
00802 #define  MxYNC_HasCancel         GET_AllowCancel
00803 #endif
00804 
00805 #define  MxBCOL_ALIGN_BEGINNING  1
00806 
00807 #define  MxTEXTSTYLEFORM_NoColorButton    0x00000001
00808 
00809 /*----------------------------------------------------------------------------*/
00810 /*    Function prototypes (keep in alphabetical order!)                       */
00811 /*----------------------------------------------------------------------------*/
00812 
00813 //!:Associate with "MsysApp Functions"
00814 //!\addtogroup MsysApp MsysApp Functions
00815 //!@{
00816 
00817 extern "C" {
00818 
00819 //! Get X Application Context.
00820 XtAppContext MsysAppGetXContext ();
00821 
00822 //! Get X Display pointer.
00823 Display* MsysAppGetXDisplay ();
00824 
00825 //! Set X Display pointer and application context.
00826 void MsysAppSetXDisplayContext (
00827    Display *xdisplay,                     //!< X Display pointer
00828    XtAppContext xappcontext               //!< Xt application context
00829    );
00830 
00831 //!@}
00832 //!:Associate with "X Functions"
00833 //!\addtogroup X11 X11 Functions
00834 //!@{
00835 
00836          /* Generic callbacks */
00837 
00838 //! The XmNhelpCallback to any widget that you want to give help to.