home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 14 Text / 14-Text.zip / RB3774.ZIP / RECORD.ZIP / RECORD.IH < prev    next >
Text File  |  1992-04-10  |  23KB  |  736 lines

  1.  
  2. /*
  3.  * This file was generated by the SOM Compiler.
  4.  * FileName: record.ih.
  5.  * Generated using:
  6.  *     SOM Precompiler spc: 1.22
  7.  *     SOM Emitter emitih: 1.59
  8.  */
  9.  
  10. #ifndef record_ih
  11. #define record_ih
  12.  
  13.  
  14. #include "record.h"
  15.  
  16. /*
  17.  * Set the scope of methods functions
  18.  */
  19. #ifndef SOM_Scope
  20. #ifdef __cplusplus
  21. #define SOM_Scope extern "C"
  22. #else
  23. #define SOM_Scope extern
  24. #endif
  25. #endif
  26.  
  27. #ifndef SOM_CurrentClass
  28. #define SOM_CurrentClass RecordCClassData.parentMtab
  29. #endif
  30.  
  31. #define Record_MaxNoMethods 2
  32.  
  33. /*
  34.  * Instance data
  35.  */
  36. typedef struct {
  37.     PSZ pRecordData;
  38. } RecordData;
  39.  
  40. /*
  41.  * Instance variable access macros
  42.  */
  43. #define _pRecordData (somThis->pRecordData)
  44.  
  45. /*
  46.  * Getdata macro
  47.  */
  48. #define RecordGetData(somSelf) \
  49.     ((RecordData *) \
  50.         SOM_DataResolve(somSelf, RecordCClassData.instanceDataToken))
  51.  
  52. /*
  53.  * Trace/Debug macro
  54.  */
  55. #ifndef RecordMethodDebug
  56. #define RecordMethodDebug(c,m) SOMMethodDebug(c,m)
  57. #endif
  58.  
  59. /*
  60.  * Begin stuff that only goes in the primary file
  61.  */
  62. #ifdef Record_Class_Source
  63.  
  64. /*
  65.  * Current class macros for Instance and Meta classes.
  66.  */
  67. #undef SOMMeta
  68. #define SOMMeta M_RecordCClassData.parentMtab
  69. #undef SOMInstance
  70. #define SOMInstance RecordCClassData.parentMtab
  71.  
  72. #ifndef M_Record_Class_Source
  73. #define M_Record_Class_Source
  74. #endif    /* M_Record_Class_Source */
  75.  
  76. /*
  77.  * Generate the Apply Stubs.
  78.  */
  79. #pragma linkage(somAP_SetRecordInfo, system)
  80. static BOOL   SOMLINK somAP_SetRecordInfo(Record *somSelf,
  81.         somId __id,
  82.         somId __desc,
  83.         va_list __ap)
  84. {
  85.     PSZ szData = va_arg(__ap, PSZ);
  86.     __ap; __id; __desc;           /* Referenced to prevent warning msg */
  87.  
  88.     return (Record_SetRecordInfo(somSelf,szData));
  89. }
  90.  
  91. #pragma linkage(somAP_GetRecordInfo, system)
  92. static BOOL   SOMLINK somAP_GetRecordInfo(Record *somSelf,
  93.         somId __id,
  94.         somId __desc,
  95.         va_list __ap)
  96. {
  97.     PSZ szData = va_arg(__ap, PSZ);
  98.     __ap; __id; __desc;           /* Referenced to prevent warning msg */
  99.  
  100.     return (Record_GetRecordInfo(somSelf,szData));
  101. }
  102.  
  103.  
  104. /*
  105.  * Overridden method: wpInitData
  106.  */
  107. #pragma linkage(record_wpInitData, system)
  108. SOM_Scope void   SOMLINK record_wpInitData(Record *somSelf);
  109. #ifndef parent_wpInitData
  110. static char *somMN_wpInitData = "wpInitData";
  111. static somId somId_wpInitData = &somMN_wpInitData;
  112. #define parent_wpInitData(somSelf) \
  113.     ((SOM_ParentResolveE(WPObject, SOM_CurrentClass, wpInitData)) \
  114.      (somSelf))
  115. #endif
  116. #define RecordParent_wpInitData parent_wpInitData
  117.  
  118. /*
  119.  * Overridden method: wpUnInitData
  120.  */
  121. #pragma linkage(record_wpUnInitData, system)
  122. SOM_Scope void   SOMLINK record_wpUnInitData(Record *somSelf);
  123. #ifndef parent_wpUnInitData
  124. static char *somMN_wpUnInitData = "wpUnInitData";
  125. static somId somId_wpUnInitData = &somMN_wpUnInitData;
  126. #define parent_wpUnInitData(somSelf) \
  127.     ((SOM_ParentResolveE(WPObject, SOM_CurrentClass, wpUnInitData)) \
  128.      (somSelf))
  129. #endif
  130. #define RecordParent_wpUnInitData parent_wpUnInitData
  131.  
  132. /*
  133.  * Overridden method: wpModifyPopupMenu
  134.  */
  135. #pragma linkage(record_wpModifyPopupMenu, system)
  136. SOM_Scope BOOL   SOMLINK record_wpModifyPopupMenu(Record *somSelf,
  137.         HWND hwndMenu,
  138.         HWND hwndCnr,
  139.         ULONG iPosition);
  140. #ifndef parent_wpModifyPopupMenu
  141. static char *somMN_wpModifyPopupMenu = "wpModifyPopupMenu";
  142. static somId somId_wpModifyPopupMenu = &somMN_wpModifyPopupMenu;
  143. #define parent_wpModifyPopupMenu(somSelf,hwndMenu,hwndCnr,iPosition) \
  144.     ((SOM_ParentResolveE(WPObject, SOM_CurrentClass, wpModifyPopupMenu)) \
  145.      (somSelf,hwndMenu,hwndCnr,iPosition))
  146. #endif
  147. #define RecordParent_wpModifyPopupMenu parent_wpModifyPopupMenu
  148.  
  149. /*
  150.  * Overridden method: wpMenuItemSelected
  151.  */
  152. #pragma linkage(record_wpMenuItemSelected, system)
  153. SOM_Scope BOOL   SOMLINK record_wpMenuItemSelected(Record *somSelf,
  154.         HWND hwndFrame,
  155.         ULONG ulMenuId);
  156. #ifndef parent_wpMenuItemSelected
  157. static char *somMN_wpMenuItemSelected = "wpMenuItemSelected";
  158. static somId somId_wpMenuItemSelected = &somMN_wpMenuItemSelected;
  159. #define parent_wpMenuItemSelected(somSelf,hwndFrame,ulMenuId) \
  160.     ((SOM_ParentResolveE(WPObject, SOM_CurrentClass, wpMenuItemSelected)) \
  161.      (somSelf,hwndFrame,ulMenuId))
  162. #endif
  163. #define RecordParent_wpMenuItemSelected parent_wpMenuItemSelected
  164.  
  165. /*
  166.  * Overridden method: wpOpen
  167.  */
  168. #pragma linkage(record_wpOpen, system)
  169. SOM_Scope HWND   SOMLINK record_wpOpen(Record *somSelf,
  170.         HWND hwndCnr,
  171.         ULONG ulView,
  172.         ULONG param);
  173. #ifndef parent_wpOpen
  174. static char *somMN_wpOpen = "wpOpen";
  175. static somId somId_wpOpen = &somMN_wpOpen;
  176. #define parent_wpOpen(somSelf,hwndCnr,ulView,param) \
  177.     ((SOM_ParentResolveE(WPObject, SOM_CurrentClass, wpOpen)) \
  178.      (somSelf,hwndCnr,ulView,param))
  179. #endif
  180. #define RecordParent_wpOpen parent_wpOpen
  181.  
  182. /*
  183.  * Overridden method: wpSetup
  184.  */
  185. #pragma linkage(record_wpSetup, system)
  186. SOM_Scope BOOL   SOMLINK record_wpSetup(Record *somSelf,
  187.         PSZ pszSetupString);
  188. #ifndef parent_wpSetup
  189. static char *somMN_wpSetup = "wpSetup";
  190. static somId somId_wpSetup = &somMN_wpSetup;
  191. #define parent_wpSetup(somSelf,pszSetupString) \
  192.     ((SOM_ParentResolveE(WPObject, SOM_CurrentClass, wpSetup)) \
  193.      (somSelf,pszSetupString))
  194. #endif
  195. #define RecordParent_wpSetup parent_wpSetup
  196.  
  197. /*
  198.  * Temporary class data structure used only in class creation
  199.  */
  200. static somClassDataStructure RecordtempClassData;
  201.  
  202. /*
  203.  * Initialize the class data structure
  204.  */
  205. struct RecordClassDataStructure RecordClassData = {(SOMAny *) NULL};
  206.  
  207. /*
  208.  * Define the C class data structure
  209.  */
  210. struct RecordCClassDataStructure RecordCClassData = {(somMethodTab *) NULL};
  211.  
  212. /*
  213.  * New Method: SetRecordInfo
  214.  */
  215. #pragma linkage(record_SetRecordInfo, system)
  216. SOM_Scope BOOL   SOMLINK record_SetRecordInfo(Record *somSelf,
  217.         PSZ szData);
  218. static char *somMN_SetRecordInfo = "SetRecordInfo";
  219. static somId somId_SetRecordInfo = &somMN_SetRecordInfo;
  220. static char *somDS_SetRecordInfo = somMD_Record_SetRecordInfo;
  221. static somId somDI_SetRecordInfo = &somDS_SetRecordInfo;
  222. #pragma linkage(somRD_SetRecordInfo, system)
  223. static BOOL   SOMLINK somRD_SetRecordInfo(Record *somSelf,
  224.         PSZ szData)
  225. {
  226.     return ((BOOL) va_somDispatchL(somSelf, somId_SetRecordInfo,
  227.         _somGetMethodDescriptor(SOM_GetClass(somSelf),somId_SetRecordInfo),szData));
  228. }
  229.  
  230. /*
  231.  * New Method: GetRecordInfo
  232.  */
  233. #pragma linkage(record_GetRecordInfo, system)
  234. SOM_Scope BOOL   SOMLINK record_GetRecordInfo(Record *somSelf,
  235.         PSZ szData);
  236. static char *somMN_GetRecordInfo = "GetRecordInfo";
  237. static somId somId_GetRecordInfo = &somMN_GetRecordInfo;
  238. static char *somDS_GetRecordInfo = somMD_Record_GetRecordInfo;
  239. static somId somDI_GetRecordInfo = &somDS_GetRecordInfo;
  240. #pragma linkage(somRD_GetRecordInfo, system)
  241. static BOOL   SOMLINK somRD_GetRecordInfo(Record *somSelf,
  242.         PSZ szData)
  243. {
  244.     return ((BOOL) va_somDispatchL(somSelf, somId_GetRecordInfo,
  245.         _somGetMethodDescriptor(SOM_GetClass(somSelf),somId_GetRecordInfo),szData));
  246. }
  247.  
  248. /*
  249.  * Routines to create the class object
  250.  */
  251.  
  252. /*
  253.  * Declare the Static Methods table.
  254.  */
  255. static somStaticMethod_t RecordSM[] = {
  256.     {    &RecordClassData.SetRecordInfo,
  257.          &somId_SetRecordInfo,
  258.          &somDI_SetRecordInfo,
  259.          (somMethodProc *) record_SetRecordInfo,
  260.          (somMethodProc *) somRD_SetRecordInfo,
  261.          (somMethodProc *) somAP_SetRecordInfo    },
  262.     {    &RecordClassData.GetRecordInfo,
  263.          &somId_GetRecordInfo,
  264.          &somDI_GetRecordInfo,
  265.          (somMethodProc *) record_GetRecordInfo,
  266.          (somMethodProc *) somRD_GetRecordInfo,
  267.          (somMethodProc *) somAP_GetRecordInfo    },
  268. };
  269.  
  270.  
  271. /*
  272.  * Declare the Override Methods table.
  273.  */
  274. static somOverrideMethod_t RecordOM[] = {
  275.     {    &somId_wpInitData,
  276.          (somMethodProc *) record_wpInitData    },
  277.     {    &somId_wpUnInitData,
  278.          (somMethodProc *) record_wpUnInitData    },
  279.     {    &somId_wpModifyPopupMenu,
  280.          (somMethodProc *) record_wpModifyPopupMenu    },
  281.     {    &somId_wpMenuItemSelected,
  282.          (somMethodProc *) record_wpMenuItemSelected    },
  283.     {    &somId_wpOpen,
  284.          (somMethodProc *) record_wpOpen    },
  285.     {    &somId_wpSetup,
  286.          (somMethodProc *) record_wpSetup    },
  287. };
  288.  
  289. static void RecordsomInitializeClass ()
  290. {
  291.     int i;
  292.     somStaticMethod_t *smp;
  293.     somOverrideMethod_t *omp;
  294.  
  295. /*
  296.  * Add the Static Methods.
  297.  */
  298.     for (smp = RecordSM, i = 0; i < 2; smp++, i++)
  299.         *(smp->classData) =
  300.             _somAddStaticMethod (RecordtempClassData.classObject,
  301.                 *(smp->methodId), *(smp->methodDescriptor),
  302.                 smp->method, smp->redispatchStub,
  303.                 smp->applyStub);
  304.  
  305.  
  306. /*
  307.  * Override methods.
  308.  */
  309.     for (omp = RecordOM, i = 0; i < 6; omp++, i++)
  310.         _somOverrideSMethod (RecordtempClassData.classObject,
  311.             *(omp->methodId), omp->method);
  312.  
  313. }
  314.  
  315. #pragma linkage(RecordsomCreateClass, system)
  316. static void SOMLINK RecordsomCreateClass(SOMClass *pClsObj,
  317.                            SOMClass *mClsObj)
  318. {
  319.     RecordtempClassData.classObject = _somNew (mClsObj);
  320.     _somInitClass (RecordtempClassData.classObject,
  321.         "Record",
  322.         pClsObj,
  323.         sizeof(RecordData),
  324.         Record_MaxNoMethods,
  325.         Record_MajorVersion,
  326.         Record_MinorVersion);
  327.     RecordCClassData.instanceDataToken = 
  328.     _somGetInstanceToken(RecordtempClassData.classObject);
  329.     RecordsomInitializeClass();
  330.     RecordCClassData.parentMtab =
  331.     _somGetPClsMtab(RecordtempClassData.classObject);
  332.     _somSetClassData(RecordtempClassData.classObject, (somClassDataStructure *)&RecordClassData);
  333.     _somClassReady(RecordtempClassData.classObject);
  334.     /* make newly created class object visible */
  335.     RecordClassData.classObject = RecordtempClassData.classObject;
  336. }
  337.  
  338. Record * SOMLINK RecordNewClass (integer4 scemajorVersion,
  339.         integer4 sceminorVersion)
  340. {
  341.     SOMClass *pClsObj;
  342.     SOMClass *mClsObj;
  343.  
  344.     /* Check the version numbers */
  345.     if (((scemajorVersion != 0) && 
  346.          (scemajorVersion != Record_MajorVersion)) ||
  347.         ((sceminorVersion != 0) && 
  348.          (sceminorVersion > Record_MinorVersion))) {
  349.     somPrintf("RecordNewClass: Error, bad version numbers.\n");
  350.     SOM_Error(SOMERROR_BadVersion);
  351.     }
  352.     /* Don't do anything if class object is already created. */
  353.     if (RecordClassData.classObject != (SOMAny *) NULL)
  354.     return(RecordClassData.classObject);
  355.  
  356.     /* Make sure the environment is initialized. */
  357.     if (SOMClassMgrObject == (SOMAny *) NULL) somEnvironmentNew();
  358.     if (SOMClassMgrObject == (SOMAny *) NULL)
  359.     SOM_Error(SOMERROR_CouldNotStartup);
  360.  
  361.     /* Get the parent class object. */
  362.     WPTransientNewClass(1,2);    /* static reference */
  363.     pClsObj = _somFindClass(SOMClassMgrObject,
  364.         SOM_IdFromString("WPTransient"), 1, 2);
  365.     if (pClsObj == (SOMClass *) NULL)
  366.     SOM_Error(SOMERROR_NoParentClass);
  367.  
  368.     /* Explicit metaclass, so get it */ 
  369.     M_RecordNewClass(0,0);    /* static reference */
  370.     mClsObj = _somFindClass(SOMClassMgrObject,
  371.         SOM_IdFromString("M_Record"), 0, 0);
  372.     if (mClsObj == (SOMClass *) NULL)
  373.     SOM_Error(SOMERROR_NoMetaClass);
  374.  
  375.     somConstructClass(RecordsomCreateClass, pClsObj, mClsObj,
  376.              &RecordtempClassData);
  377.     return (RecordClassData.classObject);
  378. }
  379.  
  380. #endif                   /* Record_Class_Source */
  381.  
  382. #endif       /* record_ih */
  383.  
  384. /*
  385.  * This file was generated by the SOM Compiler.
  386.  * FileName: record.ih.
  387.  * Generated using:
  388.  *     SOM Precompiler spc: 1.22
  389.  *     SOM Emitter emitih: 1.59
  390.  */
  391.  
  392. #ifndef record_mih
  393. #define record_mih
  394.  
  395.  
  396. /*
  397.  * Set the scope of methods functions
  398.  */
  399. #ifndef SOM_Scope
  400. #ifdef __cplusplus
  401. #define SOM_Scope extern "C"
  402. #else
  403. #define SOM_Scope extern
  404. #endif
  405. #endif
  406.  
  407. #ifndef SOM_CurrentClass
  408. #define SOM_CurrentClass M_RecordCClassData.parentMtab
  409. #endif
  410.  
  411. #define M_Record_MaxNoMethods 2
  412.  
  413. /*
  414.  * Instance data
  415.  */
  416. typedef void M_RecordData;
  417.  
  418. /*
  419.  * Trace/Debug macro
  420.  */
  421. #ifndef M_RecordMethodDebug
  422. #define M_RecordMethodDebug(c,m) SOMMethodDebug(c,m)
  423. #endif
  424.  
  425. /*
  426.  * Begin stuff that only goes in the primary file
  427.  */
  428. #ifdef M_Record_Class_Source
  429.  
  430. /*
  431.  * Current class macros for Instance and Meta classes.
  432.  */
  433.  
  434. /*
  435.  * Generate the Apply Stubs.
  436.  */
  437. #pragma linkage(somAP_clsQueryDatabase, system)
  438. static BOOL   SOMLINK somAP_clsQueryDatabase(M_Record *somSelf,
  439.         somId __id,
  440.         somId __desc,
  441.         va_list __ap)
  442. {
  443.     PSZ szSearch = va_arg(__ap, PSZ);
  444.     WPObject *Folder = va_arg(__ap, WPObject*);
  445.     __ap; __id; __desc;           /* Referenced to prevent warning msg */
  446.  
  447.     return (M_Record_clsQueryDatabase(somSelf,szSearch,Folder));
  448. }
  449.  
  450. #pragma linkage(somAP_clsRestartServer, system)
  451. static BOOL   SOMLINK somAP_clsRestartServer(M_Record *somSelf,
  452.         somId __id,
  453.         somId __desc,
  454.         va_list __ap)
  455. {
  456.     __ap; __id; __desc;           /* Referenced to prevent warning msg */
  457.  
  458.     return (M_Record_clsRestartServer(somSelf));
  459. }
  460.  
  461.  
  462. /*
  463.  * Overridden method: wpclsInitData
  464.  */
  465. #pragma linkage(recordcls_wpclsInitData, system)
  466. SOM_Scope void   SOMLINK recordcls_wpclsInitData(M_Record *somSelf);
  467. #ifndef parent_wpclsInitData
  468. static char *somMN_wpclsInitData = "wpclsInitData";
  469. static somId somId_wpclsInitData = &somMN_wpclsInitData;
  470. #define parent_wpclsInitData(somSelf) \
  471.     ((SOM_ParentResolveE(M_WPObject, SOM_CurrentClass, wpclsInitData)) \
  472.      (somSelf))
  473. #endif
  474. #define M_RecordParent_wpclsInitData parent_wpclsInitData
  475.  
  476. /*
  477.  * Overridden method: wpclsUnInitData
  478.  */
  479. #pragma linkage(recordcls_wpclsUnInitData, system)
  480. SOM_Scope void   SOMLINK recordcls_wpclsUnInitData(M_Record *somSelf);
  481. #ifndef parent_wpclsUnInitData
  482. static char *somMN_wpclsUnInitData = "wpclsUnInitData";
  483. static somId somId_wpclsUnInitData = &somMN_wpclsUnInitData;
  484. #define parent_wpclsUnInitData(somSelf) \
  485.     ((SOM_ParentResolveE(M_WPObject, SOM_CurrentClass, wpclsUnInitData)) \
  486.      (somSelf))
  487. #endif
  488. #define M_RecordParent_wpclsUnInitData parent_wpclsUnInitData
  489.  
  490. /*
  491.  * Overridden method: wpclsQueryTitle
  492.  */
  493. #pragma linkage(recordcls_wpclsQueryTitle, system)
  494. SOM_Scope PSZ   SOMLINK recordcls_wpclsQueryTitle(M_Record *somSelf);
  495. #ifndef parent_wpclsQueryTitle
  496. static char *somMN_wpclsQueryTitle = "wpclsQueryTitle";
  497. static somId somId_wpclsQueryTitle = &somMN_wpclsQueryTitle;
  498. #define parent_wpclsQueryTitle(somSelf) \
  499.     ((SOM_ParentResolveE(M_WPObject, SOM_CurrentClass, wpclsQueryTitle)) \
  500.      (somSelf))
  501. #endif
  502. #define M_RecordParent_wpclsQueryTitle parent_wpclsQueryTitle
  503.  
  504. /*
  505.  * Overridden method: wpclsQueryIcon
  506.  */
  507. #pragma linkage(recordcls_wpclsQueryIcon, system)
  508. SOM_Scope HPOINTER   SOMLINK recordcls_wpclsQueryIcon(M_Record *somSelf);
  509. #ifndef parent_wpclsQueryIcon
  510. static char *somMN_wpclsQueryIcon = "wpclsQueryIcon";
  511. static somId somId_wpclsQueryIcon = &somMN_wpclsQueryIcon;
  512. #define parent_wpclsQueryIcon(somSelf) \
  513.     ((SOM_ParentResolveE(M_WPObject, SOM_CurrentClass, wpclsQueryIcon)) \
  514.      (somSelf))
  515. #endif
  516. #define M_RecordParent_wpclsQueryIcon parent_wpclsQueryIcon
  517.  
  518. /*
  519.  * Overridden method: wpclsQueryDefaultView
  520.  */
  521. #pragma linkage(recordcls_wpclsQueryDefaultView, system)
  522. SOM_Scope ULONG   SOMLINK recordcls_wpclsQueryDefaultView(M_Record *somSelf);
  523. #ifndef parent_wpclsQueryDefaultView
  524. static char *somMN_wpclsQueryDefaultView = "wpclsQueryDefaultView";
  525. static somId somId_wpclsQueryDefaultView = &somMN_wpclsQueryDefaultView;
  526. #define parent_wpclsQueryDefaultView(somSelf) \
  527.     ((SOM_ParentResolveE(M_WPObject, SOM_CurrentClass, wpclsQueryDefaultView)) \
  528.      (somSelf))
  529. #endif
  530. #define M_RecordParent_wpclsQueryDefaultView parent_wpclsQueryDefaultView
  531.  
  532. /*
  533.  * Overridden method: wpclsFindObjectFirst
  534.  */
  535. #pragma linkage(recordcls_wpclsFindObjectFirst, system)
  536. SOM_Scope BOOL   SOMLINK recordcls_wpclsFindObjectFirst(M_Record *somSelf,
  537.         PCLASS pClassList,
  538.         PHFIND phFind,
  539.         PSZ pszTitle,
  540.         WPFolder *Folder,
  541.         BOOL fSubfolders,
  542.         PVOID pExtendedCriteria,
  543.         POBJECT pBuffer,
  544.         PULONG pCount);
  545. #ifndef parent_wpclsFindObjectFirst
  546. static char *somMN_wpclsFindObjectFirst = "wpclsFindObjectFirst";
  547. static somId somId_wpclsFindObjectFirst = &somMN_wpclsFindObjectFirst;
  548. #define parent_wpclsFindObjectFirst(somSelf,pClassList,phFind,pszTitle,Folder,fSubfolders,pExtendedCriteria,pBuffer,pCount) \
  549.     ((SOM_ParentResolveE(M_WPObject, SOM_CurrentClass, wpclsFindObjectFirst)) \
  550.      (somSelf,pClassList,phFind,pszTitle,Folder,fSubfolders,pExtendedCriteria,pBuffer,pCount))
  551. #endif
  552. #define M_RecordParent_wpclsFindObjectFirst parent_wpclsFindObjectFirst
  553.  
  554. /*
  555.  * Temporary class data structure used only in class creation
  556.  */
  557. static somClassDataStructure M_RecordtempClassData;
  558.  
  559. /*
  560.  * Initialize the class data structure
  561.  */
  562. struct M_RecordClassDataStructure M_RecordClassData = {(SOMAny *) NULL};
  563.  
  564. /*
  565.  * Define the C class data structure
  566.  */
  567. struct M_RecordCClassDataStructure M_RecordCClassData = {(somMethodTab *) NULL};
  568.  
  569. /*
  570.  * New Method: clsQueryDatabase
  571.  */
  572. #pragma linkage(recordcls_clsQueryDatabase, system)
  573. SOM_Scope BOOL   SOMLINK recordcls_clsQueryDatabase(M_Record *somSelf,
  574.         PSZ szSearch,
  575.         WPObject *Folder);
  576. static char *somMN_clsQueryDatabase = "clsQueryDatabase";
  577. static somId somId_clsQueryDatabase = &somMN_clsQueryDatabase;
  578. static char *somDS_clsQueryDatabase = somMD_M_Record_clsQueryDatabase;
  579. static somId somDI_clsQueryDatabase = &somDS_clsQueryDatabase;
  580. #pragma linkage(somRD_clsQueryDatabase, system)
  581. static BOOL   SOMLINK somRD_clsQueryDatabase(M_Record *somSelf,
  582.         PSZ szSearch,
  583.         WPObject *Folder)
  584. {
  585.     return ((BOOL) va_somDispatchL(somSelf, somId_clsQueryDatabase,
  586.         _somGetMethodDescriptor(SOM_GetClass(somSelf),somId_clsQueryDatabase),szSearch,Folder));
  587. }
  588.  
  589. /*
  590.  * New Method: clsRestartServer
  591.  */
  592. #pragma linkage(recordcls_clsRestartServer, system)
  593. SOM_Scope BOOL   SOMLINK recordcls_clsRestartServer(M_Record *somSelf);
  594. static char *somMN_clsRestartServer = "clsRestartServer";
  595. static somId somId_clsRestartServer = &somMN_clsRestartServer;
  596. static char *somDS_clsRestartServer = somMD_M_Record_clsRestartServer;
  597. static somId somDI_clsRestartServer = &somDS_clsRestartServer;
  598. #pragma linkage(somRD_clsRestartServer, system)
  599. static BOOL   SOMLINK somRD_clsRestartServer(M_Record *somSelf)
  600. {
  601.     return ((BOOL) va_somDispatchL(somSelf, somId_clsRestartServer,
  602.         _somGetMethodDescriptor(SOM_GetClass(somSelf),somId_clsRestartServer)));
  603. }
  604.  
  605. /*
  606.  * Routines to create the class object
  607.  */
  608.  
  609. /*
  610.  * Declare the Static Methods table.
  611.  */
  612. static somStaticMethod_t M_RecordSM[] = {
  613.     {    &M_RecordClassData.clsQueryDatabase,
  614.          &somId_clsQueryDatabase,
  615.          &somDI_clsQueryDatabase,
  616.          (somMethodProc *) recordcls_clsQueryDatabase,
  617.          (somMethodProc *) somRD_clsQueryDatabase,
  618.          (somMethodProc *) somAP_clsQueryDatabase    },
  619.     {    &M_RecordClassData.clsRestartServer,
  620.          &somId_clsRestartServer,
  621.          &somDI_clsRestartServer,
  622.          (somMethodProc *) recordcls_clsRestartServer,
  623.          (somMethodProc *) somRD_clsRestartServer,
  624.          (somMethodProc *) somAP_clsRestartServer    },
  625. };
  626.  
  627.  
  628. /*
  629.  * Declare the Override Methods table.
  630.  */
  631. static somOverrideMethod_t M_RecordOM[] = {
  632.     {    &somId_wpclsInitData,
  633.          (somMethodProc *) recordcls_wpclsInitData    },
  634.     {    &somId_wpclsUnInitData,
  635.          (somMethodProc *) recordcls_wpclsUnInitData    },
  636.     {    &somId_wpclsQueryTitle,
  637.          (somMethodProc *) recordcls_wpclsQueryTitle    },
  638.     {    &somId_wpclsQueryIcon,
  639.          (somMethodProc *) recordcls_wpclsQueryIcon    },
  640.     {    &somId_wpclsQueryDefaultView,
  641.          (somMethodProc *) recordcls_wpclsQueryDefaultView    },
  642.     {    &somId_wpclsFindObjectFirst,
  643.          (somMethodProc *) recordcls_wpclsFindObjectFirst    },
  644. };
  645.  
  646. static void M_RecordsomInitializeClass ()
  647. {
  648.     int i;
  649.     somStaticMethod_t *smp;
  650.     somOverrideMethod_t *omp;
  651.  
  652. /*
  653.  * Add the Static Methods.
  654.  */
  655.     for (smp = M_RecordSM, i = 0; i < 2; smp++, i++)
  656.         *(smp->classData) =
  657.             _somAddStaticMethod (M_RecordtempClassData.classObject,
  658.                 *(smp->methodId), *(smp->methodDescriptor),
  659.                 smp->method, smp->redispatchStub,
  660.                 smp->applyStub);
  661.  
  662.  
  663. /*
  664.  * Override methods.
  665.  */
  666.     for (omp = M_RecordOM, i = 0; i < 6; omp++, i++)
  667.         _somOverrideSMethod (M_RecordtempClassData.classObject,
  668.             *(omp->methodId), omp->method);
  669.  
  670. }
  671.  
  672. #pragma linkage(M_RecordsomCreateClass, system)
  673. static void SOMLINK M_RecordsomCreateClass(SOMClass *pClsObj,
  674.                            SOMClass *mClsObj)
  675. {
  676.     M_RecordtempClassData.classObject = _somNew (mClsObj);
  677.     _somInitClass (M_RecordtempClassData.classObject,
  678.         "M_Record",
  679.         pClsObj,
  680.         0,
  681.         M_Record_MaxNoMethods,
  682.         M_Record_MajorVersion,
  683.         M_Record_MinorVersion);
  684.     M_RecordCClassData.instanceDataToken = 
  685.     _somGetInstanceToken(M_RecordtempClassData.classObject);
  686.     M_RecordsomInitializeClass();
  687.     M_RecordCClassData.parentMtab =
  688.     _somGetPClsMtab(M_RecordtempClassData.classObject);
  689.     _somSetClassData(M_RecordtempClassData.classObject, (somClassDataStructure *)&M_RecordClassData);
  690.     _somClassReady(M_RecordtempClassData.classObject);
  691.     /* make newly created class object visible */
  692.     M_RecordClassData.classObject = M_RecordtempClassData.classObject;
  693. }
  694.  
  695. M_Record * SOMLINK M_RecordNewClass (integer4 scemajorVersion,
  696.         integer4 sceminorVersion)
  697. {
  698.     SOMClass *pClsObj;
  699.     SOMClass *mClsObj;
  700.  
  701.     /* Check the version numbers */
  702.     if (((scemajorVersion != 0) && 
  703.          (scemajorVersion != M_Record_MajorVersion)) ||
  704.         ((sceminorVersion != 0) && 
  705.          (sceminorVersion > M_Record_MinorVersion))) {
  706.     somPrintf("M_RecordNewClass: Error, bad version numbers.\n");
  707.     SOM_Error(SOMERROR_BadVersion);
  708.     }
  709.     /* Don't do anything if class object is already created. */
  710.     if (M_RecordClassData.classObject != (SOMAny *) NULL)
  711.     return(M_RecordClassData.classObject);
  712.  
  713.     /* Make sure the environment is initialized. */
  714.     if (SOMClassMgrObject == (SOMAny *) NULL) somEnvironmentNew();
  715.     if (SOMClassMgrObject == (SOMAny *) NULL)
  716.     SOM_Error(SOMERROR_CouldNotStartup);
  717.  
  718.     /* Get the parent class object. */
  719.     M_WPTransientNewClass(1,2);    /* static reference */
  720.     pClsObj = _somFindClass(SOMClassMgrObject,
  721.         SOM_IdFromString("M_WPTransient"), 1, 2);
  722.     if (pClsObj == (SOMClass *) NULL)
  723.     SOM_Error(SOMERROR_NoParentClass);
  724.  
  725.     /* Use parent's metaclass */ 
  726.     mClsObj = SOM_GetClass(pClsObj);
  727.  
  728.     somConstructClass(M_RecordsomCreateClass, pClsObj, mClsObj,
  729.              &M_RecordtempClassData);
  730.     return (M_RecordClassData.classObject);
  731. }
  732.  
  733. #endif                   /* M_Record_Class_Source */
  734.  
  735. #endif       /* record_ih */
  736.