Ephoto: Add the scaling feature to Ephoto.

master
Stephen Houston 6 years ago
parent 85c16161f5
commit 7d663786a2
  1. 7
      src/bin/Makefile.am
  2. 2
      src/bin/ephoto.h
  3. 18
      src/bin/ephoto_single_browser.c

@ -32,10 +32,11 @@ ephoto_SOURCES = \
ephoto_ipc.c \
ephoto_main.c \
ephoto_red_eye.c \
ephoto_thumb.c \
ephoto_thumb_browser.c \
ephoto_scale.c \
ephoto_single_browser.c \
ephoto_slideshow.c
ephoto_slideshow.c \
ephoto_thumb.c \
ephoto_thumb_browser.c
internal_bindir = $(datadir)/$(PACKAGE)
internal_bin_PROGRAMS = ephoto_thumbnail

@ -142,6 +142,8 @@ void ephoto_color_add(Ephoto *ephoto, Evas_Object *main, Evas_Object *parent,
Evas_Object *image);
void ephoto_red_eye_add(Ephoto *ephoto, Evas_Object *main, Evas_Object *parent,
Evas_Object *image);
void ephoto_scale_add(Ephoto *ephoto, Evas_Object *main, Evas_Object *parent,
Evas_Object *image, const char *file);
void ephoto_filter_blur(Evas_Object *main, Evas_Object *image);
void ephoto_filter_sharpen(Evas_Object *main, Evas_Object *image);
void ephoto_filter_dither(Evas_Object *main, Evas_Object *image);

@ -1026,6 +1026,20 @@ _crop_image(void *data, Evas_Object *obj EINA_UNUSED,
}
}
static void
_scale_image(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
{
Ephoto_Single_Browser *sb = data;
if (sb->viewer)
{
sb->editing = EINA_TRUE;
Ephoto_Viewer *v = evas_object_data_get(sb->viewer, "viewer");
ephoto_scale_add(sb->ephoto, sb->main, sb->mhbox, v->image, sb->entry->path);
}
}
static void
_go_bcg(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
{
@ -1475,6 +1489,7 @@ _add_edit_menu_items(Ephoto_Single_Browser *sb, Evas_Object *menu)
elm_menu_item_add(menu, menu_it, "document-properties", _("Transform"),
NULL, NULL);
elm_menu_item_add(menu, menu_itt, "edit-cut", _("Crop"), _crop_image, sb);
elm_menu_item_add(menu, menu_itt, "zoom-in", _("Scale"), _scale_image, sb);
elm_menu_item_separator_add(menu, menu_itt);
elm_menu_item_add(menu, menu_itt, "object-rotate-left", _("Rotate Left"),
_go_rotate_counterclock, sb);
@ -1884,11 +1899,10 @@ ephoto_single_browser_image_data_done(Evas_Object *main,
evas_object_image_data_set(elm_image_object_get(v->image), image_data);
evas_object_image_data_update_add(elm_image_object_get(v->image), 0, 0, w,
h);
_ephoto_update_bottom_bar(sb);
sb->edited_image_data = image_data;
sb->ew = w;
sb->eh = h;
_ephoto_update_bottom_bar(sb);
sb->editing = EINA_FALSE;
_zoom_fit(sb);
}

Loading…
Cancel
Save