15 #include "gtk2_gui_dialog_p.h"
18 #include <gwenhywfar/inherit.h>
19 #include <gwenhywfar/debug.h>
20 #include <gwenhywfar/gui_be.h>
21 #include <gwenhywfar/i18n.h>
23 #include <gwenhywfar/text.h>
24 #include <gwenhywfar/mdigest.h>
25 #include <gwenhywfar/debug.h>
26 #include <gwenhywfar/directory.h>
31 #define I18N(msg) GWEN_I18N_Translate(PACKAGE, msg)
34 #define GTK2_DIALOG_WIDGET_REAL 0
35 #define GTK2_DIALOG_WIDGET_CONTENT 1
36 #define GTK2_DIALOG_WIDGET_DATA 2
38 #define GTK2_DIALOG_STRING_TITLE 0
39 #define GTK2_DIALOG_STRING_VALUE 1
74 GTK2_GUI_DIALOG *xdlg;
90 GTK2_GUI_DIALOG *xdlg;
108 GTK2_GUI_DIALOG *xdlg;
110 xdlg=(GTK2_GUI_DIALOG*) p;
112 if (xdlg->mainWidget)
113 gtk_widget_destroy(xdlg->mainWidget);
121 GTK2_GUI_DIALOG *xdlg;
127 return xdlg->mainWidget;
168 const char *defaultValue) {
175 GTK2_GUI_DIALOG *xdlg;
176 GWEN_WIDGET_TREE *wtree;
191 w=GWEN_Widget_Tree_GetFirst(wtree);
204 gtk_window_set_type_hint(GTK_WINDOW(gw), GDK_WINDOW_TYPE_HINT_DIALOG);
205 gtk_window_set_position (GTK_WINDOW (gw), GTK_WIN_POS_CENTER_ON_PARENT);
207 xdlg->mainWidget=GTK_WIDGET(gw);
209 tll=gtk_window_list_toplevels();
212 GtkWindow *topLevel=
NULL;
214 for (element = tll; element; element = g_list_next(element)) {
215 GtkWindow* win = GTK_WINDOW(element->data);
216 if (gtk_window_is_active(win)) {
225 gtk_window_get_title(topLevel));
226 gtk_window_set_transient_for(gw, topLevel);
239 GTK2_GUI_DIALOG *xdlg;
250 xdlg->response=result;
251 if (g_main_loop_is_running(xdlg->loop))
252 g_main_loop_quit(xdlg->loop);
260 GTK2_GUI_DIALOG *xdlg;
277 GTK2_GUI_DIALOG *xdlg;
293 GTK2_GUI_DIALOG *xdlg;
306 GTK2_GUI_DIALOG *xdlg;
320 xdlg->unmap_handler =
326 xdlg->delete_handler =
332 xdlg->destroy_handler =
338 xdlg->loop=g_main_loop_new(
NULL, FALSE);
340 g_main_loop_run(xdlg->loop);
344 ctx=g_main_loop_get_context(xdlg->loop);
345 while(g_main_context_pending(ctx))
346 g_main_context_iteration(ctx, FALSE);
348 g_main_loop_unref(xdlg->loop);
350 if (!xdlg->destroyed) {
351 g_signal_handler_disconnect(g, xdlg->unmap_handler);
352 g_signal_handler_disconnect(g, xdlg->delete_handler);
353 g_signal_handler_disconnect(g, xdlg->destroy_handler);
356 return xdlg->response;
453 wChild=GWEN_Widget_Tree_GetFirstChild(w);
461 wChild=GWEN_Widget_Tree_GetNext(wChild);
480 while ((p=strchr(p,
'<'))) {
485 if (toupper(*t)==
'H') {
487 if (toupper(*t)==
'T') {
489 if (toupper(*t)==
'M') {
491 if (toupper(*t)==
'L') {
493 if (toupper(*t)==
'>') {
507 while ((p2=strchr(p2,
'<'))) {
512 if (toupper(*t)==
'/') {
514 if (toupper(*t)==
'H') {
516 if (toupper(*t)==
'T') {
518 if (toupper(*t)==
'M') {
520 if (toupper(*t)==
'L') {
522 if (toupper(*t)==
'>') {