Ephoto: Ephoto goes edjey! Give ephoto an edje style overlayed interface.

For screenshots and video, you can visit this post:
http://smhouston.us/ephoto-gets-edjey/
v-1.6.0
Stephen okra Houston 7 years ago
parent 31ff22d7a3
commit 86b827e5fa
  1. 4
      data/images/Makefile.am
  2. 23
      data/themes/Makefile.am
  3. 1
      src/bin/Makefile.am
  4. 2
      src/bin/ephoto.c
  5. 47
      src/bin/ephoto.h
  6. 4
      src/bin/ephoto_bcg.c
  7. 4
      src/bin/ephoto_color.c
  8. 18
      src/bin/ephoto_config.c
  9. 8
      src/bin/ephoto_cropper.c
  10. 39
      src/bin/ephoto_editor.c
  11. 28
      src/bin/ephoto_file.c
  12. 4
      src/bin/ephoto_hsv.c
  13. 328
      src/bin/ephoto_main.c
  14. 4
      src/bin/ephoto_red_eye.c
  15. 248
      src/bin/ephoto_single_browser.c
  16. 216
      src/bin/ephoto_slideshow.c
  17. 1809
      src/bin/ephoto_thumb_browser.c

@ -1,7 +1,7 @@
AUTOMAKE_OPTIONS = subdir-objects
MAINTAINERCLEANFILES = Makefile.in Makefile
EXTRA_DIST = ephoto.png
EXTRA_DIST = ephoto.png grid.png single.png
filesdir = $(datadir)/$(PACKAGE)/images
files_DATA = ephoto.png
files_DATA = ephoto.png grid.png single.png

@ -5,19 +5,22 @@ EDJE_CC = @edje_cc@
EDJE_FLAGS = -id $(top_srcdir)/data/themes
filesdir = $(datadir)/$(PACKAGE)/themes
files_DATA = crop.edj
files_DATA = ephoto.edj
EXTRA_DIST = crop.edc \
sel_border.png \
sel_corner1.png \
sel_corner3.png \
sel_corner5.png \
sel_corner7.png
EXTRA_DIST = ephoto.edc \
images/sel_border.png \
images/sel_corner1.png \
images/sel_corner3.png \
images/sel_corner5.png \
images/sel_corner7.png \
images/shadow_circle_horiz.png \
images/shadow_circle_vert.png \
images/tile.png
crop.edj: Makefile $(EXTRA_DIST)
ephoto.edj: Makefile $(EXTRA_DIST)
$(EDJE_CC) $(EDJE_FLAGS) \
$(top_srcdir)/data/themes/crop.edc \
$(top_builddir)/data/themes/crop.edj
$(top_srcdir)/data/themes/ephoto.edc \
$(top_builddir)/data/themes/ephoto.edj
clean-local:
rm -f *.edj

@ -24,6 +24,7 @@ ephoto_SOURCES = \
ephoto_color.c \
ephoto_config.c \
ephoto_cropper.c \
ephoto_directory_browser.c \
ephoto_editor.c \
ephoto_file.c \
ephoto_filters.c \

@ -11,7 +11,7 @@ elm_main(int argc, char **argv)
elm_need_efreet();
elm_language_set("");
elm_app_compile_data_dir_set(PACKAGE_DATA_DIR);
elm_app_info_set(elm_main, "ephoto", "themes/crop.edj");
elm_app_info_set(elm_main, "ephoto", "themes/ephoto.edj");
#if HAVE_GETTEXT && ENABLE_NLS
elm_app_compile_locale_set(LOCALEDIR);
bindtextdomain(PACKAGE, elm_app_locale_dir_get());

