Back to home page

EIC code displayed by LXR

 
 

    


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

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 _XmGadgetP_h
0024 #define _XmGadgetP_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 /*  Masks to define input the gadget is interested in  */
0038 
0039 #define XmNO_EVENT              0x000
0040 #define XmENTER_EVENT           0x001
0041 #define XmLEAVE_EVENT           0x002
0042 #define XmFOCUS_IN_EVENT        0x004
0043 #define XmFOCUS_OUT_EVENT       0x008
0044 #define XmMOTION_EVENT          0x010
0045 #define XmARM_EVENT             0x020
0046 #define XmACTIVATE_EVENT        0x040
0047 #define XmHELP_EVENT            0x080
0048 #define XmKEY_EVENT             0x100
0049 #define XmMULTI_ARM_EVENT       0x200
0050 #define XmMULTI_ACTIVATE_EVENT  0x400
0051 #define XmBDRAG_EVENT       0x800
0052 #define XmALL_EVENT             0xFFF
0053 
0054 
0055 /* Gadget access Macros */
0056 #define G_ShadowThickness(g) \
0057     (((XmGadget)(g))->gadget.shadow_thickness)
0058 #define G_HighlightThickness(g) \
0059     (((XmGadget)(g))->gadget.highlight_thickness)
0060 
0061 #define GCEPTR(wc)  ((XmGadgetClassExt *)(&(((XmGadgetClass)(wc))->gadget_class.extension)))
0062 #define _XmGetGadgetClassExtPtr(wc, owner) \
0063   ((*GCEPTR(wc) && (((*GCEPTR(wc))->record_type) == owner))\
0064    ? GCEPTR(wc) \
0065    :((XmGadgetClassExt *) _XmGetClassExtensionPtr(((XmGenericClassExt *)GCEPTR(wc)), owner)))
0066 
0067 #define XmGadgetClassExtVersion 2L
0068 
0069 
0070 /* Gadget cache header for each gadget's Cache Part */
0071 
0072 typedef struct _XmGadgetCache
0073 {
0074    struct _XmGadgetCache    *next;
0075    struct _XmGadgetCache    *prev;
0076    int              ref_count;
0077 } XmGadgetCache, *XmGadgetCachePtr;
0078 
0079 
0080 /* A cache entry for each class which desires gadget caching */
0081 
0082 typedef struct _XmCacheClassPart 
0083 {
0084    XmGadgetCache    cache_head;
0085    XmCacheCopyProc  cache_copy;
0086    XmGadgetCacheProc    cache_delete;
0087    XmCacheCompareProc   cache_compare;
0088 } XmCacheClassPart, *XmCacheClassPartPtr;
0089 
0090 /* A struct for properly aligning the data part of the cache entry. */
0091 
0092 typedef struct _XmGadgetCacheRef
0093 {
0094    XmGadgetCache    cache;
0095    XtArgVal     data;
0096 } XmGadgetCacheRef, *XmGadgetCacheRefPtr;
0097 
0098 /*  Gadget class structure  */
0099 
0100 typedef struct _XmGadgetClassExtRec{
0101     XtPointer           next_extension;
0102     XrmQuark            record_type;
0103     long                version;
0104     Cardinal            record_size;
0105     XmWidgetBaselineProc widget_baseline;
0106     XmWidgetDisplayRectProc  widget_display_rect;
0107     XmWidgetMarginsProc widget_margins;
0108 }XmGadgetClassExtRec, *XmGadgetClassExt;
0109 
0110 typedef struct _XmGadgetClassPart
0111 {
0112    XtWidgetProc         border_highlight;
0113    XtWidgetProc         border_unhighlight;
0114    XtActionProc         arm_and_activate;
0115    XmWidgetDispatchProc input_dispatch;
0116    XmVisualChangeProc   visual_change;      /* unused in Motif 2.0 */
0117    XmSyntheticResource * syn_resources;   
0118    int                  num_syn_resources;   
0119    XmCacheClassPartPtr  cache_part;
0120    XtPointer        extension;
0121 } XmGadgetClassPart;
0122 
0123 
0124 /*  Full class record declaration for Gadget class  */
0125 
0126 typedef struct _XmGadgetClassRec
0127 {
0128    RectObjClassPart  rect_class;
0129    XmGadgetClassPart gadget_class;
0130 } XmGadgetClassRec;
0131 
0132 externalref XmGadgetClassRec xmGadgetClassRec;
0133 
0134 
0135 /*  The Gadget instance record  */
0136 
0137 typedef struct _XmGadgetPart
0138 {
0139    Dimension shadow_thickness;
0140    Dimension highlight_thickness;
0141 
0142    XtCallbackList help_callback;
0143    XtPointer      user_data;
0144 
0145    Boolean traversal_on;
0146    Boolean highlight_on_enter;
0147    Boolean have_traversal;
0148 
0149    unsigned char unit_type;
0150    XmNavigationType navigation_type;
0151 
0152    Boolean highlight_drawn;
0153    Boolean highlighted;
0154    Boolean visible;
0155 
0156    Mask event_mask;
0157    XmDirection layout_direction;
0158 #ifdef OM22_COMPATIBILITY   
0159    XmString tool_tip_string;
0160 #endif
0161 } XmGadgetPart;
0162 
0163 /*  Full instance record declaration  */
0164 
0165 typedef struct _XmGadgetRec
0166 {
0167    ObjectPart   object;
0168    RectObjPart  rectangle;
0169    XmGadgetPart gadget;
0170 } XmGadgetRec;
0171 
0172 
0173 #ifdef __cplusplus
0174 }  /* Close scope of 'extern "C"' declaration which encloses file. */
0175 #endif
0176 
0177 #endif /* _XmGadgetP_h */
0178 /* DON'T ADD ANYTHING AFTER THIS #endif */
0179 
0180 
0181 
0182 
0183