diff options
Diffstat (limited to '')
-rw-r--r-- | src/extantz/scenri.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/extantz/scenri.c b/src/extantz/scenri.c index 02be81c..76f4513 100644 --- a/src/extantz/scenri.c +++ b/src/extantz/scenri.c | |||
@@ -351,7 +351,10 @@ static Eina_Bool _stuffsLoader(void *data) | |||
351 | Scene_Data *scenriAdd(Evas_Object *win) | 351 | Scene_Data *scenriAdd(Evas_Object *win) |
352 | { | 352 | { |
353 | Scene_Data *scene; | 353 | Scene_Data *scene; |
354 | Evas_Object *evas, *temp; | 354 | Evas_Object *evas; |
355 | #if USE_ELM_IMG | ||
356 | Evas_Object *temp; | ||
357 | #endif | ||
355 | int w, h; | 358 | int w, h; |
356 | 359 | ||
357 | evas = evas_object_evas_get(win); | 360 | evas = evas_object_evas_get(win); |
@@ -373,12 +376,19 @@ Scene_Data *scenriAdd(Evas_Object *win) | |||
373 | // Any colour or texture applied to this window gets applied to the scene, including transparency. | 376 | // Any colour or texture applied to this window gets applied to the scene, including transparency. |
374 | // Interestingly enough, the position and size of the render seems to NOT depend on the position and size of this image? | 377 | // Interestingly enough, the position and size of the render seems to NOT depend on the position and size of this image? |
375 | // Note that we can't reuse the windows background image, Evas_3D needs both images. | 378 | // Note that we can't reuse the windows background image, Evas_3D needs both images. |
379 | #if USE_ELM_IMG | ||
376 | scene->image = eo_add(ELM_IMAGE_CLASS, win, | 380 | scene->image = eo_add(ELM_IMAGE_CLASS, win, |
377 | evas_obj_size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND), | 381 | evas_obj_size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND), |
378 | elm_obj_image_fill_outside_set(EINA_TRUE), | 382 | elm_obj_image_fill_outside_set(EINA_TRUE), |
379 | efl_gfx_visible_set(EINA_TRUE), | 383 | efl_gfx_visible_set(EINA_TRUE), |
380 | temp = elm_obj_image_object_get() | 384 | temp = elm_obj_image_object_get() |
381 | ); | 385 | ); |
386 | #else | ||
387 | scene->image = evas_object_image_filled_add(evas); | ||
388 | evas_object_size_hint_weight_set(scene->image, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND), | ||
389 | evas_object_resize(scene->image, WIDTH, HEIGHT); | ||
390 | evas_object_show(scene->image); | ||
391 | #endif | ||
382 | elm_object_tooltip_text_set(scene->image, ""); | 392 | elm_object_tooltip_text_set(scene->image, ""); |
383 | elm_object_tooltip_hide(scene->image); | 393 | elm_object_tooltip_hide(scene->image); |
384 | scene->camera_node = cameraAdd(evas, scene, scene->image); | 394 | scene->camera_node = cameraAdd(evas, scene, scene->image); |
@@ -396,11 +406,20 @@ Scene_Data *scenriAdd(Evas_Object *win) | |||
396 | ); | 406 | ); |
397 | eo_do(scene->root_node, evas_canvas3d_node_member_add(scene->light_node)); | 407 | eo_do(scene->root_node, evas_canvas3d_node_member_add(scene->light_node)); |
398 | 408 | ||
409 | #if USE_ELM_IMG | ||
399 | eo_do(temp, evas_obj_image_scene_set(scene->scene)); | 410 | eo_do(temp, evas_obj_image_scene_set(scene->scene)); |
400 | 411 | ||
401 | // Elm can't seem to be able to tell us WHERE an image was clicked, so use raw Evas callbacks instead. | 412 | // Elm can't seem to be able to tell us WHERE an image was clicked, so use raw Evas callbacks instead. |
402 | evas_object_event_callback_add(temp, EVAS_CALLBACK_MOUSE_MOVE, _on_mouse_move, scene); | 413 | evas_object_event_callback_add(temp, EVAS_CALLBACK_MOUSE_MOVE, _on_mouse_move, scene); |
403 | evas_object_event_callback_add(temp, EVAS_CALLBACK_MOUSE_DOWN, _on_mouse_down, scene); | 414 | evas_object_event_callback_add(temp, EVAS_CALLBACK_MOUSE_DOWN, _on_mouse_down, scene); |
415 | #else | ||
416 | eo_do(scene->image, evas_obj_image_scene_set(scene->scene)); | ||
417 | |||
418 | // Elm can't seem to be able to tell us WHERE an image was clicked, so use raw Evas callbacks instead. | ||
419 | evas_object_event_callback_add(scene->image, EVAS_CALLBACK_MOUSE_MOVE, _on_mouse_move, scene); | ||
420 | evas_object_event_callback_add(scene->image, EVAS_CALLBACK_MOUSE_DOWN, _on_mouse_down, scene); | ||
421 | #endif | ||
422 | |||
404 | 423 | ||
405 | elm_win_resize_object_add(win, scene->image); | 424 | elm_win_resize_object_add(win, scene->image); |
406 | 425 | ||