exactness: Removed redundent (NA) tests

Signed-off-by: Aharon Hillel <a.hillel@partner.samsung.com>

SVN revision: 66388
devs/tasn/jenkins
Aharon Hillel 11 years ago committed by Tom Hacohen
parent 70a75738ee
commit 0d2d5f4510
  1. 9
      src/bin/Makefile.am
  2. 162
      src/bin/test_calendar.c
  3. 450
      src/bin/test_cursor.c
  4. 102
      src/bin/test_floating.c
  5. 148
      src/bin/test_focus2.c
  6. 107
      src/bin/test_focus3.c
  7. 100
      src/bin/test_photo.c
  8. 333
      src/bin/test_photocam.c
  9. 64
      src/bin/test_thumb.c
  10. 237
      src/bin/test_win_inline.c
  11. 357
      src/bin/test_win_state.c
  12. 26
      src/bin/tsuite.c

@ -15,17 +15,13 @@ exactness_raw_SOURCES = \
../lib/tsuite_file_data.c \
test_3d.c \
test_actionslider.c \
test_focus2.c \
test_panel.c \
test_anchorblock.c \
test_focus3.c \
test_panes.c \
test_anchorview.c \
test_focus.c \
test_photo.c \
test_bg.c \
test_gengrid.c \
test_photocam.c \
test_box.c \
test_genlist.c \
test_progressbar.c \
@ -47,9 +43,7 @@ exactness_raw_SOURCES = \
test_ctxpopup.c \
test_index.c \
test_table.c \
test_cursor.c \
test_inwin.c \
test_thumb.c \
test_diskselector.c \
test_label.c \
test_toggle.c \
@ -63,11 +57,8 @@ exactness_raw_SOURCES = \
test_map.c \
test_weather.c \
test_menu.c \
test_win_inline.c \
test_naviframe.c \
test_win_state.c \
test_notify.c \
test_floating.c \
test_scroller.c \
test_pager.c

