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