home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
pentlk11.zip
/
OEM.IH
< prev
next >
Wrap
Text File
|
1994-01-13
|
12KB
|
452 lines
/*
* This file was generated by the SOM Compiler.
* FileName: oem.ih.
* Generated using:
* SOM Precompiler spc: 1.22
* SOM Emitter emitih: 1.59
*/
/*
*
*
*
* File Name : OEM.CSC
*
* Description : Sample sublcass
*
* Function: This is a sample of a subclass of PenLocatorPen
*
* Copyright (C) 1993 IBM Corporation
*
* DISCLAIMER OF WARRANTIES. The following [enclosed] code is
* sample code created by IBM Corporation. This sample code is not
* part of any standard or IBM product and is provided to you solely
* for the purpose of assisting you in the development of your
* applications. The code is provided "AS IS", without
* warranty of any kind. IBM shall not be liable for any damages
* arising out of your use of the sample code, even if they have been
* advised of the possibility of such damages.
*
*/
#ifndef oem_ih
#define oem_ih
#include "oem.h"
/*
* Set the scope of methods functions
*/
#ifndef SOM_Scope
#define SOM_Scope static
#endif
#ifndef SOM_CurrentClass
#define SOM_CurrentClass oemCClassData.parentMtab
#endif
#define oem_MaxNoMethods 1
/*
* Instance data
*/
typedef void oemData;
/*
* Trace/Debug macro
*/
#ifndef oemMethodDebug
#define oemMethodDebug(c,m) SOMMethodDebug(c,m)
#endif
/*
* Begin stuff that only goes in the primary file
*/
#ifdef oem_Class_Source
/*
* Current class macros for Instance and Meta classes.
*/
#undef SOMMeta
#define SOMMeta M_oemCClassData.parentMtab
#undef SOMInstance
#define SOMInstance oemCClassData.parentMtab
#ifndef M_oem_Class_Source
#define M_oem_Class_Source
#endif /* M_oem_Class_Source */
/*
* Generate the Apply Stubs.
*/
#pragma linkage(somAP_AddUserTypePage, system)
static ULONG SOMLINK somAP_AddUserTypePage(oem *somSelf,
somId __id,
somId __desc,
va_list __ap)
{
HWND hwndOem = va_arg(__ap, HWND);
__ap; __id; __desc; /* Referenced to prevent warning msg */
return (oem_AddUserTypePage(somSelf,hwndOem));
}
/*
* Overridden method: wpAddSettingsPages
*/
#pragma linkage(wpAddSettingsPages, system)
SOM_Scope BOOL SOMLINK wpAddSettingsPages(oem *somSelf,
HWND hwndNotebook);
#ifndef parent_wpAddSettingsPages
static char *somMN_wpAddSettingsPages = "wpAddSettingsPages";
static somId somId_wpAddSettingsPages = &somMN_wpAddSettingsPages;
#define parent_wpAddSettingsPages(somSelf,hwndNotebook) \
((SOM_ParentResolveE(WPObject, SOM_CurrentClass, wpAddSettingsPages)) \
(somSelf,hwndNotebook))
#endif
#define oemParent_wpAddSettingsPages parent_wpAddSettingsPages
/*
* Temporary class data structure used only in class creation
*/
static somClassDataStructure oemtempClassData;
/*
* Initialize the class data structure
*/
struct oemClassDataStructure oemClassData = {(SOMAny *) NULL};
/*
* Define the C class data structure
*/
struct oemCClassDataStructure oemCClassData = {(somMethodTab *) NULL};
/*
* New Method: AddUserTypePage
*/
#pragma linkage(AddUserTypePage, system)
SOM_Scope ULONG SOMLINK AddUserTypePage(oem *somSelf,
HWND hwndOem);
static char *somMN_AddUserTypePage = "AddUserTypePage";
static somId somId_AddUserTypePage = &somMN_AddUserTypePage;
static char *somDS_AddUserTypePage = somMD_oem_AddUserTypePage;
static somId somDI_AddUserTypePage = &somDS_AddUserTypePage;
#pragma linkage(somRD_AddUserTypePage, system)
static ULONG SOMLINK somRD_AddUserTypePage(oem *somSelf,
HWND hwndOem)
{
return ((ULONG) va_somDispatchL(somSelf, somId_AddUserTypePage,
_somGetMethodDescriptor(SOM_GetClass(somSelf),somId_AddUserTypePage),hwndOem));
}
/*
* Routines to create the class object
*/
/*
* Declare the Static Methods table.
*/
static somStaticMethod_t oemSM[] = {
{ &oemClassData.AddUserTypePage,
&somId_AddUserTypePage,
&somDI_AddUserTypePage,
(somMethodProc *) AddUserTypePage,
(somMethodProc *) somRD_AddUserTypePage,
(somMethodProc *) somAP_AddUserTypePage },
};
/*
* Declare the Override Methods table.
*/
static somOverrideMethod_t oemOM[] = {
{ &somId_wpAddSettingsPages,
(somMethodProc *) wpAddSettingsPages },
};
static void oemsomInitializeClass ()
{
int i;
somStaticMethod_t *smp;
somOverrideMethod_t *omp;
/*
* Add the Static Methods.
*/
for (smp = oemSM, i = 0; i < 1; smp++, i++)
*(smp->classData) =
_somAddStaticMethod (oemtempClassData.classObject,
*(smp->methodId), *(smp->methodDescriptor),
smp->method, smp->redispatchStub,
smp->applyStub);
/*
* Override methods.
*/
for (omp = oemOM, i = 0; i < 1; omp++, i++)
_somOverrideSMethod (oemtempClassData.classObject,
*(omp->methodId), omp->method);
}
#pragma linkage(oemsomCreateClass, system)
static void SOMLINK oemsomCreateClass(SOMClass *pClsObj,
SOMClass *mClsObj)
{
oemtempClassData.classObject = _somNew (mClsObj);
_somInitClass (oemtempClassData.classObject,
"oem",
pClsObj,
0,
oem_MaxNoMethods,
oem_MajorVersion,
oem_MinorVersion);
oemCClassData.instanceDataToken =
_somGetInstanceToken(oemtempClassData.classObject);
oemsomInitializeClass();
oemCClassData.parentMtab =
_somGetPClsMtab(oemtempClassData.classObject);
_somSetClassData(oemtempClassData.classObject, (somClassDataStructure *)&oemClassData);
_somClassReady(oemtempClassData.classObject);
/* make newly created class object visible */
oemClassData.classObject = oemtempClassData.classObject;
}
oem * SOMLINK oemNewClass (integer4 scemajorVersion,
integer4 sceminorVersion)
{
SOMClass *pClsObj;
SOMClass *mClsObj;
/* Check the version numbers */
if (((scemajorVersion != 0) &&
(scemajorVersion != oem_MajorVersion)) ||
((sceminorVersion != 0) &&
(sceminorVersion > oem_MinorVersion))) {
somPrintf("oemNewClass: Error, bad version numbers.\n");
SOM_Error(SOMERROR_BadVersion);
}
/* Don't do anything if class object is already created. */
if (oemClassData.classObject != (SOMAny *) NULL)
return(oemClassData.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. */
PenLocatorPenNewClass(1,1); /* static reference */
pClsObj = _somFindClass(SOMClassMgrObject,
SOM_IdFromString("PenLocatorPen"), 1, 1);
if (pClsObj == (SOMClass *) NULL)
SOM_Error(SOMERROR_NoParentClass);
/* Explicit metaclass, so get it */
M_oemNewClass(0,0); /* static reference */
mClsObj = _somFindClass(SOMClassMgrObject,
SOM_IdFromString("M_oem"), 0, 0);
if (mClsObj == (SOMClass *) NULL)
SOM_Error(SOMERROR_NoMetaClass);
somConstructClass(oemsomCreateClass, pClsObj, mClsObj,
&oemtempClassData);
return (oemClassData.classObject);
}
#endif /* oem_Class_Source */
#endif /* oem_ih */
/*
* This file was generated by the SOM Compiler.
* FileName: oem.ih.
* Generated using:
* SOM Precompiler spc: 1.22
* SOM Emitter emitih: 1.59
*/
#ifndef oem_mih
#define oem_mih
/*
* Set the scope of methods functions
*/
#ifndef SOM_Scope
#define SOM_Scope static
#endif
#ifndef SOM_CurrentClass
#define SOM_CurrentClass M_oemCClassData.parentMtab
#endif
#define M_oem_MaxNoMethods 0
/*
* Instance data
*/
typedef void M_oemData;
/*
* Trace/Debug macro
*/
#ifndef M_oemMethodDebug
#define M_oemMethodDebug(c,m) SOMMethodDebug(c,m)
#endif
/*
* Begin stuff that only goes in the primary file
*/
#ifdef M_oem_Class_Source
/*
* Current class macros for Instance and Meta classes.
*/
/*
* Generate the Apply Stubs.
*/
/*
* Overridden method: wpclsQueryTitle
*/
#pragma linkage(oemM_wpclsQueryTitle, system)
SOM_Scope PSZ SOMLINK oemM_wpclsQueryTitle(M_oem *somSelf);
#ifndef parent_wpclsQueryTitle
static char *somMN_wpclsQueryTitle = "wpclsQueryTitle";
static somId somId_wpclsQueryTitle = &somMN_wpclsQueryTitle;
#define parent_wpclsQueryTitle(somSelf) \
((SOM_ParentResolveE(M_WPObject, SOM_CurrentClass, wpclsQueryTitle)) \
(somSelf))
#endif
#define M_oemParent_wpclsQueryTitle parent_wpclsQueryTitle
/*
* Overridden method: wpclsQueryIconData
*/
#pragma linkage(oemM_wpclsQueryIconData, system)
SOM_Scope ULONG SOMLINK oemM_wpclsQueryIconData(M_oem *somSelf,
PICONINFO pIconInfo);
#ifndef parent_wpclsQueryIconData
static char *somMN_wpclsQueryIconData = "wpclsQueryIconData";
static somId somId_wpclsQueryIconData = &somMN_wpclsQueryIconData;
#define parent_wpclsQueryIconData(somSelf,pIconInfo) \
((SOM_ParentResolveE(M_WPObject, SOM_CurrentClass, wpclsQueryIconData)) \
(somSelf,pIconInfo))
#endif
#define M_oemParent_wpclsQueryIconData parent_wpclsQueryIconData
/*
* Temporary class data structure used only in class creation
*/
static somClassDataStructure M_oemtempClassData;
/*
* Initialize the class data structure
*/
struct M_oemClassDataStructure M_oemClassData = {(SOMAny *) NULL};
/*
* Define the C class data structure
*/
struct M_oemCClassDataStructure M_oemCClassData = {(somMethodTab *) NULL};
/*
* Routines to create the class object
*/
/*
* Declare the Override Methods table.
*/
static somOverrideMethod_t M_oemOM[] = {
{ &somId_wpclsQueryTitle,
(somMethodProc *) oemM_wpclsQueryTitle },
{ &somId_wpclsQueryIconData,
(somMethodProc *) oemM_wpclsQueryIconData },
};
static void M_oemsomInitializeClass ()
{
int i;
somOverrideMethod_t *omp;
/*
* Override methods.
*/
for (omp = M_oemOM, i = 0; i < 2; omp++, i++)
_somOverrideSMethod (M_oemtempClassData.classObject,
*(omp->methodId), omp->method);
}
#pragma linkage(M_oemsomCreateClass, system)
static void SOMLINK M_oemsomCreateClass(SOMClass *pClsObj,
SOMClass *mClsObj)
{
M_oemtempClassData.classObject = _somNew (mClsObj);
_somInitClass (M_oemtempClassData.classObject,
"M_oem",
pClsObj,
0,
M_oem_MaxNoMethods,
M_oem_MajorVersion,
M_oem_MinorVersion);
M_oemCClassData.instanceDataToken =
_somGetInstanceToken(M_oemtempClassData.classObject);
M_oemsomInitializeClass();
M_oemCClassData.parentMtab =
_somGetPClsMtab(M_oemtempClassData.classObject);
_somSetClassData(M_oemtempClassData.classObject, (somClassDataStructure *)&M_oemClassData);
_somClassReady(M_oemtempClassData.classObject);
/* make newly created class object visible */
M_oemClassData.classObject = M_oemtempClassData.classObject;
}
M_oem * SOMLINK M_oemNewClass (integer4 scemajorVersion,
integer4 sceminorVersion)
{
SOMClass *pClsObj;
SOMClass *mClsObj;
/* Check the version numbers */
if (((scemajorVersion != 0) &&
(scemajorVersion != M_oem_MajorVersion)) ||
((sceminorVersion != 0) &&
(sceminorVersion > M_oem_MinorVersion))) {
somPrintf("M_oemNewClass: Error, bad version numbers.\n");
SOM_Error(SOMERROR_BadVersion);
}
/* Don't do anything if class object is already created. */
if (M_oemClassData.classObject != (SOMAny *) NULL)
return(M_oemClassData.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. */
M_PenLocatorPenNewClass(1,1); /* static reference */
pClsObj = _somFindClass(SOMClassMgrObject,
SOM_IdFromString("M_PenLocatorPen"), 1, 1);
if (pClsObj == (SOMClass *) NULL)
SOM_Error(SOMERROR_NoParentClass);
/* Use parent's metaclass */
mClsObj = SOM_GetClass(pClsObj);
somConstructClass(M_oemsomCreateClass, pClsObj, mClsObj,
&M_oemtempClassData);
return (M_oemClassData.classObject);
}
#endif /* M_oem_Class_Source */
#endif /* oem_ih */