home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / yacl-012.zip / ui / uidefs.h < prev    next >
C/C++ Source or Header  |  1995-03-28  |  3KB  |  116 lines

  1.  
  2. #ifndef _uidefs_h_ /* Sat Dec 25 09:21:26 1993 */
  3. #define _uidefs_h_
  4.  
  5.  
  6.  
  7.  
  8.  
  9. /*
  10.  *
  11.  *          Copyright (C) 1994, M. A. Sridhar
  12.  *  
  13.  *
  14.  *     This software is Copyright M. A. Sridhar, 1994. You are free
  15.  *     to copy, modify or distribute this software  as you see fit,
  16.  *     and to use  it  for  any  purpose, provided   this copyright
  17.  *     notice and the following   disclaimer are included  with all
  18.  *     copies.
  19.  *
  20.  *                        DISCLAIMER
  21.  *
  22.  *     The author makes no warranties, either expressed or implied,
  23.  *     with respect  to  this  software, its  quality, performance,
  24.  *     merchantability, or fitness for any particular purpose. This
  25.  *     software is distributed  AS IS.  The  user of this  software
  26.  *     assumes all risks  as to its quality  and performance. In no
  27.  *     event shall the author be liable for any direct, indirect or
  28.  *     consequential damages, even if the  author has been  advised
  29.  *     as to the possibility of such damages.
  30.  *
  31.  */
  32.  
  33.  
  34.  
  35. #if !defined(__MS_WINDOWS__) && !defined(__X_MOTIF__) && !defined(__OS2__)
  36. #error uidefs.h: unsupported platform
  37. #endif
  38.  
  39. // --------------------- uidefs.h -----------------------------
  40. //
  41. //      Basic declarations for the user interface framework
  42. //
  43. // ------------------------------------------------------------
  44.  
  45.  
  46.  
  47. #include "base/defs.h"
  48.  
  49. // The View Id: a "persistent" way of identifying visual objects
  50. typedef long UI_ViewID;
  51.  
  52. // The View Handle is a platform-specific handle to a VisualObject. Its
  53. // typedef depends on platform. The WindowClass is a platform-specific
  54. // typedef that establishes the class of window.
  55.  
  56. # if defined(__MS_WINDOWS__)
  57. // ----------------- Windows-specific definitions: -----------------------
  58.  
  59.     typedef long            UI_ViewHandle;
  60.     typedef const char*     UI_WindowClass;
  61.     
  62. #   define NativeEventStruct MSG
  63. #   define BTNGROUP_PROPERTY1 "YACLBtnGrp1"
  64. #   define BTNGROUP_PROPERTY2 "YACLBtnGrp2"
  65.  
  66. # elif defined(__OS2__)
  67. #   define INCL_PM
  68. #   include <os2.h>
  69.     typedef QMSG          NativeEventStruct;
  70.     typedef ulong         UI_ViewHandle;
  71.     typedef const char*   UI_WindowClass;
  72.     
  73. # elif defined(__X_MOTIF__)
  74. // -----------------    X-specific definitions: --------------------------
  75.  
  76.     extern "C" {
  77.     // These are stolen from X11/Intrinsic.h. They might have to be fixed up
  78.     // in future versions of X, if the definitions of "Widget" and
  79.     // "WidgetClass" change. We refrain from including Intrinsic.h here so
  80.     // as to minimize preprocessing time when compiling applications.
  81.     struct _WidgetRec;
  82.     struct _WidgetClassRec;
  83.     }
  84.     typedef _WidgetClassRec*   UI_WindowClass;
  85.     typedef struct _WidgetRec* UI_ViewHandle;
  86. #   define NativeEventStruct XEvent
  87.  
  88.  
  89. #endif
  90.  
  91.  
  92.  
  93. // --------------------- Useful enumerations -----------------------
  94.  
  95. enum UI_TextStyle {UIText_Left, UIText_Right, UIText_Center};
  96.  
  97. // Standard id's of the buttons on  dialogs:
  98. enum UI_StdButtonEnum {
  99.     UI_IDOK = 1, UI_IDCANCEL, UI_IDYES,  UI_IDNO
  100. };
  101.  
  102.  
  103.  
  104.  
  105. // ----------------------- Misc stuff -----------------------------
  106.  
  107. extern char _YACLWindowClassName[]; // Defined in cntroler.cxx
  108.  
  109. #ifndef __MS_WINDOWS__
  110. # define FAR    
  111. #endif
  112.  
  113.  
  114. #endif /* _uidefs_h_ */
  115.  
  116.