home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / sompar.zip / PART.XH < prev    next >
Text File  |  1993-12-19  |  4KB  |  213 lines

  1.  
  2. /*
  3.  * This file was generated by the SOM Compiler.
  4.  * FileName: part.xh.
  5.  * Generated using:
  6.  *     SOM Precompiler somipc: somc/smemit.c
  7.  *     SOM Emitter emitxh: somc/smmain.c
  8.  */
  9.  
  10. /*
  11.  * 
  12.  *  Project: Digitalk Parts like Toolbar and SOMObjects Containers Demo
  13.  *  File:    part.idl
  14.  *  Author:  Stewart Hyde
  15.  *  Created: Dec   18, 1993
  16.  *  Updated: Dec   18, 1993
  17.  * 
  18.  *  Description:
  19.  * 
  20.  */
  21.  
  22.  
  23. #ifndef SOM_Part_xh
  24. #define SOM_Part_xh
  25.  
  26. class Part;
  27.  
  28. #define Part_MajorVersion 0
  29. #define Part_MinorVersion 0
  30.  
  31. /* C++ som defs */
  32. #include <somcls.xh>
  33.  
  34. /* Include C++ parent defs */
  35. #ifndef SOM_SOMObject_xh
  36. #include <somobj.xh>
  37. #endif
  38.  
  39. #ifndef Part_API
  40. #define Part_API
  41. /*
  42.  * -- The Class API
  43.  */
  44.  
  45. /*
  46.  * Start of user-defined types:
  47.  */
  48. class SOMClass;
  49. #define Part_stackSize 100 /* 100 */
  50. #define Part_setSize 4 /* 4 */
  51.  
  52. #ifndef SOM_DONT_USE_SHORT_NAMES
  53. #ifndef SOMTGD_stackSize
  54.     #ifdef stackSize
  55.         #undef stackSize
  56.         #define SOMTGD_stackSize 1
  57.     #else
  58.         #define stackSize Part_stackSize
  59.     #endif /* stackSize */
  60. #endif /* SOMTGD_stackSize */
  61. #ifndef SOMTGD_setSize
  62.     #ifdef setSize
  63.         #undef setSize
  64.         #define SOMTGD_setSize 1
  65.     #else
  66.         #define setSize Part_setSize
  67.     #endif /* setSize */
  68. #endif /* SOMTGD_setSize */
  69. #endif /* SOM_DONT_USE_SHORT_NAMES */
  70.  
  71. /*
  72.  * End of user-defined types.
  73.  */
  74.  
  75. /* A procedure to create the Part Class */
  76. SOMEXTERN SOMClass * SOMLINK PartNewClass(
  77.         integer4 majorVersion,
  78.         integer4 minorVersion);
  79.  
  80. /* The API to the Part class object, and the methods it introduces. */
  81. SOMEXTERN struct PartClassDataStructure {
  82.     SOMClass *classObject;
  83.     somMToken Search;
  84.     somMToken Add;
  85.     somMToken Update;
  86.     somMToken Size;
  87.     somMToken Debug;
  88. } PartClassData;
  89. #define _Part PartClassData.classObject
  90.  
  91. /* The API to parentMtabs for Part, and the instance data it introduces. */
  92. SOMEXTERN struct PartCClassDataStructure {
  93.     somMethodTabs parentMtab;
  94.     somDToken instanceDataToken;
  95. } PartCClassData;
  96.  
  97. /*
  98.  * -- Typedefs for Procedures that support Methods introduced by Part
  99.  */
  100. SOMEXTERN {
  101. typedef boolean   (* SOMLINK somTD_Part_Search)(Part *somSelf, Environment *ev,
  102.         long lSet,
  103.         long lAction,
  104.         long* ID,
  105.         long* Count);
  106. typedef boolean   (* SOMLINK somTD_Part_Add)(Part *somSelf, Environment *ev,
  107.         long lSet,
  108.         long LAction,
  109.         long* ID,
  110.         long* Count);
  111. typedef boolean   (* SOMLINK somTD_Part_Update)(Part *somSelf, Environment *ev,
  112.         long lSet,
  113.         long LAction,
  114.         long* ID,
  115.         long* Count);
  116. typedef boolean   (* SOMLINK somTD_Part_Debug)(Part *somSelf, Environment *ev,
  117.         boolean NewState);
  118. typedef long   (* SOMLINK somTD_Part_Size)(Part *somSelf, Environment *ev);
  119. }
  120.  
  121. #endif /* Part_API */
  122.  
  123.  
  124. /*
  125.  * -- Method Tokens are Thunks
  126.  */
  127. #undef somresolve_
  128. #define somresolve_(obj,mToken) ((somMethodProc*)((void)obj, mToken))
  129.  
  130. /*
  131.  * -- The C++ Wrapper Class for Part
  132.  */
  133. class Part : public SOMObject
  134. {
  135. public:
  136.  
  137. void *operator new(size_t size)
  138. {
  139.    SOM_IgnoreWarning(size);
  140.    if (!PartClassData.classObject) 
  141.       PartNewClass(Part_MajorVersion,Part_MinorVersion);
  142.    return (void *)
  143.       ((somTD_SOMClass_somNew)
  144.       somresolve_((SOMObject *)((void*)(PartClassData.classObject)),
  145.                  SOMClassClassData.somNew))
  146.          ((SOMClass *)((void*)(PartClassData.classObject)));
  147. }
  148.  
  149. void operator delete(void * obj)
  150. {
  151.    ((SOMObject *)obj)->somFree();
  152. }
  153.  
  154. /* public method: Search */
  155. boolean   Search(Environment *ev,
  156.         long lSet,
  157.         long lAction,
  158.         long* ID,
  159.         long* Count)
  160. {
  161.    return SOM_Resolve(this,Part,Search)
  162.     (this,ev,lSet,lAction,ID,Count);
  163. }
  164.  
  165.  
  166. /* public method: Add */
  167. boolean   Add(Environment *ev,
  168.         long lSet,
  169.         long LAction,
  170.         long* ID,
  171.         long* Count)
  172. {
  173.    return SOM_Resolve(this,Part,Add)
  174.     (this,ev,lSet,LAction,ID,Count);
  175. }
  176.  
  177.  
  178. /* public method: Update */
  179. boolean   Update(Environment *ev,
  180.         long lSet,
  181.         long LAction,
  182.         long* ID,
  183.         long* Count)
  184. {
  185.    return SOM_Resolve(this,Part,Update)
  186.     (this,ev,lSet,LAction,ID,Count);
  187. }
  188.  
  189.  
  190. /* public method: Debug */
  191. boolean   Debug(Environment *ev,
  192.         boolean NewState)
  193. {
  194.    return SOM_Resolve(this,Part,Debug)
  195.     (this,ev,NewState);
  196. }
  197.  
  198.  
  199. /* public method: Size */
  200. long   Size(Environment *ev)
  201. {
  202.    return SOM_Resolve(this,Part,Size)
  203.     (this,ev);
  204. }
  205.  
  206.  
  207.  
  208. };   /* Part */
  209.  
  210.  
  211.  
  212. #endif       /* SOM_Part_xh */
  213.