aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/extantz
diff options
context:
space:
mode:
authorDavid Walter Seikel2014-05-06 16:53:17 +1000
committerDavid Walter Seikel2014-05-06 16:53:17 +1000
commit20f851e6e2ceed52739ffcad85e10fa4c183bff1 (patch)
treedff97aa7a2b694e27e8c32ae58489e375805bade /src/extantz
parentDisable the non working Elm input callback, and TODO++. (diff)
downloadSledjHamr-20f851e6e2ceed52739ffcad85e10fa4c183bff1.zip
SledjHamr-20f851e6e2ceed52739ffcad85e10fa4c183bff1.tar.gz
SledjHamr-20f851e6e2ceed52739ffcad85e10fa4c183bff1.tar.bz2
SledjHamr-20f851e6e2ceed52739ffcad85e10fa4c183bff1.tar.xz
Every window is a winFang now, and winFangs delete their own children.
Diffstat (limited to 'src/extantz')
-rw-r--r--src/extantz/chat.c3
-rw-r--r--src/extantz/extantz.c24
-rw-r--r--src/extantz/extantz.h3
-rw-r--r--src/extantz/files.c3
-rw-r--r--src/extantz/woMan.c3
5 files changed, 9 insertions, 27 deletions
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)
16 Widget *wid; 16 Widget *wid;
17 Evas_Object *bx, *en; 17 Evas_Object *bx, *en;
18 18
19 me = winFangAdd(ourGlobals->win, 30, 520, ourGlobals->win_w / 3, ourGlobals->win_h / 3, "chatter box", "chat"); 19 me = winFangAdd(ourGlobals->mainWindow, 30, 520, ourGlobals->win_w / 3, ourGlobals->win_h / 3, "chatter box", "chat");
20 eina_clist_add_head(&ourGlobals->winFangs, &me->node);
21 20
22 bx = eo_add(ELM_OBJ_BOX_CLASS, me->win, 21 bx = eo_add(ELM_OBJ_BOX_CLASS, me->win,
23 evas_obj_size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND), 22 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
140 140
141static void _on_done(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) 141static void _on_done(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
142{ 142{
143// GLData *gld = data;
144
145 elm_exit(); 143 elm_exit();
146} 144}
147 145
@@ -420,13 +418,14 @@ EAPI_MAIN int elm_main(int argc, char **argv)
420 elm_config_finger_size_set(0); 418 elm_config_finger_size_set(0);
421 elm_config_scale_set(1.0); 419 elm_config_scale_set(1.0);
422 420
423 eina_clist_init(&ourGlobals.winFangs);
424 gld = &ourGlobals.gld; 421 gld = &ourGlobals.gld;
425 gldata_init(gld); 422 gldata_init(gld);
426 423
427 // Set the engine to opengl_x11, then open our window. 424 // Set the engine to opengl_x11, then open our window.
428 elm_config_preferred_engine_set("opengl_x11"); 425 elm_config_preferred_engine_set("opengl_x11");
429 ourGlobals.win = elm_win_util_standard_add("extantz", "extantz virtual world viewer"); 426
427 ourGlobals.mainWindow = winFangAdd(NULL, 0, 0, 50, 20, "extantz virtual world viewer", "extantz");
428 ourGlobals.win = ourGlobals.mainWindow->win;
430 // Set preferred engine back to default from config 429 // Set preferred engine back to default from config
431 elm_config_preferred_engine_set(NULL); 430 elm_config_preferred_engine_set(NULL);
432 431
@@ -444,7 +443,6 @@ EAPI_MAIN int elm_main(int argc, char **argv)
444 return 1; 443 return 1;
445#endif 444#endif
446 445
447 evas_object_smart_callback_add(ourGlobals.win, "delete,request", _on_done, gld);
448 evas_object_event_callback_add(ourGlobals.win, EVAS_CALLBACK_RESIZE, _on_resize, &ourGlobals); 446 evas_object_event_callback_add(ourGlobals.win, EVAS_CALLBACK_RESIZE, _on_resize, &ourGlobals);
449 447
450 // Get the screen size. 448 // Get the screen size.
@@ -476,7 +474,7 @@ EAPI_MAIN int elm_main(int argc, char **argv)
476 chat_add(&ourGlobals); 474 chat_add(&ourGlobals);
477 ourGlobals.files = filesAdd(&ourGlobals, (char *) elm_app_data_dir_get(), EINA_TRUE, EINA_FALSE); 475 ourGlobals.files = filesAdd(&ourGlobals, (char *) elm_app_data_dir_get(), EINA_TRUE, EINA_FALSE);
478 char *args[] = {"extantz", "-l", "test", "-foo", "COMBINED!", NULL}; 476 char *args[] = {"extantz", "-l", "test", "-foo", "COMBINED!", NULL};
479 GuiLua *test = GuiLuaDo(5, args, ourGlobals.win); 477 GuiLua *test = GuiLuaDo(5, args, ourGlobals.mainWindow);
480 478
481 // Gotta do this after adding the windows, otherwise the menu renders under the window. 479 // Gotta do this after adding the windows, otherwise the menu renders under the window.
482 // This sucks, gotta redefine this menu each time we create a new window? 480 // 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)
511 509
512 if (ourGlobals.win) 510 if (ourGlobals.win)
513 { 511 {
514 winFang *win;
515
516 Evas_3D_Demo_fini(&ourGlobals); 512 Evas_3D_Demo_fini(&ourGlobals);
517 eo_unref(ourGlobals.tb); 513 eo_unref(ourGlobals.tb);
518
519 EINA_CLIST_FOR_EACH_ENTRY(win, &test->winFangs, winFang, node)
520 {
521 winFangDel(win);
522 }
523
524 EINA_CLIST_FOR_EACH_ENTRY(win, &ourGlobals.winFangs, winFang, node)
525 {
526 winFangDel(win);
527 }
528 eo_unref(ourGlobals.bx); 514 eo_unref(ourGlobals.bx);
529 evas_object_del(ourGlobals.win); 515 winFangDel(ourGlobals.mainWindow);
530 } 516 }
531 517
532 if (logDom >= 0) 518 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
216 Evas_Object *bx; // Our box. 216 Evas_Object *bx; // Our box.
217 int logDom; // Our logging domain. 217 int logDom; // Our logging domain.
218 218
219 winFang *mainWindow;
219 int scr_w, scr_h; // The size of the screen. 220 int scr_w, scr_h; // The size of the screen.
220 int win_w, win_h; // The size of the window. 221 int win_w, win_h; // The size of the window.
221 int win_x, win_y; // The position of the window. 222 int win_x, win_y; // The position of the window.
@@ -225,8 +226,6 @@ typedef struct _globals
225 GLData gld; 226 GLData gld;
226 Scene_Data *scene; 227 Scene_Data *scene;
227 228
228 Eina_Clist winFangs;
229
230 winFang *files; 229 winFang *files;
231} globals; 230} globals;
232 231
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
146 Widget *wid; 146 Widget *wid;
147 Evas_Object *bx, *vbox, *fs, *bt, *rd = NULL, *rdg = NULL, *hoversel; 147 Evas_Object *bx, *vbox, *fs, *bt, *rd = NULL, *rdg = NULL, *hoversel;
148 148
149 me = winFangAdd(ourGlobals->win, ourGlobals->win_w - 380, ourGlobals->win_w - 530, 350, 500, "file selector", "files"); 149 me = winFangAdd(ourGlobals->mainWindow, ourGlobals->win_w - 380, ourGlobals->win_w - 530, 350, 500, "file selector", "files");
150 eina_clist_add_head(&ourGlobals->winFangs, &me->node);
151 150
152 bx = eo_add(ELM_OBJ_BOX_CLASS, me->win, 151 bx = eo_add(ELM_OBJ_BOX_CLASS, me->win,
153 elm_obj_box_homogeneous_set(EINA_FALSE), 152 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)
159 char buf[PATH_MAX]; 159 char buf[PATH_MAX];
160 int i; 160 int i;
161 161
162 me = winFangAdd(ourGlobals->win, 30, 150, ourGlobals->win_w / 3, ourGlobals->win_h / 3, "virtual world manager", "woMan"); 162 me = winFangAdd(ourGlobals->mainWindow, 30, 150, ourGlobals->win_w / 3, ourGlobals->win_h / 3, "virtual world manager", "woMan");
163 eina_clist_add_head(&ourGlobals->winFangs, &me->node);
164 163
165 bx = elm_box_add(me->win); 164 bx = elm_box_add(me->win);
166 elm_win_resize_object_add(me->win, bx); 165 elm_win_resize_object_add(me->win, bx);