home *** CD-ROM | disk | FTP | other *** search
/ The Developer Connection…ice Driver Kit for OS/2 3 / DEV3-D1.ISO / devtools / toolkt21 / cplus / os2h / wpscheme.xh < prev    next >
Encoding:
Text File  |  1993-05-02  |  5.2 KB  |  219 lines

  1.  
  2. /*
  3.  * This file was generated by the SOM Compiler.
  4.  * FileName: wpscheme.xh.
  5.  * Generated using:
  6.  *     SOM Precompiler spc: 1.22
  7.  *     SOM Emitter emitxh: 1.11
  8.  */
  9.  
  10. /*
  11.  * 
  12.  *  Module Header
  13.  * 
  14.  *  Module Name: WPSCHEME
  15.  * 
  16.  *  OS/2 Presentation Manager Workplace class definitions
  17.  * 
  18.  *  Copyright (c) International Business Machines Corporation 1991, 1992
  19.  * 
  20.  */
  21.  
  22. #ifndef wpscheme_xh
  23. #define wpscheme_xh
  24. class WPSchemePalette;
  25.  
  26. #define WPSchemePalette_MajorVersion 1
  27. #define WPSchemePalette_MinorVersion 2
  28.  
  29. /* C++ som defs */
  30. #include <somcls.xh>
  31.  
  32. /* C++ parent def */
  33. #ifndef wppalet_xh
  34. #include "wppalet.xh"
  35. #endif
  36.  
  37. /*
  38.  * Passthru lines: File: "C.xh", "after"
  39.  */
  40.  
  41.       /*
  42.        * Scheme palette entry
  43.        */
  44.  
  45.       #define CCHSCHEMENAME 30
  46.       #define CCHFONTNAME   60
  47.  
  48.       typedef struct _SCHEME
  49.       {
  50.          CELL  cell;           /* Size of the data that follows */
  51.          ULONG RGBSysColor[SYSCLR_CSYSCOLORS];
  52.          ULONG cxBorder;
  53.          ULONG cyBorder;
  54.          CHAR  szName[CCHSCHEMENAME+1];  /* Name of this scheme */
  55.          CHAR  szWindowFont[CCHFONTNAME+1];    /* System font */
  56.          CHAR  szTitleFont[CCHFONTNAME+1];     /* System font */
  57.          CHAR  szMenuFont[CCHFONTNAME+1];      /* System font */
  58.          CHAR  szIconFont[CCHFONTNAME+1];      /* System font */
  59.       } SCHEME;
  60.       typedef SCHEME *PSCHEME;
  61.  
  62.       /*
  63.        *  Macros to extract RGB colors from a given scheme
  64.        */
  65.  
  66.       #define SYSCLR_TO_INDEX(s) (s - SYSCLR_HELPHILITE + SYSCLR_CSYSCOLORS - 1)
  67.  
  68.       #define INDEX_TO_SYSCLR(s) (s + SYSCLR_HELPHILITE - SYSCLR_CSYSCOLORS + 1)
  69.  
  70.       #define RGB_FROM_SYSCLR(psch,sysclr)                       \
  71.                 ( psch ? ( psch->RGBSysColor[ SYSCLR_TO_INDEX(sysclr) ] ) \
  72.                        : WinQuerySysColor( HWND_DESKTOP, sysclr, 0 ) )
  73.  
  74.  
  75. #ifndef WPSchemePalette_API
  76. #define WPSchemePalette_API
  77. /*
  78.  * The Class API
  79.  */
  80.  
  81. /* A procedure to create the WPSchemePalette Class */
  82. SOMEXTERN SOMClass * SOMLINK WPSchemePaletteNewClass(
  83.         integer4 majorVersion,
  84.         integer4 minorVersion);
  85.  
  86. /* A macro to return the WPSchemePalette class object */
  87. class M_WPSchemePalette;
  88. #define _WPSchemePalette ((M_WPSchemePalette*)WPSchemePaletteClassData.classObject)
  89.  
  90. /* The static interface to WPSchemePalette and its instances */
  91. SOMEXTERN struct WPSchemePaletteClassDataStructure {
  92.     SOMClass *classObject;
  93. } WPSchemePaletteClassData;
  94.  
  95. /*
  96.  * -- Typedefs for Procedures that support WPSchemePalette Methods
  97.  */
  98. extern "C" {
  99. }
  100.  
  101.  
  102. #endif /* WPSchemePalette_API */
  103.  
  104.  
  105. /*
  106.  * -- The C++ Wrapper Class for WPSchemePalette
  107.  */
  108. class WPSchemePalette : public WPPalette
  109. {
  110. public:
  111.  
  112. void *operator new(size_t size)
  113. {
  114.    (void) size;
  115.    if (!WPSchemePaletteClassData.classObject) 
  116.       WPSchemePaletteNewClass(WPSchemePalette_MajorVersion,WPSchemePalette_MinorVersion);
  117.    return (void *)
  118.       ((somTD_SOMClass_somNew)
  119.       somResolve(SOM_TestCls((SOMAny *)(WPSchemePaletteClassData.classObject),
  120.                              SOMClassClassData.classObject),
  121.                  SOMClassClassData.somNew))
  122.          ((SOMClass*)(WPSchemePaletteClassData.classObject));
  123. }
  124.  
  125. void operator delete(void * obj)
  126. {
  127.    ((SOMObject *)obj)->somFree();
  128. }
  129.  
  130.  
  131. };   /* WPSchemePalette */
  132.  
  133.  
  134.  
  135. #endif       /* wpscheme_xh */
  136.  
  137. /*
  138.  * This file was generated by the SOM Compiler.
  139.  * FileName: wpscheme.xh.
  140.  * Generated using:
  141.  *     SOM Precompiler spc: 1.22
  142.  *     SOM Emitter emitxh: 1.11
  143.  */
  144. #ifndef wpscheme_mxh
  145. #define wpscheme_mxh
  146. class M_WPSchemePalette;
  147.  
  148. #define M_WPSchemePalette_MajorVersion 1
  149. #define M_WPSchemePalette_MinorVersion 2
  150.  
  151. /* C++ som defs */
  152. #include <somcls.xh>
  153.  
  154. /* C++ parent def */
  155. #ifndef wppalet_xh
  156. #include "wppalet.xh"
  157. #endif
  158.  
  159. #ifndef M_WPSchemePalette_API
  160. #define M_WPSchemePalette_API
  161. /*
  162.  * The Class API
  163.  */
  164.  
  165. /* A procedure to create the M_WPSchemePalette Class */
  166. SOMEXTERN SOMClass * SOMLINK M_WPSchemePaletteNewClass(
  167.         integer4 majorVersion,
  168.         integer4 minorVersion);
  169.  
  170. /* A macro to return the M_WPSchemePalette class object */
  171. #define _M_WPSchemePalette ((SOMClass*)M_WPSchemePaletteClassData.classObject)
  172.  
  173. /* The static interface to M_WPSchemePalette and its instances */
  174. SOMEXTERN struct M_WPSchemePaletteClassDataStructure {
  175.     SOMClass *classObject;
  176. } M_WPSchemePaletteClassData;
  177.  
  178. /*
  179.  * -- Typedefs for Procedures that support M_WPSchemePalette Methods
  180.  */
  181. extern "C" {
  182. }
  183.  
  184.  
  185. #endif /* M_WPSchemePalette_API */
  186.  
  187.  
  188. /*
  189.  * -- The C++ Wrapper Class for M_WPSchemePalette
  190.  */
  191. class M_WPSchemePalette : public M_WPPalette
  192. {
  193. public:
  194.  
  195. void *operator new(size_t size)
  196. {
  197.    (void) size;
  198.    if (!M_WPSchemePaletteClassData.classObject) 
  199.       M_WPSchemePaletteNewClass(M_WPSchemePalette_MajorVersion,M_WPSchemePalette_MinorVersion);
  200.    return (void *)
  201.       ((somTD_SOMClass_somNew)
  202.       somResolve(SOM_TestCls((SOMAny *)(M_WPSchemePaletteClassData.classObject),
  203.                              SOMClassClassData.classObject),
  204.                  SOMClassClassData.somNew))
  205.          ((SOMClass*)(M_WPSchemePaletteClassData.classObject));
  206. }
  207.  
  208. void operator delete(void * obj)
  209. {
  210.    ((SOMObject *)obj)->somFree();
  211. }
  212.  
  213.  
  214. };   /* M_WPSchemePalette */
  215.  
  216.  
  217.  
  218. #endif       /* wpscheme_mxh */
  219.