home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / Getting Started / MPW Development / MPW Additions / INTO Interfaces&Libraries / Cyberdog SDK / PublicIncludes / SimpleCyberService.xh < prev    next >
Encoding:
Text File  |  1996-08-02  |  3.7 KB  |  166 lines  |  [TEXT/MPS ]

  1.  
  2. /*
  3.  * This file was generated by the SOM Compiler.
  4.  * FileName: SimpleCyberService.xh.
  5.  * Generated using:
  6.  *     SOM Precompiler somipc: 2.18
  7.  *     SOM Emitter emitxh.dll: 2.33
  8.  */
  9.  
  10. /*
  11.  * 
  12.  *  SimpleCyberService
  13.  * 
  14.  */
  15.  
  16.  
  17. #ifndef SOM_SimpleCyberService_xh
  18. #define SOM_SimpleCyberService_xh
  19.  
  20. class SimpleCyberService;
  21.  
  22. #define SimpleCyberService_MajorVersion 0
  23. #define SimpleCyberService_MinorVersion 0
  24.  
  25. /* C++ SOM defs */
  26. #include <somcls.xh>
  27. #include <somcm.xh>
  28.  
  29. /* C++ parent defs */
  30. #ifndef SOM_CyberService_xh
  31. #include <CyberService.xh>
  32. #endif
  33.  
  34. #ifndef SimpleCyberService_API
  35. #define SimpleCyberService_API
  36. /*
  37.  * -- The Class API
  38.  */
  39.  
  40. /*
  41.  * Start of user-defined types:
  42.  */
  43. class SOMClass;
  44. class SOMObject;
  45. class ODFrame;
  46. class ODFacet;
  47. class ODObject;
  48. class ODExtension;
  49. class CyberService;
  50. class CyberItem;
  51. class ODMenuBar;
  52. class ODPart;
  53. typedef
  54. somToken CyberMenuData;
  55.  
  56. /*
  57.  * End of user-defined types.
  58.  */
  59.  
  60. #ifdef OLDIBMSOMAPISUPPORT
  61. #define SimpleCyberServiceCClassData SimpleCyberServiceClassData
  62. #define SimpleCyberServiceNewClass(major,minor) somNewVersionedClassReference(SimpleCyberService,major,minor)
  63. #endif
  64.  
  65. /* define xxxMetaClass macro to facilitate (cls ## MetaClass) */
  66. #define SimpleCyberServiceMetaClass SOMClass
  67.  
  68.  
  69. /* The API to the SimpleCyberService class object, and the methods it introduces. */
  70. SOMEXTERN struct SimpleCyberServiceClassDataStructure {
  71. #ifdef OLDIBMSOMAPISUPPORT
  72.     SOMClass            *classObject;    /* always zero, use somNewClassReference instead */
  73. #else
  74.     long zero;
  75. #endif
  76.     somStaticClassInfo *sci;
  77.     somDToken        instanceDataToken;
  78.     long reserved [3];
  79.     somMToken DoMenuItemSelected;
  80. } SOMDLINK SimpleCyberServiceClassData;
  81.  
  82. #if !defined(SimpleCyberService_Class_Source) && !defined(SOM_Module_simplecyberservice_Source)
  83. #if PRAGMA_IMPORT_SUPPORTED
  84. #pragma import list SimpleCyberServiceClassData
  85. #endif
  86. #endif
  87.  
  88.  
  89. /*
  90.  * -- Typedefs and inline method declarations for left path inherited methods
  91.  * -- are omitted because this compilation had -museinheritedmethods in effect
  92.  */
  93.  
  94.  
  95. /*
  96.  * -- Typedefs for SimpleCyberService Method Procedures
  97.  */
  98. SOMEXTERN {
  99. typedef void   (* SOMLINK somTD_SimpleCyberService_DoMenuItemSelected)(SimpleCyberService *somSelf, Environment *ev,
  100.         long index,
  101.         ODFrame* frame,
  102.         CyberMenuData menuData);
  103. }
  104.  
  105. #endif /* SimpleCyberService_API */
  106.  
  107.  
  108. /*
  109.  * -- This emitter treats Method Tokens as Thunks by default.
  110.  * -- Use the sc modifier "nothunks" to change this default
  111.  */
  112. #undef somresolve_
  113. #define somresolve_(obj,mToken) ((somMethodProc*)((void)obj, mToken))
  114.  
  115. /*
  116.  * -- The C++ Wrapper Class for SimpleCyberService
  117.  */
  118. class SimpleCyberService : public CyberService
  119. {
  120. public:
  121.  
  122. // SimpleCyberService::new registers use of the class object, and then uses somNew
  123. // to allocate memory and load the object method table pointer. 
  124. void *operator new(size_t size)
  125. {
  126.     SOM_IgnoreWarning(size);
  127.     // Allocate memory using the default allocator for SimpleCyberService, and
  128.     // clear mem & set method table pointer, call basic initialization
  129. #ifdef SOMCHKNULL
  130.     void * __somResult = (void *)
  131.       somNewObject(SimpleCyberService);
  132.     SOMCHKNULL(__somResult);
  133.     return __somResult;
  134. #else
  135.     return (void*) somNewObject(SimpleCyberService);
  136. #endif
  137. }
  138.  
  139. // SimpleCyberService::delete uses the default deallocator for the object's class.
  140. void operator delete(void * obj)
  141. {
  142.     if (obj) {
  143.         SOM_Resolve(obj,SOMObject,somFree)
  144.            ( (SOMObject*) obj );
  145.     }
  146. }
  147.  
  148. /* method: DoMenuItemSelected */
  149. void   DoMenuItemSelected(Environment *ev,
  150.         long index,
  151.         ODFrame* frame,
  152.         CyberMenuData menuData)
  153. {
  154.    SOM_ResolveD(this,SimpleCyberService,SimpleCyberService,DoMenuItemSelected)
  155.     (this,ev,index,frame,menuData);
  156. #ifdef SOMCHKEXCEPT
  157.       SOMCHKEXCEPT;
  158. #endif
  159. }
  160.  
  161. };   /* SimpleCyberService */
  162.  
  163.  
  164.  
  165. #endif       /* SOM_SimpleCyberService_xh */
  166.