@ -59,6 +59,7 @@ Evas_Object *ephoto_thumb_add(Ephoto *ephoto, Evas_Object *parent,
void ephoto_thumb_path_set(Evas_Object *obj, const char *path);
void ephoto_directory_set(Ephoto *ephoto, const char *path,
Elm_Object_Item *expanded, Eina_Bool dirs_only, Eina_Bool thumbs_only);
void ephoto_show_folders(Ephoto *ephoto, Eina_Bool toggle);
/*config panel functions*/
Eina_Bool ephoto_config_init(Ephoto *em);
@ -68,6 +69,7 @@ void ephoto_config_main(Ephoto *em);
/*single image functions*/
Evas_Object *ephoto_single_browser_add(Ephoto *ephoto, Evas_Object *parent);
void ephoto_single_browser_show_controls(Ephoto *ephoto);
void ephoto_single_browser_entries_set(Evas_Object *obj, Eina_List *entries);
void ephoto_single_browser_entry_set(Evas_Object *obj, Ephoto_Entry *entry);
void ephoto_single_browser_focus_set(Ephoto *ephoto);
@ -80,6 +82,8 @@ void ephoto_single_browser_image_data_update(Evas_Object *main,
void ephoto_single_browser_image_data_done(Evas_Object *main,
unsigned int *image_data, Evas_Coord w, Evas_Coord h);
void ephoto_single_browser_cancel_editing(Evas_Object *main);
void ephoto_single_browser_slideshow(Evas_Object *obj);
void ephoto_single_browser_adjust_offsets(Ephoto *ephoto);
/* smart callbacks called: "back" - the user wants to go back to the previous
* screen. */
@ -87,19 +91,27 @@ void ephoto_single_browser_cancel_editing(Evas_Object *main);
Evas_Object *ephoto_slideshow_add(Ephoto *ephoto, Evas_Object *parent);
void ephoto_slideshow_entries_set(Evas_Object *obj, Eina_List *entries);
void ephoto_slideshow_entry_set(Evas_Object *obj, Ephoto_Entry *entry);
void ephoto_slideshow_show_controls(Ephoto *ephoto);
/* smart callbacks called: "back" - the user wants to go back to the previous
* screen. */
/*thumbnail browser functions*/
Evas_Object *ephoto_thumb_browser_add(Ephoto *ephoto, Evas_Object *parent);
void ephoto_thumb_browser_fsel_clear(Ephoto *ephoto);
void ephoto_thumb_browser_top_dir_set(Ephoto *ephoto, const char *dir);
void ephoto_thumb_browser_show_controls(Ephoto *ephoto);
void ephoto_thumb_browser_insert(Ephoto *ephoto, Ephoto_Entry *entry);
void ephoto_thumb_browser_remove(Ephoto *ephoto, Ephoto_Entry *entry);
void ephoto_thumb_browser_update(Ephoto *ephoto, Ephoto_Entry *entry);
void ephoto_thumb_browser_update_info_label(Ephoto *ephoto);
void ephoto_thumb_browser_slideshow(Evas_Object *obj);
void ephoto_thumb_browser_paste(Ephoto *ephoto, Elm_Object_Item *item);
/* smart callbacks called: "selected" - an item in the thumb browser is
* selected. The selected Ephoto_Entry is passed as event_info argument. */
/*directory browser functions*/
Evas_Object *ephoto_directory_browser_add(Ephoto *ephoto, Evas_Object *parent);
void ephoto_directory_browser_initialize_structure(Ephoto *ephoto);
void ephoto_directory_browser_top_dir_set(Ephoto *ephoto, const char *dir);
/*thumbnailing functions taken from enlightenment*/
int e_thumb_init(void);
int e_thumb_shutdown(void);
@ -116,18 +128,18 @@ int e_ipc_init(void);
int e_ipc_shutdown(void);
/*editing functions*/
Evas_Object *ephoto_editor_add(Evas_Object *parent, const char *title,
Evas_Object *ephoto_editor_add(Ephoto *ephoto, const char *title,
const char *data_name, void *data);
void ephoto_editor_del(Evas_Object *obj);
void ephoto_cropper_add(Evas_Object *main, Evas_Object *parent,
void ephoto_cropper_add(Ephoto *ephoto, Evas_Object *main, Evas_Object *parent,
Evas_Object *image_parent, Evas_Object *image);
void ephoto_bcg_add(Evas_Object *main, Evas_Object *parent,
void ephoto_bcg_add(Ephoto *ephoto, Evas_Object *main, Evas_Object *parent,
Evas_Object *image);
void ephoto_hsv_add(Evas_Object *main, Evas_Object *parent,
void ephoto_hsv_add(Ephoto *ephoto, Evas_Object *main, Evas_Object *parent,
Evas_Object *image);
void ephoto_color_add(Evas_Object *main, Evas_Object *parent,
void ephoto_color_add(Ephoto *ephoto, Evas_Object *main, Evas_Object *parent,
Evas_Object *image);
void ephoto_red_eye_add(Evas_Object *main, Evas_Object *parent,
void ephoto_red_eye_add(Ephoto *ephoto, Evas_Object *main, Evas_Object *parent,
Evas_Object *image);
void ephoto_filter_blur(Evas_Object *main, Evas_Object *image);
void ephoto_filter_sharpen(Evas_Object *main, Evas_Object *image);
@ -196,14 +208,12 @@ struct _Ephoto_Config
int window_width;
int window_height;
Eina_Bool fsel_hide;
Eina_Bool tool_hide;
double lpane_size;
const char *open;
Eina_Bool prompts;
Eina_Bool drop;
Evas_Object *slide_time;
Evas_Object *slide_trans;
Evas_Object *hide_toolbar;
Evas_Object *open_dir;
Evas_Object *open_dir_custom;
Evas_Object *show_prompts;
@ -213,12 +223,18 @@ struct _Ephoto_Config
struct _Ephoto
{
Evas_Object *win;
Evas_Object *panel;
Evas_Object *layout;
Evas_Object *pager;
Evas_Object *statusbar;
Evas_Object *controls_left;
Evas_Object *controls_right;
Evas_Object *infolabel;
Evas_Object *thumb_browser;
Evas_Object *single_browser;
Evas_Object *slideshow;
Evas_Object *dir_browser;
Evas_Object *right_menu;
Elm_Object_Item *tb;
Elm_Object_Item *sb;
Elm_Object_Item *sl;
@ -228,10 +244,18 @@ struct _Ephoto
Eina_List *searchentries;
Eina_List *thumbs;
Eina_Bool blocking;
Eina_Bool menu_blocking;
Eina_Bool hover_blocking;
Eina_Bool right_blocking;
Eina_Bool folders_toggle;
Eina_Bool editor_blocking;
Ecore_File_Monitor *monitor;
Ecore_Idler *file_idler;
Eina_List *file_idler_pos;
Eina_List *upload_handlers;
Ecore_Timer *overlay_timer;
Ecore_Con_Url *url_up;
char *url_ret;
char *upload_error;
@ -256,7 +280,6 @@ struct _Ephoto
Ephoto_State state, prev_state;
Ephoto_Config *config;
Ephoto_Entry *thumb_entry;
};
struct _Ephoto_Entry

@ -317,7 +317,7 @@ _editor_del(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
}
void
ephoto_bcg_add(Evas_Object *main, Evas_Object *parent, Evas_Object *image)
ephoto_bcg_add(Ephoto *ephoto, Evas_Object *main, Evas_Object *parent, Evas_Object *image)
{
Evas_Object *slider;
Ephoto_BCG *ebcg;
@ -343,7 +343,7 @@ ephoto_bcg_add(Evas_Object *main, Evas_Object *parent, Evas_Object *image)
memcpy(ebcg->original_im_data, im_data,
sizeof(unsigned int) * ebcg->w * ebcg->h);
ebcg->editor = ephoto_editor_add(parent, _("Brightness/Contrast/Gamma"),
ebcg->editor = ephoto_editor_add(ephoto, _("Brightness/Contrast/Gamma"),
"ebcg", ebcg);
evas_object_event_callback_add(ebcg->editor, EVAS_CALLBACK_DEL, _editor_del,
ebcg);

@ -302,7 +302,7 @@ _editor_del(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
}
void
ephoto_color_add(Evas_Object *main, Evas_Object *parent, Evas_Object *image)
ephoto_color_add(Ephoto *ephoto, Evas_Object *main, Evas_Object *parent, Evas_Object *image)
{
Evas_Object *slider;
Ephoto_Color *eco;
@ -328,7 +328,7 @@ ephoto_color_add(Evas_Object *main, Evas_Object *parent, Evas_Object *image)
memcpy(eco->original_im_data, im_data,
sizeof(unsigned int) * eco->w * eco->h);
eco->editor = ephoto_editor_add(parent, _("Adjust Color Levels"),
eco->editor = ephoto_editor_add(ephoto, _("Adjust Color Levels"),
"eco", eco);
evas_object_event_callback_add(eco->editor, EVAS_CALLBACK_DEL, _editor_del,
eco);

@ -1,6 +1,6 @@
#include "ephoto.h"
#define CONFIG_VERSION 15
#define CONFIG_VERSION 16
static int _ephoto_config_load(Ephoto *ephoto);
static Eina_Bool _ephoto_on_config_save(void *data);
@ -37,8 +37,6 @@ _config_save_cb(void *data, Evas_Object *obj EINA_UNUSED,
if (ecore_file_is_dir(path) || !strcmp(path, "Last"))
eina_stringshare_replace(&ephoto->config->open, path);
ephoto->config->tool_hide =
elm_check_state_get(ephoto->config->hide_toolbar);
ephoto->config->prompts = elm_check_state_get(ephoto->config->show_prompts);
ephoto->config->drop = elm_check_state_get(ephoto->config->move_drop);
if (elm_spinner_value_get(ephoto->config->slide_time) > 0)
@ -83,14 +81,6 @@ _config_general(Ephoto *ephoto, Evas_Object *parent)
elm_object_content_set(frame, table);
evas_object_show(table);
check = elm_check_add(table);
elm_object_text_set(check, _("Hide Toolbar On Fullscreen"));
evas_object_size_hint_align_set(check, 0.0, EVAS_HINT_FILL);
elm_check_state_set(check, ephoto->config->tool_hide);
elm_table_pack(table, check, 0, 0, 1, 1);
evas_object_show(check);
ephoto->config->hide_toolbar = check;
check = elm_check_add(table);
elm_object_text_set(check, _("Prompt Before Changing The Filesystem"));
evas_object_size_hint_align_set(check, 0.0, EVAS_HINT_FILL);
@ -331,9 +321,9 @@ _config_bindings(Evas_Object *parent)
_("<b><hilight>General Bindings</hilight></b><br/>"
"<b>F1:</b> Settings Panel<br/>"
"<b>F5:</b> Start Slideshow<br/>"
"<b>F11:</b> Toggle Fullscreen<br/><br/>"
"<b>F11:</b> Toggle Fullscreen<br/>"
"<b>Ctrl+Shift+f:</b> Toggle File Selector<br/><br/>"
"<b><hilight>Thumbnail Browser Bindings</hilight></b><br/>"
"<b>Ctrl+Shift+f:</b> Toggle File Selector<br/>"
"<b>Ctrl++:</b> Zoom In<br/>"
"<b>Ctrl+-:</b> Zoom Out<br/>"
"<b>Ctrl+Tab:</b> View Image<br/>"
@ -711,7 +701,6 @@ ephoto_config_init(Ephoto *ephoto)
C_VAL(D, T, window_width, EET_T_INT);
C_VAL(D, T, window_height, EET_T_INT);
C_VAL(D, T, fsel_hide, EET_T_INT);
C_VAL(D, T, tool_hide, EET_T_INT);
C_VAL(D, T, lpane_size, EET_T_DOUBLE);
C_VAL(D, T, open, EET_T_STRING);
C_VAL(D, T, prompts, EET_T_INT);
@ -726,7 +715,6 @@ ephoto_config_init(Ephoto *ephoto)
ephoto->config->window_width = 900;
ephoto->config->window_height = 600;
ephoto->config->fsel_hide = 0;
ephoto->config->tool_hide = 0;
ephoto->config->lpane_size = .15;
ephoto->config->open = eina_stringshare_add(getenv("HOME"));
ephoto->config->prompts = 1;

@ -627,7 +627,7 @@ _editor_del(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
}
void
ephoto_cropper_add(Evas_Object *main, Evas_Object *parent,
ephoto_cropper_add(Ephoto *ephoto, Evas_Object *main, Evas_Object *parent,
Evas_Object *image_parent, Evas_Object *image)
{
Ephoto_Cropper *ec;
@ -656,7 +656,7 @@ ephoto_cropper_add(Evas_Object *main, Evas_Object *parent,
evas_object_show(ec->box);
ec->layout = elm_layout_add(ec->box);
elm_layout_file_set(ec->layout, PACKAGE_DATA_DIR "/themes/crop.edj",
elm_layout_file_set(ec->layout, PACKAGE_DATA_DIR "/themes/ephoto.edj",
"ephoto,image,cropper,base");
evas_object_size_hint_weight_set(ec->layout, EVAS_HINT_EXPAND,
EVAS_HINT_EXPAND);
@ -671,7 +671,7 @@ ephoto_cropper_add(Evas_Object *main, Evas_Object *parent,
evas_object_show(ec->image);
ec->cropper = edje_object_add(evas_object_evas_get(ec->layout));
edje_object_file_set(ec->cropper, PACKAGE_DATA_DIR "/themes/crop.edj",
edje_object_file_set(ec->cropper, PACKAGE_DATA_DIR "/themes/ephoto.edj",
"ephoto,image,cropper");
edje_object_signal_callback_add(elm_layout_edje_get(ec->layout),
"cropper,changed", "ephoto.swallow.cropper", _calculate_cropper_size,
@ -701,7 +701,7 @@ ephoto_cropper_add(Evas_Object *main, Evas_Object *parent,
evas_object_event_callback_add(ec->layout, EVAS_CALLBACK_RESIZE,
_image_resize, ec);
ec->editor = ephoto_editor_add(parent, _("Crop Image"),
ec->editor = ephoto_editor_add(ephoto, _("Crop Image"),
"ec", ec);
evas_object_event_callback_add(ec->editor, EVAS_CALLBACK_DEL,
_editor_del, ec);

@ -8,31 +8,47 @@ _editor_reset(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
}
static void
_editor_apply(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
_editor_apply(void *data, Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
{
Ephoto *ephoto = data;
ecore_event_add(EPHOTO_EVENT_EDITOR_APPLY, NULL, NULL, NULL);
edje_object_signal_emit(elm_layout_edje_get(ephoto->layout),
"ephoto,editor,hide", "ephoto");
ephoto->editor_blocking = EINA_FALSE;
}
static void
_editor_cancel(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
_editor_cancel(void *data, Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
{
Ephoto *ephoto = data;
ecore_event_add(EPHOTO_EVENT_EDITOR_CANCEL, NULL, NULL, NULL);
edje_object_signal_emit(elm_layout_edje_get(ephoto->layout),
"ephoto,editor,hide", "ephoto");
ephoto->editor_blocking = EINA_FALSE;
}
Evas_Object *
ephoto_editor_add(Evas_Object *parent, const char *title, const char *data_name,
ephoto_editor_add(Ephoto *ephoto, const char *title, const char *data_name,
void *data)
{
Evas_Object *frame, *box, *ic, *button;
frame = elm_frame_add(parent);
ephoto->editor_blocking = EINA_TRUE;
edje_object_signal_emit(elm_layout_edje_get(ephoto->layout),
"ephoto,controls,hide", "ephoto");
edje_object_signal_emit(elm_layout_edje_get(ephoto->layout),
"ephoto,folders,hide", "ephoto");
frame = elm_frame_add(ephoto->layout);
elm_object_text_set(frame, title);
evas_object_size_hint_weight_set(frame, 0.3, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(frame, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_data_set(frame, data_name, data);
elm_box_pack_end(parent, frame);
elm_layout_content_set(ephoto->layout, "ephoto.swallow.editor", frame);
evas_object_show(frame);
box = elm_box_add(frame);
@ -46,6 +62,7 @@ ephoto_editor_add(Evas_Object *parent, const char *title, const char *data_name,
ic = elm_icon_add(box);
elm_icon_order_lookup_set(ic, ELM_ICON_LOOKUP_FDO_THEME);
evas_object_size_hint_min_set(ic, 20*elm_config_scale_get(), 20*elm_config_scale_get());
evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
elm_icon_standard_set(ic, "edit-undo");
@ -55,10 +72,12 @@ ephoto_editor_add(Evas_Object *parent, const char *title, const char *data_name,
evas_object_smart_callback_add(button, "clicked", _editor_reset, box);
evas_object_size_hint_weight_set(button, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_size_hint_align_set(button, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_size_hint_min_set(button, 220*elm_config_scale_get(), 30*elm_config_scale_get());
elm_box_pack_end(box, button);
evas_object_show(button);
ic = elm_icon_add(box);
evas_object_size_hint_min_set(ic, 20*elm_config_scale_get(), 20*elm_config_scale_get());
elm_icon_order_lookup_set(ic, ELM_ICON_LOOKUP_FDO_THEME);
evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
elm_icon_standard_set(ic, "document-save");
@ -66,13 +85,15 @@ ephoto_editor_add(Evas_Object *parent, const char *title, const char *data_name,
button = elm_button_add(box);
elm_object_text_set(button, _("Apply"));
elm_object_part_content_set(button, "icon", ic);
evas_object_smart_callback_add(button, "clicked", _editor_apply, box);
evas_object_smart_callback_add(button, "clicked", _editor_apply, ephoto);
evas_object_size_hint_weight_set(button, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_size_hint_align_set(button, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_size_hint_min_set(button, 220*elm_config_scale_get(), 30*elm_config_scale_get());
elm_box_pack_end(box, button);
evas_object_show(button);
ic = elm_icon_add(box);
evas_object_size_hint_min_set(ic, 20*elm_config_scale_get(), 20*elm_config_scale_get());
elm_icon_order_lookup_set(ic, ELM_ICON_LOOKUP_FDO_THEME);
evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
elm_icon_standard_set(ic, "window-close");
@ -80,12 +101,16 @@ ephoto_editor_add(Evas_Object *parent, const char *title, const char *data_name,
button = elm_button_add(box);
elm_object_text_set(button, _("Cancel"));
elm_object_part_content_set(button, "icon", ic);
evas_object_smart_callback_add(button, "clicked", _editor_cancel, box);
evas_object_smart_callback_add(button, "clicked", _editor_cancel, ephoto);
evas_object_size_hint_weight_set(button, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_size_hint_align_set(button, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_size_hint_min_set(button, 220*elm_config_scale_get(), 30*elm_config_scale_get());
elm_box_pack_end(box, button);
evas_object_show(button);
edje_object_signal_emit(elm_layout_edje_get(ephoto->layout),
"ephoto,editor,show", "ephoto");
return box;
}

@ -130,18 +130,6 @@ _save_image_as_overwrite(void *data, Evas_Object *obj EINA_UNUSED,
_("Error: Image could not be saved here!"));
ephoto_single_browser_path_pending_unset(ephoto->single_browser);
}
else
{
char *dir = ecore_file_dir_get(file);
if (strcmp(dir, ephoto->config->directory))
{
ephoto_thumb_browser_fsel_clear(ephoto);
ephoto_directory_set(ephoto, dir, NULL, EINA_FALSE, EINA_FALSE);
ephoto_thumb_browser_top_dir_set(ephoto,
ephoto->config->directory);
free(dir);
}
}
evas_object_del(popup);
elm_object_focus_set(ephoto->pager, EINA_TRUE);
evas_object_freeze_events_set(ephoto->pager, EINA_FALSE);
@ -1057,6 +1045,7 @@ _prompt_upload_apply(void *data, Evas_Object *obj EINA_UNUSED,
evas_object_del(ppopup);
popup = _processing(ephoto, _("Upload Image"),
("Please wait while your image is uploaded."));
evas_object_show(popup);
f = fopen(entry->path, "rb");
fseek(f, 0, SEEK_END);
@ -1214,21 +1203,6 @@ _prompt_save_image_as_apply(void *data, Evas_Object *obj EINA_UNUSED, void *even
ephoto_single_browser_path_pending_unset
(ephoto->single_browser);
}
else
{
evas_object_del(opopup);
char *dir = ecore_file_dir_get(buf);
if (strcmp(dir, ephoto->config->directory))
{
ephoto_thumb_browser_fsel_clear(ephoto);
ephoto_directory_set(ephoto, dir, NULL,
EINA_FALSE, EINA_FALSE);
ephoto_thumb_browser_top_dir_set(ephoto,
ephoto->config->directory);
free(dir);
}
}
}
}
evas_object_del(opopup);

@ -324,7 +324,7 @@ _editor_del(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
}
void
ephoto_hsv_add(Evas_Object *main, Evas_Object *parent, Evas_Object *image)
ephoto_hsv_add(Ephoto *ephoto, Evas_Object *main, Evas_Object *parent, Evas_Object *image)
{
Evas_Object *slider;
Ephoto_HSV *ehsv;
@ -350,7 +350,7 @@ ephoto_hsv_add(Evas_Object *main, Evas_Object *parent, Evas_Object *image)
memcpy(ehsv->original_im_data, im_data,
sizeof(unsigned int) * ehsv->w * ehsv->h);
ehsv->editor = ephoto_editor_add(parent, _("Hue/Saturation/Value"),
ehsv->editor = ephoto_editor_add(ephoto, _("Hue/Saturation/Value"),
"ehsv", ehsv);
evas_object_event_callback_add(ehsv->editor, EVAS_CALLBACK_DEL, _editor_del,
ehsv);

@ -40,9 +40,15 @@ _ephoto_thumb_browser_show(Ephoto *ephoto, Ephoto_Entry *entry)
elm_object_focus_set(ephoto->thumb_browser, EINA_TRUE);
_ephoto_state_set(ephoto, EPHOTO_STATE_THUMB);
ephoto_title_set(ephoto, ephoto->config->directory);
ephoto_thumb_browser_update_info_label(ephoto);
elm_box_clear(ephoto->controls_left);
elm_box_clear(ephoto->controls_right);
ephoto->blocking = EINA_FALSE;
ephoto->menu_blocking = EINA_FALSE;
ephoto->hover_blocking = EINA_FALSE;
ephoto->editor_blocking = EINA_FALSE;
ephoto_thumb_browser_show_controls(ephoto);
if (ephoto->thumb_entry)
elm_gengrid_item_selected_set(ephoto->thumb_entry->item, EINA_TRUE);
if ((entry) && (entry->item))
elm_gengrid_item_bring_in(entry->item, ELM_GENGRID_ITEM_SCROLLTO_IN);
}
@ -60,16 +66,26 @@ _ephoto_single_browser_show(Ephoto *ephoto, Ephoto_Entry *entry)
ephoto_single_browser_entries_set(ephoto->single_browser,
ephoto->entries);
ephoto->thumb_entry = entry;
ephoto_single_browser_entry_set(ephoto->single_browser, entry);
elm_naviframe_item_simple_promote(ephoto->pager, ephoto->single_browser);
elm_object_focus_set(ephoto->single_browser, EINA_TRUE);
_ephoto_state_set(ephoto, EPHOTO_STATE_SINGLE);
elm_box_clear(ephoto->controls_left);
elm_box_clear(ephoto->controls_right);
ephoto->blocking = EINA_FALSE;
ephoto->menu_blocking = EINA_FALSE;
ephoto->hover_blocking = EINA_FALSE;
ephoto->editor_blocking = EINA_FALSE;
ephoto_single_browser_show_controls(ephoto);
ephoto_single_browser_adjust_offsets(ephoto);
}
static void
_ephoto_slideshow_show(Ephoto *ephoto, Ephoto_Entry *entry)
{
ephoto_slideshow_show_controls(ephoto);
if (ephoto->selentries)
ephoto_slideshow_entries_set(ephoto->slideshow, ephoto->selentries);
else if (ephoto->searchentries)
@ -80,6 +96,15 @@ _ephoto_slideshow_show(Ephoto *ephoto, Ephoto_Entry *entry)
elm_naviframe_item_simple_promote(ephoto->pager, ephoto->slideshow);
elm_object_focus_set(ephoto->slideshow, EINA_TRUE);
_ephoto_state_set(ephoto, EPHOTO_STATE_SLIDESHOW);
edje_object_signal_emit(elm_layout_edje_get(ephoto->layout),
"ephoto,controls,hide", "ephoto");
edje_object_signal_emit(elm_layout_edje_get(ephoto->layout),
"ephoto,folders,hide", "ephoto");
ephoto->folders_toggle = EINA_FALSE;
ephoto->blocking = EINA_FALSE;
ephoto->menu_blocking = EINA_FALSE;
ephoto->hover_blocking = EINA_FALSE;
ephoto->editor_blocking = EINA_FALSE;
}
static void
@ -184,10 +209,40 @@ _win_free(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
ecore_timer_del(ephoto->timer.thumb_regen);
if (ephoto->monitor)
ecore_file_monitor_del(ephoto->monitor);
if (ephoto->overlay_timer)
ecore_timer_del(ephoto->overlay_timer);
ephoto_config_save(ephoto);
free(ephoto);
}
static void
_mouse_up_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
{
Ephoto *ephoto = data;
Evas_Object *but = evas_object_data_get(ephoto->layout, "folder_button");
Evas_Coord x, y, w, h, bx, by, bw, bh, cx, cy;
evas_pointer_canvas_xy_get(evas_object_evas_get(ephoto->dir_browser), &cx, &cy);
evas_object_geometry_get(ephoto->dir_browser, &x, &y, &w, &h);
evas_object_geometry_get(but, &bx, &by, &bw, &bh);
if (cx >= x && cx <= x+w)
{
if (cy >= y && cy <= y+h)
return;
}
if (cx >= bx && cx <= bx+bw)
{
if (cy >= by && cy <= by+bh)
return;
}
edje_object_signal_emit(elm_layout_edje_get(ephoto->layout),
"ephoto,folders,hide", "ephoto");
ephoto->folders_toggle = EINA_FALSE;
elm_object_tooltip_text_set(but, _("Show Folders"));
}
static void
_resize_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
@ -203,24 +258,135 @@ _resize_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
}
}
static Eina_Bool
_timer_cb(void *data)
{
Ephoto *ephoto = data;
Edje_Object *edje = elm_layout_edje_get(ephoto->layout);
if (ephoto->blocking || ephoto->menu_blocking ||
ephoto->right_blocking || ephoto->hover_blocking ||
ephoto->editor_blocking)
return ECORE_CALLBACK_PASS_ON;
edje_object_signal_emit(edje, "ephoto,controls,hide", "ephoto");
if (ephoto->folders_toggle)
edje_object_signal_emit(edje, "ephoto,folders,hide", "ephoto");
ecore_timer_del(ephoto->overlay_timer);
ephoto->overlay_timer = NULL;
return ECORE_CALLBACK_CANCEL;
}
static void
_mouse_move_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
{
Ephoto *ephoto = data;
Edje_Object *edje = elm_layout_edje_get(ephoto->layout);
if (ephoto->blocking || ephoto->menu_blocking ||
ephoto->right_blocking || ephoto->hover_blocking ||
ephoto->editor_blocking)
return;
if (ephoto->overlay_timer)
ecore_timer_del(ephoto->overlay_timer);
ephoto->overlay_timer = NULL;
edje_object_signal_emit(edje, "ephoto,controls,show", "ephoto");
if (ephoto->folders_toggle)
edje_object_signal_emit(edje, "ephoto,folders,show", "ephoto");
ephoto->overlay_timer = ecore_timer_add(3.0, _timer_cb, ephoto);
}
static void
_mouse_out_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
{
Ephoto *ephoto = data;
ephoto->blocking = EINA_FALSE;
}
static void
_mouse_in_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
{
Ephoto *ephoto = data;
ephoto->blocking = EINA_TRUE;
}
static void
_folder_icon_clicked(void *data, Evas_Object *obj,
void *event_info EINA_UNUSED)
{
Ephoto *ephoto = data;
if (!ephoto->folders_toggle)
{
edje_object_signal_emit(elm_layout_edje_get(ephoto->layout),
"ephoto,folders,show", "ephoto");
ephoto->folders_toggle = EINA_TRUE;
elm_object_tooltip_text_set(obj, _("Hide Folders"));
}
else
{
edje_object_signal_emit(elm_layout_edje_get(ephoto->layout),
"ephoto,folders,hide", "ephoto");
ephoto->folders_toggle = EINA_FALSE;
elm_object_tooltip_text_set(obj, _("Show Folders"));
}
}
/*Ephoto Thumb Browser Main Callbacks*/
static void
_pager_focused(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
_slideshow_icon_clicked(void *data, Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
{
Ephoto *ephoto = data;
if (ephoto->state == EPHOTO_STATE_THUMB)
elm_object_focus_set(ephoto->tb, EINA_TRUE);
ephoto_thumb_browser_slideshow(ephoto->thumb_browser);
else if (ephoto->state == EPHOTO_STATE_SINGLE)
ephoto_single_browser_focus_set(ephoto);
else
elm_object_focus_set(ephoto->sl, EINA_TRUE);
ephoto_single_browser_slideshow(ephoto->single_browser);
}
static void
_settings_icon_clicked(void *data, Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
{
Ephoto *ephoto = data;
ephoto_config_main(ephoto);
}
/*Toggle determines whether to toggle folder visibility, or just force visible*/
void
ephoto_show_folders(Ephoto *ephoto, Eina_Bool toggle)
{
Evas_Object *but = evas_object_data_get(ephoto->layout, "folder_button");
if (!ephoto->folders_toggle || !toggle)
{
_mouse_move_cb(ephoto, NULL, NULL, NULL);
edje_object_signal_emit(elm_layout_edje_get(ephoto->layout),
"ephoto,folders,show", "ephoto");
ephoto->folders_toggle = EINA_TRUE;
elm_object_tooltip_text_set(but, _("Hide Folders"));
}
else if (ephoto->folders_toggle && toggle)
{
edje_object_signal_emit(elm_layout_edje_get(ephoto->layout),
"ephoto,folders,hide", "ephoto");
ephoto->folders_toggle = EINA_FALSE;
elm_object_tooltip_text_set(but, _("Show Folders"));
}
}
Evas_Object *
ephoto_window_add(const char *path)
{
Ephoto *ephoto = calloc(1, sizeof(Ephoto));
Evas_Object *ic, *but;
char buf[PATH_MAX];
EINA_SAFETY_ON_NULL_RETURN_VAL(ephoto, NULL);
@ -234,6 +400,11 @@ ephoto_window_add(const char *path)
EPHOTO_EVENT_EDITOR_CANCEL = ecore_event_type_new();
ephoto->selentries = NULL;
ephoto->blocking = EINA_FALSE;
ephoto->menu_blocking = EINA_FALSE;
ephoto->hover_blocking = EINA_FALSE;
ephoto->folders_toggle = EINA_FALSE;
ephoto->editor_blocking = EINA_FALSE;
ephoto->win = elm_win_util_standard_add("ephoto", "Ephoto");
if (!ephoto->win)
{
@ -241,8 +412,8 @@ ephoto_window_add(const char *path)
return NULL;
}
evas_object_event_callback_add(ephoto->win, EVAS_CALLBACK_FREE, _win_free,
ephoto);
evas_object_event_callback_add(ephoto->win, EVAS_CALLBACK_FREE,
_win_free, ephoto);
evas_object_event_callback_add(ephoto->win, EVAS_CALLBACK_RESIZE,
_resize_cb, ephoto);
elm_win_autodel_set(ephoto->win, EINA_TRUE);
@ -258,6 +429,20 @@ ephoto_window_add(const char *path)
(ephoto->config->thumb_gen_size != 512))
ephoto_thumb_size_set(ephoto, ephoto->config->thumb_size);
ephoto->layout = elm_layout_add(ephoto->win);
elm_layout_file_set(ephoto->layout, PACKAGE_DATA_DIR "/themes/ephoto.edj",
"ephoto,main,layout");
evas_object_size_hint_weight_set(ephoto->layout, EVAS_HINT_EXPAND,
EVAS_HINT_EXPAND);
evas_object_size_hint_fill_set(ephoto->layout, EVAS_HINT_FILL,
EVAS_HINT_FILL);
evas_object_event_callback_add(ephoto->layout, EVAS_CALLBACK_MOUSE_MOVE,
_mouse_move_cb, ephoto);
evas_object_event_callback_add(ephoto->layout, EVAS_CALLBACK_MOUSE_UP,
_mouse_up_cb, ephoto);
elm_win_resize_object_add(ephoto->win, ephoto->layout);
evas_object_show(ephoto->layout);
ephoto->pager = elm_naviframe_add(ephoto->win);
elm_object_focus_allow_set(ephoto->pager, EINA_FALSE);
elm_naviframe_prev_btn_auto_pushed_set(ephoto->pager, EINA_FALSE);
@ -265,12 +450,10 @@ ephoto_window_add(const char *path)
EVAS_HINT_EXPAND);
evas_object_size_hint_fill_set(ephoto->pager, EVAS_HINT_FILL,
EVAS_HINT_FILL);
evas_object_event_callback_add(ephoto->pager, EVAS_CALLBACK_FOCUS_IN,
_pager_focused, ephoto);
elm_win_resize_object_add(ephoto->win, ephoto->pager);
elm_layout_content_set(ephoto->layout, "ephoto.swallow.main", ephoto->pager);
evas_object_show(ephoto->pager);
ephoto->thumb_browser = ephoto_thumb_browser_add(ephoto, ephoto->pager);
ephoto->thumb_browser = ephoto_thumb_browser_add(ephoto, ephoto->layout);
if (!ephoto->thumb_browser)
{
evas_object_del(ephoto->win);
@ -286,8 +469,8 @@ ephoto_window_add(const char *path)
_ephoto_thumb_browser_changed_directory, ephoto);
evas_object_smart_callback_add(ephoto->thumb_browser, "slideshow",
_ephoto_thumb_browser_slideshow, ephoto);
ephoto->single_browser = ephoto_single_browser_add(ephoto, ephoto->pager);
ephoto->single_browser = ephoto_single_browser_add(ephoto, ephoto->layout);
if (!ephoto->single_browser)
{
evas_object_del(ephoto->win);
@ -301,8 +484,7 @@ ephoto_window_add(const char *path)
_ephoto_single_browser_back, ephoto);
evas_object_smart_callback_add(ephoto->single_browser, "slideshow",
_ephoto_single_browser_slideshow, ephoto);
ephoto->slideshow = ephoto_slideshow_add(ephoto, ephoto->pager);
ephoto->slideshow = ephoto_slideshow_add(ephoto, ephoto->layout);
if (!ephoto->slideshow)
{
evas_object_del(ephoto->win);
@ -315,6 +497,104 @@ ephoto_window_add(const char *path)
evas_object_smart_callback_add(ephoto->slideshow, "back",
_ephoto_slideshow_back, ephoto);
ephoto->dir_browser = ephoto_directory_browser_add(ephoto, ephoto->layout);
elm_layout_content_set(ephoto->layout, "ephoto.swallow.folders",
ephoto->dir_browser);
evas_object_event_callback_add(ephoto->dir_browser, EVAS_CALLBACK_MOUSE_IN,
_mouse_in_cb, ephoto);
evas_object_event_callback_add(ephoto->dir_browser, EVAS_CALLBACK_MOUSE_OUT,
_mouse_out_cb, ephoto);
evas_object_show(ephoto->dir_browser);
ephoto->statusbar = elm_box_add(ephoto->layout);
elm_object_tree_focus_allow_set(ephoto->statusbar, EINA_FALSE);
elm_box_horizontal_set(ephoto->statusbar, EINA_TRUE);
evas_object_size_hint_weight_set(ephoto->statusbar,
EVAS_HINT_EXPAND, 0.0);
evas_object_size_hint_align_set(ephoto->statusbar, EVAS_HINT_FILL,
EVAS_HINT_FILL);
elm_layout_content_set(ephoto->layout, "ephoto.swallow.controls",
ephoto->statusbar);
evas_object_event_callback_add(ephoto->statusbar, EVAS_CALLBACK_MOUSE_IN,
_mouse_in_cb, ephoto);
evas_object_event_callback_add(ephoto->statusbar, EVAS_CALLBACK_MOUSE_OUT,
_mouse_out_cb, ephoto);
evas_object_show(ephoto->statusbar);
ic = elm_icon_add(ephoto->statusbar);
evas_object_size_hint_min_set(ic, 20*elm_config_scale_get(),
20*elm_config_scale_get());
elm_icon_order_lookup_set(ic, ELM_ICON_LOOKUP_FDO_THEME);
elm_icon_standard_set(ic, "folder");
evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_BOTH, 1, 1);
but = elm_button_add(ephoto->statusbar);
elm_object_part_content_set(but, "icon", ic);
evas_object_smart_callback_add(but, "clicked", _folder_icon_clicked, ephoto);
elm_object_tooltip_text_set(but, _("Show Folders"));
elm_object_tooltip_orient_set(but, ELM_TOOLTIP_ORIENT_RIGHT);
elm_box_pack_end(ephoto->statusbar, but);
evas_object_show(but);
evas_object_data_set(ephoto->layout, "folder_button", but);
ephoto->controls_left = elm_box_add(ephoto->statusbar);
elm_box_horizontal_set(ephoto->controls_left, EINA_TRUE);
evas_object_size_hint_weight_set(ephoto->controls_left,
0.0, 0.0);
evas_object_size_hint_align_set(ephoto->controls_left, EVAS_HINT_FILL,
EVAS_HINT_FILL);
elm_box_pack_end(ephoto->statusbar, ephoto->controls_left);
evas_object_show(ephoto->controls_left);
ephoto->infolabel = elm_label_add(ephoto->statusbar);
elm_object_style_set(ephoto->infolabel, "info");
elm_label_line_wrap_set(ephoto->infolabel, ELM_WRAP_MIXED);
elm_object_text_set(ephoto->infolabel, _("Information"));
evas_object_size_hint_weight_set(ephoto->infolabel,
EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(ephoto->infolabel, EVAS_HINT_FILL,
EVAS_HINT_FILL);
evas_object_size_hint_aspect_set(ephoto->infolabel, EVAS_ASPECT_CONTROL_HORIZONTAL,
1, 1);
elm_box_pack_end(ephoto->statusbar, ephoto->infolabel);
evas_object_show(ephoto->infolabel);
ephoto->controls_right = elm_box_add(ephoto->statusbar);
elm_box_horizontal_set(ephoto->controls_right, EINA_TRUE);
evas_object_size_hint_weight_set(ephoto->controls_right,
0.0, 0.0);
evas_object_size_hint_align_set(ephoto->controls_right, EVAS_HINT_FILL,
EVAS_HINT_FILL);
elm_box_pack_end(ephoto->statusbar, ephoto->controls_right);
evas_object_show(ephoto->controls_right);
ic = elm_icon_add(ephoto->statusbar);
evas_object_size_hint_min_set(ic, 20*elm_config_scale_get(),
20*elm_config_scale_get());
elm_icon_order_lookup_set(ic, ELM_ICON_LOOKUP_FDO_THEME);
elm_icon_standard_set(ic, "media-playback-start");
evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_BOTH, 1, 1);
but = elm_button_add(ephoto->statusbar);
elm_object_part_content_set(but, "icon", ic);
evas_object_smart_callback_add(but, "clicked", _slideshow_icon_clicked, ephoto);
elm_object_tooltip_text_set(but, _("Slideshow"));
elm_object_tooltip_orient_set(but, ELM_TOOLTIP_ORIENT_TOP);
elm_box_pack_end(ephoto->statusbar, but);
evas_object_show(but);
ic = elm_icon_add(ephoto->statusbar);
evas_object_size_hint_min_set(ic, 20*elm_config_scale_get(),
20*elm_config_scale_get());
elm_icon_order_lookup_set(ic, ELM_ICON_LOOKUP_FDO_THEME);
elm_icon_standard_set(ic, "preferences-system");
evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_BOTH, 1, 1);
but = elm_button_add(ephoto->statusbar);
elm_object_part_content_set(but, "icon", ic);
evas_object_smart_callback_add(but, "clicked", _settings_icon_clicked, ephoto);
elm_object_tooltip_text_set(but, _("Settings"));
elm_object_tooltip_orient_set(but, ELM_TOOLTIP_ORIENT_LEFT);
elm_box_pack_end(ephoto->statusbar, but);
evas_object_show(but);
if ((!path) || (!ecore_file_exists(path)))
{
if (ephoto->config->open)
@ -337,14 +617,16 @@ ephoto_window_add(const char *path)
if (ecore_file_is_dir(path))
{
ephoto_directory_set(ephoto, path, NULL, EINA_FALSE, EINA_FALSE);
eina_stringshare_replace(&ephoto->config->directory,
ecore_file_realpath(path));
_ephoto_thumb_browser_show(ephoto, NULL);
}
else
{
char *dir = ecore_file_dir_get(path);
ephoto_directory_set(ephoto, dir, NULL, EINA_FALSE, EINA_FALSE);
eina_stringshare_replace(&ephoto->config->directory,
ecore_file_realpath(dir));
free(dir);
ephoto_single_browser_path_pending_set(ephoto->single_browser, path);
@ -352,11 +634,14 @@ ephoto_window_add(const char *path)
ephoto->single_browser);
ephoto->state = EPHOTO_STATE_SINGLE;
}
ephoto_thumb_browser_top_dir_set(ephoto, ephoto->config->directory);
ephoto_directory_browser_top_dir_set(ephoto, ephoto->config->directory);
ephoto_directory_browser_initialize_structure(ephoto);
evas_object_resize(ephoto->win, ephoto->config->window_width,
ephoto->config->window_height);
evas_object_show(ephoto->win);
ephoto->overlay_timer = ecore_timer_add(5.0, _timer_cb, ephoto);
return ephoto->win;
}
@ -490,7 +775,6 @@ _ephoto_change_dir(void *data)
{
Ephoto_Dir_Data *ed = data;
ed->ephoto->thumb_entry = NULL;
ed->ephoto->job.change_dir = NULL;
_ephoto_populate_entries(ed);
}

@ -195,7 +195,7 @@ _editor_del(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
}
void
ephoto_red_eye_add(Evas_Object *main, Evas_Object *parent, Evas_Object *image)
ephoto_red_eye_add(Ephoto *ephoto, Evas_Object *main, Evas_Object *parent, Evas_Object *image)
{
Evas_Object *slider, *label;
Ephoto_Reye *er;
@ -222,7 +222,7 @@ ephoto_red_eye_add(Evas_Object *main, Evas_Object *parent, Evas_Object *image)
evas_object_event_callback_add(er->image, EVAS_CALLBACK_MOUSE_UP,
_reye_clicked, er);
er->editor = ephoto_editor_add(parent, _("Red Eye Removal"),
er->editor = ephoto_editor_add(ephoto, _("Red Eye Removal"),
"ereye", er);
evas_object_event_callback_add(er->editor, EVAS_CALLBACK_DEL, _editor_del,
er);

@ -14,9 +14,7 @@ struct _Ephoto_Single_Browser
Evas_Object *mhbox;
Evas_Object *table;
Evas_Object *viewer;
Evas_Object *infolabel;
Evas_Object *nolabel;
Evas_Object *botbox;
Evas_Object *event;
Elm_Object_Item *save;
const char *pending_path;
@ -54,8 +52,6 @@ static void _ephoto_main_key_down(void *data, Evas *e EINA_UNUSED,
Evas_Object *obj EINA_UNUSED,void *event_info EINA_UNUSED);
static void _ephoto_main_focused(void *data, Evas *e EINA_UNUSED,
Evas_Object *obj EINA_UNUSED,void *event_info EINA_UNUSED);
static void _ephoto_show_slideshow(void *data, Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED);
static void _ephoto_show_settings(void *data, Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED);
static void _ephoto_main_back(void *data, Evas_Object *obj EINA_UNUSED,
@ -108,29 +104,7 @@ _ephoto_update_bottom_bar(Ephoto_Single_Browser *sb)
_("Resolution"), w, h, _("File Size"), tmp);
free(tmp);
if (!evas_object_visible_get(sb->botbox))
{
evas_object_del(sb->botbox);
sb->botbox = elm_notify_add(sb->ephoto->win);
elm_notify_align_set(sb->botbox, 0.5, 1.0);
evas_object_size_hint_weight_set(sb->botbox, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_fill_set(sb->botbox, EVAS_HINT_FILL, EVAS_HINT_FILL);
sb->infolabel = elm_label_add(sb->botbox);
elm_label_line_wrap_set(sb->infolabel, ELM_WRAP_NONE);
evas_object_size_hint_weight_set(sb->infolabel, EVAS_HINT_EXPAND,
EVAS_HINT_FILL);
evas_object_size_hint_align_set(sb->infolabel, EVAS_HINT_FILL,
EVAS_HINT_FILL);
elm_object_content_set(sb->botbox, sb->infolabel);
evas_object_show(sb->infolabel);
}
elm_object_text_set(sb->infolabel, image_info);
elm_notify_timeout_set(sb->botbox, 5);
evas_object_show(sb->botbox);
elm_object_text_set(sb->ephoto->infolabel, image_info);
}
static char *
@ -1053,13 +1027,11 @@ _crop_image(void *data, Evas_Object *obj EINA_UNUSED,
if (sb->viewer)
{
sb->editing = EINA_TRUE;
if (sb->botbox)
evas_object_hide(sb->botbox);
sb->cropping = EINA_TRUE;
Ephoto_Viewer *v = evas_object_data_get(sb->viewer, "viewer");
elm_table_unpack(v->table, v->image);
ephoto_cropper_add(sb->main, sb->mhbox, v->table, v->image);
ephoto_cropper_add(sb->ephoto, sb->main, sb->mhbox, v->table, v->image);
}
}
@ -1071,11 +1043,9 @@ _go_bcg(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
if (sb->viewer)
{
sb->editing = EINA_TRUE;
if (sb->botbox)
evas_object_hide(sb->botbox);
Ephoto_Viewer *v = evas_object_data_get(sb->viewer, "viewer");
ephoto_bcg_add(sb->main, sb->mhbox, v->image);
ephoto_bcg_add(sb->ephoto, sb->main, sb->mhbox, v->image);
}
}
@ -1087,11 +1057,9 @@ _go_hsv(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
if (sb->viewer)
{
sb->editing = EINA_TRUE;
if (sb->botbox)
evas_object_hide(sb->botbox);
Ephoto_Viewer *v = evas_object_data_get(sb->viewer, "viewer");
ephoto_hsv_add(sb->main, sb->mhbox, v->image);
ephoto_hsv_add(sb->ephoto, sb->main, sb->mhbox, v->image);
}
}
@ -1104,11 +1072,9 @@ _go_color(void *data, Evas_Object *obj EINA_UNUSED,
if (sb->viewer)
{
sb->editing = EINA_TRUE;
if (sb->botbox)
evas_object_hide(sb->botbox);
Ephoto_Viewer *v = evas_object_data_get(sb->viewer, "viewer");
ephoto_color_add(sb->main, sb->mhbox, v->image);
ephoto_color_add(sb->ephoto, sb->main, sb->mhbox, v->image);
}
}
@ -1121,11 +1087,9 @@ _go_reye(void *data, Evas_Object *obj EINA_UNUSED,
if (sb->viewer)
{
sb->editing = EINA_TRUE;
if (sb->botbox)
evas_object_hide(sb->botbox);
Ephoto_Viewer *v = evas_object_data_get(sb->viewer, "viewer");
ephoto_red_eye_add(sb->main, sb->mhbox, v->image);
ephoto_red_eye_add(sb->ephoto, sb->main, sb->mhbox, v->image);
}
}
@ -1138,8 +1102,6 @@ _go_auto_eq(void *data, Evas_Object *obj EINA_UNUSED,
if (sb->viewer)
{
sb->editing = EINA_TRUE;
if (sb->botbox)
evas_object_hide(sb->botbox);
Ephoto_Viewer *v = evas_object_data_get(sb->viewer, "viewer");
ephoto_filter_histogram_eq(sb->main, v->image);
@ -1155,8 +1117,6 @@ _go_blur(void *data, Evas_Object *obj EINA_UNUSED,
if (sb->viewer)
{
sb->editing = EINA_TRUE;
if (sb->botbox)
evas_object_hide(sb->botbox);
Ephoto_Viewer *v = evas_object_data_get(sb->viewer, "viewer");
ephoto_filter_blur(sb->main, v->image);
@ -1172,8 +1132,6 @@ _go_sharpen(void *data, Evas_Object *obj EINA_UNUSED,
if (sb->viewer)
{
sb->editing = EINA_TRUE;
if (sb->botbox)
evas_object_hide(sb->botbox);
Ephoto_Viewer *v = evas_object_data_get(sb->viewer, "viewer");
ephoto_filter_sharpen(sb->main, v->image);
@ -1189,8 +1147,6 @@ _go_black_and_white(void *data, Evas_Object *obj EINA_UNUSED,
if (sb->viewer)
{
sb->editing = EINA_TRUE;
if (sb->botbox)
evas_object_hide(sb->botbox);
Ephoto_Viewer *v = evas_object_data_get(sb->viewer, "viewer");
ephoto_filter_black_and_white(sb->main, v->image);
@ -1206,14 +1162,37 @@ _go_old_photo(void *data, Evas_Object *obj EINA_UNUSED,
if (sb->viewer)
{
sb->editing = EINA_TRUE;
if (sb->botbox)
evas_object_hide(sb->botbox);
Ephoto_Viewer *v = evas_object_data_get(sb->viewer, "viewer");
ephoto_filter_old_photo(sb->main, v->image);
}
}