diff options
author | David Walter Seikel | 2014-05-05 03:48:09 +1000 |
---|---|---|
committer | David Walter Seikel | 2014-05-05 03:48:09 +1000 |
commit | ab2fb9f9c5d16f60847225608a9b21156659d210 (patch) | |
tree | fa2d81082cc7074a96e56bb1b83bd73ff06d6086 /src/extantz | |
parent | Merge the window handle creation code, and add proper hiding for them. (diff) | |
download | SledjHamr-ab2fb9f9c5d16f60847225608a9b21156659d210.zip SledjHamr-ab2fb9f9c5d16f60847225608a9b21156659d210.tar.gz SledjHamr-ab2fb9f9c5d16f60847225608a9b21156659d210.tar.bz2 SledjHamr-ab2fb9f9c5d16f60847225608a9b21156659d210.tar.xz |
winFang no longer depends on ourGlobals.
Diffstat (limited to 'src/extantz')
-rw-r--r-- | src/extantz/chat.c | 5 | ||||
-rw-r--r-- | src/extantz/extantz.c | 2 | ||||
-rw-r--r-- | src/extantz/files.c | 5 | ||||
-rw-r--r-- | src/extantz/winFang.c | 9 | ||||
-rw-r--r-- | src/extantz/winFang.h | 9 | ||||
-rw-r--r-- | src/extantz/woMan.c | 5 |
6 files changed, 17 insertions, 18 deletions
diff --git a/src/extantz/chat.c b/src/extantz/chat.c index 2155541..e0aa9da 100644 --- a/src/extantz/chat.c +++ b/src/extantz/chat.c | |||
@@ -16,7 +16,8 @@ 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); | 19 | me = winFangAdd(ourGlobals->win); |
20 | eina_clist_add_head(&ourGlobals->winFangs, &me->node); | ||
20 | 21 | ||
21 | bx = eo_add(ELM_OBJ_BOX_CLASS, me->win, | 22 | bx = eo_add(ELM_OBJ_BOX_CLASS, me->win, |
22 | evas_obj_size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND), | 23 | evas_obj_size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND), |
@@ -46,6 +47,6 @@ winFang *chat_add(globals *ourGlobals) | |||
46 | evas_object_show(bx); | 47 | evas_object_show(bx); |
47 | eo_unref(bx); | 48 | eo_unref(bx); |
48 | 49 | ||
49 | winFangComplete(ourGlobals, me, 30, 500, ourGlobals->win_w / 3, ourGlobals->win_h / 3); | 50 | winFangComplete(me, 30, 500, ourGlobals->win_w / 3, ourGlobals->win_h / 3); |
50 | return me; | 51 | return me; |
51 | } | 52 | } |
diff --git a/src/extantz/extantz.c b/src/extantz/extantz.c index 8956bbf..efe3748 100644 --- a/src/extantz/extantz.c +++ b/src/extantz/extantz.c | |||
@@ -510,7 +510,7 @@ EAPI_MAIN int elm_main(int argc, char **argv) | |||
510 | 510 | ||
511 | EINA_CLIST_FOR_EACH_ENTRY(win, &ourGlobals.winFangs, winFang, node) | 511 | EINA_CLIST_FOR_EACH_ENTRY(win, &ourGlobals.winFangs, winFang, node) |
512 | { | 512 | { |
513 | winFangDel(&ourGlobals, win); | 513 | winFangDel(win); |
514 | } | 514 | } |
515 | eo_unref(ourGlobals.bx); | 515 | eo_unref(ourGlobals.bx); |
516 | evas_object_del(ourGlobals.win); | 516 | evas_object_del(ourGlobals.win); |
diff --git a/src/extantz/files.c b/src/extantz/files.c index c0867c6..6743deb 100644 --- a/src/extantz/files.c +++ b/src/extantz/files.c | |||
@@ -146,7 +146,8 @@ 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); | 149 | me = winFangAdd(ourGlobals->win); |
150 | eina_clist_add_head(&ourGlobals->winFangs, &me->node); | ||
150 | 151 | ||
151 | bx = eo_add(ELM_OBJ_BOX_CLASS, me->win, | 152 | bx = eo_add(ELM_OBJ_BOX_CLASS, me->win, |
152 | elm_obj_box_homogeneous_set(EINA_FALSE), | 153 | elm_obj_box_homogeneous_set(EINA_FALSE), |
@@ -277,7 +278,7 @@ winFang *filesAdd(globals *ourGlobals, char *path, Eina_Bool multi, Eina_Bool sa | |||
277 | eo_unref(vbox); | 278 | eo_unref(vbox); |
278 | eo_unref(bx); | 279 | eo_unref(bx); |
279 | 280 | ||
280 | winFangComplete(ourGlobals, me, ourGlobals->win_w - 380, ourGlobals->win_w - 530, 350, 500); | 281 | winFangComplete(me, ourGlobals->win_w - 380, ourGlobals->win_w - 530, 350, 500); |
281 | winFangHide(me); | 282 | winFangHide(me); |
282 | return me; | 283 | return me; |
283 | } | 284 | } |
diff --git a/src/extantz/winFang.c b/src/extantz/winFang.c index 3c4cc22..830b84e 100644 --- a/src/extantz/winFang.c +++ b/src/extantz/winFang.c | |||
@@ -67,19 +67,18 @@ void winFangShow(winFang *win) | |||
67 | evas_object_show(win->hand[i]); | 67 | evas_object_show(win->hand[i]); |
68 | } | 68 | } |
69 | 69 | ||
70 | winFang *winFangAdd(globals *ourGlobals) | 70 | winFang *winFangAdd(Evas_Object *parent) |
71 | { | 71 | { |
72 | winFang *result; | 72 | winFang *result; |
73 | Evas_Object *bg; | 73 | Evas_Object *bg; |
74 | 74 | ||
75 | result = calloc(1, sizeof(winFang)); | 75 | result = calloc(1, sizeof(winFang)); |
76 | eina_clist_add_head(&ourGlobals->winFangs, &result->node); | ||
77 | eina_clist_init(&result->widgets); | 76 | eina_clist_init(&result->widgets); |
78 | 77 | ||
79 | // In theory this should create an EWS window, in practice, I'm not seeing any difference. | 78 | // In theory this should create an EWS window, in practice, I'm not seeing any difference. |
80 | // Guess I'll have to implement my own internal window manager. I don't think a basic one will be that hard. Famous last words. | 79 | // Guess I'll have to implement my own internal window manager. I don't think a basic one will be that hard. Famous last words. |
81 | // elm_config_engine_set("ews"); | 80 | // elm_config_engine_set("ews"); |
82 | result->win = elm_win_add(ourGlobals->win, "inlined", ELM_WIN_INLINED_IMAGE); | 81 | result->win = elm_win_add(parent, "inlined", ELM_WIN_INLINED_IMAGE); |
83 | // On mouse down we try to shift focus to the backing image, this seems to be the correct thing to force focus onto it's widgets. | 82 | // On mouse down we try to shift focus to the backing image, this seems to be the correct thing to force focus onto it's widgets. |
84 | // According to the Elm inlined image window example, this is what's needed to. | 83 | // According to the Elm inlined image window example, this is what's needed to. |
85 | evas_object_event_callback_add(elm_win_inlined_image_object_get(result->win), EVAS_CALLBACK_MOUSE_DOWN, _cb_mouse_down_elm, NULL); | 84 | evas_object_event_callback_add(elm_win_inlined_image_object_get(result->win), EVAS_CALLBACK_MOUSE_DOWN, _cb_mouse_down_elm, NULL); |
@@ -96,7 +95,7 @@ winFang *winFangAdd(globals *ourGlobals) | |||
96 | return result; | 95 | return result; |
97 | } | 96 | } |
98 | 97 | ||
99 | void winFangComplete(globals *ourGlobals, winFang *win, int x, int y, int w, int h) | 98 | void winFangComplete(winFang *win, int x, int y, int w, int h) |
100 | { | 99 | { |
101 | Evas_Object *obj = elm_win_inlined_image_object_get(win->win); | 100 | Evas_Object *obj = elm_win_inlined_image_object_get(win->win); |
102 | Evas_Object *obj2 = evas_object_evas_get(obj); | 101 | Evas_Object *obj2 = evas_object_evas_get(obj); |
@@ -150,7 +149,7 @@ void winFangComplete(globals *ourGlobals, winFang *win, int x, int y, int w, int | |||
150 | } | 149 | } |
151 | } | 150 | } |
152 | 151 | ||
153 | void winFangDel(globals *ourGlobals, winFang *win) | 152 | void winFangDel(winFang *win) |
154 | { | 153 | { |
155 | Widget *wid; | 154 | Widget *wid; |
156 | 155 | ||
diff --git a/src/extantz/winFang.h b/src/extantz/winFang.h index cc61847..49c7889 100644 --- a/src/extantz/winFang.h +++ b/src/extantz/winFang.h | |||
@@ -1,9 +1,6 @@ | |||
1 | #include <Elementary.h> | 1 | #include <Elementary.h> |
2 | 2 | ||
3 | 3 | ||
4 | // Forward references. | ||
5 | typedef struct _globals globals; | ||
6 | |||
7 | typedef struct _winFang | 4 | typedef struct _winFang |
8 | { | 5 | { |
9 | Evas_Object *win; | 6 | Evas_Object *win; |
@@ -33,10 +30,10 @@ typedef struct _Widget | |||
33 | Evas_Smart_Cb on_del; | 30 | Evas_Smart_Cb on_del; |
34 | } Widget; | 31 | } Widget; |
35 | 32 | ||
36 | winFang *winFangAdd(globals *ourGlobals); | 33 | winFang *winFangAdd(Evas_Object *parent); |
37 | void winFangComplete(globals *ourGlobals, winFang *win, int x, int y, int w, int h); | 34 | void winFangComplete(winFang *win, int x, int y, int w, int h); |
38 | void winFangHide(winFang *win); | 35 | void winFangHide(winFang *win); |
39 | void winFangShow(winFang *win); | 36 | void winFangShow(winFang *win); |
40 | void winFangDel(globals *ourGlobals, winFang *win); | 37 | void winFangDel(winFang *win); |
41 | 38 | ||
42 | Widget *widgetAdd(winFang *win, const Eo_Class *klass, Evas_Object *parent, char *title); | 39 | Widget *widgetAdd(winFang *win, const Eo_Class *klass, Evas_Object *parent, char *title); |
diff --git a/src/extantz/woMan.c b/src/extantz/woMan.c index fe2e3f2..b5a4f50 100644 --- a/src/extantz/woMan.c +++ b/src/extantz/woMan.c | |||
@@ -159,7 +159,8 @@ 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); | 162 | me = winFangAdd(ourGlobals->win); |
163 | eina_clist_add_head(&ourGlobals->winFangs, &me->node); | ||
163 | 164 | ||
164 | bx = elm_box_add(me->win); | 165 | bx = elm_box_add(me->win); |
165 | elm_win_resize_object_add(me->win, bx); | 166 | elm_win_resize_object_add(me->win, bx); |
@@ -286,6 +287,6 @@ winFang *woMan_add(globals *ourGlobals) | |||
286 | eo_unref(bt); | 287 | eo_unref(bt); |
287 | evas_object_show(bx); | 288 | evas_object_show(bx); |
288 | 289 | ||
289 | winFangComplete(ourGlobals, me, 30, 30, ourGlobals->win_w / 3, ourGlobals->win_h / 3); | 290 | winFangComplete(me, 30, 30, ourGlobals->win_w / 3, ourGlobals->win_h / 3); |
290 | return me; | 291 | return me; |
291 | } | 292 | } |