home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1995 November / PCWK1195.iso / inne / podstawy / os2 / nakladki / pc2v190.exe / SOURCE.ZIP / Source / WPS2PC2.csc < prev    next >
Encoding:
Text File  |  1995-05-01  |  8.3 KB  |  194 lines

  1. /***********************************************************************\
  2.  *                              WPS2PC2.c                              *
  3.  *              Copyright (C) by Stangl Roman, 1994, 1995              *
  4.  * This Code may be freely distributed, provided the Copyright isn't   *
  5.  * removed, under the conditions indicated in the documentation.       *
  6.  *                                                                     *
  7.  * WPS2PC2.C    PC/2's interface to the WPS. This WPS DLL allows you   *
  8.  *              to drag WPS objects onto, which are then converted     *
  9.  *              into a format understandable by PC/2. This newly       *
  10.  *              structure can then be dropped onto PC/2's Setup dialog *
  11.  *              to add Menuentries corresponding to the dropped WPS    *
  12.  *              objects to PC/2's Popup Menu. E.g. this allows you to  *
  13.  *              create a Menuentry that is equivalent to a WPS DOS     *
  14.  *              program object, inclusive any DOS settings.            *
  15.  *                                                                     *
  16.  * SOMObject                                                           *
  17.  *    WPObject                                                         *
  18.  *       WPAbstract                                                    *
  19.  *                                                                     *
  20. \***********************************************************************/
  21.  
  22. include         <wpabs.sc>
  23.  
  24. class:          Wps2Pc2,
  25.                 external stem   = Wps2Pc2,
  26.                 local,
  27.                 external prefix = Wps2Pc2X_,
  28.                 classprefix     = Wps2Pc2C_,
  29.                 major version   = 1,
  30.                 minor version   = 1,
  31.                 file stem       = Wps2Pc2;
  32.  
  33. parent:         WPAbstract;
  34.  
  35. passthru:       C.ph;
  36. endpassthru;
  37.  
  38. #
  39. # Pass to .ih file
  40. #
  41. passthru:       C.ih;
  42. static char RCSID[]="@(#) $Header: WPS2PC2.c Version 1.90 03,1995 $ (LBL)";
  43.  
  44. #define         _FILE_  "PC/2 - WPS2PC2.c V1.90"
  45.  
  46. #include        "PC2.h"                 /* User include files */
  47.  
  48. #define         INCL_WPCLASS
  49. #define         INCL_WPFOLDER
  50. #include        <pmwp.h>
  51.  
  52.                                         /* Menu ID for "Open->WPS 2 PC/2" */
  53. #define ID_WPS2PC2OPENMENU      (WPMENUID_USER+1)
  54.                                         /* Menuitem ID for "Open->WPS 2 PC/2" */
  55. #define ID_WPS2PC2OPEN          (WPMENUID_USER+2)
  56. #define DebugBox(title, text) \
  57.                               \
  58.            WinMessageBox(     \
  59.               HWND_DESKTOP,   \
  60.               HWND_DESKTOP,   \
  61.               (PSZ) text,     \
  62.               (PSZ) title,    \
  63.               20,             \
  64.               MB_OK | MB_INFORMATION | MB_MOVEABLE)
  65. endpassthru;
  66.  
  67. #
  68. # Pass to .h file
  69. #
  70. passthru:       C.h, after;
  71. MRESULT EXPENTRY WPS2PC2_MainWindowProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
  72. void            FillList2Listbox(WPSOBJECTLIST *pListRoot,
  73.                                  ULONG ulRecursionLevel);
  74. WPSOBJECTLIST  *ConvertObject2MenuData(WPObject *pwpObject,
  75.                                        ULONG ulRecursionLevel);
  76. PBYTE           AllocateSharedMem(void);
  77. PBYTE           GetFreeSharedMem(ULONG ulSharedMemSize);
  78. void            DeAllocateSharedMem(void);
  79. #pragma linkage(_Exception, System)
  80. ULONG           _Exception(PEXCEPTIONREPORTRECORD pExcRepRecord,
  81.                            PEXCEPTIONREGISTRATIONRECORD pExcRegRecord,
  82.                            PCONTEXTRECORD pCtxRecord,
  83.                            PVOID  pVoid);
  84. endpassthru;
  85.  
  86. #
  87. # Define instance data
  88. #
  89. data:
  90. VOID           *pVoid;                  /* Define some data to force a (dummy) GetData */
  91.  
  92. #
  93. # Define new methods
  94. #
  95. methods:
  96. /*--------------------------------------------------------------------------------------*\
  97.  * Instance override methods.                                                           *
  98. \*--------------------------------------------------------------------------------------*/
  99. override        wpDragOver;
  100. --
  101. -- OVERRIDE: wpDragOver                                                     ( ) Private
  102. --                                                                          (x) Public
  103. -- DESCRIPTION:
  104. --      Called when a WPS Object is dragged over the WPS 2 PC2 icon. Accept object if
  105. --      rendering method DRM_OBJECT and format DRF_OBJECT.
  106. --
  107. override        wpDrop;
  108. --
  109. -- OVERRIDE: wpDrop                                                         ( ) Private
  110. --                                                                          (x) Public
  111. -- DESCRIPTION:
  112. --      Called when a WPS Object was dropped over the WPS 2 PC2 icon. Query all objects
  113. --      dropped, allocate a unnamed shared memory, copy object data into and allow this
  114. --      shared memory to be dragged to PC/2, which will add Menuentries according to
  115. --      the objects dropped.
  116. --
  117.  
  118. override        wpModifyPopupMenu;
  119. --
  120. -- OVERRIDE: wpModifyPopupMenu                                              ( ) Private
  121. --                                                                          (x) Public
  122. -- DESCRIPTION:
  123. --      Overwrite to add the "Open->WPS 2 PC/2" menuitem to the "Open->" context menu.
  124. --
  125. override        wpMenuItemHelpSelected;
  126. --
  127. -- OVERRIDE: wpMenuItemHelpSelected                                         ( ) Private
  128. --                                                                          (x) Public
  129. -- DESCRIPTION:
  130. --      Called when receiving an help event from our menuitem we added to the context menu.
  131. --
  132. override        wpMenuItemSelected;
  133. --
  134. -- OVERRIDE: wpMenuItemSelected                                             ( ) Private
  135. --                                                                          (x) Public
  136. -- DESCRIPTION:
  137. --      Called when receiving an event from our menuitem we added to the context menu.
  138. --
  139. override        wpOpen;
  140. --
  141. -- OVERRIDE: wpOpen                                                         ( ) Private
  142. --                                                                          (x) Public
  143. -- DESCRIPTION:
  144. --      Called when the WPS2PC2 WPS icon gets opened via the context menu.
  145. --
  146. /*--------------------------------------------------------------------------------------*\
  147.  * Class override methods.                                                              *
  148. \*--------------------------------------------------------------------------------------*/
  149. override        wpclsQueryIconData, class;
  150. --
  151. -- OVERRIDE: wpclsQueryIconData                                             ( ) Private
  152. --                                                                          (x) Public
  153. -- DESCRIPTION:
  154. --      Called when querying the class's icon.
  155. --
  156. override        wpclsInitData, class;
  157. --
  158. -- OVERRIDE: wpclsInitData                                                  ( ) Private
  159. --                                                                          (x) Public
  160. -- DESCRIPTION:
  161. --      Called during class initalization.
  162. --
  163. override        wpclsUnInitData, class;
  164. --
  165. -- OVERRIDE: wpclsUnInitData                                                ( ) Private
  166. --                                                                          (x) Public
  167. -- DESCRIPTION:
  168. --      Called during class termination.
  169. --
  170. override        wpclsQueryDefaultHelp, class;
  171. --
  172. -- OVERRIDE: wpclsQueryDefaultHelp                                          ( ) Private
  173. --                                                                          (x) Public
  174. -- DESCRIPTION:
  175. --      Add default halp panels for WPS2PC2.
  176. --
  177. override        wpclsQueryDefaultView, class;
  178. --
  179. -- OVERRIDE: wpclsQueryDefaultView                                          ( ) Private
  180. --                                                                          (x) Public
  181. -- DESCRIPTION:
  182. --      Returns the default view for a new instance of this object, but WPS2PC2 should
  183. --      be used only once, we just tell what the default open view is.
  184. --
  185. override        wpclsQueryStyle, class;
  186. --
  187. -- OVERRIDE: wpclsQueryStyle                                                ( ) Private
  188. --                                                                          (x) Public
  189. -- DESCRIPTION:
  190. --      Returns the default style, used to inhibit creation of shadows, copies or
  191. --      templates because WPS 2 PC/2 supports only one instance systemwide.
  192. --
  193.  
  194.