aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin/elementary/test_photocam.c
diff options
context:
space:
mode:
authorAmitesh Singh <amitesh.sh@samsung.com>2017-06-02 10:45:25 +0900
committerAmitesh Singh <amitesh.sh@samsung.com>2017-06-02 18:32:09 +0900
commitbd1ee1b08398cc12a41838d12a4f6f70995a36d2 (patch)
tree9c37337a97cb5fbbf68d6ccc622a2412ca076a9f /src/bin/elementary/test_photocam.c
parentpopup: fix object_mirrored_set didn't work (diff)
downloadefl-bd1ee1b08398cc12a41838d12a4f6f70995a36d2.tar.gz
Efl.Ui.Image.Zoomable: implement Ui.Image.icon property
@feature
Diffstat (limited to 'src/bin/elementary/test_photocam.c')
-rw-r--r--src/bin/elementary/test_photocam.c117
1 files changed, 117 insertions, 0 deletions
diff --git a/src/bin/elementary/test_photocam.c b/src/bin/elementary/test_photocam.c
index be6a1724b1..df586dabcf 100644
--- a/src/bin/elementary/test_photocam.c
+++ b/src/bin/elementary/test_photocam.c
@@ -614,3 +614,120 @@ test_photocam_remote(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void
evas_object_resize(win, 800, 800);
evas_object_show(win);
}
+
+static const struct {
+ unsigned char val;
+ const char *name;
+} photocam_icons[] = {
+ {0, "home"},
+ {1, "folder"},
+ {2, "network-server"},
+ {3, "folder-music"},
+ {4, "user-trash"},
+ {5, "start-here"},
+ {6, "folder-download"},
+ {7, "emblem-system"},
+ {8, "emblem-mail"},
+ {9, "None"},
+ {0, NULL}
+};
+
+static void
+_radio_changed_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
+{
+ unsigned char index = efl_ui_radio_value_get(obj);
+ efl_ui_image_icon_set(data, photocam_icons[index].name);
+ printf("icon is %s\n", efl_ui_image_icon_get(data));
+}
+
+void
+test_photocam_icon(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
+{
+ Evas_Object *win, *ph, *tb2, *bt, *bx, *rd;
+ Evas_Object *rdg = NULL;
+ Evas_Object *rect = NULL;
+ int i;
+
+ win = elm_win_util_standard_add("photocam", "PhotoCam");
+ elm_win_autodel_set(win, EINA_TRUE);
+
+ ph = elm_photocam_add(win);
+ evas_object_size_hint_weight_set(ph, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ efl_ui_image_icon_set(ph, "home");
+ elm_win_resize_object_add(win, ph);
+
+ rect = evas_object_rectangle_add(evas_object_evas_get(win));
+ evas_object_color_set(rect, 0, 0, 0, 0);
+ evas_object_repeat_events_set(rect, EINA_TRUE);
+ evas_object_show(rect);
+ evas_object_event_callback_add(rect, EVAS_CALLBACK_MOUSE_WHEEL, _photocam_mouse_wheel_cb, ph);
+ evas_object_raise(rect);
+
+ evas_object_event_callback_add(ph, EVAS_CALLBACK_RESIZE, _photocam_move_resize_cb, rect);
+ evas_object_event_callback_add(ph, EVAS_CALLBACK_MOVE, _photocam_move_resize_cb, rect);
+
+ evas_object_smart_callback_add(ph, "clicked", my_ph_clicked, win);
+ evas_object_smart_callback_add(ph, "press", my_ph_press, win);
+ evas_object_smart_callback_add(ph, "longpressed", my_ph_longpressed, win);
+ evas_object_smart_callback_add(ph, "clicked,double", my_ph_clicked_double, win);
+ evas_object_smart_callback_add(ph, "load", my_ph_load, win);
+ evas_object_smart_callback_add(ph, "loaded", my_ph_loaded, win);
+ evas_object_smart_callback_add(ph, "load,details", my_ph_load_details, win);
+ evas_object_smart_callback_add(ph, "loaded,details", my_ph_loaded_details, win);
+ evas_object_smart_callback_add(ph, "zoom,start", my_ph_zoom_start, win);
+ evas_object_smart_callback_add(ph, "zoom,stop", my_ph_zoom_stop, win);
+ evas_object_smart_callback_add(ph, "zoom,change", my_ph_zoom_change, win);
+ evas_object_smart_callback_add(ph, "scroll,anim,start", my_ph_anim_start, win);
+ evas_object_smart_callback_add(ph, "scroll,anim,stop", my_ph_anim_stop, win);
+ evas_object_smart_callback_add(ph, "scroll,drag,start", my_ph_drag_start, win);
+ evas_object_smart_callback_add(ph, "scroll,drag,stop", my_ph_drag_stop, win);
+ evas_object_smart_callback_add(ph, "scroll", my_ph_scroll, win);
+
+ evas_object_show(ph);
+
+ tb2 = elm_table_add(win);
+ evas_object_size_hint_weight_set(tb2, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ elm_win_resize_object_add(win, tb2);
+
+ bt = elm_button_add(win);
+ elm_object_text_set(bt, "Z -");
+ evas_object_smart_callback_add(bt, "clicked", my_bt_zoom_out, ph);
+ evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(bt, 0.1, 0.1);
+ elm_table_pack(tb2, bt, 0, 0, 1, 1);
+ evas_object_show(bt);
+
+ bt = elm_button_add(win);
+ elm_object_text_set(bt, "Z +");
+ evas_object_smart_callback_add(bt, "clicked", my_bt_zoom_in, ph);
+ evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(bt, 0.9, 0.1);
+ elm_table_pack(tb2, bt, 2, 0, 1, 1);
+ evas_object_show(bt);
+
+ evas_object_show(tb2);
+
+ bx = elm_box_add(win);
+ evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ elm_box_horizontal_set(bx, EINA_TRUE);
+ elm_table_pack(tb2, bx, 1, 2, 1, 1);
+ evas_object_show(bx);
+
+ for (i = 0; photocam_icons[i].name; ++i)
+ {
+ rd = elm_radio_add(win);
+ evas_object_size_hint_weight_set(rd, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ elm_object_text_set(rd, photocam_icons[i].name);
+ efl_ui_radio_state_value_set(rd, photocam_icons[i].val);
+ elm_box_pack_end(bx, rd);
+ evas_object_smart_callback_add(rd, "changed", _radio_changed_cb, ph);
+ if(!rdg)
+ rdg = rd;
+ else
+ elm_radio_group_add(rd, rdg);
+ evas_object_show(rd);
+ }
+
+ evas_object_resize(win, 150, 150);
+ evas_object_show(win);
+}