home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
mnicon2.zip
/
MNIcon.ih
< prev
next >
Wrap
Text File
|
1996-02-06
|
10KB
|
398 lines
/*
* This file was generated by the SOM Compiler.
* FileName: MNIcon.ih.
* Generated using:
* SOM Precompiler spc: 1.22
* SOM Emitter emitih: 1.59
*/
/*
* MNIcon class release 1.0 (02/21/93) by Makoto Nagata
*/
#ifndef MNIcon_ih
#define MNIcon_ih
/*
* Passthru lines: File: "C.ih", "before"
*/
#define INCL_32
#define INCL_WIN
#include <os2.h>
#include "MNIcon.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 MNIconCClassData.parentMtab
#endif
#define MNIcon_MaxNoMethods 0
/*
* Instance data
*/
typedef void MNIconData;
/*
* Trace/Debug macro
*/
#ifndef MNIconMethodDebug
#define MNIconMethodDebug(c,m) SOMMethodDebug(c,m)
#endif
/*
* Begin stuff that only goes in the primary file
*/
#ifdef MNIcon_Class_Source
/*
* Current class macros for Instance and Meta classes.
*/
#undef SOMMeta
#define SOMMeta M_MNIconCClassData.parentMtab
#undef SOMInstance
#define SOMInstance MNIconCClassData.parentMtab
#ifndef M_MNIcon_Class_Source
#define M_MNIcon_Class_Source
#endif /* M_MNIcon_Class_Source */
/*
* Generate the Apply Stubs.
*/
/*
* Overridden method: wpDragOver
*/
#pragma linkage(mnicon_wpDragOver, system)
SOM_Scope MRESULT SOMLINK mnicon_wpDragOver(MNIcon *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 MNIconParent_wpDragOver parent_wpDragOver
/*
* Overridden method: wpDrop
*/
#pragma linkage(mnicon_wpDrop, system)
SOM_Scope MRESULT SOMLINK mnicon_wpDrop(MNIcon *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 MNIconParent_wpDrop parent_wpDrop
/*
* Temporary class data structure used only in class creation
*/
static somClassDataStructure MNIcontempClassData;
/*
* Initialize the class data structure
*/
struct MNIconClassDataStructure MNIconClassData = {(SOMAny *) NULL};
/*
* Define the C class data structure
*/
struct MNIconCClassDataStructure MNIconCClassData = {(somMethodTab *) NULL};
/*
* Routines to create the class object
*/
/*
* Declare the Override Methods table.
*/
static somOverrideMethod_t MNIconOM[] = {
{ &somId_wpDragOver,
(somMethodProc *) mnicon_wpDragOver },
{ &somId_wpDrop,
(somMethodProc *) mnicon_wpDrop },
};
static void MNIconsomInitializeClass ()
{
int i;
somOverrideMethod_t *omp;
/*
* Override methods.
*/
for (omp = MNIconOM, i = 0; i < 2; omp++, i++)
_somOverrideSMethod (MNIcontempClassData.classObject,
*(omp->methodId), omp->method);
}
#pragma linkage(MNIconsomCreateClass, system)
static void SOMLINK MNIconsomCreateClass(SOMClass *pClsObj,
SOMClass *mClsObj)
{
MNIcontempClassData.classObject = _somNew (mClsObj);
_somInitClass (MNIcontempClassData.classObject,
"MNIcon",
pClsObj,
0,
MNIcon_MaxNoMethods,
MNIcon_MajorVersion,
MNIcon_MinorVersion);
MNIconCClassData.instanceDataToken =
_somGetInstanceToken(MNIcontempClassData.classObject);
MNIconsomInitializeClass();
MNIconCClassData.parentMtab =
_somGetPClsMtab(MNIcontempClassData.classObject);
_somSetClassData(MNIcontempClassData.classObject, (somClassDataStructure *)&MNIconClassData);
_somClassReady(MNIcontempClassData.classObject);
/* make newly created class object visible */
MNIconClassData.classObject = MNIcontempClassData.classObject;
}
MNIcon * SOMLINK MNIconNewClass (integer4 scemajorVersion,
integer4 sceminorVersion)
{
SOMClass *pClsObj;
SOMClass *mClsObj;
/* Check the version numbers */
if (((scemajorVersion != 0) &&
(scemajorVersion != MNIcon_MajorVersion)) ||
((sceminorVersion != 0) &&
(sceminorVersion > MNIcon_MinorVersion))) {
somPrintf("MNIconNewClass: Error, bad version numbers.\n");
SOM_Error(SOMERROR_BadVersion);
}
/* Don't do anything if class object is already created. */
if (MNIconClassData.classObject != (SOMAny *) NULL)
return(MNIconClassData.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. */
WPIconNewClass(1,2); /* static reference */
pClsObj = _somFindClass(SOMClassMgrObject,
SOM_IdFromString("WPIcon"), 1, 2);
if (pClsObj == (SOMClass *) NULL)
SOM_Error(SOMERROR_NoParentClass);
/* Explicit metaclass, so get it */
M_MNIconNewClass(0,0); /* static reference */
mClsObj = _somFindClass(SOMClassMgrObject,
SOM_IdFromString("M_MNIcon"), 0, 0);
if (mClsObj == (SOMClass *) NULL)
SOM_Error(SOMERROR_NoMetaClass);
somConstructClass(MNIconsomCreateClass, pClsObj, mClsObj,
&MNIcontempClassData);
return (MNIconClassData.classObject);
}
#endif /* MNIcon_Class_Source */
#endif /* MNIcon_ih */
/*
* This file was generated by the SOM Compiler.
* FileName: MNIcon.ih.
* Generated using:
* SOM Precompiler spc: 1.22
* SOM Emitter emitih: 1.59
*/
#ifndef MNIcon_mih
#define MNIcon_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_MNIconCClassData.parentMtab
#endif
#define M_MNIcon_MaxNoMethods 0
/*
* Instance data
*/
typedef void M_MNIconData;
/*
* Trace/Debug macro
*/
#ifndef M_MNIconMethodDebug
#define M_MNIconMethodDebug(c,m) SOMMethodDebug(c,m)
#endif
/*
* Begin stuff that only goes in the primary file
*/
#ifdef M_MNIcon_Class_Source
/*
* Current class macros for Instance and Meta classes.
*/
/*
* Generate the Apply Stubs.
*/
/*
* Overridden method: wpclsQueryTitle
*/
#pragma linkage(mniconM_wpclsQueryTitle, system)
SOM_Scope PSZ SOMLINK mniconM_wpclsQueryTitle(M_MNIcon *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_MNIconParent_wpclsQueryTitle parent_wpclsQueryTitle
/*
* Temporary class data structure used only in class creation
*/
static somClassDataStructure M_MNIcontempClassData;
/*
* Initialize the class data structure
*/
struct M_MNIconClassDataStructure M_MNIconClassData = {(SOMAny *) NULL};
/*
* Define the C class data structure
*/
struct M_MNIconCClassDataStructure M_MNIconCClassData = {(somMethodTab *) NULL};
/*
* Routines to create the class object
*/
/*
* Declare the Override Methods table.
*/
static somOverrideMethod_t M_MNIconOM[] = {
{ &somId_wpclsQueryTitle,
(somMethodProc *) mniconM_wpclsQueryTitle },
};
static void M_MNIconsomInitializeClass ()
{
int i;
somOverrideMethod_t *omp;
/*
* Override methods.
*/
for (omp = M_MNIconOM, i = 0; i < 1; omp++, i++)
_somOverrideSMethod (M_MNIcontempClassData.classObject,
*(omp->methodId), omp->method);
}
#pragma linkage(M_MNIconsomCreateClass, system)
static void SOMLINK M_MNIconsomCreateClass(SOMClass *pClsObj,
SOMClass *mClsObj)
{
M_MNIcontempClassData.classObject = _somNew (mClsObj);
_somInitClass (M_MNIcontempClassData.classObject,
"M_MNIcon",
pClsObj,
0,
M_MNIcon_MaxNoMethods,
M_MNIcon_MajorVersion,
M_MNIcon_MinorVersion);
M_MNIconCClassData.instanceDataToken =
_somGetInstanceToken(M_MNIcontempClassData.classObject);
M_MNIconsomInitializeClass();
M_MNIconCClassData.parentMtab =
_somGetPClsMtab(M_MNIcontempClassData.classObject);
_somSetClassData(M_MNIcontempClassData.classObject, (somClassDataStructure *)&M_MNIconClassData);
_somClassReady(M_MNIcontempClassData.classObject);
/* make newly created class object visible */
M_MNIconClassData.classObject = M_MNIcontempClassData.classObject;
}
M_MNIcon * SOMLINK M_MNIconNewClass (integer4 scemajorVersion,
integer4 sceminorVersion)
{
SOMClass *pClsObj;
SOMClass *mClsObj;
/* Check the version numbers */
if (((scemajorVersion != 0) &&
(scemajorVersion != M_MNIcon_MajorVersion)) ||
((sceminorVersion != 0) &&
(sceminorVersion > M_MNIcon_MinorVersion))) {
somPrintf("M_MNIconNewClass: Error, bad version numbers.\n");
SOM_Error(SOMERROR_BadVersion);
}
/* Don't do anything if class object is already created. */
if (M_MNIconClassData.classObject != (SOMAny *) NULL)
return(M_MNIconClassData.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_WPIconNewClass(1,2); /* static reference */
pClsObj = _somFindClass(SOMClassMgrObject,
SOM_IdFromString("M_WPIcon"), 1, 2);
if (pClsObj == (SOMClass *) NULL)
SOM_Error(SOMERROR_NoParentClass);
/* Use parent's metaclass */
mClsObj = SOM_GetClass(pClsObj);
somConstructClass(M_MNIconsomCreateClass, pClsObj, mClsObj,
&M_MNIcontempClassData);
return (M_MNIconClassData.classObject);
}
#endif /* M_MNIcon_Class_Source */
#endif /* MNIcon_ih */