Back to home page

EIC code displayed by LXR

 
 

    


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

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  _XmCascadeBGP_h
0024 #define  _XmCascadeBGP_h
0025 
0026 #include <Xm/CascadeBG.h>
0027 #include <Xm/LabelGP.h>
0028 
0029 #ifdef __cplusplus
0030 extern "C" {
0031 #endif
0032 
0033 /*********************************************************************
0034  * The Arrow Cache record for the menu cascade button
0035  *********************************************************************/
0036 typedef struct _XmArrowPixmap
0037 {
0038    Dimension height, width;
0039    unsigned int depth;
0040    unsigned char direction;
0041    Pixel top_shadow_color;
0042    Pixel bottom_shadow_color;
0043    Pixel foreground_color;
0044    Display *display;
0045    Screen *screen;
0046    Pixmap pixmap;
0047 } XmArrowPixmap;
0048 
0049 
0050 /*********************************************************************/
0051 /* The CascadeButton Gadget Cache Object's class and instance records*/
0052 /*********************************************************************/
0053 
0054 
0055 typedef struct _XmCascadeButtonGCacheObjClassPart
0056 {
0057   int foo;
0058 } XmCascadeButtonGCacheObjClassPart;
0059 
0060 
0061 typedef struct _XmCascadeButtonGCacheObjClassRec
0062 {
0063   ObjectClassPart                     object_class;
0064   XmExtClassPart                      ext_class;
0065   XmLabelGCacheObjClassPart           label_class_cache;
0066   XmCascadeButtonGCacheObjClassPart   cascade_button_class_cache;
0067 } XmCascadeButtonGCacheObjClassRec;
0068 
0069 externalref XmCascadeButtonGCacheObjClassRec xmCascadeButtonGCacheObjClassRec;
0070 
0071 
0072 typedef struct _XmCascadeButtonGCacheObjPart
0073 {
0074   Pixmap              cascade_pixmap;         /* pixmap for the cascade */
0075   int                 map_delay;              /* time delay for posting */
0076   Pixmap          armed_pixmap;
0077   GC                  arm_gc;
0078   GC                  background_gc;
0079 } XmCascadeButtonGCacheObjPart;
0080 
0081 typedef struct _XmCascadeButtonGCacheObjRec
0082 {
0083   ObjectPart                   object;
0084   XmExtPart                    ext;
0085   XmLabelGCacheObjPart         label_cache;
0086   XmCascadeButtonGCacheObjPart cascade_button_cache;
0087 } XmCascadeButtonGCacheObjRec;
0088 
0089 /* The CascadeButtonGadget instance record */
0090 
0091 typedef struct _XmCascadeButtonGadgetPart
0092 {           /* resources */
0093   Widget        submenu;        /* the menu to pull down */
0094   XtCallbackList    activate_callback;  /* widget fired callback */
0095   XtCallbackList    cascade_callback;   /* optional callback, called */
0096                         /* when the menu is about */
0097                         /* to be pulled down */
0098             /* internal fields */
0099   Boolean       armed;          /* armed flag */
0100   XRectangle        cascade_rect;       /* location of cascade*/
0101   XtIntervalId      timer;          /* timeout id */
0102   XmCascadeButtonGCacheObjPart         *cache;
0103 } XmCascadeButtonGadgetPart;
0104 
0105 
0106 /* Full instance record declaration */
0107 
0108 typedef struct _XmCascadeButtonGadgetRec
0109 {
0110   ObjectPart             object;
0111   RectObjPart                rectangle;
0112   XmGadgetPart               gadget;
0113   XmLabelGadgetPart          label;
0114   XmCascadeButtonGadgetPart  cascade_button;
0115 } XmCascadeButtonGadgetRec;
0116 
0117 
0118 /* CascadeButton class structure */
0119 
0120 typedef struct 
0121 {
0122   XtPointer extension;  /* Pointer to extension record */
0123 } XmCascadeButtonGadgetClassPart;
0124 
0125 
0126 /* Full class record declaration for CascadeButton class */
0127 
0128 typedef struct _XmCascadeButtonGadgetClassRec 
0129 {
0130   RectObjClassPart               rect_class;
0131   XmGadgetClassPart              gadget_class;
0132   XmLabelGadgetClassPart         label_class;
0133   XmCascadeButtonGadgetClassPart cascade_button_class;
0134 } XmCascadeButtonGadgetClassRec;
0135 
0136 
0137 externalref XmCascadeButtonGadgetClassRec   xmCascadeButtonGadgetClassRec;
0138 
0139 
0140 /* Access macro definitions  for UNcached fields*/
0141 
0142 #define CBG_Submenu(cb)     (((XmCascadeButtonGadget)           \
0143                                   cb)->cascade_button.submenu)
0144 #define CBG_ActivateCall(cb)    (((XmCascadeButtonGadget)                    \
0145                                   cb)->cascade_button.activate_callback)
0146 #define CBG_CascadeCall(cb) (((XmCascadeButtonGadget)                    \
0147                                   cb)->cascade_button.cascade_callback)
0148 #define CBG_Armed(cb)       (((XmCascadeButtonGadget)                    \
0149                                   cb)->cascade_button.armed)
0150 #define CBG_CascadeRect(cb) (((XmCascadeButtonGadget)                    \
0151                                   cb)->cascade_button.cascade_rect)
0152 #define CBG_Timer(cb)           (((XmCascadeButtonGadget)                    \
0153                   cb)->cascade_button.timer)
0154 #define CBG_Cascade_x(cb)   (((XmCascadeButtonGadget)                    \
0155                                   cb)->cascade_button.cascade_rect.x)
0156 #define CBG_Cascade_y(cb)   (((XmCascadeButtonGadget)                    \
0157                                   cb)->cascade_button.cascade_rect.y)
0158 #define CBG_Cascade_width(cb)   (((XmCascadeButtonGadget)                    \
0159                                   cb)->cascade_button.cascade_rect.width)
0160 #define CBG_Cascade_height(cb)  (((XmCascadeButtonGadget)                    \
0161                                   cb)->cascade_button.cascade_rect.height)
0162 #define CBG_HasCascade(cb)      (((LabG_MenuType(cb) == XmMENU_PULLDOWN)  || \
0163                       (LabG_MenuType(cb) == XmMENU_POPUP) ||     \
0164                                   (LabG_MenuType(cb) == XmMENU_OPTION)) &&   \
0165                      (CBG_Submenu(cb)))
0166 
0167 #define XmCBG_ARMED_BIT        (1 << 0)
0168 #define XmCBG_TRAVERSE_BIT     (1 << 1)
0169 #define XmCBG_WAS_POSTED_BIT   (1 << 2)
0170 
0171 #define CBG_IsArmed(cb)  (((XmCascadeButtonGadget)(cb))->cascade_button.armed \
0172               & XmCBG_ARMED_BIT)
0173 
0174 #define CBG_Traversing(cb) (((XmCascadeButtonGadget)                          \
0175                 (cb))->cascade_button.armed & XmCBG_TRAVERSE_BIT)
0176 
0177 #define CBG_WasPosted(cb) (((XmCascadeButtonGadget)                          \
0178                 (cb))->cascade_button.armed & XmCBG_WAS_POSTED_BIT)
0179 
0180 #define CBG_SetBit(byte,bit,v)  byte = (byte & (~bit)) | (v ? bit : 0)
0181 
0182 #define CBG_SetArmed(cb,v)  CBG_SetBit (((XmCascadeButtonGadget)         \
0183                        (cb))->cascade_button.armed,          \
0184                       XmCBG_ARMED_BIT, v)
0185 
0186 #define CBG_SetTraverse(cb,v)  CBG_SetBit (((XmCascadeButtonGadget)      \
0187                        (cb))->cascade_button.armed,          \
0188                       XmCBG_TRAVERSE_BIT, v)
0189 
0190 #define CBG_SetWasPosted(cb,v)  CBG_SetBit (((XmCascadeButtonGadget)         \
0191                          (cb))->cascade_button.armed,          \
0192                         XmCBG_WAS_POSTED_BIT, v)
0193 
0194 
0195                   
0196 /* Access macro definitions  for Cached fields*/
0197 
0198 #define CBG_CascadePixmap(cb)   (((XmCascadeButtonGadget)                    \
0199                   cb)->cascade_button.cache->cascade_pixmap)
0200 #define CBG_MapDelay(cb)        (((XmCascadeButtonGadget)                    \
0201                   cb)->cascade_button.cache->map_delay)
0202 #define CBG_ArmedPixmap(cb) (((XmCascadeButtonGadget)                    \
0203                   cb)->cascade_button.cache->armed_pixmap)
0204 #define CBG_ArmGC(cb)            (((XmCascadeButtonGadget)                    \
0205                                   cb)->cascade_button.cache->arm_gc)
0206 #define CBG_BackgroundGC(cb)     (((XmCascadeButtonGadget)                    \
0207                                   cb)->cascade_button.cache->background_gc)
0208 
0209 
0210 /******************************/
0211 /* Convenience Macros         */
0212 /******************************/
0213 
0214 
0215 #define CBG_Cache(w)                    (((XmCascadeButtonGadget)(w))->\
0216                        cascade_button.cache)
0217 #define CBG_ClassCachePart(w) \
0218     (((XmCascadeButtonGadgetClass)xmCascadeButtonGadgetClass)->gadget_class.cache_part)
0219 
0220 
0221 #ifdef __cplusplus
0222 }  /* Close scope of 'extern "C"' declaration which encloses file. */
0223 #endif
0224 
0225 #endif  /* _XmCascadeBGP_h */
0226 /* DON'T ADD STUFF AFTER THIS #endif */