Ephoto: Use standard icons, remove unused code, and match dark theme.

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.
This commit is contained in:
Stephen Houston 2014-01-04 13:17:58 -06:00
parent be631ca2e8
commit 1b0e2ac4af
41 changed files with 52 additions and 925 deletions

View File

@ -6,7 +6,7 @@
________/ /__/ /__/ /__/ /_______/ /_/ /_______/
===Project Manager/Lead Developer===
Stephen "okra" Houston <UnixTitan@gmail.com>
Stephen "okra" Houston <smhouston88@gmail.com>
===Developers===
Gustavo Sverzut Barbieri <barbieri@profusion.mobi>

View File

@ -1,6 +1,3 @@
Icons from the faenza project (http://tiheum.deviantart.com/art/Faenza-Icons-173323228)
For information see COPYING.icons
Copyright (C) 2000-2011 Stephen Houston
All rights reserved.

2
NEWS
View File

@ -6,4 +6,4 @@
________/ /__/ /__/ /__/ /_______/ /_/ /_______/
New ephoto has been added to e/trunk/ephoto in svn.
Ephoto is located in git at apps/ephoto.

1
README
View File

@ -8,4 +8,3 @@ ________/ /__/ /__/ /__/ /_______/ /_/ /_______/
Ephoto Image Viewer/Editor/Manipulator/Slideshow creator.
Icons belong to the faenza project (http://tiheum.deviantart.com/art/Faenza-Icons-173323228)

16
TODO
View File

@ -7,20 +7,22 @@ ________/ /__/ /__/ /__/ /_______/ /_/ /_______/
TODO-
===Config===================
Make the config system work better loading and saving config.
Add options to the config.
Add a config dialog.
===Thumb Browser============
Add a way to view more info
============================
===Single Image Mode========
Rotate Images.
Flip Images.
-Possibly Grayscale, Sepia, etc..?
-Possibly HSV, Brightness, Contrast, RGB, etc..?
-Magnifier and color chooser
Make rotations and flips work
Add neat effects like grayscale, sepia, HSV/RGB, etc...
Save changes made to images
============================
===Slideshow================
-Slideshow features.
-Slideshow features such as changing transition and possibly moving images.
============================
===Other Random Features====
-Exporting to flickr, facebook, etc..
-Possibly a tag system?
-Read straight from a camera
============================

View File

@ -84,8 +84,6 @@ AC_SUBST(LTLIBINTL)
PKG_CHECK_MODULES([ELEMENTARY], [elementary ecore-file ethumb_client])
PKG_CHECK_MODULES([EFREET_MIME], [efreet-mime])
PKG_CHECK_MODULES([EIO], [eio])
PKG_CHECK_MODULES([EET], [eet])
AC_ARG_ENABLE([libexif],
[AC_HELP_STRING([--enable-libexif], [enable libexif support @<:@default=yes@:>@])],
@ -99,7 +97,6 @@ AC_ARG_ENABLE([libexif],
[_ephoto_enable_libexif="yes"]
)
AC_MSG_CHECKING([whether ethumb is built])
AC_MSG_RESULT([${_ephoto_enable_libexif}])
have_libexif="No"
@ -113,14 +110,6 @@ if test "x${_ephoto_enable_libexif}" = "xyes" ; then
])
fi
AC_ARG_WITH([edje-cc],
[AC_HELP_STRING([--with-edje-cc=PATH],
[specify a specific path to edje_cc])],
[edje_cc=$withval;
AC_MSG_NOTICE([edje_cc explicitly set to $edje_cc])
],[edje_cc=$(pkg-config --variable=prefix edje)/bin/edje_cc])
AC_SUBST(edje_cc)
want_quicklaunch="auto"
AC_ARG_ENABLE([quicklaunch],
[AC_HELP_STRING([--disable-quicklaunch],
@ -164,10 +153,6 @@ Makefile
ephoto.spec
data/Makefile
data/desktop/Makefile
data/images/Makefile
data/themes/Makefile
data/themes/default/Makefile
data/themes/default/images/Makefile
src/Makefile
src/bin/Makefile
$po_makefile_in

View File

@ -1,2 +1,2 @@
MAINTAINERCLEANFILES = Makefile.in Makefile
SUBDIRS = desktop images themes
SUBDIRS = desktop

View File

@ -1,9 +0,0 @@
MAINTAINERCLEANFILES = Makefile.in Makefile
IMAGES = \
*.png
imagesdir = $(pkgdatadir)/images
images_DATA = $(IMAGES)
EXTRA_DIST = $(IMAGES)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -1,5 +0,0 @@
## Process this file with automake to produce Makefile.in
MAINTAINERCLEANFILES = Makefile.in Makefile
SUBDIRS = default

View File

@ -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)

View File

@ -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";
}
}
}
}

