aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--AUTHORS7
-rw-r--r--Makefile.am10
-rw-r--r--configure.ac80
-rw-r--r--data/Makefile.am29
-rw-r--r--data/emotion/checkme2
-rw-r--r--data/ethumb/checkme2
-rw-r--r--data/ethumb/frames/border-0.jpg (renamed from legacy/ethumb/data/frames/images/border-0.jpg)bin542 -> 542 bytes
-rw-r--r--data/ethumb/frames/default.edc (renamed from legacy/ethumb/data/frames/default.edc)0
-rw-r--r--dbus-services/org.enlightenment.Ethumb.service.in (renamed from legacy/ethumb/org.enlightenment.Ethumb.service.in)0
-rw-r--r--doc/main.dox7
-rw-r--r--m4/efl.m413
-rw-r--r--old/ChangeLog.ethumb (renamed from legacy/ethumb/ChangeLog)0
-rw-r--r--old/NEWS.ethumb (renamed from legacy/ethumb/NEWS)0
-rw-r--r--old/README.ethumb (renamed from legacy/ethumb/README)0
-rw-r--r--pc/ethumb.pc.in (renamed from legacy/ethumb/ethumb.pc.in)4
-rw-r--r--pc/ethumb_client.pc.in (renamed from legacy/ethumb/ethumb_client.pc.in)2
-rw-r--r--src/Makefile.am1
-rw-r--r--src/Makefile_Ethumb.am171
-rw-r--r--src/bin/ethumb/ethumb.c (renamed from legacy/ethumb/src/bin/ethumb.c)4
-rw-r--r--src/bin/ethumb/ethumbd.c (renamed from legacy/ethumb/src/bin/ethumbd.c)91
-rw-r--r--src/bin/ethumb/ethumbd_client.c (renamed from legacy/ethumb/src/bin/ethumbd_client.c)6
-rw-r--r--src/bin/ethumb/ethumbd_private.h (renamed from legacy/ethumb/src/bin/ethumbd_private.h)0
-rw-r--r--src/bin/ethumb/ethumbd_slave.c (renamed from legacy/ethumb/src/bin/ethumbd_child.c)34
-rw-r--r--src/lib/edje/edje_edit.c3
-rw-r--r--src/lib/ethumb/Ethumb.h (renamed from legacy/ethumb/src/lib/Ethumb.h)69
-rw-r--r--src/lib/ethumb/Ethumb_Plugin.h (renamed from legacy/ethumb/src/lib/Ethumb_Plugin.h)0
-rw-r--r--src/lib/ethumb/client/Ethumb_Client.h (renamed from legacy/ethumb/src/lib/client/Ethumb_Client.h)1
-rw-r--r--src/lib/ethumb/client/ethumb_client.c (renamed from legacy/ethumb/src/lib/client/ethumb_client.c)57
-rw-r--r--src/lib/ethumb/ethumb.c (renamed from legacy/ethumb/src/lib/ethumb.c)62
-rw-r--r--src/lib/ethumb/ethumb_private.h (renamed from legacy/ethumb/src/lib/ethumb_private.h)0
-rw-r--r--src/lib/ethumb/md5.c (renamed from legacy/ethumb/src/lib/md5.c)0
-rw-r--r--src/lib/ethumb/md5.h (renamed from legacy/ethumb/src/lib/md5.h)0
-rw-r--r--src/modules/ethumb/emotion/emotion.c (renamed from legacy/ethumb/src/plugins/emotion/emotion.c)125
-rw-r--r--src/modules/ethumb/emotion/placeholder.pngbin0 -> 150 bytes
-rw-r--r--src/modules/ethumb/emotion/template.edc (renamed from legacy/ethumb/src/plugins/emotion/template.edc)6
-rw-r--r--src/tests/ethumb/ethumb_dbus.c (renamed from legacy/ethumb/src/tests/ethumb_dbus.c)4
36 files changed, 642 insertions, 148 deletions
diff --git a/AUTHORS b/AUTHORS
index 7ee6c3c8c..afb94e8d8 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -257,3 +257,10 @@ Pierre Le Magourou <pierre.lemagourou@openwide.fr>
Hugo Camboulive <hugo.camboulive@zodiacaerospace.com>
Sohyun Kim <anna1014.kim@samsung.com>
Leandro Dorileo <dorileo@profusion.mobi>
+
+Ethumb
+------
+Rafael Antognolli <antognolli@profusion.mobi>
+Cedric Bail <cedric.bail@free.fr>
+Mikael SANS <sans.mikael@gmail.com>
+Jérôme Pinot <ngc891@gmail.com>
diff --git a/Makefile.am b/Makefile.am
index c0f08f1b2..f377199d4 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -62,6 +62,7 @@ old/ChangeLog.eio \
old/ChangeLog.embryo \
old/ChangeLog.emotion \
old/ChangeLog.escape \
+old/ChangeLog.ethumb \
old/ChangeLog.evas \
old/ChangeLog.evil \
old/ChangeLog.evil.0 \
@@ -75,6 +76,7 @@ old/NEWS.eio \
old/NEWS.embryo \
old/NEWS.emotion \
old/NEWS.escape \
+old/NEWS.ethumb \
old/NEWS.evas \
old/NEWS.evil \
old/README.ecore \
@@ -89,6 +91,7 @@ old/README.embryo \
old/README.emotion \
old/README.ephysics \
old/README.escape \
+old/README.ethumb \
old/README.evas \
old/README.evil \
spec/efl.spec
@@ -125,7 +128,9 @@ pc/efreet.pc \
pc/efreet-mime.pc \
pc/efreet-trash.pc \
pc/edje.pc \
-pc/emotion.pc
+pc/emotion.pc \
+pc/ethumb.pc \
+pc/ethumb_client.pc
if BUILD_ENGINE_SOFTWARE_X11
pkgconfig_DATA += pc/evas-software-x11.pc
@@ -216,7 +221,8 @@ endif
servicedir = @dbusservicedir@
service_DATA = \
-dbus-services/org.enlightenment.Efreet.service
+dbus-services/org.enlightenment.Efreet.service \
+dbus-services/org.enlightenment.Ethumb.service
diff --git a/configure.ac b/configure.ac
index 568656471..9035a2f5c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3375,6 +3375,81 @@ EFL_LIB_END([Emotion])
#### End of Emotion
+#### Ethumb
+EFL_LIB_START([Ethumb])
+
+### Default values
+
+### Additional options to configure
+
+### Checks for programs
+
+### Checks for libraries
+EFL_PLATFORM_DEPEND([EINA], [evil])
+
+EFL_INTERNAL_DEPEND_PKG([ETHUMB], [eina])
+EFL_INTERNAL_DEPEND_PKG([ETHUMB], [evas])
+EFL_INTERNAL_DEPEND_PKG([ETHUMB], [ecore])
+EFL_INTERNAL_DEPEND_PKG([ETHUMB], [ecore-evas])
+EFL_INTERNAL_DEPEND_PKG([ETHUMB], [ecore-file])
+EFL_INTERNAL_DEPEND_PKG([ETHUMB], [edje])
+
+## modules
+
+EFL_EVAL_PKGS([ETHUMB])
+
+### Checks for header files
+
+### Checks for types
+
+### Checks for structures
+
+### Checks for compiler characteristics
+
+### Checks for linker characteristics
+
+### Checks for library functions
+
+### Check availability
+
+EFL_LIB_END([Ethumb])
+#### End of Ethumb
+
+#### Ethumb_Client
+EFL_LIB_START([Ethumb_Client])
+
+### Default values
+
+### Additional options to configure
+
+### Checks for programs
+
+### Checks for libraries
+EFL_INTERNAL_DEPEND_PKG([ETHUMB_CLIENT], [eina])
+EFL_INTERNAL_DEPEND_PKG([ETHUMB_CLIENT], [ecore])
+EFL_INTERNAL_DEPEND_PKG([ETHUMB_CLIENT], [edbus])
+EFL_INTERNAL_DEPEND_PKG([ETHUMB_CLIENT], [ethumb])
+
+EFL_EVAL_PKGS([ETHUMB_CLIENT])
+
+### Checks for header files
+
+### Checks for types
+
+### Checks for structures
+
+### Checks for compiler characteristics
+
+### Checks for linker characteristics
+
+### Checks for library functions
+
+### Check availability
+
+EFL_LIB_END([Ethumb_Client])
+#### End of Ethumb_Client
+
+
AC_ARG_ENABLE([always-build-examples],
[AC_HELP_STRING([--enable-always-build-examples],
[always build examples. @<:@default=disabled@:>@])],
@@ -3458,7 +3533,10 @@ pc/eeze.pc
pc/ephysics.pc
pc/edje.pc
pc/emotion.pc
+pc/ethumb.pc
+pc/ethumb_client.pc
dbus-services/org.enlightenment.Efreet.service
+dbus-services/org.enlightenment.Ethumb.service
$po_makefile_in
])
@@ -3665,6 +3743,8 @@ echo "Eeze...................: ${efl_lib_optional_eeze} (tizen: ${want_tizen})"
echo "EPhysics...............: ${efl_lib_optional_ephysics}"
echo "Edje...................: yes (physics=${efl_lib_optional_ephysics}, multisense=${want_multisense})"
echo "Emotion................: yes (gstreamer=${have_emotion_module_gstreamer} (xoverlay=${have_gst_xoverlay}), xine=${have_emotion_module_xine}, generic=${have_emotion_module_generic}, v4l2=${want_v4l2})"
+echo "Ethumb.................: yes"
+echo "Ethumb_Client..........: yes"
echo "Tests..................: ${build_tests}"
echo "Examples...............: make examples"
diff --git a/data/Makefile.am b/data/Makefile.am
index 5104f31b1..be0a463aa 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -60,9 +60,38 @@ edje/vim/snippets/edc.snippets \
edje/vim/syntax/edc.vim \
edje/vim/syntax/embryo.vim
+# Helper for people using EDJ
+EDJE_CC = EFL_RUN_IN_TREE=1 $(top_builddir)/src/bin/edje/edje_cc
+EDJE_CC_FLAGS_VERBOSE_0 =
+EDJE_CC_FLAGS_VERBOSE_1 = -v
+EDJE_CC_FLAGS = $(EDJE_CC_FLAGS_VERBOSE_$(V))
+
+AM_V_EDJ = $(am__v_EDJ_$(V))
+am__v_EDJ_ = $(am__v_EDJ_$(AM_DEFAULT_VERBOSITY))
+am__v_EDJ_0 = @echo " EDJ " $@;
+
########################################################################
# Emotion
emotionfilesdir = $(datadir)/emotion
emotionfiles_DATA = emotion/checkme
EXTRA_DIST += $(emotionfiles_DATA)
+
+########################################################################
+# Ethumb
+ethumbfilesdir = $(datadir)/ethumb
+ethumbfiles_DATA = ethumb/checkme
+EXTRA_DIST += $(ethumbfiles_DATA)
+
+ethumbframesdir = $(datadir)/ethumb/frames
+ethumbframes_DATA = \
+ethumb/frames/default.edj
+
+ethumb/frames/default.edj: ethumb/frames/default.edc
+ @$(MKDIR_P) ethumb/frames/
+ $(AM_V_EDJ)$(EDJE_CC) $(EDJE_CC_FLAGS) -id $(srcdir)/ethumb/frames/ $< $@
+
+
+EXTRA_DIST += \
+ethumb/frames/default.edc \
+ethumb/frames/border-0.jpg
diff --git a/data/emotion/checkme b/data/emotion/checkme
index e2f46e1c2..f1e063742 100644
--- a/data/emotion/checkme
+++ b/data/emotion/checkme
@@ -1,2 +1,2 @@
-This is just a test file used to help emotion determine its prefix
+This is just a test file used to help ethumb determine its prefix
location.
diff --git a/data/ethumb/checkme b/data/ethumb/checkme
new file mode 100644
index 000000000..987063d4c
--- /dev/null
+++ b/data/ethumb/checkme
@@ -0,0 +1,2 @@
+This is just a test file used to help evas determine its prefix
+location.
diff --git a/legacy/ethumb/data/frames/images/border-0.jpg b/data/ethumb/frames/border-0.jpg
index ee66879b2..ee66879b2 100644
--- a/legacy/ethumb/data/frames/images/border-0.jpg
+++ b/data/ethumb/frames/border-0.jpg
Binary files differ
diff --git a/legacy/ethumb/data/frames/default.edc b/data/ethumb/frames/default.edc
index 53412632c..53412632c 100644
--- a/legacy/ethumb/data/frames/default.edc
+++ b/data/ethumb/frames/default.edc
diff --git a/legacy/ethumb/org.enlightenment.Ethumb.service.in b/dbus-services/org.enlightenment.Ethumb.service.in
index ece2e031c..ece2e031c 100644
--- a/legacy/ethumb/org.enlightenment.Ethumb.service.in
+++ b/dbus-services/org.enlightenment.Ethumb.service.in
diff --git a/doc/main.dox b/doc/main.dox
index d20d5477f..9faf1491e 100644
--- a/doc/main.dox
+++ b/doc/main.dox
@@ -22,6 +22,7 @@
* @li @ref ephysics_main physics simulation integration and visual effects.
* @li @ref edje_main layout and theme library with super powers.
* @li @ref emotion_main to play music and videos.
+ * @li @ref ethumb_main to generate thumbnail images of files.
*
*/
@@ -232,3 +233,9 @@
*
* @brief Plays music and videos.
*/
+
+/**
+ * @defgroup Ethumb
+ *
+ * @brief Generates thumbnail images of files.
+ */
diff --git a/m4/efl.m4 b/m4/efl.m4
index a891203e2..7ed137f11 100644
--- a/m4/efl.m4
+++ b/m4/efl.m4
@@ -16,7 +16,18 @@ dnl Adds a pkg-config dependency on another EFL.
AC_DEFUN([EFL_INTERNAL_DEPEND_PKG],
[dnl
m4_pushdef([DOWNEFL], m4_translit([$1], [-A-Z], [_a-z]))dnl
-requirements_pc_[]m4_defn([DOWNEFL])="$2 >= ${PACKAGE_VERSION} ${requirements_pc_[][]m4_defn([DOWNEFL])}"
+dnl TODO: we need to fix the package config names for 2.0
+dnl TODO: and make them uniform in scheme.
+depname="$2"
+case "${depname}" in
+ edbus)
+ depname="edbus2"
+ ;;
+ ethumb-client)
+ depname="ethumb_client"
+ ;;
+esac
+requirements_pc_[]m4_defn([DOWNEFL])="${depname} >= ${PACKAGE_VERSION} ${requirements_pc_[][]m4_defn([DOWNEFL])}"
m4_popdef([DOWNEFL])dnl
])
diff --git a/legacy/ethumb/ChangeLog b/old/ChangeLog.ethumb
index 2470e8707..2470e8707 100644
--- a/legacy/ethumb/ChangeLog
+++ b/old/ChangeLog.ethumb
diff --git a/legacy/ethumb/NEWS b/old/NEWS.ethumb
index bf716c688..bf716c688 100644
--- a/legacy/ethumb/NEWS
+++ b/old/NEWS.ethumb
diff --git a/legacy/ethumb/README b/old/README.ethumb
index 3494520e8..3494520e8 100644
--- a/legacy/ethumb/README
+++ b/old/README.ethumb
diff --git a/legacy/ethumb/ethumb.pc.in b/pc/ethumb.pc.in
index 233e2ed39..b2d935b24 100644
--- a/legacy/ethumb/ethumb.pc.in
+++ b/pc/ethumb.pc.in
@@ -2,10 +2,12 @@ prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
+modules=@libdir@/ethumb/modules
+module_arch=@MODULE_ARCH@
Name: ethumb
Description: Thumbnail Generator Library
-Requires: @requirement_ethumb@
Version: @VERSION@
+Requires.private: @requirements_pc_ethumb@
Libs: -L${libdir} -lethumb
Cflags: -I${includedir}/ethumb-@VMAJ@
diff --git a/legacy/ethumb/ethumb_client.pc.in b/pc/ethumb_client.pc.in
index c9eebc656..796cae6e9 100644
--- a/legacy/ethumb/ethumb_client.pc.in
+++ b/pc/ethumb_client.pc.in
@@ -5,7 +5,7 @@ includedir=@includedir@
Name: ethumb_client
Description: Thumbnail Client Library
-Requires: @requirement_ethumb_client@
Version: @VERSION@
+Requires.private: @requirements_pc_ethumb_client@
Libs: -L${libdir} -lethumb_client
Cflags: -I${includedir}/ethumb-@VMAJ@
diff --git a/src/Makefile.am b/src/Makefile.am
index e22f4c004..5ad8b9770 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -43,6 +43,7 @@ include Makefile_Eeze.am
include Makefile_EPhysics.am
include Makefile_Edje.am
include Makefile_Emotion.am
+include Makefile_Ethumb.am
.PHONY: benchmark examples
diff --git a/src/Makefile_Ethumb.am b/src/Makefile_Ethumb.am
new file mode 100644
index 000000000..3b0e15daa
--- /dev/null
+++ b/src/Makefile_Ethumb.am
@@ -0,0 +1,171 @@
+### Library
+
+lib_LTLIBRARIES += \
+lib/ethumb/libethumb.la \
+lib/ethumb/client/libethumb_client.la
+
+ETHUMB_COMMON_CPPFLAGS = \
+-I$(top_srcdir)/src/lib/eina \
+-I$(top_builddir)/src/lib/eina \
+-I$(top_srcdir)/src/lib/eo \
+-I$(top_builddir)/src/lib/eo \
+-I$(top_srcdir)/src/lib/ecore \
+-I$(top_builddir)/src/lib/ecore \
+-I$(top_srcdir)/src/lib/ecore_evas \
+-I$(top_builddir)/src/lib/ecore_evas \
+-I$(top_srcdir)/src/lib/ecore_file \
+-I$(top_builddir)/src/lib/ecore_file \
+-I$(top_srcdir)/src/lib/evas \
+-I$(top_builddir)/src/lib/evas \
+-I$(top_srcdir)/src/lib/edje \
+-I$(top_builddir)/src/lib/edje \
+-I$(top_srcdir)/src/lib/ethumb \
+-I$(top_builddir)/src/lib/ethumb \
+@EFL_COV_CFLAGS@ \
+@ETHUMB_CFLAGS@ \
+@USE_EVIL_CFLAGS@
+
+ETHUMB_COMMON_LDADD = \
+lib/eina/libeina.la \
+lib/eo/libeo.la \
+lib/ecore/libecore.la \
+lib/ecore_evas/libecore_evas.la \
+lib/ecore_file/libecore_file.la \
+lib/evas/libevas.la \
+lib/edje/libedje.la \
+@EFL_COV_LIBS@ \
+@USE_EVIL_LIBS@
+
+installed_ethumbmainheadersdir = $(includedir)/ethumb-@VMAJ@
+dist_installed_ethumbmainheaders_DATA = \
+lib/ethumb/Ethumb.h \
+lib/ethumb/client/Ethumb_Client.h
+
+# libethumb.la
+lib_ethumb_libethumb_la_SOURCES = \
+lib/ethumb/Ethumb_Plugin.h \
+lib/ethumb/ethumb_private.h \
+lib/ethumb/md5.h \
+lib/ethumb/ethumb.c \
+lib/ethumb/md5.c
+
+ETHUMB_COMMON_LIBADD = $(ETHUMB_COMMON_LDADD) @ETHUMB_LIBS@
+ETHUMB_COMMON_LDADD += @ETHUMB_LDFLAGS@
+ETHUMB_COMMON_USER_LIBADD = $(ETHUMB_COMMON_LIBADD) lib/ethumb/libethumb.la
+ETHUMB_COMMON_USER_LDADD = $(ETHUMB_COMMON_LDADD) lib/ethumb/libethumb.la
+
+lib_ethumb_libethumb_la_CPPFLAGS = \
+$(ETHUMB_COMMON_CPPFLAGS) \
+-DPACKAGE_BIN_DIR=\"$(bindir)\" \
+-DPACKAGE_LIB_DIR=\"$(libdir)\" \
+-DPACKAGE_DATA_DIR=\"$(datadir)/ethumb\" \
+-DPACKAGE_BUILD_DIR=\"`pwd`/$(top_builddir)\" \
+-DEFL_ETHUMB_BUILD
+
+lib_ethumb_libethumb_la_LIBADD = $(ETHUMB_COMMON_LIBADD)
+lib_ethumb_libethumb_la_LDFLAGS = @EFL_LTLIBRARY_FLAGS@
+
+
+# libethumb_client.la
+lib_ethumb_client_libethumb_client_la_SOURCES = \
+lib/ethumb/client/ethumb_client.c
+
+lib_ethumb_client_libethumb_client_la_CPPFLAGS = \
+$(ETHUMB_COMMON_CPPFLAGS) \
+-I$(top_srcdir)/src/lib/edbus \
+-I$(top_builddir)/src/lib/edbus \
+-I$(top_srcdir)/src/lib/ethumb/client \
+-I$(top_builddir)/src/lib/ethumb/client \
+-DEFL_ETHUMB_BUILD
+
+lib_ethumb_client_libethumb_client_la_LIBADD = \
+$(ETHUMB_COMMON_USER_LIBADD) \
+lib/edbus/libedbus2.la
+lib_ethumb_client_libethumb_client_la_LDFLAGS = @EFL_LTLIBRARY_FLAGS@
+
+## Modules
+
+# Emotion
+ethumbmoduleemotiondir = $(libdir)/ethumb/modules/emotion/$(MODULE_ARCH)
+ethumbmoduleemotion_LTLIBRARIES = modules/ethumb/emotion/module.la
+modules_ethumb_emotion_module_la_SOURCES = \
+modules/ethumb/emotion/emotion.c
+modules_ethumb_emotion_module_la_CPPFLAGS = \
+$(ETHUMB_COMMON_CPPFLAGS) \
+-I$(top_srcdir)/src/lib/eet \
+-I$(top_builddir)/src/lib/eet \
+-I$(top_srcdir)/src/lib/emotion \
+-I$(top_builddir)/src/lib/emotion \
+-DPACKAGE_BIN_DIR=\"$(bindir)\" \
+-DPACKAGE_LIB_DIR=\"$(libdir)\" \
+-DPACKAGE_DATA_DIR=\"$(datadir)/ethumb\" \
+-DPACKAGE_BUILD_DIR=\"`pwd`/$(top_builddir)\"
+
+modules_ethumb_emotion_module_la_LIBADD = \
+$(ETHUMB_COMMON_USER_LIBADD) \
+lib/eet/libeet.la \
+lib/emotion/libemotion.la
+
+modules_ethumb_emotion_module_la_LDFLAGS = -module @EFL_LTMODULE_FLAGS@
+modules_ethumb_emotion_module_la_LIBTOOLFLAGS = --tag=disable-static
+
+modules/ethumb/emotion/template.edj: modules/ethumb/emotion/template.edc modules/ethumb/emotion/placeholder.png bin/edje/edje_cc
+ @$(MKDIR_P) modules/ethumb/emotion
+ $(AM_V_EDJ)$(EDJE_CC) $(EDJE_CC_FLAGS) -id $(srcdir)/modules/ethumb/emotion $< $@
+
+ethumbmoduleemotion_DATA = modules/ethumb/emotion/template.edj
+
+EXTRA_DIST += \
+modules/ethumb/emotion/template.edc \
+modules/ethumb/emotion/placeholder.png
+
+
+### Binary
+
+bin_PROGRAMS += \
+bin/ethumb/ethumb \
+bin/ethumb/ethumbd \
+bin/ethumb/ethumbd_client
+
+ethumbinternal_bindir=$(libdir)/ethumb/utils/$(MODULE_ARCH)
+ethumbinternal_bin_PROGRAMS = \
+bin/ethumb/ethumbd_slave
+
+bin_ethumb_ethumb_SOURCES = bin/ethumb/ethumb.c
+bin_ethumb_ethumb_CPPFLAGS = $(ETHUMB_COMMON_CPPFLAGS)
+bin_ethumb_ethumb_LDADD = $(ETHUMB_COMMON_USER_LDADD)
+
+# TODO: review why ethumd (master) links to libethumb! shouldn't
+bin_ethumb_ethumbd_SOURCES = \
+bin/ethumb/ethumbd_private.h \
+bin/ethumb/ethumbd.c
+bin_ethumb_ethumbd_CPPFLAGS = \
+$(ETHUMB_COMMON_CPPFLAGS) \
+-I$(top_srcdir)/src/lib/edbus \
+-I$(top_builddir)/src/lib/edbus \
+-DPACKAGE_BIN_DIR=\"$(bindir)\" \
+-DPACKAGE_LIB_DIR=\"$(libdir)\" \
+-DPACKAGE_DATA_DIR=\"$(datadir)/ethumb\" \
+-DPACKAGE_BUILD_DIR=\"`pwd`/$(top_builddir)\"
+bin_ethumb_ethumbd_LDADD = \
+$(ETHUMB_COMMON_USER_LDADD) \
+lib/edbus/libedbus2.la
+
+bin_ethumb_ethumbd_client_SOURCES = \
+bin/ethumb/ethumbd_client.c
+bin_ethumb_ethumbd_client_CPPFLAGS = \
+$(ETHUMB_COMMON_CPPFLAGS) \
+-I$(top_srcdir)/src/lib/edbus \
+-I$(top_builddir)/src/lib/edbus \
+-I$(top_srcdir)/src/lib/ethumb/client \
+-I$(top_builddir)/src/lib/ethumb/client
+bin_ethumb_ethumbd_client_LDADD = \
+$(ETHUMB_COMMON_USER_LDADD) \
+lib/ethumb/client/libethumb_client.la \
+lib/edbus/libedbus2.la
+
+bin_ethumb_ethumbd_slave_SOURCES = \
+bin/ethumb/ethumbd_private.h \
+bin/ethumb/ethumbd_slave.c
+bin_ethumb_ethumbd_slave_CPPFLAGS = $(ETHUMB_COMMON_CPPFLAGS)
+bin_ethumb_ethumbd_slave_LDADD = $(ETHUMB_COMMON_USER_LDADD)
diff --git a/legacy/ethumb/src/bin/ethumb.c b/src/bin/ethumb/ethumb.c
index 12750e019..27d50df69 100644
--- a/legacy/ethumb/src/bin/ethumb.c
+++ b/src/bin/ethumb/ethumb.c
@@ -43,7 +43,7 @@ struct frame
};
static unsigned char
-_ethumb_getopt_callback_frame_parse(const Ecore_Getopt *parser __UNUSED__, const Ecore_Getopt_Desc *desc __UNUSED__, const char *str, void *data __UNUSED__, Ecore_Getopt_Value *storage)
+_ethumb_getopt_callback_frame_parse(const Ecore_Getopt *parser EINA_UNUSED, const Ecore_Getopt_Desc *desc EINA_UNUSED, const char *str, void *data EINA_UNUSED, Ecore_Getopt_Value *storage)
{
struct frame *f = (struct frame *)storage->ptrp;
const char *tfile, *tgroup, *tswallow, *base, *sep;
@@ -135,7 +135,7 @@ _thumb_report(const char *mode, Ethumb *e)
}
static void
-_finished_thumb( void *data __UNUSED__, Ethumb *e, Eina_Bool success)
+_finished_thumb( void *data EINA_UNUSED, Ethumb *e, Eina_Bool success)
{
const char *mode = success ? "GENERATED" : "FAILED";
_thumb_report(mode, e);
diff --git a/legacy/ethumb/src/bin/ethumbd.c b/src/bin/ethumb/ethumbd.c
index cebde0f4b..f0f0d9b44 100644
--- a/legacy/ethumb/src/bin/ethumbd.c
+++ b/src/bin/ethumb/ethumbd.c
@@ -57,6 +57,7 @@ static const char _ethumb_dbus_interface[] = "org.enlightenment.Ethumb";
static const char _ethumb_dbus_objects_interface[] = "org.enlightenment.Ethumb.objects";
static const char _ethumb_dbus_path[] = "/org/enlightenment/Ethumb";
+static Eina_Prefix *_pfx = NULL;
static int _log_domain = -1;
typedef struct _Ethumbd_Setup Ethumbd_Setup;
@@ -453,7 +454,7 @@ _ethumbd_slave_alloc_cmd(Ethumbd *ed, int ssize, char *sdata)
}
static Eina_Bool
-_ethumbd_slave_data_read_cb(void *data, int type __UNUSED__, void *event)
+_ethumbd_slave_data_read_cb(void *data, int type EINA_UNUSED, void *event)
{
Ethumbd *ed = data;
Ecore_Exe_Event_Data *ev = event;
@@ -499,7 +500,7 @@ _ethumbd_slave_data_read_cb(void *data, int type __UNUSED__, void *event)
}
static Eina_Bool
-_ethumbd_slave_del_cb(void *data, int type __UNUSED__, void *event)
+_ethumbd_slave_del_cb(void *data, int type EINA_UNUSED, void *event)
{
Ethumbd *ed = data;
Ecore_Exe_Event_Del *ev = event;
@@ -885,7 +886,6 @@ _name_owner_changed_cb(void *context, const char *bus, const char *old_id, const
{
Ethumbd_Object_Data *odata = context;
Ethumbd *ed = odata->ed;
- Ethumbd_Queue *q = &ed->queue;
DBG("NameOwnerChanged: name = %s, from = %s, to = %s", bus, old_id, new_id);
if (new_id[0])
@@ -963,7 +963,8 @@ _ethumb_dbus_get_bytearray(EDBus_Message_Iter *iter)
if (!edbus_message_iter_fixed_array_get(iter, 'y', &result,
&length))
{
- ERR("not an byte array element.");
+ ERR("not byte array element. Signature: %s",
+ edbus_message_iter_signature_get(iter));
return NULL;
}
@@ -981,7 +982,7 @@ _ethumb_dbus_append_bytearray(EDBus_Message_Iter *parent, EDBus_Message_Iter *ar
if (!string)
string = "";
- size = strlen(string);
+ size = strlen(string) + 1;
for (i = 0; i < size; i++)
edbus_message_iter_basic_append(array, 'y', string[i]);
edbus_message_iter_container_close(parent, array);
@@ -1012,6 +1013,9 @@ _ethumb_dbus_queue_add_cb(const EDBus_Service_Interface *iface, const EDBus_Mess
if (!file)
{
+ eina_stringshare_del(key);
+ eina_stringshare_del(thumb);
+ eina_stringshare_del(thumb_key);
ERR("no filename given.");
goto end;
}
@@ -1019,6 +1023,10 @@ _ethumb_dbus_queue_add_cb(const EDBus_Service_Interface *iface, const EDBus_Mess
odata = edbus_service_object_data_get(iface, ODATA);
if (!odata)
{
+ eina_stringshare_del(file);
+ eina_stringshare_del(key);
+ eina_stringshare_del(thumb);
+ eina_stringshare_del(thumb_key);
ERR("could not get dbus_object data.");
goto end;
}
@@ -1159,7 +1167,7 @@ _ethumb_dbus_delete_cb(const EDBus_Service_Interface *iface, const EDBus_Message
}
static int
-_ethumb_dbus_fdo_set(Ethumbd_Object *eobject __UNUSED__, EDBus_Message_Iter *variant, Ethumbd_Request *request)
+_ethumb_dbus_fdo_set(Ethumbd_Object *eobject EINA_UNUSED, EDBus_Message_Iter *variant, Ethumbd_Request *request)
{
int fdo;
@@ -1177,7 +1185,7 @@ _ethumb_dbus_fdo_set(Ethumbd_Object *eobject __UNUSED__, EDBus_Message_Iter *var
}
static int
-_ethumb_dbus_size_set(Ethumbd_Object *eobject __UNUSED__, EDBus_Message_Iter *variant, Ethumbd_Request *request)
+_ethumb_dbus_size_set(Ethumbd_Object *eobject EINA_UNUSED, EDBus_Message_Iter *variant, Ethumbd_Request *request)
{
EDBus_Message_Iter *st;
int w, h;
@@ -1198,7 +1206,7 @@ _ethumb_dbus_size_set(Ethumbd_Object *eobject __UNUSED__, EDBus_Message_Iter *va
}
static int
-_ethumb_dbus_format_set(Ethumbd_Object *eobject __UNUSED__, EDBus_Message_Iter *variant, Ethumbd_Request *request)
+_ethumb_dbus_format_set(Ethumbd_Object *eobject EINA_UNUSED, EDBus_Message_Iter *variant, Ethumbd_Request *request)
{
int format;
@@ -1216,7 +1224,7 @@ _ethumb_dbus_format_set(Ethumbd_Object *eobject __UNUSED__, EDBus_Message_Iter *
}
static int
-_ethumb_dbus_aspect_set(Ethumbd_Object *eobject __UNUSED__, EDBus_Message_Iter *variant, Ethumbd_Request *request)
+_ethumb_dbus_aspect_set(Ethumbd_Object *eobject EINA_UNUSED, EDBus_Message_Iter *variant, Ethumbd_Request *request)
{
int aspect;
@@ -1234,7 +1242,7 @@ _ethumb_dbus_aspect_set(Ethumbd_Object *eobject __UNUSED__, EDBus_Message_Iter *
}
static int
-_ethumb_dbus_orientation_set(Ethumbd_Object *eobject __UNUSED__, EDBus_Message_Iter *variant, Ethumbd_Request *request)
+_ethumb_dbus_orientation_set(Ethumbd_Object *eobject EINA_UNUSED, EDBus_Message_Iter *variant, Ethumbd_Request *request)
{
int orientation;
@@ -1252,7 +1260,7 @@ _ethumb_dbus_orientation_set(Ethumbd_Object *eobject __UNUSED__, EDBus_Message_I
}
static int
-_ethumb_dbus_crop_set(Ethumbd_Object *eobject __UNUSED__, EDBus_Message_Iter *variant, Ethumbd_Request *request)
+_ethumb_dbus_crop_set(Ethumbd_Object *eobject EINA_UNUSED, EDBus_Message_Iter *variant, Ethumbd_Request *request)
{
EDBus_Message_Iter *st;
double x, y;
@@ -1273,7 +1281,7 @@ _ethumb_dbus_crop_set(Ethumbd_Object *eobject __UNUSED__, EDBus_Message_Iter *va
}
static int
-_ethumb_dbus_quality_set(Ethumbd_Object *eobject __UNUSED__, EDBus_Message_Iter *variant, Ethumbd_Request *request)
+_ethumb_dbus_quality_set(Ethumbd_Object *eobject EINA_UNUSED, EDBus_Message_Iter *variant, Ethumbd_Request *request)
{
int quality;
@@ -1292,7 +1300,7 @@ _ethumb_dbus_quality_set(Ethumbd_Object *eobject __UNUSED__, EDBus_Message_Iter
static int
-_ethumb_dbus_compress_set(Ethumbd_Object *eobject __UNUSED__, EDBus_Message_Iter *variant, Ethumbd_Request *request)
+_ethumb_dbus_compress_set(Ethumbd_Object *eobject EINA_UNUSED, EDBus_Message_Iter *variant, Ethumbd_Request *request)
{
int compress;
@@ -1310,7 +1318,7 @@ _ethumb_dbus_compress_set(Ethumbd_Object *eobject __UNUSED__, EDBus_Message_Iter
}
static int
-_ethumb_dbus_frame_set(Ethumbd_Object *eobject __UNUSED__, EDBus_Message_Iter *variant, Ethumbd_Request *request)
+_ethumb_dbus_frame_set(Ethumbd_Object *eobject EINA_UNUSED, EDBus_Message_Iter *variant, Ethumbd_Request *request)
{
EDBus_Message_Iter *_struct, *file_iter, *group_iter, *swallow_iter;
const char *file, *group, *swallow;
@@ -1328,15 +1336,15 @@ _ethumb_dbus_frame_set(Ethumbd_Object *eobject __UNUSED__, EDBus_Message_Iter *v
swallow = _ethumb_dbus_get_bytearray(swallow_iter);
DBG("setting frame to \"%s:%s:%s\"", file, group, swallow);
request->setup.flags.frame = 1;
- request->setup.theme_file = eina_stringshare_add(file);
- request->setup.group = eina_stringshare_add(group);
- request->setup.swallow = eina_stringshare_add(swallow);
+ request->setup.theme_file = file;
+ request->setup.group = group;
+ request->setup.swallow = swallow;
return 1;
}
static int
-_ethumb_dbus_directory_set(Ethumbd_Object *eobject __UNUSED__, EDBus_Message_Iter *variant, Ethumbd_Request *request)
+_ethumb_dbus_directory_set(Ethumbd_Object *eobject EINA_UNUSED, EDBus_Message_Iter *variant, Ethumbd_Request *request)
{
const char *directory;
EDBus_Message_Iter *array;
@@ -1350,13 +1358,13 @@ _ethumb_dbus_directory_set(Ethumbd_Object *eobject __UNUSED__, EDBus_Message_Ite
directory = _ethumb_dbus_get_bytearray(array);
DBG("setting directory to: %s", directory);
request->setup.flags.directory = 1;
- request->setup.directory = eina_stringshare_add(directory);
+ request->setup.directory = directory;
return 1;
}
static int
-_ethumb_dbus_category_set(Ethumbd_Object *eobject __UNUSED__, EDBus_Message_Iter *variant, Ethumbd_Request *request)
+_ethumb_dbus_category_set(Ethumbd_Object *eobject EINA_UNUSED, EDBus_Message_Iter *variant, Ethumbd_Request *request)
{
const char *category;
EDBus_Message_Iter *array;
@@ -1370,13 +1378,13 @@ _ethumb_dbus_category_set(Ethumbd_Object *eobject __UNUSED__, EDBus_Message_Iter
category = _ethumb_dbus_get_bytearray(array);
DBG("setting category to: %s", category);
request->setup.flags.category = 1;
- request->setup.category = eina_stringshare_add(category);
+ request->setup.category = category;
return 1;
}
static int
-_ethumb_dbus_video_time_set(Ethumbd_Object *eobject __UNUSED__, EDBus_Message_Iter *variant, Ethumbd_Request *request)
+_ethumb_dbus_video_time_set(Ethumbd_Object *eobject EINA_UNUSED, EDBus_Message_Iter *variant, Ethumbd_Request *request)
{
double video_time;
@@ -1394,7 +1402,7 @@ _ethumb_dbus_video_time_set(Ethumbd_Object *eobject __UNUSED__, EDBus_Message_It
}
static int
-_ethumb_dbus_video_start_set(Ethumbd_Object *eobject __UNUSED__, EDBus_Message_Iter *variant, Ethumbd_Request *request)
+_ethumb_dbus_video_start_set(Ethumbd_Object *eobject EINA_UNUSED, EDBus_Message_Iter *variant, Ethumbd_Request *request)
{
double video_start;
@@ -1412,7 +1420,7 @@ _ethumb_dbus_video_start_set(Ethumbd_Object *eobject __UNUSED__, EDBus_Message_I
}
static int
-_ethumb_dbus_video_interval_set(Ethumbd_Object *eobject __UNUSED__, EDBus_Message_Iter *variant, Ethumbd_Request *request)
+_ethumb_dbus_video_interval_set(Ethumbd_Object *eobject EINA_UNUSED, EDBus_Message_Iter *variant, Ethumbd_Request *request)
{
double video_interval;
@@ -1429,7 +1437,7 @@ _ethumb_dbus_video_interval_set(Ethumbd_Object *eobject __UNUSED__, EDBus_Messag
}
static int
-_ethumb_dbus_video_ntimes_set(Ethumbd_Object *eobject __UNUSED__, EDBus_Message_Iter *variant, Ethumbd_Request *request)
+_ethumb_dbus_video_ntimes_set(Ethumbd_Object *eobject EINA_UNUSED, EDBus_Message_Iter *variant, Ethumbd_Request *request)
{
unsigned int video_ntimes;
@@ -1447,7 +1455,7 @@ _ethumb_dbus_video_ntimes_set(Ethumbd_Object *eobject __UNUSED__, EDBus_Message_
}
static int
-_ethumb_dbus_video_fps_set(Ethumbd_Object *eobject __UNUSED__, EDBus_Message_Iter *variant, Ethumbd_Request *request)
+_ethumb_dbus_video_fps_set(Ethumbd_Object *eobject EINA_UNUSED, EDBus_Message_Iter *variant, Ethumbd_Request *request)
{
unsigned int video_fps;
@@ -1465,7 +1473,7 @@ _ethumb_dbus_video_fps_set(Ethumbd_Object *eobject __UNUSED__, EDBus_Message_Ite
}
static int
-_ethumb_dbus_document_page_set(Ethumbd_Object *eobject __UNUSED__, EDBus_Message_Iter *variant, Ethumbd_Request *request)
+_ethumb_dbus_document_page_set(Ethumbd_Object *eobject EINA_UNUSED, EDBus_Message_Iter *variant, Ethumbd_Request *request)
{
unsigned int document_page;
@@ -1542,7 +1550,6 @@ _ethumb_dbus_ethumb_setup_cb(const EDBus_Service_Interface *iface, const EDBus_M
Ethumbd_Object *eobject;
Ethumbd_Request *request;
Eina_Bool r = EINA_FALSE;
- int atype;
EDBus_Message_Iter *array;
EDBus_Message_Iter *data;
@@ -1568,7 +1575,7 @@ _ethumb_dbus_ethumb_setup_cb(const EDBus_Service_Interface *iface, const EDBus_M
r = EINA_TRUE;
while (edbus_message_iter_get_and_next(array, 'r', &data) && r)
{
- if (!_ethumb_dbus_ethumb_setup_parse_element(eobject, data, request));
+ if (!_ethumb_dbus_ethumb_setup_parse_element(eobject, data, request))
r = EINA_FALSE;
}
@@ -1610,12 +1617,11 @@ static const EDBus_Service_Interface_Desc server_desc = {
};
static void
-_ethumb_dbus_request_name_cb(void *data, const EDBus_Message *msg, EDBus_Pending *pending)
+_ethumb_dbus_request_name_cb(void *data, const EDBus_Message *msg, EDBus_Pending *pending EINA_UNUSED)
{
EDBus_Service_Interface *iface;
const char *errname, *errmsg;
Ethumbd *ed = data;
- int r;
if (edbus_message_error_get(msg, &errname, &errmsg))
{
@@ -1654,11 +1660,15 @@ _ethumb_dbus_finish(Ethumbd *ed)
static Eina_Bool
_ethumbd_slave_spawn(Ethumbd_Slave *slave, Ethumbd *ed)
{
+ char buf[PATH_MAX];
+
slave->bufcmd = NULL;
slave->scmd = 0;
- slave->exe = ecore_exe_pipe_run(
- ETHUMB_LIBEXEC_DIR"/ethumbd_slave",
+ snprintf(buf, sizeof(buf), "%s/ethumb/utils/"MODULE_ARCH"/ethumbd_slave",
+ eina_prefix_lib_get(_pfx));
+
+ slave->exe = ecore_exe_pipe_run(buf,
ECORE_EXE_PIPE_READ | ECORE_EXE_PIPE_WRITE, ed);
if (!slave->exe)
{
@@ -1691,11 +1701,22 @@ main(int argc, char *argv[])
if (_log_domain < 0)
{
EINA_LOG_CRIT("could not register log domain 'ethumbd'");
- exit_value = -7;
+ exit_value = -8;
goto finish;
}
}
+ _pfx = eina_prefix_new(argv[0], ethumb_init,
+ "ETHUMB", "ethumb", "checkme",
+ PACKAGE_BIN_DIR, PACKAGE_LIB_DIR,
+ PACKAGE_DATA_DIR, PACKAGE_DATA_DIR);
+ if (!_pfx)
+ {
+ ERR("Could not get ethumb installation prefix.");
+ exit_value = -7;
+ goto finish;
+ }
+
ed.data_cb = ecore_event_handler_add(ECORE_EXE_EVENT_DATA,
_ethumbd_slave_data_read_cb, &ed);
ed.del_cb = ecore_event_handler_add(ECORE_EXE_EVENT_DEL,
@@ -1773,6 +1794,8 @@ main(int argc, char *argv[])
finish:
if (ed.slave.exe)
ecore_exe_quit(ed.slave.exe);
+
+ if (_pfx) eina_prefix_free(_pfx);
ethumb_shutdown();
eina_init();
ecore_shutdown();
diff --git a/legacy/ethumb/src/bin/ethumbd_client.c b/src/bin/ethumb/ethumbd_client.c
index 1dcdf111e..e81fc2e9a 100644
--- a/legacy/ethumb/src/bin/ethumbd_client.c
+++ b/src/bin/ethumb/ethumbd_client.c
@@ -60,7 +60,7 @@ struct options
};
static unsigned char
-_ethumb_getopt_callback_frame_parse(const Ecore_Getopt *parser __UNUSED__, const Ecore_Getopt_Desc *desc __UNUSED__, const char *str, void *data __UNUSED__, Ecore_Getopt_Value *storage)
+_ethumb_getopt_callback_frame_parse(const Ecore_Getopt *parser EINA_UNUSED, const Ecore_Getopt_Desc *desc EINA_UNUSED, const char *str, void *data EINA_UNUSED, Ecore_Getopt_Value *storage)
{
struct frame *f = (struct frame *)storage->ptrp;
const char *tfile, *tgroup, *tswallow, *base, *sep;
@@ -151,7 +151,7 @@ _thumb_report(const char *mode, const char *src_path, const char *src_key, const
}
static void
-_finished_thumb(void *data __UNUSED__, Ethumb_Client *client __UNUSED__, int id __UNUSED__, const char *src_path, const char *src_key, const char *thumb_path, const char *thumb_key, Eina_Bool success)
+_finished_thumb(void *data EINA_UNUSED, Ethumb_Client *client EINA_UNUSED, int id EINA_UNUSED, const char *src_path, const char *src_key, const char *thumb_path, const char *thumb_key, Eina_Bool success)
{
const char *mode = success ? "GENERATED" : "FAILED";
_thumb_report(mode, src_path, src_key, thumb_path, thumb_key);
@@ -159,7 +159,7 @@ _finished_thumb(void *data __UNUSED__, Ethumb_Client *client __UNUSED__, int id
}
static void
-_exists(void *data, Ethumb_Client *c, __UNUSED__ Ethumb_Exists *thread, Eina_Bool exists)
+_exists(void *data, Ethumb_Client *c, EINA_UNUSED Ethumb_Exists *thread, Eina_Bool exists)
{
struct options *opts = data;
const char *thumb_path, *thumb_key;
diff --git a/legacy/ethumb/src/bin/ethumbd_private.h b/src/bin/ethumb/ethumbd_private.h
index 688eaddd6..688eaddd6 100644
--- a/legacy/ethumb/src/bin/ethumbd_private.h
+++ b/src/bin/ethumb/ethumbd_private.h
diff --git a/legacy/ethumb/src/bin/ethumbd_child.c b/src/bin/ethumb/ethumbd_slave.c
index a11c90ca1..b1d319a30 100644
--- a/legacy/ethumb/src/bin/ethumbd_child.c
+++ b/src/bin/ethumb/ethumbd_slave.c
@@ -126,7 +126,7 @@ _ec_write_safe(int fd, const void *buf, ssize_t size)
}
static int
-_ec_pipe_str_read(struct _Ethumbd_Child *ec __UNUSED__, char **str)
+_ec_pipe_str_read(struct _Ethumbd_Child *ec EINA_UNUSED, char **str)
{
int size;
int r;
@@ -215,7 +215,7 @@ _ec_op_del(struct _Ethumbd_Child *ec)
}
static void
-_ec_op_generated_cb(void *data __UNUSED__, Ethumb *e, Eina_Bool success)
+_ec_op_generated_cb(void *data EINA_UNUSED, Ethumb *e, Eina_Bool success)
{
const char *thumb_path, *thumb_key;
int size_path, size_key, size_cmd;
@@ -291,7 +291,7 @@ _ec_op_generate(struct _Ethumbd_Child *ec)
}
static int
-_ec_fdo_set(struct _Ethumbd_Child *ec __UNUSED__, Ethumb *e)
+_ec_fdo_set(struct _Ethumbd_Child *ec EINA_UNUSED, Ethumb *e)
{
int r;
int value;
@@ -306,7 +306,7 @@ _ec_fdo_set(struct _Ethumbd_Child *ec __UNUSED__, Ethumb *e)
}
static int
-_ec_size_set(struct _Ethumbd_Child *ec __UNUSED__, Ethumb *e)
+_ec_size_set(struct _Ethumbd_Child *ec EINA_UNUSED, Ethumb *e)
{
int r;
int w, h;
@@ -328,7 +328,7 @@ _ec_size_set(struct _Ethumbd_Child *ec __UNUSED__, Ethumb *e)
}
static int
-_ec_format_set(struct _Ethumbd_Child *ec __UNUSED__, Ethumb *e)
+_ec_format_set(struct _Ethumbd_Child *ec EINA_UNUSED, Ethumb *e)
{
int r;
int value;
@@ -343,7 +343,7 @@ _ec_format_set(struct _Ethumbd_Child *ec __UNUSED__, Ethumb *e)
}
static int
-_ec_aspect_set(struct _Ethumbd_Child *ec __UNUSED__, Ethumb *e)
+_ec_aspect_set(struct _Ethumbd_Child *ec EINA_UNUSED, Ethumb *e)
{
int r;
int value;
@@ -358,7 +358,7 @@ _ec_aspect_set(struct _Ethumbd_Child *ec __UNUSED__, Ethumb *e)
}
static int
-_ec_orientation_set(struct _Ethumbd_Child *ec __UNUSED__, Ethumb *e)
+_ec_orientation_set(struct _Ethumbd_Child *ec EINA_UNUSED, Ethumb *e)
{
int r;
int value;
@@ -373,7 +373,7 @@ _ec_orientation_set(struct _Ethumbd_Child *ec __UNUSED__, Ethumb *e)
}
static int
-_ec_crop_set(struct _Ethumbd_Child *ec __UNUSED__, Ethumb *e)
+_ec_crop_set(struct _Ethumbd_Child *ec EINA_UNUSED, Ethumb *e)
{
int r;
float x, y;
@@ -395,7 +395,7 @@ _ec_crop_set(struct _Ethumbd_Child *ec __UNUSED__, Ethumb *e)
}
static int
-_ec_quality_set(struct _Ethumbd_Child *ec __UNUSED__, Ethumb *e)
+_ec_quality_set(struct _Ethumbd_Child *ec EINA_UNUSED, Ethumb *e)
{
int r;
int value;
@@ -410,7 +410,7 @@ _ec_quality_set(struct _Ethumbd_Child *ec __UNUSED__, Ethumb *e)
}
static int
-_ec_compress_set(struct _Ethumbd_Child *ec __UNUSED__, Ethumb *e)
+_ec_compress_set(struct _Ethumbd_Child *ec EINA_UNUSED, Ethumb *e)
{
int r;
int value;
@@ -488,7 +488,7 @@ _ec_category_set(struct _Ethumbd_Child *ec, Ethumb *e)
}
static int
-_ec_video_time_set(struct _Ethumbd_Child *ec __UNUSED__, Ethumb *e)
+_ec_video_time_set(struct _Ethumbd_Child *ec EINA_UNUSED, Ethumb *e)
{
int r;
float value;
@@ -503,7 +503,7 @@ _ec_video_time_set(struct _Ethumbd_Child *ec __UNUSED__, Ethumb *e)
}
static int
-_ec_video_start_set(struct _Ethumbd_Child *ec __UNUSED__, Ethumb *e)
+_ec_video_start_set(struct _Ethumbd_Child *ec EINA_UNUSED, Ethumb *e)
{
int r;
float value;
@@ -518,7 +518,7 @@ _ec_video_start_set(struct _Ethumbd_Child *ec __UNUSED__, Ethumb *e)
}
static int
-_ec_video_interval_set(struct _Ethumbd_Child *ec __UNUSED__, Ethumb *e)
+_ec_video_interval_set(struct _Ethumbd_Child *ec EINA_UNUSED, Ethumb *e)
{
int r;
float value;
@@ -533,7 +533,7 @@ _ec_video_interval_set(struct _Ethumbd_Child *ec __UNUSED__, Ethumb *e)
}
static int
-_ec_video_ntimes_set(struct _Ethumbd_Child *ec __UNUSED__, Ethumb *e)
+_ec_video_ntimes_set(struct _Ethumbd_Child *ec EINA_UNUSED, Ethumb *e)
{
int r;
int value;
@@ -548,7 +548,7 @@ _ec_video_ntimes_set(struct _Ethumbd_Child *ec __UNUSED__, Ethumb *e)
}
static int
-_ec_video_fps_set(struct _Ethumbd_Child *ec __UNUSED__, Ethumb *e)
+_ec_video_fps_set(struct _Ethumbd_Child *ec EINA_UNUSED, Ethumb *e)
{
int r;
int value;
@@ -563,7 +563,7 @@ _ec_video_fps_set(struct _Ethumbd_Child *ec __UNUSED__, Ethumb *e)
}
static int
-_ec_document_page_set(struct _Ethumbd_Child *ec __UNUSED__, Ethumb *e)
+_ec_document_page_set(struct _Ethumbd_Child *ec EINA_UNUSED, Ethumb *e)
{
int r;
int value;
@@ -731,7 +731,7 @@ _ec_setup(struct _Ethumbd_Child *ec)
}
int
-main(int argc __UNUSED__, const char *argv[] __UNUSED__)
+main(int argc EINA_UNUSED, const char *argv[] EINA_UNUSED)
{
struct _Ethumbd_Child *ec;
diff --git a/src/lib/edje/edje_edit.c b/src/lib/edje/edje_edit.c
index dea54665f..9361f2392 100644
--- a/src/lib/edje/edje_edit.c
+++ b/src/lib/edje/edje_edit.c
@@ -4749,7 +4749,8 @@ edje_edit_image_data_add(Evas_Object *obj, const char *name, int id)
if ((unsigned int) id >= ed->file->image_dir->entries_count) return EINA_FALSE;
de = ed->file->image_dir->entries + id;
- eina_stringshare_replace(&de->entry, name);
+ _edje_if_string_free(ed, de->entry);
+ de->entry = eina_stringshare_add(name);
de->source_type = 1;
de->source_param = 1;
diff --git a/legacy/ethumb/src/lib/Ethumb.h b/src/lib/ethumb/Ethumb.h
index 12984acb9..fd4dff708 100644
--- a/legacy/ethumb/src/lib/Ethumb.h
+++ b/src/lib/ethumb/Ethumb.h
@@ -43,9 +43,74 @@ extern "C" {
int micro;
int revision;
} Ethumb_Version;
-
+
EAPI extern Ethumb_Version *ethumb_version;
-
+
+/**
+ * @page ethumb_main Ethumb
+ *
+ * @date 2009 (created)
+ *
+ * @section toc Table of Contents
+ *
+ * @li @ref ethumb_main_intro
+ * @li @ref ethumb_main_compiling
+ * @li @ref ethumb_main_next_steps
+ *
+ * @section ethumb_main_intro Introduction
+ *
+ * Ethumb will use @ref Evas to generate thumbnail images of given
+ * files. The API allows great customization of the generated files
+ * and also helps compling to FreeDesktop.Org Thumbnail Specification
+ * (http://specifications.freedesktop.org/thumbnail-spec/thumbnail-spec-latest.html)
+ *
+ * However, thumbnailing can be an expensive process that will impact
+ * your application experience, blocking animations and user
+ * interaction during the generation. Another problem is that one
+ * should try to cache the thumbnails in a place that other
+ * applications can benefit from the file.
+ *
+ * @ref Ethumb_Client exists to solve this. It will communicate with a
+ * server using standard D-Bus protocol. The server will use @ref
+ * Ethumb itself to generate the thumbnail images and cache them using
+ * FreeDesktop.Org standard. It is recommended that most applications
+ * use @ref Ethumb_Client instead of @ref Ethumb directly.
+ *
+ * @section ethumb_main_compiling How to compile
+ *
+ * Ethumb is a library your application links to. The procedure for
+ * this is very simple. Note that usually you want the D-Bus client
+ * library. You simply have to compile your application with the
+ * appropriate compiler flags that the @c pkg-config script
+ * outputs. For example:
+ *
+ * Compiling C or C++ files into object files:
+ *
+ * @verbatim
+ gcc -c -o main.o main.c `pkg-config --cflags ethumb_client`
+ @endverbatim
+ *
+ * Linking object files into a binary executable:
+ *
+ * @verbatim
+ gcc -o my_application main.o `pkg-config --libs ethumb_client`
+ @endverbatim
+ *
+ * See @ref pkgconfig
+ *
+ * @section ethumb_main_next_steps Next Steps
+ *
+ * After you understood what Ethumb is and installed it in your system
+ * you should proceed understanding the programming interface.
+ *
+ * Recommended reading:
+ *
+ * @li @ref Ethumb_Client to generate thumbnails using a server
+ * (recommended).
+ * @li @ref Ethumb to generate thumbnails in the local process.
+ *
+ */
+
/**
* @defgroup Ethumb Ethumb
*
diff --git a/legacy/ethumb/src/lib/Ethumb_Plugin.h b/src/lib/ethumb/Ethumb_Plugin.h
index 3eb6f020c..3eb6f020c 100644
--- a/legacy/ethumb/src/lib/Ethumb_Plugin.h
+++ b/src/lib/ethumb/Ethumb_Plugin.h
diff --git a/legacy/ethumb/src/lib/client/Ethumb_Client.h b/src/lib/ethumb/client/Ethumb_Client.h
index 47fe5ee60..3c3f95d87 100644
--- a/legacy/ethumb/src/lib/client/Ethumb_Client.h
+++ b/src/lib/ethumb/client/Ethumb_Client.h
@@ -35,6 +35,7 @@ extern "C" {
/**
* @defgroup Ethumb_Client Ethumb Client
+ * @ingroup Ethumb
*
* @{
*/
diff --git a/legacy/ethumb/src/lib/client/ethumb_client.c b/src/lib/ethumb/client/ethumb_client.c
index 77dbbd813..7b9836625 100644
--- a/legacy/ethumb/src/lib/client/ethumb_client.c
+++ b/src/lib/ethumb/client/ethumb_client.c
@@ -263,7 +263,7 @@ _ethumb_async_delete(void *data)
}
static void
-_ethumb_client_name_owner_changed(void *context, const char *bus, const char *old_id, const char *new_id)
+_ethumb_client_name_owner_changed(void *context, const char *bus EINA_UNUSED, const char *old_id, const char *new_id)
{
Ethumb_Client *client = context;
DBG("NameOwnerChanged from=[%s] to=[%s]", old_id, new_id);
@@ -311,7 +311,7 @@ _ethumb_client_report_connect(Ethumb_Client *client, Eina_Bool success)
}
static void
-_ethumb_client_new_cb(void *data, const EDBus_Message *msg, EDBus_Pending *pending)
+_ethumb_client_new_cb(void *data, const EDBus_Message *msg, EDBus_Pending *pending EINA_UNUSED)
{
const char *errname, *errmsg;
const char *opath;
@@ -350,7 +350,7 @@ _ethumb_client_call_new(Ethumb_Client *client)
}
static void
-_ethumb_client_exists_heavy(void *data, Ecore_Thread *thread __UNUSED__)
+_ethumb_client_exists_heavy(void *data, Ecore_Thread *thread EINA_UNUSED)
{
Ethumb_Async_Exists *async = data;
@@ -358,7 +358,7 @@ _ethumb_client_exists_heavy(void *data, Ecore_Thread *thread __UNUSED__)
}
static void
-_ethumb_client_exists_end(void *data, Ecore_Thread *thread __UNUSED__)
+_ethumb_client_exists_end(void *data, Ecore_Thread *thread EINA_UNUSED)
{
Ethumb_Async_Exists *async = data;
Ethumb_Exists *cb;
@@ -617,7 +617,7 @@ ethumb_client_on_server_die_callback_set(Ethumb_Client *client, Ethumb_Client_Di
*/
static void
-_ethumb_client_ethumb_setup_cb(void *data, const EDBus_Message *msg, EDBus_Pending *pending)
+_ethumb_client_ethumb_setup_cb(void *data EINA_UNUSED, const EDBus_Message *msg, EDBus_Pending *pending EINA_UNUSED)
{
const char *errname, *errmsg;
Eina_Bool result = 0;
@@ -643,9 +643,13 @@ _ethumb_client_dbus_get_bytearray(EDBus_Message_Iter *array)
const char *result;
if (edbus_message_iter_fixed_array_get(array, 'y', &result, &length))
- return eina_stringshare_add(result);
+ return eina_stringshare_add_length(result, length);
else
- return NULL;
+ {
+ ERR("Not byte array. Signature: %s",
+ edbus_message_iter_signature_get(array));
+ return NULL;
+ }
}
static void
@@ -658,7 +662,7 @@ _ethumb_client_dbus_append_bytearray(EDBus_Message_Iter *parent, const char *str
string = "";
array = edbus_message_iter_container_new(parent, 'a', "y");
- size = strlen(string);
+ size = strlen(string) + 1;
for (i = 0; i < size; i++)
edbus_message_iter_basic_append(array, 'y', string[i]);
edbus_message_iter_container_close(parent, array);
@@ -706,7 +710,6 @@ ethumb_client_ethumb_setup(Ethumb_Client *client)
Ethumb *e = client->ethumb;
int tw, th, format, aspect, orientation, quality, compress;
float cx, cy;
- double t;
const char *theme_file, *group, *swallow;
const char *directory, *category;
double video_time, video_start, video_interval;
@@ -755,7 +758,7 @@ ethumb_client_ethumb_setup(Ethumb_Client *client)
_setup_iterator_close(array, entry, variant);
variant = _setup_iterator_open(array, &entry, "compress", "i");
- quality = ethumb_thumb_quality_get(e);
+ compress = ethumb_thumb_quality_get(e);
edbus_message_iter_arguments_append(variant, "i", compress);
_setup_iterator_close(array, entry, variant);
@@ -826,8 +829,6 @@ _ethumb_client_generated_cb(void *data, const EDBus_Message *msg)
EDBus_Message_Iter *thumb_iter;
EDBus_Message_Iter *thumb_key_iter;
Eina_Bool success;
- const char *thumb = NULL;
- const char *thumb_key = NULL;
int found;
struct _ethumb_pending_gen *pending;
Eina_List *l;
@@ -854,14 +855,14 @@ _ethumb_client_generated_cb(void *data, const EDBus_Message *msg)
if (found)
{
- thumb = _ethumb_client_dbus_get_bytearray(thumb_iter);
- thumb_key = _ethumb_client_dbus_get_bytearray(thumb_key_iter);
+ const char *thumb = _ethumb_client_dbus_get_bytearray(thumb_iter);
+ const char *thumb_key = _ethumb_client_dbus_get_bytearray(thumb_key_iter);
client->pending_gen = eina_list_remove_list(client->pending_gen, l);
if (pending->generated_cb)
pending->generated_cb(pending->data, client, id,
pending->file, pending->key,
- pending->thumb, pending->thumb_key,
+ thumb, thumb_key,
success);
if (pending->free_data)
pending->free_data(pending->data);
@@ -869,12 +870,14 @@ _ethumb_client_generated_cb(void *data, const EDBus_Message *msg)
eina_stringshare_del(pending->key);
eina_stringshare_del(pending->thumb);
eina_stringshare_del(pending->thumb_key);
+ eina_stringshare_del(thumb);
+ eina_stringshare_del(thumb_key);
free(pending);
}
}
static void
-_ethumb_client_queue_add_cb(void *data, const EDBus_Message *msg, EDBus_Pending *edbus_pending)
+_ethumb_client_queue_add_cb(void *data, const EDBus_Message *msg, EDBus_Pending *edbus_pending EINA_UNUSED)
{
const char *errname, *errmsg;
int32_t id;
@@ -925,7 +928,7 @@ static int
_ethumb_client_queue_add(Ethumb_Client *client, const char *file, const char *key, const char *thumb, const char *thumb_key, Ethumb_Client_Generate_Cb generated_cb, const void *data, Eina_Free_Cb free_data)
{
EDBus_Message *msg;
- EDBus_Message_Iter *main;
+ EDBus_Message_Iter *main_itr;
struct _ethumb_pending_add *pending;
pending = calloc(1, sizeof(*pending));
@@ -942,12 +945,12 @@ _ethumb_client_queue_add(Ethumb_Client *client, const char *file, const char *ke
client->id_count = (client->id_count + 1) % MAX_ID;
msg = edbus_proxy_method_call_new(client->proxy, "queue_add");
- main = edbus_message_iter_get(msg);
- edbus_message_iter_basic_append(main, 'i', pending->id);
- _ethumb_client_dbus_append_bytearray(main, file);
- _ethumb_client_dbus_append_bytearray(main, key);
- _ethumb_client_dbus_append_bytearray(main, thumb);
- _ethumb_client_dbus_append_bytearray(main, thumb_key);
+ main_itr = edbus_message_iter_get(msg);
+ edbus_message_iter_basic_append(main_itr, 'i', pending->id);
+ _ethumb_client_dbus_append_bytearray(main_itr, file);
+ _ethumb_client_dbus_append_bytearray(main_itr, key);
+ _ethumb_client_dbus_append_bytearray(main_itr, thumb);
+ _ethumb_client_dbus_append_bytearray(main_itr, thumb_key);
pending->pending_call = edbus_proxy_send(client->proxy, msg,
_ethumb_client_queue_add_cb,
@@ -959,7 +962,7 @@ _ethumb_client_queue_add(Ethumb_Client *client, const char *file, const char *ke
}
static void
-_ethumb_client_queue_remove_cb(void *data, const EDBus_Message *msg, EDBus_Pending *edbus_pending)
+_ethumb_client_queue_remove_cb(void *data, const EDBus_Message *msg, EDBus_Pending *edbus_pending EINA_UNUSED)
{
Eina_Bool success;
struct _ethumb_pending_remove *pending = data;
@@ -2051,7 +2054,7 @@ _ethumb_client_async_free(Ethumb_Client_Async *async)
static void
_ethumb_client_thumb_finish(void *data,
Ethumb_Client *client, int id,
- const char *file __UNUSED__, const char *key __UNUSED__,
+ const char *file EINA_UNUSED, const char *key EINA_UNUSED,
const char *thumb_path, const char *thumb_key,
Eina_Bool success)
{
@@ -2073,7 +2076,7 @@ _ethumb_client_thumb_finish(void *data,
}
static Eina_Bool
-_ethumb_client_thumb_generate_idler(void *data __UNUSED__)
+_ethumb_client_thumb_generate_idler(void *data EINA_UNUSED)
{
Ethumb_Client_Async *async;
Eina_List *l1, *l2;
@@ -2141,7 +2144,7 @@ _ethumb_client_thumb_exists(void *data, Ethumb_Client *client, Ethumb_Exists *re
}
static Eina_Bool
-_ethumb_client_thumb_exists_idler(void *data __UNUSED__)
+_ethumb_client_thumb_exists_idler(void *data EINA_UNUSED)
{
Ethumb_Client_Async *async;
Eina_List *l1, *l2;
diff --git a/legacy/ethumb/src/lib/ethumb.c b/src/lib/ethumb/ethumb.c
index 28dbb81d2..65d3b97c8 100644
--- a/legacy/ethumb/src/lib/ethumb.c
+++ b/src/lib/ethumb/ethumb.c
@@ -31,23 +31,6 @@
# include <stdlib.h>
# endif
#endif
-#ifdef HAVE_ALLOCA_H
-# include <alloca.h>
-#elif !defined alloca
-# ifdef __GNUC__
-# define alloca __builtin_alloca
-# elif defined _AIX
-# define alloca __alloca
-# elif defined _MSC_VER
-# include <malloc.h>
-# define alloca _alloca
-# elif !defined HAVE_ALLOCA
-# ifdef __cplusplus
-extern "C"
-# endif
-void *alloca (size_t);
-# endif
-#endif
#include <stdio.h>
#include <stdlib.h>
@@ -109,9 +92,10 @@ static const int THUMB_SIZE_LARGE = 256;
static Eina_Hash *_plugins_ext = NULL;
static Eina_Array *_plugins = NULL;
+static Eina_Prefix *_pfx = NULL;
static Eina_Bool
-_ethumb_plugin_list_cb(Eina_Module *m, void *data __UNUSED__)
+_ethumb_plugin_list_cb(Eina_Module *m, void *data EINA_UNUSED)
{
const char *file;
const char **ext;
@@ -156,10 +140,13 @@ _ethumb_plugin_list_cb(Eina_Module *m, void *data __UNUSED__)
static void
_ethumb_plugins_load(void)
{
+ char buf[PATH_MAX];
+
_plugins_ext = eina_hash_string_small_new(NULL);
EINA_SAFETY_ON_NULL_RETURN(_plugins_ext);
- _plugins = eina_module_list_get(_plugins, PLUGINSDIR, 1,
+ snprintf(buf, sizeof(buf), "%s/ethumb/modules", eina_prefix_lib_get(_pfx));
+ _plugins = eina_module_list_get(_plugins, buf, 1,
&_ethumb_plugin_list_cb, NULL);
}
@@ -192,8 +179,17 @@ ethumb_init(void)
if (_log_dom < 0)
{
EINA_LOG_ERR("Could not register log domain: ethumb");
- eina_shutdown();
- return 0;
+ goto error_log;
+ }
+
+ _pfx = eina_prefix_new(NULL, ethumb_init,
+ "ETHUMB", "ethumb", "checkme",
+ PACKAGE_BIN_DIR, PACKAGE_LIB_DIR,
+ PACKAGE_DATA_DIR, PACKAGE_DATA_DIR);
+ if (!_pfx)
+ {
+ ERR("Could not get ethumb installation prefix.");
+ goto error_pfx;
}
evas_init();
@@ -210,6 +206,14 @@ ethumb_init(void)
_ethumb_plugins_load();
return ++initcount;
+
+ error_pfx:
+ eina_log_domain_unregister(_log_dom);
+ _log_dom = -1;
+
+ error_log:
+ eina_shutdown();
+ return 0;
}
EAPI int
@@ -231,6 +235,8 @@ ethumb_shutdown(void)
ecore_shutdown();
ecore_evas_shutdown();
edje_shutdown();
+ eina_prefix_free(_pfx);
+ _pfx = NULL;
eina_log_domain_unregister(_log_dom);
_log_dom = -1;
eina_shutdown();
@@ -1453,6 +1459,7 @@ _ethumb_image_load(Ethumb *e)
if (e->orientation == ETHUMB_THUMB_ORIENT_ORIGINAL)
{
+ /* TODO: rewrite to not need libexif just to get this */
#ifdef HAVE_LIBEXIF
ExifData *exif = exif_data_new_from_file(e->src_path);
ExifEntry *entry = NULL;
@@ -1595,7 +1602,7 @@ ethumb_generate(Ethumb *e, Ethumb_Generate_Cb finished_cb, const void *data, Ein
}
r = _ethumb_plugin_generate(e);
- fprintf(stderr, "ethumb generate: %i: %p\n", r, e->pdata);
+ DBG("ethumb plugin generate: %i: %p\n", r, e->pdata);
if (r)
{
return EINA_TRUE;
@@ -1603,7 +1610,8 @@ ethumb_generate(Ethumb *e, Ethumb_Generate_Cb finished_cb, const void *data, Ein
if (!_ethumb_image_load(e))
{
- ERR("could not load input image.");
+ ERR("could not load input image: file=%s, key=%s",
+ e->src_path, e->src_key);
ethumb_finished_callback_call(e, 0);
return EINA_FALSE;
}
@@ -1771,7 +1779,7 @@ ethumb_cmp(const Ethumb *e1, const Ethumb *e2)
}
EAPI unsigned int
-ethumb_length(__UNUSED__ const void *key)
+ethumb_length(EINA_UNUSED const void *key)
{
return sizeof (Ethumb);
}
@@ -1781,8 +1789,8 @@ ethumb_length(__UNUSED__ const void *key)
return e1->Param - e2->Param;
EAPI int
-ethumb_key_cmp(const void *key1, __UNUSED__ int key1_length,
- const void *key2, __UNUSED__ int key2_length)
+ethumb_key_cmp(const void *key1, EINA_UNUSED int key1_length,
+ const void *key2, EINA_UNUSED int key2_length)
{
const Ethumb *e1 = key1;
const Ethumb *e2 = key2;
@@ -1824,7 +1832,7 @@ ethumb_key_cmp(const void *key1, __UNUSED__ int key1_length,
#define HASH_PARAM_F(Param) r ^= eina_hash_int32((unsigned int*) &e->Param, 0);
EAPI int
-ethumb_hash(const void *key, int key_length __UNUSED__)
+ethumb_hash(const void *key, int key_length EINA_UNUSED)
{
const Ethumb *e = key;
int r = 0;
diff --git a/legacy/ethumb/src/lib/ethumb_private.h b/src/lib/ethumb/ethumb_private.h
index 49e4de9f6..49e4de9f6 100644
--- a/legacy/ethumb/src/lib/ethumb_private.h
+++ b/src/lib/ethumb/ethumb_private.h
diff --git a/legacy/ethumb/src/lib/md5.c b/src/lib/ethumb/md5.c
index b62a9ffe7..b62a9ffe7 100644
--- a/legacy/ethumb/src/lib/md5.c
+++ b/src/lib/ethumb/md5.c
diff --git a/legacy/ethumb/src/lib/md5.h b/src/lib/ethumb/md5.h
index 348fcd654..348fcd654 100644
--- a/legacy/ethumb/src/lib/md5.h
+++ b/src/lib/ethumb/md5.h
diff --git a/legacy/ethumb/src/plugins/emotion/emotion.c b/src/modules/ethumb/emotion/emotion.c
index 560e661e8..12750883d 100644
--- a/legacy/ethumb/src/plugins/emotion/emotion.c
+++ b/src/modules/ethumb/emotion/emotion.c
@@ -18,6 +18,8 @@
#include <Edje_Edit.h>
#include <Emotion.h>
+static Eina_Prefix *_pfx = NULL;
+static int _init_count = 0;
static int _log_dom = -1;
#define DBG(...) EINA_LOG_DOM_DBG(_log_dom, __VA_ARGS__)
#define INF(...) EINA_LOG_DOM_INFO(_log_dom, __VA_ARGS__)
@@ -65,7 +67,7 @@ _resize_movie(struct _emotion_plugin *_plugin)
}
static void
-_frame_decode_cb(void *data, Evas_Object *o __UNUSED__, void *event_info __UNUSED__)
+_frame_decode_cb(void *data, Evas_Object *o EINA_UNUSED, void *event_info EINA_UNUSED)
{
struct _emotion_plugin *_plugin = data;
@@ -76,13 +78,13 @@ _frame_decode_cb(void *data, Evas_Object *o __UNUSED__, void *event_info __UNUSE
}
static void
-_frame_resized_cb(void *data, Evas_Object *o __UNUSED__, void *event_info __UNUSED__)
+_frame_resized_cb(void *data, Evas_Object *o EINA_UNUSED, void *event_info EINA_UNUSED)
{
_resize_movie(data);
}
static void
-_video_stopped_cb(void *data, Evas_Object *o __UNUSED__, void *event_info __UNUSED__)
+_video_stopped_cb(void *data, Evas_Object *o EINA_UNUSED, void *event_info EINA_UNUSED)
{
struct _emotion_plugin *_plugin = data;
@@ -129,23 +131,24 @@ _setup_thumbnail(struct _emotion_plugin *_plugin)
if (!edje_file_group_exists(thumb_path, "movie/thumb"))
{
- fprintf(stderr, "ERROR: no group 'movie/thumb' found.\n");
- goto exit_error;
+ ERR("no group 'movie/thumb' found in file=%s", thumb_path);
+ goto exit_error;
}
edje = edje_edit_object_add(evas);
edje_object_file_set(edje, thumb_path, "movie/thumb");
if (!edje_object_part_exists(edje, "image"))
{
- fprintf(stderr, "ERROR: no 'image' part found.\n");
- evas_object_del(edje);
- goto exit_error;
+ ERR("no 'image' part found in file=%s, group=movie/thumb", thumb_path);
+ evas_object_del(edje);
+ goto exit_error;
}
if (!edje_edit_program_exist(edje, "animate"))
{
- fprintf(stderr, "ERROR: no 'animate' program found.\n");
- evas_object_del(edje);
- goto exit_error;
+ ERR("no 'animate' program found in file=%s, group=movie/thumb",
+ thumb_path);
+ evas_object_del(edje);
+ goto exit_error;
}
for (i = 0; i < _plugin->frnum; i++)
@@ -177,23 +180,43 @@ exit_error:
}
static void
+_finish_thumb_obj(void *data)
+{
+ struct _emotion_plugin *_plugin = data;
+ evas_object_del(_plugin->video);
+ free(_plugin);
+}
+
+static void
_finish_thumb_generation(struct _emotion_plugin *_plugin, int success)
{
int r = 0;
+
evas_object_smart_callback_del(_plugin->video, "frame_resize",
- _frame_resized_cb);
+ _frame_resized_cb);
evas_object_smart_callback_del(_plugin->video, "frame_decode",
- _frame_decode_cb);
+ _frame_decode_cb);
+ evas_object_smart_callback_del(_plugin->video, "decode_stop",
+ _video_stopped_cb);
+
emotion_object_play_set(_plugin->video, 0);
- evas_object_del(_plugin->video);
+
if (_plugin->ef)
- eet_close(_plugin->ef);
+ {
+ Eet_Error err = eet_close(_plugin->ef);
+ if (err != EET_ERROR_NONE)
+ {
+ ERR("Error writing Eet thumbnail file: %d", err);
+ success = EINA_FALSE;
+ }
+ }
if (success)
r = _setup_thumbnail(_plugin);
- free(_plugin);
ethumb_finished_callback_call(_plugin->e, r);
+
+ ecore_job_add(_finish_thumb_obj, _plugin);
}
static Eina_Bool
@@ -298,17 +321,25 @@ _generate_animated_thumb(struct _emotion_plugin *_plugin)
char buf[4096];
Ethumb *e = _plugin->e;
- snprintf(buf, sizeof(buf), "%s/data/emotion_template.edj", PLUGINSDIR);
+ snprintf(buf, sizeof(buf),
+ "%s/ethumb/modules/emotion/" MODULE_ARCH "/template.edj",
+ eina_prefix_lib_get(_pfx));
ethumb_thumb_path_get(e, &thumb_path, NULL);
thumb_dir = ecore_file_dir_get(thumb_path);
ecore_file_mkpath(thumb_dir);
free(thumb_dir);
- ecore_file_cp(buf, thumb_path);
+ if (!eina_file_copy(buf, thumb_path, 0, NULL, NULL))
+ {
+ ERR("Couldn't copy file '%s' to '%s'", buf, thumb_path);
+ ERR("could not open '%s'", thumb_path);
+ _finish_thumb_generation(_plugin, 0);
+ return;
+ }
_plugin->ef = eet_open(thumb_path, EET_FILE_MODE_READ_WRITE);
if (!_plugin->ef)
{
- fprintf(stderr, "ERROR: could not open '%s'\n", thumb_path);
- _finish_thumb_generation(_plugin, 0);
+ ERR("could not open '%s'", thumb_path);
+ _finish_thumb_generation(_plugin, 0);
}
}
@@ -325,8 +356,7 @@ _thumb_generate(Ethumb *e)
r = emotion_object_init(o, NULL);
if (!r)
{
- fprintf(stderr, "ERROR: could not start emotion using gstreamer"
- " plugin.\n");
+ ERR("Could not initialize emotion object.");
evas_object_del(o);
ethumb_finished_callback_call(e, 0);
free(_plugin);
@@ -368,7 +398,7 @@ _thumb_generate(Ethumb *e)
}
static void
-_thumb_cancel(Ethumb *e __UNUSED__, void *data)
+_thumb_cancel(Ethumb *e EINA_UNUSED, void *data)
{
struct _emotion_plugin *_plugin = data;
@@ -389,20 +419,65 @@ ethumb_plugin_get(void)
_thumb_cancel
};
- _log_dom = eina_log_domain_register("ethumb_emotion", EINA_COLOR_GREEN);
-
return &plugin;
}
static Eina_Bool
_module_init(void)
{
+ if (_init_count > 0)
+ {
+ _init_count++;
+ return EINA_TRUE;
+ }
+
+ _log_dom = eina_log_domain_register("ethumb_emotion", EINA_COLOR_GREEN);
+ if (_log_dom < 0)
+ {
+ EINA_LOG_ERR("Could not register log domain: ethumb_emotion");
+ goto error_log;
+ }
+
+ _pfx = eina_prefix_new(NULL, ethumb_init,
+ "ETHUMB", "ethumb", "checkme",
+ PACKAGE_BIN_DIR, PACKAGE_LIB_DIR,
+ PACKAGE_DATA_DIR, PACKAGE_DATA_DIR);
+ if (!_pfx)
+ {
+ ERR("Could not get ethumb installation prefix.");
+ goto error_pfx;
+ }
+
+ emotion_init();
+
+ _init_count = 1;
return EINA_TRUE;
+
+ error_pfx:
+ eina_log_domain_unregister(_log_dom);
+ _log_dom = -1;
+
+ error_log:
+ return EINA_FALSE;
}
static void
_module_shutdown(void)
{
+ if (_init_count <= 0)
+ {
+ EINA_LOG_ERR("Init count not greater than 0 in shutdown.");
+ return;
+ }
+ _init_count--;
+ if (_init_count > 0) return;
+
+ emotion_shutdown();
+
+ eina_prefix_free(_pfx);
+ _pfx = NULL;
+ eina_log_domain_unregister(_log_dom);
+ _log_dom = -1;
}
EINA_MODULE_INIT(_module_init);
diff --git a/src/modules/ethumb/emotion/placeholder.png b/src/modules/ethumb/emotion/placeholder.png
new file mode 100644
index 000000000..2c90acdc9
--- /dev/null
+++ b/src/modules/ethumb/emotion/placeholder.png
Binary files differ
diff --git a/legacy/ethumb/src/plugins/emotion/template.edc b/src/modules/ethumb/emotion/template.edc
index 4a30c3dea..050641c12 100644
--- a/legacy/ethumb/src/plugins/emotion/template.edc
+++ b/src/modules/ethumb/emotion/template.edc
@@ -3,6 +3,8 @@ collections {
group {
name: "movie/thumb";
+ images.image: "placeholder.png" COMP;
+
parts {
part {
name: "image";
@@ -10,8 +12,8 @@ collections {
mouse_events: 0;
description {
state: "default" 0.0;
- fill.smooth: 0;
- image.scale_hint: DYNAMIC;
+ fill.smooth: 0;
+ image.normal: "placeholder.png"; /* edje doesn't allow image without files anymore */
}
}
}
diff --git a/legacy/ethumb/src/tests/ethumb_dbus.c b/src/tests/ethumb/ethumb_dbus.c
index d9e2f1028..946aa137f 100644
--- a/legacy/ethumb/src/tests/ethumb_dbus.c
+++ b/src/tests/ethumb/ethumb_dbus.c
@@ -34,13 +34,13 @@
#include <Ecore.h>
static void
-_on_server_die_cb(void *data __UNUSED__, Ethumb_Client *client __UNUSED__)
+_on_server_die_cb(void *data EINA_UNUSED, Ethumb_Client *client EINA_UNUSED)
{
ecore_main_loop_quit();
}
static void
-_queue_add_cb(void *data __UNUSED__, Ethumb_Client *client __UNUSED__, int id, const char *file, const char *key __UNUSED__, const char *thumb_path, const char *thumb_key __UNUSED__, Eina_Bool success)
+_queue_add_cb(void *data EINA_UNUSED, Ethumb_Client *client EINA_UNUSED, int id, const char *file, const char *key EINA_UNUSED, const char *thumb_path, const char *thumb_key EINA_UNUSED, Eina_Bool success)
{
fprintf(stderr, ">>> %hhu file ready: %s; thumb ready: %s; id = %d\n", success, file, thumb_path, id);
}