dtcalc: change from obsoleted MAXFLOAT to FLT_MAX from std C
[oweals/cde.git] / cde / lib / DtWidget / MacrosP.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 librararies 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 /* $XConsortium: MacrosP.h /main/5 1996/03/27 20:16:40 drk $
24  *
25  * (c) Copyright 1996 Digital Equipment Corporation.
26  * (c) Copyright 1990,1996 Hewlett-Packard Company.
27  * (c) Copyright 1996 International Business Machines Corp.
28  * (c) Copyright 1996 Sun Microsystems, Inc.
29  * (c) Copyright 1996 Novell, Inc. 
30  * (c) Copyright 1996 FUJITSU LIMITED.
31  * (c) Copyright 1996 Hitachi.
32  */
33
34 /**---------------------------------------------------------------------
35 ***     
36 ***     file:           MacrosP.h
37 ***
38 ***     project:        MotifPlus Widgets
39 ***
40 ***     description:    Private include file with macros for MotifPlus
41 ***                     widgets and gadgets.
42 ***     
43 ***-------------------------------------------------------------------*/
44
45
46 #ifndef _DtMacrosP_h
47 #define _DtMacrosP_h
48
49 #define XmUNSPECIFIED_STRING    (XmString) 3
50
51
52 /*-------------------------------------------------------------
53 **      Widget Class Macros
54 */
55
56 /*      Core Class Macros
57 */
58 /*** WARNING: These macros are not thread-safe! ***/
59 #define C_WidgetClass(wc)       (wc -> core_class.widget_class)
60 #define C_Superclass(wc)        (wc -> core_class.superclass)
61 #define C_ClassName(wc)         (wc -> core_class.class_name)
62 #define C_ClassInited(wc)       (wc -> core_class.class_inited)
63 #define C_NumResources(wc)      (wc -> core_class.num_resources)
64
65 /*      Composite Class Macros
66 */      
67 #ifdef _XtCompositeP_h
68 #define C_ChangeManaged(wc)     (wc -> composite_class.change_managed)
69 #endif /* _XtCompositeP_h */
70
71 /*      Constraint Class Macros
72 */      
73 #ifdef _XtConstraintP_h
74 #define C_ConstraintResources(wc) (wc -> constraint_class.resources)
75 #define C_ConstraintNumResources(wc) (wc -> constraint_class.num_resources)
76 #endif /* _XtConstraintP_h */
77
78 /*      XmGadget Class Macros
79 */
80 #define XmInheritBorderHighlight        ((XtWidgetProc) _XtInherit)
81 #define XmInheritBorderUnhighlight      ((XtWidgetProc) _XtInherit)
82 #define XmInheritVisualChange           ((XmVisualChangeProc) _XtInherit)
83
84
85 \f
86 /*-------------------------------------------------------------
87 **      Primitive Macros
88 */
89
90 #define P_X(w)                  (w -> core.x)
91 #define P_Y(w)                  (w -> core.y)
92 #define P_Width(w)              (w -> core.width)
93 #define P_Height(w)             (w -> core.height)
94 #define P_BorderWidth(w)        (w -> core.border_width)
95 #define P_XrmName(w)            (w -> core.xrm_name)
96 #define P_PopupList(w)          (w -> core.popup_list)
97 #define P_NumPopups(w)          (w -> core.num_popups)
98
99
100 \f
101 /*-------------------------------------------------------------
102 **      Gadget Macros
103 */
104
105 /*      Object Macros
106 */
107 #define G_XrmName(r)            (r -> object.xrm_name)
108 #define G_Class(r)              (r -> object.widget_class)
109
110 /*      RectObject Macros
111 */
112 #define G_X(r)                  (r -> rectangle.x)
113 #define G_Y(r)                  (r -> rectangle.y)
114 #define G_Width(r)              (r -> rectangle.width)
115 #define G_Height(r)             (r -> rectangle.height)
116 #define G_BorderWidth(r)        (r -> rectangle.border_width)
117
118 /*      XmGadget Macros
119 */
120 #define G_HelpCB(g)             (g -> gadget.help_callback)
121 #define G_EventMask(g)          (g -> gadget.event_mask)
122 #define G_Highlighted(g)        (g -> gadget.highlighted)
123 #define G_UnitType(g)           (g -> gadget.unit_type)
124
125
126 \f
127 /*-------------------------------------------------------------
128 **      Manager Macros
129 */
130
131 /*      Core Macros
132 */
133 #define M_X(w)                  (w -> core.x)
134 #define M_Y(w)                  (w -> core.y)
135 #define M_Width(w)              (w -> core.width)
136 #define M_Height(w)             (w -> core.height)
137 #define M_BorderWidth(w)        (w -> core.border_width)
138 #define M_Background(w)         (w -> core.background_pixel)
139 #define M_Sensitive(w)          (w->core.sensitive && w->core.ancestor_sensitive) 
140 #define M_Name(w)               (w -> core.name)
141 #define M_Accelerators(w)       (w -> core.accelerators)
142 #define M_TmTranslations(w)     (w -> core.tm.translations)
143 #define M_PopupList(w)          (w -> core.popup_list)
144 #define M_NumPopups(w)          (w -> core.num_popups)
145
146 /*      Composite and Constraint Macros
147 */
148 #define M_Children(m)           (m -> composite.children)
149 #define M_NumChildren(m)        (m -> composite.num_children)
150
151 /*      XmManager Macros
152 */
153 #ifdef _XmManagerP_h
154 #define M_Foreground(m)         (m -> manager.foreground)
155 #define M_HighlightThickness(m) (m -> manager.highlight_thickness)
156 #define M_ShadowThickness(m)    (m -> manager.shadow_thickness)
157 #define M_TopShadowGC(m)        (m -> manager.top_shadow_GC)
158 #define M_BottomShadowGC(m)     (m -> manager.bottom_shadow_GC)
159 #define M_BackgroundGC(m)       (m -> manager.background_GC)
160 #define M_SelectedGadget(m)     (m -> manager.selected_gadget)
161 #define M_HelpCB(m)             (m -> manager.help_callback)
162 #define M_UnitType(m)           (m -> manager.unit_type)
163 #endif /* _XmManagerP_h */
164
165 /*      XmDrawingArea Macros
166 */
167 #ifdef _XmDrawingAreaP_h
168 #define M_MarginWidth(m)        (m -> drawing_area.margin_width)
169 #define M_MarginHeight(m)       (m -> drawing_area.margin_height)
170 #endif /* _XmDrawingAreaP_h */
171
172 /*      XmBulletinBoard Macros
173 */
174 #ifdef _XmBulletinBoardP_h
175 #define M_ButtonFontList(m)     (m -> bulletin_board.button_font_list)
176 #define M_LabelFontList(m)      (m -> bulletin_board.label_font_list)
177 #define M_TextFontList(m)       (m -> bulletin_board.text_font_list)
178 #define M_MarginWidth(m)        (m -> bulletin_board.margin_width)
179 #define M_MarginHeight(m)       (m -> bulletin_board.margin_height)
180 #endif /* _XmBulletinBoardP_h */
181
182 #ifdef MAYBE
183 /*      DtIconBox Macros
184 */
185 #ifdef _DtIconBoxP_h
186 #define M_Timer(m)              (m -> icon_box.timer)
187 #define M_ShellX(m)             (m -> icon_box.shell_x)
188 #define M_ShellY(m)             (m -> icon_box.shell_y)
189 #define M_DragShell(m)          (m -> icon_box.drag_shell)
190 #define M_DragWidget(m)         (m -> icon_box.drag_widget)
191 #define M_DragIcon(m)           (m -> icon_box.drag_icon)
192 #define M_XCursor(m)            (m -> icon_box.x_cursor)
193 #define M_CrossCursor(m)        (m -> icon_box.cross_cursor)
194 #endif /* _DtIconBoxP_h */
195 #endif /* MAYBE */
196
197 #endif /* _DtMacrosP_h */
198
199 /* DON'T ADD ANYTHING AFTER THIS #endif */