Use standard icons based on icon theme to remove dependency on Faenza icons. Removed the old directory code that would provide a preview of the images in the directory. This code hasn't worked in a while and frankly is just unneccasry and would slow down the app. Remove images and theme that was shipped with Ephoto. It is no longer needed. Change style on some widgets to better match dark theme. Prepare Ephoto to be released soon.v-1.6.0
@ -1,2 +1,2 @@ |
||||
MAINTAINERCLEANFILES = Makefile.in Makefile
|
||||
SUBDIRS = desktop images themes
|
||||
SUBDIRS = desktop
|
||||
|
@ -1,9 +0,0 @@ |
||||
MAINTAINERCLEANFILES = Makefile.in Makefile
|
||||
|
||||
IMAGES = \
|
||||
*.png |
||||
|
||||
imagesdir = $(pkgdatadir)/images
|
||||
images_DATA = $(IMAGES)
|
||||
|
||||
EXTRA_DIST = $(IMAGES)
|
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 2.1 KiB |
@ -1,5 +0,0 @@ |
||||
## Process this file with automake to produce Makefile.in
|
||||
|
||||
MAINTAINERCLEANFILES = Makefile.in Makefile
|
||||
|
||||
SUBDIRS = default
|
@ -1,23 +0,0 @@ |
||||
MAINTAINERCLEANFILES = Makefile.in
|
||||
|
||||
SUBDIRS = images
|
||||
|
||||
EDCS = ephoto.edc
|
||||
EDJS = $(EDCS:%.edc=%.edj)
|
||||
|
||||
ephoto_DEPS = ephoto.edc
|
||||
|
||||
EXTRA_DIST = $(EDCS)
|
||||
|
||||
CLEANFILES = $(EDJS)
|
||||
|
||||
themedir = $(pkgdatadir)/themes/default
|
||||
theme_DATA = $(EDJS)
|
||||
|
||||
all: $(EDJS) |
||||
|
||||
ephoto.edj: ${ephoto_DEPS} |
||||
|
||||
SUFFIXES = .edc .edj
|
||||
.edc.edj: |
||||
$(edje_cc) -id $(top_srcdir)/data/themes/default/images -fd $(top_srcdir)/data/themes/default/fonts $< $(top_builddir)/data/themes/default/$(@F)
|
@ -1,603 +0,0 @@ |
||||
externals { |
||||
external: "elm"; |
||||
} |
||||
|
||||
collections { |
||||
group { name: "elm/layout/ephoto/orient"; |
||||
parts { |
||||
part { name: "elm.swallow.content"; |
||||
type: SWALLOW; |
||||
description { state: "default" 0.0; |
||||
} |
||||
description { state: "rotate_0" 0.0; |
||||
inherit: "default" 0.0; |
||||
map { |
||||
on: 1; |
||||
rotation.z: 0; |
||||
} |
||||
} |
||||
description { state: "rotate_90" 0.0; |
||||
inherit: "default" 0.0; |
||||
map { |
||||
on: 1; |
||||
rotation.z: 90; |
||||
} |
||||
} |
||||
description { state: "rotate_180" 0.0; |
||||
inherit: "default" 0.0; |
||||
map { |
||||
on: 1; |
||||
rotation.z: 180; |
||||
} |
||||
} |
||||
description { state: "rotate_270" 0.0; |
||||
inherit: "default" 0.0; |
||||
map { |
||||
on: 1; |
||||
rotation.z: 270; |
||||
} |
||||
} |
||||
description { state: "flip_horiz" 0.0; |
||||
inherit: "default" 0.0; |
||||
map { |
||||
on: 1; |
||||
rotation.y: 180; |
||||
} |
||||
} |
||||
description { state: "flip_vert" 0.0; |
||||
inherit: "default" 0.0; |
||||
map { |
||||
on: 1; |
||||
rotation.x: 180; |
||||
} |
||||
} |
||||
description { state: "flip_horiz_90" 0.0; |
||||
inherit: "default" 0.0; |
||||
map { |
||||
on: 1; |
||||
rotation { |
||||
z: 90; |
||||
y: 180; |
||||
} |
||||
} |
||||
} |
||||
description { state: "flip_vert_90" 0.0; |
||||
inherit: "default" 0.0; |
||||
map { |
||||
on: 1; |
||||
rotation { |
||||
z: 90; |
||||
x: 180; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
programs { |
||||
program { |
||||
signal: "state,rotate,0"; |
||||
source: "ephoto"; |
||||
action: STATE_SET "rotate_0" 0.0; |
||||
target: "elm.swallow.content"; |
||||
} |
||||
program { |
||||
signal: "state,rotate,90"; |
||||
source: "ephoto"; |
||||
action: STATE_SET "rotate_90" 0.0; |
||||
target: "elm.swallow.content"; |
||||
} |
||||
program { |
||||
signal: "state,rotate,180"; |
||||
source: "ephoto"; |
||||
action: STATE_SET "rotate_180" 0.0; |
||||
target: "elm.swallow.content"; |
||||
} |
||||
program { |
||||
signal: "state,rotate,270"; |
||||
source: "ephoto"; |
||||
action: STATE_SET "rotate_270" 0.0; |
||||
target: "elm.swallow.content"; |
||||
} |
||||
program { |
||||
signal: "state,flip,horiz"; |
||||
source: "ephoto"; |
||||
action: STATE_SET "flip_horiz" 0.0; |
||||
target: "elm.swallow.content"; |
||||
} |
||||
program { |
||||
signal: "state,flip,vert"; |
||||
source: "ephoto"; |
||||
action: STATE_SET "flip_vert" 0.0; |
||||
target: "elm.swallow.content"; |
||||
} |
||||
program { |
||||
signal: "state,flip,horiz,90"; |
||||
source: "ephoto"; |
||||
action: STATE_SET "flip_horiz_90" 0.0; |
||||
target: "elm.swallow.content"; |
||||
} |
||||
program { |
||||
signal: "state,flip,vert,90"; |
||||
source: "ephoto"; |
||||
action: STATE_SET "flip_vert_90" 0.0; |
||||
target: "elm.swallow.content"; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
group { name: "elm/gengrid/item/ephoto-album-preview/default"; |
||||
data.item: "texts" "elm.text"; |
||||
data.item: "icons" "elm.swallow.icon.1 elm.swallow.icon.2 elm.swallow.icon.3"; |
||||
data.item: "states" "have_files"; |
||||
images { |
||||
image: "bt_sm_base1.png" COMP; |
||||
image: "bt_sm_shine.png" COMP; |
||||
image: "bt_sm_hilight.png" COMP; |
||||
image: "directory-512.png" COMP; |
||||
} |
||||
parts { |
||||
part { name: "event"; |
||||
type: RECT; |
||||
repeat_events: 1; |
||||
description { state: "default" 0.0; |
||||
color: 0 0 0 0; |
||||
} |
||||
} |
||||
part { name: "bg"; |
||||
clip_to: "disclip"; |
||||
mouse_events: 0; |
||||
description { state: "default" 0.0; |
||||
visible: 0; |
||||
color: 255 255 255 0; |
||||
rel1.offset: -3 -3; |
||||
rel2.offset: 2 2; |
||||
image { |
||||
normal: "bt_sm_base1.png"; |
||||
border: 6 6 6 6; |
||||
middle: SOLID; |
||||
} |
||||
} |
||||
description { state: "selected" 0.0; |
||||
inherit: "default" 0.0; |
||||
visible: 1; |
||||
color: 255 255 255 255; |
||||
} |
||||
} |
||||
part { name: "image"; |
||||
type: IMAGE; |
||||
mouse_events: 0; |
||||
description { state: "default" 0.0; |
||||
aspect_preference: BOTH; |
||||
aspect: 1.0 1.0; |
||||
image.normal: "directory-512.png"; |
||||
rel2 { |
||||
to_y: "elm.text"; |
||||
relative: 1.0 0.0; |
||||
offset: -1 -2; |
||||
} |
||||
} |
||||
} |
||||
part { name: "have-files-clipper"; |
||||
type: RECT; |
||||
description { state: "default" 0.0; |
||||
color: 255 255 255 0; |
||||
visible: 0; |
||||
} |
||||
description { state: "visible" 0.0; |
||||
inherit: "default" 0.0; |
||||
color: 255 255 255 255; |
||||
visible: 1; |
||||
} |
||||
} |
||||
part { name: "icon_box_margin"; |
||||
type: RECT; |
||||
mouse_events: 0; |
||||
clip_to: "have-files-clipper"; |
||||
description { state: "default" 0.0; |
||||
color: 255 255 255 0; |
||||
rel1 { |
||||
to: "icon_box"; |
||||
offset: -1 -1; |
||||
} |
||||
rel2 { |
||||
to: "icon_box"; |
||||
offset: 0 0; |
||||
} |
||||
} |
||||
} |
||||
part { name: "icon_box"; |
||||
type: RECT; |
||||
mouse_events: 0; |
||||
clip_to: "have-files-clipper"; |
||||
description { state: "default" 0.0; |
||||
color: 255 255 255 0; |
||||
align: 1.0 1.0; |
||||
min: 32 32; |
||||
|
||||
rel1 { |
||||
to: "image"; |
||||
relative: 0.0 0.0; |
||||
offset: 0 20; |
||||
} |
||||
rel2 { |
||||
to: "image"; |
||||
relative: 1.0 1.0; |
||||
offset: -1 -1; |
||||
} |
||||
} |
||||
} |
||||
part { name: "elm.swallow.icon.1"; |
||||
type: SWALLOW; |
||||
mouse_events: 0; |
||||
clip_to: "have-files-clipper"; |
||||
description { state: "default" 0.0; |
||||
color: 255 0 0 255; |
||||
map { |
||||
on: 0; |
||||
rotation { |
||||
z: 0; |
||||
} |
||||
} |
||||
rel1 { |
||||
relative: 0.2 0.2; |
||||
to: "icon_box"; |
||||
} |
||||
rel2 { |
||||
relative: 0.8 0.8; |
||||
offset: -1 -1; |
||||
to: "icon_box"; |
||||
} |
||||
} |
||||
} |
||||
part { name: "elm.swallow.icon.2"; |
||||
type: SWALLOW; |
||||
mouse_events: 0; |
||||
clip_to: "have-files-clipper"; |
||||
description { state: "default" 0.0; |
||||
color: 255 0 0 255; |
||||
map { |
||||
on: 1; |
||||
rotation { |
||||
z: 15; |
||||
} |
||||
} |
||||
rel1 { |
||||
relative: 0.2 0.2; |
||||
to: "icon_box"; |
||||
} |
||||
rel2 { |
||||
relative: 0.8 0.8; |
||||
offset: -1 -1; |
||||
to: "icon_box"; |
||||
} |
||||
} |
||||
} |
||||
part { name: "elm.swallow.icon.3"; |
||||
type: SWALLOW; |
||||
mouse_events: 0; |
||||
clip_to: "have-files-clipper"; |
||||
description { state: "default" 0.0; |
||||
color: 255 0 0 255; |
||||
map { |
||||
on: 1; |
||||
rotation { |
||||
z: -15; |
||||
} |
||||
} |
||||
rel1 { |
||||
relative: 0.2 0.2; |
||||
to: "icon_box"; |
||||
} |
||||
rel2 { |
||||
relative: 0.8 0.8; |
||||
offset: -1 -1; |
||||
to: "icon_box"; |
||||
} |
||||
} |
||||
} |
||||
part { name: "elm.text"; |
||||
clip_to: "disclip"; |
||||
type: TEXT; |
||||
effect: SOFT_SHADOW; |
||||
mouse_events: 0; |
||||
scale: 1; |
||||
description { state: "default" 0.0; |
||||
rel1 { |
||||
relative: 0.0 1.0; |
||||
offset: 20 -30; |
||||
} |
||||
rel2 { |
||||
relative: 1.0 1.0; |
||||
offset: -21 -15; |
||||
} |
||||
color: 0 0 0 255; |
||||
color3: 0 0 0 0; |
||||
text { |
||||
font: "Sans"; |
||||
size: 10; |
||||
min: 0 1; |
||||
align: 0.5 0.0; |
||||
text_class: "grid_item"; |
||||
} |
||||
} |
||||
description { state: "selected" 0.0; |
||||
inherit: "default" 0.0; |
||||
color: 255 255 255 255; |
||||
} |
||||
} |
||||
part { name: "fg1"; |
||||
clip_to: "disclip"; |
||||
mouse_events: 0; |
||||
description { state: "default" 0.0; |
||||
visible: 0; |
||||
color: 255 255 255 0; |
||||
rel1.offset: -3 -3; |
||||
rel2 { |
||||
relative: 1.0 0.5; |
||||
offset: 2 -1; |
||||
} |
||||
image { |
||||
normal: "bt_sm_hilight.png"; |
||||
border: 6 6 6 0; |
||||
} |
||||
} |
||||
description { state: "selected" 0.0; |
||||
inherit: "default" 0.0; |
||||
visible: 1; |
||||
color: 255 255 255 255; |
||||
} |
||||
} |
||||
part { name: "fg2"; |
||||
clip_to: "disclip"; |
||||
mouse_events: 0; |
||||
description { state: "default" 0.0; |
||||
visible: 0; |
||||
color: 255 255 255 0; |
||||
rel1.offset: -3 -3; |
||||
rel2.offset: 2 2; |
||||
image { |
||||
normal: "bt_sm_shine.png"; |
||||
border: 6 6 6 0; |
||||
} |
||||
} |
||||
description { state: "selected" 0.0; |
||||
inherit: "default" 0.0; |
||||
visible: 1; |
||||
color: 255 255 255 255; |
||||
} |
||||
} |
||||
part { name: "disclip"; |
||||
type: RECT; |
||||
description { state: "default" 0.0; |
||||
rel1.to: "bg"; |
||||
rel2.to: "bg"; |
||||
} |
||||
description { state: "disabled" 0.0; |
||||
inherit: "default" 0.0; |
||||
color: 255 255 255 64; |
||||
} |
||||
} |
||||
} |
||||
programs { |
||||
program { name: "load"; |
||||
signal: "load"; |
||||
// script { |
||||
// new Float:val; |
||||
// custom_state(PART:"elm.swallow.icon.3", "default", 0.0); |
||||
// custom_state(PART:"elm.swallow.icon.1", "default", 0.0); |
||||
// val = randf(); |
||||
// val = 40 * val - 20; |
||||
// set_state_val(PART:"elm.swallow.icon.3", STATE_MAP_ROT_Z, val); |
||||
// val = randf(); |
||||
// val = 40 * val - 20; |
||||
// set_state_val(PART:"elm.swallow.icon.1", STATE_MAP_ROT_Z, val); |
||||
//set_state(PART:"elm.swallow.icon.1", "custom", 0.0); |
||||
// set_state(PART:"elm.swallow.icon.3", "custom", 0.0); |
||||
//} |
||||
} |
||||
program { name: "go_active"; |
||||
signal: "elm,state,selected"; |
||||
source: "elm"; |
||||
action: STATE_SET "selected" 0.0; |
||||
target: "bg"; |
||||
target: "fg1"; |
||||
target: "fg2"; |
||||
target: "elm.text"; |
||||
} |
||||
program { name: "go_passive"; |
||||
signal: "elm,state,unselected"; |
||||
source: "elm"; |
||||
action: STATE_SET "default" 0.0; |
||||
target: "bg"; |
||||
target: "fg1"; |
||||
target: "fg2"; |
||||
target: "elm.text"; |
||||
transition: LINEAR 0.1; |
||||
} |
||||
program { name: "go_disabled"; |
||||
signal: "elm,state,disabled"; |
||||
source: "elm"; |
||||
action: STATE_SET "disabled" 0.0; |
||||
target: "disclip"; |
||||
} |
||||
program { name: "go_enabled"; |
||||
signal: "elm,state,enabled"; |
||||
source: "elm"; |
||||
action: STATE_SET "default" 0.0; |
||||
target: "disclip"; |
||||
} |
||||
program { |
||||
signal: "elm,state,have_files,active"; |
||||
source: "elm"; |
||||
action: STATE_SET "visible" 0.0; |
||||
target: "have-files-clipper"; |
||||
} |
||||
} |
||||
} |
||||
group { name: "elm/gengrid/item/ephoto-up/default"; |
||||
data.item: "texts" "elm.text"; |
||||
images { |
||||
image: "bt_sm_base1.png" COMP; |
||||
image: "bt_sm_shine.png" COMP; |
||||
image: "bt_sm_hilight.png" COMP; |
||||
image: "directory-up-512.png" COMP; |
||||
} |
||||
parts { |
||||
part { name: "event"; |
||||
type: RECT; |
||||
repeat_events: 1; |
||||
description { state: "default" 0.0; |
||||
color: 0 0 0 0; |
||||
} |
||||
} |
||||
part { name: "bg"; |
||||
clip_to: "disclip"; |
||||
mouse_events: 0; |
||||
description { state: "default" 0.0; |
||||
visible: 0; |
||||
color: 255 255 255 0; |
||||
rel1.offset: -3 -3; |
||||
rel2.offset: 2 2; |
||||
image { |
||||
normal: "bt_sm_base1.png"; |
||||
border: 6 6 6 6; |
||||
middle: SOLID; |
||||
} |
||||
} |
||||
description { state: "selected" 0.0; |
||||
inherit: "default" 0.0; |
||||
visible: 1; |
||||
color: 255 255 255 255; |
||||
} |
||||
} |
||||
part { name: "image"; |
||||
type: IMAGE; |
||||
mouse_events: 0; |
||||
description { state: "default" 0.0; |
||||
aspect_preference: BOTH; |
||||
aspect: 1.0 1.0; |
||||
image.normal: "directory-up-512.png"; |
||||
rel2 { |
||||
to_y: "elm.text"; |
||||
relative: 1.0 0.0; |
||||
offset: -1 -2; |
||||
} |
||||
} |
||||
} |
||||
part { name: "elm.text"; |
||||
clip_to: "disclip"; |
||||
type: TEXT; |
||||
effect: SOFT_SHADOW; |
||||
mouse_events: 0; |
||||
scale: 1; |
||||
description { state: "default" 0.0; |
||||
rel1 { |
||||
relative: 0.0 1.0; |
||||
offset: 20 -30; |
||||
} |
||||
rel2 { |
||||
relative: 1.0 1.0; |
||||
offset: -21 -15; |
||||
} |
||||
color: 0 0 0 255; |
||||
color3: 0 0 0 0; |
||||
text { |
||||
font: "Sans"; |
||||
size: 10; |
||||
min: 0 1; |
||||
align: 0.5 0.0; |
||||
text_class: "grid_item"; |
||||
} |
||||
} |
||||
description { state: "selected" 0.0; |
||||
inherit: "default" 0.0; |
||||
color: 255 255 255 255; |
||||
} |
||||
} |
||||
part { name: "fg1"; |
||||
clip_to: "disclip"; |
||||
mouse_events: 0; |
||||
description { state: "default" 0.0; |
||||
visible: 0; |
||||
color: 255 255 255 0; |
||||
rel1.offset: -3 -3; |
||||
rel2 { |
||||
relative: 1.0 0.5; |
||||
offset: 2 -1; |
||||
} |
||||
image { |
||||
normal: "bt_sm_hilight.png"; |
||||
border: 6 6 6 0; |
||||
} |
||||
} |
||||
description { state: "selected" 0.0; |
||||
inherit: "default" 0.0; |
||||
visible: 1; |
||||
color: 255 255 255 255; |
||||
} |
||||
} |
||||
part { name: "fg2"; |
||||
clip_to: "disclip"; |
||||
mouse_events: 0; |
||||
description { state: "default" 0.0; |
||||
visible: 0; |
||||
color: 255 255 255 0; |
||||
rel1.offset: -3 -3; |
||||
rel2.offset: 2 2; |
||||
image { |
||||
normal: "bt_sm_shine.png"; |
||||
border: 6 6 6 0; |
||||
} |
||||
} |
||||
description { state: "selected" 0.0; |
||||
inherit: "default" 0.0; |
||||
visible: 1; |
||||
color: 255 255 255 255; |
||||
} |
||||
} |
||||
part { name: "disclip"; |
||||
type: RECT; |
||||
description { state: "default" 0.0; |
||||
rel1.to: "bg"; |
||||
rel2.to: "bg"; |
||||
} |
||||
description { state: "disabled" 0.0; |
||||
inherit: "default" 0.0; |
||||
color: 255 255 255 64; |
||||
} |
||||
} |
||||
} |
||||
programs { |
||||
program { name: "go_active"; |
||||
signal: "elm,state,selected"; |
||||
source: "elm"; |
||||
action: STATE_SET "selected" 0.0; |
||||
target: "bg"; |
||||
target: "fg1"; |
||||
target: "fg2"; |
||||
target: "elm.text"; |
||||
} |
||||
program { name: "go_passive"; |
||||
signal: "elm,state,unselected"; |
||||
source: "elm"; |
||||
action: STATE_SET "default" 0.0; |
||||
target: "bg"; |
||||
target: "fg1"; |
||||
target: "fg2"; |
||||
target: "elm.text"; |
||||
transition: LINEAR 0.1; |
||||
} |
||||
program { name: "go_disabled"; |
||||
signal: "elm,state,disabled"; |
||||
source: "elm"; |
||||
action: STATE_SET "disabled" 0.0; |
||||
target: "disclip"; |
||||
} |
||||
program { name: "go_enabled"; |
||||
signal: "elm,state,enabled"; |
||||
source: "elm"; |
||||
action: STATE_SET "default" 0.0; |
||||
target: "disclip"; |
||||
} |
||||
} |
||||
} |
||||
} |
@ -1,4 +0,0 @@ |
||||
MAINTAINERCLEANFILES = Makefile.in
|
||||
|
||||
EXTRA_DIST = \
|
||||
*.png |
Before Width: | Height: | Size: 477 B |
Before Width: | Height: | Size: 285 B |
Before Width: | Height: | Size: 275 B |
Before Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 35 KiB |
@ -1,7 +1,6 @@ |
||||
src/bin/ephoto.c |
||||
src/bin/ephoto_config.c |
||||
src/bin/ephoto_main.c |
||||
src/bin/ephoto_directory_thumb.c |
||||
src/bin/ephoto_thumb_browser.c |
||||
src/bin/ephoto_single_browser.c |
||||
src/bin/ephoto_slideshow.c |
||||
|
@ -1,176 +0,0 @@ |
||||
#include "ephoto.h" |
||||
|
||||
typedef struct _Ephoto_Directory_Thumb Ephoto_Directory_Thumb; |
||||
struct _Ephoto_Directory_Thumb |
||||
{ |
||||
Eio_File *ls; |
||||
Eina_List *objs; |
||||
Ephoto_Entry *entry; |
||||
Eina_Bool canceled:1; |
||||
}; |
||||
|
||||
static Eina_Hash *_pending_dirs = NULL; |
||||
|
||||
static void |
||||
_entry_free(void *data, const Ephoto_Entry *entry __UNUSED__) |
||||
{ |
||||
Ephoto_Directory_Thumb *dt = data; |
||||
dt->entry = NULL; |
||||
} |
||||
|
||||
static void |
||||
_ephoto_directory_thumb_free(Ephoto_Directory_Thumb *dt) |
||||
{ |
||||
if (dt->entry) |
||||
{ |
||||
ephoto_entry_free_listener_del(dt->entry, _entry_free, dt); |
||||
eina_hash_del(_pending_dirs, dt->entry->path, dt); |
||||
dt->entry = NULL; |
||||
} |
||||
|
||||
if (dt->ls) |
||||
{ |
||||
dt->canceled = EINA_TRUE; |
||||
eio_file_cancel(dt->ls); |
||||
return; |
||||
} |
||||
|
||||
free(dt); |
||||
|
||||
if (_pending_dirs) |
||||
{ |
||||
if (!eina_hash_population(_pending_dirs)) |
||||
{ |
||||
eina_hash_free(_pending_dirs); |
||||
_pending_dirs = NULL; |
||||
} |
||||
} |
||||
} |
||||
|
||||
static void |
||||
_obj_del(void *data, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__) |
||||
{ |
||||
Ephoto_Directory_Thumb *dt = data; |
||||
dt->objs = eina_list_remove(dt->objs, obj); |
||||
if (!dt->objs) |
||||
{ |
||||
dt->canceled = EINA_TRUE; |
||||
_ephoto_directory_thumb_free(dt); |
||||
} |
||||
} |
||||
|
||||
static Eina_Bool |
||||
_populate_filter(void *data __UNUSED__, Eio_File *handler __UNUSED__, const Eina_File_Direct_Info *info) |
||||
{ |
||||
return _ephoto_eina_file_direct_info_image_useful(info); |
||||
} |
||||
|
||||
static void |
||||
_populate_end(void *data, Eio_File *handler __UNUSED__) |
||||
{ |
||||
Ephoto_Directory_Thumb *dt = data; |
||||
Evas_Object *obj; |
||||
dt->ls = NULL; |
||||
|
||||
EINA_LIST_FREE(dt->objs, obj) |
||||
evas_object_event_callback_del_full(obj, EVAS_CALLBACK_DEL, _obj_del, dt); |
||||
|
||||
if (dt->entry) |
||||
{ |
||||
dt->entry->dir_files_checked = EINA_TRUE; |
||||
if ((dt->entry->item) && (!dt->canceled)) |
||||
elm_gengrid_item_update(dt->entry->item); |
||||
} |
||||
|
||||
_ephoto_directory_thumb_free(dt); |
||||
} |
||||
|
||||
static void |
||||
_populate_error(void *data, Eio_File *handler, int error) |
||||
{ |
||||
Ephoto_Directory_Thumb *dt = data; |
||||
if (error) ERR("could not populate: %s", strerror(error)); |
||||
_populate_end(dt, handler); |
||||
} |
||||
|
||||
static void |
||||
_populate_main(void *data, Eio_File *handler __UNUSED__, const Eina_File_Direct_Info *info) |
||||
{ |
||||
Ephoto_Directory_Thumb *dt = data; |
||||
Evas_Object *obj; |
||||
const char *file; |
||||
|
||||
if (!dt->objs) return; |
||||
if (!dt->entry) return; |
||||
|
||||
obj = dt->objs->data; |
||||
file = eina_stringshare_add(info->path); |
||||
|
||||
DBG("populate thumbnail %p with path '%s'", obj, file); |
||||
|
||||
dt->objs = eina_list_remove_list(dt->objs, dt->objs); |
||||
dt->entry->dir_files = eina_list_append(dt->entry->dir_files, file); |
||||
ephoto_thumb_path_set(obj, file); |
||||
|
||||
evas_object_event_callback_del_full(obj, EVAS_CALLBACK_DEL, _obj_del, dt); |
||||
if ((!dt->objs) && (dt->ls)) |
||||
{ |
||||
eio_file_cancel(dt->ls); |
||||
dt->ls = NULL; |
||||
} |
||||
} |
||||
|
||||
Evas_Object * |
||||
ephoto_directory_thumb_add(Evas_Object *parent, Ephoto_Entry *entry) |
||||
{ |
||||
Ephoto_Directory_Thumb *dt; |
||||
Evas_Object *obj; |
||||
|
||||
if (_pending_dirs) |
||||
dt = eina_hash_find(_pending_dirs, entry->path); |
||||
else |
||||
{ |
||||
dt = NULL; |
||||
_pending_dirs = eina_hash_stringshared_new(NULL); |
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(_pending_dirs, NULL); |
||||
} |
||||
|
||||
obj = ephoto_thumb_add(entry->ephoto, parent, NULL); |
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(obj, NULL); |
||||
|
||||
if (!dt) |
||||
{ |
||||
dt = calloc(1, sizeof(Ephoto_Directory_Thumb)); |
||||
if (!dt) |
||||
{ |
||||
ERR("could not allocate memory for Ephoto_Directory_Thumb"); |
||||
evas_object_del(obj); |
||||
return NULL; |
||||
} |
||||
ephoto_entry_free_listener_add(entry, _entry_free, dt); |
||||
dt->entry = entry; |
||||
dt->ls = eio_file_direct_ls(entry->path, |
||||
_populate_filter, |
||||
_populate_main, |
||||
_populate_end, |
||||
_populate_error, |
||||
dt); |
||||
if (!dt->ls) |
||||
{ |
||||
ERR("could not create eio_file_direct_ls(%s)", entry->path); |
||||
evas_object_del(obj); |
||||
free(dt); |
||||
return NULL; |
||||
} |
||||
|
||||
eina_hash_add(_pending_dirs, entry->path, dt); |
||||
DBG("start thread to lookup inside '%s' for thumbnails.", entry->path); |
||||
} |
||||
else |
||||
DBG("thread already started, wait for thumbnails in '%s'", entry->path); |
||||
|
||||
dt->objs = eina_list_append(dt->objs, obj); |
||||
|
||||
evas_object_event_callback_add(obj, EVAS_CALLBACK_DEL, _obj_del, dt); |
||||
return obj; |
||||
} |