summaryrefslogtreecommitdiff
path: root/tools/glade/glade/gb.h
blob: d827d7d2b9df8269812d101319e64ab5cbd0ed37 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
/*  Gtk+ User Interface Builder
 *  Copyright (C) 1998  Damon Chaplin
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 */
#ifndef GLADE_GB_H
#define GLADE_GB_H

/* This header file is included by all gbwidgets in the gbwidget directory,
   so if we add any header files to Glade, we only have to change this. */

#include "gladeconfig.h"

#include <string.h>

#include "editor.h"
#include "gbwidget.h"
#include "glade_project.h"
#include "load.h"
#include "property.h"
#include "save.h"
#include "source.h"
#include "utils.h"

#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */

/* The package name we need to pass to dgettext to get GTK+'s translated
   strings. */
#define GLADE_GTK_GETTEXT_PACKAGE	"gtk20"


  /* The index of the dialog hint in GbTypeHintChoices. */
#define GLADE_TYPE_HINT_DIALOG_INDEX	1

/* This is the error margin we use for floating-point comparisons. */
#define GLADE_EPSILON	0.000001

/* This value is copied from gnome-entry.c. */
#define GLADE_DEFAULT_MAX_HISTORY_SAVED	10

/* Keys used to store a pointer to the parent widget. Currently we only need
   this for the GtkCombo popup window, as there is no way to step up to the
   GtkCombo. */
extern const gchar *GladeParentKey;

/* Keys used to store object data. */
extern const gchar *GladeButtonStockIDKey;
extern const gchar *GladeDialogResponseIDKey;

extern const gchar *GladeToolButtonStockIDKey;
extern const gchar *GladeToolButtonIconKey;

/* The moniker key, only used for Bonobo controls. */
extern const gchar *Moniker;

extern const gint GladeReliefChoicesSize;
extern const gchar *GladeReliefChoices[];
extern const gint   GladeReliefValues[];
extern const gchar *GladeReliefSymbols[];

extern const gint GladeShadowChoicesSize;
extern const gchar *GladeShadowChoices[];
extern const gint   GladeShadowValues[];
extern const gchar *GladeShadowSymbols[];

extern const gint GladeCornerChoicesSize;
extern const gchar *GladeCornerChoices[];
extern const gint   GladeCornerValues[];
extern const gchar *GladeCornerSymbols[];

/* Special child names. */
extern const gchar *GladeChildDialogVBox;
extern const gchar *GladeChildDialogActionArea;

extern const gchar *GladeChildOKButton;
extern const gchar *GladeChildCancelButton;
extern const gchar *GladeChildApplyButton;
extern const gchar *GladeChildHelpButton;
extern const gchar *GladeChildSaveButton;
extern const gchar *GladeChildCloseButton;

extern const gchar *GladeChildMenuItemImage;

extern const gchar *GladeChildComboEntry;
extern const gchar *GladeChildComboList;

extern const gchar *GladeChildFontSelection;
extern const gchar *GladeChildColorSelection;

extern const gchar *GladeChildGnomeAppDock;
extern const gchar *GladeChildGnomeAppBar;
extern const gchar *GladeChildGnomeEntry;
extern const gchar *GladeChildGnomePBoxNotebook;
extern const gchar *GladeChildGnomeDruidVBox;

extern const gchar *GladeChildBonoboWindowDock;
extern const gchar *GladeChildBonoboWindowAppBar;

/* These aren't saved in the XML. */
extern const gchar *GladeChildCListTitle;



/* GtkFixed/GtkLayout Child property names. */
extern const gchar *GladeFixedChildX;
extern const gchar *GladeFixedChildY;
extern const gchar *GladeLayoutChildX;
extern const gchar *GladeLayoutChildY;


/* Information on the stock GTK+ responses. */
typedef struct _GladeDialogResponse GladeDialogResponse;
struct _GladeDialogResponse
{
  gchar *name;
  gint response_id;
  /* This is the stock id that usually goes with the response id. If the user
     sets the stock id to this, then we automatically set the response id. */
  gchar *stock_id;
};

typedef struct _GladeFindGroupData GladeFindGroupData;
struct _GladeFindGroupData {
  GSList *group;
  GtkWidget *found_widget;
};

extern GladeDialogResponse GladeStockResponses[];
extern const gint GladeStockResponsesSize;

/* Some common functions. */
void	    gb_box_set_size			(GtkWidget *widget,
						 gint size);
void	    gb_box_create_child_properties	(GtkWidget * widget,
						 GbWidgetCreateChildArgData * data);
void	    gb_box_get_child_properties		(GtkWidget *widget,
						 GtkWidget *child,
						 GbWidgetGetArgData *data);
void	    gb_box_set_child_properties		(GtkWidget * widget,
						 GtkWidget * child,
						 GbWidgetSetArgData * data);
