diff options
author | David Walter Seikel | 2014-05-03 23:40:48 +1000 |
---|---|---|
committer | David Walter Seikel | 2014-05-03 23:40:48 +1000 |
commit | 160c161b57595fdae637936c50a162d193f1a982 (patch) | |
tree | 4400c1a5e91e402e9af612fecec61aed152d2e30 | |
parent | White space clean ups from uncrustify. (diff) | |
download | SledjHamr-160c161b57595fdae637936c50a162d193f1a982.zip SledjHamr-160c161b57595fdae637936c50a162d193f1a982.tar.gz SledjHamr-160c161b57595fdae637936c50a162d193f1a982.tar.bz2 SledjHamr-160c161b57595fdae637936c50a162d193f1a982.tar.xz |
More shuffling of gld -> ourGlobals and related cleanups.
-rw-r--r-- | src/extantz/Evas_3D_demo.c | 7 | ||||
-rw-r--r-- | src/extantz/chat.c | 11 | ||||
-rw-r--r-- | src/extantz/crappisspuke.cpp | 14 | ||||
-rw-r--r-- | src/extantz/extantz.c | 24 | ||||
-rw-r--r-- | src/extantz/extantz.h | 51 | ||||
-rw-r--r-- | src/extantz/fangWin.c | 8 | ||||
-rw-r--r-- | src/extantz/woMan.c | 16 |
7 files changed, 69 insertions, 62 deletions
diff --git a/src/extantz/Evas_3D_demo.c b/src/extantz/Evas_3D_demo.c index b01dd47..95b2f2f 100644 --- a/src/extantz/Evas_3D_demo.c +++ b/src/extantz/Evas_3D_demo.c | |||
@@ -266,9 +266,8 @@ _sphere_init(int precision) | |||
266 | } | 266 | } |
267 | 267 | ||
268 | 268 | ||
269 | Eina_Bool _animate_scene(void *data) | 269 | Eina_Bool _animate_scene(globals *ourGlobals) |
270 | { | 270 | { |
271 | globals *ourGlobals = data; | ||
272 | static float angle = 0.0f; | 271 | static float angle = 0.0f; |
273 | static float earthAngle = 0.0f; | 272 | static float earthAngle = 0.0f; |
274 | static int frame = 0; | 273 | static int frame = 0; |
@@ -703,12 +702,10 @@ void Evas_3D_Demo_add(globals *ourGlobals) | |||
703 | // Elm can't seem to be able to tell us WHERE an image was clicked, so use raw Evas calbacks instead. | 702 | // Elm can't seem to be able to tell us WHERE an image was clicked, so use raw Evas calbacks instead. |
704 | evas_object_event_callback_add(temp, EVAS_CALLBACK_MOUSE_MOVE, _on_mouse_move, &ourScene); | 703 | evas_object_event_callback_add(temp, EVAS_CALLBACK_MOUSE_MOVE, _on_mouse_move, &ourScene); |
705 | evas_object_event_callback_add(temp, EVAS_CALLBACK_MOUSE_DOWN, _on_mouse_down, &ourScene); | 704 | evas_object_event_callback_add(temp, EVAS_CALLBACK_MOUSE_DOWN, _on_mouse_down, &ourScene); |
706 | cameraAdd(obj, &ourGlobals->gld); | 705 | cameraAdd(ourGlobals, obj); |
707 | elm_win_resize_object_add(ourGlobals->win, obj); | 706 | elm_win_resize_object_add(ourGlobals->win, obj); |
708 | // elm_box_pack_end(ourGlobals->gld.bx, obj); | 707 | // elm_box_pack_end(ourGlobals->gld.bx, obj); |
709 | 708 | ||
710 | // Add animation timer callback. | ||
711 | // ecore_timer_add(0.016, _animate_scene, &ourScene); | ||
712 | ourGlobals->gld.move = calloc(1, sizeof(cameraMove)); | 709 | ourGlobals->gld.move = calloc(1, sizeof(cameraMove)); |
713 | } | 710 | } |
714 | 711 | ||
diff --git a/src/extantz/chat.c b/src/extantz/chat.c index 12f4d20..4ad5033 100644 --- a/src/extantz/chat.c +++ b/src/extantz/chat.c | |||
@@ -1,6 +1,5 @@ | |||
1 | #include "extantz.h" | 1 | #include "extantz.h" |
2 | 2 | ||
3 | |||
4 | void chat_add(globals *ourGlobals) | 3 | void chat_add(globals *ourGlobals) |
5 | { | 4 | { |
6 | Evas_Object *win, *bx, *en; | 5 | Evas_Object *win, *bx, *en; |
@@ -8,10 +7,10 @@ void chat_add(globals *ourGlobals) | |||
8 | win = fang_win_add(ourGlobals); | 7 | win = fang_win_add(ourGlobals); |
9 | 8 | ||
10 | bx = eo_add(ELM_OBJ_BOX_CLASS, win); | 9 | bx = eo_add(ELM_OBJ_BOX_CLASS, win); |
11 | eo_do(bx, | 10 | eo_do(bx, |
12 | evas_obj_size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND), | 11 | evas_obj_size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND), |
13 | evas_obj_size_hint_align_set(EVAS_HINT_FILL, EVAS_HINT_FILL) | 12 | evas_obj_size_hint_align_set(EVAS_HINT_FILL, EVAS_HINT_FILL) |
14 | ); | 13 | ); |
15 | elm_win_resize_object_add(win, bx); | 14 | elm_win_resize_object_add(win, bx); |
16 | 15 | ||
17 | en = eo_add(ELM_OBJ_ENTRY_CLASS, win); | 16 | en = eo_add(ELM_OBJ_ENTRY_CLASS, win); |
@@ -22,7 +21,7 @@ void chat_add(globals *ourGlobals) | |||
22 | evas_obj_size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND), | 21 | evas_obj_size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND), |
23 | evas_obj_size_hint_align_set(EVAS_HINT_FILL, EVAS_HINT_FILL), | 22 | evas_obj_size_hint_align_set(EVAS_HINT_FILL, EVAS_HINT_FILL), |
24 | evas_obj_visibility_set(EINA_TRUE) | 23 | evas_obj_visibility_set(EINA_TRUE) |
25 | ); | 24 | ); |
26 | elm_box_pack_end(bx, en); | 25 | elm_box_pack_end(bx, en); |
27 | eo_unref(en); | 26 | eo_unref(en); |
28 | 27 | ||
@@ -31,12 +30,12 @@ void chat_add(globals *ourGlobals) | |||
31 | eo_do(en, | 30 | eo_do(en, |
32 | elm_obj_entry_scrollable_set(EINA_TRUE), | 31 | elm_obj_entry_scrollable_set(EINA_TRUE), |
33 | // TODO - Setting editable to TRUE is what hangs up extantz on exit. | 32 | // TODO - Setting editable to TRUE is what hangs up extantz on exit. |
34 | // elm_obj_entry_editable_set(EINA_TRUE), | 33 | // elm_obj_entry_editable_set(EINA_TRUE), |
35 | elm_obj_entry_editable_set(EINA_FALSE), | 34 | elm_obj_entry_editable_set(EINA_FALSE), |
36 | evas_obj_size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND), | 35 | evas_obj_size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND), |
37 | evas_obj_size_hint_align_set(EVAS_HINT_FILL, EVAS_HINT_FILL), | 36 | evas_obj_size_hint_align_set(EVAS_HINT_FILL, EVAS_HINT_FILL), |
38 | evas_obj_visibility_set(EINA_TRUE) | 37 | evas_obj_visibility_set(EINA_TRUE) |
39 | ); | 38 | ); |
40 | elm_box_pack_end(bx, en); | 39 | elm_box_pack_end(bx, en); |
41 | eo_unref(en); | 40 | eo_unref(en); |
42 | 41 | ||
diff --git a/src/extantz/crappisspuke.cpp b/src/extantz/crappisspuke.cpp index 04cebca..fca6f35 100644 --- a/src/extantz/crappisspuke.cpp +++ b/src/extantz/crappisspuke.cpp | |||
@@ -18,8 +18,9 @@ u32 then; | |||
18 | extern "C" { | 18 | extern "C" { |
19 | #endif | 19 | #endif |
20 | 20 | ||
21 | EAPI int startIrr(GLData *gld) | 21 | EAPI int startIrr(globals *ourGlobals) |
22 | { | 22 | { |
23 | GLData *gld = &ourGlobals->gld; | ||
23 | SIrrlichtCreationParameters params; | 24 | SIrrlichtCreationParameters params; |
24 | #if USE_IRR | 25 | #if USE_IRR |
25 | IrrlichtDevice *device; | 26 | IrrlichtDevice *device; |
@@ -92,7 +93,7 @@ etc. of course. | |||
92 | */ | 93 | */ |
93 | 94 | ||
94 | 95 | ||
95 | sfc = ecore_evas_window_get(gld->ee); | 96 | sfc = ecore_evas_window_get(ourGlobals->ee); |
96 | // This is the way Raster wants me to do things, but these functions are not actually available. Pffft | 97 | // This is the way Raster wants me to do things, but these functions are not actually available. Pffft |
97 | // ctx = gl->glGetCurrentContext(); | 98 | // ctx = gl->glGetCurrentContext(); |
98 | // display = gl->glGetCurrentDisplay(); | 99 | // display = gl->glGetCurrentDisplay(); |
@@ -229,8 +230,9 @@ etc. of course. | |||
229 | return 1; | 230 | return 1; |
230 | } | 231 | } |
231 | 232 | ||
232 | EAPI void drawIrr_start(GLData *gld) | 233 | EAPI void drawIrr_start(globals *ourGlobals) |
233 | { | 234 | { |
235 | GLData *gld = &ourGlobals->gld; | ||
234 | if (gld->useIrr) | 236 | if (gld->useIrr) |
235 | { | 237 | { |
236 | IrrlichtDevice *device = gld->device; | 238 | IrrlichtDevice *device = gld->device; |
@@ -267,16 +269,18 @@ EAPI void drawIrr_start(GLData *gld) | |||
267 | } | 269 | } |
268 | } | 270 | } |
269 | 271 | ||
270 | EAPI void drawIrr_end(GLData *gld) | 272 | EAPI void drawIrr_end(globals *ourGlobals) |
271 | { | 273 | { |
274 | GLData *gld = &ourGlobals->gld; | ||
272 | IVideoDriver *driver = gld->driver; | 275 | IVideoDriver *driver = gld->driver; |
273 | 276 | ||
274 | if (gld->useIrr) | 277 | if (gld->useIrr) |
275 | driver->endScene(); | 278 | driver->endScene(); |
276 | } | 279 | } |
277 | 280 | ||
278 | EAPI void finishIrr(GLData *gld) | 281 | EAPI void finishIrr(globals *ourGlobals) |
279 | { | 282 | { |
283 | GLData *gld = &ourGlobals->gld; | ||
280 | IrrlichtDevice *device = gld->device; | 284 | IrrlichtDevice *device = gld->device; |
281 | 285 | ||
282 | /* | 286 | /* |
diff --git a/src/extantz/extantz.c b/src/extantz/extantz.c index d1fdf50..ace5150 100644 --- a/src/extantz/extantz.c +++ b/src/extantz/extantz.c | |||
@@ -89,7 +89,6 @@ static void _on_resize(void *data, Evas *evas, Evas_Object *obj, void *event_inf | |||
89 | static void _clean_gl(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) | 89 | static void _clean_gl(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) |
90 | { | 90 | { |
91 | globals *ourGlobals = data; | 91 | globals *ourGlobals = data; |
92 | GLData *gld = &ourGlobals->gld; | ||
93 | 92 | ||
94 | ecore_animator_del(ourGlobals->animator); | 93 | ecore_animator_del(ourGlobals->animator); |
95 | 94 | ||
@@ -97,7 +96,9 @@ static void _clean_gl(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNU | |||
97 | // evas_gl_make_current(NULL, NULL, NULL); | 96 | // evas_gl_make_current(NULL, NULL, NULL); |
98 | 97 | ||
99 | // TODO - Since this is created on the render thread, better hope this is being deleted on the render thread. | 98 | // TODO - Since this is created on the render thread, better hope this is being deleted on the render thread. |
100 | finishIrr(gld); | 99 | #if USE_IRR |
100 | finishIrr(ourGlobals); | ||
101 | #endif | ||
101 | 102 | ||
102 | #if DO_GEARS | 103 | #if DO_GEARS |
103 | Evas_GL_API *gl = gld->glApi; | 104 | Evas_GL_API *gl = gld->glApi; |
@@ -141,14 +142,19 @@ static void _draw_gl(Evas_Object *obj) | |||
141 | GLData *gld = &ourGlobals->gld; | 142 | GLData *gld = &ourGlobals->gld; |
142 | if (!ourGlobals) return; | 143 | if (!ourGlobals) return; |
143 | 144 | ||
144 | if (!gld->doneIrr) gld->doneIrr = startIrr(gld); // Needs to be after gld->win is shown, and needs to be done in the render thread. | 145 | #if USE_IRR |
146 | if (!gld->doneIrr) gld->doneIrr = startIrr(ourGlobals); // Needs to be after gld->win is shown, and needs to be done in the render thread. | ||
147 | #endif | ||
148 | |||
145 | #if DO_GEARS | 149 | #if DO_GEARS |
146 | if (!gld->gearsInited) gears_init(gld); | 150 | if (!gld->gearsInited) gears_init(gld); |
147 | #endif | 151 | #endif |
148 | 152 | ||
149 | // if (gld->resized) _resize(gld); | 153 | // if (gld->resized) _resize(gld); |
150 | 154 | ||
151 | drawIrr_start(gld); | 155 | #if USE_IRR |
156 | drawIrr_start(ourGlobals); | ||
157 | #endif | ||
152 | 158 | ||
153 | #if DO_GEARS | 159 | #if DO_GEARS |
154 | drawGears(gld); | 160 | drawGears(gld); |
@@ -156,7 +162,9 @@ static void _draw_gl(Evas_Object *obj) | |||
156 | 162 | ||
157 | _animate_scene(ourGlobals); | 163 | _animate_scene(ourGlobals); |
158 | 164 | ||
159 | drawIrr_end(gld); | 165 | #if USE_IRR |
166 | drawIrr_end(ourGlobals); | ||
167 | #endif | ||
160 | 168 | ||
161 | #if USE_IRR | 169 | #if USE_IRR |
162 | #else | 170 | #else |
@@ -349,12 +357,14 @@ EAPI_MAIN int elm_main(int argc, char **argv) | |||
349 | // Set preferred engine back to default from config | 357 | // Set preferred engine back to default from config |
350 | elm_config_preferred_engine_set(NULL); | 358 | elm_config_preferred_engine_set(NULL); |
351 | 359 | ||
352 | // TODO, or not TODO - I keep getting rid of these, but keep bringing them back. Leave ee commented for now. | 360 | // TODO, or not TODO - I keep getting rid of these, but keep bringing them back. |
353 | // Get the Evas / canvas from the elm window (that the Evas_Object "lives on"), which is itself an Evas_Object created by Elm, so not sure if it was created internally with Ecore_Evas. | 361 | // Get the Evas / canvas from the elm window (that the Evas_Object "lives on"), which is itself an Evas_Object created by Elm, so not sure if it was created internally with Ecore_Evas. |
354 | ourGlobals.evas = evas_object_evas_get(ourGlobals.win); | 362 | ourGlobals.evas = evas_object_evas_get(ourGlobals.win); |
355 | // An Ecore_Evas holds an Evas. | 363 | // An Ecore_Evas holds an Evas. |
356 | // Get the Ecore_Evas that wraps an Evas. | 364 | // Get the Ecore_Evas that wraps an Evas. |
357 | //ourGlobals.ee = ecore_evas_ecore_evas_get(ourGlobals.evas); // Only use this on Evas that was created with Ecore_Evas. | 365 | #if USE_IRR |
366 | ourGlobals.ee = ecore_evas_ecore_evas_get(ourGlobals.evas); // Only use this on Evas that was created with Ecore_Evas. | ||
367 | #endif | ||
358 | 368 | ||
359 | #if USE_PHYSICS | 369 | #if USE_PHYSICS |
360 | if (!ephysics_init()) | 370 | if (!ephysics_init()) |
diff --git a/src/extantz/extantz.h b/src/extantz/extantz.h index fab6708..3c671bb 100644 --- a/src/extantz/extantz.h +++ b/src/extantz/extantz.h | |||
@@ -1,6 +1,6 @@ | |||
1 | #define USE_PHYSICS 1 | 1 | #define USE_PHYSICS 1 |
2 | #define USE_IRR 0 | 2 | #define USE_IRR 0 |
3 | #define USE_DEMO 1 | 3 | #define USE_DEMO 0 |
4 | #define DO_GEARS 0 | 4 | #define DO_GEARS 0 |
5 | 5 | ||
6 | 6 | ||
@@ -57,9 +57,14 @@ typedef struct ICameraSceneNode ICameraSceneNode; | |||
57 | #endif | 57 | #endif |
58 | 58 | ||
59 | 59 | ||
60 | 60 | #if DO_GEARS | |
61 | typedef struct _Gear Gear; | 61 | typedef struct _Gear |
62 | typedef struct _GLData GLData; | 62 | { |
63 | GLfloat *vertices; | ||
64 | GLuint vbo; | ||
65 | int count; | ||
66 | } Gear; | ||
67 | #endif | ||
63 | 68 | ||
64 | typedef enum | 69 | typedef enum |
65 | { | 70 | { |
@@ -98,7 +103,6 @@ typedef struct | |||
98 | ezPlatform platform; | 103 | ezPlatform platform; |
99 | ezViewer *viewer; | 104 | ezViewer *viewer; |
100 | Elm_Object_Item *item; | 105 | Elm_Object_Item *item; |
101 | GLData *gld; // Just a temporary evil hack to pass gld to _grid_sel_cb(). | ||
102 | } ezGrid; | 106 | } ezGrid; |
103 | 107 | ||
104 | typedef struct | 108 | typedef struct |
@@ -120,16 +124,6 @@ typedef struct | |||
120 | } ezLandmark; | 124 | } ezLandmark; |
121 | 125 | ||
122 | 126 | ||
123 | |||
124 | struct _Gear | ||
125 | { | ||
126 | GLfloat *vertices; | ||
127 | GLuint vbo; | ||
128 | int count; | ||
129 | }; | ||
130 | |||
131 | |||
132 | |||
133 | typedef struct _Scene_Data | 127 | typedef struct _Scene_Data |
134 | { | 128 | { |
135 | Evas_Object *image; // Our Elm image. | 129 | Evas_Object *image; // Our Elm image. |
@@ -162,7 +156,7 @@ typedef struct _Scene_Data | |||
162 | } Scene_Data; | 156 | } Scene_Data; |
163 | 157 | ||
164 | // Elm GL view related data here. | 158 | // Elm GL view related data here. |
165 | struct _GLData | 159 | typedef struct _GLData |
166 | { | 160 | { |
167 | Evas_Object *winwin; | 161 | Evas_Object *winwin; |
168 | Evas_Object *elmGl; | 162 | Evas_Object *elmGl; |
@@ -204,11 +198,13 @@ struct _GLData | |||
204 | GLfloat proj[16]; | 198 | GLfloat proj[16]; |
205 | GLfloat light[3]; | 199 | GLfloat light[3]; |
206 | #endif | 200 | #endif |
207 | }; | 201 | } GLData; |
208 | 202 | ||
209 | typedef struct _globals | 203 | typedef struct _globals |
210 | { | 204 | { |
211 | // Ecore_Evas *ee; | 205 | #if USE_IRR |
206 | Ecore_Evas *ee; | ||
207 | #endif | ||
212 | Evas *evas; | 208 | Evas *evas; |
213 | Evas_Object *win; // Our Elm window. | 209 | Evas_Object *win; // Our Elm window. |
214 | Evas_Object *tb; // Our Elm toolbar. | 210 | Evas_Object *tb; // Our Elm toolbar. |
@@ -222,29 +218,33 @@ typedef struct _globals | |||
222 | 218 | ||
223 | Ecore_Animator *animator; | 219 | Ecore_Animator *animator; |
224 | 220 | ||
225 | struct _GLData gld; | 221 | GLData gld; |
226 | Scene_Data *scene; | 222 | Scene_Data *scene; |
227 | } globals; | 223 | } globals; |
228 | 224 | ||
229 | extern globals ourGlobals; | 225 | extern globals ourGlobals; |
230 | 226 | ||
231 | 227 | ||
228 | #if DO_GEARS | ||
232 | void gears_init(GLData *gld); | 229 | void gears_init(GLData *gld); |
233 | void drawGears(GLData *gld); | 230 | void drawGears(GLData *gld); |
234 | void free_gear(Gear *gear); | 231 | void free_gear(Gear *gear); |
232 | #endif | ||
235 | 233 | ||
236 | EPhysics_World *ephysicsAdd(globals *ourGlobals); | 234 | EPhysics_World *ephysicsAdd(globals *ourGlobals); |
237 | 235 | ||
238 | EAPI int startIrr(GLData *gld); | 236 | #if USE_IRR |
239 | EAPI void drawIrr_start(GLData *gld); | 237 | EAPI int startIrr(globals *ourGlobals); |
240 | EAPI void drawIrr_end(GLData *gld); | 238 | EAPI void drawIrr_start(globals *ourGlobals); |
241 | EAPI void finishIrr(GLData *gld); | 239 | EAPI void drawIrr_end(globals *ourGlobals); |
240 | EAPI void finishIrr(globals *ourGlobals); | ||
241 | #endif | ||
242 | 242 | ||
243 | EAPI void Evas_3D_Demo_add(globals *ourGlobals); | 243 | EAPI void Evas_3D_Demo_add(globals *ourGlobals); |
244 | Eina_Bool _animate_scene(void *data); | 244 | Eina_Bool _animate_scene(globals *ourGlobals); |
245 | void Evas_3D_Demo_fini(globals *ourGlobals); | 245 | void Evas_3D_Demo_fini(globals *ourGlobals); |
246 | 246 | ||
247 | void cameraAdd(Evas_Object *win, GLData *gld); | 247 | void cameraAdd(globals *ourGlobals, Evas_Object *win); |
248 | 248 | ||
249 | Evas_Object *fang_win_add(globals *ourGlobals); | 249 | Evas_Object *fang_win_add(globals *ourGlobals); |
250 | void fang_win_complete(globals *ourGlobals, Evas_Object *win, int x, int y, int w, int h); | 250 | void fang_win_complete(globals *ourGlobals, Evas_Object *win, int x, int y, int w, int h); |
@@ -257,4 +257,3 @@ void woMan_add(globals *ourGlobals); | |||
257 | #ifdef __cplusplus | 257 | #ifdef __cplusplus |
258 | } | 258 | } |
259 | #endif | 259 | #endif |
260 | |||
diff --git a/src/extantz/fangWin.c b/src/extantz/fangWin.c index c7ec145..e95910c 100644 --- a/src/extantz/fangWin.c +++ b/src/extantz/fangWin.c | |||
@@ -6,7 +6,6 @@ | |||
6 | // Evas style event callback. | 6 | // Evas style event callback. |
7 | static void _cb_mouse_down_elm(void *data, Evas *evas, Evas_Object *obj, void *event_info) | 7 | static void _cb_mouse_down_elm(void *data, Evas *evas, Evas_Object *obj, void *event_info) |
8 | { | 8 | { |
9 | // GLData *gld = data; | ||
10 | Evas_Event_Mouse_Down *ev = event_info; | 9 | Evas_Event_Mouse_Down *ev = event_info; |
11 | 10 | ||
12 | if (1 == ev->button) | 11 | if (1 == ev->button) |
@@ -80,7 +79,6 @@ static void create_handles(Evas_Object *obj) | |||
80 | 79 | ||
81 | Evas_Object *fang_win_add(globals *ourGlobals) | 80 | Evas_Object *fang_win_add(globals *ourGlobals) |
82 | { | 81 | { |
83 | GLData *gld = &ourGlobals->gld; | ||
84 | Evas_Object *win, *bg; | 82 | Evas_Object *win, *bg; |
85 | 83 | ||
86 | // In theory this should create an EWS window, in practice, I'm not seeing any difference. | 84 | // In theory this should create an EWS window, in practice, I'm not seeing any difference. |
@@ -89,7 +87,7 @@ Evas_Object *fang_win_add(globals *ourGlobals) | |||
89 | win = elm_win_add(ourGlobals->win, "inlined", ELM_WIN_INLINED_IMAGE); | 87 | win = elm_win_add(ourGlobals->win, "inlined", ELM_WIN_INLINED_IMAGE); |
90 | // 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. | 88 | // 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. |
91 | // According to the Elm inlined image window example, this is what's needed to. | 89 | // According to the Elm inlined image window example, this is what's needed to. |
92 | evas_object_event_callback_add(elm_win_inlined_image_object_get(win), EVAS_CALLBACK_MOUSE_DOWN, _cb_mouse_down_elm, gld); | 90 | evas_object_event_callback_add(elm_win_inlined_image_object_get(win), EVAS_CALLBACK_MOUSE_DOWN, _cb_mouse_down_elm, NULL); |
93 | elm_win_alpha_set(win, EINA_TRUE); | 91 | elm_win_alpha_set(win, EINA_TRUE); |
94 | 92 | ||
95 | // Apparently transparent is not good enough for ELM backgrounds, so make it a rectangle. | 93 | // Apparently transparent is not good enough for ELM backgrounds, so make it a rectangle. |
@@ -135,9 +133,9 @@ void overlay_add(globals *ourGlobals) | |||
135 | gld->winwin = elm_win_add(ourGlobals->win, "inlined", ELM_WIN_INLINED_IMAGE); | 133 | gld->winwin = elm_win_add(ourGlobals->win, "inlined", ELM_WIN_INLINED_IMAGE); |
136 | // 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. | 134 | // 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. |
137 | // According to the Elm inlined image window example, this is what's needed to. | 135 | // According to the Elm inlined image window example, this is what's needed to. |
138 | evas_object_event_callback_add(elm_win_inlined_image_object_get(gld->winwin), EVAS_CALLBACK_MOUSE_DOWN, _cb_mouse_down_elm, gld); | 136 | evas_object_event_callback_add(elm_win_inlined_image_object_get(gld->winwin), EVAS_CALLBACK_MOUSE_DOWN, _cb_mouse_down_elm, NULL); |
139 | // In this code, we are making our own camera, so grab it's input when we are focused. | 137 | // In this code, we are making our own camera, so grab it's input when we are focused. |
140 | cameraAdd(gld->winwin, gld); | 138 | cameraAdd(ourGlobals, gld->winwin); |
141 | 139 | ||
142 | elm_win_alpha_set(gld->winwin, EINA_TRUE); | 140 | elm_win_alpha_set(gld->winwin, EINA_TRUE); |
143 | // Apparently transparent is not good enough for ELM backgrounds, so make it a rectangle. | 141 | // Apparently transparent is not good enough for ELM backgrounds, so make it a rectangle. |
diff --git a/src/extantz/woMan.c b/src/extantz/woMan.c index bef449c..2a1cfc8 100644 --- a/src/extantz/woMan.c +++ b/src/extantz/woMan.c | |||
@@ -139,13 +139,13 @@ static Evas_Object *_viewer_content_get(void *data, Evas_Object *obj, const char | |||
139 | 139 | ||
140 | static void _grid_sel_cb(void *data, Evas_Object *obj, void *event_info) | 140 | static void _grid_sel_cb(void *data, Evas_Object *obj, void *event_info) |
141 | { | 141 | { |
142 | // ezGrid *thisGrid = data; | 142 | globals *ourGlobals = evas_object_data_get(obj, "glob"); |
143 | // GLData *gld = thisGrid->gld; | 143 | ezGrid *thisGrid = data; |
144 | // char buf[PATH_MAX]; | 144 | char buf[PATH_MAX]; |
145 | 145 | ||
146 | // sprintf(buf, "dillo -f -g '%dx%d+%d+%d' %s &", gld->win_w - (gld->win_w / 5), gld->win_h - 30, gld->win_w / 5, gld->win_y, thisGrid->splashPage); | 146 | // sprintf(buf, "dillo -f -g '%dx%d+%d+%d' %s &", gld->win_w - (ourGlobals->win_w / 5), ourGlobals->win_h - 30, ourGlobals->win_w / 5, ourGlobals->win_y, thisGrid->splashPage); |
147 | // sprintf(buf, "uzbl -g '%dx%d+%d+%d' -u %s &", gld->win_w - (gld->win_w / 5), gld->win_h - 30, gld->win_w / 5, gld->win_y, thisGrid->splashPage); | 147 | sprintf(buf, "uzbl -g '%dx%d+%d+%d' -u %s &", ourGlobals->win_w - (ourGlobals->win_w / 5), ourGlobals->win_h - 30, ourGlobals->win_w / 5, ourGlobals->win_y, thisGrid->splashPage); |
148 | // printf("%s ### genlist obj [%p], item pointer [%p]\n", buf, obj, event_info); | 148 | printf("%s ### genlist obj [%p], item pointer [%p]\n", buf, obj, event_info); |
149 | // comment this out for now, busy dealing with input stuff, don't want to trigger this multiple times. | 149 | // comment this out for now, busy dealing with input stuff, don't want to trigger this multiple times. |
150 | // system(buf); | 150 | // system(buf); |
151 | } | 151 | } |
@@ -153,7 +153,6 @@ static void _grid_sel_cb(void *data, Evas_Object *obj, void *event_info) | |||
153 | 153 | ||
154 | void woMan_add(globals *ourGlobals) | 154 | void woMan_add(globals *ourGlobals) |
155 | { | 155 | { |
156 | GLData *gld = &ourGlobals->gld; | ||
157 | // Evas_Object *win, *bg, *bx, *ic, *bb, *av, *en, *bt, *nf, *tab, *tb, *gridList, *viewerList, *menu; | 156 | // Evas_Object *win, *bg, *bx, *ic, *bb, *av, *en, *bt, *nf, *tab, *tb, *gridList, *viewerList, *menu; |
158 | Evas_Object *win, *bx, *bt, *nf, *tab, *tb, *gridList, *viewerList, *menu; | 157 | Evas_Object *win, *bx, *bt, *nf, *tab, *tb, *gridList, *viewerList, *menu; |
159 | Elm_Object_Item *tb_it, *menu_it, *tab_it; | 158 | Elm_Object_Item *tb_it, *menu_it, *tab_it; |
@@ -195,6 +194,7 @@ void woMan_add(globals *ourGlobals) | |||
195 | 194 | ||
196 | gridList = elm_genlist_add(win); | 195 | gridList = elm_genlist_add(win); |
197 | grids = eina_hash_stringshared_new(free); | 196 | grids = eina_hash_stringshared_new(free); |
197 | evas_object_data_set(gridList, "glob", ourGlobals); | ||
198 | 198 | ||
199 | grid_gic = elm_genlist_item_class_new(); | 199 | grid_gic = elm_genlist_item_class_new(); |
200 | grid_gic->item_style = "double_label"; | 200 | grid_gic->item_style = "double_label"; |
@@ -214,7 +214,7 @@ void woMan_add(globals *ourGlobals) | |||
214 | thisGrid->loginURI = gridTest[i][1]; | 214 | thisGrid->loginURI = gridTest[i][1]; |
215 | thisGrid->splashPage = gridTest[i][2]; | 215 | thisGrid->splashPage = gridTest[i][2]; |
216 | thisGrid->icon = "folder"; | 216 | thisGrid->icon = "folder"; |
217 | thisGrid->gld = gld; | 217 | // thisGrid->gld = gld; |
218 | thisGrid->item = elm_genlist_item_append(gridList, grid_gic, thisGrid, NULL, ELM_GENLIST_ITEM_TREE, _grid_sel_cb, thisGrid); | 218 | thisGrid->item = elm_genlist_item_append(gridList, grid_gic, thisGrid, NULL, ELM_GENLIST_ITEM_TREE, _grid_sel_cb, thisGrid); |
219 | eina_hash_add(grids, thisGrid->name, thisGrid); | 219 | eina_hash_add(grids, thisGrid->name, thisGrid); |
220 | } | 220 | } |