Merge branch 'master' into cde-next
[oweals/cde.git] / cde / programs / dtwm / ButtonP.h
1 /*
2  * CDE - Common Desktop Environment
3  *
4  * Copyright (c) 1993-2012, The Open Group. All rights reserved.
5  *
6  * These libraries and programs are free software; you can
7  * redistribute them and/or modify them under the terms of the GNU
8  * Lesser General Public License as published by the Free Software
9  * Foundation; either version 2 of the License, or (at your option)
10  * any later version.
11  *
12  * These libraries and programs are distributed in the hope that
13  * they will be useful, but WITHOUT ANY WARRANTY; without even the
14  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15  * PURPOSE. See the GNU Lesser General Public License for more
16  * details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with these libraries and programs; if not, write
20  * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21  * Floor, Boston, MA 02110-1301 USA
22  */
23 /******************************************************************************
24 *******************************************************************************
25 *
26 *  (c) Copyright 1992 HEWLETT-PACKARD COMPANY
27 *  ALL RIGHTS RESERVED
28 *
29 *******************************************************************************
30 ******************************************************************************/
31 #ifndef _DtButtonP_h
32 #define _DtButtonP_h
33
34 #include <Xm/XmP.h>
35 #include "Button.h"
36 #include <Xm/GadgetP.h>
37 #include <Xm/ManagerP.h>
38
39 #if defined(__cplusplus) || defined(c_plusplus)
40 extern "C" {
41 #endif
42
43 /*  Arrow class structure  */
44
45 typedef struct _DtButtonGadgetClassPart
46 {
47    caddr_t extension;
48 } DtButtonGadgetClassPart;
49
50
51 /*  Full class record declaration for Arrow class  */
52
53 typedef struct _DtButtonGadgetClassRec
54 {
55    RectObjClassPart             rect_class;
56    XmGadgetClassPart            gadget_class;
57    DtButtonGadgetClassPart      button_class;
58 } DtButtonGadgetClassRec;
59
60 externalref DtButtonGadgetClassRec dtButtonGadgetClassRec;
61
62
63 /*  The button instance record  */
64
65 typedef struct _DtButtonGadgetPart
66 {
67    XtCallbackList callback;
68
69    Boolean armed;
70
71    GC      gc_normal;
72    GC      gc_clip;
73    GC      gc_background;
74    GC      gc_armed_bg;
75
76    XtIntervalId     timer;      
77    unsigned char    multiClick;         /* KEEP/DISCARD resource */
78    int              click_count;
79    Time             armTimeStamp;
80    Time             activateTimeStamp;
81
82         Widget          subpanel;
83         XtPointer       push_function;
84         XtPointer       push_argument;
85
86         String          image_name;
87         Pixmap          pixmap;
88         Pixmap          mask;
89         Dimension       pixmap_width;
90         Dimension       pixmap_height;
91
92         int             cursor_font;
93         Pixel           arm_color;
94 } DtButtonGadgetPart;
95
96
97 /*  Full instance record declaration  */
98
99 typedef struct _DtButtonGadgetRec
100 {
101    ObjectPart            object;
102    RectObjPart           rectangle;
103    XmGadgetPart          gadget;
104    DtButtonGadgetPart    button;
105 } DtButtonGadgetRec;
106
107 #define B_Expose(w,e,r) \
108         (w -> core.widget_class->core_class.expose)(w,e,r)
109 #define B_ArmColor(w)           (w -> button.arm_color)
110 #define B_CursorFont(w)         (w -> button.cursor_font)
111 #define B_Armed(w)              (w -> button.armed)
112 #define B_PushFunction(w)       (w -> button.push_function)
113 #define B_PushArgument(w)       (w -> button.push_argument)
114 #define B_Subpanel(w)           (w -> button.subpanel)
115 #define B_Callback(w)           (w -> button.callback)
116 #define B_PixmapWidth(w)        (w -> button.pixmap_width)
117 #define B_PixmapHeight(w)       (w -> button.pixmap_height)
118 #define B_ImageName(w)          (w -> button.image_name)
119 #define B_Mask(w)               (w -> button.mask)
120 #define B_Pixmap(w)             (w -> button.pixmap)
121 #define M_TopShadowColor(w)     (w -> manager.top_shadow_color)
122 #define M_BottomShadowColor(w)  (w -> manager.bottom_shadow_color)
123
124 #if defined(__cplusplus) || defined(c_plusplus)
125 }  /* Close scope of 'extern "C"' declaration which encloses file. */
126 #endif
127
128 #endif /* _DtButtonP_h */
129 /* DON'T ADD ANYTHING AFTER THIS #endif */