void	    gb_box_create_popup_menu		(GtkWidget * widget,
						 GbWidgetCreateMenuData * data);
void	    gb_box_write_add_child_source	(GtkWidget * parent,
						 const gchar * parent_name,
						 GtkWidget * child,
						 GbWidgetWriteSourceData * data);

void	    gb_button_get_standard_properties	(GtkWidget * widget,
						 GbWidgetGetArgData * data,
						 gchar *stock_id_p,
						 gchar *label_p,
						 gchar *icon_p,
						 gchar *relief_p,
						 gchar *focus_on_click_p);
void	    gb_button_set_standard_properties	(GtkWidget * widget,
						 GbWidgetSetArgData * data,
						 gchar *stock_id_p,
						 gchar *label_p,
						 gchar *icon_p,
						 gchar *relief_p,
						 gchar *focus_on_click_p);
void	    gb_button_create_popup_menu		(GtkWidget * widget,
						 GbWidgetCreateMenuData * data);
void	    gb_button_find_radio_group		(GtkWidget *widget,
						 GladeFindGroupData *find_data);
void	    gb_button_write_standard_source	(GtkWidget * widget,
						 GbWidgetWriteSourceData * data,
						 const gchar *label_p);
void	    gb_button_destroy			(GtkWidget * widget,
						 GbWidgetDestroyData * data);

char*	    gb_dialog_response_id_to_string	(gint response_id);
gint	    gb_dialog_response_id_from_string	(const gchar *response_id);


void	    gb_frame_create_popup_menu		(GtkWidget *widget,
						 GbWidgetCreateMenuData *data);
void	    gb_frame_add_child			(GtkWidget *widget,
						 GtkWidget *child,
						 GbWidgetSetArgData *data);
void	    gb_frame_get_child_properties	(GtkWidget *widget,
						 GtkWidget *child,
						 GbWidgetGetArgData *data);
void	    gb_frame_write_add_child_source	(GtkWidget * parent,
						 const gchar *parent_name,
						 GtkWidget *child,
						 GbWidgetWriteSourceData * data);


void	    gb_label_create_standard_properties (GtkWidget * widget,
						 GbWidgetCreateArgData * data,
						 const char *label_p,
						 const char *use_underline_p,
						 const char *use_markup_p,
						 const char *justify_p,
						 const char *wrap_p,
						 const char *selectable_p,
						 const char *xalign_p,
						 const char *yalign_p,
						 const char *xpad_p,
						 const char *ypad_p,
						 const char *focus_target_p,
						 const char *ellipsize_p,
						 const char *width_chars_p,
						 const char *single_line_mode_p,
						 const char *angle_p);


void	    gb_label_get_standard_properties	(GtkWidget * widget,
						 GbWidgetGetArgData * data,
						 const char *label_p,
						 const char *use_underline_p,
						 const char *use_markup_p,
						 const char *justify_p,
						 const char *wrap_p,
						 const char *selectable_p,
						 const char *xalign_p,
						 const char *yalign_p,
						 const char *xpad_p,
						 const char *ypad_p,
						 const char *focus_target_p,
						 const char *ellipsize_p,
						 const char *width_chars_p,
						 const char *single_line_mode_p,
						 const char *angle_p);

void	    gb_label_set_standard_properties	(GtkWidget * widget,
						 GbWidgetSetArgData * data,
						 const char *label_p,
						 const char *use_underline_p,
						 const char *use_markup_p,
						 const char *justify_p,
						 const char *wrap_p,
						 const char *selectable_p,
						 const char *xalign_p,
						 const char *yalign_p,
						 const char *xpad_p,
						 const char *ypad_p,
						 const char *focus_target_p,
						 const char *ellipsize_p,
						 const char *width_chars_p,
						 const char *single_line_mode_p,
						 const char *angle_p);

void	    gb_label_write_standard_source	(GtkWidget * widget,
						 GbWidgetWriteSourceData *data,
						 const char *label_p,
						 const char *use_underline_p,
						 const char *use_markup_p,
						 const char *justify_p,
						 const char *wrap_p,
						 const char *selectable_p,
						 const char *xalign_p,
						 const char *yalign_p,
						 const char *xpad_p,
						 const char *ypad_p,
						 const char *focus_target_p,
						 const char *ellipsize_p,
						 const char *width_chars_p,
						 const char *single_line_mode_p,
						 const char *angle_p);



void	    gb_paned_create_child_properties	(GtkWidget * widget,
						 GbWidgetCreateChildArgData * data);
void	    gb_paned_get_child_properties	(GtkWidget *widget,
						 GtkWidget *child,
						 GbWidgetGetArgData *data);
void	    gb_paned_set_child_properties	(GtkWidget * widget,
						 GtkWidget * child,
						 GbWidgetSetArgData * data);
