home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / BLACKH.ZIP / BlackHol.ih < prev    next >
Text File  |  1992-11-19  |  12KB  |  444 lines

  1.  
  2. /*
  3.  * This file was generated by the SOM Compiler.
  4.  * FileName: BlackHol.ih.
  5.  * Generated using:
  6.  *     SOM Precompiler spc: 1.22
  7.  *     SOM Emitter emitih: 1.59
  8.  */
  9.  
  10. /*
  11.  * 
  12.  * 
  13.  *   DMan.CSC - Workplace Shell test
  14.  * ────────────────────────────────────────────────────────────────────┐
  15.  * │  Greg's Black Hole - anything you put in will disappear forever...  │
  16.  * │                                                                     │
  17.  * └──────────────────┐   Gregory Czaja, CONT00 @ LEXVMK, November 1992  │
  18.  *                    └─────────────────────────────────────────────────
  19.  */
  20.  
  21.  
  22. #ifndef BlackHol_ih
  23. #define BlackHol_ih
  24.  
  25.  
  26. /*
  27.  * Passthru lines: File: "C.ih", "before"
  28.  */
  29. /* implementation defs for BlackHole */
  30.  
  31.  /* PM definitions */
  32.    #define INCL_WIN
  33.    #define INCL_DOS
  34.    #define INCL_GPIBITMAPS
  35.    #include <os2.h>
  36.  
  37.    #define INCL_WPCLASS
  38.    #define INCL_WPFOLDER
  39.    #include <pmwp.h>
  40.  
  41.  /* internal definitions */
  42.    #define MYSTR_CLASSNAME      "BlackHole"
  43.  
  44. #include "BlackHol.h"
  45.  
  46. /*
  47.  * Set the scope of methods functions
  48.  */
  49. #ifndef SOM_Scope
  50. #ifdef __cplusplus
  51. #define SOM_Scope extern "C"
  52. #else
  53. #define SOM_Scope extern
  54. #endif
  55. #endif
  56.  
  57. #ifndef SOM_CurrentClass
  58. #define SOM_CurrentClass BlackHoleCClassData.parentMtab
  59. #endif
  60.  
  61. #define BlackHole_MaxNoMethods 0
  62.  
  63. /*
  64.  * Instance data
  65.  */
  66. typedef struct {
  67.     PSZ mytext;
  68. } BlackHoleData;
  69.  
  70. /*
  71.  * Instance variable access macros
  72.  */
  73. #define _mytext (somThis->mytext)
  74.  
  75. /*
  76.  * Getdata macro
  77.  */
  78. #define BlackHoleGetData(somSelf) \
  79.     ((BlackHoleData *) \
  80.         SOM_DataResolve(somSelf, BlackHoleCClassData.instanceDataToken))
  81.  
  82. /*
  83.  * Trace/Debug macro
  84.  */
  85. #ifndef BlackHoleMethodDebug
  86. #define BlackHoleMethodDebug(c,m) SOMMethodDebug(c,m)
  87. #endif
  88.  
  89. /*
  90.  * Begin stuff that only goes in the primary file
  91.  */
  92. #ifdef BlackHole_Class_Source
  93.  
  94. /*
  95.  * Current class macros for Instance and Meta classes.
  96.  */
  97. #undef SOMMeta
  98. #define SOMMeta M_BlackHoleCClassData.parentMtab
  99. #undef SOMInstance
  100. #define SOMInstance BlackHoleCClassData.parentMtab
  101.  
  102. #ifndef M_BlackHole_Class_Source
  103. #define M_BlackHole_Class_Source
  104. #endif    /* M_BlackHole_Class_Source */
  105.  
  106. /*
  107.  * Generate the Apply Stubs.
  108.  */
  109.  
  110. /*
  111.  * Overridden method: wpDragOver
  112.  */
  113. #pragma linkage(BlackHolX_wpDragOver, system)
  114. SOM_Scope MRESULT   SOMLINK BlackHolX_wpDragOver(BlackHole *somSelf,
  115.         HWND hwndCnr,
  116.         PDRAGINFO pdrgInfo);
  117. #ifndef parent_wpDragOver
  118. static char *somMN_wpDragOver = "wpDragOver";
  119. static somId somId_wpDragOver = &somMN_wpDragOver;
  120. #define parent_wpDragOver(somSelf,hwndCnr,pdrgInfo) \
  121.     ((SOM_ParentResolveE(WPObject, SOM_CurrentClass, wpDragOver)) \
  122.      (somSelf,hwndCnr,pdrgInfo))
  123. #endif
  124. #define BlackHoleParent_wpDragOver parent_wpDragOver
  125.  
  126. /*
  127.  * Overridden method: wpDrop
  128.  */
  129. #pragma linkage(BlackHolX_wpDrop, system)
  130. SOM_Scope MRESULT   SOMLINK BlackHolX_wpDrop(BlackHole *somSelf,
  131.         HWND hwndCnr,
  132.         PDRAGINFO pdrgInfo,
  133.         PDRAGITEM pdrgItem);
  134. #ifndef parent_wpDrop
  135. static char *somMN_wpDrop = "wpDrop";
  136. static somId somId_wpDrop = &somMN_wpDrop;
  137. #define parent_wpDrop(somSelf,hwndCnr,pdrgInfo,pdrgItem) \
  138.     ((SOM_ParentResolveE(WPObject, SOM_CurrentClass, wpDrop)) \
  139.      (somSelf,hwndCnr,pdrgInfo,pdrgItem))
  140. #endif
  141. #define BlackHoleParent_wpDrop parent_wpDrop
  142.  
  143. /*
  144.  * Temporary class data structure used only in class creation
  145.  */
  146. static somClassDataStructure BlackHoletempClassData;
  147.  
  148. /*
  149.  * Initialize the class data structure
  150.  */
  151. struct BlackHoleClassDataStructure BlackHoleClassData = {(SOMAny *) NULL};
  152.  
  153. /*
  154.  * Define the C class data structure
  155.  */
  156. struct BlackHoleCClassDataStructure BlackHoleCClassData = {(somMethodTab *) NULL};
  157.  
  158. /*
  159.  * Routines to create the class object
  160.  */
  161.  
  162. /*
  163.  * Declare the Override Methods table.
  164.  */
  165. static somOverrideMethod_t BlackHoleOM[] = {
  166.     {    &somId_wpDragOver,
  167.          (somMethodProc *) BlackHolX_wpDragOver    },
  168.     {    &somId_wpDrop,
  169.          (somMethodProc *) BlackHolX_wpDrop    },
  170. };
  171.  
  172. static void BlackHolesomInitializeClass ()
  173. {
  174.     int i;
  175.     somOverrideMethod_t *omp;
  176.  
  177. /*
  178.  * Override methods.
  179.  */
  180.     for (omp = BlackHoleOM, i = 0; i < 2; omp++, i++)
  181.         _somOverrideSMethod (BlackHoletempClassData.classObject,
  182.             *(omp->methodId), omp->method);
  183.  
  184. }
  185.  
  186. #pragma linkage(BlackHolesomCreateClass, system)
  187. static void SOMLINK BlackHolesomCreateClass(SOMClass *pClsObj,
  188.                            SOMClass *mClsObj)
  189. {
  190.     BlackHoletempClassData.classObject = _somNew (mClsObj);
  191.     _somInitClass (BlackHoletempClassData.classObject,
  192.         "BlackHole",
  193.         pClsObj,
  194.         sizeof(BlackHoleData),
  195.         BlackHole_MaxNoMethods,
  196.         BlackHole_MajorVersion,
  197.         BlackHole_MinorVersion);
  198.     BlackHoleCClassData.instanceDataToken = 
  199.     _somGetInstanceToken(BlackHoletempClassData.classObject);
  200.     BlackHolesomInitializeClass();
  201.     BlackHoleCClassData.parentMtab =
  202.     _somGetPClsMtab(BlackHoletempClassData.classObject);
  203.     _somSetClassData(BlackHoletempClassData.classObject, (somClassDataStructure *)&BlackHoleClassData);
  204.     _somClassReady(BlackHoletempClassData.classObject);
  205.     /* make newly created class object visible */
  206.     BlackHoleClassData.classObject = BlackHoletempClassData.classObject;
  207. }
  208.  
  209. BlackHole * SOMLINK BlackHoleNewClass (integer4 scemajorVersion,
  210.         integer4 sceminorVersion)
  211. {
  212.     SOMClass *pClsObj;
  213.     SOMClass *mClsObj;
  214.  
  215.     /* Check the version numbers */
  216.     if (((scemajorVersion != 0) && 
  217.          (scemajorVersion != BlackHole_MajorVersion)) ||
  218.         ((sceminorVersion != 0) && 
  219.          (sceminorVersion > BlackHole_MinorVersion))) {
  220.     somPrintf("BlackHoleNewClass: Error, bad version numbers.\n");
  221.     SOM_Error(SOMERROR_BadVersion);
  222.     }
  223.     /* Don't do anything if class object is already created. */
  224.     if (BlackHoleClassData.classObject != (SOMAny *) NULL)
  225.     return(BlackHoleClassData.classObject);
  226.  
  227.     /* Make sure the environment is initialized. */
  228.     if (SOMClassMgrObject == (SOMAny *) NULL) somEnvironmentNew();
  229.     if (SOMClassMgrObject == (SOMAny *) NULL)
  230.     SOM_Error(SOMERROR_CouldNotStartup);
  231.  
  232.     /* Get the parent class object. */
  233.     WPAbstractNewClass(1,2);    /* static reference */
  234.     pClsObj = _somFindClass(SOMClassMgrObject,
  235.         SOM_IdFromString("WPAbstract"), 1, 2);
  236.     if (pClsObj == (SOMClass *) NULL)
  237.     SOM_Error(SOMERROR_NoParentClass);
  238.  
  239.     /* Explicit metaclass, so get it */ 
  240.     M_BlackHoleNewClass(0,0);    /* static reference */
  241.     mClsObj = _somFindClass(SOMClassMgrObject,
  242.         SOM_IdFromString("M_BlackHole"), 0, 0);
  243.     if (mClsObj == (SOMClass *) NULL)
  244.     SOM_Error(SOMERROR_NoMetaClass);
  245.  
  246.     somConstructClass(BlackHolesomCreateClass, pClsObj, mClsObj,
  247.              &BlackHoletempClassData);
  248.     return (BlackHoleClassData.classObject);
  249. }
  250.  
  251. #endif                   /* BlackHole_Class_Source */
  252.  
  253. #endif       /* BlackHol_ih */
  254.  
  255. /*
  256.  * This file was generated by the SOM Compiler.
  257.  * FileName: BlackHol.ih.
  258.  * Generated using:
  259.  *     SOM Precompiler spc: 1.22
  260.  *     SOM Emitter emitih: 1.59
  261.  */
  262.  
  263. #ifndef BlackHol_mih
  264. #define BlackHol_mih
  265.  
  266.  
  267. /*
  268.  * Set the scope of methods functions
  269.  */
  270. #ifndef SOM_Scope
  271. #ifdef __cplusplus
  272. #define SOM_Scope extern "C"
  273. #else
  274. #define SOM_Scope extern
  275. #endif
  276. #endif
  277.  
  278. #ifndef SOM_CurrentClass
  279. #define SOM_CurrentClass M_BlackHoleCClassData.parentMtab
  280. #endif
  281.  
  282. #define M_BlackHole_MaxNoMethods 0
  283.  
  284. /*
  285.  * Instance data
  286.  */
  287. typedef void M_BlackHoleData;
  288.  
  289. /*
  290.  * Trace/Debug macro
  291.  */
  292. #ifndef M_BlackHoleMethodDebug
  293. #define M_BlackHoleMethodDebug(c,m) SOMMethodDebug(c,m)
  294. #endif
  295.  
  296. /*
  297.  * Begin stuff that only goes in the primary file
  298.  */
  299. #ifdef M_BlackHole_Class_Source
  300.  
  301. /*
  302.  * Current class macros for Instance and Meta classes.
  303.  */
  304.  
  305. /*
  306.  * Generate the Apply Stubs.
  307.  */
  308.  
  309. /*
  310.  * Overridden method: wpclsInitData
  311.  */
  312. #pragma linkage(BlackHolC_wpclsInitData, system)
  313. SOM_Scope void   SOMLINK BlackHolC_wpclsInitData(M_BlackHole *somSelf);
  314. #ifndef parent_wpclsInitData
  315. static char *somMN_wpclsInitData = "wpclsInitData";
  316. static somId somId_wpclsInitData = &somMN_wpclsInitData;
  317. #define parent_wpclsInitData(somSelf) \
  318.     ((SOM_ParentResolveE(M_WPObject, SOM_CurrentClass, wpclsInitData)) \
  319.      (somSelf))
  320. #endif
  321. #define M_BlackHoleParent_wpclsInitData parent_wpclsInitData
  322.  
  323. /*
  324.  * Overridden method: wpclsUnInitData
  325.  */
  326. #pragma linkage(BlackHolC_wpclsUnInitData, system)
  327. SOM_Scope void   SOMLINK BlackHolC_wpclsUnInitData(M_BlackHole *somSelf);
  328. #ifndef parent_wpclsUnInitData
  329. static char *somMN_wpclsUnInitData = "wpclsUnInitData";
  330. static somId somId_wpclsUnInitData = &somMN_wpclsUnInitData;
  331. #define parent_wpclsUnInitData(somSelf) \
  332.     ((SOM_ParentResolveE(M_WPObject, SOM_CurrentClass, wpclsUnInitData)) \
  333.      (somSelf))
  334. #endif
  335. #define M_BlackHoleParent_wpclsUnInitData parent_wpclsUnInitData
  336.  
  337. /*
  338.  * Temporary class data structure used only in class creation
  339.  */
  340. static somClassDataStructure M_BlackHoletempClassData;
  341.  
  342. /*
  343.  * Initialize the class data structure
  344.  */
  345. struct M_BlackHoleClassDataStructure M_BlackHoleClassData = {(SOMAny *) NULL};
  346.  
  347. /*
  348.  * Define the C class data structure
  349.  */
  350. struct M_BlackHoleCClassDataStructure M_BlackHoleCClassData = {(somMethodTab *) NULL};
  351.  
  352. /*
  353.  * Routines to create the class object
  354.  */
  355.  
  356. /*
  357.  * Declare the Override Methods table.
  358.  */
  359. static somOverrideMethod_t M_BlackHoleOM[] = {
  360.     {    &somId_wpclsInitData,
  361.          (somMethodProc *) BlackHolC_wpclsInitData    },
  362.     {    &somId_wpclsUnInitData,
  363.          (somMethodProc *) BlackHolC_wpclsUnInitData    },
  364. };
  365.  
  366. static void M_BlackHolesomInitializeClass ()
  367. {
  368.     int i;
  369.     somOverrideMethod_t *omp;
  370.  
  371. /*
  372.  * Override methods.
  373.  */
  374.     for (omp = M_BlackHoleOM, i = 0; i < 2; omp++, i++)
  375.         _somOverrideSMethod (M_BlackHoletempClassData.classObject,
  376.             *(omp->methodId), omp->method);
  377.  
  378. }
  379.  
  380. #pragma linkage(M_BlackHolesomCreateClass, system)
  381. static void SOMLINK M_BlackHolesomCreateClass(SOMClass *pClsObj,
  382.                            SOMClass *mClsObj)
  383. {
  384.     M_BlackHoletempClassData.classObject = _somNew (mClsObj);
  385.     _somInitClass (M_BlackHoletempClassData.classObject,
  386.         "M_BlackHole",
  387.         pClsObj,
  388.         0,
  389.         M_BlackHole_MaxNoMethods,
  390.         M_BlackHole_MajorVersion,
  391.         M_BlackHole_MinorVersion);
  392.     M_BlackHoleCClassData.instanceDataToken = 
  393.     _somGetInstanceToken(M_BlackHoletempClassData.classObject);
  394.     M_BlackHolesomInitializeClass();
  395.     M_BlackHoleCClassData.parentMtab =
  396.     _somGetPClsMtab(M_BlackHoletempClassData.classObject);
  397.     _somSetClassData(M_BlackHoletempClassData.classObject, (somClassDataStructure *)&M_BlackHoleClassData);
  398.     _somClassReady(M_BlackHoletempClassData.classObject);
  399.     /* make newly created class object visible */
  400.     M_BlackHoleClassData.classObject = M_BlackHoletempClassData.classObject;
  401. }
  402.  
  403. M_BlackHole * SOMLINK M_BlackHoleNewClass (integer4 scemajorVersion,
  404.         integer4 sceminorVersion)
  405. {
  406.     SOMClass *pClsObj;
  407.     SOMClass *mClsObj;
  408.  
  409.     /* Check the version numbers */
  410.     if (((scemajorVersion != 0) && 
  411.          (scemajorVersion != M_BlackHole_MajorVersion)) ||
  412.         ((sceminorVersion != 0) && 
  413.          (sceminorVersion > M_BlackHole_MinorVersion))) {
  414.     somPrintf("M_BlackHoleNewClass: Error, bad version numbers.\n");
  415.     SOM_Error(SOMERROR_BadVersion);
  416.     }
  417.     /* Don't do anything if class object is already created. */
  418.     if (M_BlackHoleClassData.classObject != (SOMAny *) NULL)
  419.     return(M_BlackHoleClassData.classObject);
  420.  
  421.     /* Make sure the environment is initialized. */
  422.     if (SOMClassMgrObject == (SOMAny *) NULL) somEnvironmentNew();
  423.     if (SOMClassMgrObject == (SOMAny *) NULL)
  424.     SOM_Error(SOMERROR_CouldNotStartup);
  425.  
  426.     /* Get the parent class object. */
  427.     M_WPAbstractNewClass(1,2);    /* static reference */
  428.     pClsObj = _somFindClass(SOMClassMgrObject,
  429.         SOM_IdFromString("M_WPAbstract"), 1, 2);
  430.     if (pClsObj == (SOMClass *) NULL)
  431.     SOM_Error(SOMERROR_NoParentClass);
  432.  
  433.     /* Use parent's metaclass */ 
  434.     mClsObj = SOM_GetClass(pClsObj);
  435.  
  436.     somConstructClass(M_BlackHolesomCreateClass, pClsObj, mClsObj,
  437.              &M_BlackHoletempClassData);
  438.     return (M_BlackHoleClassData.classObject);
  439. }
  440.  
  441. #endif                   /* M_BlackHole_Class_Source */
  442.  
  443. #endif       /* BlackHol_ih */
  444.