home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / wpobj.zip / CLRSTAR.IH < prev    next >
Text File  |  1993-11-10  |  6KB  |  215 lines

  1.  
  2. /*
  3.  * This file was generated by the SOM Compiler.
  4.  * FileName: clrstar.ih.
  5.  * Generated using:
  6.  *     SOM Precompiler spc: 1.22
  7.  *     SOM Emitter emitih: 1.59
  8.  */
  9.  
  10. /*
  11.  * 
  12.  * MODULE NAME: ClrPalet.CSC
  13.  * 
  14.  * DESCRIPTION:
  15.  *   Object class definition file for StarColorPalette object class.
  16.  */
  17.  
  18.  
  19. #ifndef clrstar_ih
  20. #define clrstar_ih
  21.  
  22.  
  23. /*
  24.  * Passthru lines: File: "C.ih", "before"
  25.  */
  26.  
  27. #define SOM_NoTest 1        /* Disables somTestCls on method resolution */
  28. #define _RETAIL             /* Disables xxxMethodDebug() functions */
  29.  
  30. /* Include the standard PM header files
  31.  */
  32. #define INCL_WIN
  33. #define INCL_GPI
  34. #define INCL_DOS
  35. #define INCL_WINWORKPLACE
  36. #define INCL_WPCLASS
  37. #define INCL_WPFOLDER
  38. #include <os2.h>
  39. #include <string.h>
  40.  
  41.  
  42. #include "clrstar.h"
  43.  
  44. /*
  45.  * Set the scope of methods functions
  46.  */
  47. #ifndef SOM_Scope
  48. #ifdef __cplusplus
  49. #define SOM_Scope extern "C"
  50. #else
  51. #define SOM_Scope extern
  52. #endif
  53. #endif
  54.  
  55. #ifndef SOM_CurrentClass
  56. #define SOM_CurrentClass StarColorPaletteCClassData.parentMtab
  57. #endif
  58.  
  59. #define StarColorPalette_MaxNoMethods 0
  60.  
  61. /*
  62.  * Instance data
  63.  */
  64. typedef void StarColorPaletteData;
  65.  
  66. /*
  67.  * Trace/Debug macro
  68.  */
  69. #ifndef StarColorPaletteMethodDebug
  70. #define StarColorPaletteMethodDebug(c,m) SOMMethodDebug(c,m)
  71. #endif
  72.  
  73. /*
  74.  * Begin stuff that only goes in the primary file
  75.  */
  76. #ifdef StarColorPalette_Class_Source
  77.  
  78. /*
  79.  * Current class macros for Instance and Meta classes.
  80.  */
  81. #undef SOMMeta
  82. #define SOMMeta M_StarColorPaletteCClassData.parentMtab
  83. #undef SOMInstance
  84. #define SOMInstance StarColorPaletteCClassData.parentMtab
  85.  
  86. #ifndef M_StarColorPalette_Class_Source
  87. #define M_StarColorPalette_Class_Source
  88. #endif    /* M_StarColorPalette_Class_Source */
  89.  
  90. /*
  91.  * Generate the Apply Stubs.
  92.  */
  93.  
  94. /*
  95.  * Overridden method: QuerySampleShape
  96.  */
  97. #pragma linkage(clrs_QuerySampleShape, system)
  98. SOM_Scope BOOL   SOMLINK clrs_QuerySampleShape(StarColorPalette *somSelf,
  99.         PPOINTL pPoints,
  100.         PULONG pcPoints);
  101. #ifndef parent_QuerySampleShape
  102. static char *somMN_QuerySampleShape = "QuerySampleShape";
  103. static somId somId_QuerySampleShape = &somMN_QuerySampleShape;
  104. #define parent_QuerySampleShape(somSelf,pPoints,pcPoints) \
  105.     ((SOM_ParentResolveE(ColorPalette, SOM_CurrentClass, QuerySampleShape)) \
  106.      (somSelf,pPoints,pcPoints))
  107. #endif
  108. #define StarColorPaletteParent_QuerySampleShape parent_QuerySampleShape
  109.  
  110. /*
  111.  * Temporary class data structure used only in class creation
  112.  */
  113. static somClassDataStructure StarColorPalettetempClassData;
  114.  
  115. /*
  116.  * Initialize the class data structure
  117.  */
  118. struct StarColorPaletteClassDataStructure StarColorPaletteClassData = {(SOMAny *) NULL};
  119.  
  120. /*
  121.  * Define the C class data structure
  122.  */
  123. struct StarColorPaletteCClassDataStructure StarColorPaletteCClassData = {(somMethodTab *) NULL};
  124.  
  125. /*
  126.  * Routines to create the class object
  127.  */
  128.  
  129. /*
  130.  * Declare the Override Methods table.
  131.  */
  132. static somOverrideMethod_t StarColorPaletteOM[] = {
  133.     {    &somId_QuerySampleShape,
  134.          (somMethodProc *) clrs_QuerySampleShape    },
  135. };
  136.  
  137. static void StarColorPalettesomInitializeClass ()
  138. {
  139.     int i;
  140.     somOverrideMethod_t *omp;
  141.  
  142. /*
  143.  * Override methods.
  144.  */
  145.     for (omp = StarColorPaletteOM, i = 0; i < 1; omp++, i++)
  146.         _somOverrideSMethod (StarColorPalettetempClassData.classObject,
  147.             *(omp->methodId), omp->method);
  148.  
  149. }
  150.  
  151. #pragma linkage(StarColorPalettesomCreateClass, system)
  152. static void SOMLINK StarColorPalettesomCreateClass(SOMClass *pClsObj,
  153.                            SOMClass *mClsObj)
  154. {
  155.     StarColorPalettetempClassData.classObject = _somNew (mClsObj);
  156.     _somInitClass (StarColorPalettetempClassData.classObject,
  157.         "StarColorPalette",
  158.         pClsObj,
  159.         0,
  160.         StarColorPalette_MaxNoMethods,
  161.         StarColorPalette_MajorVersion,
  162.         StarColorPalette_MinorVersion);
  163.     StarColorPaletteCClassData.instanceDataToken = 
  164.     _somGetInstanceToken(StarColorPalettetempClassData.classObject);
  165.     StarColorPalettesomInitializeClass();
  166.     StarColorPaletteCClassData.parentMtab =
  167.     _somGetPClsMtab(StarColorPalettetempClassData.classObject);
  168.     _somSetClassData(StarColorPalettetempClassData.classObject, (somClassDataStructure *)&StarColorPaletteClassData);
  169.     _somClassReady(StarColorPalettetempClassData.classObject);
  170.     /* make newly created class object visible */
  171.     StarColorPaletteClassData.classObject = StarColorPalettetempClassData.classObject;
  172. }
  173.  
  174. StarColorPalette * SOMLINK StarColorPaletteNewClass (integer4 scemajorVersion,
  175.         integer4 sceminorVersion)
  176. {
  177.     SOMClass *pClsObj;
  178.     SOMClass *mClsObj;
  179.  
  180.     /* Check the version numbers */
  181.     if (((scemajorVersion != 0) && 
  182.          (scemajorVersion != StarColorPalette_MajorVersion)) ||
  183.         ((sceminorVersion != 0) && 
  184.          (sceminorVersion > StarColorPalette_MinorVersion))) {
  185.     somPrintf("StarColorPaletteNewClass: Error, bad version numbers.\n");
  186.     SOM_Error(SOMERROR_BadVersion);
  187.     }
  188.     /* Don't do anything if class object is already created. */
  189.     if (StarColorPaletteClassData.classObject != (SOMAny *) NULL)
  190.     return(StarColorPaletteClassData.classObject);
  191.  
  192.     /* Make sure the environment is initialized. */
  193.     if (SOMClassMgrObject == (SOMAny *) NULL) somEnvironmentNew();
  194.     if (SOMClassMgrObject == (SOMAny *) NULL)
  195.     SOM_Error(SOMERROR_CouldNotStartup);
  196.  
  197.     /* Get the parent class object. */
  198.     ColorPaletteNewClass(1,2);    /* static reference */
  199.     pClsObj = _somFindClass(SOMClassMgrObject,
  200.         SOM_IdFromString("ColorPalette"), 1, 2);
  201.     if (pClsObj == (SOMClass *) NULL)
  202.     SOM_Error(SOMERROR_NoParentClass);
  203.  
  204.     /* Use parent's metaclass */ 
  205.     mClsObj = SOM_GetClass(pClsObj);
  206.  
  207.     somConstructClass(StarColorPalettesomCreateClass, pClsObj, mClsObj,
  208.              &StarColorPalettetempClassData);
  209.     return (StarColorPaletteClassData.classObject);
  210. }
  211.  
  212. #endif                   /* StarColorPalette_Class_Source */
  213.  
  214. #endif       /* clrstar_ih */
  215.