-fpermissive to allow GCC to compile old C++
[oweals/cde.git] / cde / programs / dtmail / dtmail / dtb_utils.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: dtb_utils.h /main/3 1995/11/06 16:18:28 rswiston $ */
24 /*
25  * File: dtb_utils.h
26  * CDE Application Builder General Utility Functions
27  *
28  * This file was generated by dtcodegen, from project dtmailopts
29  *
30  *    ** DO NOT MODIFY BY HAND - ALL MODIFICATIONS WILL BE LOST **
31  */
32 #ifndef _DTB_UTILS_H_
33 #define _DTB_UTILS_H_
34
35 #include <stdlib.h>
36 #include <X11/Intrinsic.h>
37 #include <Xm/Xm.h>
38
39 /*
40  * Function type for client session save callback
41  */
42 typedef Boolean (*DtbClientSessionSaveCB) (
43     Widget,
44     char *,
45     char ***,
46     int *
47 );
48 typedef struct {
49     char        *help_text;
50     char        *help_volume;
51     char        *help_locationID;
52 } DtbObjectHelpDataRec, *DtbObjectHelpData;
53
54 /*
55  * Returns answer value for modal MessageBox
56  */
57 typedef enum {
58     DTB_ANSWER_NONE,
59     DTB_ANSWER_ACTION1,
60     DTB_ANSWER_ACTION2,
61     DTB_ANSWER_ACTION3,
62     DTB_ANSWER_CANCEL,
63     DTB_ANSWER_HELP
64 } DTB_MODAL_ANSWER;
65
66 /*
67  * Values for MessageBox default button
68  */
69 typedef enum {
70     DTB_ACTION1_BUTTON,
71     DTB_ACTION2_BUTTON,
72     DTB_ACTION3_BUTTON,
73     DTB_CANCEL_BUTTON,
74     DTB_NONE
75 } DTB_BUTTON;
76
77 /*
78  * Types/ways of centering an object
79  */
80 typedef enum {
81     DTB_CENTER_NONE,
82     DTB_CENTER_POSITION_VERT,
83     DTB_CENTER_POSITION_HORIZ,
84     DTB_CENTER_POSITION_BOTH
85 } DTB_CENTERING_TYPES;
86
87 /*
88  * Types of group layout
89  */
90 typedef enum {
91     DTB_GROUP_NONE,
92     DTB_GROUP_ROWS,
93     DTB_GROUP_COLUMNS,
94     DTB_GROUP_ROWSCOLUMNS
95 } DTB_GROUP_TYPES;
96
97 /*
98  * Types/ways of aligning the children of a group
99  */
100 typedef enum {
101     DTB_ALIGN_NONE,
102     DTB_ALIGN_TOP,
103     DTB_ALIGN_RIGHT,
104     DTB_ALIGN_BOTTOM,
105     DTB_ALIGN_LEFT,
106     DTB_ALIGN_VCENTER,
107     DTB_ALIGN_HCENTER,
108     DTB_ALIGN_LABELS
109 } DTB_ALIGN_TYPES;
110
111 /*
112  * Structure to store attributes of a group
113  */
114 typedef struct {
115     DTB_GROUP_TYPES     group_type;
116     DTB_ALIGN_TYPES     row_align;
117     DTB_ALIGN_TYPES     col_align;
118     int                 margin;
119     int                 num_rows;
120     int                 num_cols;
121     int                 hoffset;
122     int                 voffset;
123     Widget              ref_widget;
124 } DtbGroupInfo;
125
126
127
128 /*
129  * Application Builder utility functions
130  */
131 int dtb_cvt_file_to_pixmap(
132     String      fileName,
133     Widget      widget,
134     Pixmap      *pixmapReturnPtr
135 );
136 int dtb_set_label_pixmaps(
137     Widget      widget,
138     Pixmap      labelPixmap,
139     Pixmap      labelInsensitivePixmap
140 );
141 int dtb_set_label_from_bitmap_data(
142     Widget              widget,
143     int                 width,
144     int                 height,
145     unsigned char       *bitmapData
146 );
147 Boolean dtb_file_has_extension(
148     String      fileName, 
149     String      extension
150 );
151 int dtb_cvt_filebase_to_pixmap(
152     Widget      widget,
153     String      fileBase,
154     String      extension,
155     Pixmap      *pixmap_ptr
156 );
157 int dtb_cvt_image_file_to_pixmap(
158                 Widget  widget,
159                 String  fileName,
160                 Pixmap  *pixmap
161 );
162 int dtb_set_label_from_image_file(
163                 Widget  widget,
164                 String  fileName
165 );
166 unsigned long dtb_cvt_resource_from_string(
167     Widget              parent,
168     String              res_type,
169     unsigned int        size_of_type,
170     String              res_str_value,
171     unsigned long       error_value
172 );
173 Pixmap dtb_create_greyed_pixmap(
174     Widget      widget,
175     Pixmap      pixmap
176 );
177 void dtb_save_toplevel_widget(
178     Widget      toplevel
179 );
180 Widget dtb_get_toplevel_widget();
181 void dtb_save_command(
182     char        *argv0
183 );
184 char *  dtb_get_command();
185 String dtb_get_exe_dir(void);
186 #ifdef DEAD_WOOD
187 void dtb_help_dispatch(
188     Widget      widget,
189     XtPointer   clientData,
190     XtPointer   callData
191 );
192 #endif /* DEAD_WOOD */
193 void dtb_more_help_dispatch(
194     Widget      widget,
195     XtPointer   clientData,
196     XtPointer   callData
197 );
198 void dtb_help_back_hdlr(
199     Widget      widget,
200     XtPointer   clientData,
201     XtPointer   callData
202 );
203 #ifdef DEAD_WOOD
204 void dtb_do_onitem_help();
205 #endif /* DEAD_WOOD */
206 int dtb_show_help_volume_info(
207     char        *volume_name,
208     char        *location_id
209 );
210 #ifdef DEAD_WOOD
211 void  dtb_call_help_callback(
212     Widget widget,
213     XtPointer clientData,
214     XtPointer callData
215 );
216 void dtb_children_center(
217     Widget              form,
218     DTB_CENTERING_TYPES type
219 );
220 void dtb_children_uncenter(
221     Widget              form,
222     DTB_CENTERING_TYPES type
223 );
224 #endif /* DEAD_WOOD */
225 void dtb_center(
226     Widget              form_child,
227     DTB_CENTERING_TYPES type
228 );
229 void dtb_uncenter(
230     Widget              form_child,
231     DTB_CENTERING_TYPES type
232 );
233 void dtb_children_align(
234     Widget              parent,
235     DTB_GROUP_TYPES     group_type,
236     DTB_ALIGN_TYPES     row_align,
237     DTB_ALIGN_TYPES     col_align,
238     int                 margin,
239     int                 num_rows,
240     int                 num_cols,
241     int                 hoffset,
242     int                 voffset
243 );
244 void dtb_session_save(
245     Widget      widget,
246     XtPointer   clientData,
247     XtPointer   callData
248 );
249 DtbClientSessionSaveCB dtb_get_client_session_saveCB();
250
251
252 #define dtb_cvt_string_to_pixel(parent, str) \
253         ((Pixel)dtb_cvt_resource_from_string( \
254                    (parent), XtRPixel, sizeof(Pixel), (str), 0))
255
256 #endif /* _DTB_UTILS_H_ */