Back to home page

EIC code displayed by LXR

 
 

    


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

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 _XmPButtonGP_h
0024 #define _XmPButtonGP_h
0025 
0026 #include <Xm/PushBG.h>
0027 #include <Xm/LabelGP.h>
0028 
0029 #ifdef __cplusplus
0030 extern "C" {
0031 #endif
0032 
0033 /*************************************************************/
0034 /* The PushButton Gadget Cache Object's class and instance records*/
0035 /*************************************************************/
0036 
0037 typedef struct _XmPushButtonGCacheObjClassPart
0038 {
0039     int foo;
0040 } XmPushButtonGCacheObjClassPart;
0041 
0042                     
0043 typedef struct _XmPushButtonGCacheObjClassRec  
0044 {
0045     ObjectClassPart                     object_class;
0046         XmExtClassPart                      ext_class;
0047     XmLabelGCacheObjClassPart           label_class_cache;
0048     XmPushButtonGCacheObjClassPart      pushbutton_class_cache;
0049 } XmPushButtonGCacheObjClassRec;
0050 
0051 externalref XmPushButtonGCacheObjClassRec xmPushButtonGCacheObjClassRec;
0052 
0053 
0054 typedef struct _XmPushButtonGCacheObjPart
0055 {
0056    Boolean      fill_on_arm;
0057    Pixel            arm_color;
0058    Pixmap       arm_pixmap;
0059    Pixmap           unarm_pixmap;
0060    unsigned char    multiClick;     /* KEEP/DISCARD resource */
0061    Dimension        default_button_shadow_thickness;
0062              /* New resource - always add it to gadget's dimension. */
0063 
0064    GC               fill_gc;
0065    GC               background_gc;
0066 
0067    /* following items have some persistence across gadget instances and are
0068    ** here only for data-space savings
0069    */
0070    XtIntervalId     timer;
0071    Widget           timer_widget;
0072    
0073 } XmPushButtonGCacheObjPart;
0074 
0075 typedef struct _XmPushButtonGCacheObjRec
0076 {
0077     ObjectPart                   object;
0078     XmExtPart                    ext;
0079     XmLabelGCacheObjPart         label_cache;
0080     XmPushButtonGCacheObjPart    pushbutton_cache;
0081 } XmPushButtonGCacheObjRec;
0082 
0083 
0084 /* PushButton class structure */
0085 
0086 typedef struct _XmPushButtonGadgetClassPart
0087 {
0088     XtPointer extension;  /* Pointer to extension record */
0089 } XmPushButtonGadgetClassPart;
0090 
0091 
0092 /* Full class record declaration for PushButton class */
0093 
0094 typedef struct _XmPushButtonGadgetClassRec 
0095 {
0096    RectObjClassPart             rect_class;
0097    XmGadgetClassPart            gadget_class;
0098    XmLabelGadgetClassPart       label_class;
0099    XmPushButtonGadgetClassPart  pushbutton_class;
0100 
0101 } XmPushButtonGadgetClassRec;
0102 
0103 
0104 externalref XmPushButtonGadgetClassRec xmPushButtonGadgetClassRec;
0105 
0106 
0107 /* PushButton instance record */
0108 
0109 typedef struct _XmPushButtonGadgetPart
0110 {
0111    XtCallbackList   activate_callback;
0112    XtCallbackList   arm_callback;
0113    XtCallbackList   disarm_callback;
0114 
0115    Dimension        show_as_default;
0116    Boolean      armed;
0117    int              click_count;
0118 
0119    Boolean      compatible;   /* if false it is Motif 1.1 else Motif 1.0  */
0120                                   /* not cached for performance reasons */
0121    
0122    XmPushButtonGCacheObjPart  *cache; /* Replace cache instance fields */
0123                     /* with a pointer */
0124 } XmPushButtonGadgetPart;
0125 
0126 /* Full instance record declaration */
0127 
0128 typedef struct _XmPushButtonGadgetRec {
0129    ObjectPart              object;
0130    RectObjPart             rectangle;
0131    XmGadgetPart            gadget;
0132    XmLabelGadgetPart       label;
0133    XmPushButtonGadgetPart   pushbutton;
0134 } XmPushButtonGadgetRec;
0135 
0136 /* MACROS */
0137 /**********/
0138 
0139 /* Macros for cached instance fields */
0140 
0141 #define PBG_FillOnArm(w)        (((XmPushButtonGadget) (w)) -> \
0142                        pushbutton.cache->fill_on_arm)
0143 #define PBG_ArmColor(w)         (((XmPushButtonGadget) (w)) -> \
0144                        pushbutton.cache->arm_color)
0145 #define PBG_FillGc(w)           (((XmPushButtonGadget) (w)) -> \
0146                        pushbutton.cache->fill_gc)
0147 #define PBG_BackgroundGc(w)     (((XmPushButtonGadget) (w)) -> \
0148                        pushbutton.cache->background_gc)
0149 #define PBG_Timer(w)            (((XmPushButtonGadget) (w)) -> \
0150                        pushbutton.cache->timer)
0151 #define PBG_ArmPixmap(w)        (((XmPushButtonGadget) (w)) -> \
0152                        pushbutton.cache->arm_pixmap)
0153 #define PBG_UnarmPixmap(w)      (((XmPushButtonGadget) (w)) -> \
0154                        pushbutton.cache->unarm_pixmap)
0155 #define PBG_MultiClick(w)           (((XmPushButtonGadget) (w)) -> \
0156                                    pushbutton.cache->multiClick)
0157 #define PBG_DefaultButtonShadowThickness(w)     (((XmPushButtonGadget) (w)) -> \
0158                        pushbutton.cache->default_button_shadow_thickness)
0159 
0160 /* Macros for uncached instance fields */
0161 
0162 #define PBG_ActivateCallback(w)     (((XmPushButtonGadget) (w)) -> \
0163                        pushbutton.activate_callback)
0164 #define PBG_ArmCallback(w)      (((XmPushButtonGadget) (w)) -> \
0165                        pushbutton.arm_callback)
0166 #define PBG_DisarmCallback(w)       (((XmPushButtonGadget) (w)) -> \
0167                        pushbutton.disarm_callback)
0168 #define PBG_Armed(w)            (((XmPushButtonGadget) (w)) -> \
0169                        pushbutton.armed)
0170 #define PBG_ClickCount(w)      (((XmPushButtonGadget) (w)) -> \
0171                        pushbutton.click_count)
0172 #define PBG_Compatible(w)      (((XmPushButtonGadget) (w)) -> \
0173                        pushbutton.compatible)
0174 #define PBG_ShowAsDefault(w)        (((XmPushButtonGadget) (w)) -> \
0175                        pushbutton.show_as_default)
0176 
0177 /******************************/
0178 /* Convenience Macros         */
0179 /******************************/
0180 
0181 #define PBG_Cache(w)            (((XmPushButtonGadget)(w))->\
0182                        pushbutton.cache)
0183 #define PBG_ClassCachePart(w) \
0184     (((XmPushButtonGadgetClass)xmPushButtonGadgetClass)->gadget_class.cache_part)
0185 
0186 
0187 /********    Private Function Declarations    ********/
0188 
0189 /********    End Private Function Declarations    ********/
0190 
0191 
0192 #ifdef __cplusplus
0193 }  /* Close scope of 'extern "C"' declaration which encloses file. */
0194 #endif
0195 
0196 #endif /* _XmPButtonGP_h */
0197 /* DON'T ADD ANYTHING AFTER THIS #endif */