void	    gb_paned_write_add_child_source	(GtkWidget * parent,
						 const gchar *parent_name,
						 GtkWidget *child,
						 GbWidgetWriteSourceData * data);

GSList *    gb_radio_button_reset_radio_group	(GtkWidget * widget);
void	    gb_radio_button_update_radio_group	(GSList * group);

void	    gb_table_update_placeholders	(GtkWidget * table,
						 gint rows,
						 gint cols);

void	    gb_tool_button_get_standard_properties (GtkWidget *widget,
						    GbWidgetGetArgData * data,
						    gchar *stock_id_p,
						    gchar *label_p,
						    gchar *icon_p,
						    gchar *visible_horz_p,
						    gchar *visible_vert_p,
						    gchar *is_important_p);
void	    gb_tool_button_set_standard_properties (GtkWidget *widget,
						    GbWidgetSetArgData * data,
						    gchar *stock_id_p,
						    gchar *label_p,
						    gchar *icon_p,
						    gchar *visible_horz_p,
						    gchar *visible_vert_p,
						    gchar *is_important_p);
void	    gb_tool_button_destroy		(GtkWidget * widget,
						 GbWidgetDestroyData * data);


void	    gb_window_create_standard_properties(GtkWidget * widget,
						 GbWidgetCreateArgData * data,
						 gchar *title_p,
						 gchar *type_p,
						 gchar *position_p,
						 gchar *modal_p,
						 gchar *default_width_p,
						 gchar *default_height_p,
						 gchar *shrink_p,
						 gchar *grow_p,
						 gchar *auto_shrink_p,
						 gchar *icon_name_p,
						 gchar *focus_on_map_p,
						 gchar *resizable_p,
						 gchar *destroy_with_parent_p,
						 gchar *icon_p,
						 gchar *role_p,
						 gchar *type_hint_p,
						 gchar *skip_taskbar_p,
						 gchar *skip_pager_p,
						 gchar *decorated_p,
						 gchar *gravity_p,
						 gchar *urgency_p);
void	    gb_window_get_standard_properties	(GtkWidget * widget,
						 GbWidgetGetArgData * data,
						 gchar *title_p,
						 gchar *type_p,
						 gchar *position_p,
						 gchar *modal_p,
						 gchar *default_width_p,
						 gchar *default_height_p,
						 gchar *shrink_p,
						 gchar *grow_p,
						 gchar *auto_shrink_p,
						 gchar *icon_name_p,
						 gchar *focus_on_map_p,
						 gchar *resizable_p,
						 gchar *destroy_with_parent_p,
						 gchar *icon_p,
						 gchar *role_p,
						 gchar *type_hint_p,
						 gchar *skip_taskbar_p,
						 gchar *skip_pager_p,
						 gchar *decorated_p,
						 gchar *gravity_p,
						 gchar *urgency_p);
void	    gb_window_set_standard_properties	(GtkWidget * widget,
						 GbWidgetSetArgData * data,
						 gchar *title_p,
						 gchar *type_p,
						 gchar *position_p,
						 gchar *modal_p,
						 gchar *default_width_p,
						 gchar *default_height_p,
						 gchar *shrink_p,
						 gchar *grow_p,
						 gchar *auto_shrink_p,
						 gchar *icon_name_p,
						 gchar *focus_on_map_p,
						 gchar *resizable_p,
						 gchar *destroy_with_parent_p,
						 gchar *icon_p,
						 gchar *role_p,
						 gchar *type_hint_p,
						 gchar *skip_taskbar_p,
						 gchar *skip_pager_p,
						 gchar *decorated_p,
						 gchar *gravity_p,
						 gchar *urgency_p);
void	    gb_window_write_standard_source	(GtkWidget * widget,
						 GbWidgetWriteSourceData *data,
						 gchar *title_p,
						 gchar *type_p,
						 gchar *position_p,
						 gchar *modal_p,
						 gchar *default_width_p,
						 gchar *default_height_p,
						 gchar *shrink_p,
						 gchar *grow_p,
						 gchar *auto_shrink_p,
						 gchar *icon_name_p,
						 gchar *focus_on_map_p,
						 gchar *resizable_p,
						 gchar *destroy_with_parent_p,
						 gchar *icon_p,
						 gchar *role_p,
						 gchar *type_hint_p,
						 gchar *skip_taskbar_p,
						 gchar *skip_pager_p,
						 gchar *decorated_p,
						 gchar *gravity_p,
						 gchar *urgency_p);
void	    gb_window_destroy			(GtkWidget * widget,
						 GbWidgetDestroyData * data);


gboolean    gb_set_scroll_adjustments_hook	(GSignalInvocationHint  *ihint,
						 guint			n_param_values,
						 const GValue	       *param_values,
						 gpointer		data);


#ifdef __cplusplus
}
#endif /* __cplusplus */

#endif /* GLADE_GB_H */