home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / mnicon2.zip / MNIcon.ih < prev    next >
Text File  |  1996-02-06  |  10KB  |  398 lines

  1.  
  2. /*
  3.  * This file was generated by the SOM Compiler.
  4.  * FileName: MNIcon.ih.
  5.  * Generated using:
  6.  *     SOM Precompiler spc: 1.22
  7.  *     SOM Emitter emitih: 1.59
  8.  */
  9.  
  10. /*
  11.  *   MNIcon class release 1.0 (02/21/93) by Makoto Nagata
  12.  */
  13.  
  14.  
  15. #ifndef MNIcon_ih
  16. #define MNIcon_ih
  17.  
  18.  
  19. /*
  20.  * Passthru lines: File: "C.ih", "before"
  21.  */
  22.  
  23. #define INCL_32
  24. #define INCL_WIN
  25. #include <os2.h>
  26.  
  27.  
  28. #include "MNIcon.h"
  29.  
  30. /*
  31.  * Set the scope of methods functions
  32.  */
  33. #ifndef SOM_Scope
  34. #ifdef __cplusplus
  35. #define SOM_Scope extern "C"
  36. #else
  37. #define SOM_Scope extern
  38. #endif
  39. #endif
  40.  
  41. #ifndef SOM_CurrentClass
  42. #define SOM_CurrentClass MNIconCClassData.parentMtab
  43. #endif
  44.  
  45. #define MNIcon_MaxNoMethods 0
  46.  
  47. /*
  48.  * Instance data
  49.  */
  50. typedef void MNIconData;
  51.  
  52. /*
  53.  * Trace/Debug macro
  54.  */
  55. #ifndef MNIconMethodDebug
  56. #define MNIconMethodDebug(c,m) SOMMethodDebug(c,m)
  57. #endif
  58.  
  59. /*
  60.  * Begin stuff that only goes in the primary file
  61.  */
  62. #ifdef MNIcon_Class_Source
  63.  
  64. /*
  65.  * Current class macros for Instance and Meta classes.
  66.  */
  67. #undef SOMMeta
  68. #define SOMMeta M_MNIconCClassData.parentMtab
  69. #undef SOMInstance
  70. #define SOMInstance MNIconCClassData.parentMtab
  71.  
  72. #ifndef M_MNIcon_Class_Source
  73. #define M_MNIcon_Class_Source
  74. #endif    /* M_MNIcon_Class_Source */
  75.  
  76. /*
  77.  * Generate the Apply Stubs.
  78.  */
  79.  
  80. /*
  81.  * Overridden method: wpDragOver
  82.  */
  83. #pragma linkage(mnicon_wpDragOver, system)
  84. SOM_Scope MRESULT   SOMLINK mnicon_wpDragOver(MNIcon *somSelf,
  85.         HWND hwndCnr,
  86.         PDRAGINFO pdrgInfo);
  87. #ifndef parent_wpDragOver
  88. static char *somMN_wpDragOver = "wpDragOver";
  89. static somId somId_wpDragOver = &somMN_wpDragOver;
  90. #define parent_wpDragOver(somSelf,hwndCnr,pdrgInfo) \
  91.     ((SOM_ParentResolveE(WPObject, SOM_CurrentClass, wpDragOver)) \
  92.      (somSelf,hwndCnr,pdrgInfo))
  93. #endif
  94. #define MNIconParent_wpDragOver parent_wpDragOver
  95.  
  96. /*
  97.  * Overridden method: wpDrop
  98.  */
  99. #pragma linkage(mnicon_wpDrop, system)
  100. SOM_Scope MRESULT   SOMLINK mnicon_wpDrop(MNIcon *somSelf,
  101.         HWND hwndCnr,
  102.         PDRAGINFO pdrgInfo,
  103.         PDRAGITEM pdrgItem);
  104. #ifndef parent_wpDrop
  105. static char *somMN_wpDrop = "wpDrop";
  106. static somId somId_wpDrop = &somMN_wpDrop;
  107. #define parent_wpDrop(somSelf,hwndCnr,pdrgInfo,pdrgItem) \
  108.     ((SOM_ParentResolveE(WPObject, SOM_CurrentClass, wpDrop)) \
  109.      (somSelf,hwndCnr,pdrgInfo,pdrgItem))
  110. #endif
  111. #define MNIconParent_wpDrop parent_wpDrop
  112.  
  113. /*
  114.  * Temporary class data structure used only in class creation
  115.  */
  116. static somClassDataStructure MNIcontempClassData;
  117.  
  118. /*
  119.  * Initialize the class data structure
  120.  */
  121. struct MNIconClassDataStructure MNIconClassData = {(SOMAny *) NULL};
  122.  
  123. /*
  124.  * Define the C class data structure
  125.  */
  126. struct MNIconCClassDataStructure MNIconCClassData = {(somMethodTab *) NULL};
  127.  
  128. /*
  129.  * Routines to create the class object
  130.  */
  131.  
  132. /*
  133.  * Declare the Override Methods table.
  134.  */
  135. static somOverrideMethod_t MNIconOM[] = {
  136.     {    &somId_wpDragOver,
  137.          (somMethodProc *) mnicon_wpDragOver    },
  138.     {    &somId_wpDrop,
  139.          (somMethodProc *) mnicon_wpDrop    },
  140. };
  141.  
  142. static void MNIconsomInitializeClass ()
  143. {
  144.     int i;
  145.     somOverrideMethod_t *omp;
  146.  
  147. /*
  148.  * Override methods.
  149.  */
  150.     for (omp = MNIconOM, i = 0; i < 2; omp++, i++)
  151.         _somOverrideSMethod (MNIcontempClassData.classObject,
  152.             *(omp->methodId), omp->method);
  153.  
  154. }
  155.  
  156. #pragma linkage(MNIconsomCreateClass, system)
  157. static void SOMLINK MNIconsomCreateClass(SOMClass *pClsObj,
  158.                            SOMClass *mClsObj)
  159. {
  160.     MNIcontempClassData.classObject = _somNew (mClsObj);
  161.     _somInitClass (MNIcontempClassData.classObject,
  162.         "MNIcon",
  163.         pClsObj,
  164.         0,
  165.         MNIcon_MaxNoMethods,
  166.         MNIcon_MajorVersion,
  167.         MNIcon_MinorVersion);
  168.     MNIconCClassData.instanceDataToken = 
  169.     _somGetInstanceToken(MNIcontempClassData.classObject);
  170.     MNIconsomInitializeClass();
  171.     MNIconCClassData.parentMtab =
  172.     _somGetPClsMtab(MNIcontempClassData.classObject);
  173.     _somSetClassData(MNIcontempClassData.classObject, (somClassDataStructure *)&MNIconClassData);
  174.     _somClassReady(MNIcontempClassData.classObject);
  175.     /* make newly created class object visible */
  176.     MNIconClassData.classObject = MNIcontempClassData.classObject;
  177. }
  178.  
  179. MNIcon * SOMLINK MNIconNewClass (integer4 scemajorVersion,
  180.         integer4 sceminorVersion)
  181. {
  182.     SOMClass *pClsObj;
  183.     SOMClass *mClsObj;
  184.  
  185.     /* Check the version numbers */
  186.     if (((scemajorVersion != 0) && 
  187.          (scemajorVersion != MNIcon_MajorVersion)) ||
  188.         ((sceminorVersion != 0) && 
  189.          (sceminorVersion > MNIcon_MinorVersion))) {
  190.     somPrintf("MNIconNewClass: Error, bad version numbers.\n");
  191.     SOM_Error(SOMERROR_BadVersion);
  192.     }
  193.     /* Don't do anything if class object is already created. */
  194.     if (MNIconClassData.classObject != (SOMAny *) NULL)
  195.     return(MNIconClassData.classObject);
  196.  
  197.     /* Make sure the environment is initialized. */
  198.     if (SOMClassMgrObject == (SOMAny *) NULL) somEnvironmentNew();
  199.     if (SOMClassMgrObject == (SOMAny *) NULL)
  200.     SOM_Error(SOMERROR_CouldNotStartup);
  201.  
  202.     /* Get the parent class object. */
  203.     WPIconNewClass(1,2);    /* static reference */
  204.     pClsObj = _somFindClass(SOMClassMgrObject,
  205.         SOM_IdFromString("WPIcon"), 1, 2);
  206.     if (pClsObj == (SOMClass *) NULL)
  207.     SOM_Error(SOMERROR_NoParentClass);
  208.  
  209.     /* Explicit metaclass, so get it */ 
  210.     M_MNIconNewClass(0,0);    /* static reference */
  211.     mClsObj = _somFindClass(SOMClassMgrObject,
  212.         SOM_IdFromString("M_MNIcon"), 0, 0);
  213.     if (mClsObj == (SOMClass *) NULL)
  214.     SOM_Error(SOMERROR_NoMetaClass);
  215.  
  216.     somConstructClass(MNIconsomCreateClass, pClsObj, mClsObj,
  217.              &MNIcontempClassData);
  218.     return (MNIconClassData.classObject);
  219. }
  220.  
  221. #endif                   /* MNIcon_Class_Source */
  222.  
  223. #endif       /* MNIcon_ih */
  224.  
  225. /*
  226.  * This file was generated by the SOM Compiler.
  227.  * FileName: MNIcon.ih.
  228.  * Generated using:
  229.  *     SOM Precompiler spc: 1.22
  230.  *     SOM Emitter emitih: 1.59
  231.  */
  232.  
  233. #ifndef MNIcon_mih
  234. #define MNIcon_mih
  235.  
  236.  
  237. /*
  238.  * Set the scope of methods functions
  239.  */
  240. #ifndef SOM_Scope
  241. #ifdef __cplusplus
  242. #define SOM_Scope extern "C"
  243. #else
  244. #define SOM_Scope extern
  245. #endif
  246. #endif
  247.  
  248. #ifndef SOM_CurrentClass
  249. #define SOM_CurrentClass M_MNIconCClassData.parentMtab
  250. #endif
  251.  
  252. #define M_MNIcon_MaxNoMethods 0
  253.  
  254. /*
  255.  * Instance data
  256.  */
  257. typedef void M_MNIconData;
  258.  
  259. /*
  260.  * Trace/Debug macro
  261.  */
  262. #ifndef M_MNIconMethodDebug
  263. #define M_MNIconMethodDebug(c,m) SOMMethodDebug(c,m)
  264. #endif
  265.  
  266. /*
  267.  * Begin stuff that only goes in the primary file
  268.  */
  269. #ifdef M_MNIcon_Class_Source
  270.  
  271. /*
  272.  * Current class macros for Instance and Meta classes.
  273.  */
  274.  
  275. /*
  276.  * Generate the Apply Stubs.
  277.  */
  278.  
  279. /*
  280.  * Overridden method: wpclsQueryTitle
  281.  */
  282. #pragma linkage(mniconM_wpclsQueryTitle, system)
  283. SOM_Scope PSZ   SOMLINK mniconM_wpclsQueryTitle(M_MNIcon *somSelf);
  284. #ifndef parent_wpclsQueryTitle
  285. static char *somMN_wpclsQueryTitle = "wpclsQueryTitle";
  286. static somId somId_wpclsQueryTitle = &somMN_wpclsQueryTitle;
  287. #define parent_wpclsQueryTitle(somSelf) \
  288.     ((SOM_ParentResolveE(M_WPObject, SOM_CurrentClass, wpclsQueryTitle)) \
  289.      (somSelf))
  290. #endif
  291. #define M_MNIconParent_wpclsQueryTitle parent_wpclsQueryTitle
  292.  
  293. /*
  294.  * Temporary class data structure used only in class creation
  295.  */
  296. static somClassDataStructure M_MNIcontempClassData;
  297.  
  298. /*
  299.  * Initialize the class data structure
  300.  */
  301. struct M_MNIconClassDataStructure M_MNIconClassData = {(SOMAny *) NULL};
  302.  
  303. /*
  304.  * Define the C class data structure
  305.  */
  306. struct M_MNIconCClassDataStructure M_MNIconCClassData = {(somMethodTab *) NULL};
  307.  
  308. /*
  309.  * Routines to create the class object
  310.  */
  311.  
  312. /*
  313.  * Declare the Override Methods table.
  314.  */
  315. static somOverrideMethod_t M_MNIconOM[] = {
  316.     {    &somId_wpclsQueryTitle,
  317.          (somMethodProc *) mniconM_wpclsQueryTitle    },
  318. };
  319.  
  320. static void M_MNIconsomInitializeClass ()
  321. {
  322.     int i;
  323.     somOverrideMethod_t *omp;
  324.  
  325. /*
  326.  * Override methods.
  327.  */
  328.     for (omp = M_MNIconOM, i = 0; i < 1; omp++, i++)
  329.         _somOverrideSMethod (M_MNIcontempClassData.classObject,
  330.             *(omp->methodId), omp->method);
  331.  
  332. }
  333.  
  334. #pragma linkage(M_MNIconsomCreateClass, system)
  335. static void SOMLINK M_MNIconsomCreateClass(SOMClass *pClsObj,
  336.                            SOMClass *mClsObj)
  337. {
  338.     M_MNIcontempClassData.classObject = _somNew (mClsObj);
  339.     _somInitClass (M_MNIcontempClassData.classObject,
  340.         "M_MNIcon",
  341.         pClsObj,
  342.         0,
  343.         M_MNIcon_MaxNoMethods,
  344.         M_MNIcon_MajorVersion,
  345.         M_MNIcon_MinorVersion);
  346.     M_MNIconCClassData.instanceDataToken = 
  347.     _somGetInstanceToken(M_MNIcontempClassData.classObject);
  348.     M_MNIconsomInitializeClass();
  349.     M_MNIconCClassData.parentMtab =
  350.     _somGetPClsMtab(M_MNIcontempClassData.classObject);
  351.     _somSetClassData(M_MNIcontempClassData.classObject, (somClassDataStructure *)&M_MNIconClassData);
  352.     _somClassReady(M_MNIcontempClassData.classObject);
  353.     /* make newly created class object visible */
  354.     M_MNIconClassData.classObject = M_MNIcontempClassData.classObject;
  355. }
  356.  
  357. M_MNIcon * SOMLINK M_MNIconNewClass (integer4 scemajorVersion,
  358.         integer4 sceminorVersion)
  359. {
  360.     SOMClass *pClsObj;
  361.     SOMClass *mClsObj;
  362.  
  363.     /* Check the version numbers */
  364.     if (((scemajorVersion != 0) && 
  365.          (scemajorVersion != M_MNIcon_MajorVersion)) ||
  366.         ((sceminorVersion != 0) && 
  367.          (sceminorVersion > M_MNIcon_MinorVersion))) {
  368.     somPrintf("M_MNIconNewClass: Error, bad version numbers.\n");
  369.     SOM_Error(SOMERROR_BadVersion);
  370.     }
  371.     /* Don't do anything if class object is already created. */
  372.     if (M_MNIconClassData.classObject != (SOMAny *) NULL)
  373.     return(M_MNIconClassData.classObject);
  374.  
  375.     /* Make sure the environment is initialized. */
  376.     if (SOMClassMgrObject == (SOMAny *) NULL) somEnvironmentNew();
  377.     if (SOMClassMgrObject == (SOMAny *) NULL)
  378.     SOM_Error(SOMERROR_CouldNotStartup);
  379.  
  380.     /* Get the parent class object. */
  381.     M_WPIconNewClass(1,2);    /* static reference */
  382.     pClsObj = _somFindClass(SOMClassMgrObject,
  383.         SOM_IdFromString("M_WPIcon"), 1, 2);
  384.     if (pClsObj == (SOMClass *) NULL)
  385.     SOM_Error(SOMERROR_NoParentClass);
  386.  
  387.     /* Use parent's metaclass */ 
  388.     mClsObj = SOM_GetClass(pClsObj);
  389.  
  390.     somConstructClass(M_MNIconsomCreateClass, pClsObj, mClsObj,
  391.              &M_MNIcontempClassData);
  392.     return (M_MNIconClassData.classObject);
  393. }
  394.  
  395. #endif                   /* M_MNIcon_Class_Source */
  396.  
  397. #endif       /* MNIcon_ih */
  398.