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  _XmCascadeBP_h
0024 #define  _XmCascadeBP_h
0025 
0026 #include <Xm/CascadeB.h>
0027 #include <Xm/LabelP.h>
0028 
0029 #ifdef __cplusplus
0030 extern "C" {
0031 #endif
0032 
0033 /* The CascadeButton instance record */
0034 
0035 typedef struct 
0036 {               /* resources */
0037     XtCallbackList  activate_callback;  /* widget fired callback */
0038     XtCallbackList  cascade_callback;   /* called when the menu is  */
0039                         /* about to be pulled down */
0040 
0041     Widget      submenu;        /* the menu to pull down */
0042     Pixmap      cascade_pixmap;     /* pixmap for the cascade */
0043     int         map_delay;      /* time delay for posting */
0044 
0045                 /* internal fields */
0046 
0047     GC                  arm_GC;                 /* armed GC */
0048     GC                  background_GC;          /* normal GC */
0049     Boolean     armed;          /* armed flag */
0050     XRectangle      cascade_rect;       /* location of cascade*/
0051     XtIntervalId    timer;          /* timeout id */
0052     Pixmap      armed_pixmap;       /* arm arrow cascade */
0053 
0054 } XmCascadeButtonPart;
0055 
0056 
0057 /* Full instance record declaration */
0058 
0059 typedef struct _XmCascadeButtonRec
0060 {
0061     CorePart        core;
0062     XmPrimitivePart primitive;
0063     XmLabelPart     label;
0064     XmCascadeButtonPart cascade_button;
0065 } XmCascadeButtonRec;
0066 
0067 typedef struct _XmCascadeButtonWidgetRec/* OBSOLETE (for compatibility only).*/
0068 {
0069     CorePart        core;
0070     XmPrimitivePart primitive;
0071     XmLabelPart     label;
0072     XmCascadeButtonPart cascade_button;
0073 } XmCascadeButtonWidgetRec;
0074 
0075 
0076 /* CascadeButton class structure */
0077 
0078 typedef struct 
0079 {
0080     XtPointer   extension;  /* Pointer to extension record */
0081 } XmCascadeButtonClassPart;
0082 
0083 
0084 /* Full class record declaration for CascadeButton class */
0085 
0086 typedef struct _XmCascadeButtonClassRec 
0087 {
0088     CoreClassPart       core_class;
0089     XmPrimitiveClassPart    primitive_class;
0090     XmLabelClassPart        label_class;
0091     XmCascadeButtonClassPart cascade_button_class;
0092 } XmCascadeButtonClassRec;
0093 
0094 
0095 externalref XmCascadeButtonClassRec   xmCascadeButtonClassRec;
0096 
0097 
0098 /* Access macro definitions */
0099 
0100 #define CB_Submenu(cb)      (((XmCascadeButtonWidget)                    \
0101                                   cb)->cascade_button.submenu)
0102 
0103 #define CB_ActivateCall(cb) (((XmCascadeButtonWidget)                    \
0104                                   cb)->cascade_button.activate_callback)
0105 #define CB_CascadeCall(cb)  (((XmCascadeButtonWidget)                    \
0106                                   cb)->cascade_button.cascade_callback)
0107 
0108 
0109 #define CB_CascadePixmap(cb)    (((XmCascadeButtonWidget)                    \
0110                                   cb)->cascade_button.cascade_pixmap)
0111 #define CB_ArmedPixmap(cb)  (((XmCascadeButtonWidget)                    \
0112                                   cb)->cascade_button.armed_pixmap)
0113 
0114 #define CB_ArmGC(cb)            (((XmCascadeButtonWidget)                    \
0115                                   cb)->cascade_button.arm_GC)
0116 #define CB_BackgroundGC(cb)     (((XmCascadeButtonWidget)                    \
0117                                   cb)->cascade_button.background_GC)
0118 
0119 #define CB_Cascade_x(cb)    (((XmCascadeButtonWidget)                    \
0120                                   cb)->cascade_button.cascade_rect.x)
0121 #define CB_Cascade_y(cb)    (((XmCascadeButtonWidget)                    \
0122                                   cb)->cascade_button.cascade_rect.y)
0123 #define CB_Cascade_width(cb)    (((XmCascadeButtonWidget)                    \
0124                                   cb)->cascade_button.cascade_rect.width)
0125 #define CB_Cascade_height(cb)   (((XmCascadeButtonWidget)                    \
0126                                   cb)->cascade_button.cascade_rect.height)
0127 
0128 #define CB_HasCascade(cb)       (((Lab_MenuType(cb) == XmMENU_PULLDOWN)  ||  \
0129                   (Lab_MenuType(cb) == XmMENU_POPUP)) &&     \
0130                      (CB_Submenu(cb)))
0131 
0132 
0133 #define XmCB_ARMED_BIT        (1 << 0)  
0134 #define XmCB_TRAVERSE_BIT     (1 << 1)
0135 #define XmCB_WAS_POSTED_BIT   (1 << 2)
0136 
0137 
0138 #define CB_IsArmed(cb)   (((XmCascadeButtonWidget)(cb))->cascade_button.armed \
0139               & XmCB_ARMED_BIT)
0140 
0141 #define CB_Traversing(cb) (((XmCascadeButtonWidget)                           \
0142                 (cb))->cascade_button.armed & XmCB_TRAVERSE_BIT)
0143 
0144 #define CB_WasPosted(cb)  (((XmCascadeButtonWidget)                           \
0145                 (cb))->cascade_button.armed & XmCB_WAS_POSTED_BIT)
0146 
0147 #define CB_SetBit(byte,bit,v)  byte = (byte & (~bit)) | (v ? bit : 0)
0148 
0149 #define CB_SetArmed(cb,v)  CB_SetBit (((XmCascadeButtonWidget)           \
0150                        (cb))->cascade_button.armed,          \
0151                       XmCB_ARMED_BIT, v)
0152 
0153 #define CB_SetTraverse(cb,v)  CB_SetBit (((XmCascadeButtonWidget)        \
0154                        (cb))->cascade_button.armed,          \
0155                       XmCB_TRAVERSE_BIT, v)
0156 
0157 #define CB_SetWasPosted(cb,v)  CB_SetBit (((XmCascadeButtonWidget)       \
0158                        (cb))->cascade_button.armed,      \
0159                       XmCB_WAS_POSTED_BIT, v)
0160 
0161 
0162 
0163 #ifdef __cplusplus
0164 }  /* Close scope of 'extern "C"' declaration which encloses file. */
0165 #endif
0166 
0167 #endif  /* _XmCascadeBP_h */
0168 /* DON'T ADD STUFF AFTER THIS #endif */