diff options
author | David Walter Seikel | 2014-05-05 02:44:09 +1000 |
---|---|---|
committer | David Walter Seikel | 2014-05-05 02:44:09 +1000 |
commit | 8617ffe44a0845794e671add64754ba2cbc080f3 (patch) | |
tree | 41467f3d43756ecee46fa0ad6de07d150d47cf6e /src/extantz | |
parent | Delete libwinFang.so on build. (diff) | |
download | SledjHamr-8617ffe44a0845794e671add64754ba2cbc080f3.zip SledjHamr-8617ffe44a0845794e671add64754ba2cbc080f3.tar.gz SledjHamr-8617ffe44a0845794e671add64754ba2cbc080f3.tar.bz2 SledjHamr-8617ffe44a0845794e671add64754ba2cbc080f3.tar.xz |
Track all windows in a Eina_List.
Diffstat (limited to 'src/extantz')
-rw-r--r-- | src/extantz/extantz.c | 16 | ||||
-rw-r--r-- | src/extantz/extantz.h | 3 | ||||
-rw-r--r-- | src/extantz/winFang.c | 1 | ||||
-rw-r--r-- | src/extantz/winFang.h | 5 |
4 files changed, 16 insertions, 9 deletions
diff --git a/src/extantz/extantz.c b/src/extantz/extantz.c index 679a47e..8956bbf 100644 --- a/src/extantz/extantz.c +++ b/src/extantz/extantz.c | |||
@@ -386,7 +386,6 @@ EAPI_MAIN int elm_main(int argc, char **argv) | |||
386 | Evas_Object *obj; | 386 | Evas_Object *obj; |
387 | EPhysics_World *world; | 387 | EPhysics_World *world; |
388 | GLData *gld = NULL; | 388 | GLData *gld = NULL; |
389 | winFang *chat = NULL, *woMan = NULL; | ||
390 | char buf[PATH_MAX]; | 389 | char buf[PATH_MAX]; |
391 | // Eina_Bool gotWebKit = elm_need_web(); // Initialise ewebkit if it exists, or return EINA_FALSE if it don't. | 390 | // Eina_Bool gotWebKit = elm_need_web(); // Initialise ewebkit if it exists, or return EINA_FALSE if it don't. |
392 | 391 | ||
@@ -417,6 +416,7 @@ EAPI_MAIN int elm_main(int argc, char **argv) | |||
417 | elm_config_finger_size_set(0); | 416 | elm_config_finger_size_set(0); |
418 | elm_config_scale_set(1.0); | 417 | elm_config_scale_set(1.0); |
419 | 418 | ||
419 | eina_clist_init(&ourGlobals.winFangs); | ||
420 | gld = &ourGlobals.gld; | 420 | gld = &ourGlobals.gld; |
421 | gldata_init(gld); | 421 | gldata_init(gld); |
422 | 422 | ||
@@ -468,8 +468,8 @@ EAPI_MAIN int elm_main(int argc, char **argv) | |||
468 | elm_win_resize_object_add(ourGlobals.win, ourGlobals.bx); | 468 | elm_win_resize_object_add(ourGlobals.win, ourGlobals.bx); |
469 | 469 | ||
470 | // overlay_add(&ourGlobals); | 470 | // overlay_add(&ourGlobals); |
471 | woMan = woMan_add(&ourGlobals); | 471 | woMan_add(&ourGlobals); |
472 | chat = chat_add(&ourGlobals); | 472 | chat_add(&ourGlobals); |
473 | ourGlobals.files = filesAdd(&ourGlobals, (char *) elm_app_data_dir_get(), EINA_TRUE, EINA_FALSE); | 473 | ourGlobals.files = filesAdd(&ourGlobals, (char *) elm_app_data_dir_get(), EINA_TRUE, EINA_FALSE); |
474 | 474 | ||
475 | // Gotta do this after adding the windows, otherwise the menu renders under the window. | 475 | // Gotta do this after adding the windows, otherwise the menu renders under the window. |
@@ -503,11 +503,15 @@ EAPI_MAIN int elm_main(int argc, char **argv) | |||
503 | 503 | ||
504 | if (ourGlobals. win) | 504 | if (ourGlobals. win) |
505 | { | 505 | { |
506 | winFang *win; | ||
507 | |||
506 | Evas_3D_Demo_fini(&ourGlobals); | 508 | Evas_3D_Demo_fini(&ourGlobals); |
507 | eo_unref(ourGlobals.tb); | 509 | eo_unref(ourGlobals.tb); |
508 | winFangDel(&ourGlobals, ourGlobals.files); | 510 | |
509 | winFangDel(&ourGlobals, chat); | 511 | EINA_CLIST_FOR_EACH_ENTRY(win, &ourGlobals.winFangs, winFang, node) |
510 | winFangDel(&ourGlobals, woMan); | 512 | { |
513 | winFangDel(&ourGlobals, win); | ||
514 | } | ||
511 | eo_unref(ourGlobals.bx); | 515 | eo_unref(ourGlobals.bx); |
512 | evas_object_del(ourGlobals.win); | 516 | evas_object_del(ourGlobals.win); |
513 | } | 517 | } |
diff --git a/src/extantz/extantz.h b/src/extantz/extantz.h index 046f099..7d969b1 100644 --- a/src/extantz/extantz.h +++ b/src/extantz/extantz.h | |||
@@ -211,7 +211,6 @@ typedef struct _globals | |||
211 | Evas_Object *win; // Our Elm window. | 211 | Evas_Object *win; // Our Elm window. |
212 | Evas_Object *tb; // Our Elm toolbar. | 212 | Evas_Object *tb; // Our Elm toolbar. |
213 | Evas_Object *bx; // Our box. | 213 | Evas_Object *bx; // Our box. |
214 | Eina_Clist widgets; // Our windows widgets. | ||
215 | int logDom; // Our logging domain. | 214 | int logDom; // Our logging domain. |
216 | 215 | ||
217 | int scr_w, scr_h; // The size of the screen. | 216 | int scr_w, scr_h; // The size of the screen. |
@@ -223,7 +222,7 @@ typedef struct _globals | |||
223 | GLData gld; | 222 | GLData gld; |
224 | Scene_Data *scene; | 223 | Scene_Data *scene; |
225 | 224 | ||
226 | Eina_Clist windows; | 225 | Eina_Clist winFangs; |
227 | 226 | ||
228 | winFang *files; | 227 | winFang *files; |
229 | } globals; | 228 | } globals; |
diff --git a/src/extantz/winFang.c b/src/extantz/winFang.c index 0f0328f..3d2b6ef 100644 --- a/src/extantz/winFang.c +++ b/src/extantz/winFang.c | |||
@@ -82,6 +82,7 @@ winFang *winFangAdd(globals *ourGlobals) | |||
82 | Evas_Object *bg; | 82 | Evas_Object *bg; |
83 | 83 | ||
84 | result = calloc(1, sizeof(winFang)); | 84 | result = calloc(1, sizeof(winFang)); |
85 | eina_clist_add_head(&ourGlobals->winFangs, &result->node); | ||
85 | eina_clist_init(&result->widgets); | 86 | eina_clist_init(&result->widgets); |
86 | 87 | ||
87 | // In theory this should create an EWS window, in practice, I'm not seeing any difference. | 88 | // In theory this should create an EWS window, in practice, I'm not seeing any difference. |
diff --git a/src/extantz/winFang.h b/src/extantz/winFang.h index 8749be5..738a616 100644 --- a/src/extantz/winFang.h +++ b/src/extantz/winFang.h | |||
@@ -8,6 +8,7 @@ typedef struct _winFang | |||
8 | { | 8 | { |
9 | Evas_Object *win; | 9 | Evas_Object *win; |
10 | Eina_Clist widgets; | 10 | Eina_Clist widgets; |
11 | Eina_Clist node; | ||
11 | void *data; | 12 | void *data; |
12 | Evas_Smart_Cb on_del; | 13 | Evas_Smart_Cb on_del; |
13 | } winFang; | 14 | } winFang; |
@@ -16,12 +17,14 @@ typedef struct _Widget | |||
16 | { | 17 | { |
17 | char magic[8]; | 18 | char magic[8]; |
18 | Evas_Object *obj; | 19 | Evas_Object *obj; |
19 | Eina_Clist node; | 20 | |
20 | char *label, *look, *action, *help; | 21 | char *label, *look, *action, *help; |
21 | // foreground / background colour | 22 | // foreground / background colour |
22 | // thing | 23 | // thing |
23 | // types {} | 24 | // types {} |
24 | // skangCoord x, y, w, h | 25 | // skangCoord x, y, w, h |
26 | |||
27 | Eina_Clist node; | ||
25 | void *data; | 28 | void *data; |
26 | Evas_Smart_Cb on_del; | 29 | Evas_Smart_Cb on_del; |
27 | } Widget; | 30 | } Widget; |