home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
WPSDEM.ZIP
/
WHOAMI
/
WHOAMI.IH
< prev
next >
Wrap
Text File
|
1992-04-30
|
5KB
|
190 lines
/*
* This file was generated by the SOM Compiler.
* FileName: whoami.ih.
* Generated using:
* SOM Precompiler spc: 1.22
* SOM Emitter emitih: 1.59
*/
#ifndef whoami_ih
#define whoami_ih
/*
* Passthru lines: File: "C.ih", "before"
*/
#define INCL_WINWORKPLACE
#include <os2.h>
#include "whoami.h"
/*
* Set the scope of methods functions
*/
#ifndef SOM_Scope
#define SOM_Scope static
#endif
#ifndef SOM_CurrentClass
#define SOM_CurrentClass WhoamiCClassData.parentMtab
#endif
#define Whoami_MaxNoMethods 0
/*
* Instance data
*/
typedef void WhoamiData;
/*
* Trace/Debug macro
*/
#ifndef WhoamiMethodDebug
#define WhoamiMethodDebug(c,m) SOMMethodDebug(c,m)
#endif
/*
* Begin stuff that only goes in the primary file
*/
#ifdef Whoami_Class_Source
/*
* Current class macros for Instance and Meta classes.
*/
#undef SOMMeta
#define SOMMeta M_WhoamiCClassData.parentMtab
#undef SOMInstance
#define SOMInstance WhoamiCClassData.parentMtab
#ifndef M_Whoami_Class_Source
#define M_Whoami_Class_Source
#endif /* M_Whoami_Class_Source */
/*
* Generate the Apply Stubs.
*/
/*
* Overridden method: wpDrop
*/
#pragma linkage(wpDrop, system)
SOM_Scope MRESULT SOMLINK wpDrop(Whoami *somSelf,
HWND hwndCnr,
PDRAGINFO pdrgInfo,
PDRAGITEM pdrgItem);
#ifndef parent_wpDrop
static char *somMN_wpDrop = "wpDrop";
static somId somId_wpDrop = &somMN_wpDrop;
#define parent_wpDrop(somSelf,hwndCnr,pdrgInfo,pdrgItem) \
((SOM_ParentResolveE(WPObject, SOM_CurrentClass, wpDrop)) \
(somSelf,hwndCnr,pdrgInfo,pdrgItem))
#endif
#define WhoamiParent_wpDrop parent_wpDrop
/*
* Temporary class data structure used only in class creation
*/
static somClassDataStructure WhoamitempClassData;
/*
* Initialize the class data structure
*/
struct WhoamiClassDataStructure WhoamiClassData = {(SOMAny *) NULL};
/*
* Define the C class data structure
*/
struct WhoamiCClassDataStructure WhoamiCClassData = {(somMethodTab *) NULL};
/*
* Routines to create the class object
*/
/*
* Declare the Override Methods table.
*/
static somOverrideMethod_t WhoamiOM[] = {
{ &somId_wpDrop,
(somMethodProc *) wpDrop },
};
static void WhoamisomInitializeClass ()
{
int i;
somOverrideMethod_t *omp;
/*
* Override methods.
*/
for (omp = WhoamiOM, i = 0; i < 1; omp++, i++)
_somOverrideSMethod (WhoamitempClassData.classObject,
*(omp->methodId), omp->method);
}
#pragma linkage(WhoamisomCreateClass, system)
static void SOMLINK WhoamisomCreateClass(SOMClass *pClsObj,
SOMClass *mClsObj)
{
WhoamitempClassData.classObject = _somNew (mClsObj);
_somInitClass (WhoamitempClassData.classObject,
"Whoami",
pClsObj,
0,
Whoami_MaxNoMethods,
Whoami_MajorVersion,
Whoami_MinorVersion);
WhoamiCClassData.instanceDataToken =
_somGetInstanceToken(WhoamitempClassData.classObject);
WhoamisomInitializeClass();
WhoamiCClassData.parentMtab =
_somGetPClsMtab(WhoamitempClassData.classObject);
_somSetClassData(WhoamitempClassData.classObject, (somClassDataStructure *)&WhoamiClassData);
_somClassReady(WhoamitempClassData.classObject);
/* make newly created class object visible */
WhoamiClassData.classObject = WhoamitempClassData.classObject;
}
Whoami * SOMLINK WhoamiNewClass (integer4 scemajorVersion,
integer4 sceminorVersion)
{
SOMClass *pClsObj;
SOMClass *mClsObj;
/* Check the version numbers */
if (((scemajorVersion != 0) &&
(scemajorVersion != Whoami_MajorVersion)) ||
((sceminorVersion != 0) &&
(sceminorVersion > Whoami_MinorVersion))) {
somPrintf("WhoamiNewClass: Error, bad version numbers.\n");
SOM_Error(SOMERROR_BadVersion);
}
/* Don't do anything if class object is already created. */
if (WhoamiClassData.classObject != (SOMAny *) NULL)
return(WhoamiClassData.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. */
WPAbstractNewClass(1,2); /* static reference */
pClsObj = _somFindClass(SOMClassMgrObject,
SOM_IdFromString("WPAbstract"), 1, 2);
if (pClsObj == (SOMClass *) NULL)
SOM_Error(SOMERROR_NoParentClass);
/* Use parent's metaclass */
mClsObj = SOM_GetClass(pClsObj);
somConstructClass(WhoamisomCreateClass, pClsObj, mClsObj,
&WhoamitempClassData);
return (WhoamiClassData.classObject);
}
#endif /* Whoami_Class_Source */
#endif /* whoami_ih */