home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / tolkit45.zip / os2tk45 / idl / wppalet.idl < prev    next >
Text File  |  1999-03-15  |  7KB  |  243 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.   BOOL wpFreeCellData(in PCELL pCell,                           
  63.                       in ULONG ulIndex);
  64.  
  65.  
  66. #ifdef __SOMIDL__
  67.   implementation {
  68.  
  69.     releaseorder: wpPaintCell,wpSelectCell,wpSetupCell,wpQueryPaletteInfo,
  70.                   wpSetPaletteInfo,wpEditCell,wpDragCell,withdrawn,
  71.                   wpInitCellStructs,wpRedrawCell,wpPaintPalette,
  72.                   wpPalettePrivate1,
  73.                   wpQueryPaletteHelp,
  74.                   wpPalettePrivate2,
  75.                   wpSaveCellData,wpRestoreCellData,             
  76.                   wpFreeCellData;                               
  77.  
  78.     externalstem = wppal;
  79.     local;
  80.     externalprefix = pal_;
  81.     majorversion = 1;
  82.     minorversion = 2;
  83.     filestem = wppalet;
  84.     metaclass = M_WPPalette;
  85.     callstyle = oidl;
  86.     dllname = "wpconfig.dll";
  87.  
  88.     passthru C_h_after =  ""
  89. "      /*"
  90. "       *  Open view for the wpOpen() method"
  91. "       */"
  92. ""
  93. "      #define OPEN_PALETTE       121"
  94. ""
  95. "      /*"
  96. "       *  Palette save-restore keys"
  97. "       */"
  98. ""
  99. "      #define IDKEY_PALXCELLCOUNT      1000"
  100. "      #define IDKEY_PALYCELLCOUNT      1001"
  101. "      #define IDKEY_PALXCELLWIDTH      1002"
  102. "      #define IDKEY_PALYCELLHEIGHT     1003"
  103. "      #define IDKEY_PALXGAP            1004"
  104. "      #define IDKEY_PALYGAP            1005"
  105. "      #define IDKEY_PALSCREENSIZEX     1006"
  106. "      #define IDKEY_PALSCREENSIZEY     1007"
  107. "      #define IDKEY_PALCELLDATA_FIRST  1050"
  108. ""
  109. "      /*"
  110. "       *  Default palette information"
  111. "       */"
  112. ""
  113. "      #define DEF_XCELLCOUNT      13" 
  114. "      #define DEF_YCELLCOUNT      9"  
  115. ""
  116. "      /*"
  117. "       *  Variables kept for each open palette window as"
  118. "       *  a structure pointed to by the QWL_USER window"
  119. "       *  word ..."
  120. "       */"
  121. ""
  122. "      typedef struct _CELL"
  123. "      {"
  124. "         ULONG       cbData;           /* Size of the data that follows */"
  125. ""
  126. "         /* Class specific cell data follows immediately afterwards -"
  127. "          * for example the font palette would store the ASCII name of"
  128. "          * the font, and the color palette would store the RGB color"
  129. "          * of the cell."
  130. "          */"
  131. "      } CELL;"
  132. "      typedef CELL *PCELL;"
  133. ""
  134. "      typedef struct _PALINFO"
  135. "      {"
  136. "         ULONG       xCellCount;       /* Number of columns of cells */"
  137. "         ULONG       yCellCount;       /* Number of rows of cells */"
  138. "         ULONG       xCursor;          /* Cursor location (readonly) */"
  139. "         ULONG       yCursor;          /* Cursor location (readonly) */"
  140. "         ULONG       xCellWidth;       /* Width of each cell */"
  141. "         ULONG       yCellHeight;      /* Height of each cell */"
  142. "         ULONG       xGap;             /* X separation of cells */"
  143. "         ULONG       yGap;             /* Y separation of cells */"
  144. "      } PALINFO;"
  145. "      typedef PALINFO *PPALINFO;"
  146. ""
  147. "      #define SetPaletteDataPtr( hwnd, pPaletteData ) \"
  148. "           WinSetWindowULong( hwnd, QWL_USER, (ULONG)pPaletteData )"
  149. ""
  150. "      #define QueryPaletteDataPtr( hwnd ) \"
  151. "           (PPALETTEDATA)WinQueryWindowULong( hwnd, QWL_USER )"
  152. ""
  153. "      typedef struct _PALETTEDATA"
  154. "      {"
  155. "         WPFolder   *Palette;          /* Folder object for this window */"
  156. "         USEITEM     UseItem;          /* Folder object's INUSE list item */"
  157. "         VIEWITEM    ViewItem;"
  158. "         ULONG       xCursor;"
  159. "         ULONG       yCursor;"
  160. "      } PALETTEDATA;"
  161. "      typedef PALETTEDATA *PPALETTEDATA;"
  162. ""
  163. "      typedef struct _CELLSTRUCT"
  164. "      {"
  165. "         RECTL       rclCell;          /* Cell coordinates */"
  166. "         PCELL       pCell;            /* Cell data pointer */"
  167. "      } CELLSTRUCT;"
  168. "      typedef CELLSTRUCT *PCELLSTRUCT;"
  169. "      /*"
  170. "       *  Miscellaneous"
  171. "       */"
  172. ""
  173. "      #define PM_INVALIDATECELL WM_USER+1000"
  174. ""
  175. "      /* Macros that act on a PALINFO..."
  176. "       */"
  177. "      #define PALETTE_WIDTH(p)  ( p.xCellCount*(p.xCellWidth+p.xGap) )"
  178. "      #define PALETTE_HEIGHT(p) ( p.yCellCount*(p.yCellHeight+p.yGap) )"
  179. "      #define ID_PALSCROLLHORZ     8091"
  180. "      #define ID_PALSCROLLVERT     8092"
  181. ""
  182. "      /* Coordinates (these are in DIALOG UNITS)"
  183. "       */"
  184. "      #define CXBUTTON          12       /* Width of a button (with no text) */"
  185. "      #define CYBUTTON          12       /* Height of a button */"
  186. "      #define XBUTTONGAP        6"
  187. "      #define YBUTTONGAP        4"
  188. "      #define CYBUTTONAREA      (CYBUTTON + 2*YBUTTONGAP)"
  189. "      #define DEF_XCELLWIDTH    10" 
  190. "      #define DEF_YCELLHEIGHT   6"  
  191. "      #define DEF_XCELLGAP      4"  
  192. "      #define DEF_YCELLGAP      4"  
  193. ""
  194. "";
  195.  
  196.  
  197.     wpInitData: override;
  198.     wpUnInitData: override;
  199.     wpSetup: override;
  200.     wpSaveState: override;
  201.     wpRestoreState: override;
  202.     wpMenuItemSelected: override;
  203.     wpOpen: override;
  204.     wpMenuItemHelpSelected: override;
  205.     wpFilterMenu: override;                                                     
  206.     wpModifyMenu: override;                                                     
  207.     somDefaultInit: override;             
  208.     somDestruct:    override;             
  209.  
  210.  
  211.   };
  212. #endif /* __SOMIDL__ */
  213. };
  214.  
  215. interface M_WPPalette : M_WPAbstract
  216. {
  217.   PSZ wpclsQueryEditString();
  218.  
  219. #ifdef __SOMIDL__
  220.   implementation {
  221.  
  222.     releaseorder: wpclsQueryEditString;
  223.  
  224.     externalstem = wppal;
  225.     local;
  226.     externalprefix = palM_;
  227.     majorversion = 1;
  228.     minorversion = 2;
  229.     filestem = wppalet;
  230.     callstyle = oidl;
  231.     dllname = "wpconfig.dll";
  232.  
  233.     wpclsQueryTitle: override;
  234.     wpclsQueryStyle: override;
  235.     wpclsQueryDefaultView: override;
  236.     wpclsQueryDefaultHelp: override;
  237.  
  238.   };
  239. #endif /* __SOMIDL__ */
  240. };
  241.  
  242. #endif  /* wppalet_idl */
  243.