home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / odtlktv4.zip / ODTLKT / TOOLKIT / IDL / WPPALET.IDL < prev    next >
Text File  |  1995-11-07  |  7KB  |  237 lines

  1.  
  2. //  Module Header
  3. //
  4. //  Module Name: WPPALET
  5. //
  6. //  OS/2 Presentation Manager Workplace class definitions
  7. //
  8. //  Copyright (c) International Business Machines Corporation 1991, 1992
  9. //
  10.  
  11. #ifndef wppalet_idl
  12. #define wppalet_idl
  13.  
  14. #include "wpabs.idl"
  15. #include <somcls.idl>
  16.  
  17. interface M_WPPalette;
  18.  
  19. interface WPPalette : WPAbstract
  20.  
  21. {
  22.   void wpPaintCell(in PCELL pCell,
  23.                    in HPS hps,
  24.                    in PRECTL prcl,
  25.                    in BOOL fHilite);
  26.  
  27.   BOOL wpSetupCell(in PVOID pCellData,
  28.                    in ULONG cb,
  29.                    in ULONG x,
  30.                    in ULONG y);
  31.  
  32.   BOOL wpRedrawCell(in PCELL pCell);
  33.  
  34.   BOOL wpQueryPaletteInfo(in PPALINFO pPalInfo);
  35.  
  36.   BOOL wpSetPaletteInfo(in PPALINFO pPalInfo);
  37.  
  38.   BOOL wpEditCell(in PCELL pCell,
  39.                   in HWND hwndPal);
  40.  
  41.   BOOL wpDragCell(in PCELL pCell,
  42.                   in HWND hwndPal,
  43.                   in PPOINTL ptlDrag);
  44.  
  45.   ULONG wpQueryPaletteHelp();
  46.  
  47.   void wpSelectCell(in HWND hwndPal,
  48.                     in PCELL pCell);
  49.  
  50.   void wpPaintPalette(in HPS hps,
  51.                       in PRECTL prcl);
  52.  
  53.   BOOL wpInitCellStructs();
  54.  
  55.   BOOL wpSaveCellData(in PCELL pCell,                           
  56.                       in ULONG ulIndex);
  57.  
  58.   BOOL wpRestoreCellData(inout PCELL pCell,                    
  59.                          in ULONG ulIndex,
  60.                          in ULONG ulCellSize);
  61.  
  62.  
  63. #ifdef __SOMIDL__
  64.   implementation {
  65.  
  66.     releaseorder: wpPaintCell,wpSelectCell,wpSetupCell,wpQueryPaletteInfo,
  67.                   wpSetPaletteInfo,wpEditCell,wpDragCell,withdrawn,
  68.                   wpInitCellStructs,wpRedrawCell,wpPaintPalette,wpMouseAction,
  69.                   wpQueryPaletteHelp,wpShowPalettePointer,
  70.                   wpSaveCellData,wpRestoreCellData;             
  71.  
  72.     externalstem = wppal;
  73.     local;
  74.     externalprefix = pal_;
  75.     majorversion = 1;
  76.     minorversion = 2;
  77.     filestem = wppalet;
  78.     metaclass = M_WPPalette;
  79.     callstyle = oidl;
  80.     dllname = "wpconfig.dll";
  81.  
  82.     passthru C_h_after =  ""
  83. "      /*"
  84. "       *  Open view for the wpOpen() method"
  85. "       */"
  86. ""
  87. "      #define OPEN_PALETTE       121"
  88. ""
  89. "      /*"
  90. "       *  Palette save-restore keys"
  91. "       */"
  92. ""
  93. "      #define IDKEY_PALXCELLCOUNT      1000"
  94. "      #define IDKEY_PALYCELLCOUNT      1001"
  95. "      #define IDKEY_PALXCELLWIDTH      1002"
  96. "      #define IDKEY_PALYCELLHEIGHT     1003"
  97. "      #define IDKEY_PALXGAP            1004"
  98. "      #define IDKEY_PALYGAP            1005"
  99. "      #define IDKEY_PALSCREENSIZEX     1006"
  100. "      #define IDKEY_PALSCREENSIZEY     1007"
  101. "      #define IDKEY_PALCELLDATA_FIRST  1050"
  102. ""
  103. "      /*"
  104. "       *  Default palette information"
  105. "       */"
  106. ""
  107. "      #define DEF_XCELLCOUNT      13                                           //jrb79998"
  108. "      #define DEF_YCELLCOUNT      9                                            //jrb79998"
  109. ""
  110. "      /*"
  111. "       *  Variables kept for each open palette window as"
  112. "       *  a structure pointed to by the QWL_USER window"
  113. "       *  word ..."
  114. "       */"
  115. ""
  116. "      typedef struct _CELL"
  117. "      {"
  118. "         ULONG       cbData;           /* Size of the data that follows */"
  119. ""
  120. "         /* Class specific cell data follows immediately afterwards -"
  121. "          * for example the font palette would store the ASCII name of"
  122. "          * the font, and the color palette would store the RGB color"
  123. "          * of the cell."
  124. "          */"
  125. "      } CELL;"
  126. "      typedef CELL *PCELL;"
  127. ""
  128. "      typedef struct _PALINFO"
  129. "      {"
  130. "         ULONG       xCellCount;       /* Number of columns of cells */"
  131. "         ULONG       yCellCount;       /* Number of rows of cells */"
  132. "         ULONG       xCursor;          /* Cursor location (readonly) */"
  133. "         ULONG       yCursor;          /* Cursor location (readonly) */"
  134. "         ULONG       xCellWidth;       /* Width of each cell */"
  135. "         ULONG       yCellHeight;      /* Height of each cell */"
  136. "         ULONG       xGap;             /* X separation of cells */"
  137. "         ULONG       yGap;             /* Y separation of cells */"
  138. "      } PALINFO;"
  139. "      typedef PALINFO *PPALINFO;"
  140. ""
  141. "      #define SetPaletteDataPtr( hwnd, pPaletteData ) \"
  142. "           WinSetWindowULong( hwnd, QWL_USER, (ULONG)pPaletteData )"
  143. ""
  144. "      #define QueryPaletteDataPtr( hwnd ) \"
  145. "           (PPALETTEDATA)WinQueryWindowULong( hwnd, QWL_USER )"
  146. ""
  147. "      typedef struct _PALETTEDATA"
  148. "      {"
  149. "         WPFolder   *Palette;          /* Folder object for this window */"
  150. "         USEITEM     UseItem;          /* Folder object's INUSE list item */"
  151. "         VIEWITEM    ViewItem;"
  152. "         ULONG       xCursor;"
  153. "         ULONG       yCursor;"
  154. "      } PALETTEDATA;"
  155. "      typedef PALETTEDATA *PPALETTEDATA;"
  156. ""
  157. "      typedef struct _CELLSTRUCT"
  158. "      {"
  159. "         RECTL       rclCell;          /* Cell coordinates */"
  160. "         PCELL       pCell;            /* Cell data pointer */"
  161. "      } CELLSTRUCT;"
  162. "      typedef CELLSTRUCT *PCELLSTRUCT;"
  163. "      /*"
  164. "       *  Miscellaneous"
  165. "       */"
  166. ""
  167. "      #define PM_INVALIDATECELL WM_USER+1000"
  168. ""
  169. "      /* Macros that act on a PALINFO..."
  170. "       */"
  171. "      #define PALETTE_WIDTH(p)  ( p.xCellCount*(p.xCellWidth+p.xGap) )"
  172. "      #define PALETTE_HEIGHT(p) ( p.yCellCount*(p.yCellHeight+p.yGap) )"
  173. "      #define ID_PALSCROLLHORZ     8091"
  174. "      #define ID_PALSCROLLVERT     8092"
  175. ""
  176. "      /* Coordinates (these are in DIALOG UNITS)"
  177. "       */"
  178. "      #define CXBUTTON          12       /* Width of a button (with no text) */"
  179. "      #define CYBUTTON          12       /* Height of a button */"
  180. "      #define XBUTTONGAP        6"
  181. "      #define YBUTTONGAP        4"
  182. "      #define CYBUTTONAREA      (CYBUTTON + 2*YBUTTONGAP)"
  183. "      #define DEF_XCELLWIDTH    10                                             //jrb88724"
  184. "      #define DEF_YCELLHEIGHT   6                                              //jrb88724"
  185. "      #define DEF_XCELLGAP      4                                              //jrb88724"
  186. "      #define DEF_YCELLGAP      4                                              //jrb88724"
  187. ""
  188. "";
  189.  
  190.  
  191.     wpInitData: override;
  192.     wpUnInitData: override;
  193.     wpSetup: override;
  194.     wpSaveState: override;
  195.     wpRestoreState: override;
  196.     wpMenuItemSelected: override;
  197.     wpModifyPopupMenu: override;
  198.     wpFilterPopupMenu: override;
  199.     wpOpen: override;
  200.     wpMenuItemHelpSelected: override;
  201.     somDefaultInit: override;             
  202.     somDestruct:    override;             
  203.  
  204.  
  205.   };
  206. #endif /* __SOMIDL__ */
  207. };
  208.  
  209. interface M_WPPalette : M_WPAbstract
  210. {
  211.   PSZ wpclsQueryEditString();
  212.  
  213. #ifdef __SOMIDL__
  214.   implementation {
  215.  
  216.     releaseorder: wpclsQueryEditString;
  217.  
  218.     externalstem = wppal;
  219.     local;
  220.     externalprefix = palM_;
  221.     majorversion = 1;
  222.     minorversion = 2;
  223.     filestem = wppalet;
  224.     callstyle = oidl;
  225.     dllname = "wpconfig.dll";
  226.  
  227.     wpclsQueryTitle: override;
  228.     wpclsQueryStyle: override;
  229.     wpclsQueryDefaultView: override;
  230.     wpclsQueryDefaultHelp: override;
  231.  
  232.   };
  233. #endif /* __SOMIDL__ */
  234. };
  235.  
  236. #endif  /* wppalet_idl */
  237.