File indexing completed on 2025-01-18 10:15:23
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
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
0034
0035 typedef struct
0036 {
0037 XtCallbackList activate_callback;
0038 XtCallbackList cascade_callback;
0039
0040
0041 Widget submenu;
0042 Pixmap cascade_pixmap;
0043 int map_delay;
0044
0045
0046
0047 GC arm_GC;
0048 GC background_GC;
0049 Boolean armed;
0050 XRectangle cascade_rect;
0051 XtIntervalId timer;
0052 Pixmap armed_pixmap;
0053
0054 } XmCascadeButtonPart;
0055
0056
0057
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
0068 {
0069 CorePart core;
0070 XmPrimitivePart primitive;
0071 XmLabelPart label;
0072 XmCascadeButtonPart cascade_button;
0073 } XmCascadeButtonWidgetRec;
0074
0075
0076
0077
0078 typedef struct
0079 {
0080 XtPointer extension;
0081 } XmCascadeButtonClassPart;
0082
0083
0084
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
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 }
0165 #endif
0166
0167 #endif
0168