home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / warptlk3.zip / TOOLKIT / IDL / WPPALET.IDL < prev    next >
Text File  |  1995-08-30  |  7KB  |  198 lines

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