aboutsummaryrefslogtreecommitdiffstats
path: root/legacy/elementary/src/bin/test_photocam.c
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2009-09-23 08:19:03 +0000
committerCarsten Haitzler <raster@rasterman.com>2009-09-23 08:19:03 +0000
commit08dffc73e49c4548b7f11f7516075be28d693cc5 (patch)
treeda3dae16df52f8aed049723b07601914a691992d /legacy/elementary/src/bin/test_photocam.c
parentfix genlist tree insert bug. (actually not treee bug - general one) (diff)
downloadefl-08dffc73e49c4548b7f11f7516075be28d693cc5.tar.gz
some zooming working dynamically
SVN revision: 42642
Diffstat (limited to 'legacy/elementary/src/bin/test_photocam.c')
-rw-r--r--legacy/elementary/src/bin/test_photocam.c48
1 files changed, 46 insertions, 2 deletions
diff --git a/legacy/elementary/src/bin/test_photocam.c b/legacy/elementary/src/bin/test_photocam.c
index 811a77a437..91f6b70154 100644
--- a/legacy/elementary/src/bin/test_photocam.c
+++ b/legacy/elementary/src/bin/test_photocam.c
@@ -1,9 +1,31 @@
#include <Elementary.h>
#ifndef ELM_LIB_QUICKLAUNCH
void
+my_bt_zoom_in(void *data, Evas_Object *obj, void *event_info)
+{
+ int zoom;
+
+ zoom = elm_photocam_zoom_get(data);
+ zoom /= 2;
+ elm_photocam_zoom_mode_set(data, ELM_PHOTOCAM_ZOOM_MODE_MANUAL);
+ if (zoom >= 1) elm_photocam_zoom_set(data, zoom);
+}
+
+void
+my_bt_zoom_out(void *data, Evas_Object *obj, void *event_info)
+{
+ int zoom;
+
+ zoom = elm_photocam_zoom_get(data);
+ zoom *= 2;
+ elm_photocam_zoom_mode_set(data, ELM_PHOTOCAM_ZOOM_MODE_MANUAL);
+ if (zoom <= 32) elm_photocam_zoom_set(data, zoom);
+}
+
+void
test_photocam(void *data, Evas_Object *obj, void *event_info)
{
- Evas_Object *win, *bg, *ph;
+ Evas_Object *win, *bg, *ph, *tb2, *bt;
char buf[PATH_MAX];
const char *img[4] =
{
@@ -26,10 +48,32 @@ test_photocam(void *data, Evas_Object *obj, void *event_info)
evas_object_size_hint_weight_set(ph, 1.0, 1.0);
elm_win_resize_object_add(win, ph);
- elm_photocam_file_set(ph, img[1]);
+ elm_photocam_file_set(ph, img[2]);
evas_object_show(ph);
+ tb2 = elm_table_add(win);
+ evas_object_size_hint_weight_set(tb2, 1.0, 1.0);
+ elm_win_resize_object_add(win, tb2);
+
+ bt = elm_button_add(win);
+ elm_button_label_set(bt, "Z -");
+ evas_object_smart_callback_add(bt, "clicked", my_bt_zoom_out, ph);
+ evas_object_size_hint_weight_set(bt, 1.0, 1.0);
+ 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_button_label_set(bt, "Z +");
+ evas_object_smart_callback_add(bt, "clicked", my_bt_zoom_in, ph);
+ evas_object_size_hint_weight_set(bt, 1.0, 1.0);
+ evas_object_size_hint_align_set(bt, 0.9, 0.1);
+ elm_table_pack(tb2, bt, 0, 0, 1, 1);
+ evas_object_show(bt);
+
+ evas_object_show(tb2);
+
evas_object_resize(win, 800, 800);
evas_object_show(win);
}