home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
wpobj.zip
/
CLRSTAR.IH
< prev
next >
Wrap
Text File
|
1993-11-10
|
6KB
|
215 lines
/*
* This file was generated by the SOM Compiler.
* FileName: clrstar.ih.
* Generated using:
* SOM Precompiler spc: 1.22
* SOM Emitter emitih: 1.59
*/
/*
*
* MODULE NAME: ClrPalet.CSC
*
* DESCRIPTION:
* Object class definition file for StarColorPalette object class.
*/
#ifndef clrstar_ih
#define clrstar_ih
/*
* Passthru lines: File: "C.ih", "before"
*/
#define SOM_NoTest 1 /* Disables somTestCls on method resolution */
#define _RETAIL /* Disables xxxMethodDebug() functions */
/* Include the standard PM header files
*/
#define INCL_WIN
#define INCL_GPI
#define INCL_DOS
#define INCL_WINWORKPLACE
#define INCL_WPCLASS
#define INCL_WPFOLDER
#include <os2.h>
#include <string.h>
#include "clrstar.h"
/*
* Set the scope of methods functions
*/
#ifndef SOM_Scope
#ifdef __cplusplus
#define SOM_Scope extern "C"
#else
#define SOM_Scope extern
#endif
#endif
#ifndef SOM_CurrentClass
#define SOM_CurrentClass StarColorPaletteCClassData.parentMtab
#endif
#define StarColorPalette_MaxNoMethods 0
/*
* Instance data
*/
typedef void StarColorPaletteData;
/*
* Trace/Debug macro
*/
#ifndef StarColorPaletteMethodDebug
#define StarColorPaletteMethodDebug(c,m) SOMMethodDebug(c,m)
#endif
/*
* Begin stuff that only goes in the primary file
*/
#ifdef StarColorPalette_Class_Source
/*
* Current class macros for Instance and Meta classes.
*/
#undef SOMMeta
#define SOMMeta M_StarColorPaletteCClassData.parentMtab
#undef SOMInstance
#define SOMInstance StarColorPaletteCClassData.parentMtab
#ifndef M_StarColorPalette_Class_Source
#define M_StarColorPalette_Class_Source
#endif /* M_StarColorPalette_Class_Source */
/*
* Generate the Apply Stubs.
*/
/*
* Overridden method: QuerySampleShape
*/
#pragma linkage(clrs_QuerySampleShape, system)
SOM_Scope BOOL SOMLINK clrs_QuerySampleShape(StarColorPalette *somSelf,
PPOINTL pPoints,
PULONG pcPoints);
#ifndef parent_QuerySampleShape
static char *somMN_QuerySampleShape = "QuerySampleShape";
static somId somId_QuerySampleShape = &somMN_QuerySampleShape;
#define parent_QuerySampleShape(somSelf,pPoints,pcPoints) \
((SOM_ParentResolveE(ColorPalette, SOM_CurrentClass, QuerySampleShape)) \
(somSelf,pPoints,pcPoints))
#endif
#define StarColorPaletteParent_QuerySampleShape parent_QuerySampleShape
/*
* Temporary class data structure used only in class creation
*/
static somClassDataStructure StarColorPalettetempClassData;
/*
* Initialize the class data structure
*/
struct StarColorPaletteClassDataStructure StarColorPaletteClassData = {(SOMAny *) NULL};
/*
* Define the C class data structure
*/
struct StarColorPaletteCClassDataStructure StarColorPaletteCClassData = {(somMethodTab *) NULL};
/*
* Routines to create the class object
*/
/*
* Declare the Override Methods table.
*/
static somOverrideMethod_t StarColorPaletteOM[] = {
{ &somId_QuerySampleShape,
(somMethodProc *) clrs_QuerySampleShape },
};
static void StarColorPalettesomInitializeClass ()
{
int i;
somOverrideMethod_t *omp;
/*
* Override methods.
*/
for (omp = StarColorPaletteOM, i = 0; i < 1; omp++, i++)
_somOverrideSMethod (StarColorPalettetempClassData.classObject,
*(omp->methodId), omp->method);
}
#pragma linkage(StarColorPalettesomCreateClass, system)
static void SOMLINK StarColorPalettesomCreateClass(SOMClass *pClsObj,
SOMClass *mClsObj)
{
StarColorPalettetempClassData.classObject = _somNew (mClsObj);
_somInitClass (StarColorPalettetempClassData.classObject,
"StarColorPalette",
pClsObj,
0,
StarColorPalette_MaxNoMethods,
StarColorPalette_MajorVersion,
StarColorPalette_MinorVersion);
StarColorPaletteCClassData.instanceDataToken =
_somGetInstanceToken(StarColorPalettetempClassData.classObject);
StarColorPalettesomInitializeClass();
StarColorPaletteCClassData.parentMtab =
_somGetPClsMtab(StarColorPalettetempClassData.classObject);
_somSetClassData(StarColorPalettetempClassData.classObject, (somClassDataStructure *)&StarColorPaletteClassData);
_somClassReady(StarColorPalettetempClassData.classObject);
/* make newly created class object visible */
StarColorPaletteClassData.classObject = StarColorPalettetempClassData.classObject;
}
StarColorPalette * SOMLINK StarColorPaletteNewClass (integer4 scemajorVersion,
integer4 sceminorVersion)
{
SOMClass *pClsObj;
SOMClass *mClsObj;
/* Check the version numbers */
if (((scemajorVersion != 0) &&
(scemajorVersion != StarColorPalette_MajorVersion)) ||
((sceminorVersion != 0) &&
(sceminorVersion > StarColorPalette_MinorVersion))) {
somPrintf("StarColorPaletteNewClass: Error, bad version numbers.\n");
SOM_Error(SOMERROR_BadVersion);
}
/* Don't do anything if class object is already created. */
if (StarColorPaletteClassData.classObject != (SOMAny *) NULL)
return(StarColorPaletteClassData.classObject);
/* Make sure the environment is initialized. */
if (SOMClassMgrObject == (SOMAny *) NULL) somEnvironmentNew();
if (SOMClassMgrObject == (SOMAny *) NULL)
SOM_Error(SOMERROR_CouldNotStartup);
/* Get the parent class object. */
ColorPaletteNewClass(1,2); /* static reference */
pClsObj = _somFindClass(SOMClassMgrObject,
SOM_IdFromString("ColorPalette"), 1, 2);
if (pClsObj == (SOMClass *) NULL)
SOM_Error(SOMERROR_NoParentClass);
/* Use parent's metaclass */
mClsObj = SOM_GetClass(pClsObj);
somConstructClass(StarColorPalettesomCreateClass, pClsObj, mClsObj,
&StarColorPalettetempClassData);
return (StarColorPaletteClassData.classObject);
}
#endif /* StarColorPalette_Class_Source */
#endif /* clrstar_ih */