From 20f851e6e2ceed52739ffcad85e10fa4c183bff1 Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Tue, 6 May 2014 16:53:17 +1000 Subject: Every window is a winFang now, and winFangs delete their own children. --- src/extantz/chat.c | 3 +-- src/extantz/extantz.c | 24 +++++------------------- src/extantz/extantz.h | 3 +-- src/extantz/files.c | 3 +-- src/extantz/woMan.c | 3 +-- 5 files changed, 9 insertions(+), 27 deletions(-) (limited to 'src/extantz') diff --git a/src/extantz/chat.c b/src/extantz/chat.c index d060cb1..4c18e53 100644 --- a/src/extantz/chat.c +++ b/src/extantz/chat.c @@ -16,8 +16,7 @@ winFang *chat_add(globals *ourGlobals) Widget *wid; Evas_Object *bx, *en; - me = winFangAdd(ourGlobals->win, 30, 520, ourGlobals->win_w / 3, ourGlobals->win_h / 3, "chatter box", "chat"); - eina_clist_add_head(&ourGlobals->winFangs, &me->node); + me = winFangAdd(ourGlobals->mainWindow, 30, 520, ourGlobals->win_w / 3, ourGlobals->win_h / 3, "chatter box", "chat"); bx = eo_add(ELM_OBJ_BOX_CLASS, me->win, evas_obj_size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND), diff --git a/src/extantz/extantz.c b/src/extantz/extantz.c index b7de3a7..aceebe7 100644 --- a/src/extantz/extantz.c +++ b/src/extantz/extantz.c @@ -140,8 +140,6 @@ static void _on_open(void *data, Evas_Object *obj EINA_UNUSED, void *event_info static void _on_done(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) { -// GLData *gld = data; - elm_exit(); } @@ -420,13 +418,14 @@ EAPI_MAIN int elm_main(int argc, char **argv) elm_config_finger_size_set(0); elm_config_scale_set(1.0); - eina_clist_init(&ourGlobals.winFangs); gld = &ourGlobals.gld; gldata_init(gld); // Set the engine to opengl_x11, then open our window. elm_config_preferred_engine_set("opengl_x11"); - ourGlobals.win = elm_win_util_standard_add("extantz", "extantz virtual world viewer"); + + ourGlobals.mainWindow = winFangAdd(NULL, 0, 0, 50, 20, "extantz virtual world viewer", "extantz"); + ourGlobals.win = ourGlobals.mainWindow->win; // Set preferred engine back to default from config elm_config_preferred_engine_set(NULL); @@ -444,7 +443,6 @@ EAPI_MAIN int elm_main(int argc, char **argv) return 1; #endif - evas_object_smart_callback_add(ourGlobals.win, "delete,request", _on_done, gld); evas_object_event_callback_add(ourGlobals.win, EVAS_CALLBACK_RESIZE, _on_resize, &ourGlobals); // Get the screen size. @@ -476,7 +474,7 @@ EAPI_MAIN int elm_main(int argc, char **argv) chat_add(&ourGlobals); ourGlobals.files = filesAdd(&ourGlobals, (char *) elm_app_data_dir_get(), EINA_TRUE, EINA_FALSE); char *args[] = {"extantz", "-l", "test", "-foo", "COMBINED!", NULL}; - GuiLua *test = GuiLuaDo(5, args, ourGlobals.win); + GuiLua *test = GuiLuaDo(5, args, ourGlobals.mainWindow); // Gotta do this after adding the windows, otherwise the menu renders under the window. // This sucks, gotta redefine this menu each time we create a new window? @@ -511,22 +509,10 @@ EAPI_MAIN int elm_main(int argc, char **argv) if (ourGlobals.win) { - winFang *win; - Evas_3D_Demo_fini(&ourGlobals); eo_unref(ourGlobals.tb); - - EINA_CLIST_FOR_EACH_ENTRY(win, &test->winFangs, winFang, node) - { - winFangDel(win); - } - - EINA_CLIST_FOR_EACH_ENTRY(win, &ourGlobals.winFangs, winFang, node) - { - winFangDel(win); - } eo_unref(ourGlobals.bx); - evas_object_del(ourGlobals.win); + winFangDel(ourGlobals.mainWindow); } if (logDom >= 0) diff --git a/src/extantz/extantz.h b/src/extantz/extantz.h index aab5de5..502420b 100644 --- a/src/extantz/extantz.h +++ b/src/extantz/extantz.h @@ -216,6 +216,7 @@ typedef struct _globals Evas_Object *bx; // Our box. int logDom; // Our logging domain. + winFang *mainWindow; int scr_w, scr_h; // The size of the screen. int win_w, win_h; // The size of the window. int win_x, win_y; // The position of the window. @@ -225,8 +226,6 @@ typedef struct _globals GLData gld; Scene_Data *scene; - Eina_Clist winFangs; - winFang *files; } globals; diff --git a/src/extantz/files.c b/src/extantz/files.c index 357769e..948c261 100644 --- a/src/extantz/files.c +++ b/src/extantz/files.c @@ -146,8 +146,7 @@ winFang *filesAdd(globals *ourGlobals, char *path, Eina_Bool multi, Eina_Bool sa Widget *wid; Evas_Object *bx, *vbox, *fs, *bt, *rd = NULL, *rdg = NULL, *hoversel; - me = winFangAdd(ourGlobals->win, ourGlobals->win_w - 380, ourGlobals->win_w - 530, 350, 500, "file selector", "files"); - eina_clist_add_head(&ourGlobals->winFangs, &me->node); + me = winFangAdd(ourGlobals->mainWindow, ourGlobals->win_w - 380, ourGlobals->win_w - 530, 350, 500, "file selector", "files"); bx = eo_add(ELM_OBJ_BOX_CLASS, me->win, elm_obj_box_homogeneous_set(EINA_FALSE), diff --git a/src/extantz/woMan.c b/src/extantz/woMan.c index ee0cc02..8215253 100644 --- a/src/extantz/woMan.c +++ b/src/extantz/woMan.c @@ -159,8 +159,7 @@ winFang *woMan_add(globals *ourGlobals) char buf[PATH_MAX]; int i; - me = winFangAdd(ourGlobals->win, 30, 150, ourGlobals->win_w / 3, ourGlobals->win_h / 3, "virtual world manager", "woMan"); - eina_clist_add_head(&ourGlobals->winFangs, &me->node); + me = winFangAdd(ourGlobals->mainWindow, 30, 150, ourGlobals->win_w / 3, ourGlobals->win_h / 3, "virtual world manager", "woMan"); bx = elm_box_add(me->win); elm_win_resize_object_add(me->win, bx); -- cgit v1.1