Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:15:22

0001 /* 
0002  * Motif
0003  *
0004  * Copyright (c) 1987-2012, The Open Group. All rights reserved.
0005  *
0006  * These libraries and programs are free software; you can
0007  * redistribute them and/or modify them under the terms of the GNU
0008  * Lesser General Public License as published by the Free Software
0009  * Foundation; either version 2 of the License, or (at your option)
0010  * any later version.
0011  *
0012  * These libraries and programs are distributed in the hope that
0013  * they will be useful, but WITHOUT ANY WARRANTY; without even the
0014  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
0015  * PURPOSE. See the GNU Lesser General Public License for more
0016  * details.
0017  *
0018  * You should have received a copy of the GNU Lesser General Public
0019  * License along with these librararies and programs; if not, write
0020  * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
0021  * Floor, Boston, MA 02110-1301 USA
0022 */ 
0023 #ifndef _XmBaseClassP_h
0024 #define _XmBaseClassP_h
0025 
0026 #ifndef _XmNO_BC_INCL
0027 #define _XmNO_BC_INCL
0028 #endif
0029 
0030 #include <Xm/XmP.h>
0031 
0032 #ifdef __cplusplus
0033 extern "C" {
0034 #endif
0035 
0036 
0037 #define _XmBCEPTR(wc)   ((XmBaseClassExt *)(&(((WidgetClass)(wc))\
0038                           ->core_class.extension)))
0039 #define _XmBCE(wc)  ((XmBaseClassExt)(((WidgetClass)(wc))\
0040                       ->core_class.extension))
0041 
0042 #define _XmGetBaseClassExtPtr(wc, owner) \
0043     ((_XmBCE(wc) && (((_XmBCE(wc))->record_type) == owner)) ? \
0044      _XmBCEPTR(wc) :  \
0045      ((XmBaseClassExt *) _XmGetClassExtensionPtr( \
0046                          ((XmGenericClassExt *)  \
0047                           _XmBCEPTR( wc)),  \
0048                          owner)))
0049 
0050 /* defines for 256 bit (at least) bit field
0051  */
0052 #define _XmGetFlagsBit(field, bit) \
0053     (field[ (bit >> 3) ]) & (1 << (bit & 0x07))
0054 
0055 #define _XmSetFlagsBit(field, bit) \
0056         (field[ (bit >> 3) ] |= (1 << (bit & 0x07)))
0057 
0058 
0059 #ifndef XTHREADS
0060 #define _XmFastSubclassInit(wc, bit_field) { \
0061     if((_Xm_fastPtr = _XmGetBaseClassExtPtr( wc, XmQmotif)) && \
0062        (*_Xm_fastPtr)) \
0063         _XmSetFlagsBit((*_Xm_fastPtr)->flags, bit_field) ; \
0064    }
0065 
0066 /* _XmGetBaseClassExtPtr can return NULL or a pointer to a NULL extension,
0067  * for non Motif classes in particular, so we check that up front.
0068  * We use the global _Xm_fastPtr for that purpose, this variable exists
0069  * already in BaseClass.c for apparently no other use.
0070  */
0071 
0072 #define _XmIsFastSubclass(wc, bit) \
0073     ((_Xm_fastPtr = _XmGetBaseClassExtPtr((wc),XmQmotif)) && \
0074          (*_Xm_fastPtr)) ? \
0075          (_XmGetFlagsBit(((*_Xm_fastPtr)->flags), bit) ? TRUE : FALSE) \
0076          : FALSE
0077 
0078 #else
0079 extern void _XmFastSubclassInit(WidgetClass, unsigned int);
0080 extern Boolean _XmIsFastSubclass(WidgetClass, unsigned int);
0081 #endif  /* XTHREADS */
0082 
0083 #define XmBaseClassExtVersion 2L
0084 #define XmBaseClassExtVersion 2L
0085 
0086 
0087 typedef Cardinal (*XmGetSecResDataFunc)( WidgetClass,
0088                         XmSecondaryResourceData **);
0089 
0090 typedef struct _XmObjectClassExtRec{
0091     XtPointer       next_extension; 
0092     XrmQuark        record_type;    
0093     long        version;    
0094     Cardinal        record_size;    
0095 } XmObjectClassExtRec, *XmObjectClassExt;
0096 
0097 typedef struct _XmGenericClassExtRec{
0098     XtPointer       next_extension; 
0099     XrmQuark        record_type;    
0100     long        version;    
0101     Cardinal        record_size;    
0102 } XmGenericClassExtRec, *XmGenericClassExt;
0103 
0104 typedef struct _XmWrapperDataRec{
0105     struct _XmWrapperDataRec *next;
0106     WidgetClass     widgetClass;
0107     XtInitProc      initializeLeaf;
0108     XtSetValuesFunc setValuesLeaf;
0109     XtArgsProc      getValuesLeaf;
0110     XtRealizeProc   realize;
0111     XtWidgetClassProc   classPartInitLeaf;
0112     XtWidgetProc    resize;
0113     XtGeometryHandler   geometry_manager;
0114 
0115     /* init_depth is obselete now .. */
0116     Cardinal        init_depth;
0117 
0118     int                 initializeLeafCount;
0119     int                 setValuesLeafCount;
0120     int                 getValuesLeafCount;
0121     XtInitProc          constraintInitializeLeaf;
0122     XtSetValuesFunc     constraintSetValuesLeaf;
0123     int                 constraintInitializeLeafCount;
0124     int         constraintSetValuesLeafCount;
0125 } XmWrapperDataRec, *XmWrapperData;
0126 
0127 typedef struct _XmBaseClassExtRec{
0128     XtPointer       next_extension; 
0129     XrmQuark        record_type;    
0130     long        version;    
0131     Cardinal        record_size;    
0132     XtInitProc      initializePrehook;
0133     XtSetValuesFunc     setValuesPrehook;
0134     XtInitProc      initializePosthook;
0135     XtSetValuesFunc     setValuesPosthook;
0136     WidgetClass     secondaryObjectClass;
0137     XtInitProc      secondaryObjectCreate;
0138     XmGetSecResDataFunc getSecResData;
0139     unsigned char   flags[32];
0140     XtArgsProc      getValuesPrehook;
0141     XtArgsProc      getValuesPosthook;
0142     XtWidgetClassProc   classPartInitPrehook;
0143     XtWidgetClassProc   classPartInitPosthook;
0144     XtResourceList  ext_resources;
0145     XtResourceList  compiled_ext_resources;
0146     Cardinal        num_ext_resources;
0147     Boolean     use_sub_resources;
0148     XmWidgetNavigableProc widgetNavigable;
0149     XmFocusChangeProc   focusChange;
0150     XmWrapperData   wrapperData;
0151 } XmBaseClassExtRec, *XmBaseClassExt;
0152 
0153 
0154 typedef struct _XmWidgetExtDataRec{
0155     Widget      widget;
0156     Widget      reqWidget;
0157     Widget      oldWidget;
0158 } XmWidgetExtDataRec, *XmWidgetExtData;
0159 
0160 externalref XrmQuark         XmQmotif;
0161 externalref int          _XmInheritClass;
0162 externalref XmBaseClassExt * _Xm_fastPtr;
0163   
0164 /********    Private Function Declarations    ********/
0165 
0166 
0167 extern XmGenericClassExt * _XmGetClassExtensionPtr( 
0168                         XmGenericClassExt *listHeadPtr,
0169                         XrmQuark owner) ;
0170 extern Boolean _XmIsSubclassOf(WidgetClass wc, WidgetClass sc);
0171 
0172 
0173 /********    End Private Function Declarations    ********/
0174 
0175 #ifdef __cplusplus
0176 }  /* Close scope of 'extern "C"' declaration which encloses file. */
0177 #endif
0178 
0179 #endif /* _XmBaseClassP_h */
0180 /* DON'T ADD ANYTHING AFTER THIS #endif */