home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / cset21v5.zip / TOOLKT21 / CPLUS / OS2H / WPPALET.XH < prev    next >
Text File  |  1993-05-03  |  11KB  |  397 lines

  1.  
  2. /*
  3.  * This file was generated by the SOM Compiler.
  4.  * FileName: wppalet.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: WPPALET
  15.  * 
  16.  *  OS/2 Presentation Manager Workplace class definitions
  17.  * 
  18.  *  Copyright (c) International Business Machines Corporation 1991, 1992
  19.  * 
  20.  */
  21.  
  22. #ifndef wppalet_xh
  23. #define wppalet_xh
  24. class WPPalette;
  25.  
  26. #define WPPalette_MajorVersion 1
  27. #define WPPalette_MinorVersion 2
  28.  
  29. /* C++ som defs */
  30. #include <somcls.xh>
  31.  
  32. /* C++ parent def */
  33. #ifndef wpabs_xh
  34. #include "wpabs.xh"
  35. #endif
  36.  
  37. /*
  38.  * Passthru lines: File: "C.xh", "after"
  39.  */
  40.  
  41.       /*
  42.        *  Open view for the wpOpen() method
  43.        */
  44.  
  45.       #define OPEN_PALETTE       121
  46.  
  47.       /*
  48.        *  Palette save-restore keys
  49.        */
  50.  
  51.       #define IDKEY_PALXCELLCOUNT      1000
  52.       #define IDKEY_PALYCELLCOUNT      1001
  53.       #define IDKEY_PALXCELLWIDTH      1002
  54.       #define IDKEY_PALYCELLHEIGHT     1003
  55.       #define IDKEY_PALXGAP            1004
  56.       #define IDKEY_PALYGAP            1005
  57.       #define IDKEY_PALSCREENSIZEX     1006
  58.       #define IDKEY_PALSCREENSIZEY     1007
  59.       #define IDKEY_PALCELLDATA_FIRST  1050
  60.  
  61.       /*
  62.        *  Default palette information
  63.        */
  64.  
  65.       #define DEF_XCELLCOUNT      6
  66.       #define DEF_YCELLCOUNT      5
  67.  
  68.       /*
  69.        *  Variables kept for each open palette window as
  70.        *  a structure pointed to by the QWL_USER window
  71.        *  word ...
  72.        */
  73.  
  74.       typedef struct _CELL
  75.       {
  76.          ULONG       cbData;           /* Size of the data that follows */
  77.  
  78.          /* Class specific cell data follows immediately afterwards -
  79.           * for example the font palette would store the ASCII name of
  80.           * the font, and the color palette would store the RGB color
  81.           * of the cell.
  82.           */
  83.       } CELL;
  84.       typedef CELL *PCELL;
  85.  
  86.       typedef struct _PALINFO
  87.       {
  88.          ULONG       xCellCount;       /* Number of columns of cells */
  89.          ULONG       yCellCount;       /* Number of rows of cells */
  90.          ULONG       xCursor;          /* Cursor location (readonly) */
  91.          ULONG       yCursor;          /* Cursor location (readonly) */
  92.          ULONG       xCellWidth;       /* Width of each cell */
  93.          ULONG       yCellHeight;      /* Height of each cell */
  94.          ULONG       xGap;             /* X separation of cells */
  95.          ULONG       yGap;             /* Y separation of cells */
  96.       } PALINFO;
  97.       typedef PALINFO *PPALINFO;
  98.  
  99.       #define SetPaletteDataPtr( hwnd, pPaletteData ) \
  100.            WinSetWindowULong( hwnd, QWL_USER, (ULONG)pPaletteData )
  101.  
  102.       #define QueryPaletteDataPtr( hwnd ) \
  103.            (PPALETTEDATA)WinQueryWindowULong( hwnd, QWL_USER )
  104.  
  105.       typedef struct _PALETTEDATA
  106.       {
  107.          WPFolder   *Palette;          /* Folder object for this window */
  108.          USEITEM     UseItem;          /* Folder object's INUSE list item */
  109.          VIEWITEM    ViewItem;
  110.          ULONG       xCursor;
  111.          ULONG       yCursor;
  112.       } PALETTEDATA;
  113.       typedef PALETTEDATA *PPALETTEDATA;
  114.  
  115.       typedef struct _CELLSTRUCT
  116.       {
  117.          RECTL       rclCell;          /* Cell coordinates */
  118.          PCELL       pCell;            /* Cell data pointer */
  119.       } CELLSTRUCT;
  120.       typedef CELLSTRUCT *PCELLSTRUCT;
  121.       /*
  122.        *  Miscellaneous
  123.        */
  124.  
  125.       #define PM_INVALIDATECELL WM_USER+1000
  126.  
  127.       /* Macros that act on a PALINFO...
  128.        */
  129.       #define PALETTE_WIDTH(p)  ( p.xCellCount*(p.xCellWidth+p.xGap) )
  130.       #define PALETTE_HEIGHT(p) ( p.yCellCount*(p.yCellHeight+p.yGap) )
  131.       #define ID_PALSCROLLHORZ     8091
  132.       #define ID_PALSCROLLVERT     8092
  133.  
  134.       /* Coordinates (these are in DIALOG UNITS)
  135.        */
  136.       #define CXBUTTON          12       /* Width of a button (with no text) */
  137.       #define CYBUTTON          12       /* Height of a button */
  138.       #define XBUTTONGAP        6
  139.       #define YBUTTONGAP        4
  140.       #define CYBUTTONAREA      (CYBUTTON + 2*YBUTTONGAP)
  141.       #define DEF_XCELLWIDTH    22
  142.       #define DEF_YCELLHEIGHT   16
  143.       #define DEF_XCELLGAP      4
  144.       #define DEF_YCELLGAP      4
  145.  
  146.  
  147.  
  148. #ifndef WPPalette_API
  149. #define WPPalette_API
  150. /*
  151.  * The Class API
  152.  */
  153.  
  154. /* A procedure to create the WPPalette Class */
  155. SOMEXTERN SOMClass * SOMLINK WPPaletteNewClass(
  156.         integer4 majorVersion,
  157.         integer4 minorVersion);
  158.  
  159. /* A macro to return the WPPalette class object */
  160. class M_WPPalette;
  161. #define _WPPalette ((M_WPPalette*)WPPaletteClassData.classObject)
  162.  
  163. /* The static interface to WPPalette and its instances */
  164. SOMEXTERN struct WPPaletteClassDataStructure {
  165.     SOMClass *classObject;
  166.     somMToken wpPaintCell;
  167.     somMToken wpSelectCell;
  168.     somMToken wpSetupCell;
  169.     somMToken wpQueryPaletteInfo;
  170.     somMToken wpSetPaletteInfo;
  171.     somMToken wpEditCell;
  172.     somMToken wpDragCell;
  173.     somMToken withdrawn;
  174.     somMToken wpInitCellStructs;
  175.     somMToken wpRedrawCell;
  176.     somMToken wpPaintPalette;
  177.     somMToken wpMouseAction;
  178.     somMToken wpQueryPaletteHelp;
  179.     somMToken wpShowPalettePointer;
  180. } WPPaletteClassData;
  181.  
  182. /*
  183.  * -- Typedefs for Procedures that support WPPalette Methods
  184.  */
  185. extern "C" {
  186. typedef VOID    (SOMLINK *somTD_WPPalette_wpPaintCell)(WPPalette *somSelf,PCELL pCell,HPS hps,PRECTL prcl,BOOL fHilite);
  187. typedef BOOL    (SOMLINK *somTD_WPPalette_wpSetupCell)(WPPalette *somSelf,PVOID pCellData,ULONG cb,ULONG x,ULONG y);
  188. typedef BOOL    (SOMLINK *somTD_WPPalette_wpRedrawCell)(WPPalette *somSelf,PCELL pCell);
  189. typedef BOOL    (SOMLINK *somTD_WPPalette_wpQueryPaletteInfo)(WPPalette *somSelf,PPALINFO pPalInfo);
  190. typedef BOOL    (SOMLINK *somTD_WPPalette_wpSetPaletteInfo)(WPPalette *somSelf,PPALINFO pPalInfo);
  191. typedef BOOL    (SOMLINK *somTD_WPPalette_wpEditCell)(WPPalette *somSelf,PCELL pCell,HWND hwndPal);
  192. typedef BOOL    (SOMLINK *somTD_WPPalette_wpDragCell)(WPPalette *somSelf,PCELL pCell,HWND hwndPal,PPOINTL ptlDrag);
  193. typedef ULONG    (SOMLINK *somTD_WPPalette_wpQueryPaletteHelp)(WPPalette *somSelf);
  194. }
  195.  
  196.  
  197. #endif /* WPPalette_API */
  198.  
  199.  
  200. /*
  201.  * -- The C++ Wrapper Class for WPPalette
  202.  */
  203. class WPPalette : public WPAbstract
  204. {
  205. public:
  206.  
  207. void *operator new(size_t size)
  208. {
  209.    (void) size;
  210.    if (!WPPaletteClassData.classObject) 
  211.       WPPaletteNewClass(WPPalette_MajorVersion,WPPalette_MinorVersion);
  212.    return (void *)
  213.       ((somTD_SOMClass_somNew)
  214.       somResolve(SOM_TestCls((SOMAny *)(WPPaletteClassData.classObject),
  215.                              SOMClassClassData.classObject),
  216.                  SOMClassClassData.somNew))
  217.          ((SOMClass*)(WPPaletteClassData.classObject));
  218. }
  219.  
  220. void operator delete(void * obj)
  221. {
  222.    ((SOMObject *)obj)->somFree();
  223. }
  224.  
  225. /* public method: wpPaintCell */
  226. VOID    wpPaintCell(PCELL pCell,
  227.         HPS hps,
  228.         PRECTL prcl,
  229.         BOOL fHilite)
  230. {
  231.    SOM_Resolve((SOMAny *)this,WPPalette,wpPaintCell)
  232.     (this,pCell,hps,prcl,fHilite);
  233. }
  234.  
  235.  
  236. /* public method: wpSetupCell */
  237. BOOL    wpSetupCell(PVOID pCellData,
  238.         ULONG cb,
  239.         ULONG x,
  240.         ULONG y)
  241. {
  242.    return (BOOL) SOM_Resolve((SOMAny *)this,WPPalette,wpSetupCell)
  243.     (this,pCellData,cb,x,y);
  244. }
  245.  
  246.  
  247. /* public method: wpRedrawCell */
  248. BOOL    wpRedrawCell(PCELL pCell)
  249. {
  250.    return (BOOL) SOM_Resolve((SOMAny *)this,WPPalette,wpRedrawCell)
  251.     (this,pCell);
  252. }
  253.  
  254.  
  255. /* public method: wpQueryPaletteInfo */
  256. BOOL    wpQueryPaletteInfo(PPALINFO pPalInfo)
  257. {
  258.    return (BOOL) SOM_Resolve((SOMAny *)this,WPPalette,wpQueryPaletteInfo)
  259.     (this,pPalInfo);
  260. }
  261.  
  262.  
  263. /* public method: wpSetPaletteInfo */
  264. BOOL    wpSetPaletteInfo(PPALINFO pPalInfo)
  265. {
  266.    return (BOOL) SOM_Resolve((SOMAny *)this,WPPalette,wpSetPaletteInfo)
  267.     (this,pPalInfo);
  268. }
  269.  
  270.  
  271. /* public method: wpEditCell */
  272. BOOL    wpEditCell(PCELL pCell,
  273.         HWND hwndPal)
  274. {
  275.    return (BOOL) SOM_Resolve((SOMAny *)this,WPPalette,wpEditCell)
  276.     (this,pCell,hwndPal);
  277. }
  278.  
  279.  
  280. /* public method: wpDragCell */
  281. BOOL    wpDragCell(PCELL pCell,
  282.         HWND hwndPal,
  283.         PPOINTL ptlDrag)
  284. {
  285.    return (BOOL) SOM_Resolve((SOMAny *)this,WPPalette,wpDragCell)
  286.     (this,pCell,hwndPal,ptlDrag);
  287. }
  288.  
  289.  
  290. /* public method: wpQueryPaletteHelp */
  291. ULONG    wpQueryPaletteHelp()
  292. {
  293.    return (ULONG) SOM_Resolve((SOMAny *)this,WPPalette,wpQueryPaletteHelp)
  294.     (this);
  295. }
  296.  
  297.  
  298.  
  299. };   /* WPPalette */
  300.  
  301.  
  302.  
  303. #endif       /* wppalet_xh */
  304.  
  305. /*
  306.  * This file was generated by the SOM Compiler.
  307.  * FileName: wppalet.xh.
  308.  * Generated using:
  309.  *     SOM Precompiler spc: 1.22
  310.  *     SOM Emitter emitxh: 1.11
  311.  */
  312. #ifndef wppalet_mxh
  313. #define wppalet_mxh
  314. class M_WPPalette;
  315.  
  316. #define M_WPPalette_MajorVersion 1
  317. #define M_WPPalette_MinorVersion 2
  318.  
  319. /* C++ som defs */
  320. #include <somcls.xh>
  321.  
  322. /* C++ parent def */
  323. #ifndef wpabs_xh
  324. #include "wpabs.xh"
  325. #endif
  326.  
  327. #ifndef M_WPPalette_API
  328. #define M_WPPalette_API
  329. /*
  330.  * The Class API
  331.  */
  332.  
  333. /* A procedure to create the M_WPPalette Class */
  334. SOMEXTERN SOMClass * SOMLINK M_WPPaletteNewClass(
  335.         integer4 majorVersion,
  336.         integer4 minorVersion);
  337.  
  338. /* A macro to return the M_WPPalette class object */
  339. #define _M_WPPalette ((SOMClass*)M_WPPaletteClassData.classObject)
  340.  
  341. /* The static interface to M_WPPalette and its instances */
  342. SOMEXTERN struct M_WPPaletteClassDataStructure {
  343.     SOMClass *classObject;
  344.     somMToken wpclsQueryEditString;
  345. } M_WPPaletteClassData;
  346.  
  347. /*
  348.  * -- Typedefs for Procedures that support M_WPPalette Methods
  349.  */
  350. extern "C" {
  351. typedef PSZ    (SOMLINK *somTD_M_WPPalette_wpclsQueryEditString)(M_WPPalette *somSelf);
  352. }
  353.  
  354.  
  355. #endif /* M_WPPalette_API */
  356.  
  357.  
  358. /*
  359.  * -- The C++ Wrapper Class for M_WPPalette
  360.  */
  361. class M_WPPalette : public M_WPAbstract
  362. {
  363. public:
  364.  
  365. void *operator new(size_t size)
  366. {
  367.    (void) size;
  368.    if (!M_WPPaletteClassData.classObject) 
  369.       M_WPPaletteNewClass(M_WPPalette_MajorVersion,M_WPPalette_MinorVersion);
  370.    return (void *)
  371.       ((somTD_SOMClass_somNew)
  372.       somResolve(SOM_TestCls((SOMAny *)(M_WPPaletteClassData.classObject),
  373.                              SOMClassClassData.classObject),
  374.                  SOMClassClassData.somNew))
  375.          ((SOMClass*)(M_WPPaletteClassData.classObject));
  376. }
  377.  
  378. void operator delete(void * obj)
  379. {
  380.    ((SOMObject *)obj)->somFree();
  381. }
  382.  
  383. /* public method: wpclsQueryEditString */
  384. PSZ    wpclsQueryEditString()
  385. {
  386.    return (PSZ) SOM_Resolve((SOMAny *)this,M_WPPalette,wpclsQueryEditString)
  387.     (this);
  388. }
  389.  
  390.  
  391.  
  392. };   /* M_WPPalette */
  393.  
  394.  
  395.  
  396. #endif       /* wppalet_mxh */
  397.