38 #include "toolbar.h" |
38 #include "toolbar.h" |
39 #include "container.h" |
39 #include "container.h" |
40 |
40 |
41 static int nwindows = 0; |
41 static int nwindows = 0; |
42 |
42 |
43 static ui_callback wclose_fnc = NULL; |
|
44 static void *wclose_udata = NULL; |
|
45 |
|
46 static int window_default_width = 650; |
43 static int window_default_width = 650; |
47 static int window_default_height = 550; |
44 static int window_default_height = 550; |
48 |
45 |
49 void ui_exit_event(GtkWidget *widget, gpointer data) { |
46 void ui_exit_event(GtkWidget *widget, gpointer data) { |
50 if(wclose_fnc) { |
47 UiObject *obj = data; |
51 // TODO: use UiEvent |
48 UiEvent ev; |
52 wclose_fnc(data, wclose_udata); |
49 ev.window = obj->window; |
|
50 ev.document = obj->ctx->document; |
|
51 ev.obj = obj; |
|
52 ev.eventdata = NULL; |
|
53 ev.intval = 0; |
|
54 |
|
55 if(obj->ctx->close_callback) { |
|
56 obj->ctx->close_callback(&ev, obj->ctx->close_data); |
53 } |
57 } |
|
58 // TODO: free UiObject |
|
59 |
54 nwindows--; |
60 nwindows--; |
55 if(nwindows == 0) { |
61 if(nwindows == 0) { |
56 gtk_main_quit(); |
62 gtk_main_quit(); |
57 } |
63 } |
58 } |
64 } |