@ -142,165 +142,3 @@ TEST_START(test_calendar)
evas_object_show(win);
}
TEST_END
void
_print_cal_info(Evas_Object *cal, Evas_Object *en)
{
char info[1024];
double interval;
int year_min, year_max;
Eina_Bool sel_enabled;
const char **wds;
struct tm stime;
if (!elm_calendar_selected_time_get(cal, &stime))
return;
interval = elm_calendar_interval_get(cal);
elm_calendar_min_max_year_get(cal, &year_min, &year_max);
sel_enabled = elm_calendar_day_selection_enabled_get(cal);
wds = elm_calendar_weekdays_names_get(cal);
snprintf(info, sizeof(info),
" Day: %i, Mon: %i, Year %i, WeekDay: %i<br>"
" Interval: %0.2f, Year_Min: %i, Year_Max %i, Sel Enabled : %i<br>"
" Weekdays: %s, %s, %s, %s, %s, %s, %s<br>",
stime.tm_mday, stime.tm_mon, stime.tm_year + 1900, stime.tm_wday,
interval, year_min, year_max, sel_enabled,
wds[0], wds[1], wds[2], wds[3], wds[4], wds[5], wds[6]);
elm_entry_entry_set(en, info);
}
static void
_print_cal_info_cb(void *data, Evas_Object *obj, void *event_info __UNUSED__)
{
_print_cal_info(obj, data);
}
static char *
_format_month_year(struct tm *stime)
{
char buf[32];
if (!strftime(buf, sizeof(buf), "%b %y", stime)) return NULL;
return strdup(buf);
}
/* A test intended to cover all the calendar api and much use cases as
possible */
TEST_START(test_calendar2)
{
Evas_Object *bg, *bx, *bxh, *bxx, *cal, *cal2, *cal3, *en;
Elm_Calendar_Mark *mark;
struct tm selected_time;
time_t current_time;
const char *weekdays[] =
{
"Sunday", "Monday", "Tuesday", "Wednesday",
"Thursday", "Friday", "Saturday"
};
bg = elm_bg_add(win);
elm_win_resize_object_add(win, bg);
evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_show(bg);
bxx = elm_box_add(win);
elm_win_resize_object_add(win, bxx);
evas_object_size_hint_weight_set(bxx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_show(bxx);
api->bt = elm_button_add(win);
elm_object_text_set(api->bt, "Next API function");
evas_object_smart_callback_add(api->bt, "clicked", _api_bt_clicked, (void *) api);
elm_box_pack_end(bxx, api->bt);
elm_object_disabled_set(api->bt, EINA_TRUE); /* NOT USED at the Moment */
evas_object_show(api->bt);
bx = elm_box_add(win);
evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_show(bx);
api->data = bx;
elm_box_pack_end(bxx, bx);
bxh = elm_box_add(win);
elm_box_horizontal_set(bxh, EINA_TRUE);
evas_object_size_hint_weight_set(bxh, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(bxh, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_show(bxh);
elm_box_pack_end(bx, bxh);
cal = elm_calendar_add(win);
evas_object_size_hint_weight_set(cal, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(cal, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_show(cal);
elm_box_pack_end(bx, cal);
cal2 = elm_calendar_add(win);
evas_object_size_hint_weight_set(cal2, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(cal2, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_calendar_day_selection_enabled_set(cal2, EINA_FALSE);
evas_object_show(cal2);
elm_box_pack_end(bxh, cal2);
cal3 = elm_calendar_add(win);
evas_object_size_hint_weight_set(cal3, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(cal3, EVAS_HINT_FILL, EVAS_HINT_FILL);
current_time = time(NULL) + 34 * 84600;
localtime_r(&current_time, &selected_time);
elm_calendar_selected_time_set(cal3, &selected_time);
current_time = time(NULL) + 1 * 84600;
localtime_r(&current_time, &selected_time);
elm_calendar_mark_add(cal3, "checked", &selected_time, ELM_CALENDAR_UNIQUE);
elm_calendar_marks_clear(cal3);
current_time = time(NULL);
localtime_r(&current_time, &selected_time);
elm_calendar_mark_add(cal3, "checked", &selected_time, ELM_CALENDAR_DAILY);
elm_calendar_mark_add(cal3, "holiday", &selected_time, ELM_CALENDAR_DAILY);
elm_calendar_marks_draw(cal3);
evas_object_show(cal3);
elm_box_pack_end(bxh, cal3);
en = elm_entry_add(win);
evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_show(en);
elm_box_pack_end(bx, en);
elm_entry_editable_set(en, EINA_FALSE);
evas_object_show(win);
elm_calendar_min_max_year_set(cal3, -1, -1);
elm_calendar_weekdays_names_set(cal, weekdays);
elm_calendar_interval_set(cal, 0.4);
elm_calendar_format_function_set(cal, _format_month_year);
elm_calendar_min_max_year_set(cal, 2010, 2020);
current_time = time(NULL) + 4 * 84600;
localtime_r(&current_time, &selected_time);
elm_calendar_mark_add(cal, "holiday", &selected_time, ELM_CALENDAR_ANNUALLY);
current_time = time(NULL) + 1 * 84600;
localtime_r(&current_time, &selected_time);
elm_calendar_mark_add(cal, "checked", &selected_time, ELM_CALENDAR_UNIQUE);
current_time = time(NULL) - 363 * 84600;
localtime_r(&current_time, &selected_time);
elm_calendar_mark_add(cal, "checked", &selected_time, ELM_CALENDAR_MONTHLY);
current_time = time(NULL) - 5 * 84600;
localtime_r(&current_time, &selected_time);
mark = elm_calendar_mark_add(cal, "holiday", &selected_time,
ELM_CALENDAR_WEEKLY);
current_time = time(NULL) + 1 * 84600;
localtime_r(&current_time, &selected_time);
elm_calendar_mark_add(cal, "holiday", &selected_time, ELM_CALENDAR_WEEKLY);
elm_calendar_mark_del(mark);
elm_calendar_marks_draw(cal);
_print_cal_info(cal, en);
evas_object_smart_callback_add(cal, "changed", _print_cal_info_cb, en);
}
TEST_END

@ -1,450 +0,0 @@
#include <Elementary.h>
#include <Elementary_Cursor.h>
#include "tsuite.h"
typedef struct _Testitem
{
Elm_Gengrid_Item *item;
const char *path;
int mode;
int onoff;
} Testitem;
static Elm_Gengrid_Item_Class gic;
char *
grd_lbl_get(void *data, Evas_Object *obj __UNUSED__, const char *part __UNUSED__)
{
const Testitem *ti = data;
char buf[256];
snprintf(buf, sizeof(buf), "Photo %s", ti->path);
return strdup(buf);
}
Evas_Object *
grd_content_get(void *data, Evas_Object *obj, const char *part)
{
const Testitem *ti = data;
if (!strcmp(part, "elm.swallow.icon"))
{
Evas_Object *icon = elm_bg_add(obj);
elm_bg_file_set(icon, ti->path, NULL);
evas_object_size_hint_aspect_set(icon, EVAS_ASPECT_CONTROL_VERTICAL,
1, 1);
evas_object_show(icon);
return icon;
}
return NULL;
}
static Elm_Genlist_Item_Class itct;
static void
glt_exp(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info)
{
Elm_Genlist_Item *it = event_info;
Evas_Object *gl = elm_genlist_item_genlist_get(it);
int val = (int)(long)elm_genlist_item_data_get(it);
Elm_Genlist_Item *it1, *it2, *it3;
val *= 10;
it1 = elm_genlist_item_append(gl, &itct, (void *)(long)(val + 1), it,
ELM_GENLIST_ITEM_NONE, NULL, NULL);
it2 = elm_genlist_item_append(gl, &itct, (void *)(long)(val + 2), it,
ELM_GENLIST_ITEM_NONE, NULL, NULL);
it3 = elm_genlist_item_append(gl, &itct, (void *)(long)(val + 3), it,
ELM_GENLIST_ITEM_SUBITEMS, NULL, NULL);
elm_genlist_item_cursor_set(it1, ELM_CURSOR_HAND2);
elm_genlist_item_cursor_set(it2, ELM_CURSOR_HAND2);
elm_genlist_item_cursor_set(it3, ELM_CURSOR_HAND1);
}
static void
glt_con(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info)
{
Elm_Genlist_Item *it = event_info;
elm_genlist_item_subitems_clear(it);
}
static void
glt_exp_req(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info)
{
Elm_Genlist_Item *it = event_info;
elm_genlist_item_expanded_set(it, 1);
}
static void
glt_con_req(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info)
{
Elm_Genlist_Item *it = event_info;
elm_genlist_item_expanded_set(it, 0);
}
char *
glt_text_get(void *data, Evas_Object *obj __UNUSED__, const char *part __UNUSED__)
{
char buf[256];
snprintf(buf, sizeof(buf), "Item mode %i", (int)(long)data);
return strdup(buf);
}
TEST_START(test_cursor)
{
Evas_Object *bg, *bx, *bt, *list, *entry, *ck;
Elm_List_Item *lit;
bg = elm_bg_add(win);
elm_win_resize_object_add(win, bg);
evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_show(bg);
elm_object_cursor_set(bg, ELM_CURSOR_CIRCLE);
bx = elm_box_add(win);
evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_win_resize_object_add(win, bx);
evas_object_show(bx);
ck = elm_clock_add(win);
elm_object_cursor_set(ck, ELM_CURSOR_CLOCK);
elm_box_pack_end(bx, ck);
evas_object_show(ck);
bt = elm_button_add(win);
elm_object_cursor_set(bt, ELM_CURSOR_COFFEE_MUG);
elm_object_text_set(bt, "Coffee Mug");
elm_box_pack_end(bx, bt);
evas_object_show(bt);
bt = elm_button_add(win);
elm_object_cursor_set(bt, ELM_CURSOR_CLOCK);
elm_object_text_set(bt, "Cursor unset");
elm_object_cursor_unset(bt);
elm_box_pack_end(bx, bt);
evas_object_show(bt);
list = elm_list_add(win);
elm_box_pack_end(bx, list);
evas_object_size_hint_weight_set(list, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_fill_set(list, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_object_cursor_set(list, ELM_CURSOR_WATCH);
lit = elm_list_item_append(list, "watch over list | hand1", NULL, NULL, NULL,
NULL);
elm_list_item_cursor_set(lit, ELM_CURSOR_HAND1);
lit = elm_list_item_append(list, "watch over list | hand2", NULL, NULL, NULL,
NULL);
elm_list_item_cursor_set(lit, ELM_CURSOR_HAND2);
elm_list_go(list);
evas_object_show(list);
entry = elm_entry_add(win);
elm_entry_scrollable_set(entry, EINA_TRUE);
elm_entry_entry_set(entry, "Xterm cursor");
elm_entry_single_line_set(entry, EINA_TRUE);
evas_object_size_hint_weight_set(entry, EVAS_HINT_EXPAND, 0);
evas_object_size_hint_fill_set(entry, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_box_pack_end(bx, entry);
evas_object_show(entry);
elm_object_cursor_set(entry, ELM_CURSOR_XTERM);
evas_object_resize(win, 320, 480);
evas_object_show(win);
}
TEST_END
TEST_START(test_cursor2)
{
Evas_Object *bg, *bx, *o, *grid, *gl;
Elm_Genlist_Item *it1, *it2, *it3;
Elm_Object_Item *tb_it;
Elm_List_Item *lit;
char buf[PATH_MAX];
static Testitem ti[144];
int i, n;
const char *img[9] =
{
"panel_01.jpg",
"plant_01.jpg",
"rock_01.jpg",
"rock_02.jpg",
"sky_01.jpg",
"sky_02.jpg",
"sky_03.jpg",
"sky_04.jpg",
"wood_01.jpg",
};
bg = elm_bg_add(win);
elm_win_resize_object_add(win, bg);
evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_show(bg);
bx = elm_box_add(win);
evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_win_resize_object_add(win, bx);
evas_object_show(bx);
o = elm_toolbar_add(win);
elm_toolbar_homogeneous_set(o, 0);
evas_object_size_hint_weight_set(o, 0.0, 0.0);
evas_object_size_hint_align_set(o, EVAS_HINT_FILL, 0.0);
tb_it = elm_toolbar_item_append(o, NULL, "Bogosity", NULL, NULL);
elm_toolbar_item_cursor_set(tb_it, ELM_CURSOR_BOGOSITY);
tb_it = elm_toolbar_item_append(o, NULL, "Unset", NULL, NULL);
elm_toolbar_item_cursor_set(tb_it, ELM_CURSOR_BOGOSITY);
elm_toolbar_item_cursor_unset(tb_it);
tb_it = elm_toolbar_item_append(o, NULL, "Xterm", NULL, NULL);
elm_toolbar_item_cursor_set(tb_it, ELM_CURSOR_XTERM);
elm_box_pack_end(bx, o);
evas_object_show(o);
o = elm_list_add(win);
elm_box_pack_end(bx, o);
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_fill_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
lit = elm_list_item_append(o, "cursor bogosity", NULL, NULL, NULL, NULL);
elm_list_item_cursor_set(lit, ELM_CURSOR_BOGOSITY);
lit = elm_list_item_append(o, "cursor unset", NULL, NULL, NULL, NULL);
elm_list_item_cursor_set(lit, ELM_CURSOR_BOGOSITY);
elm_list_item_cursor_unset(lit);
lit = elm_list_item_append(o, "cursor xterm", NULL, NULL, NULL, NULL);
elm_list_item_cursor_set(lit, ELM_CURSOR_XTERM);
elm_list_go(o);
evas_object_show(o);
gl = elm_genlist_add(win);
evas_object_size_hint_align_set(gl, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_size_hint_weight_set(gl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_show(gl);
itct.item_style = "default";
itct.func.text_get = glt_text_get;
it1 = elm_genlist_item_append(gl, &itct, (void *) 1, NULL,
ELM_GENLIST_ITEM_SUBITEMS, NULL, NULL);
it2 = elm_genlist_item_append(gl, &itct, (void *) 2, NULL,
ELM_GENLIST_ITEM_SUBITEMS, NULL, NULL);
it3 = elm_genlist_item_append(gl, &itct, (void *) 3, NULL,
ELM_GENLIST_ITEM_NONE, NULL, NULL);
elm_genlist_item_cursor_set(it1, ELM_CURSOR_HAND1);
elm_genlist_item_cursor_set(it2, ELM_CURSOR_HAND1);
elm_genlist_item_cursor_set(it3, ELM_CURSOR_CROSS);
evas_object_smart_callback_add(gl, "expand,request", glt_exp_req, gl);
evas_object_smart_callback_add(gl, "contract,request", glt_con_req, gl);
evas_object_smart_callback_add(gl, "expanded", glt_exp, gl);
evas_object_smart_callback_add(gl, "contracted", glt_con, gl);
elm_box_pack_end(bx, gl);
grid = elm_gengrid_add(win);
elm_gengrid_item_size_set(grid, 130, 130);
elm_gengrid_horizontal_set(grid, EINA_FALSE);
elm_gengrid_multi_select_set(grid, EINA_TRUE);
evas_object_size_hint_weight_set(grid, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_fill_set(grid, EVAS_HINT_FILL, EVAS_HINT_FILL);
gic.item_style = "default";
gic.func.text_get = grd_lbl_get;
gic.func.content_get = grd_content_get;
n = 0;
for (i = 0; i < 3 * 3; i++)
{
snprintf(buf, sizeof(buf), "%s/images/%s", elm_app_data_dir_get(), img[n]);
n = (n + 1) % 9;
ti[i].mode = i;
ti[i].path = eina_stringshare_add(buf);
ti[i].item = elm_gengrid_item_append(grid, &gic, &(ti[i]), NULL, NULL);
if (n % 2)
elm_gengrid_item_cursor_set(ti[i].item, ELM_CURSOR_HAND1);
else
elm_gengrid_item_cursor_set(ti[i].item, ELM_CURSOR_CLOCK);
if (!(i % 5))
elm_gengrid_item_selected_set(ti[i].item, EINA_TRUE);
}
elm_box_pack_end(bx, grid);
evas_object_show(grid);
evas_object_resize(win, 320, 480);
evas_object_show(win);
}
TEST_END
TEST_START(test_cursor3)
{
Evas_Object *bg, *bx, *o;
Elm_List_Item *lit;
char buf[PATH_MAX];
snprintf(buf, sizeof(buf), "%s/objects/cursors.edj", elm_app_data_dir_get());
elm_theme_extension_add(NULL, buf);
bg = elm_bg_add(win);
elm_win_resize_object_add(win, bg);
evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_show(bg);
bx = elm_box_add(win);
evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_win_resize_object_add(win, bx);
evas_object_show(bx);
o = elm_button_add(win);
elm_object_cursor_set(o, ELM_CURSOR_HAND1);
elm_object_cursor_engine_only_set(o, EINA_FALSE);
elm_object_text_set(o, "hand1");
elm_box_pack_end(bx, o);
evas_object_show(o);
o = elm_button_add(win);
elm_object_cursor_set(o, ELM_CURSOR_HAND2);
elm_object_text_set(o, "hand2 x");
elm_box_pack_end(bx, o);
evas_object_show(o);
o = elm_button_add(win);
elm_object_cursor_set(o, ELM_CURSOR_HAND2);
elm_object_cursor_engine_only_set(o, EINA_FALSE);
elm_object_text_set(o, "hand2");
elm_box_pack_end(bx, o);
evas_object_show(o);
o = elm_button_add(win);
elm_object_cursor_set(o, "hand3");
elm_object_cursor_engine_only_set(o, EINA_FALSE);
elm_object_text_set(o, "hand3");
elm_box_pack_end(bx, o);
evas_object_show(o);
o = elm_button_add(win);
elm_object_cursor_set(o, "hand3");
elm_object_cursor_engine_only_set(o, EINA_FALSE);
elm_object_cursor_style_set(o, "transparent");
elm_object_text_set(o, "hand3 transparent");
elm_box_pack_end(bx, o);
evas_object_show(o);
o = elm_button_add(win);
elm_object_cursor_set(o, "hand3");
elm_object_cursor_engine_only_set(o, EINA_FALSE);
elm_object_cursor_unset(o);
elm_object_text_set(o, "unset");
elm_box_pack_end(bx, o);
evas_object_show(o);
o = elm_button_add(win);
elm_object_cursor_set(o, "hand4");
elm_object_text_set(o, "not existent");
elm_box_pack_end(bx, o);
evas_object_show(o);
elm_cursor_engine_only_set(0);
o = elm_button_add(win);
elm_object_cursor_set(o, "hand2");
elm_object_text_set(o, "hand 2 engine only config false");
elm_box_pack_end(bx, o);
evas_object_show(o);
elm_cursor_engine_only_set(1);
o = elm_button_add(win);
elm_object_cursor_set(o, "hand2");
elm_object_text_set(o, "hand 2 engine only config true");
elm_box_pack_end(bx, o);
evas_object_show(o);
o = elm_list_add(win);
elm_box_pack_end(bx, o);
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_fill_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
lit = elm_list_item_append(o, "cursor hand2 x", NULL, NULL, NULL, NULL);
elm_list_item_cursor_set(lit, ELM_CURSOR_HAND2);
lit = elm_list_item_append(o, "cursor hand2", NULL, NULL, NULL, NULL);
elm_list_item_cursor_set(lit, ELM_CURSOR_HAND2);
elm_list_item_cursor_engine_only_set(lit, EINA_FALSE);
lit = elm_list_item_append(o, "cursor hand3", NULL, NULL, NULL, NULL);
elm_list_item_cursor_set(lit, "hand3");
elm_list_item_cursor_engine_only_set(lit, EINA_FALSE);
lit = elm_list_item_append(o, "cursor hand3 transparent", NULL, NULL,
NULL, NULL);
elm_list_item_cursor_set(lit, "hand3");
elm_list_item_cursor_style_set(lit, "transparent");
elm_list_item_cursor_engine_only_set(lit, EINA_FALSE);
elm_list_go(o);
evas_object_show(o);
evas_object_resize(win, 320, 480);
evas_object_show(win);
}
TEST_END
TEST_START(test_cursor4)
{
Evas_Object *win, *bg, *bx, *ly, *bt;
char buf[PATH_MAX];
win = elm_win_add(NULL, "cursor layout", ELM_WIN_BASIC);
elm_win_title_set(win, "Cursor Layout");
elm_win_autodel_set(win, EINA_TRUE);
snprintf(buf, sizeof(buf), "%s/objects/cursors.edj", elm_app_data_dir_get());
bg = elm_bg_add(win);
elm_win_resize_object_add(win, bg);
evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_show(bg);
bx = elm_box_add(win);
evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_win_resize_object_add(win, bx);
evas_object_show(bx);
ly = elm_layout_add(win);
elm_layout_file_set(ly, buf, "test/layout/events");
evas_object_size_hint_weight_set(ly, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(ly, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_object_cursor_set(ly, ELM_CURSOR_HAND1);
elm_box_pack_end(bx, ly);
evas_object_show(ly);
ly = elm_layout_add(win);
elm_layout_file_set(ly, buf, "test/layout/noevents");
evas_object_size_hint_weight_set(ly, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(ly, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_object_cursor_set(ly, ELM_CURSOR_XTERM);
elm_layout_part_cursor_set(ly, "top-left", ELM_CURSOR_CROSS);
elm_layout_part_cursor_set(ly, "bottom-left", ELM_CURSOR_PIRATE);
elm_box_pack_end(bx, ly);
evas_object_show(ly);
ly = elm_layout_add(win);
elm_layout_file_set(ly, buf, "test/layout/parts2");
evas_object_size_hint_weight_set(ly, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(ly, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_layout_part_cursor_set(ly, "top-left", ELM_CURSOR_CROSS);
elm_layout_part_cursor_set(ly, "bottom-left", ELM_CURSOR_PIRATE);
elm_layout_file_set(ly, buf, "test/layout/parts");
elm_box_pack_end(bx, ly);
evas_object_show(ly);
ly = elm_layout_add(win);
evas_object_size_hint_weight_set(ly, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(ly, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_layout_file_set(ly, buf, "test/layout/swallow");
bt = elm_button_add(win);
elm_object_text_set(bt, "Cursor over obj");
elm_object_part_content_set(ly, "swallow1", bt);
elm_object_cursor_set(bt, ELM_CURSOR_PIRATE);
bt = elm_button_add(win);
elm_object_text_set(bt, "Cursor over part");
elm_object_part_content_set(ly, "swallow2", bt);
elm_layout_part_cursor_set(ly, "swallow2", ELM_CURSOR_PIRATE);
elm_box_pack_end(bx, ly);
evas_object_show(ly);
evas_object_resize(win, 320, 480);
evas_object_show(win);
}
TEST_END

@ -1,102 +0,0 @@
#include <Elementary.h>
#include "tsuite.h"
typedef struct _Testitem
{
Elm_Genlist_Item *item;
int mode;
int onoff;
} Testitem;
static Elm_Genlist_Item_Class itc1;
static char *glf_text_get(void *data, Evas_Object *obj __UNUSED__, const char *part __UNUSED__)
{
char buf[256];
snprintf(buf, sizeof(buf), "Item # %i", (int)(long)data);
return strdup(buf);
}
static Evas_Object *glf_content_get(void *data __UNUSED__, Evas_Object *obj, const char *part __UNUSED__)
{
char buf[PATH_MAX];
Evas_Object *ic = elm_icon_add(obj);
snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
elm_icon_file_set(ic, buf, NULL);
evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
return ic;
}
static Eina_Bool glf_state_get(void *data __UNUSED__, Evas_Object *obj __UNUSED__, const char *part __UNUSED__)
{
return EINA_FALSE;
}
static void glf_del(void *data __UNUSED__, Evas_Object *obj __UNUSED__)
{
}
static void
gl_sel(void *data, Evas_Object *obj, void *event_info)
{
printf("sel item data [%p] on genlist obj [%p], item pointer [%p]\n", data, obj, event_info);
}
static Eina_Bool
anim(void *data)
{
Evas_Object *gl = data;
Evas_Coord x, y;
y = 0;
x = (sin(ecore_loop_time_get()) * 500);
evas_object_move(gl, x, y);
return ECORE_CALLBACK_RENEW;
}
static void
_del(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
Ecore_Animator *ani = data;
ecore_animator_del(ani);
}
TEST_START(test_floating)
{
Evas_Object *bg, *gl;
int i;
Ecore_Animator *ani;
bg = elm_bg_add(win);
elm_win_resize_object_add(win, bg);
evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_show(bg);
gl = elm_genlist_add(win);
evas_object_size_hint_weight_set(gl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(gl, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_move(gl, 800, 0);
evas_object_resize(gl, 480, 800);
evas_object_show(gl);
itc1.item_style = "default";
itc1.func.text_get = glf_text_get;
itc1.func.content_get = glf_content_get;
itc1.func.state_get = glf_state_get;
itc1.func.del = glf_del;
for (i = 0; i < 20; i++)
{
elm_genlist_item_append(gl, &itc1,
(void *)(long)i/* item data */,
NULL/* parent */,
ELM_GENLIST_ITEM_NONE,
gl_sel/* func */,
(void *)(long)(i * 10)/* func data */);
}
evas_object_resize(win, 480, 800);
evas_object_show(win);
ani = ecore_animator_add(anim, gl);
evas_object_event_callback_add(win, EVAS_CALLBACK_DEL, _del, ani);
}
TEST_END

@ -1,148 +0,0 @@
#include <Elementary.h>
#include "tsuite.h"
static void
_focus_in(void *data __UNUSED__, Evas *e __UNUSED__, void *event_info)
{
const char *type = evas_object_type_get(event_info);
if ((type) && (!strcmp(type, "elm_widget")))
type = elm_object_widget_type_get(event_info);
printf("Evas_Object focus in: %p %s\n", event_info, type);
}
static void
_focus_out(void *data __UNUSED__, Evas *e __UNUSED__, void *event_info)
{
const char *type = evas_object_type_get(event_info);
if ((type) && (!strcmp(type, "elm_widget")))
type = elm_object_widget_type_get(event_info);
printf("Evas_Object focus out: %p %s\n", event_info, type);
}
static void
_focus_obj(void *data, Evas_Object *o __UNUSED__, void *event_info __UNUSED__)
{
Evas_Object *newfocus = data;
const char *type = evas_object_type_get(newfocus);
if ((type) && (!strcmp(type, "elm_widget")))
type = elm_object_widget_type_get(newfocus);
printf("elm_object_focus_set(%p, EINA_TRUE) %s\n", newfocus, type);
elm_object_focus_set(newfocus, EINA_TRUE);
}
static void
_focus_layout_part(void *data, Evas_Object *o __UNUSED__, void *event_info __UNUSED__)
{
Evas_Object *ed = elm_layout_edje_get(data);
Evas_Object *newfocus = (Evas_Object *)edje_object_part_object_get(ed, "sky");
const char *type = evas_object_type_get(newfocus);
printf("evas_object_focus_set(%p, 1) %s\n", newfocus, type);
evas_object_focus_set(newfocus, EINA_TRUE);;
}
TEST_START(test_focus2)
{
Evas_Object *bg, *bx, *ly, *bt, *en, *bt1;
char buf[PATH_MAX];
elm_win_focus_highlight_enabled_set(win, EINA_TRUE);
evas_event_callback_add
(evas_object_evas_get(win), EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN,
_focus_in, NULL);
evas_event_callback_add
(evas_object_evas_get(win), EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_OUT,
_focus_out, NULL);
bg = elm_bg_add(win);
elm_win_resize_object_add(win, bg);
evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_show(bg);
bx = elm_box_add(win);
elm_win_resize_object_add(win, bx);
evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_show(bx);
#define PARENT bx /* this is broken, but should work */
//#define PARENT win
en = elm_entry_add(PARENT);
elm_entry_scrollable_set(en, EINA_TRUE);
evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, 0.0);
evas_object_size_hint_align_set(en, EVAS_HINT_FILL, 0.5);
elm_entry_scrollbar_policy_set(en, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
elm_entry_entry_set(en, "Scrolled Entry that should get focus");
elm_entry_single_line_set(en, 1);
evas_object_show(en);
elm_box_pack_end(bx, en);
bt = elm_button_add(PARENT);
elm_object_text_set(bt, "Give focus to scrolled entry");
evas_object_smart_callback_add(bt, "clicked", _focus_obj, en);
elm_box_pack_end(bx, bt);
evas_object_show(bt);
ly = elm_layout_add(PARENT);
snprintf(buf, sizeof(buf), "%s/objects/test.edj", elm_app_data_dir_get());
elm_layout_file_set(ly, buf, "layout");
evas_object_size_hint_weight_set(ly, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_box_pack_end(bx, ly);
evas_object_show(ly);
bt1 = bt = elm_button_add(ly);
elm_object_text_set(bt, "Button 1");
elm_object_part_content_set(ly, "element1", bt);
en = elm_entry_add(ly);
elm_entry_scrollable_set(en, EINA_TRUE);
evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, 0.0);
evas_object_size_hint_align_set(en, EVAS_HINT_FILL, 0.5);
elm_entry_scrollbar_policy_set(en, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
elm_entry_entry_set(en, "Scrolled Entry that should get focus");
elm_entry_single_line_set(en, 1);
elm_object_part_content_set(ly, "element2", en);
bt = elm_button_add(ly);
elm_object_text_set(bt, "Button 2");
elm_object_part_content_set(ly, "element3", bt);
bt = elm_button_add(PARENT);
elm_object_text_set(bt, "Give focus to layout");
evas_object_smart_callback_add(bt, "clicked", _focus_obj, ly);
evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, 0.0);
evas_object_size_hint_align_set(en, EVAS_HINT_FILL, 0.5);
elm_box_pack_end(bx, bt);
evas_object_show(bt);
bt = elm_button_add(PARENT);
elm_object_text_set(bt, "Give focus to layout part");
evas_object_smart_callback_add(bt, "clicked", _focus_layout_part, ly);
evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, 0.0);
evas_object_size_hint_align_set(en, EVAS_HINT_FILL, 0.5);
elm_box_pack_end(bx, bt);
evas_object_show(bt);
bt = elm_button_add(PARENT);
elm_object_text_set(bt, "Give focus to layout 'Button 1'");
evas_object_smart_callback_add(bt, "clicked", _focus_obj, bt1);
evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, 0.0);
evas_object_size_hint_align_set(en, EVAS_HINT_FILL, 0.5);
elm_box_pack_end(bx, bt);
evas_object_show(bt);
bt = elm_button_add(PARENT);
elm_object_text_set(bt, "Give focus to layout 'Entry'");
evas_object_smart_callback_add(bt, "clicked", _focus_obj, en);
evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, 0.0);
evas_object_size_hint_align_set(en, EVAS_HINT_FILL, 0.5);
elm_box_pack_end(bx, bt);
evas_object_show(bt);
evas_object_resize(win, 400, 400);
evas_object_show(win);
}
TEST_END

@ -1,107 +0,0 @@
/* Test for Focus Chain Linear*/
#include <Elementary.h>
#include "tsuite.h"
static Evas_Object *foc = NULL;
static void
_foc(void *data __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
{
foc = obj;
printf("foc -> %p\n", foc);
}
static void
_unfoc(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
foc = NULL;
printf("foc -> %p\n", foc);
}
static void
_add(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
Evas_Object *bx = data, *en;
en = elm_entry_add(elm_object_top_widget_get(bx));
elm_entry_scrollable_set(en, EINA_TRUE);
elm_entry_entry_set(en, "An entry");
evas_object_smart_callback_add(en, "focused", _foc, NULL);
evas_object_smart_callback_add(en, "unfocused", _unfoc, NULL);
evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, 0.0);
evas_object_size_hint_align_set(en, EVAS_HINT_FILL, 0.5);
elm_entry_single_line_set(en, 1);
elm_box_pack_start(bx, en);
evas_object_show(en);
}
static void
_del(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
if (foc) evas_object_del(foc);
}
static void
_hide(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
if (foc) evas_object_hide(foc);
}
TEST_START(test_focus3)
{
Evas_Object *bg, *bx, *bt, *en;
elm_win_focus_highlight_enabled_set(win, EINA_TRUE);
evas_object_resize(win, 320, 480);
bg = elm_bg_add(win);
elm_win_resize_object_add(win, bg);
evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_show(bg);
bx = elm_box_add(win);
evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_win_resize_object_add(win, bx);
evas_object_show(bx);
en = elm_entry_add(win);
elm_entry_scrollable_set(en, EINA_TRUE);
elm_entry_entry_set(en, "An entry");
evas_object_smart_callback_add(en, "focused", _foc, NULL);
evas_object_smart_callback_add(en, "unfocused", _unfoc, NULL);
evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, 0.0);
evas_object_size_hint_align_set(en, EVAS_HINT_FILL, 0.5);
elm_entry_single_line_set(en, 1);
elm_box_pack_end(bx, en);
evas_object_show(en);
bt = elm_button_add(win);
elm_object_focus_allow_set(bt, 0);
elm_object_text_set(bt, "Add");
evas_object_smart_callback_add(bt, "clicked", _add, bx);
evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, 0.5);
elm_box_pack_end(bx, bt);
evas_object_show(bt);
bt = elm_button_add(win);
elm_object_focus_allow_set(bt, 0);
elm_object_text_set(bt, "Del");
evas_object_smart_callback_add(bt, "clicked", _del, NULL);
evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, 0.5);
elm_box_pack_end(bx, bt);
evas_object_show(bt);
bt = elm_button_add(win);
elm_object_focus_allow_set(bt, 0);
elm_object_text_set(bt, "Hide");
evas_object_smart_callback_add(bt, "clicked", _hide, NULL);
evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, 0.5);
elm_box_pack_end(bx, bt);
evas_object_show(bt);
evas_object_show(win);
}
TEST_END

@ -1,100 +0,0 @@
#include <Elementary.h>
#include "tsuite.h"
static void drop_cb(void *mydata, Evas_Object *obj, void *evdata);
static void drag_stop_cb(void *mydata, Evas_Object *obj, void *evdata);
static void drag_start_cb(void *mydata, Evas_Object *obj, void *evdata);
TEST_START(test_photo)
{
Evas_Object *bg, *sc, *tb, *ph;
int i, j, n;
char buf[PATH_MAX];
const char *img[9] =
{
"panel_01.jpg",
"mystrale.jpg",
"mystrale_2.jpg",
"rock_02.jpg",
"sky_01.jpg",
"sky_02.jpg",
"sky_03.jpg",
"sky_04.jpg",
"wood_01.jpg"
};
elm_need_ethumb();
bg = elm_bg_add(win);
evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_win_resize_object_add(win, bg);
evas_object_show(bg);
tb = elm_table_add(win);
evas_object_size_hint_weight_set(tb, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
n = 0;
for (j = 0; j < 12; j++)
{
for (i = 0; i < 12; i++)
{
ph = elm_photo_add(win);
snprintf(buf, sizeof(buf), "%s/images/%s",
elm_app_data_dir_get(), img[n]);
n++;
if (n >= 9) n = 0;
elm_photo_size_set(ph, 80);
if (n == 8)
elm_photo_thumb_set(ph, buf, NULL);
else
elm_photo_file_set(ph, buf);
elm_photo_editable_set(ph, 1);
evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND,
EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(ph, EVAS_HINT_FILL,
EVAS_HINT_FILL);
evas_object_smart_callback_add(ph, "drop",
drop_cb, NULL);
evas_object_smart_callback_add(ph, "drag,start",
drag_start_cb, NULL);
evas_object_smart_callback_add(ph, "drag,stop",
drag_stop_cb, NULL);
if ((n == 2) || (n == 3))
{
elm_photo_fill_inside_set(ph, EINA_TRUE);
elm_object_style_set(ph, "shadow");
}
elm_table_pack(tb, ph, i, j, 1, 1);
evas_object_show(ph);
}
}
sc = elm_scroller_add(win);
evas_object_size_hint_weight_set(sc, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_win_resize_object_add(win, sc);
elm_object_content_set(sc, tb);
evas_object_show(tb);
evas_object_show(sc);
evas_object_resize(win, 300, 300);
evas_object_show(win);
}
TEST_END
/* Never called, elm_photo never call "drop" smart cb */
static void
drop_cb(void *mydata __UNUSED__, Evas_Object *obj, void *evdata __UNUSED__){
printf("Drop on obj %p\n", obj);
}
static void
drag_start_cb(void *mydata __UNUSED__, Evas_Object *obj __UNUSED__, void *evdata __UNUSED__){
}
static void
drag_stop_cb(void *mydata __UNUSED__, Evas_Object *obj __UNUSED__, void *evdata __UNUSED__){
}
/* vim:set ts=8 sw=3 sts=3 expandtab cino=>5n-2f0^-2{2(0W1st0 :*/

@ -1,333 +0,0 @@
#include <Elementary.h>
#include "tsuite.h"
static Evas_Object *rect;
static void
my_ph_clicked(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
printf("clicked\n");
}
static void
my_ph_press(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
printf("press\n");
}
static void
my_ph_longpressed(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
printf("longpressed\n");
}
static void
my_ph_clicked_double(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
printf("clicked,double\n");
}
static void
my_ph_load(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
printf("load\n");
}
static void
my_ph_loaded(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
printf("loaded\n");
}
static void
my_ph_load_details(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
printf("load,details\n");
}
static void
my_ph_loaded_details(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
printf("loaded,details\n");
}
static void
my_ph_zoom_start(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
printf("zoom,start\n");
}
static void
my_ph_zoom_stop(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
printf("zoom,stop\n");
}
static void
my_ph_zoom_change(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
printf("zoom,change\n");
}
static void
my_ph_anim_start(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
printf("anim,start\n");
}
static void
my_ph_anim_stop(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
printf("anim,stop\n");
}
static void
my_ph_drag_start(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
printf("drag,start\n");
}
static void
my_ph_drag_stop(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
printf("drag_stop\n");
}
static void
my_ph_scroll(void *data __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
{
int x, y, w, h;
elm_photocam_region_get(obj, &x, &y, &w, &h);
printf("scroll %i %i %ix%i\n", x, y, w, h);
}
static void
my_bt_open(void *data, Evas_Object *obj __UNUSED__, void *event_info)
{
Evas_Object *ph = data;
const char *file = event_info;
if (file)
elm_photocam_file_set(ph, file);
}
static void
my_bt_show_reg(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
elm_photocam_image_region_show(data, 30, 50, 500, 300);
}
static void
my_bt_bring_reg(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
elm_photocam_image_region_bring_in(data, 800, 300, 500, 300);
}
static void
my_bt_zoom_in(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
double zoom;
zoom = elm_photocam_zoom_get(data);
zoom -= 0.5;
elm_photocam_zoom_mode_set(data, ELM_PHOTOCAM_ZOOM_MODE_MANUAL);
if (zoom >= (1.0 / 32.0)) elm_photocam_zoom_set(data, zoom);
}
static void
my_bt_zoom_out(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
double zoom;
zoom = elm_photocam_zoom_get(data);
zoom += 0.5;
elm_photocam_zoom_mode_set(data, ELM_PHOTOCAM_ZOOM_MODE_MANUAL);
if (zoom <= 256.0) elm_photocam_zoom_set(data, zoom);
}
static void
my_bt_pause(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
elm_photocam_paused_set(data, !elm_photocam_paused_get(data));
}
static void
my_bt_zoom_fit(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
elm_photocam_zoom_mode_set(data, ELM_PHOTOCAM_ZOOM_MODE_AUTO_FIT);
}
static void
my_bt_zoom_fill(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
elm_photocam_zoom_mode_set(data, ELM_PHOTOCAM_ZOOM_MODE_AUTO_FILL);
}
static void
_photocam_mouse_wheel_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info)
{
Evas_Object *photocam = data;
Evas_Event_Mouse_Wheel *ev = (Evas_Event_Mouse_Wheel*) event_info;
int zoom;
double val;
//unset the mouse wheel
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
zoom = elm_photocam_zoom_get(photocam);
if ((ev->z>0) && (zoom == 1)) return;
if (ev->z > 0)
zoom /= 2;
else
zoom *= 2;
val = 1;
int _zoom = zoom;
while(_zoom>1)
{
_zoom /= 2;
val++;
}
elm_photocam_zoom_mode_set(photocam, ELM_PHOTOCAM_ZOOM_MODE_MANUAL);
if (zoom >= 1) elm_photocam_zoom_set(photocam, zoom);
}
static void
_photocam_move_resize_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
int x,y,w,h;
evas_object_geometry_get(data,&x,&y,&w,&h);
evas_object_resize(rect,w,h);
evas_object_move(rect,x,y);
}
TEST_START(test_photocam)
{
Evas_Object *bg, *ph, *tb2, *bt;
// these were just testing - use the "select photo" browser to select one
const char *img[5] =
{
"/home/raster/t1.jpg", // 5 mpixel
"/home/raster/t2.jpg", // 18 mpixel
"/home/raster/t3.jpg", // 39 mpixel
"/home/raster/t4.jpg", // 192 mpixel
"/home/raster/t5.jpg" // 466 mpixel
};
bg = elm_bg_add(win);
evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_win_resize_object_add(win, bg);
evas_object_show(bg);
ph = elm_photocam_add(win);
evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_win_resize_object_add(win, ph);
evas_object_data_set(ph, "window", win);
rect = evas_object_rectangle_add(evas_object_evas_get(win));