aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/extantz/winFang.c
diff options
context:
space:
mode:
authorDavid Walter Seikel2014-05-05 00:55:37 +1000
committerDavid Walter Seikel2014-05-05 00:55:37 +1000
commitd5d869e9ec2c54db9e3ff25c518d0b57ee362c1e (patch)
treec86a3c2b51216270a447652174b7c1b54a59d6b4 /src/extantz/winFang.c
parentMinor clean up. (diff)
downloadSledjHamr-d5d869e9ec2c54db9e3ff25c518d0b57ee362c1e.zip
SledjHamr-d5d869e9ec2c54db9e3ff25c518d0b57ee362c1e.tar.gz
SledjHamr-d5d869e9ec2c54db9e3ff25c518d0b57ee362c1e.tar.bz2
SledjHamr-d5d869e9ec2c54db9e3ff25c518d0b57ee362c1e.tar.xz
fangWin -> winFang and related changes.
Diffstat (limited to '')
-rw-r--r--src/extantz/winFang.c (renamed from src/extantz/fangWin.c)54
1 files changed, 6 insertions, 48 deletions
diff --git a/src/extantz/fangWin.c b/src/extantz/winFang.c
index 88a5c00..0f0328f 100644
--- a/src/extantz/fangWin.c
+++ b/src/extantz/winFang.c
@@ -76,12 +76,12 @@ static void create_handles(Evas_Object *obj)
76 } 76 }
77} 77}
78 78
79fangWin *fang_win_add(globals *ourGlobals) 79winFang *winFangAdd(globals *ourGlobals)
80{ 80{
81 fangWin *result; 81 winFang *result;
82 Evas_Object *bg; 82 Evas_Object *bg;
83 83
84 result = calloc(1, sizeof(fangWin)); 84 result = calloc(1, sizeof(winFang));
85 eina_clist_init(&result->widgets); 85 eina_clist_init(&result->widgets);
86 86
87 // In theory this should create an EWS window, in practice, I'm not seeing any difference. 87 // In theory this should create an EWS window, in practice, I'm not seeing any difference.
@@ -104,7 +104,7 @@ fangWin *fang_win_add(globals *ourGlobals)
104 return result; 104 return result;
105} 105}
106 106
107void fang_win_complete(globals *ourGlobals, fangWin *win, int x, int y, int w, int h) 107void winFangComplete(globals *ourGlobals, winFang *win, int x, int y, int w, int h)
108{ 108{
109 // image object for win is unlinked to its pos/size - so manual control 109 // image object for win is unlinked to its pos/size - so manual control
110 // this allows also for using map and other things with it. 110 // this allows also for using map and other things with it.
@@ -116,7 +116,7 @@ void fang_win_complete(globals *ourGlobals, fangWin *win, int x, int y, int w, i
116 create_handles(elm_win_inlined_image_object_get(win->win)); 116 create_handles(elm_win_inlined_image_object_get(win->win));
117} 117}
118 118
119void fang_win_del(globals *ourGlobals, fangWin *win) 119void winFangDel(globals *ourGlobals, winFang *win)
120{ 120{
121 Widget *wid; 121 Widget *wid;
122 122
@@ -132,49 +132,7 @@ void fang_win_del(globals *ourGlobals, fangWin *win)
132 evas_object_del(win->win); 132 evas_object_del(win->win);
133} 133}
134 134
135void overlay_add(globals *ourGlobals) 135Widget *widgetAdd(winFang *win, const Eo_Class *klass, Evas_Object *parent, char *title)
136{
137 GLData *gld = &ourGlobals->gld;
138 Evas_Object *bg;
139
140 // There are many reasons for this window.
141 // The first is to cover the GL and provide something to click on to change focus.
142 // The second is to provide something to click on for all the GL type clicking stuff that needs to be done. In other words, no click through, we catch the clicks here.
143 // So we can probably avoid the following issue -
144 // How to do click through? evas_object_pass_events_set(rectangle, EINA_TRUE), and maybe need to do that to the underlaying window to?
145 // Though if the rectangle is entirely transparent, or even hidden, events might pass through anyway.
146 // Gotta have click through on the parts where there's no other window.
147 // The third is to have the other windows live here.
148 // This idea doesn't work, as it breaks the damn focus again.
149 // Don't think it's needed anyway.
150 // While on the subject of layers, need a HUD layer of some sort, but Irrlicht might support that itself.
151
152 gld->winwin = elm_win_add(ourGlobals->win, "inlined", ELM_WIN_INLINED_IMAGE);
153 // 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.
154 // According to the Elm inlined image window example, this is what's needed to.
155 evas_object_event_callback_add(elm_win_inlined_image_object_get(gld->winwin), EVAS_CALLBACK_MOUSE_DOWN, _cb_mouse_down_elm, NULL);
156 // In this code, we are making our own camera, so grab it's input when we are focused.
157 cameraAdd(ourGlobals, gld->winwin);
158
159 elm_win_alpha_set(gld->winwin, EINA_TRUE);
160 // Apparently transparent is not good enough for ELM backgrounds, so make it a rectangle.
161 // Apparently coz ELM prefers stuff to have edjes. A bit over the top if all I want is a transparent rectangle.
162 bg = evas_object_rectangle_add(evas_object_evas_get(gld->winwin));
163 evas_object_color_set(bg, 0, 0, 0, 0);
164 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
165 elm_win_resize_object_add(gld->winwin, bg);
166 evas_object_show(bg);
167
168 // image object for win is unlinked to its pos/size - so manual control
169 // this allows also for using map and other things with it.
170 evas_object_move(elm_win_inlined_image_object_get(gld->winwin), 0, 0);
171 // Odd, it needs to be resized twice. WTF?
172 evas_object_resize(gld->winwin, ourGlobals->win_w, ourGlobals->win_h);
173 evas_object_resize(elm_win_inlined_image_object_get(gld->winwin), ourGlobals->win_w, ourGlobals->win_h);
174 evas_object_show(gld->winwin);
175}
176
177Widget *widgetAdd(fangWin *win, const Eo_Class *klass, Evas_Object *parent, char *title)
178{ 136{
179 Widget *result; 137 Widget *result;
180 138