1 /**
2  *
3  * $Id: BulletinBP.h,v 1.1 2004/08/28 19:23:24 dannybackx Exp $
4  *
5  * Copyright (C) 1995 Free Software Foundation, Inc.
6  * Copyright (C) 1995-2000 LessTif Development Team
7  *
8  * This file is part of the GNU LessTif Library.
9  *
10  * This library is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU Library General Public
12  * License as published by the Free Software Foundation; either
13  * version 2 of the License, or (at your option) any later version.
14  *
15  * This library is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18  * Library General Public License for more details.
19  *
20  * You should have received a copy of the GNU Library General Public
21  * License along with this library; if not, write to the Free
22  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23  *
24  **/
25 
26 #ifndef _XM_BULLETINBP_H
27 #define _XM_BULLETINBP_H
28 
29 #include <Xm/BulletinB.h>
30 #include <Xm/ManagerP.h>
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
36 /* The bulletin board constraint part */
37 typedef struct _XmBulletinBoardConstraintPart {
38    char empty;
39 } XmBulletinBoardConstraintPart, *XmBulletinBoardConstraint;
40 
41 /* Define the bulletin board instance part */
42 typedef struct {
43     Dimension margin_width;
44     Dimension margin_height;
45 
46     Widget default_button;
47     Widget dynamic_default_button;
48     Widget cancel_button;
49     Widget dynamic_cancel_button;
50 
51     XtCallbackList focus_callback;
52     XtCallbackList map_callback;
53     XtCallbackList unmap_callback;
54 
55     XtTranslations text_translations;
56 
57     XmFontList button_font_list;
58     XmFontList label_font_list;
59     XmFontList text_font_list;
60 
61     Boolean allow_overlap;
62     Boolean default_position;
63     Boolean auto_unmanage;
64     unsigned char resize_policy;
65 
66     Dimension old_width;
67     Dimension old_height;
68     Dimension old_shadow_thickness;
69 
70     unsigned char shadow_type;
71     Boolean in_set_values;
72     Boolean initial_focus;
73 
74     Boolean no_resize;
75     unsigned char dialog_style;
76     XmString dialog_title;
77     Widget shell;
78     Widget stupid_dead_field;
79 
80     XmGeoMatrix geo_cache;
81 } XmBulletinBoardPart;
82 
83 /* Define the full instance record */
84 typedef struct _XmBulletinBoardRec {
85     CorePart core;
86     CompositePart composite;
87     ConstraintPart constraint;
88     XmManagerPart manager;
89     XmBulletinBoardPart bulletin_board;
90 } XmBulletinBoardRec;
91 
92 /* Define class part structure */
93 typedef struct {
94     Boolean		always_install_accelerators;
95     XmGeoCreateProc	geo_matrix_create;
96     XmFocusMovedProc	focus_moved_proc;
97     XtPointer		extension;
98 } XmBulletinBoardClassPart;
99 
100 /* Define the full class record */
101 typedef struct _XmBulletinBoardClassRec {
102     CoreClassPart core_class;
103     CompositeClassPart composite_class;
104     ConstraintClassPart constraint_class;
105     XmManagerClassPart manager_class;
106     XmBulletinBoardClassPart bulletin_board_class;
107 } XmBulletinBoardClassRec;
108 
109 XMLIBEXPORT extern XmBulletinBoardClassRec xmBulletinBoardClassRec;
110 
111 #define XmDIALOG_SUFFIX                "_popup"
112 
113 #define BB_CancelButton(w) \
114 	(((XmBulletinBoardWidget)(w))->bulletin_board.cancel_button)
115 
116 #define BB_DynamicCancelButton(w) \
117 	(((XmBulletinBoardWidget)(w))->bulletin_board.dynamic_cancel_button)
118 
119 #define BB_DefaultButton(w) \
120 	(((XmBulletinBoardWidget)(w))->bulletin_board.default_button)
121 
122 #define BB_DynamicDefaultButton(w) \
123 	(((XmBulletinBoardWidget)(w))->bulletin_board.dynamic_default_button)
124 
125 #define BB_MarginHeight(w) \
126 	(((XmBulletinBoardWidget)(w))->bulletin_board.margin_height)
127 
128 #define BB_MarginWidth(w) \
129 	(((XmBulletinBoardWidget)(w))->bulletin_board.margin_width)
130 
131 #define BB_ButtonFontList(w) \
132 	(((XmBulletinBoardWidget)(w))->bulletin_board.button_font_list)
133 
134 #define BB_LabelFontList(w) \
135 	(((XmBulletinBoardWidget)(w))->bulletin_board.label_font_list)
136 
137 #define BB_TextFontList(w) \
138 	(((XmBulletinBoardWidget)(w))->bulletin_board.text_font_list)
139 
140 #define BB_StringDirection(w) \
141 	(((XmBulletinBoardWidget)(w))->manager.string_direction)
142 
143 #define BB_ResizePolicy(w) \
144 	(((XmBulletinBoardWidget)(w))->bulletin_board.resize_policy)
145 
146 #define BB_InSetValues(w) \
147 	(((XmBulletinBoardWidget)(w))->bulletin_board.in_set_values)
148 
149 #define BB_InitialFocus(w) \
150 	(((XmBulletinBoardWidget)(w))->bulletin_board.initial_focus)
151 
152 Widget _XmBB_CreateButtonG(Widget bb, XmString l_string, char *name);
153 Widget _XmBB_CreateLabelG( Widget bb, XmString l_string, char *name);
154 void _XmBulletinBoardSizeUpdate(Widget wid);
155 void _XmBulletinBoardFocusMoved(Widget wid,
156 				XtPointer client_data,
157 				XtPointer data);
158 void _XmBulletinBoardReturn(Widget wid, XEvent *event,
159 			    String *params, Cardinal *numParams);
160 void _XmBulletinBoardCancel(Widget wid, XEvent *event,
161 			    String *params, Cardinal *numParams);
162 void _XmBulletinBoardMap(Widget wid);
163 void _XmBulletinBoardUnmap(Widget wid);
164 void _XmBulletinBoardSetDefaultShadow(Widget button);
165 void _XmBulletinBoardSetDynDefaultButton(Widget wid,
166 					 Widget newDefaultButton);
167 void _XmBBUpdateDynDefaultButton(Widget bb);
168 
169 
170 #ifdef __cplusplus
171 }
172 #endif
173 
174 #endif /* _XM_BULLETINBP_H */
175