home *** CD-ROM | disk | FTP | other *** search
-
- /*
- * This file was generated by the SOM Compiler.
- * FileName: wpnewf.ih.
- * Generated using:
- * SOM Precompiler spc: 1.22
- * SOM Emitter emitih: 1.60
- */
-
- /*
- *
- * New Program object: It closes the parent folder upon launching it
- * Written by : Ghassan Salem
- */
-
-
- #ifndef WPNewF_ih
- #define WPNewF_ih
-
-
- /*
- * Passthru lines: File: "C.ih", "before"
- */
- #define INCL_WINWINDOWMGR
- #define INCL_WININPUT
- #define INCL_DOSPROCESS
- #define INCL_WINMESSAGEMGR
- #define INCL_WINPROGRAMLIST
- #include <os2.h>
- /* internal definitions */
- #define ID_CLOSEANDR (WPMENUID_USER+1) /* menus added to popup menu */
- #define IDM_CLOSEANDR (WPMENUID_USER+2)
-
- #define MYSTR_CLASSNAME "WPNewF"
-
- #include "WPNewF.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 WPNewFCClassData.parentMtab
- #endif
-
- #define WPNewF_MaxNoMethods 0
-
- /*
- * Instance data
- */
- typedef struct {
- PSZ pszMyHeader;
- } WPNewFData;
-
- /*
- * Instance variable access macros
- */
- #define _pszMyHeader (somThis->pszMyHeader)
-
- /*
- * Getdata macro
- */
- #define WPNewFGetData(somSelf) \
- ((WPNewFData *) \
- SOM_DataResolve(somSelf, WPNewFCClassData.instanceDataToken))
-
- /*
- * Trace/Debug macro
- */
- #ifndef WPNewFMethodDebug
- #define WPNewFMethodDebug(c,m) SOMMethodDebug(c,m)
- #endif
-
- /*
- * Begin stuff that only goes in the primary file
- */
- #ifdef WPNewF_Class_Source
-
- /*
- * Current class macros for Instance and Meta classes.
- */
- #undef SOMMeta
- #define SOMMeta M_WPNewFCClassData.parentMtab
- #undef SOMInstance
- #define SOMInstance WPNewFCClassData.parentMtab
-
- #ifndef M_WPNewF_Class_Source
- #define M_WPNewF_Class_Source
- #endif /* M_WPNewF_Class_Source */
-
- /*
- * Generate the Apply Stubs.
- */
-
- /*
- * Overridden method: wpOpen
- */
- #pragma linkage(WPNewFX_wpOpen, system)
- SOM_Scope HWND SOMLINK WPNewFX_wpOpen(WPNewF *somSelf,
- HWND hwndCnr,
- ULONG ulView,
- ULONG param);
- #ifndef parent_wpOpen
- static char *somMN_wpOpen = "wpOpen";
- static somId somId_wpOpen = &somMN_wpOpen;
- #define parent_wpOpen(somSelf,hwndCnr,ulView,param) \
- ((SOM_ParentResolveE(WPObject, SOM_CurrentClass, wpOpen)) \
- (somSelf,hwndCnr,ulView,param))
- #endif
- #define WPNewFParent_wpOpen parent_wpOpen
-
- /*
- * Temporary class data structure used only in class creation
- */
- static somClassDataStructure WPNewFtempClassData;
-
- /*
- * Initialize the class data structure
- */
- struct WPNewFClassDataStructure WPNewFClassData = {(SOMAny *) NULL};
-
- /*
- * Define the C class data structure
- */
- struct WPNewFCClassDataStructure WPNewFCClassData = {(somMethodTab *) NULL};
-
- /*
- * Routines to create the class object
- */
-
- /*
- * Declare the Override Methods table.
- */
- static somOverrideMethod_t WPNewFOM[] = {
- { &somId_wpOpen,
- (somMethodProc *) WPNewFX_wpOpen },
- };
-
- static void WPNewFsomInitializeClass (void)
- {
- int i;
- somOverrideMethod_t *omp;
-
- /*
- * Override methods.
- */
- for (omp = WPNewFOM, i = 0; i < 1; omp++, i++)
- _somOverrideSMethod (WPNewFtempClassData.classObject,
- *(omp->methodId), omp->method);
-
- }
-
- #pragma linkage(WPNewFsomCreateClass, system)
- static void SOMLINK WPNewFsomCreateClass(SOMClass *pClsObj,
- SOMClass *mClsObj)
- {
- WPNewFtempClassData.classObject = _somNew (mClsObj);
- _somInitClass (WPNewFtempClassData.classObject,
- "WPNewF",
- pClsObj,
- sizeof(WPNewFData),
- WPNewF_MaxNoMethods,
- WPNewF_MajorVersion,
- WPNewF_MinorVersion);
- WPNewFCClassData.instanceDataToken =
- _somGetInstanceToken(WPNewFtempClassData.classObject);
- WPNewFsomInitializeClass();
- WPNewFCClassData.parentMtab =
- _somGetPClsMtab(WPNewFtempClassData.classObject);
- _somSetClassData(WPNewFtempClassData.classObject, (somClassDataStructure *)&WPNewFClassData);
- _somClassReady(WPNewFtempClassData.classObject);
- /* make newly created class object visible */
- WPNewFClassData.classObject = WPNewFtempClassData.classObject;
- }
-
- WPNewF * SOMLINK WPNewFNewClass (integer4 scemajorVersion,
- integer4 sceminorVersion)
- {
- SOMClass *pClsObj;
- SOMClass *mClsObj;
-
- /* Check the version numbers */
- if (((scemajorVersion != 0) &&
- (scemajorVersion != WPNewF_MajorVersion)) ||
- ((sceminorVersion != 0) &&
- (sceminorVersion > WPNewF_MinorVersion))) {
- somPrintf("WPNewFNewClass: Error, bad version numbers.\n");
- SOM_Error(SOMERROR_BadVersion);
- }
- /* Don't do anything if class object is already created. */
- if (WPNewFClassData.classObject != (SOMAny *) NULL)
- return(WPNewFClassData.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. */
- WPFolderNewClass(1,1); /* static reference */
- pClsObj = _somFindClass(SOMClassMgrObject,
- SOM_IdFromString("WPFolder"), 1, 1);
- if (pClsObj == (SOMClass *) NULL)
- SOM_Error(SOMERROR_NoParentClass);
-
- /* Use parent's metaclass */
- mClsObj = SOM_GetClass(pClsObj);
-
- somConstructClass(WPNewFsomCreateClass, pClsObj, mClsObj,
- &WPNewFtempClassData);
- return (WPNewFClassData.classObject);
- }
-
- #endif /* WPNewF_Class_Source */
-
- #endif /* WPNewF_ih */
-