Binary file not shown.

View File

@ -1,4 +0,0 @@
MAINTAINERCLEANFILES = Makefile.in
EXTRA_DIST = \
*.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 477 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 285 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 275 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

View File

@ -6,8 +6,8 @@ License: BSD
Group: Applications/Multimedia
URL: http://www.stephen.3sixty8.com
Source: %{name}-%{version}.tar.gz
Packager: %{?_packager:%{_packager}}%{!?_packager:Stephen Houston <Unixtitan@gmail.com>}
Vendor: %{?_vendorinfo:%{_vendorinfo}}%{!?_vendorinfo:Okra Project (http://www.stephen.3sixty8.com/)}
Packager: %{?_packager:%{_packager}}%{!?_packager:Stephen Houston <smhouston88@gmail.com>}
Vendor: %{?_vendorinfo:%{_vendorinfo}}%{!?_vendorinfo:Okra Project (http://www.smhouston.us/)}
Distribution: %{?_distribution:%{_distribution}}%{!?_distribution:%{_vendor}}
#BuildSuggests: xorg-x11-devel
Requires: efl edje ethumb

View File

@ -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

View File

@ -6,7 +6,7 @@ INCLUDES = \
-DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \
-DGETTEXT_PACKAGE=\"$(PACKAGE)\" \
-DLOCALEDIR=\"$(localedir)\" \
@ELEMENTARY_CFLAGS@ @EFREET_MIME_CFLAGS@ @EIO_CFLAGS@ @EXIF_CFLAGS@ @EET_CFLAGS@
@ELEMENTARY_CFLAGS@ @EFREET_MIME_CFLAGS@ @EXIF_CFLAGS@
bin_PROGRAMS = ephoto
if BUILD_QUICKLAUNCH
@ -17,13 +17,12 @@ _sources = \
ephoto.c \
ephoto_main.c \
ephoto_config.c \
ephoto_directory_thumb.c \
ephoto_thumb_browser.c \
ephoto_single_browser.c \
ephoto_slideshow.c
_libs = @ELEMENTARY_LIBS@ @EFREET_MIME_LIBS@ @EIO_LIBS@ @EXIF_LIBS@ @EET_LIBS@
_libs = @ELEMENTARY_LIBS@ @EFREET_MIME_LIBS@ @EXIF_LIBS@
ephoto_SOURCES = $(_sources)
ephoto_LDADD = $(_libs)

View File

@ -37,8 +37,6 @@ elm_main(int argc, char **argv)
goto end_log_domain;
}
elm_theme_extension_add(NULL, PACKAGE_DATA_DIR"/themes/default/ephoto.edj");
if (!efreet_mime_init())
ERR("Could not init efreet_mime!");

View File

@ -22,8 +22,6 @@
#include <string.h>
#include <dirent.h>
#define THEME_FILE PACKAGE_DATA_DIR"/themes/default/ephoto.edj"
typedef struct _Ephoto_Config Ephoto_Config;
typedef struct _Ephoto Ephoto;
typedef struct _Ephoto_Entry Ephoto_Entry;
@ -58,8 +56,6 @@ void ephoto_slideshow_entry_set(Evas_Object *obj, Ephoto_Entry *entry);
* "back" - the user want to go back to the previous screen.
*/
Evas_Object *ephoto_directory_thumb_add(Evas_Object *parent, Ephoto_Entry *e);
Evas_Object *ephoto_thumb_browser_add(Ephoto *ephoto, Evas_Object *parent);
/* smart callbacks called:
@ -143,8 +139,6 @@ struct _Ephoto_Entry
Ephoto *ephoto;
Elm_Object_Item *item;
Eina_List *free_listeners;
Eina_List *dir_files; /* if dir, here contain files with preview */
Eina_Bool dir_files_checked : 1;
Eina_Bool is_dir : 1;
Eina_Bool is_up : 1;
};

View File

@ -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;
}

View File

@ -522,7 +522,6 @@ ephoto_entry_new(Ephoto *ephoto, const char *path, const char *label)
void
ephoto_entry_free(Ephoto_Entry *entry)
{
const char *s;
Ephoto_Entry_Free_Listener *fl;
EINA_LIST_FREE(entry->free_listeners, fl)
@ -533,7 +532,6 @@ ephoto_entry_free(Ephoto_Entry *entry)
EINA_SAFETY_ON_NULL_RETURN(entry);
eina_stringshare_del(entry->path);
eina_stringshare_del(entry->label);
EINA_LIST_FREE(entry->dir_files, s) eina_stringshare_del(s);
free(entry);
}

View File

@ -812,7 +812,7 @@ _button_add(Evas_Object *box, const char *image)
but = elm_button_add(box);
ic = elm_icon_add(but);
elm_image_file_set(ic, image, NULL);
elm_icon_standard_set(ic, image);
evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_BOTH, 1, 1);
elm_object_content_set(but, ic);
@ -851,23 +851,23 @@ ephoto_single_browser_add(Ephoto *ephoto, Evas_Object *parent)
evas_object_show(sb->bar);
elm_box_pack_end(sb->main, sb->bar);
but = _button_add(sb->bar, PACKAGE_DATA_DIR "/images/back_grid.png");
but = _button_add(sb->bar, "go-home");
evas_object_smart_callback_add(but, "clicked", _back, sb);
sep = elm_separator_add(sb->bar);
elm_box_pack_end(sb->bar, sep);
evas_object_show(sep);
but = _button_add(sb->bar, PACKAGE_DATA_DIR "/images/zoom-in.png");
but = _button_add(sb->bar, "zoom-in");
evas_object_smart_callback_add(but, "clicked", _zoom_in_cb, sb);
but = _button_add(sb->bar, PACKAGE_DATA_DIR "/images/zoom-out.png");
but = _button_add(sb->bar, "zoom-out");
evas_object_smart_callback_add(but, "clicked", _zoom_out_cb, sb);
but = _button_add(sb->bar, PACKAGE_DATA_DIR "/images/zoom-fit.png");
but = _button_add(sb->bar, "zoom-fit");
evas_object_smart_callback_add(but, "clicked", _zoom_fit_cb, sb);
but = _button_add(sb->bar, PACKAGE_DATA_DIR "/images/zoom-original.png");
but = _button_add(sb->bar, "zoom-original");
evas_object_smart_callback_add(but, "clicked", _zoom_1_cb, sb);
sep = elm_separator_add(sb->bar);
@ -891,23 +891,23 @@ ephoto_single_browser_add(Ephoto *ephoto, Evas_Object *parent)
elm_box_pack_end(sb->bar, sep);
evas_object_show(sep);
but = _button_add(sb->bar, PACKAGE_DATA_DIR "/images/first.png");
but = _button_add(sb->bar, "go-first");
evas_object_smart_callback_add(but, "clicked", _go_first, sb);
but = _button_add(sb->bar, PACKAGE_DATA_DIR "/images/back.png");
but = _button_add(sb->bar, "go-previous");
evas_object_smart_callback_add(but, "clicked", _go_prev, sb);
but = _button_add(sb->bar, PACKAGE_DATA_DIR "/images/forward.png");
but = _button_add(sb->bar, "go-next");
evas_object_smart_callback_add(but, "clicked", _go_next, sb);
but = _button_add(sb->bar, PACKAGE_DATA_DIR "/images/last.png");
but = _button_add(sb->bar, "go-last");
evas_object_smart_callback_add(but, "clicked", _go_last, sb);
sep = elm_separator_add(sb->bar);
elm_box_pack_end(sb->bar, sep);
evas_object_show(sep);
but = _button_add(sb->bar, PACKAGE_DATA_DIR "/images/slideshow.png");
but = _button_add(sb->bar, "media-playback-start");
evas_object_smart_callback_add(but, "clicked", _slideshow, sb);
sb->handlers = eina_list_append

