Ephoto: Add a nice effect for fading out the controls bar and add the beginning of moving slideshows (needs work still).

master
Stephen okra Houston 6 years ago
parent a2f674b21b
commit af8353c0f7
  1. 368
      data/themes/ephoto.edc
  2. 3
      src/bin/ephoto.h
  3. 46
      src/bin/ephoto_config.c
  4. 36
      src/bin/ephoto_file.c
  5. 4
      src/bin/ephoto_filters.c
  6. 19
      src/bin/ephoto_main.c
  7. 26
      src/bin/ephoto_single_browser.c
  8. 303
      src/bin/ephoto_slideshow.c

@ -19,6 +19,8 @@ collections {
public offsetv = 0;
public custom = 0 ;
public custom_folders = 0;
public folders_visible = 1;
public controls_visible = 1;
public message(Msg_Type:type, id, ...) {
if ((type == MSG_INT_SET) && (id == 1)) {
new hoffset = getarg(2);
@ -58,6 +60,54 @@ collections {
STATE_MIN, minw, 0);
}
}
public hide_folders(val, Float:pos) {
set_int(folders_visible, 0);
set_state_anim(PART:"ephoto.swallow.folders",
"hidden", 0.0, DECELERATE, pos);
set_state_anim(PART:"folders_shadow",
"hidden", 0.0, DECELERATE, pos);
set_state_anim(PART:"ephoto,folders",
"hidden", 0.0, DECELERATE, pos);
}
public show_folders(val, Float:pos) {
set_int(folders_visible, 1);
if (get_int(custom_folders)) {
set_state_anim(PART:"ephoto.swallow.folders",
"custom", 0.0, ACCELERATE, pos);
}
else {
set_state_anim(PART:"ephoto.swallow.folders",
"default", 0.0, ACCELERATE, pos);
}
set_state_anim(PART:"folders_shadow",
"default", 0.0, ACCELERATE, pos);
set_state_anim(PART:"ephoto,folders",
"default", 0.0, ACCELERATE, pos);
}
public hide_controls(val, Float:pos) {
set_int(controls_visible, 0);
set_state_anim(PART:"ephoto.swallow.controls",
"hidden", 0.0, DECELERATE, pos);
set_state_anim(PART:"controls_shadow",
"hidden", 0.0, DECELERATE, pos);
set_state_anim(PART:"ephoto,controls",
"hidden", 0.0, DECELERATE, pos);
}
public show_controls(val, Float:pos) {
set_int(controls_visible, 1);
if (get_int(custom)) {
set_state_anim(PART:"ephoto.swallow.controls",
"custom", 0.0, ACCELERATE, pos);
}
else {
set_state_anim(PART:"ephoto.swallow.controls",
"default", 0.0, ACCELERATE, pos);
}
set_state_anim(PART:"controls_shadow",
"default", 0.0, ACCELERATE, pos);
set_state_anim(PART:"ephoto,controls",
"default", 0.0, ACCELERATE, pos);
}
}
parts {
rect { name: "ephoto,main,clip";
@ -160,13 +210,13 @@ collections {
min: 220 0;
rel1.to: "ephoto.swallow.folders";
rel2.to: "ephoto.swallow.folders";
visible: 0;
color: 255 255 255 255;
visible: 1;
}
description { state: "visible" 0.0;
description { state: "hidden" 0.0;
inherit: default 0.0;
rel1.to: "ephoto.swallow.folders";
rel2.to: "ephoto.swallow.folders";
visible: 1;
color: 255 255 255 0;
visible: 0;
}
}
image { name: "folders_shadow";
@ -176,18 +226,17 @@ collections {
fixed: 1 1;
image.normal: "images/shadow_circle_vert.png";
min: 32 0;
color: 255 255 255 0;
visible: 0;
}
description { state: "visible" 0.0;
inherit: "default" 0.0;
fixed: 1 1;
rel1.to: "ephoto,folders";
rel1.relative: 1.0 0.0;
rel2.to: "ephoto,folders";
color: 255 255 255 128;
visible: 1;
}
description { state: "hidden" 0.0;
inherit: "default" 0.0;
color: 255 255 255 0;
visible: 0;
}
}
rect { name: "folders_base";
clip_to: "ephoto,folders";
@ -204,21 +253,20 @@ collections {
clip_to: "ephoto,folders";
description { state: "default" 0.0;
fixed: 1 1;
rel1.to: "ephoto,controls";
rel1.relative: 0.0 0.0;
rel2.to: "ephoto,controls";
rel2.relative: 0.0 0.0;
visible: 0;
}
description { state: "visible" 0.0;
inherit: "default" 0.0;
min: 220 0;
rel1.to: "ephoto.swallow.main";
rel1.relative: 0.0 0.0;
rel2.to: "ephoto,controls";
rel2.relative: 0.0 0.0;
align: 0.0 0.0;
color: 255 255 255 255;
visible: 1;
}
description { state: "hidden" 0.0;
inherit: "default" 0.0;
color: 255 255 255 0;
visible: 0;
}
}
rect { name: "ephoto,controls";
scale: 1;
@ -282,10 +330,6 @@ collections {
description { state: "hidden" 0.0;
inherit: "default" 0.0;
color: 255 255 255 0;
rel1.to: "ephoto.swallow.main";
rel1.relative: 0.0 1.0;
rel2.to: "ephoto.swallow.main";
rel2.relative: 1.0 2.0;
visible: 0;
}
}
@ -307,42 +351,34 @@ collections {
}
program { signal: "ephoto,folders,hide";
source: "ephoto";
action: STATE_SET "default" 0.0;
target: "ephoto.swallow.folders";
target: "folders_shadow";
target: "ephoto,folders";
script {
if (get_int(folders_visible)) {
anim(1.0, "hide_folders", 1);
}
}
}
program { signal: "ephoto,folders,show";
source: "ephoto";
script {
if (get_int(custom_folders)) {
set_state(PART:"ephoto.swallow.folders", "custom", 0.0);
if (!get_int(folders_visible)) {
anim(0.5, "show_folders", 1);
}
else {
set_state(PART:"ephoto.swallow.folders", "visible", 0.0);
}
set_state(PART:"folders_shadow", "visible", 0.0);
set_state(PART:"ephoto,folders", "visible", 0.0);
}
}
program { signal: "ephoto,controls,hide";
source: "ephoto";
action: STATE_SET "hidden" 0.0;
target: "ephoto.swallow.controls";
target: "controls_shadow";
target: "ephoto,controls";
script {
if (get_int(controls_visible)) {
anim(1.0, "hide_controls", 1);
}
}
}
program { signal: "ephoto,controls,show";
source: "ephoto";
script {
if (get_int(custom)) {
set_state(PART:"ephoto.swallow.controls", "custom", 0.0);
if (!get_int(controls_visible)) {
anim(0.5, "show_controls", 1);
}
else {
set_state(PART:"ephoto.swallow.controls", "default", 0.0);
}
set_state(PART:"controls_shadow", "default", 0.0);
set_state(PART:"ephoto,controls", "default", 0.0);
}
}
}
@ -368,6 +404,9 @@ collections {
}
}
group { name: "ephoto,slideshow,base";
data {
item: transitions "fade black_fade horizontal vertical square";
}
parts {
rect { "background";
scale: 1;
@ -378,20 +417,255 @@ collections {
}
rect { "slide_clip";
scale: 1;
description { state: "default" 0.0;
rel1.to: "background";
rel2.to: "background";
color: 255 255 255 255;
}
description { state: "black_fade_init" 0.0;
inherit: "default" 0.0;
color: 255 255 255 255;
}
description { state: "black_fade" 0.0;
inherit: "default" 0.0;
color: 0 0 0 255;
}
}
rect { "slide_clip2";
scale: 1;
description { state: "default" 0.0;
rel1.to: "background";
rel2.to: "background";
color: 255 255 255 0;
}
description { state: "black_fade_init" 0.0;
inherit: "default" 0.0;
color: 0 0 0 255;
}
description { state: "black_fade" 0.0;
inherit: "default" 0.0;
color: 255 255 255 255;
}
}
swallow { "ephoto.swallow.slideshow.item";
scale: 1;
mouse_events: 1;
clip_to: "slide_clip";
description {
state: "default" 0.0;
rel1.to: "slide_clip";
rel2.to: "slide_clip";
}
}
swallow { "ephoto.swallow.slideshow.item2";
scale: 1;
mouse_events: 1;
clip_to: "slide_clip2";
description {
state: "default" 0.0;
rel1.to: "slide_clip2";
rel2.to: "slide_clip2";
}
}
}
programs {
program {
signal: "ephoto,black_fade";
source: "ephoto";
action: STATE_SET "black_fade_init" 0.0;
target: "slide_clip";
target: "slide_clip2";
after: "black_fade_2";
}
program { name: "black_fade_2";
action: STATE_SET "black_fade" 0.0;
target: "slide_clip";
transition: SINUSOIDAL 0.75;
after: "black_fade_3";
}
program { name: "black_fade_3";
action: STATE_SET "black_fade" 0.0;
target: "slide_clip2";
transition: SINUSOIDAL 0.75;
after: "end";
}
program { name: "end";
action: SIGNAL_EMIT "ephoto,transition,end" "ephoto";
}
program {
signal: "ephoto,transition,done";
source: "ephoto";
action: STATE_SET "default" 0.0;
target: "slide_clip";
target: "slide_clip2";
}
}
}
group { name: "ephoto,slideshow,item";
script {
public timeout;
public message(Msg_Type:type, id, ...) {
if ((type == MSG_FLOAT_SET) && (id == 1)) {
new Float:time;
time = getfarg(2);
set_float(timeout, time);
}
}
public left_to_right(val, Float:pos) {
set_state_anim(PART:"ephoto.swallow.slideshow.item",
"end_left_to_right", 0.0,
SINUSOIDAL, pos);
}
public right_to_left(val, Float:pos) {
set_state_anim(PART:"ephoto.swallow.slideshow.item",
"end_right_to_left", 0.0,
SINUSOIDAL, pos);
}
public top_to_bottom(val, Float:pos) {
set_state_anim(PART:"ephoto.swallow.slideshow.item",
"end_top_to_bottom", 0.0,
SINUSOIDAL, pos);
}
public bottom_to_top(val, Float:pos) {
set_state_anim(PART:"ephoto.swallow.slideshow.item",
"end_bottom_to_top", 0.0,
SINUSOIDAL, pos);
}
}
parts {
rect { "background";
scale: 1;
description {
state: "default" 0.0;
color: 0 0 0 255;
}
}
rect { "slide_clip";
scale: 1;
description { state: "default" 0.0;
rel1.to: "background";
rel2.to: "background";
color: 255 255 255 255;
}
}
swallow { "ephoto.swallow.slideshow";
swallow { "ephoto.swallow.slideshow.item";
scale: 1;
clip_to: "slide_clip";
mouse_events: 1;
description {
state: "default" 0.0;
rel1.to: "background";
rel1.relative: 0.0 0.0;
rel2.to: "background";
rel2.relative: 1.0 1.0;
}
description {
state: "default_left_to_right" 0.0;
rel1.to: "background";
rel1.relative: -0.2 0.0;
rel2.to: "background";
rel2.relative: 1.0 1.0;
}
description {
state: "end_left_to_right" 0.0;
inherit: "default" 0.0;
rel1.relative: 0.0 0.0;
rel2.relative: 1.2 1.0;
}
}
description {
state: "default_right_to_left" 0.0;
rel1.to: "background";
rel1.relative: 0.0 0.0;
rel2.to: "background";
rel2.relative: 1.2 1.0;
}
description {
state: "end_right_to_left" 0.0;
inherit: "default" 0.0;
rel1.relative: -0.2 0.0;
rel2.relative: 1.0 1.0;
}
description {
state: "default_top_to_bottom" 0.0;
rel1.to: "background";
rel1.relative: 0.0 -0.2;
rel2.to: "background";
rel2.relative: 1.0 1.0;
}
description {
state: "end_top_to_bottom" 0.0;
inherit: "default" 0.0;
rel1.relative: 0.0 0.0;
rel2.relative: 1.0 1.2;
}
description {
state: "default_bottom_to_top" 0.0;
rel1.to: "background";
rel1.relative: 0.0 0.0;
rel2.to: "background";
rel2.relative: 1.0 1.2;
}
description {
state: "end_bottom_to_top" 0.0;
inherit: "default" 0.0;
rel1.relative: 0.0 -0.2;
rel2.relative: 1.0 1.0;
}
}
}
programs {
program {
signal: "ephoto,slideshow,move,left,to,right";
source: "ephoto";
script {
anim(get_float(timeout), "left_to_right", 1);
}
}
program {
signal: "ephoto,slideshow,move,right,to,left";
source: "ephoto";
script {
anim(get_float(timeout), "right_to_left", 1);
}
}
program {
signal: "ephoto,slideshow,move,top,to,bottom";
source: "ephoto";
script {
anim(get_float(timeout), "top_to_bottom", 1);
}
}
program {
signal: "ephoto,slideshow,move,bottom,to,top";
source: "ephoto";
script {
anim(get_float(timeout), "bottom_to_top", 1);
}
}
program {
signal: "ephoto,slideshow,default,left,to,right";
source: "ephoto";
action: STATE_SET "default_left_to_right" 0.0;
target: "ephoto.swallow.slideshow.item";
}
program {
signal: "ephoto,slideshow,default,right,to,left";
source: "ephoto";
action: STATE_SET "default_right_to_left" 0.0;
target: "ephoto.swallow.slideshow.item";
}
program {
signal: "ephoto,slideshow,default,top,to,bottom";
source: "ephoto";
action: STATE_SET "default_top_to_bottom" 0.0;
target: "ephoto.swallow.slideshow.item";
}
program {
signal: "ephoto,slideshow,default,bottom,to,top";
source: "ephoto";
action: STATE_SET "default_bottom_to_top" 0.0;
target: "ephoto.swallow.slideshow.item";
}
}
}
group { name: "ephoto,image,cropper,base";

@ -92,6 +92,7 @@ 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);
void ephoto_slideshow_adjust_offsets(Ephoto *ephoto);
/* smart callbacks called: "back" - the user wants to go back to the previous
* screen. */
@ -219,12 +220,14 @@ struct _Ephoto_Config
const char *open;
Eina_Bool prompts;
Eina_Bool drop;
Eina_Bool movess;
Evas_Object *slide_time;
Evas_Object *slide_trans;
Evas_Object *open_dir;
Evas_Object *open_dir_custom;
Evas_Object *show_prompts;
Evas_Object *move_drop;
Evas_Object *slide_move;
};
struct _Ephoto

@ -1,6 +1,6 @@
#include "ephoto.h"
#define CONFIG_VERSION 16
#define CONFIG_VERSION 17
static int _ephoto_config_load(Ephoto *ephoto);
static Eina_Bool _ephoto_on_config_save(void *data);
@ -39,6 +39,7 @@ _config_save_cb(void *data, Evas_Object *obj EINA_UNUSED,
eina_stringshare_replace(&ephoto->config->open, path);
ephoto->config->prompts = elm_check_state_get(ephoto->config->show_prompts);
ephoto->config->drop = elm_check_state_get(ephoto->config->move_drop);
ephoto->config->movess = elm_check_state_get(ephoto->config->slide_move);
if (elm_spinner_value_get(ephoto->config->slide_time) > 0)
ephoto->config->slideshow_timeout =
elm_spinner_value_get(ephoto->config->slide_time);
@ -148,10 +149,36 @@ _spinner_changed(void *data EINA_UNUSED, Evas_Object *obj,
elm_spinner_label_format_set(obj, buf);
}
static Eina_List *
_ephoto_transitions_list_get(const char *str)
{
Eina_List *list = NULL;
const char *s, *b;
if (!str) return NULL;
for (b = s = str; 1; s++)
{
if ((*s == ' ') || (!*s))
{
char *t = malloc(s - b + 1);
if (t)
{
strncpy(t, b, s - b);
t[s - b] = 0;
list = eina_list_append(list, eina_stringshare_add(t));
free(t);
}
b = s + 1;
}
if (!*s) break;
}
return list;
}
static void
_config_slideshow(Ephoto *ephoto, Evas_Object *parent)
{
Evas_Object *frame, *table, *label, *spinner, *hoversel;
Eina_List *transitions;
Evas_Object *frame, *table, *check, *label, *spinner, *hoversel;
const Eina_List *l;
const char *transition;
char buf[PATH_MAX];
@ -198,9 +225,12 @@ _config_slideshow(Ephoto *ephoto, Evas_Object *parent)
elm_table_pack(table, label, 0, 1, 1, 1);
evas_object_show(label);
transitions = _ephoto_transitions_list_get(edje_object_data_get(elm_layout_edje_get
(ephoto->slideshow), "transitions"));
hoversel = elm_hoversel_add(table);
elm_hoversel_hover_parent_set(hoversel, ephoto->win);
EINA_LIST_FOREACH(elm_slideshow_transitions_get(ephoto->slideshow), l,
EINA_LIST_FOREACH(transitions, l,
transition) elm_hoversel_item_add(hoversel, transition, NULL, 0,
_hv_select, transition);
elm_hoversel_item_add(hoversel, "None", NULL, 0, _hv_select, NULL);
@ -211,6 +241,14 @@ _config_slideshow(Ephoto *ephoto, Evas_Object *parent)
elm_table_pack(table, hoversel, 1, 1, 1, 1);
evas_object_show(hoversel);
ephoto->config->slide_trans = hoversel;
check = elm_check_add(table);
elm_object_text_set(check, _("Moving Slideshow"));
evas_object_size_hint_align_set(check, 0.0, EVAS_HINT_FILL);
elm_check_state_set(check, ephoto->config->movess);
elm_table_pack(table, check, 0, 2, 2, 1);
evas_object_show(check);
ephoto->config->slide_move = check;
}
static Evas_Object *
@ -700,6 +738,7 @@ ephoto_config_init(Ephoto *ephoto)
C_VAL(D, T, open, EET_T_STRING);
C_VAL(D, T, prompts, EET_T_INT);
C_VAL(D, T, drop, EET_T_INT);
C_VAL(D, T, movess, EET_T_INT);
switch (_ephoto_config_load(ephoto))
{
case 0:
@ -714,6 +753,7 @@ ephoto_config_init(Ephoto *ephoto)
ephoto->config->open = eina_stringshare_add(getenv("HOME"));
ephoto->config->prompts = 1;
ephoto->config->drop = 0;
ephoto->config->movess = 1;
break;
default:

@ -8,7 +8,6 @@ _complete_ok(void *data, Evas_Object *obj EINA_UNUSED,
Ephoto *ephoto = evas_object_data_get(popup, "ephoto");
evas_object_del(popup);
evas_object_freeze_events_set(ephoto->pager, EINA_FALSE);
elm_object_focus_set(ephoto->pager, EINA_TRUE);
}
@ -17,7 +16,6 @@ _complete(Ephoto *ephoto, const char *title, const char *text)
{
Evas_Object *popup, *box, *label, *ic, *button;
evas_object_freeze_events_set(ephoto->pager, EINA_TRUE);
popup = elm_popup_add(ephoto->win);
elm_object_part_text_set(popup, "title,text", title);
@ -60,7 +58,6 @@ _prompt_cancel(void *data, Evas_Object *obj EINA_UNUSED,
Ephoto *ephoto = evas_object_data_get(popup, "ephoto");
evas_object_del(popup);
evas_object_freeze_events_set(ephoto->pager, EINA_FALSE);
elm_object_focus_set(ephoto->pager, EINA_TRUE);
}
@ -69,8 +66,6 @@ _prompt(Ephoto *ephoto, const char *title, const char *text)
{
Evas_Object *popup, *box, *label;
evas_object_freeze_events_set(ephoto->pager, EINA_TRUE);
popup = elm_popup_add(ephoto->win);
elm_object_part_text_set(popup, "title,text", title);
elm_popup_orient_set(popup, ELM_POPUP_ORIENT_CENTER);
@ -115,7 +110,6 @@ _save_image_as_overwrite(void *data, Evas_Object *obj EINA_UNUSED,
ephoto_single_browser_entry_set(ephoto->single_browser, entry);
evas_object_del(popup);
elm_object_focus_set(ephoto->pager, EINA_TRUE);
evas_object_freeze_events_set(ephoto->pager, EINA_FALSE);
return;
}
}
@ -131,7 +125,6 @@ _save_image_as_overwrite(void *data, Evas_Object *obj EINA_UNUSED,
}
evas_object_del(popup);
elm_object_focus_set(ephoto->pager, EINA_TRUE);
evas_object_freeze_events_set(ephoto->pager, EINA_FALSE);
}
static void
@ -188,9 +181,6 @@ _upload_image_complete_cb(void *data, int ev_type EINA_UNUSED, void *event)
evas_object_del(ppopup);
elm_object_focus_set(ephoto->pager, EINA_TRUE);
evas_object_freeze_events_set(ephoto->pager, EINA_FALSE);
evas_object_freeze_events_set(ephoto->pager, EINA_TRUE);
popup = elm_popup_add(ephoto->win);
elm_object_part_text_set(popup, "title,text", _("Image Uploaded"));
@ -353,7 +343,6 @@ _new_dir_confirm(void *data, Evas_Object *obj EINA_UNUSED,
_("There was an error creating this directory."));
}
evas_object_del(popup);
evas_object_freeze_events_set(ephoto->pager, EINA_FALSE);
elm_object_focus_set(ephoto->pager, EINA_TRUE);
}
@ -365,7 +354,6 @@ _new_dir_cancel(void *data, Evas_Object *obj EINA_UNUSED,
Ephoto *ephoto = evas_object_data_get(popup, "ephoto");
evas_object_del(popup);
evas_object_freeze_events_set(ephoto->pager, EINA_FALSE);
elm_object_focus_set(ephoto->pager, EINA_TRUE);
}
@ -374,8 +362,6 @@ _new_dir(Ephoto *ephoto, const char *file)
{
Evas_Object *popup, *box, *entry, *button, *ic;
evas_object_freeze_events_set(ephoto->pager, EINA_TRUE);
popup = elm_popup_add(ephoto->win);
elm_object_part_text_set(popup, "title,text", _("New Directory"));
elm_popup_orient_set(popup, ELM_POPUP_ORIENT_CENTER);
@ -444,7 +430,6 @@ _rename_confirm(void *data, Evas_Object *obj EINA_UNUSED,
if (!escaped)
{
evas_object_del(popup);
evas_object_freeze_events_set(ephoto->pager, EINA_FALSE);
elm_object_focus_set(ephoto->pager, EINA_TRUE);
return;
}
@ -471,7 +456,6 @@ _rename_confirm(void *data, Evas_Object *obj EINA_UNUSED,
new_file_name);
}
evas_object_del(popup);
evas_object_freeze_events_set(ephoto->pager, EINA_FALSE);
elm_object_focus_set(ephoto->pager, EINA_TRUE);
free(escaped);
}
@ -484,7 +468,6 @@ _rename_cancel(void *data, Evas_Object *obj EINA_UNUSED,
Ephoto *ephoto = evas_object_data_get(popup, "ephoto");
evas_object_del(popup);
evas_object_freeze_events_set(ephoto->pager, EINA_FALSE);
elm_object_focus_set(ephoto->pager, EINA_TRUE);
}
@ -494,7 +477,6 @@ _rename_file(Ephoto *ephoto, const char *file)
Evas_Object *popup, *box, *entry, *button, *ic;
char buf[PATH_MAX], *bn, *string;
evas_object_freeze_events_set(ephoto->pager, EINA_TRUE);
popup = elm_popup_add(ephoto->win);
if (ecore_file_is_dir(file))
@ -562,8 +544,6 @@ _processing(Ephoto *ephoto, const char *title, const char *text)
{
Evas_Object *popup, *box, *label, *pb;
evas_object_freeze_events_set(ephoto->pager, EINA_TRUE);
popup = elm_popup_add(ephoto->win);
elm_object_part_text_set(popup, "title,text", title);
elm_popup_orient_set(popup, ELM_POPUP_ORIENT_CENTER);
@ -653,7 +633,6 @@ _move_thread_cb(void *data, Ecore_Thread *et EINA_UNUSED)
ephoto->file_pos = NULL;
evas_object_del(popup);
evas_object_freeze_events_set(ephoto->pager, EINA_FALSE);
elm_object_focus_set(ephoto->pager, EINA_TRUE);
}
@ -730,7 +709,6 @@ _copy_thread_cb(void *data, Ecore_Thread *et EINA_UNUSED)
ephoto->file_pos = NULL;
evas_object_del(popup);
evas_object_freeze_events_set(ephoto->pager, EINA_FALSE);
elm_object_focus_set(ephoto->pager, EINA_TRUE);
}
@ -811,7 +789,6 @@ _delete_thread_cb(void *data, Ecore_Thread *et EINA_UNUSED)
ephoto->file_errors = 0;
evas_object_del(popup);
evas_object_freeze_events_set(ephoto->pager, EINA_FALSE);
elm_object_focus_set(ephoto->pager, EINA_TRUE);
}
@ -888,7 +865,6 @@ _delete_dir_thread_cb(void *data, Ecore_Thread *et EINA_UNUSED)
ephoto->file_errors = 0;
evas_object_del(popup);
evas_object_freeze_events_set(ephoto->pager, EINA_FALSE);
elm_object_focus_set(ephoto->pager, EINA_TRUE);
}
@ -948,7 +924,6 @@ _empty_trash_thread_cb(void *data, Ecore_Thread *th EINA_UNUSED)
ephoto->file_errors = 0;
evas_object_del(popup);
evas_object_freeze_events_set(ephoto->pager, EINA_FALSE);
elm_object_focus_set(ephoto->pager, EINA_TRUE);
}
@ -1031,7 +1006,6 @@ _prompt_save_image_apply(void *data, Evas_Object *obj EINA_UNUSED,
ephoto_single_browser_entry_set(ephoto->single_browser, entry);
evas_object_del(popup);
elm_object_focus_set(ephoto->pager, EINA_TRUE);
evas_object_freeze_events_set(ephoto->pager, EINA_FALSE);
return;
}
}
@ -1044,7 +1018,6 @@ _prompt_save_image_apply(void *data, Evas_Object *obj EINA_UNUSED,
ephoto_single_browser_entry_set(ephoto->single_browser, entry);
evas_object_del(popup);
elm_object_focus_set(ephoto->pager, EINA_TRUE);
evas_object_freeze_events_set(ephoto->pager, EINA_FALSE);
}
static void
@ -1088,7 +1061,6 @@ _prompt_save_image_as_apply(void *data, Evas_Object *obj EINA_UNUSED, void *even
{
Evas_Object *popup, *ic, *button;
evas_object_freeze_events_set(ephoto->pager, EINA_TRUE);
popup = _prompt(ephoto, _("Overwrite Image"),
_("Are you sure you want to overwrite this image?"));
@ -1143,7 +1115,6 @@ _prompt_save_image_as_apply(void *data, Evas_Object *obj EINA_UNUSED, void *even
}
evas_object_del(opopup);
elm_object_focus_set(ephoto->pager, EINA_TRUE);
evas_object_freeze_events_set(ephoto->pager, EINA_FALSE);
}
static void
@ -1155,7 +1126,6 @@ _prompt_empty_apply(void *data, Evas_Object *obj EINA_UNUSED,
Eina_List *files = evas_object_data_get(popup, "files");
evas_object_del(popup);
evas_object_freeze_events_set(ephoto->pager, EINA_FALSE);
elm_object_focus_set(ephoto->pager, EINA_TRUE);
_empty_trash(ephoto, files);
}
@ -1170,7 +1140,6 @@ _prompt_delete_apply(void *data, Evas_Object *obj EINA_UNUSED,
Eina_File_Type *type = evas_object_data_get(popup, "type");
evas_object_del(popup);
evas_object_freeze_events_set(ephoto->pager, EINA_FALSE);
elm_object_focus_set(ephoto->pager, EINA_TRUE);
if (*type == EINA_FILE_DIR)
_delete_dir(ephoto, files);
@ -1188,7 +1157,6 @@ _prompt_move_apply(void *data, Evas_Object *obj EINA_UNUSED,
const char *path = evas_object_data_get(popup, "path");
evas_object_del(popup);
evas_object_freeze_events_set(ephoto->pager, EINA_FALSE);
elm_object_focus_set(ephoto->pager, EINA_TRUE);
_move_files(ephoto, files, path);
}
@ -1203,7 +1171,6 @@ _prompt_copy_apply(void *data, Evas_Object *obj EINA_UNUSED,
const char *path = evas_object_data_get(popup, "path");
evas_object_del(popup);
evas_object_freeze_events_set(ephoto->pager, EINA_FALSE);
elm_object_focus_set(ephoto->pager, EINA_TRUE);
_copy_files(ephoto, files, path);
}
@ -1219,7 +1186,6 @@ ephoto_file_save_image(Ephoto *ephoto, Ephoto_Entry *entry, Evas_Object *image)
_("Error: Image could not be saved here!"));
return;
}
evas_object_freeze_events_set(ephoto->pager, EINA_TRUE);
popup = _prompt(ephoto, _("Save Image"),
_("Are you sure you want to overwrite this image?"));
@ -1260,8 +1226,6 @@ ephoto_file_save_image_as(Ephoto *ephoto, Ephoto_Entry *entry, Evas_Object *imag
evas_object_geometry_get(ephoto->win, 0, 0, 0, &h);
evas_object_freeze_events_set(ephoto->pager, EINA_TRUE);
popup = elm_popup_add(ephoto->win);
elm_popup_scrollable_set(popup, EINA_TRUE);
elm_object_part_text_set(popup, "title,text", _("Save Image As"));

@ -130,8 +130,6 @@ _processing(Evas_Object *main)
{
Evas_Object *popup, *box, *label, *pb;
evas_object_freeze_events_set(main, EINA_TRUE);
popup = elm_popup_add(main);
elm_object_part_text_set(popup, "title,text", _("Applying Filter"));
elm_popup_orient_set(popup, ELM_POPUP_ORIENT_CENTER);
@ -175,7 +173,6 @@ _thread_finished_cb(void *data, Ecore_Thread *th EINA_UNUSED)
if (ef->popup)
{
evas_object_del(ef->popup);
evas_object_freeze_events_set(ef->main, EINA_FALSE);
}
if (ef->im_data)
free(ef->im_data);
@ -226,7 +223,6 @@ _thread_finished_cb(void *data, Ecore_Thread *th EINA_UNUSED)
if (ef->popup)
{
evas_object_del(ef->popup);
evas_object_freeze_events_set(ef->main, EINA_FALSE);
}
if (ef->im_data)
free(ef->im_data);

@ -100,11 +100,13 @@ _ephoto_slideshow_show(Ephoto *ephoto, Ephoto_Entry *entry)
"ephoto,controls,hide", "ephoto");
edje_object_signal_emit(elm_layout_edje_get(ephoto->layout),
"ephoto,folders,hide", "ephoto");
evas_object_hide(ephoto->dir_browser);
ephoto->folders_toggle = EINA_FALSE;
ephoto->blocking = EINA_FALSE;
ephoto->menu_blocking = EINA_FALSE;
ephoto->hover_blocking = EINA_FALSE;
ephoto->editor_blocking = EINA_FALSE;
ephoto_slideshow_adjust_offsets(ephoto);
}
static void
@ -242,6 +244,7 @@ _mouse_up_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
}
edje_object_signal_emit(elm_layout_edje_get(ephoto->layout),
"ephoto,folders,hide", "ephoto");
evas_object_hide(ephoto->dir_browser);
ephoto->folders_toggle = EINA_FALSE;
elm_object_tooltip_text_set(but, _("Show Folders"));
}
@ -274,7 +277,10 @@ _timer_cb(void *data)
edje_object_signal_emit(edje, "ephoto,controls,hide", "ephoto");
if (ephoto->folders_toggle)
edje_object_signal_emit(edje, "ephoto,folders,hide", "ephoto");
{
edje_object_signal_emit(edje, "ephoto,folders,hide", "ephoto");
evas_object_hide(ephoto->dir_browser);
}
ecore_timer_del(ephoto->overlay_timer);
ephoto->overlay_timer = NULL;
@ -298,7 +304,10 @@ _mouse_move_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
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");
{
edje_object_signal_emit(edje, "ephoto,folders,show", "ephoto");
evas_object_show(ephoto->dir_browser);
}
ephoto->overlay_timer = ecore_timer_add(3.0, _timer_cb, ephoto);
}
@ -335,6 +344,7 @@ _folder_icon_clicked(void *data, Evas_Object *obj,
{
edje_object_signal_emit(elm_layout_edje_get(ephoto->layout),
"ephoto,folders,show", "ephoto");
evas_object_show(ephoto->dir_browser);
ephoto->folders_toggle = EINA_TRUE;
if (elm_object_text_get(obj))
elm_object_text_set(obj, _("Hide Folders"));
@ -344,6 +354,7 @@ _folder_icon_clicked(void *data, Evas_Object *obj,
{
edje_object_signal_emit(elm_layout_edje_get(ephoto->layout),
"ephoto,folders,hide", "ephoto");
evas_object_hide(ephoto->dir_browser);
ephoto->folders_toggle = EINA_FALSE;
if (elm_object_text_get(obj))
elm_object_text_set(obj, _("Show Folders"));
@ -384,6 +395,7 @@ ephoto_show_folders(Ephoto *ephoto, Eina_Bool toggle)
_mouse_move_cb(ephoto, NULL, NULL, NULL);
edje_object_signal_emit(elm_layout_edje_get(ephoto->layout),
"ephoto,folders,show", "ephoto");
evas_object_show(ephoto->dir_browser);
ephoto->folders_toggle = EINA_TRUE;
elm_object_tooltip_text_set(but, _("Hide Folders"));
}
@ -391,6 +403,7 @@ ephoto_show_folders(Ephoto *ephoto, Eina_Bool toggle)
{
edje_object_signal_emit(elm_layout_edje_get(ephoto->layout),
"ephoto,folders,hide", "ephoto");
evas_object_hide(ephoto->dir_browser);
ephoto->folders_toggle = EINA_FALSE;
elm_object_tooltip_text_set(but, _("Show Folders"));
}
@ -459,7 +472,6 @@ ephoto_window_add(const char *path)
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);
evas_object_size_hint_weight_set(ephoto->pager, EVAS_HINT_EXPAND,
EVAS_HINT_EXPAND);
@ -522,7 +534,6 @@ ephoto_window_add(const char *path)
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);

@ -50,8 +50,6 @@ static void _ephoto_update_bottom_bar(Ephoto_Single_Browser *sb);
static void _ephoto_main_edit_menu(Ephoto_Single_Browser *sb);
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_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,
@ -821,7 +819,6 @@ _reset_yes(void *data, Evas_Object *obj EINA_UNUSED,
if (sb->event)
{
elm_object_focus_set(sb->event, EINA_TRUE);
evas_object_freeze_events_set(sb->event, EINA_FALSE);
}
}
@ -836,7 +833,6 @@ _reset_no(void *data, Evas_Object *obj EINA_UNUSED,
if (sb->event)
{
elm_object_focus_set(sb->event, EINA_TRUE);
evas_object_freeze_events_set(sb->event, EINA_FALSE);
}
}
@ -847,9 +843,6 @@ _reset_image(void *data, Evas_Object *obj EINA_UNUSED,
Ephoto_Single_Browser *sb = data;
Evas_Object *popup, *box, *label, *ic, *button;
if (sb->event)
evas_object_freeze_events_set(sb->event, EINA_TRUE);
popup = elm_popup_add(sb->ephoto->win);
elm_object_part_text_set(popup, "title,text", _("Reset Image"));
elm_popup_orient_set(popup, ELM_POPUP_ORIENT_CENTER);
@ -1714,22 +1707,6 @@ _ephoto_main_back(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EIN
evas_object_smart_callback_call(sb->main, "back", sb->entry);
}
static void
_ephoto_main_focused(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
void *event_data EINA_UNUSED)
{
Ephoto_Single_Browser *sb = data;
if (sb->ephoto->state == EPHOTO_STATE_SINGLE)
{
if (sb->event)
{
elm_object_focus_set(sb->event, EINA_TRUE);
evas_object_raise(sb->event);
}
}
}
static void
_ephoto_main_del(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
@ -2050,12 +2027,9 @@ ephoto_single_browser_add(Ephoto *ephoto, Evas_Object *parent)
sb->main = box;
elm_box_horizontal_set(sb->main, EINA_FALSE);
elm_object_tree_focus_allow_set(sb->main, EINA_FALSE);
evas_object_event_callback_add(sb->main, EVAS_CALLBACK_DEL, _ephoto_main_del, sb);
evas_object_event_callback_add(sb->main, EVAS_CALLBACK_KEY_DOWN, _ephoto_main_key_down,
sb);
evas_object_event_callback_add(sb->ephoto->win, EVAS_CALLBACK_FOCUS_IN,
_ephoto_main_focused, sb);
evas_object_size_hint_weight_set(sb->main, EVAS_HINT_EXPAND,
EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(sb->main, EVAS_HINT_FILL, EVAS_HINT_FILL);

@ -1,11 +1,21 @@
#include "ephoto.h"
typedef enum _Ephoto_Slideshow_Move Ephoto_Slideshow_Move;
typedef struct _Ephoto_Slideshow Ephoto_Slideshow;
enum _Ephoto_Slideshow_Move
{
EPHOTO_SLIDESHOW_MOVE_LEFT_TO_RIGHT,
EPHOTO_SLIDESHOW_MOVE_RIGHT_TO_LEFT,
EPHOTO_SLIDESHOW_MOVE_TOP_TO_BOTTOM,
EPHOTO_SLIDESHOW_MOVE_BOTTOM_TO_TOP
};
struct _Ephoto_Slideshow
{
Ephoto *ephoto;
Evas_Object *current_image;
Evas_Object *current_item;
Evas_Object *old_item;
Evas_Object *slideshow;
Evas_Object *event;
Evas_Object *notify;
@ -17,11 +27,13 @@ struct _Ephoto_Slideshow
Ephoto_Entry *entry;
Eina_Bool playing;
Ecore_Timer *timer;
int timeout;
Ephoto_Slideshow_Move move;
float timeout;
int current;
};
static Evas_Object *_slideshow_item_get(Ephoto_Entry *entry, Evas_Object *parent);
static Evas_Object *_slideshow_item_get(Ephoto_Slideshow *ss,
Ephoto_Entry *entry, Evas_Object *parent);
static Eina_Bool _slideshow_transition(void *data);
static void _slideshow_play(Ephoto_Slideshow *ss);
static void _slideshow_pause(Ephoto_Slideshow *ss);
@ -37,11 +49,108 @@ _image_shown(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
ephoto_title_set(entry->ephoto, entry->basename);
}
static const char *
_slideshow_move_end_get(Ephoto_Slideshow *ss)
{
switch (ss->move)
{
case EPHOTO_SLIDESHOW_MOVE_LEFT_TO_RIGHT:
return "ephoto,slideshow,move,left,to,right";
case EPHOTO_SLIDESHOW_MOVE_RIGHT_TO_LEFT:
return "ephoto,slideshow,move,right,to,left";
case EPHOTO_SLIDESHOW_MOVE_TOP_TO_BOTTOM:
return "ephoto,slideshow,move,top,to,bottom";
case EPHOTO_SLIDESHOW_MOVE_BOTTOM_TO_TOP:
return "ephoto,slideshow,move,bottom,to,top";
default: return "default";
}
}
static const char *
_slideshow_move_start_get(Ephoto_Slideshow *ss)
{
switch (ss->move)
{
case EPHOTO_SLIDESHOW_MOVE_LEFT_TO_RIGHT:
return "ephoto,slideshow,default,left,to,right";
case EPHOTO_SLIDESHOW_MOVE_RIGHT_TO_LEFT:
return "ephoto,slideshow,default,right,to,left";
case EPHOTO_SLIDESHOW_MOVE_TOP_TO_BOTTOM:
return "ephoto,slideshow,default,top,to,bottom";
case EPHOTO_SLIDESHOW_MOVE_BOTTOM_TO_TOP:
return "ephoto,slideshow,default,bottom,to,top";
default: return "default";
}
}
static void
_slideshow_move_randomize(Ephoto_Slideshow *ss)
{
int i, r = 0;
int range = 4;
int buckets = RAND_MAX / range;
int limit = buckets * range;
r = rand();
while (r >= limit)
{
r = rand();
}
i = r / buckets;
switch (i)
{
case 0:
ss->move = EPHOTO_SLIDESHOW_MOVE_LEFT_TO_RIGHT;
break;
case 1:
ss->move = EPHOTO_SLIDESHOW_MOVE_RIGHT_TO_LEFT;
break;
case 2:
ss->move = EPHOTO_SLIDESHOW_MOVE_TOP_TO_BOTTOM;
break;
case 3:
ss->move = EPHOTO_SLIDESHOW_MOVE_BOTTOM_TO_TOP;
break;
default: ss->move = EPHOTO_SLIDESHOW_MOVE_LEFT_TO_RIGHT;
}
}
static void
_on_transition_end(void *data, Evas_Object *obj EINA_UNUSED,
const char *emission EINA_UNUSED, const char *source EINA_UNUSED)
{
Ephoto_Slideshow *ss = data;
if (ss->old_item)
{
elm_layout_content_unset(ss->slideshow, "ephoto.swallow.slideshow.item");
evas_object_del(ss->old_item);
ss->old_item = NULL;
}
if (ss->current_item)
{
elm_layout_content_unset(ss->slideshow, "ephoto.swallow.slideshow.item2");
}
elm_layout_content_set(ss->slideshow, "ephoto.swallow.slideshow.item",
ss->current_item);
evas_object_show(ss->current_item);
elm_layout_signal_emit(ss->slideshow, "ephoto,transition,done", "ephoto");
if (ss->timer)
ecore_timer_del(ss->timer);
ss->timer = NULL;
ss->timer = ecore_timer_add(ss->timeout, _slideshow_transition, ss);
}
static Evas_Object *
_slideshow_item_get(Ephoto_Entry *entry, Evas_Object *parent)
_slideshow_item_get(Ephoto_Slideshow *ss, Ephoto_Entry *entry, Evas_Object *parent)
{
const char *group = NULL;
const char *ext = strrchr(entry->path, '.');
Evas_Coord w, h, sw, sh;
Evas_Object *layout, *image;
Edje_Message_Float_Set *msg;
if (ext)
{
@ -59,16 +168,38 @@ _slideshow_item_get(Ephoto_Entry *entry, Evas_Object *parent)
}
}
}
Evas_Object *image = elm_image_add(parent);
layout = elm_layout_add(parent);
elm_layout_file_set(layout, PACKAGE_DATA_DIR "/themes/ephoto.edj",
"ephoto,slideshow,item");
evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(layout, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_data_set(layout, "entry", entry);
image = elm_image_add(parent);
elm_image_preload_disabled_set(image, EINA_TRUE);
elm_image_smooth_set(image, EINA_FALSE);
elm_image_file_set(image, entry->path, group);
elm_image_fill_outside_set(image, EINA_FALSE);
elm_image_fill_outside_set(image, EINA_TRUE);
evas_object_size_hint_weight_set(image, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(image, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_data_set(image, "entry", entry);
evas_object_event_callback_add(image, EVAS_CALLBACK_SHOW, _image_shown,
entry);
evas_object_image_size_get(elm_image_object_get(image), &w, &h);
evas_object_geometry_get(parent, 0, 0, &sw, &sh);
if (w < sw && h < sh)
{
evas_object_size_hint_max_set(image, w, h);
elm_image_fill_outside_set(image, EINA_FALSE);
}
elm_layout_content_set(layout, "ephoto.swallow.slideshow.item", image);
msg = alloca(sizeof(Edje_Message_Float_Set) + (1 * sizeof(float)));
msg->count = 1;
msg->val[0] = (float)ss->timeout;
edje_object_message_send(elm_layout_edje_get(layout),
EDJE_MESSAGE_FLOAT_SET, 1, msg);
return image;
return layout;
}
static Eina_Bool
@ -83,34 +214,63 @@ _slideshow_transition(void *data)
ss->timer = NULL;
return EINA_FALSE;
}
if (ss->current_image)
{
elm_layout_content_unset(ss->slideshow, "ephoto.swallow.slideshow");
evas_object_del(ss->current_image);
}
ss->current += 1;
if (!eina_list_nth(ss->entries, ss->current))
ss->current = 0;
ss->current_image = _slideshow_item_get(eina_list_nth(ss->entries, ss->current),
if (ss->old_item)
evas_object_del(ss->old_item);
ss->old_item = ss->current_item;
ss->current_item = _slideshow_item_get(ss, eina_list_nth(ss->entries, ss->current),
ss->slideshow);
elm_layout_content_set(ss->slideshow, "ephoto.swallow.slideshow", ss->current_image);
evas_object_show(ss->current_image);
elm_layout_content_set(ss->slideshow, "ephoto.swallow.slideshow.item2",
ss->current_item);
evas_object_show(ss->current_item);
return EINA_TRUE;
elm_layout_signal_emit(ss->slideshow, "ephoto,black_fade", "ephoto");
if (ss->ephoto->config->movess)
{
elm_layout_signal_emit(ss->current_item, _slideshow_move_start_get(ss), "ephoto");
elm_layout_signal_emit(ss->current_item, _slideshow_move_end_get(ss), "ephoto");
_slideshow_move_randomize(ss);
}
if (ss->timer)
ecore_timer_del(ss->timer);
ss->timer = NULL;
return EINA_FALSE;
}
static void
_slideshow_play(Ephoto_Slideshow *ss)
{
if (!ss->current_image)
Edje_Message_Float_Set *msg;
if (!ss->current_item)
{
if (!eina_list_nth(ss->entries, ss->current))
ss->current = 0;
ss->current_image = _slideshow_item_get(eina_list_nth(ss->entries, ss->current),
ss->current_item = _slideshow_item_get(ss, eina_list_nth(ss->entries, ss->current),
ss->slideshow);
elm_layout_content_set(ss->slideshow, "ephoto.swallow.slideshow", ss->current_image);
evas_object_show(ss->current_image);
elm_layout_content_set(ss->slideshow, "ephoto.swallow.slideshow.item",
ss->current_item);
evas_object_show(ss->current_item);
}
_slideshow_move_randomize(ss);
msg = alloca(sizeof(