aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
authorDavid Walter Seikel2014-05-02 00:02:59 +1000
committerDavid Walter Seikel2014-05-02 00:02:59 +1000
commitcd17ae0f88b4096f0178fe365ffdfd884c720aee (patch)
tree79d95703f3c04eb340305cdc3738d265091cb114 /src
parentClean up the resize function. (diff)
downloadSledjHamr-cd17ae0f88b4096f0178fe365ffdfd884c720aee.zip
SledjHamr-cd17ae0f88b4096f0178fe365ffdfd884c720aee.tar.gz
SledjHamr-cd17ae0f88b4096f0178fe365ffdfd884c720aee.tar.bz2
SledjHamr-cd17ae0f88b4096f0178fe365ffdfd884c720aee.tar.xz
Use Elm images instead of Evas images for the Evas_3d, and make the background the sky image.
Diffstat (limited to 'src')
-rw-r--r--src/GuiLua/GuiLua.c29
1 files changed, 19 insertions, 10 deletions
diff --git a/src/GuiLua/GuiLua.c b/src/GuiLua/GuiLua.c
index 2877fc4..192c698 100644
--- a/src/GuiLua/GuiLua.c
+++ b/src/GuiLua/GuiLua.c
@@ -612,6 +612,7 @@ static int window(lua_State *L)
612 char *name = "GuiLua"; 612 char *name = "GuiLua";
613 char *title = "GuiLua test harness"; 613 char *title = "GuiLua test harness";
614 struct _Widget *wid; 614 struct _Widget *wid;
615 Evas_Object *temp;
615 int result = 0; 616 int result = 0;
616 int w = WIDTH, h = HEIGHT; 617 int w = WIDTH, h = HEIGHT;
617 618
@@ -641,11 +642,18 @@ static int window(lua_State *L)
641 642
642 _scene_setup(ourGlobals, &ourScene); 643 _scene_setup(ourGlobals, &ourScene);
643 644
644 /* Add a background rectangle objects. */ 645 // Add a background image object.
645 ourGlobals->background = eo_add(EVAS_OBJ_RECTANGLE_CLASS, ourGlobals->evas); 646 wid = calloc(1, sizeof(struct _Widget));
646 eo_do(ourGlobals->background, 647 strcpy(wid->magic, "Widget");
647 evas_obj_color_set(0, 0, 0, 255), 648 eina_clist_add_head(&ourGlobals->widgets, &wid->node);
648 evas_obj_size_set(w, w), 649
650 wid->obj = eo_add(ELM_OBJ_IMAGE_CLASS, ourGlobals->win);
651 ourGlobals->background = (wid->obj);
652 eo_do(wid->obj,
653 elm_obj_image_fill_outside_set(EINA_TRUE),
654 elm_obj_image_file_set("../../media/sky_01.jpg", NULL),
655 evas_obj_position_set(0, 0),
656 evas_obj_size_set(w, h),
649 evas_obj_visibility_set(EINA_TRUE) 657 evas_obj_visibility_set(EINA_TRUE)
650 ); 658 );
651 659
@@ -654,17 +662,19 @@ static int window(lua_State *L)
654 strcpy(wid->magic, "Widget"); 662 strcpy(wid->magic, "Widget");
655 eina_clist_add_head(&ourGlobals->widgets, &wid->node); 663 eina_clist_add_head(&ourGlobals->widgets, &wid->node);
656 664
657 wid->obj = eo_add(EVAS_OBJ_IMAGE_CLASS, ourGlobals->win); 665 wid->obj = eo_add(ELM_OBJ_IMAGE_CLASS, ourGlobals->win);
658 ourGlobals->image = (wid->obj); 666 ourGlobals->image = (wid->obj);
659 eo_do(wid->obj, 667 eo_do(wid->obj,
660 evas_obj_image_filled_set(EINA_TRUE), 668 elm_obj_image_fill_outside_set(EINA_TRUE),
661 evas_obj_image_size_set(w, h),
662 evas_obj_image_file_set("../../media/sky_01.jpg", NULL),
663 evas_obj_position_set(0, 0), 669 evas_obj_position_set(0, 0),
664 evas_obj_size_set(w, h), 670 evas_obj_size_set(w, h),
665 evas_obj_visibility_set(EINA_TRUE), 671 evas_obj_visibility_set(EINA_TRUE),
672 temp = elm_obj_image_object_get()
673 );
674 eo_do(temp,
666 evas_obj_image_scene_set(ourScene.scene) 675 evas_obj_image_scene_set(ourScene.scene)
667 ); 676 );
677
668 // Add animation timer callback. 678 // Add animation timer callback.
669 ecore_timer_add(0.016, _animate_scene, &ourScene); 679 ecore_timer_add(0.016, _animate_scene, &ourScene);
670 680
@@ -729,7 +739,6 @@ static int closeWindow(lua_State *L)
729 { 739 {
730 eo_unref(wid->obj); 740 eo_unref(wid->obj);
731 } 741 }
732 eo_unref(ourGlobals->background);
733 evas_object_del(ourGlobals->win); 742 evas_object_del(ourGlobals->win);
734 } 743 }
735 744