View File

@ -65,51 +65,27 @@ _ephoto_thumb_item_text_get(void *data, Evas_Object *obj __UNUSED__, const char
}
static Evas_Object *
_ephoto_thumb_dir_icon_get(void *data, Evas_Object *obj, const char *part)
_ephoto_thumb_up_icon_get(void *data __UNUSED__, Evas_Object *obj, const char *part __UNUSED__)
{
Ephoto_Entry *e = data;
const char *f;
int n;
Evas_Object *ic;
if (strncmp(part, "elm.swallow.icon.", sizeof("elm.swallow.icon.") - 1) != 0)
return NULL;
ic = elm_icon_add(obj);
evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
elm_icon_standard_set(ic, "go-up");
n = atoi(part + sizeof("elm.swallow.icon.") - 1);
if (n < 1)
return NULL;
n--;
return ic;
}
f = eina_list_nth(e->dir_files, n);
if (f)
{
Evas_Object *o;
o = ephoto_thumb_add(e->ephoto, obj, f);
//elm_object_style_set(o, "default");
return o;
}
if (e->dir_files_checked)
return NULL;
return ephoto_directory_thumb_add(obj, e);
}
static Eina_Bool
_ephoto_thumb_dir_state_get(void *data, Evas_Object *obj __UNUSED__, const char *part)
static Evas_Object *
_ephoto_thumb_dir_icon_get(void *data __UNUSED__, Evas_Object *obj, const char *part __UNUSED__)
{
Ephoto_Entry *e = data;
int n;
if (strcmp(part, "have_files") == 0)
return !!e->dir_files;
if (strncmp(part, "have_file.", sizeof("have_file.") - 1) != 0)
return EINA_FALSE;
n = atoi(part + sizeof("have_file.") - 1);
if (n < 1)
return EINA_FALSE;
return n <= (int)eina_list_count(e->dir_files);
Evas_Object *ic;
ic = elm_icon_add(obj);
evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
elm_icon_standard_set(ic, "folder");
return ic;
}
static Evas_Object *
@ -449,7 +425,7 @@ _button_add(Evas_Object *box, const char *image)
but = elm_button_add(box);
ic = elm_icon_add(but);
elm_image_file_set(ic, image, NULL);
elm_icon_standard_set(ic, image);
evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_BOTH, 1, 1);
elm_object_content_set(but, ic);
@ -472,16 +448,16 @@ ephoto_thumb_browser_add(Ephoto *ephoto, Evas_Object *parent)
tb = calloc(1, sizeof(Ephoto_Thumb_Browser));
EINA_SAFETY_ON_NULL_GOTO(tb, error);
_ephoto_thumb_up_class.item_style = "ephoto-up";
_ephoto_thumb_up_class.item_style = "default";
_ephoto_thumb_up_class.func.text_get = _ephoto_thumb_item_text_get;
_ephoto_thumb_up_class.func.content_get = NULL;
_ephoto_thumb_up_class.func.content_get = _ephoto_thumb_up_icon_get;
_ephoto_thumb_up_class.func.state_get = NULL;
_ephoto_thumb_up_class.func.del = _ephoto_thumb_item_del;
_ephoto_thumb_dir_class.item_style = "ephoto-album-preview";
_ephoto_thumb_dir_class.item_style = "default";
_ephoto_thumb_dir_class.func.text_get = _ephoto_thumb_item_text_get;
_ephoto_thumb_dir_class.func.content_get = _ephoto_thumb_dir_icon_get;
_ephoto_thumb_dir_class.func.state_get = _ephoto_thumb_dir_state_get;
_ephoto_thumb_dir_class.func.state_get = NULL;
_ephoto_thumb_dir_class.func.del = _ephoto_thumb_item_del;
_ephoto_thumb_file_class.item_style = "thumb";
@ -509,10 +485,10 @@ ephoto_thumb_browser_add(Ephoto *ephoto, Evas_Object *parent)
evas_object_show(tb->bar);
elm_box_pack_end(tb->main, tb->bar);
but = _button_add(tb->bar, PACKAGE_DATA_DIR "/images/single.png");
but = _button_add(tb->bar, "image-x-generic");
evas_object_smart_callback_add(but, "clicked", _view_single, tb);
but = _button_add(tb->bar, PACKAGE_DATA_DIR "/images/slideshow.png");
but = _button_add(tb->bar, "media-playback-start");
evas_object_smart_callback_add(but, "clicked", _slideshow, tb);
tb->entry = elm_entry_add(tb->bar);
@ -529,11 +505,11 @@ ephoto_thumb_browser_add(Ephoto *ephoto, Evas_Object *parent)
evas_object_show(tb->entry);
elm_box_pack_end(tb->bar, tb->entry);
but = _button_add(tb->bar, PACKAGE_DATA_DIR "/images/zoom-in.png");
but = _button_add(tb->bar, "zoom-in.png");
evas_object_smart_callback_add(but, "clicked", _zoom_in, tb);
max = but;
but = _button_add(tb->bar, PACKAGE_DATA_DIR "/images/zoom-out.png");
but = _button_add(tb->bar, "zoom-out.png");
evas_object_smart_callback_add(but, "clicked", _zoom_out, tb);
min = but;