#include <Elementary.h>
+#include "test.h"
#ifdef HAVE_CONFIG_H
# include "elementary_config.h"
#endif
{
Cube *c;
int i;
-
+
w -= (w / 2);
h -= (h / 2);
d -= (d / 2);
o = evas_object_image_add(evas);
c->side[i].o = o;
snprintf(buf, sizeof(buf), "%s/images/%s",
- PACKAGE_DATA_DIR, "twofish.jpg");
+ elm_app_data_dir_get(), "twofish.jpg");
evas_object_image_file_set(o, buf, NULL);
evas_object_image_fill_set(o, 0, 0, 256, 256);
evas_object_resize(o, 256, 256);
POINT(0, 1, w, -h, -d, 256, 0);
POINT(0, 2, w, h, -d, 256, 256);
POINT(0, 3, -w, h, -d, 0, 256);
-
+
POINT(1, 0, w, -h, -d, 0, 0);
POINT(1, 1, w, -h, d, 256, 0);
POINT(1, 2, w, h, d, 256, 256);
POINT(1, 3, w, h, -d, 0, 256);
-
+
POINT(2, 0, w, -h, d, 0, 0);
POINT(2, 1, -w, -h, d, 256, 0);
POINT(2, 2, -w, h, d, 256, 256);
POINT(2, 3, w, h, d, 0, 256);
-
+
POINT(3, 0, -w, -h, d, 0, 0);
POINT(3, 1, -w, -h, -d, 256, 0);
POINT(3, 2, -w, h, -d, 256, 256);
POINT(3, 3, -w, h, d, 0, 256);
-
+
POINT(4, 0, -w, -h, d, 0, 0);
POINT(4, 1, w, -h, d, 256, 0);
POINT(4, 2, w, -h, -d, 256, 256);
POINT(4, 3, -w, -h, -d, 0, 256);
-
+
POINT(5, 0, -w, h, -d, 0, 0);
POINT(5, 1, w, h, -d, 256, 0);
POINT(5, 2, w, h, d, 256, 256);
POINT(5, 3, -w, h, d, 0, 256);
-
+
return c;
}
Evas_Map *m;
int i, j, order[6], sorted;
Evas_Coord mz[6];
-
+
m = evas_map_new(4);
evas_map_smooth_set(m, 0);
-
+
for (i = 0; i < 6; i++)
{
Evas_Coord tz[4];
-
+
for (j = 0; j < 4; j++)
{
evas_map_point_coord_set(m, j,
}
else
evas_object_hide(c->side[i].o);
-
+
order[i] = i;
for (j = 0; j < 4; j++)
evas_map_point_coord_get(m, j, NULL, NULL, &(tz[j]));
}
}
while (!sorted);
-
+
evas_object_raise(c->side[order[0]].o);
for (i = 1; i < 6; i++)
evas_object_stack_below(c->side[order[i]].o, c->side[order[i - 1]].o);
evas_map_free(m);
}
+/*
static void
_cube_free(Cube *c)
{
int i;
-
+
for (i = 0; i < 6; i++) evas_object_del(c->side[i].o);
free(c);
}
+*/
static void
_cube_update(Evas_Object *win, Cube *c)
{
Evas_Coord w, h;
-
+
evas_object_geometry_get(win, NULL, NULL, &w, &h);
_cube_pos(c,
(w / 2), (h / 2), 512,
test_3d(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
Evas_Object *win, *bg, *bx, *sl;
- char buf[PATH_MAX];
- win = elm_win_add(NULL, "3d", ELM_WIN_BASIC);
- elm_win_title_set(win, "3D");
- elm_win_autodel_set(win, 1);
+ win = elm_win_add(NULL, "box-vert", ELM_WIN_BASIC);
+ elm_win_title_set(win, "Box Vert");
+ elm_win_autodel_set(win, EINA_TRUE);
bg = elm_bg_add(win);
elm_win_resize_object_add(win, bg);
evas_object_show(bg);
cube = _cube_new(evas_object_evas_get(win), 240, 240, 240);
-
+
bx = elm_box_add(win);
evas_object_layer_set(bx, 10);
evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_show(bx);
sl = elm_slider_add(win);
- elm_slider_label_set(sl, "Rot X");
+ elm_object_text_set(sl, "Rot X");
elm_slider_unit_format_set(sl, "%1.0f units");
elm_slider_span_size_set(sl, 360);
elm_slider_min_max_set(sl, 0, 360);
evas_object_show(sl);
sl = elm_slider_add(win);
- elm_slider_label_set(sl, "Rot Y");
+ elm_object_text_set(sl, "Rot Y");
elm_slider_unit_format_set(sl, "%1.0f units");
elm_slider_span_size_set(sl, 360);
elm_slider_min_max_set(sl, 0, 360);
evas_object_show(sl);
sl = elm_slider_add(win);
- elm_slider_label_set(sl, "Rot Z");
+ elm_object_text_set(sl, "Rot Z");
elm_slider_unit_format_set(sl, "%1.0f units");
elm_slider_span_size_set(sl, 360);
elm_slider_min_max_set(sl, 0, 360);
evas_object_show(sl);
sl = elm_slider_add(win);
- elm_slider_label_set(sl, "CX Off");
+ elm_object_text_set(sl, "CX Off");
elm_slider_unit_format_set(sl, "%1.0f units");
elm_slider_span_size_set(sl, 360);
elm_slider_min_max_set(sl, -320, 320);
evas_object_show(sl);
sl = elm_slider_add(win);
- elm_slider_label_set(sl, "CY Off");
+ elm_object_text_set(sl, "CY Off");
elm_slider_unit_format_set(sl, "%1.0f units");
elm_slider_span_size_set(sl, 360);
elm_slider_min_max_set(sl, -320, 320);
evas_object_show(sl);
sl = elm_slider_add(win);
- elm_slider_label_set(sl, "Foc");
+ elm_object_text_set(sl, "Foc");
elm_slider_unit_format_set(sl, "%1.0f units");
elm_slider_span_size_set(sl, 360);
elm_slider_min_max_set(sl, 1, 2000);
evas_object_show(sl);
sl = elm_slider_add(win);
- elm_slider_label_set(sl, "Z0");
+ elm_object_text_set(sl, "Z0");
elm_slider_unit_format_set(sl, "%1.0f units");
elm_slider_span_size_set(sl, 360);
elm_slider_min_max_set(sl, -2000, 2000);