home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
World_Of_Computer_Software-02-386-Vol-2of3.iso
/
b
/
blckh2.zip
/
BLACKHOL.IH
< prev
next >
Wrap
Text File
|
1992-11-19
|
12KB
|
444 lines
/*
* This file was generated by the SOM Compiler.
* FileName: BlackHol.ih.
* Generated using:
* SOM Precompiler spc: 1.22
* SOM Emitter emitih: 1.59
*/
/*
*
*
* DMan.CSC - Workplace Shell test
* ────────────────────────────────────────────────────────────────────┐
* │ Greg's Black Hole - anything you put in will disappear forever... │
* │ │
* └──────────────────┐ Gregory Czaja, CONT00 @ LEXVMK, November 1992 │
* └─────────────────────────────────────────────────
*/
#ifndef BlackHol_ih
#define BlackHol_ih
/*
* Passthru lines: File: "C.ih", "before"
*/
/* implementation defs for BlackHole */
/* PM definitions */
#define INCL_WIN
#define INCL_DOS
#define INCL_GPIBITMAPS
#include <os2.h>
#define INCL_WPCLASS
#define INCL_WPFOLDER
#include <pmwp.h>
/* internal definitions */
#define MYSTR_CLASSNAME "BlackHole"
#include "BlackHol.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 BlackHoleCClassData.parentMtab
#endif
#define BlackHole_MaxNoMethods 0
/*
* Instance data
*/
typedef struct {
PSZ mytext;
} BlackHoleData;
/*
* Instance variable access macros
*/
#define _mytext (somThis->mytext)
/*
* Getdata macro
*/
#define BlackHoleGetData(somSelf) \
((BlackHoleData *) \
SOM_DataResolve(somSelf, BlackHoleCClassData.instanceDataToken))
/*
* Trace/Debug macro
*/
#ifndef BlackHoleMethodDebug
#define BlackHoleMethodDebug(c,m) SOMMethodDebug(c,m)
#endif
/*
* Begin stuff that only goes in the primary file
*/
#ifdef BlackHole_Class_Source
/*
* Current class macros for Instance and Meta classes.
*/
#undef SOMMeta
#define SOMMeta M_BlackHoleCClassData.parentMtab
#undef SOMInstance
#define SOMInstance BlackHoleCClassData.parentMtab
#ifndef M_BlackHole_Class_Source
#define M_BlackHole_Class_Source
#endif /* M_BlackHole_Class_Source */
/*
* Generate the Apply Stubs.
*/
/*
* Overridden method: wpDragOver
*/
#pragma linkage(BlackHolX_wpDragOver, system)
SOM_Scope MRESULT SOMLINK BlackHolX_wpDragOver(BlackHole *somSelf,
HWND hwndCnr,
PDRAGINFO pdrgInfo);
#ifndef parent_wpDragOver
static char *somMN_wpDragOver = "wpDragOver";
static somId somId_wpDragOver = &somMN_wpDragOver;
#define parent_wpDragOver(somSelf,hwndCnr,pdrgInfo) \
((SOM_ParentResolveE(WPObject, SOM_CurrentClass, wpDragOver)) \
(somSelf,hwndCnr,pdrgInfo))
#endif
#define BlackHoleParent_wpDragOver parent_wpDragOver
/*
* Overridden method: wpDrop
*/
#pragma linkage(BlackHolX_wpDrop, system)
SOM_Scope MRESULT SOMLINK BlackHolX_wpDrop(BlackHole *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 BlackHoleParent_wpDrop parent_wpDrop
/*
* Temporary class data structure used only in class creation
*/
static somClassDataStructure BlackHoletempClassData;
/*
* Initialize the class data structure
*/
struct BlackHoleClassDataStructure BlackHoleClassData = {(SOMAny *) NULL};
/*
* Define the C class data structure
*/
struct BlackHoleCClassDataStructure BlackHoleCClassData = {(somMethodTab *) NULL};
/*
* Routines to create the class object
*/
/*
* Declare the Override Methods table.
*/
static somOverrideMethod_t BlackHoleOM[] = {
{ &somId_wpDragOver,
(somMethodProc *) BlackHolX_wpDragOver },
{ &somId_wpDrop,
(somMethodProc *) BlackHolX_wpDrop },
};
static void BlackHolesomInitializeClass ()
{
int i;
somOverrideMethod_t *omp;
/*
* Override methods.
*/
for (omp = BlackHoleOM, i = 0; i < 2; omp++, i++)
_somOverrideSMethod (BlackHoletempClassData.classObject,
*(omp->methodId), omp->method);
}
#pragma linkage(BlackHolesomCreateClass, system)
static void SOMLINK BlackHolesomCreateClass(SOMClass *pClsObj,
SOMClass *mClsObj)
{
BlackHoletempClassData.classObject = _somNew (mClsObj);
_somInitClass (BlackHoletempClassData.classObject,
"BlackHole",
pClsObj,
sizeof(BlackHoleData),
BlackHole_MaxNoMethods,
BlackHole_MajorVersion,
BlackHole_MinorVersion);
BlackHoleCClassData.instanceDataToken =
_somGetInstanceToken(BlackHoletempClassData.classObject);
BlackHolesomInitializeClass();
BlackHoleCClassData.parentMtab =
_somGetPClsMtab(BlackHoletempClassData.classObject);
_somSetClassData(BlackHoletempClassData.classObject, (somClassDataStructure *)&BlackHoleClassData);
_somClassReady(BlackHoletempClassData.classObject);
/* make newly created class object visible */
BlackHoleClassData.classObject = BlackHoletempClassData.classObject;
}
BlackHole * SOMLINK BlackHoleNewClass (integer4 scemajorVersion,
integer4 sceminorVersion)
{
SOMClass *pClsObj;
SOMClass *mClsObj;
/* Check the version numbers */
if (((scemajorVersion != 0) &&
(scemajorVersion != BlackHole_MajorVersion)) ||
((sceminorVersion != 0) &&
(sceminorVersion > BlackHole_MinorVersion))) {
somPrintf("BlackHoleNewClass: Error, bad version numbers.\n");
SOM_Error(SOMERROR_BadVersion);
}
/* Don't do anything if class object is already created. */
if (BlackHoleClassData.classObject != (SOMAny *) NULL)
return(BlackHoleClassData.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);
/* Explicit metaclass, so get it */
M_BlackHoleNewClass(0,0); /* static reference */
mClsObj = _somFindClass(SOMClassMgrObject,
SOM_IdFromString("M_BlackHole"), 0, 0);
if (mClsObj == (SOMClass *) NULL)
SOM_Error(SOMERROR_NoMetaClass);
somConstructClass(BlackHolesomCreateClass, pClsObj, mClsObj,
&BlackHoletempClassData);
return (BlackHoleClassData.classObject);
}
#endif /* BlackHole_Class_Source */
#endif /* BlackHol_ih */
/*
* This file was generated by the SOM Compiler.
* FileName: BlackHol.ih.
* Generated using:
* SOM Precompiler spc: 1.22
* SOM Emitter emitih: 1.59
*/
#ifndef BlackHol_mih
#define BlackHol_mih
/*
* 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 M_BlackHoleCClassData.parentMtab
#endif
#define M_BlackHole_MaxNoMethods 0
/*
* Instance data
*/
typedef void M_BlackHoleData;
/*
* Trace/Debug macro
*/
#ifndef M_BlackHoleMethodDebug
#define M_BlackHoleMethodDebug(c,m) SOMMethodDebug(c,m)
#endif
/*
* Begin stuff that only goes in the primary file
*/
#ifdef M_BlackHole_Class_Source
/*
* Current class macros for Instance and Meta classes.
*/
/*
* Generate the Apply Stubs.
*/
/*
* Overridden method: wpclsInitData
*/
#pragma linkage(BlackHolC_wpclsInitData, system)
SOM_Scope void SOMLINK BlackHolC_wpclsInitData(M_BlackHole *somSelf);
#ifndef parent_wpclsInitData
static char *somMN_wpclsInitData = "wpclsInitData";
static somId somId_wpclsInitData = &somMN_wpclsInitData;
#define parent_wpclsInitData(somSelf) \
((SOM_ParentResolveE(M_WPObject, SOM_CurrentClass, wpclsInitData)) \
(somSelf))
#endif
#define M_BlackHoleParent_wpclsInitData parent_wpclsInitData
/*
* Overridden method: wpclsUnInitData
*/
#pragma linkage(BlackHolC_wpclsUnInitData, system)
SOM_Scope void SOMLINK BlackHolC_wpclsUnInitData(M_BlackHole *somSelf);
#ifndef parent_wpclsUnInitData
static char *somMN_wpclsUnInitData = "wpclsUnInitData";
static somId somId_wpclsUnInitData = &somMN_wpclsUnInitData;
#define parent_wpclsUnInitData(somSelf) \
((SOM_ParentResolveE(M_WPObject, SOM_CurrentClass, wpclsUnInitData)) \
(somSelf))
#endif
#define M_BlackHoleParent_wpclsUnInitData parent_wpclsUnInitData
/*
* Temporary class data structure used only in class creation
*/
static somClassDataStructure M_BlackHoletempClassData;
/*
* Initialize the class data structure
*/
struct M_BlackHoleClassDataStructure M_BlackHoleClassData = {(SOMAny *) NULL};
/*
* Define the C class data structure
*/
struct M_BlackHoleCClassDataStructure M_BlackHoleCClassData = {(somMethodTab *) NULL};
/*
* Routines to create the class object
*/
/*
* Declare the Override Methods table.
*/
static somOverrideMethod_t M_BlackHoleOM[] = {
{ &somId_wpclsInitData,
(somMethodProc *) BlackHolC_wpclsInitData },
{ &somId_wpclsUnInitData,
(somMethodProc *) BlackHolC_wpclsUnInitData },
};
static void M_BlackHolesomInitializeClass ()
{
int i;
somOverrideMethod_t *omp;
/*
* Override methods.
*/
for (omp = M_BlackHoleOM, i = 0; i < 2; omp++, i++)
_somOverrideSMethod (M_BlackHoletempClassData.classObject,
*(omp->methodId), omp->method);
}
#pragma linkage(M_BlackHolesomCreateClass, system)
static void SOMLINK M_BlackHolesomCreateClass(SOMClass *pClsObj,
SOMClass *mClsObj)
{
M_BlackHoletempClassData.classObject = _somNew (mClsObj);
_somInitClass (M_BlackHoletempClassData.classObject,
"M_BlackHole",
pClsObj,
0,
M_BlackHole_MaxNoMethods,
M_BlackHole_MajorVersion,
M_BlackHole_MinorVersion);
M_BlackHoleCClassData.instanceDataToken =
_somGetInstanceToken(M_BlackHoletempClassData.classObject);
M_BlackHolesomInitializeClass();
M_BlackHoleCClassData.parentMtab =
_somGetPClsMtab(M_BlackHoletempClassData.classObject);
_somSetClassData(M_BlackHoletempClassData.classObject, (somClassDataStructure *)&M_BlackHoleClassData);
_somClassReady(M_BlackHoletempClassData.classObject);
/* make newly created class object visible */
M_BlackHoleClassData.classObject = M_BlackHoletempClassData.classObject;
}
M_BlackHole * SOMLINK M_BlackHoleNewClass (integer4 scemajorVersion,
integer4 sceminorVersion)
{
SOMClass *pClsObj;
SOMClass *mClsObj;
/* Check the version numbers */
if (((scemajorVersion != 0) &&
(scemajorVersion != M_BlackHole_MajorVersion)) ||
((sceminorVersion != 0) &&
(sceminorVersion > M_BlackHole_MinorVersion))) {
somPrintf("M_BlackHoleNewClass: Error, bad version numbers.\n");
SOM_Error(SOMERROR_BadVersion);
}
/* Don't do anything if class object is already created. */
if (M_BlackHoleClassData.classObject != (SOMAny *) NULL)
return(M_BlackHoleClassData.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_WPAbstractNewClass(1,2); /* static reference */
pClsObj = _somFindClass(SOMClassMgrObject,
SOM_IdFromString("M_WPAbstract"), 1, 2);
if (pClsObj == (SOMClass *) NULL)
SOM_Error(SOMERROR_NoParentClass);
/* Use parent's metaclass */
mClsObj = SOM_GetClass(pClsObj);
somConstructClass(M_BlackHolesomCreateClass, pClsObj, mClsObj,
&M_BlackHoletempClassData);
return (M_BlackHoleClassData.classObject);
}
#endif /* M_BlackHole_Class_Source */
#endif /* BlackHol_ih */