annoyances--: comment rotation/flip as it was broken.

Raster had his word "it is broken that way, either fix it or remove"
and thus removed it is as fixing it properly takes much more time than
I have now.



SVN revision: 54056
This commit is contained in:
Gustavo Sverzut Barbieri 2010-10-31 02:04:36 +00:00
parent d113da0a6c
commit 9d02b17892
1 changed files with 22 additions and 0 deletions

View File

@ -4,6 +4,12 @@
#include <libexif/exif-data.h> #include <libexif/exif-data.h>
#endif #endif
/* ROTATION is disabled until we do it properly, and properly means
* elm_photocam and elm_image rotates their images internally.
* Rotating the scroller is not correct and was rejected by Raster and others.
*/
//#define ROTATION
#define ZOOM_MIN 0.1 #define ZOOM_MIN 0.1
#define ZOOM_MAX 10.0 #define ZOOM_MAX 10.0
#define ZOOM_STEP 0.2 #define ZOOM_STEP 0.2
@ -28,10 +34,12 @@ struct _Ephoto_Flow_Browser
Elm_Toolbar_Item *go_prev; Elm_Toolbar_Item *go_prev;
Elm_Toolbar_Item *go_next; Elm_Toolbar_Item *go_next;
Elm_Toolbar_Item *go_last; Elm_Toolbar_Item *go_last;
#ifdef ROTATION
Elm_Toolbar_Item *rotate_counterclock; Elm_Toolbar_Item *rotate_counterclock;
Elm_Toolbar_Item *rotate_clock; Elm_Toolbar_Item *rotate_clock;
Elm_Toolbar_Item *flip_horiz; Elm_Toolbar_Item *flip_horiz;
Elm_Toolbar_Item *flip_vert; Elm_Toolbar_Item *flip_vert;
#endif
Elm_Toolbar_Item *slideshow; Elm_Toolbar_Item *slideshow;
} action; } action;
const char *path; const char *path;
@ -141,6 +149,7 @@ _viewer_zoom_set(Evas_Object *obj, float zoom)
static void static void
_orient_apply(Ephoto_Flow_Browser *fb) _orient_apply(Ephoto_Flow_Browser *fb)
{ {
#ifdef ROTATION
const char *sig; const char *sig;
switch (fb->orient) switch (fb->orient)
{ {
@ -173,8 +182,12 @@ _orient_apply(Ephoto_Flow_Browser *fb)
} }
DBG("orient: %d, signal '%s'", fb->orient, sig); DBG("orient: %d, signal '%s'", fb->orient, sig);
edje_object_signal_emit(fb->orient_edje, sig, "ephoto"); edje_object_signal_emit(fb->orient_edje, sig, "ephoto");
#else
(void)fb;
#endif
} }
#ifdef ROTATION
static void static void
_rotate_counterclock(Ephoto_Flow_Browser *fb) _rotate_counterclock(Ephoto_Flow_Browser *fb)
{ {
@ -306,6 +319,7 @@ _flip_vert(Ephoto_Flow_Browser *fb)
} }
_orient_apply(fb); _orient_apply(fb);
} }
#endif
static void static void
_mouse_wheel(void *data, Evas *e __UNUSED__, Evas_Object *o __UNUSED__, void *event_info) _mouse_wheel(void *data, Evas *e __UNUSED__, Evas_Object *o __UNUSED__, void *event_info)
@ -553,6 +567,7 @@ _go_last(void *data, Evas_Object *o __UNUSED__, void *event_info __UNUSED__)
_last_entry(fb); _last_entry(fb);
} }
#ifdef ROTATION
static void static void
_go_rotate_counterclock(void *data, Evas_Object *o __UNUSED__, void *event_info __UNUSED__) _go_rotate_counterclock(void *data, Evas_Object *o __UNUSED__, void *event_info __UNUSED__)
{ {
@ -584,6 +599,7 @@ _go_flip_vert(void *data, Evas_Object *o __UNUSED__, void *event_info __UNUSED__
elm_toolbar_item_selected_set(fb->action.flip_vert, EINA_FALSE); elm_toolbar_item_selected_set(fb->action.flip_vert, EINA_FALSE);
_flip_vert(fb); _flip_vert(fb);
} }
#endif
static void static void
_slideshow(void *data, Evas_Object *o __UNUSED__, void *event_info __UNUSED__) _slideshow(void *data, Evas_Object *o __UNUSED__, void *event_info __UNUSED__)
@ -607,7 +623,9 @@ _key_down(void *data, Evas *e __UNUSED__, Evas_Object *o __UNUSED__, void *event
Ephoto_Flow_Browser *fb = data; Ephoto_Flow_Browser *fb = data;
Evas_Event_Key_Down *ev = event_info; Evas_Event_Key_Down *ev = event_info;
Eina_Bool ctrl = evas_key_modifier_is_set(ev->modifiers, "Control"); Eina_Bool ctrl = evas_key_modifier_is_set(ev->modifiers, "Control");
#ifdef ROTATION
Eina_Bool shift = evas_key_modifier_is_set(ev->modifiers, "Shift"); Eina_Bool shift = evas_key_modifier_is_set(ev->modifiers, "Shift");
#endif
const char *k = ev->keyname; const char *k = ev->keyname;
if (ctrl) if (ctrl)
@ -632,6 +650,7 @@ _key_down(void *data, Evas *e __UNUSED__, Evas_Object *o __UNUSED__, void *event
_first_entry(fb); _first_entry(fb);
else if (!strcmp(k, "End")) else if (!strcmp(k, "End"))
_last_entry(fb); _last_entry(fb);
#if ROTATION
else if (!strcmp(k, "bracketleft")) else if (!strcmp(k, "bracketleft"))
{ {
if (!shift) _rotate_counterclock(fb); if (!shift) _rotate_counterclock(fb);
@ -642,6 +661,7 @@ _key_down(void *data, Evas *e __UNUSED__, Evas_Object *o __UNUSED__, void *event
if (!shift) _rotate_clock(fb); if (!shift) _rotate_clock(fb);
else _flip_vert(fb); else _flip_vert(fb);
} }
#endif
else if (!strcmp(k, "F5")) else if (!strcmp(k, "F5"))
{ {
if (fb->entry) if (fb->entry)
@ -743,6 +763,7 @@ ephoto_flow_browser_add(Ephoto *ephoto, Evas_Object *parent)
_toolbar_item_separator_add(fb); _toolbar_item_separator_add(fb);
#ifdef ROTATION
fb->action.rotate_counterclock = _toolbar_item_add fb->action.rotate_counterclock = _toolbar_item_add
(fb, "object-rotate-left", "Rotate Left", 50, _go_rotate_counterclock); (fb, "object-rotate-left", "Rotate Left", 50, _go_rotate_counterclock);
fb->action.rotate_clock = _toolbar_item_add fb->action.rotate_clock = _toolbar_item_add
@ -762,6 +783,7 @@ ephoto_flow_browser_add(Ephoto *ephoto, Evas_Object *parent)
(fb->action.flip_horiz, "Flip object horizontally"); (fb->action.flip_horiz, "Flip object horizontally");
elm_toolbar_item_tooltip_text_set elm_toolbar_item_tooltip_text_set
(fb->action.flip_vert, "Flip object vertically"); (fb->action.flip_vert, "Flip object vertically");
#endif
fb->orient_layout = elm_layout_add(layout); fb->orient_layout = elm_layout_add(layout);
if (!elm_layout_theme_set if (!elm_layout_theme_set