home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / include / Xm / BaseClassP.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-06-30  |  6.7 KB  |  222 lines

  1. /* 
  2.  * (c) Copyright 1989, 1990, 1991, 1992, 1993 OPEN SOFTWARE FOUNDATION, INC. 
  3.  * ALL RIGHTS RESERVED 
  4. */ 
  5. /* 
  6.  * Motif Release 1.2.3
  7. */ 
  8. /*   $RCSfile: BaseClassP.h,v $ $Revision: 10.1 $ $Date: 1994/02/03 15:34:16 $ */
  9. /*
  10. *  (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 HEWLETT-PACKARD COMPANY */
  11. /*
  12. *  (c) Copyright 1989, 1990 DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS. */
  13. /*
  14. *  (c) Copyright 1988 MASSACHUSETTS INSTITUTE OF TECHNOLOGY  */
  15. #ifndef _XmBaseClassP_h
  16. #define _XmBaseClassP_h
  17.  
  18. #ifndef _XmNO_BC_INCL
  19. #define _XmNO_BC_INCL
  20. #endif
  21.  
  22. #include <Xm/XmP.h>
  23.  
  24. #ifdef __cplusplus
  25. extern "C" {
  26. #endif
  27.  
  28.  
  29. #define _XmBCEPTR(wc)    ((XmBaseClassExt *)(&(((WidgetClass)(wc))\
  30.                           ->core_class.extension)))
  31. #define _XmBCE(wc)    ((XmBaseClassExt)(((WidgetClass)(wc))\
  32.                       ->core_class.extension))
  33.  
  34. #define _XmGetBaseClassExtPtr(wc, owner) \
  35.     ((_XmBCE(wc) && (((_XmBCE(wc))->record_type) == owner)) \
  36.      ?  \
  37.      _XmBCEPTR(wc)  \
  38.      :  \
  39.      ((XmBaseClassExt *) _XmGetClassExtensionPtr( \
  40.                          ((XmGenericClassExt *)  \
  41.                           _XmBCEPTR( wc)),  \
  42.                          owner)))
  43.  
  44. /* defines for 256 bit (at least) bit field
  45.  */
  46. #define _XmGetFlagsBit(field, bit) \
  47.     (field[ (bit >> 3) ]) & (1 << (bit & 0x07))
  48.  
  49. #define _XmSetFlagsBit(field, bit) \
  50.         (field[ (bit >> 3) ] |= (1 << (bit & 0x07)))
  51.  
  52.  
  53. #define _XmFastSubclassInit(wc, bit_field) { \
  54.     if((_Xm_fastPtr = _XmGetBaseClassExtPtr( wc, XmQmotif)) && \
  55.        (*_Xm_fastPtr)) \
  56.         _XmSetFlagsBit((*_Xm_fastPtr)->flags, bit_field) ; \
  57.    }
  58.  
  59. /* _XmGetBaseClassExtPtr can return NULL or a pointer to a NULL extension,
  60.    for non Motif classes in particular, so we check that up front.
  61.    We use the global _Xm_fastPtr for that purpose, this variable exists
  62.    already in BaseClass.c for apparently no other use */
  63.  
  64. #define _XmIsFastSubclass(wc, bit) \
  65.     ((_Xm_fastPtr = _XmGetBaseClassExtPtr((wc),XmQmotif)) && \
  66.          (*_Xm_fastPtr)) ? \
  67.          (_XmGetFlagsBit(((*_Xm_fastPtr)->flags), bit) ? TRUE : FALSE) \
  68.          : FALSE
  69.  
  70. #define XmBaseClassExtVersion 2L
  71. #define XmBaseClassExtVersion 2L
  72.  
  73.  
  74. #ifdef _NO_PROTO
  75. typedef Cardinal (*XmGetSecResDataFunc) ();
  76. #else
  77. typedef Cardinal (*XmGetSecResDataFunc)( WidgetClass,
  78.                         XmSecondaryResourceData **);
  79. #endif
  80.  
  81. typedef struct _XmObjectClassExtRec{
  82.     XtPointer         next_extension;    
  83.     XrmQuark         record_type;    
  84.     long         version;    
  85.     Cardinal         record_size;    
  86. }XmObjectClassExtRec, *XmObjectClassExt;
  87.  
  88. typedef struct _XmGenericClassExtRec{
  89.     XtPointer         next_extension;    
  90.     XrmQuark         record_type;    
  91.     long         version;    
  92.     Cardinal         record_size;    
  93. }XmGenericClassExtRec, *XmGenericClassExt;
  94.  
  95. typedef struct _XmWrapperDataRec{
  96.     struct _XmWrapperDataRec *next;
  97.     WidgetClass        widgetClass;
  98.     XtInitProc        initializeLeaf;
  99.     XtSetValuesFunc    setValuesLeaf;
  100.     XtArgsProc        getValuesLeaf;
  101.     XtRealizeProc    realize;
  102.     XtWidgetClassProc    classPartInitLeaf;
  103.     XtWidgetProc    resize;
  104.     XtGeometryHandler   geometry_manager;
  105.     Cardinal        init_depth;
  106. }XmWrapperDataRec, *XmWrapperData;
  107.  
  108. typedef struct _XmBaseClassExtRec{
  109.     XtPointer         next_extension;    
  110.     XrmQuark         record_type;    
  111.     long         version;    
  112.     Cardinal         record_size;    
  113.     XtInitProc        initializePrehook;
  114.     XtSetValuesFunc     setValuesPrehook;
  115.     XtInitProc        initializePosthook;
  116.     XtSetValuesFunc     setValuesPosthook;
  117.     WidgetClass        secondaryObjectClass;
  118.     XtInitProc        secondaryObjectCreate;
  119.     XmGetSecResDataFunc    getSecResData;
  120.     unsigned char    flags[32];
  121.     XtArgsProc        getValuesPrehook;
  122.     XtArgsProc        getValuesPosthook;
  123.     XtWidgetClassProc    classPartInitPrehook;
  124.     XtWidgetClassProc    classPartInitPosthook;
  125.     XtResourceList    ext_resources;
  126.     XtResourceList    compiled_ext_resources;
  127.     Cardinal        num_ext_resources;
  128.     Boolean        use_sub_resources;
  129.     XmWidgetNavigableProc widgetNavigable;
  130.     XmFocusChangeProc    focusChange;
  131.     XmWrapperData    wrapperData;
  132. }XmBaseClassExtRec, *XmBaseClassExt;
  133.  
  134.  
  135. typedef struct _XmWidgetExtDataRec{
  136.     Widget        widget;
  137.     Widget        reqWidget;
  138.     Widget        oldWidget;
  139. }XmWidgetExtDataRec, *XmWidgetExtData;
  140.  
  141. externalref XrmQuark        XmQmotif;
  142. externalref int     _XmInheritClass;
  143. externalref XmBaseClassExt * _Xm_fastPtr;
  144.   
  145.  
  146. /********    Private Function Declarations    ********/
  147. #ifdef _NO_PROTO
  148.  
  149. extern Boolean _XmIsSlowSubclass() ;
  150. extern XmGenericClassExt * _XmGetClassExtensionPtr() ;
  151. extern void _XmPushWidgetExtData() ;
  152. extern void _XmPopWidgetExtData() ;
  153. extern XmWidgetExtData _XmGetWidgetExtData() ;
  154. extern void _XmFreeWidgetExtData() ;
  155. extern void _XmBaseClassPartInitialize() ;
  156. extern void _XmInitializeExtensions() ;
  157. extern Boolean _XmIsStandardMotifWidgetClass() ;
  158. extern Cardinal _XmSecondaryResourceData() ;
  159. extern void _XmTransformSubResources() ;
  160.  
  161. #else
  162.  
  163. extern Boolean _XmIsSlowSubclass( 
  164.                         WidgetClass wc,
  165.                         unsigned int bit) ;
  166. extern XmGenericClassExt * _XmGetClassExtensionPtr( 
  167.                         XmGenericClassExt *listHeadPtr,
  168.                         XrmQuark owner) ;
  169. extern void _XmPushWidgetExtData( 
  170.                         Widget widget,
  171.                         XmWidgetExtData data,
  172. #if NeedWidePrototypes
  173.                         unsigned int extType) ;
  174. #else
  175.                         unsigned char extType) ;
  176. #endif /* NeedWidePrototypes */
  177. extern void _XmPopWidgetExtData( 
  178.                         Widget widget,
  179.                         XmWidgetExtData *dataRtn,
  180. #if NeedWidePrototypes
  181.                         unsigned int extType) ;
  182. #else
  183.                         unsigned char extType) ;
  184. #endif /* NeedWidePrototypes */
  185. extern XmWidgetExtData _XmGetWidgetExtData( 
  186.                         Widget widget,
  187. #if NeedWidePrototypes
  188.                         unsigned int extType) ;
  189. #else
  190.                         unsigned char extType) ;
  191. #endif /* NeedWidePrototypes */
  192. extern void _XmFreeWidgetExtData( 
  193.                         Widget widget) ;
  194. extern void _XmBaseClassPartInitialize( 
  195.                         WidgetClass wc) ;
  196. extern void _XmInitializeExtensions( void ) ;
  197. extern Boolean _XmIsStandardMotifWidgetClass( 
  198.                         WidgetClass wc) ;
  199. extern Cardinal _XmSecondaryResourceData( 
  200.                         XmBaseClassExt bcePtr,
  201.                         XmSecondaryResourceData **secResDataRtn,
  202.                         XtPointer client_data,
  203.                         String name,
  204.                         String class_name,
  205.                         XmResourceBaseProc basefunctionpointer) ;
  206. extern void _XmTransformSubResources( 
  207.                         XtResourceList comp_resources,
  208.                         Cardinal num_comp_resources,
  209.                         XtResourceList *resources,
  210.                         Cardinal *num_resources) ;
  211.  
  212. #endif /* _NO_PROTO */
  213. /********    End Private Function Declarations    ********/
  214.  
  215.  
  216. #ifdef __cplusplus
  217. }  /* Close scope of 'extern "C"' declaration which encloses file. */
  218. #endif
  219.  
  220. #endif /* _XmBaseClassP_h */
  221. /* DON'T ADD ANYTHING AFTER THIS #endif */
  222.