summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaehwan Kim <jae.hwan.kim@samsung.com>2012-08-07 18:03:25 +0900
committerJaehwan Kim <jae.hwan.kim@samsung.com>2012-08-07 18:04:03 +0900
commit6319c761a2e2ba50b4c916284cb300f1ff3dd115 (patch)
treeee7983d1f93feeb6125a027ba7444902da2a01b6
parent9d1ba0d03223a3017d2d0251dcaefb1f66ff879b (diff)
parentab7e8b5240ba7a2a73ed207b1a20834f28dbbd97 (diff)
downloadedje-6319c761a2e2ba50b4c916284cb300f1ff3dd115.tar.gz
edje-6319c761a2e2ba50b4c916284cb300f1ff3dd115.tar.bz2
edje-6319c761a2e2ba50b4c916284cb300f1ff3dd115.zip
EFL core migration @74702
Merge remote-tracking branch 'origin/upstream' into HEAD Conflicts: ChangeLog configure.ac src/bin/edje_cc.c src/bin/edje_cc_handlers.c src/lib/edje_entry.c src/lib/edje_multisense.c
-rw-r--r--.gitignore1
-rw-r--r--AUTHORS8
-rw-r--r--ChangeLog126
-rw-r--r--Makefile.am24
-rw-r--r--NEWS32
-rw-r--r--README2
-rw-r--r--configure.ac98
-rw-r--r--doc/Makefile.am2
-rw-r--r--doc/examples.dox16
-rw-r--r--doc/head.html1
-rw-r--r--edje.pc.in1
-rw-r--r--src/bin/Makefile.am38
-rw-r--r--src/bin/edje_cc.c134
-rw-r--r--src/bin/edje_cc.h18
-rw-r--r--src/bin/edje_cc_handlers.c690
-rw-r--r--src/bin/edje_cc_mem.c8
-rw-r--r--src/bin/edje_cc_out.c1764
-rw-r--r--src/bin/edje_cc_parse.c275
-rw-r--r--src/bin/edje_cc_sources.c12
-rw-r--r--src/bin/edje_convert.c6
-rw-r--r--src/bin/edje_convert_main.c5
-rw-r--r--src/bin/edje_decc.c122
-rw-r--r--src/bin/edje_decc.h9
-rw-r--r--src/bin/edje_inspector.c2
-rw-r--r--src/bin/edje_multisense_convert.c6
-rw-r--r--src/bin/edje_player.c14
-rw-r--r--src/bin/edje_watch.c137
-rw-r--r--src/bin/epp/cpplib.c36
-rw-r--r--src/bin/epp/cpplib.h5
-rw-r--r--src/examples/Makefile.am14
-rw-r--r--src/lib/Edje.h63
-rw-r--r--src/lib/Makefile.am9
-rw-r--r--src/lib/edje_cache.c71
-rw-r--r--src/lib/edje_calc.c198
-rw-r--r--src/lib/edje_data.c29
-rw-r--r--src/lib/edje_edit.c11
-rw-r--r--src/lib/edje_embryo.c12
-rw-r--r--src/lib/edje_entry.c136
-rw-r--r--src/lib/edje_load.c288
-rw-r--r--src/lib/edje_lua2.c68
-rw-r--r--src/lib/edje_main.c30
-rw-r--r--src/lib/edje_match.c24
-rw-r--r--src/lib/edje_multisense.c37
-rw-r--r--src/lib/edje_private.h95
-rw-r--r--src/lib/edje_program.c30
-rw-r--r--src/lib/edje_smart.c1
-rw-r--r--src/lib/edje_text.c8
-rw-r--r--src/lib/edje_textblock_styles.c19
-rw-r--r--src/lib/edje_util.c616
-rw-r--r--src/modules/alsa_snd_player/Makefile.am1
-rw-r--r--src/modules/eet_snd_reader/Makefile.am1
-rw-r--r--src/modules/multisense_factory/Makefile.am1
52 files changed, 3779 insertions, 1575 deletions
diff --git a/.gitignore b/.gitignore
index 6fb9fca..c271153 100644
--- a/.gitignore
+++ b/.gitignore
@@ -36,6 +36,7 @@ cscope.out
/src/bin/edje_convert
/src/bin/edje_decc
/src/bin/edje_player
+/src/bin/edje_watch
/stamp-h1
tags
/config.cache
diff --git a/AUTHORS b/AUTHORS
index 893fb07..668532c 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -21,4 +21,10 @@ billiob (Boris Faure) <billiob@gmail.com>
Govindaraju SM <govi.sm@samsung.com> <govism@gmail.com>
Prince Kumar Dubey <prince.dubey@samsung.com> <prince.dubey@gmail.com>
David Seikel <onefang at gmail.com>
-Mikael Sans <sans.mikael@gmail.com> \ No newline at end of file
+Mikael Sans <sans.mikael@gmail.com>
+Jérôme Pinot <ngc891@gmail.com>
+Rajeev Ranjan (Rajeev) <rajeev.r@samsung.com> <rajeev.jnnce@gmail.com>
+ChunEon Park (Hermet) <hermet@hermet.pe.kr>
+Kim Shinwoo <kimcinoo.efl@gmail.com>
+Michael Bouchaud (yoz) <michael.bouchaud@gmail.com>
+WooHyun Jung (woohyun) <woohyun0705@gmail.com>
diff --git a/ChangeLog b/ChangeLog
index 31e57d9..f015eef 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2012-06-06 Leandro Pereira
+
+ * Made state index optional (defaulting to 0.0).
+
2011-01-29 Carsten Haitzler (The Rasterman)
1.0.0 release
@@ -412,7 +416,127 @@
edje_object_part_text_escaped_set() that converts escapes to
plain UTF8 if the part is TEXT.
-2012-05-21 Shilpa Onkar Singh
+2012-04-26 Carsten Haitzler (The Rasterman)
+
+ 1.2.0 release
+
+2012-04-30 Jérôme Pinot
+
+ * Add missing files in the tarballs.
+
+2012-05-02 Cedric Bail
+
+ * Doing less allocation and reuse Evas_Map does help.
+
+2012-05-08 Cedric Bail
+
+ * Add edje_watch tools to automatically rebuild edc.
+
+2012-05-09 Cedric Bail
+
+ * Fix bug in case of nesting edje_object_signal_emit and edje_object_signal_callback_{add,del}
+ * Check that the file changed on disk when trying to reopen it.
+ * Emit ['edje,change,file', 'edje'] when the file change on disk.
+ * Automatically reload edje file when it change in edje_player.
+
+2012-05-10 Cedric Bail
+
+ * Preserve user box and table items during call of edje_object_file_set.
+
+2012-05-12 Rajeev Ranjan (Rajeev)
+
+ * Add edje_cc optimization to remove alpha channel flag from images
+ with absolutely no alpha in them if marked as havin alpha in the
+ originals
+
+2012-05-14 Cedric Bail
+
+ * Preserve drag informations during call of edje_object_file_set.
+
+2012-05-15 Carsten Haitzler (The Rasterman)
+
+ * Optimize edje_cc to be multi-threaded and compress in parallel
+ * Remove O(n2) algorithms for O(1) in the parser in edje_cc
+ * Add options for the new compression modes in Eet. (fastcomp
+ and fastdecomp - LZ4 and LZ4HC).
+ * Overall sped up edje_cc by 4x faster (if you use fastcomp)
+ and about 4.5x faster with old zlib compression.
+
+2012-05-16 Cedric Bail
+
+ * Fix table and text when fixed point is turned on.
+ * Clamp image tween to never underflow also.
+
+2012-05-20 Cedric Bail
+
+ * Use Eina_File instead of fopen when possible in edje_cc.
+
+2012-05-21 Shilpa Onkar Singh
* Fix patch for edje draggable jump issue when external event
area is used for the dragable.
+
+2012-06-04 Cedric Bail
+
+ * Add SPACER part to reduce the load on the canvas (lighter and faster theme).
+
+2012-06-04 Prince Kumar Dubey
+
+ * Fix decompile of sound samples to use sound source file, not name
+ * Fix decompile of sound samples not double-free
+ * Fix alsa configure option to be alsa, not flac.
+
+2012-06-06 Jihoon Kim
+
+ * edje_entry: display preedit string even though there is no attribute
+
+2012-06-20 Kim Shinwoo
+
+ * Add edje_object_access_part_list_get and acess flags in edc file.
+
+2012-06-21 Carsten Haitzler (The Rasterman)
+
+ * Improve edje_cc slightly to use prefix for full path to
+ embryo_cc. this still like before requires embryo and edje to share
+ the same install prefix for edje_cc to work.
+
+2012-06-12 Michael Bouchaud (yoz)
+
+ * The aliases are now inherited from the targeted group
+ * Aliases can be usable with edje programs, if the part is in the
+ group
+
+2012-06-24 Cedric Bail
+
+ * Emit signal for flagged part when their size get to zero.
+
+2012-07-03 Tom Hacohen (TAsn)
+
+ * Entry: Update anchors from user_insert as well.
+
+2012-07-12 Tom Hacohen (TAsn)
+
+ * Textblock: Fixed issue with updating only the font size using text
+ classes.
+ * Textblock: Fixed updating textblock text_class with
+ edje_text_class_set.
+ * Text classes: Fixed edje_text_class_set to behave like
+ edje_object_text_class_set (and as expected) wrt NULL fonts.
+
+2012-07-12 Cedric Bail
+
+ * Warn at compile time about forgotten image definition.
+ * Stop compilation when clipping to a non RECT part.
+
+2012-07-14 Cedric Bail
+
+ * Fix Edje_Multisense shutdown.
+
+2012-07-24 Carsten Haitzler (The Rasterman)
+
+ * Fix edje entry to extend selection to char pos/word or line
+ when holding shift + mouse click.
+
+2012-07-29 Cedric Bail
+
+ * Reduce potential reentrant issue when using edje_object_signal_emit.
diff --git a/Makefile.am b/Makefile.am
index 4d02ab0..01415b9 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -72,23 +72,21 @@ endif
if EFL_ENABLE_COVERAGE
lcov-reset:
- @rm -rf coverage
- @find . -name "*.gcda" -exec rm {} \;
- @lcov --directory . --zerocounters
+ @rm -rf $(top_builddir)/coverage
+ @find $(top_builddir) -name "*.gcda" -delete
+ @lcov --zerocounters --directory $(top_builddir)
lcov-report:
- @mkdir coverage
- @lcov --compat-libtool --directory $(top_srcdir)/src --capture --output-file coverage/coverage.info
- @lcov -l coverage/coverage.info |grep "\\.h" |cut -d " " -f 2 > coverage/remove
- @lcov -r coverage/coverage.info `cat coverage/remove` > coverage/coverage.cleaned.info
- @rm coverage/remove
- @mv coverage/coverage.cleaned.info coverage/coverage.info
- @genhtml -t "$(PACKAGE_STRING)" -o coverage coverage/coverage.info
+ @mkdir $(top_builddir)/coverage
+ lcov --capture --compat-libtool --output-file $(top_builddir)/coverage/coverage.info --directory $(top_builddir)
+ lcov --remove $(top_builddir)/coverage/coverage.info '*.h' --output-file $(top_builddir)/coverage/coverage.cleaned.info
+ genhtml -t "$(PACKAGE_STRING)" -o $(top_builddir)/coverage/html $(top_builddir)/coverage/coverage.cleaned.info
+ @echo "Coverage Report at $(top_builddir)/coverage/html"
coverage:
- @make lcov-reset
- @make check
- @make lcov-report
+ @$(MAKE) lcov-reset
+ @$(MAKE) check
+ @$(MAKE) lcov-report
else
lcov-reset:
@echo "reconfigure with --enable-coverage"
diff --git a/NEWS b/NEWS
index 441230a..ecda60a 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,35 @@
+Edje 1.3.0
+
+Changes since Edje 1.2.0:
+-------------------------
+
+Additions:
+ * Add edje_watch to monitore change on edje source.
+ * Emit ['edje,change,file', 'edje'] when the file change on disk.
+ * edje_player will automatically reload the file when it change on disk.
+ * Add SPACER part. This part are not putting anything into the canvas. So lighter and faster to
+ process (Use it to replace RECT part that are never visible and never catch any event).
+ * Add accessibility flags and API to retrieve the relevant part.
+ * Emit signal when flagged part size get to zero.
+ * Warn at compile time about forgotten image.
+ * Stop compilation when clipping to a non RECT part.
+
+Improvements:
+ * Allocate once and reuse Evas_Map.
+ * Make edje_cc faster by improving the parser, mapping file in memory and using threads.
+ * Made state index optional in EDC files and Embryo scripts.
+
+Fixes:
+ * Add missing files in the tarballs.
+ * Prevent crash when running nested edje_object_signal_emit with edje_object_signal_callback_{add,del}.
+ * Do actually verify that the file on disk is different from the file we have loaded.
+ * Preserve user drag, box and table information during call of edje_object_file_set.
+ * Fix table and text when fixed point is turned on.
+ * Clamp image tween to never underflow also.
+ * [entry] display preedit string even though there is no attribute
+ * Fix shutdown of Edje_Multisense.
+ * Reduce potential reentrant issue when using edje_object_signal_emit.
+
Edje 1.2.0
Changes since Edje 1.1.0:
diff --git a/README b/README
index 9af4e36..f57cfd3 100644
--- a/README
+++ b/README
@@ -1,4 +1,4 @@
-Edje 1.2.0
+Edje 1.7.0
******************************************************************************
diff --git a/configure.ac b/configure.ac
index 130d9f1..bd3591e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,12 +1,12 @@
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
m4_define([v_maj], [1])
-m4_define([v_min], [2])
-m4_define([v_mic], [0])
+m4_define([v_min], [6])
+m4_define([v_mic], [99])
m4_define([v_rev], m4_esyscmd([(svnversion "${SVN_REPO_PATH:-.}" | grep -v '\(export\|Unversioned directory\)' || echo 0) | awk -F : '{printf("%s\n", $1);}' | tr -d ' :MSP\n']))
m4_if(v_rev, [0], [m4_define([v_rev], m4_esyscmd([git log 2> /dev/null | (grep -m1 git-svn-id || echo 0) | sed -e 's/.*@\([0-9]*\).*/\1/' | tr -d '\n']))])
##-- When released, remove the dnl on the below line
-m4_undefine([v_rev])
+dnl m4_undefine([v_rev])
##-- When doing snapshots - change soname. remove dnl on below line
dnl m4_define([relname], [ver-pre-svn-07])
dnl m4_define([v_rel], [-release relname])
@@ -18,7 +18,7 @@ m4_define([lt_age], v_min)
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
-AC_INIT([edje], [v_ver]-beta, [enlightenment-devel@lists.sourceforge.net])
+AC_INIT([edje], [v_ver], [enlightenment-devel@lists.sourceforge.net])
AC_PREREQ([2.52])
AC_CONFIG_SRCDIR([configure.ac])
AC_CONFIG_MACRO_DIR([m4])
@@ -65,7 +65,7 @@ AC_CANONICAL_HOST
case "$host_os" in
- mingw32ce* | cegcc*)
+ mingw32ce*)
MODULE_ARCH="$host_os-$host_cpu"
install_vim="no"
have_edje_cc="no"
@@ -104,6 +104,7 @@ EFL_ENABLE_BIN([edje-recc])
EFL_ENABLE_BIN([edje-player])
EFL_ENABLE_BIN([edje-inspector])
EFL_ENABLE_BIN([edje-external-inspector])
+EFL_ENABLE_BIN([edje-watch])
# Optional EDJE_PROGRAM_CACHE (use much more ram, but increase speed in some cases)
want_edje_program_cache="no"
@@ -220,7 +221,7 @@ AC_SUBST(pkgconfig_requires_private)
EFL_EDJE_BUILD=""
case "$host_os" in
mingw*)
- PKG_CHECK_MODULES([EVIL], [evil >= 1.0.0])
+ PKG_CHECK_MODULES([EVIL], [evil >= 1.6.99])
AC_DEFINE([HAVE_EVIL], [1], [Set to 1 if Evil library is installed])
requirement_edje="evil ${requirement_edje}"
EFL_EDJE_BUILD="-DEFL_EDJE_BUILD"
@@ -258,40 +259,49 @@ fi
PKG_CHECK_MODULES([MINIMAL],
[
- eina >= 1.2.0
- eet >= 1.6.0
+ eina >= 1.6.99
+ eet >= 1.6.99
])
PKG_CHECK_MODULES([EDJE],
[
- eina >= 1.2.0
- eet >= 1.6.0
- evas >= 1.2.0
- ecore >= 1.2.0
- ecore-evas >= 1.2.0
- ecore-file >= 1.2.0
- embryo >= 1.2.0
+ eina >= 1.6.99
+ eet >= 1.6.99
+ evas >= 1.6.99
+ ecore >= 1.6.99
+ ecore-evas >= 1.6.99
+ ecore-file >= 1.6.99
+ embryo >= 1.6.99
])
EDJE_LIBS="${EDJE_LIBS} ${LUA_LIBS} ${lua_libs}"
EDJE_CFLAGS="${EDJE_CFLAGS} ${LUA_CFLAGS}"
-requirement_edje="embryo >= 1.2.0 ecore-evas >= 1.2.0 ecore >= 1.2.0 evas >= 1.2.0 eet >= 1.6.0 eina >= 1.2.0 ${requirement_edje}"
+requirement_edje="embryo >= 1.6.99 ecore-evas >= 1.6.99 ecore >= 1.6.99 evas >= 1.6.99 eet >= 1.6.99 eina >= 1.6.99 ${requirement_edje}"
requirement_edje="${requirement_lua} ${requirement_edje}"
have_ecore_imf="no"
PKG_CHECK_MODULES([ECORE_IMF],
[
- ecore-imf >= 1.2.0
- ecore-imf-evas >= 1.2.0
+ ecore-imf >= 1.6.99
+ ecore-imf-evas >= 1.6.99
],
[
AC_DEFINE([HAVE_ECORE_IMF], [1], [Input Method Support for Edje Entry])
have_ecore_imf="yes"
- requirement_edje="ecore-imf-evas >= 1.2.0 ecore-imf >= 1.2.0 ${requirement_edje}"
+ requirement_edje="ecore-imf-evas >= 1.6.99 ecore-imf >= 1.6.99 ${requirement_edje}"
],
[have_ecore_imf="no"])
+PKG_CHECK_MODULES([EIO],
+ [eio >= 1.6.99],
+ [
+ AC_DEFINE([HAVE_EIO], [1], [Eio is available for monitoring file assynchronously])
+ have_eio="yes"
+ requirement_edje="eio >= 1.6.99 ${requirement_edje}"
+ ],
+ [have_eio="no"])
+
# Enable Multisense use
want_multisense="yes"
AC_ARG_ENABLE([multisense],
@@ -321,7 +331,7 @@ if test "x${want_multisense}" = "xyes" -a "x$want_sndfile" != "xno"; then
],
[have_sndfile="no"; want_multisense="no"]
)
-
+
if test "x$want_sndfile" = "xyes" -a "x$have_sndfile" = "xno"; then
AC_MSG_ERROR([sndfile support requested, but not found by pkg-config.])
fi
@@ -406,7 +416,7 @@ if test "x${want_multisense}" = "xyes" -a "x$want_alsa_lib" != "xno"; then
if test "x$want_alsa_lib" = "xyes" -a "x$have_alsa_lib" = "xno"; then
AC_MSG_ERROR([alsa support requested, but not found by pkg-config.])
fi
-fi
+fi
AM_CONDITIONAL([HAVE_LIBALSA], [test "x${have_alsa_lib}" = "xyes"])
##pulse audio library
@@ -468,32 +478,46 @@ fi
if test "x${want_multisense}" = "xyes" ; then
AC_DEFINE([ENABLE_MULTISENSE], [1], [Use Multisense])
fi
+AC_SUBST([want_multisense])
# Dependencies for the binaries
-if test "x$have_edje_cc" = "xyes"; then
- PKG_CHECK_MODULES([EDJE_CC], [ecore-file >= 1.2.0 ecore-evas >= 1.2.0 ecore >= 1.2.0 evas >= 1.2.0 eet >= 1.6.0 eina >= 1.2.0])
+if test "x${have_edje_cc}" = "xyes" ; then
+ PKG_CHECK_MODULES([EDJE_CC],
+ [ecore-file >= 1.6.99 ecore-evas >= 1.6.99 ecore >= 1.6.99 evas >= 1.6.99 eet >= 1.6.0 eina >= 1.6.99])
EDJE_CC_LIBS="${EDJE_CC_LIBS} ${LUA_LIBS} ${lua_libs}"
fi
-AM_CONDITIONAL([BUILD_EPP], [test "x$have_edje_cc" = "xyes"])
+AM_CONDITIONAL([BUILD_EPP], [test "x${have_edje_cc}" = "xyes"])
-if test "x$have_edje_decc" = "xyes"; then
- PKG_CHECK_MODULES([EDJE_DECC], [ecore-file >= 1.2.0 ecore-evas >= 1.2.0 ecore >= 1.2.0 evas >= 1.2.0 eet >= 1.6.0 eina >= 1.2.0])
+if test "x${have_edje_decc}" = "xyes" ; then
+ PKG_CHECK_MODULES([EDJE_DECC],
+ [ecore-file >= 1.6.99 ecore-evas >= 1.6.99 ecore >= 1.6.99 evas >= 1.6.99 eet >= 1.6.99 eina >= 1.6.99])
fi
-if test "x$have_edje_player" = "xyes"; then
- PKG_CHECK_MODULES([EDJE_PLAYER], [ecore-evas >= 1.2.0 ecore >= 1.2.0 evas >= 1.2.0 eina >= 1.2.0])
+if test "x${have_edje_player}" = "xyes" ; then
+ PKG_CHECK_MODULES([EDJE_PLAYER],
+ [ecore-evas >= 1.6.99 ecore >= 1.6.99 evas >= 1.6.99 eina >= 1.6.99])
fi
-if test "x$have_edje_inspector" = "xyes"; then
- PKG_CHECK_MODULES([EDJE_INSPECTOR], [ecore-evas >= 1.2.0 ecore >= 1.2.0 evas >= 1.2.0 eina >= 1.2.0])
+if test "x${have_edje_inspector}" = "xyes" ; then
+ PKG_CHECK_MODULES([EDJE_INSPECTOR],
+ [ecore-evas >= 1.6.99 ecore >= 1.6.99 evas >= 1.6.99 eina >= 1.6.99])
fi
-if test "x$have_edje_external_inspector" = "xyes"; then
- PKG_CHECK_MODULES([EDJE_EXTERNAL_INSPECTOR], [ecore >= 1.2.0 evas >= 1.2.0 eina >= 1.2.0])
+if test "x${have_edje_external_inspector}" = "xyes" ; then
+ PKG_CHECK_MODULES([EDJE_EXTERNAL_INSPECTOR],
+ [ecore >= 1.6.99 evas >= 1.6.99 eina >= 1.6.99])
fi
+if test "x${have_edje_watch}" = "xyes" ; then
+ PKG_CHECK_MODULES([EDJE_WATCH],
+ [ecore >= 1.6.99 eina >= 1.6.99 eio >= 1.6.99],
+ [have_edje_watch="yes"],
+ [have_edje_watch="no"])
+fi
+
+AM_CONDITIONAL([BUILD_EDJE_WATCH], [test "x${have_edje_watch}" = "xyes"])
### Checks for header files
AC_CHECK_HEADERS([locale.h sys/resource.h])
@@ -518,9 +542,6 @@ case "$host_os" in
mingw32ce*)
EDJE_CFLAGS="${EDJE_CFLAGS} -D_WIN32_WCE=0x0420"
;;
- cegcc*)
- EDJE_CFLAGS="${EDJE_CFLAGS} -mwin32 -D_WIN32_WCE=0x0420"
- ;;
esac
@@ -528,7 +549,7 @@ esac
lt_enable_auto_import=""
case "$host_os" in
- mingw* | cegcc*)
+ mingw*)
lt_enable_auto_import="-Wl,--enable-auto-import"
;;
esac
@@ -542,7 +563,7 @@ AC_ISC_POSIX
AC_FUNC_ALLOCA
case "$host_os" in
- mingw* | cegcc*)
+ mingw*)
AC_DEFINE([HAVE_REALPATH], [1], [Define to 1 if you have the `realpath' function.])
;;
*)
@@ -616,7 +637,7 @@ echo "Configuration Options Summary:"
echo
echo " Amalgamation.........: ${do_amalgamation}"
echo " Ecore IMF............: $have_ecore_imf"
-echo " Multisense...........: $want_multisense"
+dnl echo " Multisense...........: $want_multisense"
if test "x${want_multisense}" = "xyes" ; then
echo " LibRemix.............: $have_libremix"
@@ -643,6 +664,7 @@ echo " Build edje_recc..............: $have_edje_recc"
echo " Build edje_player............: $have_edje_player"
echo " Build edje_inspector.........: $have_edje_inspector"
echo " Build edje_external_inspector: $have_edje_external_inspector"
+echo " Build edje_watch.............: $have_edje_watch"
echo
echo "Compilation............: make (or gmake)"
echo " CPPFLAGS.............: $CPPFLAGS"
diff --git a/doc/Makefile.am b/doc/Makefile.am
index 97c2a68..b00aa03 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -32,4 +32,4 @@ doc:
endif
EXTRA_DIST = Doxyfile e.css foot.html head.html $(wildcard img/*.*) \
- $(wildcard examples/*.*)
+ $(wildcard examples/*.*) examples.dox
diff --git a/doc/examples.dox b/doc/examples.dox
index 17fd993..d0efafe 100644
--- a/doc/examples.dox
+++ b/doc/examples.dox
@@ -34,7 +34,7 @@
* declares two parts (blue and green rectangles) and an item data:
* @include basic.edc
*
- * We start by trying to acces an @b unexistant group in the file, so
+ * We start by trying to access an @b unexistant group in the file, so
* that you can see the usefulness of edje_object_load_error_get() and
* edje_load_error_str(). Check that the error message will tell you
* just that -- a group which didn't exist in the file was called for:
@@ -88,7 +88,7 @@
* @until min. size is
*
* The next two calls are to make <b>size calculations</b> on our
- * object. Because of the minumim size declared for @c "part_one" part's
+ * object. Because of the minimum size declared for @c "part_one" part's
* default state description, that will be our exact minimum
* size calculated for the group (remember the @c "min" declaration at
* group level is just a @b hint, not an enforcement). We then
@@ -819,10 +819,10 @@
*
* This example shows how to manipulate and change Color classes. In this example
* we will create two surfaces to show what happens when you change the color
- * class at the proccess and object level.
+ * class at the process and object level.
*
* It's a very simple example, there are two surfaces created from the same EDC,
- * but just in one of them we will set a specific color class, althoug both will be
+ * but just in one of them we will set a specific color class, although both will be
* affected by color class set at the process level as you will see.
*
* It's important you know that all colors has the format R G B A. Just to be easier
@@ -1116,9 +1116,9 @@
* Signals are software interruption, this means that when it happens and if the program is sensitive to it
* the program will stop whatever it is doing and handle the signal.
*
- * In this example we are only sensitive to the "mouve,move" signal so we need to register a callback to it.
+ * In this example we are only sensitive to the "mouse,move" signal so we need to register a callback to it.
* To do this we will add a signal callback to our edje object that will detect "mouse,move" signal
- * comming from the part "part_image" and when this happens we will call the fuction _on_mouse_over passing
+ * coming from the part "part_image" and when this happens we will call the function _on_mouse_over passing
* the evas pointer as a parameter. The evas pointer is passed as a parameter because we need to know
* where is the mouse pointer in the screen.
*
@@ -1133,7 +1133,7 @@
* we need to now where is the ball and where is the mouse and we can easily discovery these things using
* this:
*
- * For the the object position in the canvas:
+ * For the object position in the canvas:
* @dontinclude signals2.c
* @skipline evas_object_geometry
*
@@ -1146,7 +1146,7 @@
* @until y -= (
*
* You can change the formula above if you like. Because we are changing the object's position
- * we need to do something if the new position is beyound the canvas size. So here it is:
+ * we need to do something if the new position is beyond the canvas size. So here it is:
*
* @skip if
* @until y = 0
diff --git a/doc/head.html b/doc/head.html
index b6ad721..e490e78 100644
--- a/doc/head.html
+++ b/doc/head.html
@@ -56,6 +56,7 @@
<li><a href="luaref.html">LUA scripting</a></li>
<li><a href="Edje_8h.html">Edje API</a></li>
<li><a href="edcref.html">EDC Reference</a></li>
+ <li><a href="pages.html">Releted Pages</a></li>
<li class="current"><a href="index.html">Main Page</a></li>
</ul>
</div>
diff --git a/edje.pc.in b/edje.pc.in
index 1f2befe..88110e9 100644
--- a/edje.pc.in
+++ b/edje.pc.in
@@ -6,6 +6,7 @@ includedir=@includedir@
datarootdir=@datarootdir@
datadir=@datadir@/edje
vmaj=@VMAJ@
+multisense=@want_multisense@
Name: edje
Description: Enlightened graphical design and layout engine.
diff --git a/src/bin/Makefile.am b/src/bin/Makefile.am
index a936d5a..ccb6580 100644
--- a/src/bin/Makefile.am
+++ b/src/bin/Makefile.am
@@ -8,8 +8,16 @@ bin_SCRIPTS = @EDJE_RECC_PRG@
bin_PROGRAMS = @EDJE_CC_PRG@ @EDJE_DECC_PRG@ @EDJE_PLAYER_PRG@ @EDJE_INSPECTOR_PRG@ @EDJE_EXTERNAL_INSPECTOR_PRG@
+if BUILD_EDJE_WATCH
+bin_PROGRAMS += @EDJE_WATCH_PRG@
+endif
+
EXTRA_PROGRAMS = edje_cc edje_decc edje_player edje_inspector edje_external_inspector
+if BUILD_EDJE_WATCH
+EXTRA_PROGRAMS += edje_watch
+endif
+
edje_cc_SOURCES = \
edje_cc.c \
edje_cc_out.c \
@@ -26,10 +34,20 @@ edje_cc_CPPFLAGS = \
-DPACKAGE_LIB_DIR=\"$(libdir)\" \
-DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \
-DEPP_DIR=\"$(libdir)/$(PACKAGE)/utils\" \
-@EDJE_CFLAGS@ @EDJE_CC_CFLAGS@ @EVIL_CFLAGS@ @SNDFILE_CFLAGS@
-edje_cc_LDADD = $(top_builddir)/src/lib/libedje.la @EDJE_CC_LIBS@ @EVIL_LIBS@ @VORBISENC_LIBS@ @FLAC_LIBS@ @SNDFILE_LIBS@ -lm
+@EDJE_CFLAGS@ @EDJE_CC_CFLAGS@ @EIO_CFLAGS@ @EVIL_CFLAGS@ @SNDFILE_CFLAGS@
+edje_cc_LDADD = $(top_builddir)/src/lib/libedje.la @EDJE_CC_LIBS@ @EDJE_LIBS@ @EVIL_LIBS@ @VORBISENC_LIBS@ @FLAC_LIBS@ @SNDFILE_LIBS@ -lm
edje_cc_LDFLAGS = @lt_enable_auto_import@
+edje_watch_SOURCES = \
+edje_watch.c
+
+edje_watch_CPPFLAGS = \
+-I$(top_srcdir)/src/bin \
+-I$(top_srcdir)/src/lib \
+-DPACKAGE_BIN_DIR=\"$(bindir)\" \
+@EDJE_CFLAGS@ @EDJE_CC_CFLAGS@ @EIO_CFLAGS@ @EVIL_CFLAGS@ @EDJE_WATCH_CFLAGS@
+edje_watch_LDADD = $(top_builddir)/src/lib/libedje.la @EDJE_WATCH_LIBS@ @EDJE_LIBS@
+edje_watch_LDFLAGS = @lt_enable_auto_import@
edje_decc_SOURCES = \
edje_decc.c \
@@ -40,32 +58,32 @@ edje_cc_sources.c
edje_decc_CPPFLAGS = \
-I$(top_srcdir)/src/bin \
-I$(top_srcdir)/src/lib \
-@EDJE_CFLAGS@ @EDJE_DECC_CFLAGS@ @EVIL_CFLAGS@
-edje_decc_LDADD = $(top_builddir)/src/lib/libedje.la @EDJE_DECC_LIBS@ @VORBISENC_LIBS@ @FLAC_LIBS@ @SNDFILE_LIBS@
+@EDJE_CFLAGS@ @EDJE_DECC_CFLAGS@ @EIO_CFLAGS@ @EVIL_CFLAGS@
+edje_decc_LDADD = $(top_builddir)/src/lib/libedje.la @EDJE_DECC_LIBS@ @EDJE_LIBS@ @VORBISENC_LIBS@ @FLAC_LIBS@ @SNDFILE_LIBS@
edje_decc_LDFLAGS = @lt_enable_auto_import@
edje_player_SOURCES = edje_player.c
edje_player_CPPFLAGS = \
-I$(top_srcdir)/src/bin \
-I$(top_srcdir)/src/lib \
-@EDJE_PLAYER_CFLAGS@ @EVIL_CFLAGS@
-edje_player_LDADD = $(top_builddir)/src/lib/libedje.la @EDJE_PLAYER_LIBS@ @EVIL_LIBS@ @VORBISENC_LIBS@ @FLAC_LIBS@ @SNDFILE_LIBS@
+@EDJE_PLAYER_CFLAGS@ @EVIL_CFLAGS@ @EIO_CFLAGS@
+edje_player_LDADD = $(top_builddir)/src/lib/libedje.la @EDJE_PLAYER_LIBS@ @EDJE_LIBS@ @EVIL_LIBS@ @VORBISENC_LIBS@ @FLAC_LIBS@ @SNDFILE_LIBS@
edje_player_LDFLAGS = @lt_enable_auto_import@
edje_inspector_SOURCES = edje_inspector.c
edje_inspector_CPPFLAGS = \
-I$(top_srcdir)/src/bin \
-I$(top_srcdir)/src/lib \
-@EDJE_INSPECTOR_CFLAGS@
-edje_inspector_LDADD = $(top_builddir)/src/lib/libedje.la @EDJE_INSPECTOR_LIBS@ @VORBISENC_LIBS@ @FLAC_LIBS@
+@EDJE_INSPECTOR_CFLAGS@ @EIO_CFLAGS@
+edje_inspector_LDADD = $(top_builddir)/src/lib/libedje.la @EDJE_INSPECTOR_LIBS@ @EDJE_LIBS@ @VORBISENC_LIBS@ @FLAC_LIBS@
edje_inspector_LDFLAGS = @lt_enable_auto_import@
edje_external_inspector_SOURCES = edje_external_inspector.c
edje_external_inspector_CPPFLAGS = \
-I$(top_srcdir)/src/bin \
-I$(top_srcdir)/src/lib \
-@EDJE_EXTERNAL_INSPECTOR_CFLAGS@
-edje_external_inspector_LDADD = $(top_builddir)/src/lib/libedje.la @EDJE_EXTERNAL_INSPECTOR_LIBS@ @VORBISENC_LIBS@ @FLAC_LIBS@ @SNDFILE_LIBS@
+@EDJE_EXTERNAL_INSPECTOR_CFLAGS@ @EIO_CFLAGS@
+edje_external_inspector_LDADD = $(top_builddir)/src/lib/libedje.la @EDJE_EXTERNAL_INSPECTOR_LIBS@ @EDJE_LIBS@ @VORBISENC_LIBS@ @FLAC_LIBS@ @SNDFILE_LIBS@
edje_external_inspector_LDFLAGS = @lt_enable_auto_import@
EXTRA_DIST = @EDJE_RECC_PRG@ edje_cc.h edje_convert.h edje_convert.c edje_multisense_convert.h edje_data_convert.c
diff --git a/src/bin/edje_cc.c b/src/bin/edje_cc.c
index 63cb173..ce42f2c 100644
--- a/src/bin/edje_cc.c
+++ b/src/bin/edje_cc.c
@@ -19,8 +19,9 @@ Eina_List *defines = NULL;
char *file_in = NULL;
char *tmp_dir = NULL;
char *file_out = NULL;
-char *progname = NULL;
-int verbose = 0;
+char *watchfile = NULL;
+
+static const char *progname = NULL;
int no_lossy = 0;
int no_comp = 0;
@@ -28,6 +29,88 @@ int no_raw = 0;
int no_save = 0;
int min_quality = 0;
int max_quality = 100;
+int compress_mode = EET_COMPRESSION_DEFAULT;
+int threads = 0;
+
+static void
+_edje_cc_log_cb(const Eina_Log_Domain *d,
+ Eina_Log_Level level,
+ const char *file,
+ const char *fnc,
+ int line,
+ const char *fmt,
+ __UNUSED__ void *data,
+ va_list args)
+{
+ if ((d->name) && (d->namelen == sizeof("edje_cc") - 1) &&
+ (memcmp(d->name, "edje_cc", sizeof("edje_cc") - 1) == 0))
+ {
+ const char *prefix;
+ Eina_Bool use_color = !eina_log_color_disable_get();
+
+ if (use_color)
+ {
+#ifndef _WIN32
+ fputs(eina_log_level_color_get(level), stderr);
+#else
+ int color;
+ switch (level)
+ {
+ case EINA_LOG_LEVEL_CRITICAL:
+ color = FOREGROUND_RED | FOREGROUND_INTENSITY;
+ break;
+ case EINA_LOG_LEVEL_ERR:
+ color = FOREGROUND_RED;
+ break;
+ case EINA_LOG_LEVEL_WARN:
+ color = FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_INTENSITY;
+ break;
+ case EINA_LOG_LEVEL_INFO:
+ color = FOREGROUND_GREEN | FOREGROUND_INTENSITY;
+ break;
+ case EINA_LOG_LEVEL_DBG:
+ color = FOREGROUND_BLUE | FOREGROUND_INTENSITY;
+ break;
+ default:
+ color = FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE;
+ }
+ SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), color);
+#endif
+ }
+
+ switch (level)
+ {
+ case EINA_LOG_LEVEL_CRITICAL:
+ prefix = "Critical. ";
+ break;
+ case EINA_LOG_LEVEL_ERR:
+ prefix = "Error. ";
+ break;
+ case EINA_LOG_LEVEL_WARN:
+ prefix = "Warning. ";
+ break;
+ default:
+ prefix = "";
+ }
+ fprintf(stderr, "%s: %s", progname, prefix);
+
+ if (use_color)
+ {
+#ifndef _WIN32
+ fputs(EINA_COLOR_RESET, stderr);
+#else
+ SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),
+ FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE);
+#endif
+ }
+
+
+ vfprintf(stderr, fmt, args);
+ putc('\n', stderr);
+ }
+ else
+ eina_log_print_cb_stderr(d, level, file, fnc, line, fmt, NULL, args);
+}
static void
main_help(void)
@@ -38,6 +121,7 @@ main_help(void)
"\n"
"Where OPTIONS is one or more of:\n"
"\n"
+ "-w files.txt Dump all sources files path into files.txt\n"
"-id image/directory Add a directory to look in for relative path images\n"
"-fd font/directory Add a directory to look in for relative path fonts\n"
"-sd sound/directory Add a directory to look in for relative path sounds samples\n"
@@ -50,6 +134,10 @@ main_help(void)
"-min-quality VAL Do NOT allow lossy images with quality < VAL (0-100)\n"
"-max-quality VAL Do NOT allow lossy images with quality > VAL (0-100)\n"
"-Ddefine_val=to CPP style define to define input macro definitions to the .edc source\n"
+ "-fastcomp Use a faster compression algorithm (LZ4) (mutually exclusive with -fastdecomp)\n"
+ "-fastdecomp Use a faster decompression algorithm (LZ4HC) (mutually exclusive with -fastcomp)\n"
+ "-threads Compile the edje file using multiple parallel threads (by default)\n"
+ "-nothreads Compile the edje file using only the main loop\n"
,progname);
}
@@ -72,6 +160,9 @@ main(int argc, char **argv)
EINA_LOG_ERR("Enable to create a log domain.");
exit(-1);
}
+ progname = ecore_file_file_get(argv[0]);
+ eina_log_print_cb_set(_edje_cc_log_cb, NULL);
+
tmp_dir = getenv("TMPDIR");
img_dirs = eina_list_append(img_dirs, ".");
@@ -79,7 +170,6 @@ main(int argc, char **argv)
/* add defines to epp so edc files can detect edje_cc version */
defines = eina_list_append(defines, mem_strdup("-DEDJE_VERSION_12=12"));
- progname = argv[0];
for (i = 1; i < argc; i++)
{
if (!strcmp(argv[i], "-h"))
@@ -89,7 +179,7 @@ main(int argc, char **argv)
}
else if (!strcmp(argv[i], "-v"))
{
- verbose = 1;
+ eina_log_domain_level_set("edje_cc", EINA_LOG_LEVEL_INFO);
}
else if (!strcmp(argv[i], "-no-lossy"))
{
@@ -142,6 +232,22 @@ main(int argc, char **argv)
if (max_quality < 0) max_quality = 0;
if (max_quality > 100) max_quality = 100;
}
+ else if (!strcmp(argv[i], "-fastcomp"))
+ {
+ compress_mode = EET_COMPRESSION_SUPERFAST;
+ }
+ else if (!strcmp(argv[i], "-fastdecomp"))
+ {
+ compress_mode = EET_COMPRESSION_VERYFAST;
+ }
+ else if (!strcmp(argv[i], "-threads"))
+ {
+ threads = 1;
+ }
+ else if (!strcmp(argv[i], "-nothreads"))
+ {
+ threads = 0;
+ }
else if (!strncmp(argv[i], "-D", 2))
{
defines = eina_list_append(defines, mem_strdup(argv[i]));
@@ -151,18 +257,27 @@ main(int argc, char **argv)
i++;
file_out = argv[i];
}
+ else if ((!strcmp(argv[i], "-w")) && (i < (argc - 1)))
+ {
+ i++;
+ watchfile = argv[i];
+ unlink(watchfile);
+ }
else if (!file_in)
file_in = argv[i];
else if (!file_out)
file_out = argv[i];
}
+
if (!file_in)
{
- fprintf(stderr, "%s: Error: no input file specified.\n", progname);
+ ERR("no input file specified.");
main_help();
exit(-1);
}
+
+
pfx = eina_prefix_new(argv[0], /* argv[0] value (optional) */
main, /* an optional symbol to check path of */
"EDJE", /* env var prefix to use (XXX_PREFIX, XXX_BIN_DIR etc. */
@@ -181,7 +296,7 @@ main(int argc, char **argv)
if (stat(file_in, &st) || !S_ISREG(st.st_mode))
#endif
{
- fprintf(stderr, "%s: Error: file not found: %s.\n", progname, file_in);
+ ERR("file not found: %s.", file_in);
main_help();
exit(-1);
}
@@ -202,7 +317,7 @@ main(int argc, char **argv)
}
if (!file_out)
{
- fprintf(stderr, "%s: Error: no output file specified.\n", progname);
+ ERR("no output file specified.");
main_help();
exit(-1);
}
@@ -213,12 +328,15 @@ main(int argc, char **argv)
if (!strcmp (file_in, file_out))
#endif
{
- fprintf(stderr, "%s: Error: input file equals output file.\n", progname);
+ ERR("input file equals output file.");
main_help();
exit(-1);
}
_on_edjecc = EINA_TRUE;
+
+ using_file(file_in);
+
if (!edje_init())
exit(-1);
diff --git a/src/bin/edje_cc.h b/src/bin/edje_cc.h
index 0291f29..d9468b6 100644
--- a/src/bin/edje_cc.h
+++ b/src/bin/edje_cc.h
@@ -17,6 +17,7 @@ extern Eina_Prefix *pfx;
/* logging variables */
extern int _edje_cc_log_dom ;
#define EDJE_CC_DEFAULT_LOG_COLOR EINA_COLOR_CYAN
+
#ifdef ERR
# undef ERR
#endif
@@ -29,7 +30,14 @@ extern int _edje_cc_log_dom ;
# undef WRN
#endif
#define WRN(...) EINA_LOG_DOM_WARN(_edje_cc_log_dom, __VA_ARGS__)
-
+#ifdef CRIT
+# undef CRIT
+#endif
+#define CRIT(...) EINA_LOG_DOM_CRIT(_edje_cc_log_dom, __VA_ARGS__)
+#ifdef DBG
+# undef DBG
+#endif
+#define DBG(...) EINA_LOG_DOM_DBG(_edje_cc_log_dom, __VA_ARGS__)
/* types */
typedef struct _New_Object_Handler New_Object_Handler;
@@ -194,6 +202,8 @@ void *mem_alloc(size_t size);
char *mem_strdup(const char *s);
#define SZ sizeof
+void using_file(const char *filename);
+
void error_and_abort(Eet_File *ef, const char *fmt, ...);
/* global vars */
@@ -204,8 +214,7 @@ extern Eina_List *snd_dirs;
extern char *file_in;
extern char *tmp_dir;
extern char *file_out;
-extern char *progname;
-extern int verbose;
+extern char *watchfile;
extern int no_lossy;
extern int no_comp;
extern int no_raw;
@@ -224,6 +233,7 @@ extern Eina_List *defines;
extern Eina_List *aliases;
extern New_Object_Handler object_handlers[];
extern New_Statement_Handler statement_handlers[];
-
+extern int compress_mode;
+extern int threads;
#endif
diff --git a/src/bin/edje_cc_handlers.c b/src/bin/edje_cc_handlers.c
index eb5da0f..3799e6e 100644
--- a/src/bin/edje_cc_handlers.c
+++ b/src/bin/edje_cc_handlers.c
@@ -40,7 +40,7 @@
/**
* @page edcref Edje Data Collection reference
* An Edje Data Collection, it's a plain text file (normally identified with the
- * .edc extension),consisting of instructions for the Edje Compiler.
+ * .edc extension), consisting of instructions for the Edje Compiler.
*
* The syntax for the edje data collection files follows a simple structure of
* "blocks { .. }" that can contain "properties: ..", more blocks, or both.
@@ -142,6 +142,7 @@ static void st_collections_group_parts_part_entry_mode(void);
static void st_collections_group_parts_part_select_mode(void);
static void st_collections_group_parts_part_cursor_mode(void);
static void st_collections_group_parts_part_multiline(void);
+static void st_collections_group_parts_part_access(void);
static void st_collections_group_parts_part_dragable_x(void);
static void st_collections_group_parts_part_dragable_y(void);
static void st_collections_group_parts_part_dragable_confine(void);
@@ -170,6 +171,7 @@ static void st_collections_group_parts_part_description_inherit(void);
static void st_collections_group_parts_part_description_source(void);
static void st_collections_group_parts_part_description_state(void);
static void st_collections_group_parts_part_description_visible(void);
+static void st_collections_group_parts_part_description_limit(void);
static void st_collections_group_parts_part_description_align(void);
static void st_collections_group_parts_part_description_fixed(void);
static void st_collections_group_parts_part_description_min(void);
@@ -386,6 +388,7 @@ New_Statement_Handler statement_handlers[] =
{"collections.group.parts.part.select_mode", st_collections_group_parts_part_select_mode},
{"collections.group.parts.part.cursor_mode", st_collections_group_parts_part_cursor_mode},
{"collections.group.parts.part.multiline", st_collections_group_parts_part_multiline},
+ {"collections.group.parts.part.access", st_collections_group_parts_part_access},
{"collections.group.parts.part.image", st_images_image}, /* dup */
{"collections.group.parts.part.set.name", st_images_set_name},
{"collections.group.parts.part.set.image.image", st_images_set_image_image},
@@ -433,6 +436,7 @@ New_Statement_Handler statement_handlers[] =
{"collections.group.parts.part.description.source", st_collections_group_parts_part_description_source},
{"collections.group.parts.part.description.state", st_collections_group_parts_part_description_state},
{"collections.group.parts.part.description.visible", st_collections_group_parts_part_description_visible},
+ {"collections.group.parts.part.description.limit", st_collections_group_parts_part_description_limit},
{"collections.group.parts.part.description.align", st_collections_group_parts_part_description_align},
{"collections.group.parts.part.description.fixed", st_collections_group_parts_part_description_fixed},
{"collections.group.parts.part.description.min", st_collections_group_parts_part_description_min},
@@ -874,6 +878,7 @@ _edje_part_description_alloc(unsigned char type, const char *collection, const c
switch (type)
{
+ case EDJE_PART_TYPE_SPACER:
case EDJE_PART_TYPE_RECTANGLE:
case EDJE_PART_TYPE_SWALLOW:
case EDJE_PART_TYPE_GROUP:
@@ -970,8 +975,9 @@ _edje_part_description_alloc(unsigned char type, const char *collection, const c
if (!result)
{
- ERR("%s: Error. Unknown type %i of part %s in collection %s.", progname, type, part, collection);
- exit(-1);
+ ERR("Unknown type %i of part %s in collection %s.",
+ type, part, collection);
+ exit(-1);
}
return result;
@@ -993,8 +999,8 @@ _edje_program_check(const char *name, Edje_Program *me, Edje_Program **pgrms, un
epp = (Edje_Program_Parser *)pgrms[i];
if (!epp->can_override)
{
- ERR("%s: Error. parse error %s:%i. There is already a program of the name %s\n",
- progname, file_in, line - 1, name);
+ ERR("parse error %s:%i. There is already a program of the name %s",
+ file_in, line - 1, name);
exit(-1);
}
else
@@ -1072,9 +1078,8 @@ _edje_program_copy(Edje_Program *ep, Edje_Program *ep2)
data_queue_copied_part_lookup(pc, &(et2->id), &(et->id));
else
{
- ERR("%s: Error. parse error %s:%i. "
- "target may only be used after action",
- progname, file_in, line - 1);
+ ERR("parse error %s:%i. target may only be used after action",
+ file_in, line - 1);
exit(-1);
}
}
@@ -1163,7 +1168,7 @@ st_externals_external(void)
0, sizeof (Edje_External_Directory));
if (!edje_file->external_dir->entries)
{
- ERR("%s: Error. not enough memory", progname);
+ ERR("not enough memory");
exit(-1);
}
@@ -1220,7 +1225,7 @@ st_externals_external(void)
Compression methods:
@li RAW: Uncompressed.
@li COMP: Lossless compression.
- @li LOSSY [0-100]: Lossy comression with quality from 0 to 100.
+ @li LOSSY [0-100]: Lossy compression with quality from 0 to 100.
@li USER: Do not embed the file, refer to the external file instead.
@endproperty
*/
@@ -1251,8 +1256,8 @@ st_images_image(void)
0, sizeof (Edje_Image_Directory_Entry));
if (!edje_file->image_dir->entries)
{
- ERR("%s: Error. No enough memory.", progname);
- exit(-1);
+ ERR("No enough memory.");
+ exit(-1);
}
img = edje_file->image_dir->entries + edje_file->image_dir->entries_count - 1;
@@ -1340,8 +1345,8 @@ ob_images_set(void)
0, sizeof (Edje_Image_Directory_Set));
if (!edje_file->image_dir->sets)
{
- ERR("%s: Error. Not enough memory.", progname);
- exit(-1);
+ ERR("Not enough memory.");
+ exit(-1);
}
edje_file->image_dir->sets[edje_file->image_dir->sets_count - 1].id = edje_file->image_dir->sets_count - 1;
}
@@ -1365,6 +1370,16 @@ st_images_set_name(void)
edje_file->image_dir->sets[edje_file->image_dir->sets_count - 1].name = parse_str(0);
}
+/**
+ @page edcref
+
+ @block
+ image
+ @description
+ The "image" block inside a "set" block define the characteristic of an image.
+ Every block will describe one image and the size rule to use it.
+ @endblock
+**/
static void
ob_images_set_image(void)
{
@@ -1378,6 +1393,23 @@ ob_images_set_image(void)
set->entries = eina_list_append(set->entries, entry);
}
+/**
+ @page edcref
+
+ @property
+ image
+ @parameters
+ [image file] [compression method] (compression level)
+ @effect
+ Used to include each image file. The full path to the directory holding
+ the images can be defined later with edje_cc's "-id" option.
+ Compression methods:
+ @li RAW: Uncompressed.
+ @li COMP: Lossless compression.
+ @li LOSSY [0-100]: Lossy compression with quality from 0 to 100.
+ @li USER: Do not embed the file, refer to the external file instead.
+ @endproperty
+**/
static void
st_images_set_image_image(void)
{
@@ -1429,8 +1461,8 @@ st_images_set_image_size(void)
if (entry->size.min.w > entry->size.max.w
|| entry->size.min.h > entry->size.max.h)
{
- ERR("%s: Error. parse error %s:%i. Image min and max size are not in the right order ([%i, %i] < [%i, %i])",
- progname, file_in, line - 1,
+ ERR("parse error %s:%i. Image min and max size are not in the right order ([%i, %i] < [%i, %i])",
+ file_in, line - 1,
entry->size.min.w, entry->size.min.h,
entry->size.max.w, entry->size.max.h);
exit(-1);
@@ -1540,7 +1572,7 @@ st_data_item(void)
@parameters
[parameter name] [parameter filename]
@effect
- Defines a new parameter , the value will be the contents of the
+ Defines a new parameter, the value will be the contents of the
specified file formated as a single string of text. This property only
works with plain text files.
@endproperty
@@ -1568,23 +1600,23 @@ st_data_file(void)
fd = open(filename, O_RDONLY | O_BINARY, S_IRUSR | S_IWUSR);
if (fd < 0)
{
- ERR("%s: Error. %s:%i when opening file \"%s\": \"%s\"",
- progname, file_in, line, filename, strerror(errno));
+ ERR("%s:%i when opening file \"%s\": \"%s\"",
+ file_in, line, filename, strerror(errno));
exit(-1);
}
if (fstat(fd, &buf))
{
- ERR("%s: Error. %s:%i when stating file \"%s\": \"%s\"",
- progname, file_in, line, filename, strerror(errno));
+ ERR("%s:%i when stating file \"%s\": \"%s\"",
+ file_in, line, filename, strerror(errno));
exit(-1);
}
data = mmap(NULL, buf.st_size, PROT_READ, MAP_SHARED, fd, 0);
if (data == MAP_FAILED)
{
- ERR("%s: Error. %s:%i when mapping file \"%s\": \"%s\"",
- progname, file_in, line, filename, strerror(errno));
+ ERR("%s:%i when mapping file \"%s\": \"%s\"",
+ file_in, line, filename, strerror(errno));
exit(-1);
}
@@ -1592,8 +1624,7 @@ st_data_file(void)
for (i = 0; i < buf.st_size; ++i, ++over)
if (*over == '\0')
{
- ERR("%s: Error. %s:%i file \"%s\" is a binary file.",
- progname, file_in, line, filename);
+ ERR("%s:%i file \"%s\" is a binary file.", file_in, line, filename);
exit(-1);
}
@@ -1677,8 +1708,8 @@ st_color_class_name(void)
{
if ((cc != tcc) && (!strcmp(cc->name, tcc->name)))
{
- fprintf(stderr, "%s: Error. parse error %s:%i. There is already a color class named \"%s\"\n",
- progname, file_in, line - 1, cc->name);
+ ERR("parse error %s:%i. There is already a color class named \"%s\"",
+ file_in, line - 1, cc->name);
exit(-1);
}
}
@@ -1808,8 +1839,8 @@ st_styles_style_name(void)
{
if (stl->name && tstl->name && (stl != tstl) && (!strcmp(stl->name, tstl->name)))
{
- ERR("%s: Error. parse error %s:%i. There is already a style named \"%s\"",
- progname, file_in, line - 1, stl->name);
+ ERR("parse error %s:%i. There is already a style named \"%s\"",
+ file_in, line - 1, stl->name);
exit(-1);
}
}
@@ -1835,9 +1866,9 @@ st_styles_style_base(void)
stl = eina_list_data_get(eina_list_last(edje_file->styles));
if (stl->tags)
{
- ERR("%s: Error. parse error %s:%i. There is already a basic format for the style",
- progname, file_in, line - 1);
- exit(-1);
+ ERR("parse error %s:%i. There is already a basic format for the style",
+ file_in, line - 1);
+ exit(-1);
}
tag = mem_alloc(SZ(Edje_Style_Tag));
tag->key = mem_strdup("DEFAULT");
@@ -1931,7 +1962,7 @@ ob_collections(void)
source: "sound_file3.wav";
}
sample {
- name: "sound_file4" AS-IS;
+ name: "sound_file4" AS_IS;
source: "sound_file1.wav";
}
@description
@@ -1946,7 +1977,7 @@ ob_collections(void)
the sounds can be defined later with edje_cc's "-sd" option.
@li RAW: Uncompressed.
@li COMP: Lossless compression.
- @li LOSSY [45.0 - 1000.0]: Lossy comression with quality from 45.0 to 1000.0.
+ @li LOSSY [-0.1 - 1.0]: Lossy compression with quality from 0 to 1.0.
@li AS_IS: Check for re-encoding, no compression/encoding, just write the file information as it is.
@endproperty
@since 1.1.0
@@ -1980,7 +2011,7 @@ st_collections_group_sound_sample_name(void)
if (!edje_file->sound_dir->samples)
{
- ERR("%s: Error. No enough memory.", progname);
+ ERR("No enough memory.");
exit(-1);
}
@@ -2027,7 +2058,7 @@ st_collections_group_sound_sample_source(void)
if (!edje_file->sound_dir->samples)
{
- ERR("%s: Error. Invalid sound sample source definition.", progname);
+ ERR("Invalid sound sample source definition.");
exit(-1);
}
@@ -2037,7 +2068,7 @@ st_collections_group_sound_sample_source(void)
if (!sample)
{
- ERR("%s: Error. Invalid sound sample source definition.", progname);
+ ERR("Invalid sound sample source definition.");
exit(-1);
}
sample->snd_src = parse_str(0);
@@ -2077,14 +2108,14 @@ st_collections_group_sound_tone(void)
{
if (!strcmp(edje_file->sound_dir->tones[i].name, tmp))
{
- ERR("%s: Error. Tone name: %s already exist.", progname, tmp);
+ ERR("Tone name: %s already exist.", tmp);
free((char *)tmp);
exit(-1);
}
if (edje_file->sound_dir->tones[i].value == value)
{
- ERR("%s: Error. Tone name %s with same frequency %d exist.",
- progname, edje_file->sound_dir->tones[i].name, value);
+ ERR("Tone name %s with same frequency %d exist.",
+ edje_file->sound_dir->tones[i].name, value);
exit(-1);
}
}
@@ -2096,7 +2127,7 @@ st_collections_group_sound_tone(void)
if (!edje_file->sound_dir->tones)
{
- ERR("%s: Error. No enough memory.", progname);
+ ERR("No enough memory.");
exit(-1);
}
@@ -2141,11 +2172,11 @@ ob_collections_group(void)
{
Edje_Part_Collection *pc;
Code *cd;
-
+
if (current_de && !current_de->entry)
{
- ERR("%p: Error. A collection without a name was detected, that's not allowed.", progname);
- exit(-1);
+ ERR("A collection without a name was detected, that's not allowed.");
+ exit(-1);
}
current_de = mem_alloc(SZ(Edje_Part_Collection_Directory_Entry));
@@ -2252,7 +2283,6 @@ st_collections_group_inherit(void)
Edje_Pack_Element_Parser *pitem;
Edje_Part_Description_Common *ed, *ed2;
Edje_List_Foreach_Data fdata;
- Edje_String *es;
Eina_List *l;
char *parent_name;
unsigned int i, j;
@@ -2270,36 +2300,61 @@ st_collections_group_inherit(void)
}
if (!pc2)
{
- ERR("%s: Error. parse error %s:%i. There isn't a group with the name %s",
- progname, file_in, line - 1, parent_name);
+ ERR("parse error %s:%i. There isn't a group with the name %s",
+ file_in, line - 1, parent_name);
exit(-1);
}
if (pc2 == pc)
{
- ERR("%s: Error. parse error %s:%i. You are trying to inherit '%s' from itself. That's not possible."
+ ERR("parse error %s:%i. You are trying to inherit '%s' from itself. That's not possible."
"If there is another group of the same name, you want to inherit from that group and have the"
"same name as that group, there is a trick ! Just put the inherit before the directive that set"
- "the name !", progname, file_in, line - 1, parent_name);
+ "the name !", file_in, line - 1, parent_name);
exit(-1);
}
if (pc2->data)
{
- char *key;
+ char *key, *data;
memset(&fdata, 0, sizeof(Edje_List_Foreach_Data));
eina_hash_foreach(pc2->data,
_edje_data_item_list_foreach, &fdata);
- if (!pc->data)
- pc->data = eina_hash_string_small_new(free);
+ if (!pc->data) pc->data = eina_hash_string_small_new(free);
+ EINA_LIST_FREE(fdata.list, key)
+ {
+ data = eina_hash_find(pc2->data, key);
+ eina_hash_direct_add(pc->data, key, data);
+ }
+ }
+
+ if (pc2->alias)
+ {
+ char *key, *alias;
+ memset(&fdata, 0, sizeof(Edje_List_Foreach_Data));
+ eina_hash_foreach(pc2->alias,
+ _edje_data_item_list_foreach, &fdata);
+ if (!pc->alias) pc->alias = eina_hash_string_small_new(free);
+ EINA_LIST_FREE(fdata.list, key)
+ {
+ alias = eina_hash_find(pc2->alias, key);
+ eina_hash_direct_add(pc->alias, key, alias);
+ }
+ }
+ if (pc2->aliased)
+ {
+ char *key, *aliased;
+ memset(&fdata, 0, sizeof(Edje_List_Foreach_Data));
+ eina_hash_foreach(pc2->aliased,
+ _edje_data_item_list_foreach, &fdata);
+ if (!pc->aliased) pc->aliased = eina_hash_string_small_new(free);
EINA_LIST_FREE(fdata.list, key)
{
- es = mem_alloc(SZ(Edje_String));
- es = (Edje_String *)eina_hash_find(pc2->data, key);
- eina_hash_direct_add(pc->data, key, es);
+ aliased = eina_hash_find(pc2->aliased, key);
+ eina_hash_direct_add(pc->aliased, key, aliased);
}
}
@@ -2339,6 +2394,7 @@ st_collections_group_inherit(void)
ep->select_mode = ep2->select_mode;
ep->cursor_mode = ep2->cursor_mode;
ep->multiline = ep2->multiline;
+ ep->access = ep2->access;
ep->dragable.x = ep2->dragable.x;
ep->dragable.step_x = ep2->dragable.step_x;
ep->dragable.count_x = ep2->dragable.count_x;
@@ -2644,8 +2700,8 @@ ob_collections_group_script(void)
cd->l2 = get_verbatim_line2();
if (cd->shared)
{
- ERR("%s: Error. parse error %s:%i. There is already an existing script section for the group",
- progname, file_in, line - 1);
+ ERR("parse error %s:%i. There is already an existing script section for the group",
+ file_in, line - 1);
exit(-1);
}
cd->shared = s;
@@ -2675,8 +2731,8 @@ ob_collections_group_lua_script(void)
cd->l2 = get_verbatim_line2();
if (cd->shared)
{
- ERR("%s: Error. parse error %s:%i. There is already an existing script section for the group",
- progname, file_in, line - 1);
+ ERR("parse error %s:%i. There is already an existing script section for the group",
+ file_in, line - 1);
exit(-1);
}
cd->shared = s;
@@ -2785,7 +2841,7 @@ st_collections_group_limits_vertical(void)
pc->limits.vertical = realloc(pc->limits.vertical, pc->limits.vertical_count * sizeof (Edje_Limit *));
if (!pc->limits.vertical || !el)
{
- ERR("%s: Error. Not enough memory.", progname);
+ ERR("Not enough memory.");
exit(-1);
}
@@ -2823,7 +2879,7 @@ st_collections_group_limits_horizontal(void)
pc->limits.horizontal = realloc(pc->limits.horizontal, pc->limits.horizontal_count * sizeof (Edje_Limit *));
if (!pc->limits.horizontal || !el)
{
- ERR("%s: Error. Not enough memory.", progname);
+ ERR("Not enough memory.");
exit(-1);
}
@@ -2917,8 +2973,8 @@ ob_collections_group_parts_part(void)
pc->parts = realloc(pc->parts, pc->parts_count * sizeof (Edje_Part *));
if (!pc->parts)
{
- ERR("%s: Error. Not enough memory.", progname);
- exit(-1);
+ ERR("Not enough memory.");
+ exit(-1);
}
current_part = pc->parts[pc->parts_count - 1] = ep;
@@ -2931,6 +2987,7 @@ ob_collections_group_parts_part(void)
ep->pointer_mode = EVAS_OBJECT_POINTER_MODE_AUTOGRAB;
ep->precise_is_inside = 0;
ep->use_alternate_font_metrics = 0;
+ ep->access = 0;
ep->clip_to_id = -1;
ep->dragable.confine_id = -1;
ep->dragable.event_id = -1;
@@ -2983,8 +3040,8 @@ st_collections_group_parts_part_name(void)
epp = (Edje_Part_Parser *)pc->parts[i];
if (!epp->can_override)
{
- ERR("%s: Error. parse error %s:%i. There is already a part of the name %s",
- progname, file_in, line - 1, ep->name);
+ ERR("parse error %s:%i. There is already a part of the name %s",
+ file_in, line - 1, ep->name);
exit(-1);
}
else
@@ -3020,6 +3077,7 @@ st_collections_group_parts_part_name(void)
@li TABLE
@li EXTERNAL
@li PROXY
+ @li SPACER
@endproperty
*/
static void
@@ -3041,6 +3099,7 @@ st_collections_group_parts_part_type(void)
"TABLE", EDJE_PART_TYPE_TABLE,
"EXTERNAL", EDJE_PART_TYPE_EXTERNAL,
"PROXY", EDJE_PART_TYPE_PROXY,
+ "SPACER", EDJE_PART_TYPE_SPACER,
NULL);
/* handle type change of inherited part */
@@ -3268,7 +3327,7 @@ st_collections_group_parts_part_precise_is_inside(void)
@effect
Only affects text and textblock parts, when enabled Edje will use
different size measurement functions. Disabled by default. (note from
- the author: I don't know what this is exactlu useful for?)
+ the author: I don't know what this is exactly useful for?)
@endproperty
*/
static void
@@ -3287,7 +3346,8 @@ st_collections_group_parts_part_use_alternate_font_metrics(void)
[another part's name]
@effect
Only renders the area of part that coincides with another part's
- container. Overflowing content will not be displayed.
+ container. Overflowing content will not be displayed. Note that
+ the part being clipped to can only be a rectangle part.
@endproperty
*/
static void
@@ -3551,7 +3611,7 @@ st_collections_group_parts_part_entry_mode(void)
Sets the selection mode for a textblock part to one of:
@li DEFAULT selection mode is what you would expect on any desktop. Press
mouse, drag and release to end.
- @li EXPLICITmode requires the application
+ @li EXPLICIT mode requires the application
controlling the edje object has to explicitly begin and end selection
modes, and the selection itself is dragable at both ends.
@endproperty
@@ -3614,6 +3674,25 @@ st_collections_group_parts_part_multiline(void)
/**
@page edcref
+ @property
+ access
+ @parameters
+ [1 or 0]
+ @effect
+ Specifies whether the part will use accessibility feature (1),
+ or not (0). It's set to 0 by default.
+ @endproperty
+*/
+static void
+st_collections_group_parts_part_access(void)
+{
+ check_arg_count(1);
+
+ current_part->access = parse_bool(0);
+}
+
+/**
+ @page edcref
@block
dragable
@context
@@ -3784,18 +3863,17 @@ static void ob_collections_group_parts_part_box_items_item(void)
if ((ep->type != EDJE_PART_TYPE_BOX) && (ep->type != EDJE_PART_TYPE_TABLE))
{
- ERR("%s: Error. parse error %s:%i. "
- "box attributes in non-BOX or TABLE part.",
- progname, file_in, line - 1);
- exit(-1);
+ ERR("parse error %s:%i. box attributes in non-BOX or TABLE part.",
+ file_in, line - 1);
+ exit(-1);
}
ep->items_count++;
ep->items = realloc(ep->items, sizeof (Edje_Pack_Element*) * ep->items_count);
if (!ep->items)
{
- ERR("%s: Error. Not enough memory.", progname);
- exit(-1);
+ ERR("Not enough memory.");
+ exit(-1);
}
item = mem_alloc(SZ(Edje_Pack_Element_Parser));
@@ -3849,9 +3927,8 @@ static void st_collections_group_parts_part_box_items_item_type(void)
s = parse_str(0);
if (strcmp(s, "GROUP"))
{
- ERR("%s: Error. parse error %s:%i. "
- "token %s not one of: GROUP.",
- progname, file_in, line - 1, s);
+ ERR("parse error %s:%i. token %s not one of: GROUP.",
+ file_in, line - 1, s);
exit(-1);
}
/* FIXME: handle the enum, once everything else is supported */
@@ -3892,8 +3969,8 @@ static void st_collections_group_parts_part_box_items_item_name(void)
pitem = (Edje_Pack_Element_Parser *)ep->items[i];
if (!pitem->can_override)
{
- ERR("%s: Error. parse error %s:%i. There is already a item of the name %s",
- progname, file_in, line - 1, item->name);
+ ERR("parse error %s:%i. There is already a item of the name %s",
+ file_in, line - 1, item->name);
exit(-1);
}
else
@@ -4111,10 +4188,9 @@ static void st_collections_group_parts_part_table_items_item_position(void)
if (current_part->type != EDJE_PART_TYPE_TABLE)
{
- ERR("%s: Error. parse error %s:%i. "
- "table attributes in non-TABLE part.",
- progname, file_in, line - 1);
- exit(-1);
+ ERR("parse error %s:%i. table attributes in non-TABLE part.",
+ file_in, line - 1);
+ exit(-1);
}
current_item->col = parse_int_range(0, 0, 0xffff);
@@ -4138,10 +4214,9 @@ static void st_collections_group_parts_part_table_items_item_span(void)
if (current_part->type != EDJE_PART_TYPE_TABLE)
{
- ERR("%s: Error. parse error %s:%i. "
- "table attributes in non-TABLE part.",
- progname, file_in, line - 1);
- exit(-1);
+ ERR("parse error %s:%i. table attributes in non-TABLE part.",
+ file_in, line - 1);
+ exit(-1);
}
current_item->colspan = parse_int_range(0, 1, 0xffff);
@@ -4196,17 +4271,18 @@ ob_collections_group_parts_part_description(void)
if (!ep->default_desc)
{
- current_desc = ep->default_desc = ed;
+ current_desc = ep->default_desc = ed;
}
else
{
- ep->other.desc_count++;
- ep->other.desc = realloc(ep->other.desc,
- sizeof (Edje_Part_Description_Common*) * ep->other.desc_count);
- current_desc = ep->other.desc[ep->other.desc_count - 1] = ed;
+ ep->other.desc_count++;
+ ep->other.desc = realloc(ep->other.desc,
+ sizeof (Edje_Part_Description_Common*) * ep->other.desc_count);
+ current_desc = ep->other.desc[ep->other.desc_count - 1] = ed;
}
ed->visible = 1;
+ ed->limit = 0;
ed->align.x = FROM_DOUBLE(0.5);
ed->align.y = FROM_DOUBLE(0.5);
ed->min.w = 0;
@@ -4284,29 +4360,31 @@ st_collections_group_parts_part_description_inherit(void)
if (!ed->state.name)
{
- ERR("%s: Error. parse error %s:%i. "
- "inherit may only be used after state",
- progname, file_in, line - 1);
+ ERR("parse error %s:%i. inherit may only be used after state",
+ file_in, line - 1);
exit(-1);
}
parent = parent_desc;
if (!parent)
{
- check_arg_count(2);
+ check_min_arg_count(1);
/* inherit may not be used in the default description */
if (!ep->other.desc_count)
{
- ERR("%s: Error. parse error %s:%i. "
+ ERR("parse error %s:%i. "
"inherit may not be used in the default description",
- progname, file_in, line - 1);
+ file_in, line - 1);
exit(-1);
}
/* find the description that we inherit from */
parent_name = parse_str(0);
- parent_val = parse_float_range(1, 0.0, 1.0);
+ if (get_arg_count() == 2)
+ parent_val = parse_float_range(1, 0.0, 1.0);
+ else
+ parent_val = 0.0;
if (!strcmp (parent_name, "default") && parent_val == 0.0)
parent = ep->default_desc;
@@ -4343,9 +4421,9 @@ st_collections_group_parts_part_description_inherit(void)
if (!parent)
{
- ERR("%s: Error. parse error %s:%i. "
- "cannot find referenced part state %s %lf",
- ep->name, file_in, line - 1, parent_name, parent_val);
+ ERR("parse error %s:%i. "
+ "cannot find referenced part %s state %s %lf",
+ file_in, line - 1, ep->name, parent_name, parent_val);
exit(-1);
}
@@ -4377,6 +4455,7 @@ st_collections_group_parts_part_description_inherit(void)
ed->color_class = STRDUP(ed->color_class);
switch (ep->type)
{
+ case EDJE_PART_TYPE_SPACER:
case EDJE_PART_TYPE_RECTANGLE:
case EDJE_PART_TYPE_SWALLOW:
case EDJE_PART_TYPE_GROUP:
@@ -4503,9 +4582,8 @@ st_collections_group_parts_part_description_source(void)
if (current_part->type != EDJE_PART_TYPE_PROXY)
{
- ERR("%s: Error. parse error %s:%i. "
- "source attributes in non-PROXY part.",
- progname, file_in, line - 1);
+ ERR("parse error %s:%i. source attributes in non-PROXY part.",
+ file_in, line - 1);
exit(-1);
}
@@ -4538,7 +4616,7 @@ st_collections_group_parts_part_description_state(void)
Edje_Part_Description_Common *ed;
char *s;
- check_arg_count(2);
+ check_min_arg_count(1);
ep = current_part;
@@ -4548,14 +4626,16 @@ st_collections_group_parts_part_description_state(void)
s = parse_str(0);
if (!strcmp (s, "custom"))
{
- ERR("%s: Error. parse error %s:%i. "
- "invalid state name: '%s'.",
- progname, file_in, line - 1, s);
+ ERR("parse error %s:%i. invalid state name: '%s'.",
+ file_in, line - 1, s);
exit(-1);
}
ed->state.name = s;
- ed->state.value = parse_float_range(1, 0.0, 1.0);
+ if (get_arg_count() == 1)
+ ed->state.value = 0.0;
+ else
+ ed->state.value = parse_float_range(1, 0.0, 1.0);
if (ed != ep->default_desc)
{
@@ -4609,8 +4689,52 @@ st_collections_group_parts_part_description_visible(void)
{
check_arg_count(1);
+ if (current_part->type == EDJE_PART_TYPE_SPACER)
+ {
+ ERR("parse error %s:%i. SPACER part can't have a visibility defined",
+ file_in, line - 1);
+ exit(-1);
+ }
+
current_desc->visible = parse_bool(0);
}
+/**
+ @page edcref
+ @property
+ limit
+ @parameters
+ [NONE, WIDTH, HEIGHT or BOTH]
+ @effect
+ Emit a signal when the part size change from zero or to a zero size
+ ('limit,width,over', 'limit,width,zero'). By default no signal are
+ emitted.
+ @endproperty
+ @since 1.7.0
+*/
+static void
+st_collections_group_parts_part_description_limit(void)
+{
+ check_arg_count(1);
+
+ current_desc->limit = parse_enum(0,
+ "NONE", 0,
+ "WIDTH", 1,
+ "HEIGHT", 2,
+ "BOTH", 3);
+
+ if (current_desc->limit)
+ {
+ Edje_Part_Collection *pc;
+ int count;
+
+ pc = eina_list_data_get(eina_list_last(edje_collections));
+ count = pc->limits.parts_count++;
+ pc->limits.parts = realloc(pc->limits.parts,
+ pc->limits.parts_count * sizeof (Edje_Part_Limit));
+ data_queue_part_lookup(pc, current_part->name,
+ &(pc->limits.parts[count].part));
+ }
+}
/**
@page edcref
@@ -4685,9 +4809,9 @@ st_collections_group_parts_part_description_min(void)
if ((current_part->type != EDJE_PART_TYPE_IMAGE && current_part->type != EDJE_PART_TYPE_GROUP) ||
!tmp || strcmp(tmp, "SOURCE") != 0)
{
- ERR("%s: Error. parse error %s:%i. "
+ ERR("parse error %s:%i. "
"Only IMAGE and GROUP part can have a min: SOURCE; defined",
- progname, file_in, line - 1);
+ file_in, line - 1);
exit(-1);
}
@@ -4745,9 +4869,9 @@ st_collections_group_parts_part_description_max(void)
if (current_part->type != EDJE_PART_TYPE_IMAGE ||
!tmp || strcmp(tmp, "SOURCE") != 0)
{
- ERR("%s: Error. parse error %s:%i. "
+ ERR("parse error %s:%i. "
"Only IMAGE part can have a max: SOURCE; defined",
- progname, file_in, line - 1);
+ file_in, line - 1);
exit(-1);
}
@@ -4841,6 +4965,13 @@ st_collections_group_parts_part_description_color_class(void)
{
check_arg_count(1);
+ if (current_part->type == EDJE_PART_TYPE_SPACER)
+ {
+ ERR("parse error %s:%i. SPACER part can't have a color defined",
+ file_in, line - 1);
+ exit(-1);
+ }
+
current_desc->color_class = parse_str(0);
}
@@ -4859,6 +4990,13 @@ st_collections_group_parts_part_description_color(void)
{
check_arg_count(4);
+ if (current_part->type == EDJE_PART_TYPE_SPACER)
+ {
+ ERR("parse error %s:%i. SPACER part can't have a color defined",
+ file_in, line - 1);
+ exit(-1);
+ }
+
current_desc->color.r = parse_int_range(0, 0, 255);
current_desc->color.g = parse_int_range(1, 0, 255);
current_desc->color.b = parse_int_range(2, 0, 255);
@@ -4880,6 +5018,13 @@ st_collections_group_parts_part_description_color2(void)
{
check_arg_count(4);
+ if (current_part->type == EDJE_PART_TYPE_SPACER)
+ {
+ ERR("parse error %s:%i. SPACER part can't have a color defined",
+ file_in, line - 1);
+ exit(-1);
+ }
+
current_desc->color2.r = parse_int_range(0, 0, 255);
current_desc->color2.g = parse_int_range(1, 0, 255);
current_desc->color2.b = parse_int_range(2, 0, 255);
@@ -4909,8 +5054,9 @@ st_collections_group_parts_part_description_color3(void)
if (current_part->type != EDJE_PART_TYPE_TEXT
&& current_part->type != EDJE_PART_TYPE_TEXTBLOCK)
{
- ERR("%s: Error. Setting color3 in part %s from %s not of type TEXT or TEXTBLOCK.", progname, current_part->name, pc->part);
- exit(-1);
+ ERR("Setting color3 in part %s from %s not of type TEXT or TEXTBLOCK.",
+ current_part->name, pc->part);
+ exit(-1);
}
ed = (Edje_Part_Description_Text*)current_desc;
@@ -5190,10 +5336,10 @@ st_collections_group_parts_part_description_image_normal(void)
if (current_part->type != EDJE_PART_TYPE_IMAGE)
{
- ERR("%s: Error. parse error %s:%i. "
- "image attributes in non-IMAGE part.",
- progname, file_in, line - 1);
- exit(-1);
+ ERR("parse error %s:%i. "
+ "image attributes in non-IMAGE part.",
+ file_in, line - 1);
+ exit(-1);
}
ed = (Edje_Part_Description_Image*) current_desc;
@@ -5217,7 +5363,8 @@ st_collections_group_parts_part_description_image_normal(void)
@effect
Name of an image to be used in an animation loop, an image block can
have none, one or multiple tween declarations. Images are displayed in
- the order they are listed.
+ the order they are listed, during the transition to the state they are
+ declared in; the "normal" image is the final state.
@endproperty
*/
static void
@@ -5229,10 +5376,9 @@ st_collections_group_parts_part_description_image_tween(void)
if (current_part->type != EDJE_PART_TYPE_IMAGE)
{
- ERR("%s: Error. parse error %s:%i. "
- "image attributes in non-IMAGE part.",
- progname, file_in, line - 1);
- exit(-1);
+ ERR("parse error %s:%i. image attributes in non-IMAGE part.",
+ file_in, line - 1);
+ exit(-1);
}
ed = (Edje_Part_Description_Image*) current_desc;
@@ -5274,10 +5420,9 @@ st_collections_group_parts_part_description_image_border(void)
if (current_part->type != EDJE_PART_TYPE_IMAGE)
{
- ERR("%s: Error. parse error %s:%i. "
- "image attributes in non-IMAGE part.",
- progname, file_in, line - 1);
- exit(-1);
+ ERR("parse error %s:%i. image attributes in non-IMAGE part.",
+ file_in, line - 1);
+ exit(-1);
}
ed = (Edje_Part_Description_Image*) current_desc;
@@ -5309,10 +5454,9 @@ st_collections_group_parts_part_description_image_middle(void)
if (current_part->type != EDJE_PART_TYPE_IMAGE)
{
- ERR("%s: Error. parse error %s:%i. "
- "image attributes in non-IMAGE part.",
- progname, file_in, line - 1);
- exit(-1);
+ ERR("parse error %s:%i. image attributes in non-IMAGE part.",
+ file_in, line - 1);
+ exit(-1);
}
ed = (Edje_Part_Description_Image*) current_desc;
@@ -5352,10 +5496,9 @@ st_collections_group_parts_part_description_image_border_scale_by(void)
if (current_part->type != EDJE_PART_TYPE_IMAGE)
{
- ERR("%s: Error. parse error %s:%i. "
- "image attributes in non-IMAGE part.",
- progname, file_in, line - 1);
- exit(-1);
+ ERR("parse error %s:%i. image attributes in non-IMAGE part.",
+ file_in, line - 1);
+ exit(-1);
}
ed = (Edje_Part_Description_Image*) current_desc;
@@ -5383,10 +5526,9 @@ st_collections_group_parts_part_description_image_border_scale(void)
if (current_part->type != EDJE_PART_TYPE_IMAGE)
{
- ERR("%s: Error. parse error %s:%i. "
- "image attributes in non-IMAGE part.",
- progname, file_in, line - 1);
- exit(-1);
+ ERR("parse error %s:%i. image attributes in non-IMAGE part.",
+ file_in, line - 1);
+ exit(-1);
}
ed = (Edje_Part_Description_Image*) current_desc;
@@ -5417,10 +5559,9 @@ st_collections_group_parts_part_description_image_scale_hint(void)
if (current_part->type != EDJE_PART_TYPE_IMAGE)
{
- ERR("%s: Error. parse error %s:%i. "
- "image attributes in non-IMAGE part.",
- progname, file_in, line - 1);
- exit(-1);
+ ERR("parse error %s:%i. image attributes in non-IMAGE part.",
+ file_in, line - 1);
+ exit(-1);
}
ed = (Edje_Part_Description_Image*) current_desc;
@@ -5455,7 +5596,10 @@ st_collections_group_parts_part_description_image_scale_hint(void)
}
@description
The fill method is an optional block that defines the way an IMAGE part
- is going to be displayed inside its container.
+ is going to be displayed inside its container.
+ It can be used for tiling (repeating the image) or displaying only
+ part of an image. See @ref evas_object_image_fill_set() documentation
+ for more details.
@endblock
@property
@@ -5496,9 +5640,9 @@ st_collections_group_parts_part_description_fill_smooth(void)
}
default:
{
- ERR("%s: Error. parse error %s:%i. "
+ ERR("parse error %s:%i. "
"image and proxy attributes in non-IMAGE, non-PROXY `%s` part (%i).",
- progname, file_in, line - 1, current_part->name, current_part->type);
+ file_in, line - 1, current_part->name, current_part->type);
exit(-1);
}
}
@@ -5530,9 +5674,8 @@ st_collections_group_parts_part_description_fill_spread(void)
/* XXX this will need to include IMAGES when spread support is added to evas images */
{
- ERR("%s: Error. parse error %s:%i. "
- "fill.spread not supported yet.",
- progname, file_in, line - 1);
+ ERR("parse error %s:%i. fill.spread not supported yet.",
+ file_in, line - 1);
exit(-1);
}
@@ -5543,10 +5686,9 @@ st_collections_group_parts_part_description_fill_spread(void)
if (ep->type != EDJE_PART_TYPE_IMAGE)
{
- ERR("%s: Error. parse error %s:%i. "
- "image attributes in non-IMAGE part.",
- progname, file_in, line - 1);
- exit(-1);
+ ERR("parse error %s:%i. image attributes in non-IMAGE part.",
+ file_in, line - 1);
+ exit(-1);
}
ed = (Edje_Part_Description_Image*) ep->default_desc;
@@ -5596,9 +5738,9 @@ st_collections_group_parts_part_description_fill_type(void)
}
default:
{
- ERR("%s: Error. parse error %s:%i. "
+ ERR("parse error %s:%i. "
"image and proxy attributes in non-IMAGE, non-PROXY part.",
- progname, file_in, line - 1);
+ file_in, line - 1);
exit(-1);
}
}
@@ -5669,9 +5811,9 @@ st_collections_group_parts_part_description_fill_origin_relative(void)
}
default:
{
- ERR("%s: Error. parse error %s:%i. "
+ ERR("parse error %s:%i. "
"image and proxy attributes in non-IMAGE, non-PROXY part.",
- progname, file_in, line - 1);
+ file_in, line - 1);
exit(-1);
}
}
@@ -5719,9 +5861,9 @@ st_collections_group_parts_part_description_fill_origin_offset(void)
}
default:
{
- ERR("%s: Error. parse error %s:%i. "
+ ERR("parse error %s:%i. "
"image and proxy attributes in non-IMAGE, non-PROXY part.",
- progname, file_in, line - 1);
+ file_in, line - 1);
exit(-1);
}
}
@@ -5757,7 +5899,7 @@ st_collections_group_parts_part_description_fill_origin_offset(void)
@parameters
[width] [height]
@effect
- Takes a pair of decimal values that represent the a percentual value
+ Takes a pair of decimal values that represent the percentual value
of the original size of the element. For example, "0.5 0.5" represents
half the size, while "2.0 2.0" represents the double. The default
value is "1.0 1.0".
@@ -5792,9 +5934,9 @@ st_collections_group_parts_part_description_fill_size_relative(void)
}
default:
{
- ERR("%s: Error. parse error %s:%i. "
+ ERR("parse error %s:%i. "
"image and proxy attributes in non-IMAGE, non-PROXY part.",
- progname, file_in, line - 1);
+ file_in, line - 1);
exit(-1);
}
}
@@ -5842,9 +5984,9 @@ st_collections_group_parts_part_description_fill_size_offset(void)
}
default:
{
- ERR("%s: Error. parse error %s:%i. "
+ ERR("parse error %s:%i. "
"image and proxy attributes in non-IMAGE, non-PROXY part.",
- progname, file_in, line - 1);
+ file_in, line - 1);
exit(-1);
}
}
@@ -5906,10 +6048,9 @@ st_collections_group_parts_part_description_text_text(void)
if ((current_part->type != EDJE_PART_TYPE_TEXT) &&
(current_part->type != EDJE_PART_TYPE_TEXTBLOCK))
{
- ERR("%s: Error. parse error %s:%i. "
- "text attributes in non-TEXT part.",
- progname, file_in, line - 1);
- exit(-1);
+ ERR("parse error %s:%i. text attributes in non-TEXT part.",
+ file_in, line - 1);
+ exit(-1);
}
ed = (Edje_Part_Description_Text*) current_desc;
@@ -5953,10 +6094,9 @@ st_collections_group_parts_part_description_text_text_class(void)
if ((current_part->type != EDJE_PART_TYPE_TEXT) &&
(current_part->type != EDJE_PART_TYPE_TEXTBLOCK))
{
- ERR("%s: Error. parse error %s:%i. "
- "text attributes in non-TEXT part.",
- progname, file_in, line - 1);
- exit(-1);
+ ERR("parse error %s:%i. text attributes in non-TEXT part.",
+ file_in, line - 1);
+ exit(-1);
}
ed = (Edje_Part_Description_Text*) current_desc;
@@ -5986,10 +6126,9 @@ st_collections_group_parts_part_description_text_font(void)
if ((current_part->type != EDJE_PART_TYPE_TEXT) &&
(current_part->type != EDJE_PART_TYPE_TEXTBLOCK))
{
- ERR("%s: Error. parse error %s:%i. "
- "text attributes in non-TEXT part.",
- progname, file_in, line - 1);
- exit(-1);
+ ERR("parse error %s:%i. text attributes in non-TEXT part.",
+ file_in, line - 1);
+ exit(-1);
}
ed = (Edje_Part_Description_Text*) current_desc;
@@ -6019,10 +6158,9 @@ st_collections_group_parts_part_description_text_style(void)
if ((current_part->type != EDJE_PART_TYPE_TEXT) &&
(current_part->type != EDJE_PART_TYPE_TEXTBLOCK))
{
- ERR("%s: Error. parse error %s:%i. "
- "text attributes in non-TEXT part.",
- progname, file_in, line - 1);
- exit(-1);
+ ERR("parse error %s:%i. text attributes in non-TEXT part.",
+ file_in, line - 1);
+ exit(-1);
}
ed = (Edje_Part_Description_Text*) current_desc;
@@ -6053,10 +6191,9 @@ st_collections_group_parts_part_description_text_repch(void)
if ((current_part->type != EDJE_PART_TYPE_TEXT) &&
(current_part->type != EDJE_PART_TYPE_TEXTBLOCK))
{
- ERR("%s: Error. parse error %s:%i. "
- "text attributes in non-TEXT part.",
- progname, file_in, line - 1);
- exit(-1);
+ ERR("parse error %s:%i. text attributes in non-TEXT part.",
+ file_in, line - 1);
+ exit(-1);
}
ed = (Edje_Part_Description_Text*) current_desc;
@@ -6086,10 +6223,9 @@ st_collections_group_parts_part_description_text_size(void)
if ((current_part->type != EDJE_PART_TYPE_TEXT) &&
(current_part->type != EDJE_PART_TYPE_TEXTBLOCK))
{
- ERR("%s: Error. parse error %s:%i. "
- "text attributes in non-TEXT part.",
- progname, file_in, line - 1);
- exit(-1);
+ ERR("parse error %s:%i. text attributes in non-TEXT part.",
+ file_in, line - 1);
+ exit(-1);
}
ed = (Edje_Part_Description_Text*)current_desc;
@@ -6120,10 +6256,9 @@ st_collections_group_parts_part_description_text_size_range(void)
if ((current_part->type != EDJE_PART_TYPE_TEXT) &&
(current_part->type != EDJE_PART_TYPE_TEXTBLOCK))
{
- ERR("%s: Error. parse error %s:%i. "
- "text attributes in non-TEXT part.",
- progname, file_in, line - 1);
- exit(-1);
+ ERR("parse error %s:%i. text attributes in non-TEXT part.",
+ file_in, line - 1);
+ exit(-1);
}
ed = (Edje_Part_Description_Text*) current_desc;
@@ -6132,10 +6267,9 @@ st_collections_group_parts_part_description_text_size_range(void)
ed->text.size_range_max = parse_int_range(1, 0, 255);
if (ed->text.size_range_min > ed->text.size_range_max)
{
- ERR("%s: Error. parse error %s:%i. "
- "min size is bigger than max size.",
- progname, file_in, line - 1);
- exit(-1);
+ ERR("parse error %s:%i. min size is bigger than max size.",
+ file_in, line - 1);
+ exit(-1);
}
}
@@ -6161,10 +6295,9 @@ st_collections_group_parts_part_description_text_fit(void)
if ((current_part->type != EDJE_PART_TYPE_TEXT) &&
(current_part->type != EDJE_PART_TYPE_TEXTBLOCK))
{
- ERR("%s: Error. parse error %s:%i. "
- "text attributes in non-TEXT part.",
- progname, file_in, line - 1);
- exit(-1);
+ ERR("parse error %s:%i. text attributes in non-TEXT part.",
+ file_in, line - 1);
+ exit(-1);
}
ed = (Edje_Part_Description_Text*) current_desc;
@@ -6196,10 +6329,9 @@ st_collections_group_parts_part_description_text_min(void)
if ((current_part->type != EDJE_PART_TYPE_TEXT) &&
(current_part->type != EDJE_PART_TYPE_TEXTBLOCK))
{
- ERR("%s: Error. parse error %s:%i. "
- "text attributes in non-TEXT part.",
- progname, file_in, line - 1);
- exit(-1);
+ ERR("parse error %s:%i. text attributes in non-TEXT part.",
+ file_in, line - 1);
+ exit(-1);
}
ed = (Edje_Part_Description_Text*)current_desc;
@@ -6231,10 +6363,9 @@ st_collections_group_parts_part_description_text_max(void)
if ((current_part->type != EDJE_PART_TYPE_TEXT) &&
(current_part->type != EDJE_PART_TYPE_TEXTBLOCK))
{
- ERR("%s: Error. parse error %s:%i. "
- "text attributes in non-TEXT part.",
- progname, file_in, line - 1);
- exit(-1);
+ ERR("parse error %s:%i. text attributes in non-TEXT part.",
+ file_in, line - 1);
+ exit(-1);
}
ed = (Edje_Part_Description_Text*) current_desc;
@@ -6265,10 +6396,9 @@ st_collections_group_parts_part_description_text_align(void)
if ((current_part->type != EDJE_PART_TYPE_TEXT) &&
(current_part->type != EDJE_PART_TYPE_TEXTBLOCK))
{
- ERR("%s: Error. parse error %s:%i. "
- "text attributes in non-TEXT part.",
- progname, file_in, line - 1);
- exit(-1);
+ ERR("parse error %s:%i. text attributes in non-TEXT part.",
+ file_in, line - 1);
+ exit(-1);
}
ed = (Edje_Part_Description_Text*) current_desc;
@@ -6302,10 +6432,9 @@ st_collections_group_parts_part_description_text_source(void)
if ((current_part->type != EDJE_PART_TYPE_TEXT) &&
(current_part->type != EDJE_PART_TYPE_TEXTBLOCK))
{
- ERR("%s: Error. parse error %s:%i. "
- "text attributes in non-TEXT part.",
- progname, file_in, line - 1);
- exit(-1);
+ ERR("parse error %s:%i. text attributes in non-TEXT part.",
+ file_in, line - 1);
+ exit(-1);
}
ed = (Edje_Part_Description_Text*) current_desc;
@@ -6344,10 +6473,9 @@ st_collections_group_parts_part_description_text_text_source(void)
if ((current_part->type != EDJE_PART_TYPE_TEXT) &&
(current_part->type != EDJE_PART_TYPE_TEXTBLOCK))
{
- ERR("%s: Error. parse error %s:%i. "
- "text attributes in non-TEXT part.",
- progname, file_in, line - 1);
- exit(-1);
+ ERR("parse error %s:%i. text attributes in non-TEXT part.",
+ file_in, line - 1);
+ exit(-1);
}
ed = (Edje_Part_Description_Text*) current_desc;
@@ -6384,10 +6512,9 @@ st_collections_group_parts_part_description_text_elipsis(void)
if ((current_part->type != EDJE_PART_TYPE_TEXT) &&
(current_part->type != EDJE_PART_TYPE_TEXTBLOCK))
{
- ERR("%s: Error. parse error %s:%i. "
- "text attributes in non-TEXT part.",
- progname, file_in, line - 1);
- exit(-1);
+ ERR("parse error %s:%i. text attributes in non-TEXT part.",
+ file_in, line - 1);
+ exit(-1);
}
ed = (Edje_Part_Description_Text*) current_desc;
@@ -6480,10 +6607,9 @@ static void st_collections_group_parts_part_description_box_layout(void)
if (current_part->type != EDJE_PART_TYPE_BOX)
{
- ERR("%s: Error. parse error %s:%i. "
- "box attributes in non-BOX part.",
- progname, file_in, line - 1);
- exit(-1);
+ ERR("parse error %s:%i. box attributes in non-BOX part.",
+ file_in, line - 1);
+ exit(-1);
}
ed = (Edje_Part_Description_Box*) current_desc;
@@ -6501,10 +6627,9 @@ static void st_collections_group_parts_part_description_box_align(void)
if (current_part->type != EDJE_PART_TYPE_BOX)
{
- ERR("%s: Error. parse error %s:%i. "
- "box attributes in non-BOX part.",
- progname, file_in, line - 1);
- exit(-1);
+ ERR("parse error %s:%i. box attributes in non-BOX part.",
+ file_in, line - 1);
+ exit(-1);
}
ed = (Edje_Part_Description_Box*) current_desc;
@@ -6521,10 +6646,9 @@ static void st_collections_group_parts_part_description_box_padding(void)
if (current_part->type != EDJE_PART_TYPE_BOX)
{
- ERR("%s: Error. parse error %s:%i. "
- "box attributes in non-BOX part.",
- progname, file_in, line - 1);
- exit(-1);
+ ERR("parse error %s:%i. box attributes in non-BOX part.",
+ file_in, line - 1);
+ exit(-1);
}
ed = (Edje_Part_Description_Box*) current_desc;
@@ -6542,10 +6666,9 @@ st_collections_group_parts_part_description_box_min(void)
if (current_part->type != EDJE_PART_TYPE_BOX)
{
- ERR("%s: Error. parse error %s:%i. "
- "box attributes in non-BOX part.",
- progname, file_in, line - 1);
- exit(-1);
+ ERR("parse error %s:%i. box attributes in non-BOX part.",
+ file_in, line - 1);
+ exit(-1);
}
ed = (Edje_Part_Description_Box*) current_desc;
@@ -6629,10 +6752,9 @@ static void st_collections_group_parts_part_description_table_homogeneous(void)
if (current_part->type != EDJE_PART_TYPE_TABLE)
{
- ERR("%s: Error. parse error %s:%i. "
- "table attributes in non-TABLE part.",
- progname, file_in, line - 1);
- exit(-1);
+ ERR("parse error %s:%i. table attributes in non-TABLE part.",
+ file_in, line - 1);
+ exit(-1);
}
ed = (Edje_Part_Description_Table*) current_desc;
@@ -6652,10 +6774,9 @@ static void st_collections_group_parts_part_description_table_align(void)
if (current_part->type != EDJE_PART_TYPE_TABLE)
{
- ERR("%s: Error. parse error %s:%i. "
- "table attributes in non-TABLE part.",
- progname, file_in, line - 1);
- exit(-1);
+ ERR("parse error %s:%i. table attributes in non-TABLE part.",
+ file_in, line - 1);
+ exit(-1);
}
ed = (Edje_Part_Description_Table*) current_desc;
@@ -6672,10 +6793,9 @@ static void st_collections_group_parts_part_description_table_padding(void)
if (current_part->type != EDJE_PART_TYPE_TABLE)
{
- ERR("%s: Error. parse error %s:%i. "
- "table attributes in non-TABLE part.",
- progname, file_in, line - 1);
- exit(-1);
+ ERR("parse error %s:%i. table attributes in non-TABLE part.",
+ file_in, line - 1);
+ exit(-1);
}
ed = (Edje_Part_Description_Table*) current_desc;
@@ -6693,10 +6813,9 @@ st_collections_group_parts_part_description_table_min(void)
if (current_part->type != EDJE_PART_TYPE_TABLE)
{
- ERR("%s: Error. parse error %s:%i. "
- "box attributes in non-TABLE part.",
- progname, file_in, line - 1);
- exit(-1);
+ ERR("parse error %s:%i. box attributes in non-TABLE part.",
+ file_in, line - 1);
+ exit(-1);
}
ed = (Edje_Part_Description_Table*) current_desc;
@@ -6977,7 +7096,7 @@ st_collections_group_parts_part_description_map_rotation_x(void)
@parameters
[Y degrees]
@effect
- This sets the rotation around the u axis of the part considering
+ This sets the rotation around the y axis of the part considering
the center set. In degrees.
@endproperty
*/
@@ -7102,10 +7221,9 @@ _st_collections_group_parts_part_description_params(Edje_External_Param_Type typ
if (current_part->type != EDJE_PART_TYPE_EXTERNAL)
{
- ERR("%s: Error. parse error %s:%i. "
- "params in non-EXTERNAL part.",
- progname, file_in, line - 1);
- exit(-1);
+ ERR("parse error %s:%i. params in non-EXTERNAL part.",
+ file_in, line - 1);
+ exit(-1);
}
ed = (Edje_Part_Description_External*) current_desc;
@@ -7147,8 +7265,8 @@ _st_collections_group_parts_part_description_params(Edje_External_Param_Type typ
param->s = parse_str(1);
break;
default:
- ERR("%s: Error. parse error %s:%i. Invalid param type.\n",
- progname, file_in, line - 1);
+ ERR("parse error %s:%i. Invalid param type.",
+ file_in, line - 1);
break;
}
@@ -7471,7 +7589,10 @@ st_collections_group_programs_program_action(void)
if (ep->action == EDJE_ACTION_TYPE_STATE_SET)
{
ep->state = parse_str(1);
- ep->value = parse_float_range(2, 0.0, 1.0);
+ if (get_arg_count() == 1)
+ ep->value = 0.0;
+ else
+ ep->value = parse_float_range(2, 0.0, 1.0);
}
else if (ep->action == EDJE_ACTION_TYPE_SIGNAL_EMIT)
{
@@ -7489,8 +7610,7 @@ st_collections_group_programs_program_action(void)
break;
if (i == (int)(edje_file->sound_dir->samples_count - 1))
{
- ERR("%s: Error. No Sample name %s exist.", progname,
- ep->sample_name);
+ ERR("No Sample name %s exist.", ep->sample_name);
exit(-1);
}
}
@@ -7507,8 +7627,7 @@ st_collections_group_programs_program_action(void)
break;
if (i == (int)(edje_file->sound_dir->tones_count - 1))
{
- ERR("%s: Error. No Tone name %s exist.", progname,
- ep->tone_name);
+ ERR("No Tone name %s exist.", ep->tone_name);
exit(-1);
}
}
@@ -7605,13 +7724,13 @@ st_collections_group_programs_program_action(void)
ACCEL_FAC, DECEL_FAC and SIN_FAC need the extra optional
"interp val 1" to determine the "factor" of curviness. 1.0 is the same
as their non-factor counterparts, where 0.0 is equal to linear.
- numbers higher than one make the curve angles steeper with a more
- prnounced curve point.
+ Numbers higher than one make the curve angles steeper with a more
+ pronounced curve point.
DIVIS, BOUNCE and SPRING also require "interp val 2" in addition
to "interp val 1".
- DIVIS uses val 1 as the initial graident start
+ DIVIS uses val 1 as the initial gradient start
(0.0 is horizontal, 1.0 is diagonal (linear), 2.0 is twice the
gradient of linear etc.). val 2 is interpreted as an integer factor
defining how much the value swings "outside" the gradient only to come
@@ -7619,7 +7738,7 @@ st_collections_group_programs_program_action(void)
to linear interpolation. Note that DIVIS can exceed 1.0
BOUNCE uses val 2 as the number of bounces (so its rounded down to
- the nearest integer value), with val 2 determining how much the
+ the nearest integer value), with val 1 determining how much the
bounce decays, with 0.0 giving linear decay per bounce, and higher
values giving much more decay.
@@ -7672,9 +7791,8 @@ st_collections_group_programs_program_transition(void)
current_program->tween.mode |= EDJE_TWEEN_MODE_OPT_FROM_CURRENT;
else if (get_arg_count() != 2)
{
- ERR("%s: Error. parse error %s:%i. "
- "Need 2rd parameter to set time",
- progname, file_in, line - 1);
+ ERR("parse error %s:%i. Need 2rd parameter to set time",
+ file_in, line - 1);
exit(-1);
}
}
@@ -7690,9 +7808,8 @@ st_collections_group_programs_program_transition(void)
current_program->tween.mode |= EDJE_TWEEN_MODE_OPT_FROM_CURRENT;
else if (get_arg_count() != 3)
{
- ERR("%s: Error. parse error %s:%i. "
- "Need 3rd parameter to set factor",
- progname, file_in, line - 1);
+ ERR("parse error %s:%i. Need 3rd parameter to set factor",
+ file_in, line - 1);
exit(-1);
}
current_program->tween.v1 = FROM_DOUBLE(parse_float_range(2, 0.0, 999999999.0));
@@ -7709,9 +7826,9 @@ st_collections_group_programs_program_transition(void)
current_program->tween.mode |= EDJE_TWEEN_MODE_OPT_FROM_CURRENT;
else if (get_arg_count() != 4)
{
- ERR("%s: Error. parse error %s:%i. "
+ ERR("parse error %s:%i. "
"Need 3rd and 4th parameters to set factor and counts",
- progname, file_in, line - 1);
+ file_in, line - 1);
exit(-1);
}
current_program->tween.v1 = FROM_DOUBLE(parse_float_range(2, 0.0, 999999999.0));
@@ -7781,9 +7898,8 @@ st_collections_group_programs_program_target(void)
data_queue_part_lookup(pc, name, &(et->id));
else
{
- ERR("%s: Error. parse error %s:%i. "
- "target may only be used after action",
- progname, file_in, line - 1);
+ ERR("parse error %s:%i. target may only be used after action",
+ file_in, line - 1);
exit(-1);
}
free(name);
@@ -7896,8 +8012,8 @@ ob_collections_group_programs_program_script(void)
cp->original = strdup(s);
if (cd->shared && cd->is_lua)
{
- ERR("%s: Error. parse error %s:%i. You're trying to mix Embryo and Lua scripting in the same group",
- progname, file_in, line - 1);
+ ERR("parse error %s:%i. You're trying to mix Embryo and Lua scripting in the same group",
+ file_in, line - 1);
exit(-1);
}
cd->is_lua = 0;
diff --git a/src/bin/edje_cc_mem.c b/src/bin/edje_cc_mem.c
index d2d4ae0..e1fa239 100644
--- a/src/bin/edje_cc_mem.c
+++ b/src/bin/edje_cc_mem.c
@@ -14,8 +14,8 @@ mem_alloc(size_t size)
mem = calloc(1, size);
if (mem) return mem;
- ERR("%s: Error. %s:%i memory allocation of %zu bytes failed. %s",
- progname, file_in, line, size, strerror(errno));
+ ERR("%s:%i memory allocation of %zu bytes failed. %s",
+ file_in, line, size, strerror(errno));
exit(-1);
return NULL;
}
@@ -27,8 +27,8 @@ mem_strdup(const char *s)
str = strdup(s);
if (str) return str;
- ERR("%s: Error. %s:%i memory allocation of %zu bytes failed. %s. string being duplicated: \"%s\"",
- progname, file_in, line, strlen(s) + 1, strerror(errno), s);
+ ERR("%s:%i memory allocation of %zu bytes failed. %s. string being duplicated: \"%s\"",
+ file_in, line, strlen(s) + 1, strerror(errno), s);
exit(-1);
return NULL;
}
diff --git a/src/bin/edje_cc_out.c b/src/bin/edje_cc_out.c
index d195d78..1c22637 100644
--- a/src/bin/edje_cc_out.c
+++ b/src/bin/edje_cc_out.c
@@ -111,6 +111,74 @@ struct _Code_Lookup
Eina_Bool set;
};
+typedef struct _Script_Lua_Writer Script_Lua_Writer;
+
+struct _Script_Lua_Writer
+{
+ char *buf;
+ int size;
+};
+
+typedef struct _Script_Write Script_Write;;
+typedef struct _Head_Write Head_Write;
+typedef struct _Fonts_Write Fonts_Write;
+typedef struct _Image_Write Image_Write;
+typedef struct _Sound_Write Sound_Write;
+typedef struct _Group_Write Group_Write;
+
+struct _Script_Write
+{
+ Eet_File *ef;
+ Code *cd;
+ int i;
+ Ecore_Exe *exe;
+ int tmpn_fd, tmpo_fd;
+ char tmpn[PATH_MAX];
+ char tmpo[PATH_MAX];
+ char *errstr;
+};
+
+struct _Head_Write
+{
+ Eet_File *ef;
+ char *errstr;
+};
+
+struct _Fonts_Write
+{
+ Eet_File *ef;
+ Font *fn;
+ char *errstr;
+};
+
+struct _Image_Write
+{
+ Eet_File *ef;
+ Edje_Image_Directory_Entry *img;
+ Evas_Object *im;
+ int w, h;
+ int alpha;
+ unsigned int *data;
+ char *path;
+ char *errstr;
+};
+
+struct _Sound_Write
+{
+ Eet_File *ef;
+ Edje_Sound_Sample *sample;
+ int i;
+};
+
+struct _Group_Write
+{
+ Eet_File *ef;
+ Edje_Part_Collection *pc;
+ char *errstr;
+};
+
+static int pending_threads = 0;
+
static void data_process_string(Edje_Part_Collection *pc, const char *prefix, char *s, void (*func)(Edje_Part_Collection *pc, char *name, char* ptr, int len));
Edje_File *edje_file = NULL;
@@ -131,22 +199,17 @@ static Eina_List *image_lookups = NULL;
static Eina_List *part_slave_lookups = NULL;
static Eina_List *image_slave_lookups= NULL;
-#define ABORT_WRITE(eet_file, file) \
- eet_close(eet_file); \
- unlink(file); \
- exit(-1);
-
void
-error_and_abort(Eet_File *ef, const char *fmt, ...)
+error_and_abort(Eet_File *ef __UNUSED__, const char *fmt, ...)
{
va_list ap;
- fprintf(stderr, "%s: Error. ", progname);
-
va_start(ap, fmt);
- vfprintf(stderr, fmt, ap);
+ eina_log_vprint(_edje_cc_log_dom, EINA_LOG_LEVEL_CRITICAL,
+ "unknown", "unknown", 0, fmt, ap);
va_end(ap);
- ABORT_WRITE(ef, file_out);
+ unlink(file_out);
+ exit(-1);
}
void
@@ -157,23 +220,22 @@ data_setup(void)
}
static void
-check_image_part_desc (Edje_Part_Collection *pc, Edje_Part *ep,
- Edje_Part_Description_Image *epd, Eet_File *ef)
+check_image_part_desc(Edje_Part_Collection *pc, Edje_Part *ep,
+ Edje_Part_Description_Image *epd, Eet_File *ef)
{
unsigned int i;
-
-#if 0 /* FIXME: This check sounds like not a useful one */
- if (epd->image.id == -1)
- ERR(ef, "Collection %s(%i): image attributes missing for "
- "part \"%s\", description \"%s\" %f\n",
+
+ /* FIXME: This check sounds like not a useful one */
+ if (epd->image.id == -1 && epd->common.visible)
+ WRN("Collection %s(%i): image attributes missing for "
+ "part \"%s\", description \"%s\" %f",
pc->part, pc->id, ep->name, epd->common.state.name, epd->common.state.value);
-#endif
for (i = 0; i < epd->image.tweens_count; ++i)
{
if (epd->image.tweens[i]->id == -1)
error_and_abort(ef, "Collection %i: tween image id missing for "
- "part \"%s\", description \"%s\" %f\n",
+ "part \"%s\", description \"%s\" %f",
pc->id, ep->name, epd->common.state.name, epd->common.state.value);
}
}
@@ -187,11 +249,11 @@ check_packed_items(Edje_Part_Collection *pc, Edje_Part *ep, Eet_File *ef)
{
if (ep->items[i]->type == EDJE_PART_TYPE_GROUP && !ep->items[i]->source)
error_and_abort(ef, "Collection %i: missing source on packed item "
- "of type GROUP in part \"%s\"\n",
+ "of type GROUP in part \"%s\"",
pc->id, ep->name);
if (ep->type == EDJE_PART_TYPE_TABLE && (ep->items[i]->col < 0 || ep->items[i]->row < 0))
error_and_abort(ef, "Collection %i: missing col/row on packed item "
- "for part \"%s\" of type TABLE\n",
+ "for part \"%s\" of type TABLE",
pc->id, ep->name);
}
}
@@ -200,18 +262,18 @@ static void
check_nameless_state(Edje_Part_Collection *pc, Edje_Part *ep, Edje_Part_Description_Common *ed, Eet_File *ef)
{
if (!ed->state.name)
- error_and_abort(ef, "Collection %i: description with state missing on part \"%s\"\n",
+ error_and_abort(ef, "Collection %i: description with state missing on part \"%s\"",
pc->id, ep->name);
}
static void
-check_part (Edje_Part_Collection *pc, Edje_Part *ep, Eet_File *ef)
+check_part(Edje_Part_Collection *pc, Edje_Part *ep, Eet_File *ef)
{
unsigned int i;
/* FIXME: check image set and sort them. */
if (!ep->default_desc)
error_and_abort(ef, "Collection %i: default description missing "
- "for part \"%s\"\n", pc->id, ep->name);
+ "for part \"%s\"", pc->id, ep->name);
for (i = 0; i < ep->other.desc_count; ++i)
check_nameless_state(pc, ep, ep->other.desc[i], ef);
@@ -226,10 +288,16 @@ check_part (Edje_Part_Collection *pc, Edje_Part *ep, Eet_File *ef)
else if ((ep->type == EDJE_PART_TYPE_BOX) ||
(ep->type == EDJE_PART_TYPE_TABLE))
check_packed_items(pc, ep, ef);
+
+ /* FIXME: When mask are supported remove this check */
+ if (ep->clip_to_id != -1 &&
+ pc->parts[ep->clip_to_id]->type != EDJE_PART_TYPE_RECTANGLE)
+ error_and_abort(ef, "Collection %i: clip_to point to a non RECT part '%s' !",
+ pc->id, pc->parts[ep->clip_to_id]->name);
}
static void
-check_program (Edje_Part_Collection *pc, Edje_Program *ep, Eet_File *ef)
+check_program(Edje_Part_Collection *pc, Edje_Program *ep, Eet_File *ef)
{
switch (ep->action)
{
@@ -240,17 +308,19 @@ check_program (Edje_Part_Collection *pc, Edje_Program *ep, Eet_File *ef)
case EDJE_ACTION_TYPE_DRAG_VAL_PAGE:
if (!ep->targets)
error_and_abort(ef, "Collection %i: target missing in program "
- "\"%s\"\n", pc->id, ep->name);
+ "\"%s\"", pc->id, ep->name);
break;
default:
break;
}
}
-static int
-data_write_header(Eet_File *ef)
+static void
+data_thread_head(void *data, Ecore_Thread *thread __UNUSED__)
{
+ Head_Write *hw = data;
int bytes = 0;
+ char buf[PATH_MAX];
if (edje_file)
{
@@ -258,147 +328,199 @@ data_write_header(Eet_File *ef)
{
Edje_Part_Collection_Directory_Entry *ce;
- /* copy aliases into collection directory */
EINA_LIST_FREE(aliases, ce)
{
Edje_Part_Collection_Directory_Entry *sce;
Eina_Iterator *it;
if (!ce->entry)
- error_and_abort(ef, "Collection %i: name missing.\n", ce->id);
+ {
+ snprintf(buf, sizeof(buf),
+ "Collection %i: name missing.", ce->id);
+ hw->errstr = strdup(buf);
+ return;
+ }
it = eina_hash_iterator_data_new(edje_file->collection);
EINA_ITERATOR_FOREACH(it, sce)
- if (ce->id == sce->id)
- {
- memcpy(&ce->count, &sce->count, sizeof (ce->count));
- break;
- }
+ {
+ if (ce->id == sce->id)
+ {
+ memcpy(&ce->count, &sce->count, sizeof (ce->count));
+ break;
+ }
+ }
if (!sce)
- error_and_abort(ef, "Collection %s (%i) can't find an correct alias.\n", ce->entry, ce->id);
-
+ {
+ snprintf(buf, sizeof(buf),
+ "Collection %s (%i) can't find an correct alias.",
+ ce->entry, ce->id);
+ hw->errstr = strdup(buf);
+ return;
+ }
eina_iterator_free(it);
-
eina_hash_direct_add(edje_file->collection, ce->entry, ce);
}
}
- bytes = eet_data_write(ef, edd_edje_file, "edje/file", edje_file, 1);
+ bytes = eet_data_write(hw->ef, edd_edje_file, "edje/file", edje_file,
+ compress_mode);
if (bytes <= 0)
- error_and_abort(ef, "Unable to write \"edje_file\" entry to \"%s\" \n",
- file_out);
+ {
+ snprintf(buf, sizeof(buf),
+ "Unable to write \"edje_file\" entry to \"%s\"",
+ file_out);
+ hw->errstr = strdup(buf);
+ return;
+ }
}
- if (verbose)
+ INF("Wrote %9i bytes (%4iKb) for \"edje_file\" header",
+ bytes, (bytes + 512) / 1024);
+}
+
+static void
+data_thread_head_end(void *data, Ecore_Thread *thread __UNUSED__)
+{
+ Head_Write *hw = data;
+
+ pending_threads--;
+ if (pending_threads <= 0) ecore_main_loop_quit();
+ if (hw->errstr)
{
- printf("%s: Wrote %9i bytes (%4iKb) for \"edje_file\" header\n",
- progname, bytes, (bytes + 512) / 1024);
+ error_and_abort(hw->ef, hw->errstr);
+ free(hw->errstr);
}
+ free(hw);
+}
- return bytes;
+static void
+data_write_header(Eet_File *ef)
+{
+ Head_Write *hw;
+
+ hw = calloc(1, sizeof(Head_Write));
+ hw->ef = ef;
+ pending_threads++;
+ if (threads)
+ ecore_thread_run(data_thread_head, data_thread_head_end, NULL, hw);
+ else
+ {
+ data_thread_head(hw, NULL);
+ data_thread_head_end(hw, NULL);
+ }
}
-static int
-data_write_fonts(Eet_File *ef, int *font_num, int *input_bytes, int *input_raw_bytes)
+static void
+data_thread_fonts(void *data, Ecore_Thread *thread __UNUSED__)
{
- Eina_Iterator *it;
+ Fonts_Write *fc = data;
+ Eina_List *ll;
+ Eina_File *f = NULL;
+ void *m = NULL;
int bytes = 0;
- int total_bytes = 0;
- Font *fn;
+ char buf[PATH_MAX];
+ char buf2[PATH_MAX];
- if (!edje_file->fonts)
- return 0;
+ f = eina_file_open(fc->fn->file, 0);
+ if (f)
+ {
+ using_file(fc->fn->file);
+ m = eina_file_map_all(f, EINA_FILE_SEQUENTIAL);
+ }
+ else
+ {
+ char *dat;
- it = eina_hash_iterator_data_new(edje_file->fonts);
- EINA_ITERATOR_FOREACH(it, fn)
+ EINA_LIST_FOREACH(fnt_dirs, ll, dat)
+ {
+ snprintf(buf, sizeof(buf), "%s/%s", dat, fc->fn->file);
+ f = eina_file_open(buf, 0);
+ if (f)
+ {
+ using_file(buf);
+ m = eina_file_map_all(f, EINA_FILE_SEQUENTIAL);
+ if (m) break;
+ eina_file_close(f);
+ f = NULL;
+ }
+ }
+ }
+ if (!m)
{
- void *fdata = NULL;
- int fsize = 0;
- Eina_List *ll;
- FILE *f;
+ if (f) eina_file_close(f);
+ snprintf(buf, sizeof(buf),
+ "Unable to load font part \"%s\" entry to %s",
+ fc->fn->file, file_out);
+ fc->errstr = strdup(buf);
+ return;
+ }
- f = fopen(fn->file, "rb");
- if (f)
- {
- long pos;
+ snprintf(buf, sizeof(buf), "edje/fonts/%s", fc->fn->name);
+ bytes = eet_write(fc->ef, buf, m, eina_file_size_get(f), compress_mode);
- fseek(f, 0, SEEK_END);
- pos = ftell(f);
- rewind(f);
- fdata = malloc(pos);
- if (fdata)
- {
- if (fread(fdata, pos, 1, f) != 1)
- error_and_abort(ef, "Unable to read all of font "
- "file \"%s\"\n", fn->file);
- fsize = pos;
- }
- fclose(f);
- }
- else
- {
- char *data;
+ if ((bytes <= 0) || eina_file_map_faulted(f, m))
+ {
+ eina_file_map_free(f, m);
+ eina_file_close(f);
+ snprintf(buf2, sizeof(buf2),
+ "Unable to write font part \"%s\" as \"%s\" "
+ "part entry to %s", fc->fn->file, buf, file_out);
+ fc->errstr = strdup(buf2);
+ return;
+ }
- EINA_LIST_FOREACH(fnt_dirs, ll, data)
- {
- char buf[4096];
+ INF("Wrote %9i bytes (%4iKb) for \"%s\" font entry \"%s\" compress: [real: %2.1f%%]",
+ bytes, (bytes + 512) / 1024, buf, fc->fn->file,
+ 100 - (100 * (double)bytes) / ((double)(eina_file_size_get(f)))
+ );
+ eina_file_map_free(f, m);
+ eina_file_close(f);
+}
- snprintf(buf, sizeof(buf), "%s/%s", data, fn->file);
- f = fopen(buf, "rb");
- if (f)
- {
- long pos;
-
- fseek(f, 0, SEEK_END);
- pos = ftell(f);
- rewind(f);
- fdata = malloc(pos);
- if (fdata)
- {
- if (fread(fdata, pos, 1, f) != 1)
- error_and_abort(ef, "Unable to read all of font "
- "file \"%s\"\n", buf);
- fsize = pos;
- }
- fclose(f);
- if (fdata) break;
- }
- }
- }
- if (!fdata)
- {
- error_and_abort(ef, "Unable to load font part \"%s\" entry "
- "to %s \n", fn->file, file_out);
- }
- else
- {
- char buf[4096];
+static void
+data_thread_fonts_end(void *data, Ecore_Thread *thread __UNUSED__)
+{
+ Fonts_Write *fc = data;
+ pending_threads--;
+ if (pending_threads <= 0) ecore_main_loop_quit();
+ if (fc->errstr)
+ {
+ error_and_abort(fc->ef, fc->errstr);
+ free(fc->errstr);
+ }
+ free(fc);
+}
- snprintf(buf, sizeof(buf), "edje/fonts/%s", fn->name);
- bytes = eet_write(ef, buf, fdata, fsize, 1);
- if (bytes <= 0)
- error_and_abort(ef, "Unable to write font part \"%s\" as \"%s\" "
- "part entry to %s \n", fn->file, buf, file_out);
+static void
+data_write_fonts(Eet_File *ef, int *font_num)
+{
+ Eina_Iterator *it;
+ Font *fn;
- *font_num += 1;
- total_bytes += bytes;
- *input_bytes += fsize;
- *input_raw_bytes += fsize;
+ if (!edje_file->fonts) return;
- if (verbose)
- {
- printf("%s: Wrote %9i bytes (%4iKb) for \"%s\" font entry \"%s\" compress: [real: %2.1f%%]\n",
- progname, bytes, (bytes + 512) / 1024, buf, fn->file,
- 100 - (100 * (double)bytes) / ((double)(fsize))
- );
- }
- free(fdata);
- }
+ it = eina_hash_iterator_data_new(edje_file->fonts);
+ EINA_ITERATOR_FOREACH(it, fn)
+ {
+ Fonts_Write *fc;
+
+ fc = calloc(1, sizeof(Fonts_Write));
+ if (!fc) continue;
+ fc->ef = ef;
+ fc->fn = fn;
+ pending_threads++;
+ if (threads)
+ ecore_thread_run(data_thread_fonts, data_thread_fonts_end, NULL, fc);
+ else
+ {
+ data_thread_fonts(fc, NULL);
+ data_thread_fonts_end(fc, NULL);
+ }
+ *font_num += 1;
}
eina_iterator_free(it);
-
- return total_bytes;
}
static void
@@ -445,6 +567,9 @@ error_and_abort_image_load_error(Eet_File *ef, const char *file, int error)
"pgm",
"ppm",
"pnm",
+ "bmp",
+ "ico",
+ "tga",
NULL
};
@@ -479,295 +604,354 @@ error_and_abort_image_load_error(Eet_File *ef, const char *file, int error)
}
show_err:
error_and_abort
- (ef, "Unable to load image \"%s\" used by file \"%s\": %s.%s\n",
+ (ef, "Unable to load image \"%s\" used by file \"%s\": %s.%s",
file, file_out, errmsg, hint);
}
-static int
-data_write_images(Eet_File *ef, int *image_num, int *input_bytes, int *input_raw_bytes)
+static void
+data_thread_image(void *data, Ecore_Thread *thread __UNUSED__)
{
- unsigned int i;
+ Image_Write *iw = data;
+ char buf[PATH_MAX], buf2[PATH_MAX];
+ unsigned int *start, *end;
+ Eina_Bool opaque = EINA_TRUE;
int bytes = 0;
- int total_bytes = 0;
- if ((edje_file) && (edje_file->image_dir))
+ if ((iw->data) && (iw->w > 0) && (iw->h > 0))
{
- Ecore_Evas *ee;
- Evas *evas;
- Edje_Image_Directory_Entry *img;
-
- ecore_init();
- ecore_evas_init();
-
- ee = ecore_evas_buffer_new(1, 1);
- if (!ee)
- error_and_abort(ef, "Cannot create buffer engine canvas for image "
- "load.\n");
-
- evas = ecore_evas_get(ee);
- for (i = 0; i < edje_file->image_dir->entries_count; i++)
- {
- img = &edje_file->image_dir->entries[i];
+ int mode, qual;
+
+ snprintf(buf, sizeof(buf), "edje/images/%i", iw->img->id);
+ qual = 80;
+ if ((iw->img->source_type == EDJE_IMAGE_SOURCE_TYPE_INLINE_PERFECT) &&
+ (iw->img->source_param == 0))
+ mode = 0; /* RAW */
+ else if ((iw->img->source_type == EDJE_IMAGE_SOURCE_TYPE_INLINE_PERFECT) &&
+ (iw->img->source_param == 1))
+ mode = 1; /* COMPRESS */
+ else
+ mode = 2; /* LOSSY */
+ if ((mode == 0) && (no_raw))
+ {
+ mode = 1; /* promote compression */
+ iw->img->source_param = 95;
+ }
+ if ((mode == 2) && (no_lossy)) mode = 1; /* demote compression */
+ if ((mode == 1) && (no_comp))
+ {
+ if (no_lossy) mode = 0; /* demote compression */
+ else if (no_raw)
+ {
+ iw->img->source_param = 90;
+ mode = 2; /* no choice. lossy */
+ }
+ }
+ if (mode == 2)
+ {
+ qual = iw->img->source_param;
+ if (qual < min_quality) qual = min_quality;
+ if (qual > max_quality) qual = max_quality;
+ }
+ if (iw->alpha)
+ {
+ start = (unsigned int *) iw->data;
+ end = start + (iw->w * iw->h);
+ while (start < end)
+ {
+ if ((*start & 0xff000000) != 0xff000000)
+ {
+ opaque = EINA_FALSE;
+ break;
+ }
+ start++;
+ }
+ if (opaque) iw->alpha = 0;
+ }
+ if (mode == 0)
+ bytes = eet_data_image_write(iw->ef, buf,
+ iw->data, iw->w, iw->h,
+ iw->alpha,
+ 0, 0, 0);
+ else if (mode == 1)
+ bytes = eet_data_image_write(iw->ef, buf,
+ iw->data, iw->w, iw->h,
+ iw->alpha,
+ compress_mode,
+ 0, 0);
+ else if (mode == 2)
+ bytes = eet_data_image_write(iw->ef, buf,
+ iw->data, iw->w, iw->h,
+ iw->alpha,
+ 0, qual, 1);
+ if (bytes <= 0)
+ {
+ snprintf(buf2, sizeof(buf2),
+ "Unable to write image part "
+ "\"%s\" as \"%s\" part entry to "
+ "%s", iw->img->entry, buf, file_out);
+ iw->errstr = strdup(buf2);
+ return;
+ }
+ }
+ else
+ {
+ snprintf(buf2, sizeof(buf2),
+ "Unable to load image part "
+ "\"%s\" as \"%s\" part entry to "
+ "%s", iw->img->entry, buf, file_out);
+ iw->errstr = strdup(buf2);
+ return;
+ }
- if (img->source_type == EDJE_IMAGE_SOURCE_TYPE_EXTERNAL
- || img->entry == NULL)
- {
- }
- else
- {
- Evas_Object *im;
- Eina_List *ll;
- char *data;
- int load_err = EVAS_LOAD_ERROR_NONE;
+ if (eina_log_domain_level_check(_edje_cc_log_dom, EINA_LOG_LEVEL_INFO))
+ {
+ struct stat st;
- im = NULL;
- EINA_LIST_FOREACH(img_dirs, ll, data)
- {
- char buf[4096];
-
- snprintf(buf, sizeof(buf), "%s/%s",
- data, img->entry);
- im = evas_object_image_add(evas);
- if (im)
- {
- evas_object_image_file_set(im, buf, NULL);
- load_err = evas_object_image_load_error_get(im);
- if (load_err == EVAS_LOAD_ERROR_NONE)
- break;
- evas_object_del(im);
- im = NULL;
- if (load_err != EVAS_LOAD_ERROR_DOES_NOT_EXIST)
- break;
- }
- }
- if ((!im) && (load_err == EVAS_LOAD_ERROR_DOES_NOT_EXIST))
- {
- im = evas_object_image_add(evas);
- if (im)
- {
- evas_object_image_file_set(im, img->entry, NULL);
- load_err = evas_object_image_load_error_get(im);
- if (load_err != EVAS_LOAD_ERROR_NONE)
- {
- evas_object_del(im);
- im = NULL;
- }
- }
- }
- if (im)
- {
- void *im_data;
- int im_w, im_h;
- int im_alpha;
- char buf[256];
-
- evas_object_image_size_get(im, &im_w, &im_h);
- im_alpha = evas_object_image_alpha_get(im);
- im_data = evas_object_image_data_get(im, 0);
- if ((im_data) && (im_w > 0) && (im_h > 0))
- {
- int mode, qual;
-
- snprintf(buf, sizeof(buf), "edje/images/%i", img->id);
- qual = 80;
- if ((img->source_type == EDJE_IMAGE_SOURCE_TYPE_INLINE_PERFECT) &&
- (img->source_param == 0))
- mode = 0; /* RAW */
- else if ((img->source_type == EDJE_IMAGE_SOURCE_TYPE_INLINE_PERFECT) &&
- (img->source_param == 1))
- mode = 1; /* COMPRESS */
- else
- mode = 2; /* LOSSY */
- if ((mode == 0) && (no_raw))
- {
- mode = 1; /* promote compression */
- img->source_param = 95;
- }
- if ((mode == 2) && (no_lossy)) mode = 1; /* demote compression */
- if ((mode == 1) && (no_comp))
- {
- if (no_lossy) mode = 0; /* demote compression */
- else if (no_raw)
- {
- img->source_param = 90;
- mode = 2; /* no choice. lossy */
- }
- }
- if (mode == 2)
- {
- qual = img->source_param;
- if (qual < min_quality) qual = min_quality;
- if (qual > max_quality) qual = max_quality;
- }
- if (mode == 0)
- bytes = eet_data_image_write(ef, buf,
- im_data, im_w, im_h,
- im_alpha,
- 0, 0, 0);
- else if (mode == 1)
- bytes = eet_data_image_write(ef, buf,
- im_data, im_w, im_h,
- im_alpha,
- 1, 0, 0);
- else if (mode == 2)
- bytes = eet_data_image_write(ef, buf,
- im_data, im_w, im_h,
- im_alpha,
- 0, qual, 1);
- if (bytes <= 0)
- error_and_abort(ef, "Unable to write image part "
- "\"%s\" as \"%s\" part entry to "
- "%s\n", img->entry, buf,
- file_out);
-
- *image_num += 1;
- total_bytes += bytes;
- }
- else
- {
- error_and_abort_image_load_error
- (ef, img->entry, load_err);
- }
+ if (!iw->path || (stat(iw->path, &st))) st.st_size = 0;
+ INF("Wrote %9i bytes (%4iKb) for \"%s\" image entry \"%s\" compress: [raw: %2.1f%%] [real: %2.1f%%]",
+ bytes, (bytes + 512) / 1024, buf, iw->img->entry,
+ 100 - (100 * (double)bytes) / ((double)(iw->w * iw->h * 4)),
+ 100 - (100 * (double)bytes) / ((double)(st.st_size))
+ );
+ }
+}
- if (verbose)
- {
- struct stat st;
- const char *file = NULL;
-
- evas_object_image_file_get(im, &file, NULL);
- if (!file || (stat(file, &st) != 0))
- st.st_size = 0;
- *input_bytes += st.st_size;
- *input_raw_bytes += im_w * im_h * 4;
- printf("%s: Wrote %9i bytes (%4iKb) for \"%s\" image entry \"%s\" compress: [raw: %2.1f%%] [real: %2.1f%%]\n",
- progname, bytes, (bytes + 512) / 1024, buf, img->entry,
- 100 - (100 * (double)bytes) / ((double)(im_w * im_h * 4)),
- 100 - (100 * (double)bytes) / ((double)(st.st_size))
- );
- }
- evas_object_del(im);
- }
- else
- {
- error_and_abort_image_load_error
- (ef, img->entry, load_err);
- }
- }
- }
- ecore_evas_free(ee);
- ecore_evas_shutdown();
- ecore_shutdown();
+static void
+data_thread_image_end(void *data, Ecore_Thread *thread __UNUSED__)
+{
+ Image_Write *iw = data;
+
+ pending_threads--;
+ if (pending_threads <= 0) ecore_main_loop_quit();
+ if (iw->errstr)
+ {
+ error_and_abort(iw->ef, iw->errstr);
+ free(iw->errstr);
}
+ if (iw->path) free(iw->path);
+ evas_object_del(iw->im);
+ free(iw);
+}
- return total_bytes;
+static void
+data_image_preload_done(void *data, Evas *e __UNUSED__, Evas_Object *o, void *event_info __UNUSED__)
+{
+ Image_Write *iw = data;
+
+ evas_object_image_size_get(o, &iw->w, &iw->h);
+ iw->alpha = evas_object_image_alpha_get(o);
+ iw->data = evas_object_image_data_get(o, 0);
+ if (threads)
+ ecore_thread_run(data_thread_image, data_thread_image_end, NULL, iw);
+ else
+ {
+ data_thread_image(iw, NULL);
+ data_thread_image_end(iw, NULL);
+ }
}
-static int
-data_write_sounds(Eet_File * ef, int *sound_num, int *input_bytes, int *input_raw_bytes)
+static void
+data_write_images(Eet_File *ef, int *image_num)
{
- int bytes = 0;
- int total_bytes = 0;
+ int i;
+ Ecore_Evas *ee;
+ Evas *evas;
- if ((edje_file) && (edje_file->sound_dir))
- {
- Eina_List *ll;
- Edje_Sound_Sample *sample;
-#ifdef HAVE_LIBSNDFILE
- Edje_Sound_Encode *enc_info;
-#endif
- char *dir_path = NULL;
- char snd_path[PATH_MAX];
- char sndid_str[15];
- void *fdata;
- FILE *fp = NULL;
- struct stat st;
- int size = 0;
- int i;
+ if (!((edje_file) && (edje_file->image_dir))) return;
- for (i = 0; i < (int)edje_file->sound_dir->samples_count; i++)
+ ecore_evas_init();
+ ee = ecore_evas_buffer_new(1, 1);
+ if (!ee)
+ error_and_abort(ef, "Cannot create buffer engine canvas for image load.");
+ evas = ecore_evas_get(ee);
+
+ for (i = 0; i < (int)edje_file->image_dir->entries_count; i++)
+ {
+ Edje_Image_Directory_Entry *img;
+
+ img = &edje_file->image_dir->entries[i];
+ if ((img->source_type == EDJE_IMAGE_SOURCE_TYPE_EXTERNAL) ||
+ (img->entry == NULL))
{
- sample = &edje_file->sound_dir->samples[i];
- memset(&st, 0, sizeof(struct stat));
+ }
+ else
+ {
+ Evas_Object *im;
+ Eina_List *ll;
+ char *s;
+ int load_err = EVAS_LOAD_ERROR_NONE;
+ Image_Write *iw;
- // Search the Sound file in all the -sd ( sound directory )
- EINA_LIST_FOREACH(snd_dirs, ll, dir_path)
+ iw = calloc(1, sizeof(Image_Write));
+ iw->ef = ef;
+ iw->img = img;
+ iw->im = im = evas_object_image_add(evas);
+ if (threads)
+ evas_object_event_callback_add(im,
+ EVAS_CALLBACK_IMAGE_PRELOADED,
+ data_image_preload_done,
+ iw);
+ EINA_LIST_FOREACH(img_dirs, ll, s)
{
- snprintf((char *)snd_path, sizeof(snd_path), "%s/%s", dir_path,
- sample->snd_src);
- stat(snd_path, &st);
- if (st.st_size) break;
- }
- if (!st.st_size)
- {
- snprintf((char *)snd_path, sizeof(snd_path), "%s",
- sample->snd_src);
- stat(snd_path, &st);
+ char buf[PATH_MAX];
+
+ snprintf(buf, sizeof(buf), "%s/%s", s, img->entry);
+ evas_object_image_file_set(im, buf, NULL);
+ load_err = evas_object_image_load_error_get(im);
+ if (load_err == EVAS_LOAD_ERROR_NONE)
+ {
+ *image_num += 1;
+ iw->path = strdup(buf);
+ pending_threads++;
+ if (threads)
+ evas_object_image_preload(im, 0);
+ using_file(buf);
+ if (!threads)
+ data_image_preload_done(iw, evas, im, NULL);
+ break;
+ }
}
- size = st.st_size;
- if (!size)
+ if (load_err != EVAS_LOAD_ERROR_NONE)
{
- ERR("%s: Error. Unable to load sound source file : %s",
- progname, sample->snd_src);
- exit(-1);
+ evas_object_image_file_set(im, img->entry, NULL);
+ load_err = evas_object_image_load_error_get(im);
+ if (load_err == EVAS_LOAD_ERROR_NONE)
+ {
+ *image_num += 1;
+ iw->path = strdup(img->entry);
+ pending_threads++;
+ if (threads)
+ evas_object_image_preload(im, 0);
+ using_file(img->entry);
+ if (!threads)
+ data_image_preload_done(iw, evas, im, NULL);
+ }
+ else
+ error_and_abort_image_load_error
+ (ef, img->entry, load_err);
}
+ }
+ }
+}
+
+static void
+data_thread_sounds(void *data, Ecore_Thread *thread __UNUSED__)
+{
+ Sound_Write *sw = data;
+ Eina_List *ll;
#ifdef HAVE_LIBSNDFILE
- enc_info = _edje_multisense_encode(snd_path, sample, sample->quality);
-
- stat(enc_info->file, &st);
- size = st.st_size;
- fp = fopen(enc_info->file, "rb");
-#else
- fp = fopen(snd_path, "rb");
+ Edje_Sound_Encode *enc_info;
#endif
- if (!fp)
- {
- ERR("%s: Error: Unable to load sound data of: %s",
- progname, sample->name);
- exit(-1);
- }
-
- snprintf(sndid_str, sizeof(sndid_str), "edje/sounds/%i", sample->id);
- fdata = malloc(size);
- if (!fdata)
- {
- ERR("%s: Error. %s:%i while allocating memory to load file \"%s\"",
- progname, file_in, line, snd_path);
- exit(-1);
- }
- if (fread(fdata, size, 1, fp))
- bytes = eet_write(ef, sndid_str, fdata, size, EINA_FALSE);
- free(fdata);
- fclose(fp);
-
+ char *dir_path = NULL;
+ char snd_path[PATH_MAX];
+ char sndid_str[15];
+ Eina_File *f = NULL;
+ void *m = NULL;
+ int bytes = 0;
+
+ // Search the Sound file in all the -sd ( sound directory )
+ EINA_LIST_FOREACH(snd_dirs, ll, dir_path)
+ {
+ snprintf((char *)snd_path, sizeof(snd_path), "%s/%s", dir_path,
+ sw->sample->snd_src);
+ f = eina_file_open(snd_path, 0);
+ if (f) break;
+ }
+ if (!f)
+ {
+ snprintf((char *)snd_path, sizeof(snd_path), "%s",
+ sw->sample->snd_src);
+ f = eina_file_open(snd_path, 0);
+ }
#ifdef HAVE_LIBSNDFILE
- //If encoded temporary file, delete it.
- if (enc_info->encoded) unlink(enc_info->file);
+ if (f) eina_file_close(f);
+ enc_info = _edje_multisense_encode(snd_path, sw->sample,
+ sw->sample->quality);
+ f = eina_file_open(enc_info->file, 0);
+ if (f) using_file(enc_info->file);
+#else
+ if (f) using_file(snd_path);
#endif
- *sound_num += 1;
- total_bytes += bytes;
- *input_bytes += size;
- *input_raw_bytes += size;
+ if (!f)
+ {
+ ERR("Unable to load sound data of: %s", sw->sample->name);
+ exit(-1);
+ }
- if (verbose)
- {
+ snprintf(sndid_str, sizeof(sndid_str), "edje/sounds/%i", sw->sample->id);
+ m = eina_file_map_all(f, EINA_FILE_WILLNEED);
+ if (m)
+ {
+ bytes = eet_write(sw->ef, sndid_str, m, eina_file_size_get(f),
+ EET_COMPRESSION_NONE);
+ if (eina_file_map_faulted(f, m))
+ {
+ ERR("File access error when reading '%s'",
+ eina_file_filename_get(f));
+ exit(-1);
+ }
+ eina_file_map_free(f, m);
+ }
+ eina_file_close(f);
+
+#ifdef HAVE_LIBSNDFILE
+ //If encoded temporary file, delete it.
+ if (enc_info->encoded) unlink(enc_info->file);
+#endif
#ifdef HAVE_LIBSNDFILE
- printf ("%s: Wrote %9i bytes (%4iKb) for \"%s\" %s sound entry"
- "\"%s\" \n", progname, bytes, (bytes + 512) / 1024,
- sndid_str, enc_info->comp_type, sample->name);
+ INF("Wrote %9i bytes (%4iKb) for \"%s\" %s sound entry \"%s\"",
+ bytes, (bytes + 512) / 1024,
+ sndid_str, enc_info->comp_type, sw->sample->name);
#else
- printf ("%s: Wrote %9i bytes (%4iKb) for \"%s\" %s sound entry"
- "\"%s\" \n", progname, bytes, (bytes + 512) / 1024,
- sndid_str, "RAW PCM", sample->name);
+ INF("Wrote %9i bytes (%4iKb) for \"%s\" %s sound entry \"%s\"",
+ bytes, (bytes + 512) / 1024,
+ sndid_str, "RAW PCM", sw->sample->name);
#endif
- }
+
#ifdef HAVE_LIBSNDFILE
- if ((enc_info->file) && (!enc_info->encoded)) eina_stringshare_del(enc_info->file);
- if (enc_info) free(enc_info);
- enc_info = NULL;
+ if ((enc_info->file) && (!enc_info->encoded))
+ eina_stringshare_del(enc_info->file);
+ if (enc_info) free(enc_info);
+ enc_info = NULL;
#endif
+}
+
+static void
+data_thread_sounds_end(void *data, Ecore_Thread *thread __UNUSED__)
+{
+ Sound_Write *sw = data;
+ pending_threads--;
+ if (pending_threads <= 0) ecore_main_loop_quit();
+ free(sw);
+}
+
+static void
+data_write_sounds(Eet_File *ef, int *sound_num)
+{
+ if ((edje_file) && (edje_file->sound_dir))
+ {
+ int i;
+
+ for (i = 0; i < (int)edje_file->sound_dir->samples_count; i++)
+ {
+ Sound_Write *sw;
+
+ sw = calloc(1, sizeof(Sound_Write));
+ if (!sw) continue;
+ sw->ef = ef;
+ sw->sample = &edje_file->sound_dir->samples[i];
+ sw->i = i;
+ *sound_num += 1;
+ pending_threads++;
+ if (threads)
+ ecore_thread_run(data_thread_sounds, data_thread_sounds_end, NULL, sw);
+ else
+ {
+ data_thread_sounds(sw, NULL);
+ data_thread_sounds_end(sw, NULL);
+ }
}
}
- return total_bytes;
}
static void
@@ -796,35 +980,73 @@ check_groups(Eet_File *ef)
}
}
-static int
+static void
+data_thread_group(void *data, Ecore_Thread *thread __UNUSED__)
+{
+ Group_Write *gw = data;
+ int bytes;
+ char buf[PATH_MAX];
+ char buf2[PATH_MAX];
+
+ snprintf(buf, sizeof(buf), "edje/collections/%i", gw->pc->id);
+ bytes = eet_data_write(gw->ef, edd_edje_part_collection, buf, gw->pc,
+ compress_mode);
+ return;
+ if (bytes <= 0)
+ {
+ snprintf(buf2, sizeof(buf2),
+ "Unable to write \"%s\" part entry to %s",
+ buf, file_out);
+ gw->errstr = strdup(buf2);
+ return;
+ }
+
+ INF("Wrote %9i bytes (%4iKb) for \"%s\" aka \"%s\" collection entry",
+ bytes, (bytes + 512) / 1024, buf, gw->pc->part);
+}
+
+static void
+data_thread_group_end(void *data, Ecore_Thread *thread __UNUSED__)
+{
+ Group_Write *gw = data;
+ pending_threads--;
+ if (pending_threads <= 0) ecore_main_loop_quit();
+ if (gw->errstr)
+ {
+ error_and_abort(gw->ef, gw->errstr);
+ free(gw->errstr);
+ }
+ free(gw);
+}
+
+static void
data_write_groups(Eet_File *ef, int *collection_num)
{
Eina_List *l;
Edje_Part_Collection *pc;
- int bytes = 0;
- int total_bytes = 0;
EINA_LIST_FOREACH(edje_collections, l, pc)
{
- char buf[4096];
-
- snprintf(buf, sizeof(buf), "edje/collections/%i", pc->id);
- bytes = eet_data_write(ef, edd_edje_part_collection, buf, pc, 1);
- if (bytes <= 0)
- error_and_abort(ef, "Error. Unable to write \"%s\" part entry "
- "to %s\n", buf, file_out);
-
- *collection_num += 1;
- total_bytes += bytes;
+ Group_Write *gw;
- if (verbose)
- {
- printf("%s: Wrote %9i bytes (%4iKb) for \"%s\" aka \"%s\" collection entry\n",
- progname, bytes, (bytes + 512) / 1024, buf, pc->part);
- }
+ gw = calloc(1, sizeof(Group_Write));
+ if (!gw)
+ {
+ error_and_abort(ef, "Cannot allocate memory for group writer");
+ return;
+ }
+ gw->ef = ef;
+ gw->pc = pc;
+ pending_threads++;
+ if (threads)
+ ecore_thread_run(data_thread_group, data_thread_group_end, NULL, gw);
+ else
+ {
+ data_thread_group(gw, NULL);
+ data_thread_group_end(gw, NULL);
+ }
+ *collection_num += 1;
}
-
- return total_bytes;
}
static void
@@ -833,7 +1055,7 @@ create_script_file(Eet_File *ef, const char *filename, const Code *cd, int fd)
FILE *f = fdopen(fd, "wb");
if (!f)
error_and_abort(ef, "Unable to open temp file \"%s\" for script "
- "compilation.\n", filename);
+ "compilation.", filename);
Eina_List *ll;
Code_Program *cp;
@@ -906,48 +1128,124 @@ create_script_file(Eet_File *ef, const char *filename, const Code *cd, int fd)
}
static void
-compile_script_file(Eet_File *ef, const char *source, const char *output,
- int script_num, int fd)
+data_thread_script(void *data, Ecore_Thread *thread __UNUSED__)
{
+ Script_Write *sc = data;
FILE *f;
- char buf[4096];
- int ret;
-
- snprintf(buf, sizeof(buf),
- "embryo_cc -i %s/include -o %s %s",
- eina_prefix_data_get(pfx), output, source);
- ret = system(buf);
-
- /* accept warnings in the embryo code */
- if (ret < 0 || ret > 1)
- error_and_abort(ef, "Compiling script code not clean.\n");
+ int size;
+ char buf[PATH_MAX];
- f = fdopen(fd, "rb");
+ f = fdopen(sc->tmpo_fd, "rb");
if (!f)
- error_and_abort(ef, "Unable to open script object \"%s\" for reading.\n",
- output);
+ {
+ snprintf(buf, sizeof(buf),
+ "Unable to open script object \"%s\" for reading.",
+ sc->tmpo);
+ sc->errstr = strdup(buf);
+ return;
+ }
fseek(f, 0, SEEK_END);
- int size = ftell(f);
+ size = ftell(f);
rewind(f);
if (size > 0)
{
- void *data = malloc(size);
+ void *dat = malloc(size);
- if (data)
+ if (dat)
{
- if (fread(data, size, 1, f) != 1)
- error_and_abort(ef, "Unable to read all of script object "
- "\"%s\"\n", output);
-
- snprintf(buf, sizeof(buf), "edje/scripts/embryo/compiled/%i", script_num);
- eet_write(ef, buf, data, size, 1);
- free(data);
+ if (fread(dat, size, 1, f) != 1)
+ {
+ snprintf(buf, sizeof(buf),
+ "Unable to read all of script object \"%s\"",
+ sc->tmpo);
+ sc->errstr = strdup(buf);
+ return;
+ }
+ snprintf(buf, sizeof(buf), "edje/scripts/embryo/compiled/%i",
+ sc->i);
+ eet_write(sc->ef, buf, dat, size, compress_mode);
+ free(dat);
}
+ else
+ {
+ snprintf(buf, sizeof(buf),
+ "Alloc failed for %lu bytes", (unsigned long)size);
+ sc->errstr = strdup(buf);
+ return;
+ }
}
-
fclose(f);
+
+ if (!no_save)
+ {
+ Eina_List *ll;
+ Code_Program *cp;
+
+ if (sc->cd->original)
+ {
+ snprintf(buf, PATH_MAX, "edje/scripts/embryo/source/%i", sc->i);
+ eet_write(sc->ef, buf, sc->cd->original,
+ strlen(sc->cd->original) + 1, compress_mode);
+ }
+ EINA_LIST_FOREACH(sc->cd->programs, ll, cp)
+ {
+ if (!cp->original) continue;
+ snprintf(buf, PATH_MAX, "edje/scripts/embryo/source/%i/%i",
+ sc->i, cp->id);
+ eet_write(sc->ef, buf, cp->original,
+ strlen(cp->original) + 1, compress_mode);
+ }
+ }
+
+ unlink(sc->tmpn);
+ unlink(sc->tmpo);
+ close(sc->tmpn_fd);
+ close(sc->tmpo_fd);
+}
+
+static void
+data_thread_script_end(void *data, Ecore_Thread *thread __UNUSED__)
+{
+ Script_Write *sc = data;
+ pending_threads--;
+ if (pending_threads <= 0) ecore_main_loop_quit();
+ if (sc->errstr)
+ {
+ error_and_abort(sc->ef, sc->errstr);
+ free(sc->errstr);
+ }
+ free(sc);
+}
+
+static Eina_Bool
+data_scripts_exe_del_cb(void *data __UNUSED__, int evtype __UNUSED__, void *evinfo)
+{
+ Script_Write *sc = data;
+ Ecore_Exe_Event_Del *ev = evinfo;
+
+ if (!ev->exe) return ECORE_CALLBACK_RENEW;
+ if (ecore_exe_data_get(ev->exe) != sc) return ECORE_CALLBACK_RENEW;
+ if (ev->exit_code != 0)
+ {
+ error_and_abort(sc->ef, "Compiling script code not clean.");
+ return ECORE_CALLBACK_CANCEL;
+ }
+ if (threads)
+ {
+ pending_threads++;
+ ecore_thread_run(data_thread_script, data_thread_script_end, NULL, sc);
+ }
+ else
+ {
+ pending_threads++;
+ data_thread_script(sc, NULL);
+ data_thread_script_end(sc, NULL);
+ }
+ pending_threads--;
+ if (pending_threads <= 0) ecore_main_loop_quit();
+ return ECORE_CALLBACK_CANCEL;
}
static void
@@ -965,82 +1263,57 @@ data_write_scripts(Eet_File *ef)
for (i = 0, l = codes; l; l = eina_list_next(l), i++)
{
- char tmpn[PATH_MAX];
- char tmpo[PATH_MAX];
- int fd;
Code *cd = eina_list_data_get(l);
+ Script_Write *sc;
+ char buf[PATH_MAX];
if (cd->is_lua)
continue;
if ((!cd->shared) && (!cd->programs))
continue;
-
- snprintf(tmpn, PATH_MAX, "%s/edje_cc.sma-tmp-XXXXXX", tmp_dir);
- fd = mkstemp(tmpn);
- if (fd < 0)
- error_and_abort(ef, "Unable to open temp file \"%s\" for script "
- "compilation.\n", tmpn);
-
- create_script_file(ef, tmpn, cd, fd);
-
- snprintf(tmpo, PATH_MAX, "%s/edje_cc.amx-tmp-XXXXXX", tmp_dir);
- fd = mkstemp(tmpo);
- if (fd < 0)
- {
- unlink(tmpn);
- error_and_abort(ef, "Unable to open temp file \"%s\" for script "
- "compilation.\n", tmpn);
- }
- compile_script_file(ef, tmpn, tmpo, i, fd);
-
- unlink(tmpn);
- unlink(tmpo);
-
- if (!no_save)
+ sc = calloc(1, sizeof(Script_Write));
+ sc->ef = ef;
+ sc->cd = cd;
+ sc->i = i;
+ snprintf(sc->tmpn, PATH_MAX, "%s/edje_cc.sma-tmp-XXXXXX", tmp_dir);
+ sc->tmpn_fd = mkstemp(sc->tmpn);
+ if (sc->tmpn_fd < 0)
+ error_and_abort(ef, "Unable to open temp file \"%s\" for script "
+ "compilation.", sc->tmpn);
+ snprintf(sc->tmpo, PATH_MAX, "%s/edje_cc.amx-tmp-XXXXXX", tmp_dir);
+ sc->tmpo_fd = mkstemp(sc->tmpo);
+ if (sc->tmpo_fd < 0)
{
- char buf[PATH_MAX];
- Eina_List *ll;
- Code_Program *cp;
-
- if (cd->original)
- {
- snprintf(buf, PATH_MAX, "edje/scripts/embryo/source/%i", i);
- eet_write(ef, buf, cd->original, strlen(cd->original) + 1, 1);
- }
- EINA_LIST_FOREACH(cd->programs, ll, cp)
- {
- if (!cp->original)
- continue;
- snprintf(buf, PATH_MAX, "edje/scripts/embryo/source/%i/%i", i,
- cp->id);
- eet_write(ef, buf, cp->original, strlen(cp->original) + 1, 1);
- }
+ unlink(sc->tmpn);
+ error_and_abort(ef, "Unable to open temp file \"%s\" for script "
+ "compilation.", sc->tmpn);
}
+ create_script_file(ef, sc->tmpn, cd, sc->tmpn_fd);
+ snprintf(buf, sizeof(buf),
+ "%s/embryo_cc -i %s/include -o %s %s",
+ eina_prefix_bin_get(pfx),
+ eina_prefix_data_get(pfx),
+ sc->tmpo, sc->tmpn);
+ pending_threads++;
+ sc->exe = ecore_exe_run(buf, sc);
+ ecore_event_handler_add(ECORE_EXE_EVENT_DEL,
+ data_scripts_exe_del_cb, sc);
}
}
-typedef struct _Edje_Lua_Script_Writer_Struct Edje_Lua_Script_Writer_Struct;
-
-struct _Edje_Lua_Script_Writer_Struct
-{
- char *buf;
- int size;
-};
-
#ifdef LUA_BINARY
static int
_edje_lua_script_writer(lua_State *L __UNUSED__, const void *chunk_buf, size_t chunk_size, void *_data)
{
- Edje_Lua_Script_Writer_Struct *data;
+ Script_Lua_Writer *data;
void *old;
- data = (Edje_Lua_Script_Writer_Struct *)_data;
+ data = (Script_Lua_Writer *)_data;
old = data->buf;
- data->buf = malloc (data->size + chunk_size);
- memcpy (data->buf, old, data->size);
- memcpy (&((data->buf)[data->size]), chunk_buf, chunk_size);
- if (old)
- free (old);
+ data->buf = malloc(data->size + chunk_size);
+ memcpy(data->buf, old, data->size);
+ memcpy(&((data->buf)[data->size]), chunk_buf, chunk_size);
+ if (old) free(old);
data->size += chunk_size;
return 0;
@@ -1048,216 +1321,285 @@ _edje_lua_script_writer(lua_State *L __UNUSED__, const void *chunk_buf, size_t c
#endif
void
-_edje_lua_error_and_abort(lua_State * L, int err_code, Eet_File *ef)
+_edje_lua_error_and_abort(lua_State *L, int err_code, Script_Write *sc)
{
+ char buf[PATH_MAX];
char *err_type;
-
+
switch (err_code)
{
- case LUA_ERRRUN:
+ case LUA_ERRRUN:
err_type = "runtime";
break;
- case LUA_ERRSYNTAX:
+ case LUA_ERRSYNTAX:
err_type = "syntax";
break;
- case LUA_ERRMEM:
+ case LUA_ERRMEM:
err_type = "memory allocation";
break;
- case LUA_ERRERR:
+ case LUA_ERRERR:
err_type = "error handler";
break;
- default:
+ default:
err_type = "unknown";
break;
}
- error_and_abort(ef, "Lua %s error: %s\n", err_type, lua_tostring(L, -1));
+ snprintf(buf, sizeof(buf),
+ "Lua %s error: %s", err_type, lua_tostring(L, -1));
+ sc->errstr = strdup(buf);
}
+static void
+data_thread_lua_script(void *data, Ecore_Thread *thread __UNUSED__)
+{
+ Script_Write *sc = data;
+ char buf[PATH_MAX];
+ lua_State *L;
+ int ln = 1;
+ luaL_Buffer b;
+ Script_Lua_Writer dat;
+ Eina_List *ll;
+ Code_Program *cp;
+#ifdef LUA_BINARY
+ int err_code;
+#endif
+
+ L = luaL_newstate();
+ if (!L)
+ {
+ snprintf(buf, sizeof(buf),
+ "Lua error: Lua state could not be initialized");
+ sc->errstr = strdup(buf);
+ return;
+ }
+
+ luaL_buffinit(L, &b);
+
+ dat.buf = NULL;
+ dat.size = 0;
+ if (sc->cd->shared)
+ {
+ while (ln < (sc->cd->l1 - 1))
+ {
+ luaL_addchar(&b, '\n');
+ ln++;
+ }
+ luaL_addstring(&b, sc->cd->shared);
+ ln += sc->cd->l2 - sc->cd->l1;
+ }
+
+ EINA_LIST_FOREACH(sc->cd->programs, ll, cp)
+ {
+ if (cp->script)
+ {
+ while (ln < (cp->l1 - 1))
+ {
+ luaL_addchar(&b, '\n');
+ ln++;
+ }
+ luaL_addstring(&b, "_G[");
+ lua_pushnumber(L, cp->id);
+ luaL_addvalue(&b);
+ luaL_addstring(&b, "] = function (ed, signal, source)");
+ luaL_addstring(&b, cp->script);
+ luaL_addstring(&b, "end\n");
+ ln += cp->l2 - cp->l1 + 1;
+ }
+ }
+ luaL_pushresult(&b);
+#ifdef LUA_BINARY
+ if (err_code = luaL_loadstring(L, lua_tostring (L, -1)))
+ {
+ _edje_lua_error_and_abort(L, err_code, sc);
+ return;
+ }
+ lua_dump(L, _edje_lua_script_writer, &dat);
+#else // LUA_PLAIN_TEXT
+ dat.buf = (char *)lua_tostring(L, -1);
+ dat.size = strlen(dat.buf);
+#endif
+ //printf("lua chunk size: %d\n", dat.size);
+
+ /*
+ * TODO load and test Lua chunk
+ */
+
+ /*
+ if (luaL_loadbuffer(L, globbuf, globbufsize, "edje_lua_script"))
+ printf("lua load error: %s\n", lua_tostring (L, -1));
+ if (lua_pcall(L, 0, 0, 0))
+ printf("lua call error: %s\n", lua_tostring (L, -1));
+ */
+
+ snprintf(buf, sizeof(buf), "edje/scripts/lua/%i", sc->i);
+ if (eet_write(sc->ef, buf, dat.buf, dat.size, compress_mode) <= 0)
+ {
+ snprintf(buf, sizeof(buf),
+ "Unable to write script %i", sc->i);
+ sc->errstr = strdup(buf);
+ return;
+ }
+#ifdef LUA_BINARY
+ free(dat.buf);
+#endif
+ lua_close(L);
+}
+
+static void
+data_thread_lua_script_end(void *data, Ecore_Thread *thread __UNUSED__)
+{
+ Script_Write *sc = data;
+ pending_threads--;
+ if (pending_threads <= 0) ecore_main_loop_quit();
+ if (sc->errstr)
+ {
+ error_and_abort(sc->ef, sc->errstr);
+ free(sc->errstr);
+ }
+ free(sc);
+}
static void
data_write_lua_scripts(Eet_File *ef)
{
Eina_List *l;
- Eina_List *ll;
- Code_Program *cp;
int i;
for (i = 0, l = codes; l; l = eina_list_next(l), i++)
{
- char buf[4096];
- Code *cd;
- lua_State *L;
- int ln = 1;
- luaL_Buffer b;
- Edje_Lua_Script_Writer_Struct data;
-#ifdef LUA_BINARY
- int err_code;
-#endif
+ Code *cd;
+ Script_Write *sc;
+
+ cd = (Code *)eina_list_data_get(l);
+ if (!cd->is_lua)
+ continue;
+ if ((!cd->shared) && (!cd->programs))
+ continue;
+
+ sc = calloc(1, sizeof(Script_Write));
+ sc->ef = ef;
+ sc->cd = cd;
+ sc->i = i;
+ pending_threads++;
+ if (threads)
+ ecore_thread_run(data_thread_lua_script, data_thread_lua_script_end, NULL, sc);
+ else
+ {
+ data_thread_lua_script(sc, NULL);
+ data_thread_lua_script_end(sc, NULL);
+ }
+ }
+}
- cd = (Code *)eina_list_data_get(l);
- if (!cd->is_lua)
- continue;
- if ((!cd->shared) && (!cd->programs))
- continue;
-
- L = luaL_newstate();
- if (!L)
- error_and_abort(ef, "Lua error: Lua state could not be initialized\n");
+static void
+data_thread_source(void *data, Ecore_Thread *thread __UNUSED__)
+{
+ Eet_File *ef = data;
+ source_append(ef);
+}
- luaL_buffinit(L, &b);
+static void
+data_thread_source_end(void *data __UNUSED__, Ecore_Thread *thread __UNUSED__)
+{
+ pending_threads--;
+ if (pending_threads <= 0) ecore_main_loop_quit();
+}
- data.buf = NULL;
- data.size = 0;
- if (cd->shared)
- {
- while (ln < (cd->l1 - 1))
- {
- luaL_addchar(&b, '\n');
- ln++;
- }
- luaL_addstring(&b, cd->shared);
- ln += cd->l2 - cd->l1;
- }
+static void
+data_thread_fontmap(void *data, Ecore_Thread *thread __UNUSED__)
+{
+ Eet_File *ef = data;
+ source_fontmap_save(ef, fonts);
+}
- EINA_LIST_FOREACH(cd->programs, ll, cp)
- {
- if (cp->script)
- {
- while (ln < (cp->l1 - 1))
- {
- luaL_addchar(&b, '\n');
- ln++;
- }
- luaL_addstring(&b, "_G[");
- lua_pushnumber(L, cp->id);
- luaL_addvalue(&b);
- luaL_addstring(&b, "] = function (ed, signal, source)");
- luaL_addstring(&b, cp->script);
- luaL_addstring(&b, "end\n");
- ln += cp->l2 - cp->l1 + 1;
- }
- }
- luaL_pushresult(&b);
-#ifdef LUA_BINARY
- if (err_code = luaL_loadstring(L, lua_tostring (L, -1)))
- _edje_lua_error_and_abort(L, err_code, ef);
- lua_dump(L, _edje_lua_script_writer, &data);
-#else // LUA_PLAIN_TEXT
- data.buf = (char *)lua_tostring(L, -1);
- data.size = strlen(data.buf);
-#endif
- //printf("lua chunk size: %d\n", data.size);
-
- /*
- * TODO load and test Lua chunk
- */
-
- /*
- if (luaL_loadbuffer(L, globbuf, globbufsize, "edje_lua_script"))
- printf("lua load error: %s\n", lua_tostring (L, -1));
- if (lua_pcall(L, 0, 0, 0))
- printf("lua call error: %s\n", lua_tostring (L, -1));
- */
-
- snprintf(buf, sizeof(buf), "edje/scripts/lua/%i", i);
- eet_write(ef, buf, data.buf, data.size, 1);
-#ifdef LUA_BINARY
- free(data.buf);
-#endif
- lua_close(L);
- }
+static void
+data_thread_fontmap_end(void *data __UNUSED__, Ecore_Thread *thread __UNUSED__)
+{
+ pending_threads--;
+ if (pending_threads <= 0) ecore_main_loop_quit();
}
void
data_write(void)
{
Eet_File *ef;
- int input_bytes = 0;
- int total_bytes = 0;
- int src_bytes = 0;
- int fmap_bytes = 0;
- int input_raw_bytes = 0;
int image_num = 0;
int sound_num = 0;
int font_num = 0;
int collection_num = 0;
+ double t;
if (!edje_file)
{
- ERR("%s: Error. No data to put in \"%s\"",
- progname, file_out);
+ ERR("No data to put in \"%s\"", file_out);
exit(-1);
}
ef = eet_open(file_out, EET_FILE_MODE_WRITE);
if (!ef)
{
- ERR("%s: Error. Unable to open \"%s\" for writing output",
- progname, file_out);
+ ERR("Unable to open \"%s\" for writing output", file_out);
exit(-1);
}
check_groups(ef);
- total_bytes += data_write_header(ef);
- total_bytes += data_write_fonts(ef, &font_num, &input_bytes,
- &input_raw_bytes);
- total_bytes += data_write_images(ef, &image_num, &input_bytes,
- &input_raw_bytes);
- total_bytes += data_write_sounds(ef, &sound_num, &input_bytes,
- &input_raw_bytes);
+ ecore_thread_max_set(ecore_thread_max_get() * 2);
+
+ pending_threads++;
+ t = ecore_time_get();
+ data_write_header(ef);
- total_bytes += data_write_groups(ef, &collection_num);
+ INF("header: %3.5f", ecore_time_get() - t); t = ecore_time_get();
+ data_write_groups(ef, &collection_num);
+ INF("groups: %3.5f", ecore_time_get() - t); t = ecore_time_get();
data_write_scripts(ef);
+ INF("scripts: %3.5f", ecore_time_get() - t); t = ecore_time_get();
data_write_lua_scripts(ef);
+ INF("lua scripts: %3.5f", ecore_time_get() - t); t = ecore_time_get();
- src_bytes = source_append(ef);
- total_bytes += src_bytes;
- fmap_bytes = source_fontmap_save(ef, fonts);
- total_bytes += fmap_bytes;
+ pending_threads++;
+ if (threads)
+ ecore_thread_run(data_thread_source, data_thread_source_end, NULL, ef);
+ else
+ {
+ data_thread_source(ef, NULL);
+ data_thread_source_end(ef, NULL);
+ }
+ INF("source: %3.5f", ecore_time_get() - t); t = ecore_time_get();
+ pending_threads++;
+ if (threads)
+ ecore_thread_run(data_thread_fontmap, data_thread_fontmap_end, NULL, ef);
+ else
+ {
+ data_thread_fontmap(ef, NULL);
+ data_thread_fontmap_end(ef, NULL);
+ }
+ INF("fontmap: %3.5f", ecore_time_get() - t); t = ecore_time_get();
+ data_write_images(ef, &image_num);
+ INF("images: %3.5f", ecore_time_get() - t); t = ecore_time_get();
+ data_write_fonts(ef, &font_num);
+ INF("fonts: %3.5f", ecore_time_get() - t); t = ecore_time_get();
+ data_write_sounds(ef, &sound_num);
+ INF("sounds: %3.5f", ecore_time_get() - t); t = ecore_time_get();
+ pending_threads--;
+ if (pending_threads > 0) ecore_main_loop_begin();
+ INF("THREADS: %3.5f", ecore_time_get() - t); t = ecore_time_get();
eet_close(ef);
- if (verbose)
- {
- struct stat st;
-
- if (stat(file_in, &st) != 0)
- st.st_size = 0;
- input_bytes += st.st_size;
- input_raw_bytes += st.st_size;
- printf("Summary:\n"
- " Wrote %i collections\n"
- " Wrote %i images\n"
- " Wrote %i sounds\n"
- " Wrote %i fonts\n"
- " Wrote %i bytes (%iKb) of original source data\n"
- " Wrote %i bytes (%iKb) of original source font map\n"
- "Conservative compression summary:\n"
- " Wrote total %i bytes (%iKb) from %i (%iKb) input data\n"
- " Output file is %3.1f%% the size of the input data\n"
- " Saved %i bytes (%iKb)\n"
- "Raw compression summary:\n"
- " Wrote total %i bytes (%iKb) from %i (%iKb) raw input data\n"
- " Output file is %3.1f%% the size of the raw input data\n"
- " Saved %i bytes (%iKb)\n"
- ,
- collection_num,
- image_num,
- sound_num,
- font_num,
- src_bytes, (src_bytes + 512) / 1024,
- fmap_bytes, (fmap_bytes + 512) / 1024,
- total_bytes, (total_bytes + 512) / 1024,
- input_bytes, (input_bytes + 512) / 1024,
- (100.0 * (double)total_bytes) / (double)input_bytes,
- input_bytes - total_bytes,
- (input_bytes - total_bytes + 512) / 1024,
- total_bytes, (total_bytes + 512) / 1024,
- input_raw_bytes, (input_raw_bytes + 512) / 1024,
- (100.0 * (double)total_bytes) / (double)input_raw_bytes,
- input_raw_bytes - total_bytes,
- (input_raw_bytes - total_bytes + 512) / 1024);
+ if (eina_log_domain_level_check(_edje_cc_log_dom, EINA_LOG_LEVEL_INFO))
+ {
+ printf("Summary:\n"
+ " Wrote %i collections\n"
+ " Wrote %i images\n"
+ " Wrote %i sounds\n"
+ " Wrote %i fonts\n"
+ ,
+ collection_num,
+ image_num,
+ sound_num,
+ font_num);
}
}
@@ -1279,7 +1621,7 @@ reorder_parts(void)
{
ep = (Edje_Part_Parser *)pc->parts[i];
if (ep->reorder.insert_before && ep->reorder.insert_after)
- ERR("%s: Error. Unable to use together insert_before and insert_after in part \"%s\".", progname, pc->parts[i]->name);
+ ERR("Unable to use together insert_before and insert_after in part \"%s\".", pc->parts[i]->name);
if (ep->reorder.done)
{
@@ -1295,9 +1637,11 @@ reorder_parts(void)
{
ep2 = (Edje_Part_Parser *)pc->parts[j];
if (ep2->reorder.after)
- ERR("%s: Error. The part \"%s\" is ambiguous ordered part.", progname, pc->parts[i]->name);
+ ERR("The part \"%s\" is ambiguous ordered part.",
+ pc->parts[i]->name);
if (ep2->reorder.linked_prev)
- ERR("%s: Error. Unable to insert two or more parts in same part \"%s\".", progname, pc->parts[j]->name);
+ ERR("Unable to insert two or more parts in same part \"%s\".",
+ pc->parts[j]->name);
k = j - 1;
found = EINA_TRUE;
ep2->reorder.linked_prev += ep->reorder.linked_prev + 1;
@@ -1314,9 +1658,9 @@ reorder_parts(void)
{
ep2 = (Edje_Part_Parser *)pc->parts[j];
if (ep2->reorder.before)
- ERR("%s: Error. The part \"%s\" is ambiguous ordered part.", progname, pc->parts[i]->name);
+ ERR("The part \"%s\" is ambiguous ordered part.", pc->parts[i]->name);
if (ep2->reorder.linked_next)
- ERR("%s: Error. Unable to insert two or more parts in same part \"%s\".", progname, pc->parts[j]->name);
+ ERR("Unable to insert two or more parts in same part \"%s\".", pc->parts[j]->name);
k = j;
found = EINA_TRUE;
ep2->reorder.linked_next += ep->reorder.linked_next + 1;
@@ -1335,8 +1679,7 @@ reorder_parts(void)
if (((i > k) && ((i - ep->reorder.linked_prev) <= k))
|| ((i < k) && ((i + ep->reorder.linked_next) >= k)))
- ERR("%s: Error. The part order is wrong. It has circular dependency.",
- progname);
+ ERR("The part order is wrong. It has circular dependency.");
amount = ep->reorder.linked_prev + ep->reorder.linked_next + 1;
linked = i - ep->reorder.linked_prev;
@@ -1394,12 +1737,41 @@ data_queue_group_lookup(const char *name, Edje_Part *part)
gl->part = part;
}
+//#define NEWPARTLOOKUP 1
+#ifdef NEWPARTLOOKUP
+static Eina_Hash *_part_lookups_hash = NULL;
+static Eina_Hash *_part_lookups_dest_hash = NULL;
+#endif
+
void
data_queue_part_lookup(Edje_Part_Collection *pc, const char *name, int *dest)
{
+ Part_Lookup *pl = NULL;
Eina_List *l;
- Part_Lookup *pl;
+#ifdef NEWPARTLOOKUP
+ char buf[256];
+#endif
+#ifdef NEWPARTLOOKUP
+ snprintf(buf, sizeof(buf), "%lu-%lu",
+ (unsigned long)name, (unsigned long)dest);
+ if (_part_lookups_hash) pl = eina_hash_find(_part_lookups_hash, buf);
+ if (pl)
+ {
+ free(pl->name);
+ if (name[0])
+ pl->name = mem_strdup(name);
+ else
+ {
+ eina_hash_del(_part_lookups_hash, buf, pl);
+ snprintf(buf, sizeof(buf), "%lu", (unsigned long)dest);
+ eina_hash_del(_part_lookups_dest_hash, buf, pl);
+ part_lookups = eina_list_remove(part_lookups, pl);
+ free(pl);
+ }
+ return;
+ }
+#else
EINA_LIST_FOREACH(part_lookups, l, pl)
{
if ((pl->pc == pc) && (pl->dest == dest))
@@ -1415,13 +1787,34 @@ data_queue_part_lookup(Edje_Part_Collection *pc, const char *name, int *dest)
return;
}
}
+#endif
if (!name[0]) return;
pl = mem_alloc(SZ(Part_Lookup));
- part_lookups = eina_list_append(part_lookups, pl);
+ part_lookups = eina_list_prepend(part_lookups, pl);
pl->pc = pc;
pl->name = mem_strdup(name);
pl->dest = dest;
+#ifdef NEWPARTLOOKUP
+ if (!_part_lookups_hash)
+ _part_lookups_hash = eina_hash_string_superfast_new(NULL);
+ eina_hash_add(_part_lookups_hash, buf, pl);
+
+ snprintf(buf, sizeof(buf), "%lu", (unsigned long)dest);
+ if (!_part_lookups_dest_hash)
+ _part_lookups_dest_hash = eina_hash_string_superfast_new(NULL);
+ l = eina_hash_find(_part_lookups_dest_hash, buf);
+ if (l)
+ {
+ l = eina_list_append(l, pl);
+ eina_hash_modify(_part_lookups_dest_hash, buf, l);
+ }
+ else
+ {
+ l = eina_list_append(l, pl);
+ eina_hash_add(_part_lookups_dest_hash, buf, l);
+ }
+#endif
}
void
@@ -1429,12 +1822,26 @@ data_queue_copied_part_lookup(Edje_Part_Collection *pc, int *src, int *dest)
{
Eina_List *l;
Part_Lookup *pl;
+#ifdef NEWPARTLOOKUP
+ Eina_List *list;
+ char buf[256];
+#endif
+#ifdef NEWPARTLOOKUP
+ if (!_part_lookups_dest_hash) return;
+ snprintf(buf, sizeof(buf), "%lu", (unsigned long)src);
+ list = eina_hash_find(_part_lookups_dest_hash, buf);
+ EINA_LIST_FOREACH(list, l, pl)
+ {
+ data_queue_part_lookup(pc, pl->name, dest);
+ }
+#else
EINA_LIST_FOREACH(part_lookups, l, pl)
{
if (pl->dest == src)
data_queue_part_lookup(pc, pl->name, dest);
}
+#endif
}
void
@@ -1570,6 +1977,7 @@ data_queue_image_remove(int *dest, Eina_Bool *set)
if (il->dest == dest && il->set == set)
{
image_lookups = eina_list_remove_list(image_lookups, l);
+ free(il->name);
free(il);
return ;
}
@@ -1713,11 +2121,15 @@ data_process_lookups(void)
}
else
{
+ char *alias;
+ alias = eina_hash_find(part->pc->alias, part->name);
+ if (!alias)
+ alias = part->name;
for (i = 0; i < part->pc->parts_count; ++i)
{
ep = part->pc->parts[i];
- if ((ep->name) && (!strcmp(ep->name, part->name)))
+ if ((ep->name) && (!strcmp(ep->name, alias)))
{
handle_slave_lookup(part_slave_lookups, part->dest, ep->id);
*(part->dest) = ep->id;
@@ -1727,8 +2139,8 @@ data_process_lookups(void)
if (i == part->pc->parts_count)
{
- ERR("%s: Error. Unable to find part name \"%s\".",
- progname, part->name);
+ ERR("Unable to find part name \"%s\" needed in group '%s'.",
+ alias, part->pc->part);
exit(-1);
}
}
@@ -1769,11 +2181,10 @@ data_process_lookups(void)
if (!find)
{
if (!program->anonymous)
- ERR("%s: Error. Unable to find program name \"%s\".",
- progname, program->u.name);
+ ERR("Unable to find program name \"%s\".",
+ program->u.name);
else
- ERR("%s: Error. Unable to find anonymous program.",
- progname);
+ ERR("Unable to find anonymous program.");
exit(-1);
}
@@ -1812,8 +2223,7 @@ data_process_lookups(void)
if (!de)
{
- ERR("%s: Error. Unable to find group name \"%s\".",
- progname, group->name);
+ ERR("Unable to find group name \"%s\".", group->name);
exit(-1);
}
@@ -1885,8 +2295,7 @@ free_group:
if (!find)
{
- ERR("%s: Error. Unable to find image name \"%s\".",
- progname, image->name);
+ ERR("Unable to find image name \"%s\".", image->name);
exit(-1);
}
@@ -1907,14 +2316,8 @@ free_group:
if (de->entry && eina_hash_find(images_in_use, de->entry))
continue ;
- if (verbose)
- {
- printf("%s: Image '%s' in ressource 'edje/image/%i' will not be included as it is unused.\n", progname, de->entry, de->id);
- }
- else
- {
- INF("Image '%s' in ressource 'edje/image/%i' will not be included as it is unused.", de->entry, de->id);
- }
+ INF("Image '%s' in resource 'edje/image/%i' will not be included as it is unused.",
+ de->entry, de->id);
de->entry = NULL;
}
@@ -1926,14 +2329,7 @@ free_group:
if (set->name && eina_hash_find(images_in_use, set->name))
continue ;
- if (verbose)
- {
- printf("%s: Set '%s' will not be included as it is unused.\n", progname, set->name);
- }
- else
- {
- INF("Set '%s' will not be included as it is unused.", set->name);
- }
+ INF("Set '%s' will not be included as it is unused.", set->name);
set->name = NULL;
set->entries = NULL;
@@ -2159,11 +2555,23 @@ data_process_script_lookups(void)
n = eina_convert_itoa(cl->val, buf);
if (n > cl->len)
{
- ERR("%s: Error. The unexpected happened. A numeric replacement string was larger than the original!",
- progname);
+ ERR("The unexpected happened. A numeric replacement string was larger than the original!");
exit(-1);
}
memset(cl->ptr, ' ', cl->len);
strncpy(cl->ptr, buf, n);
}
}
+
+void
+using_file(const char *filename)
+{
+ FILE *f;
+
+ if (!watchfile) return;
+ f = fopen(watchfile, "ab");
+ if (!f) return ;
+ fputs(filename, f);
+ fputc('\n', f);
+ fclose(f);
+}
diff --git a/src/bin/edje_cc_parse.c b/src/bin/edje_cc_parse.c
index adc08d3..d315790 100644
--- a/src/bin/edje_cc_parse.c
+++ b/src/bin/edje_cc_parse.c
@@ -91,11 +91,11 @@ err_show_stack(void)
s = stack_id();
if (s)
{
- printf("PARSE STACK:\n%s\n", s);
+ ERR("PARSE STACK:\n%s", s);
free(s);
}
else
- printf("NO PARSE STACK\n");
+ ERR("NO PARSE STACK");
}
static void
@@ -104,12 +104,11 @@ err_show_params(void)
Eina_List *l;
char *p;
- printf("PARAMS:");
+ ERR("PARAMS:");
EINA_LIST_FOREACH(params, l, p)
{
- printf(" %s", p);
+ ERR(" %s", p);
}
- printf("\n");
}
static void
@@ -119,44 +118,57 @@ err_show(void)
err_show_params();
}
+static Eina_Hash *_new_object_hash = NULL;
+static Eina_Hash *_new_statement_hash = NULL;
+static void
+fill_object_statement_hashes(void)
+{
+ int i, n;
+
+ if (_new_object_hash) return;
+
+ _new_object_hash = eina_hash_string_superfast_new(NULL);
+ _new_statement_hash = eina_hash_string_superfast_new(NULL);
+
+ n = object_handler_num();
+ for (i = 0; i < n; i++)
+ {
+ eina_hash_add(_new_object_hash, object_handlers[i].type,
+ &(object_handlers[i]));
+ }
+ n = statement_handler_num();
+ for (i = 0; i < n; i++)
+ {
+ eina_hash_add(_new_statement_hash, statement_handlers[i].type,
+ &(statement_handlers[i]));
+ }
+}
+
static void
new_object(void)
{
char *id;
- int i;
- int handled = 0;
+ New_Object_Handler *oh;
+ New_Statement_Handler *sh;
+ fill_object_statement_hashes();
id = stack_id();
- for (i = 0; i < object_handler_num(); i++)
+ oh = eina_hash_find(_new_object_hash, id);
+ if (oh)
{
- if (!strcmp(object_handlers[i].type, id))
- {
- handled = 1;
- if (object_handlers[i].func)
- {
- object_handlers[i].func();
- }
- break;
- }
+ if (oh->func) oh->func();
}
- if (!handled)
- {
- for (i = 0; i < statement_handler_num(); i++)
- {
- if (!strcmp(statement_handlers[i].type, id))
- {
- free(id);
- return;
- }
- }
- }
- if (!handled)
+ else
{
- ERR("%s: Error. %s:%i unhandled keyword %s",
- progname, file_in, line - 1,
- (char *)eina_list_data_get(eina_list_last(stack)));
- err_show();
- exit(-1);
+ sh = eina_hash_find(_new_statement_hash, id);
+ if (!sh)
+ {
+ ERR("%s:%i unhandled keyword %s",
+ file_in, line - 1,
+ (char *)eina_list_data_get(eina_list_last(stack)));
+ err_show();
+ exit(-1);
+ }
}
free(id);
}
@@ -165,29 +177,22 @@ static void
new_statement(void)
{
char *id;
- int i;
- int handled = 0;
+ New_Statement_Handler *sh;
+ fill_object_statement_hashes();
id = stack_id();
- for (i = 0; i < statement_handler_num(); i++)
+ sh = eina_hash_find(_new_statement_hash, id);
+ if (sh)
{
- if (!strcmp(statement_handlers[i].type, id))
- {
- handled = 1;
- if (statement_handlers[i].func)
- {
- statement_handlers[i].func();
- }
- break;
- }
+ if (sh->func) sh->func();
}
- if (!handled)
+ else
{
- ERR("%s: Error. %s:%i unhandled keyword %s",
- progname, file_in, line - 1,
- (char *)eina_list_data_get(eina_list_last(stack)));
+ ERR("%s:%i unhandled keyword %s",
+ file_in, line - 1,
+ (char *)eina_list_data_get(eina_list_last(stack)));
err_show();
- exit(-1);
+ exit(-1);
}
free(id);
}
@@ -281,8 +286,8 @@ next_token(char *p, char *end, char **new_p, int *delim)
tmpstr = alloca(l + 1);
if (!tmpstr)
{
- ERR("%s: Error. %s:%i malloc %i bytes failed",
- progname, file_in, line - 1, l + 1);
+ ERR("%s:%i malloc %i bytes failed",
+ file_in, line - 1, l + 1);
exit(-1);
}
strncpy(tmpstr, p, l);
@@ -462,8 +467,8 @@ stack_chop_top(void)
}
else
{
- ERR("%s: Error. parse error %s:%i. } marker without matching { marker",
- progname, file_in, line - 1);
+ ERR("parse error %s:%i. } marker without matching { marker",
+ file_in, line - 1);
err_show();
exit(-1);
}
@@ -476,11 +481,8 @@ parse(char *data, off_t size)
int delim = 0;
int do_params = 0;
- if (verbose)
- {
- INF("%s: Parsing input file",
- progname);
- }
+ DBG("Parsing input file");
+
p = data;
end = data + size;
line = 1;
@@ -491,8 +493,8 @@ parse(char *data, off_t size)
*/
if (do_params && delim && *token != ';')
{
- ERR("%s: Error. parse error %s:%i. %c marker before ; marker",
- progname, file_in, line - 1, *token);
+ ERR("parse error %s:%i. %c marker before ; marker",
+ file_in, line - 1, *token);
err_show();
exit(-1);
}
@@ -503,9 +505,9 @@ parse(char *data, off_t size)
{
if (do_params)
{
- ERR("%s: Error. parse error %s:%i. } marker before ; marker",
- progname, file_in, line - 1);
- err_show();
+ ERR("Parse error %s:%i. } marker before ; marker",
+ file_in, line - 1);
+ err_show();
exit(-1);
}
else
@@ -531,8 +533,8 @@ parse(char *data, off_t size)
{
if (do_params)
{
- ERR("%s: Error. parse error %s:%i. { marker before ; marker",
- progname, file_in, line - 1);
+ ERR("parse error %s:%i. { marker before ; marker",
+ file_in, line - 1);
err_show();
exit(-1);
}
@@ -615,8 +617,8 @@ parse(char *data, off_t size)
}
else
{
- ERR("%s: Error. parse error %s:%i. { marker does not have matching } marker",
- progname, file_in, line - 1);
+ ERR("Parse error %s:%i. { marker does not have matching } marker",
+ file_in, line - 1);
err_show();
exit(-1);
}
@@ -626,11 +628,8 @@ parse(char *data, off_t size)
}
}
}
- if (verbose)
- {
- INF("%s: Parsing done",
- progname);
- }
+
+ DBG("Parsing done");
}
static char *clean_file = NULL;
@@ -739,20 +738,20 @@ compile(void)
eina_prefix_lib_get(pfx));
if (ecore_file_exists(buf2))
{
- snprintf(buf, sizeof(buf), "%s %s -I%s %s -o %s",
- buf2, file_in, inc, def, tmpn);
+ snprintf(buf, sizeof(buf), "%s -a %s %s -I%s %s -o %s",
+ buf2, watchfile ? watchfile : "/dev/null", file_in, inc, def, tmpn);
ret = system(buf);
}
else
{
- ERR("Error. Cannot run epp: %s", buf2);
+ ERR("Cannot run epp: %s", buf2);
exit(-1);
}
if (ret == EXIT_SUCCESS)
file_in = tmpn;
else
{
- ERR("Error. Exit code of epp not clean: %i", ret);
+ ERR("Exit code of epp not clean: %i", ret);
exit(-1);
}
free(def);
@@ -760,14 +759,11 @@ compile(void)
fd = open(file_in, O_RDONLY | O_BINARY, S_IRUSR | S_IWUSR);
if (fd < 0)
{
- ERR("%s: Error. cannot open file \"%s\" for input. %s",
- progname, file_in, strerror(errno));
+ ERR("Cannot open file \"%s\" for input. %s",
+ file_in, strerror(errno));
exit(-1);
}
- if (verbose)
- {
- INF("%s: Opening \"%s\" for input", progname, file_in);
- }
+ DBG("Opening \"%s\" for input", file_in);
size = lseek(fd, 0, SEEK_END);
lseek(fd, 0, SEEK_SET);
@@ -776,8 +772,7 @@ compile(void)
parse(data, size);
else
{
- ERR("%s: Error. cannot read file \"%s\". %s",
- progname, file_in, strerror(errno));
+ ERR("Cannot read file \"%s\". %s", file_in, strerror(errno));
exit(-1);
}
free(data);
@@ -787,7 +782,7 @@ compile(void)
{
if (!stl->name)
{
- ERR("%s: Error. style must have a name.", progname);
+ ERR("style must have a name.");
exit(-1);
}
}
@@ -813,8 +808,8 @@ is_num(int n)
str = eina_list_nth(params, n);
if (!str)
{
- ERR("%s: Error. %s:%i no parameter supplied as argument %i",
- progname, file_in, line - 1, n + 1);
+ ERR("%s:%i no parameter supplied as argument %i",
+ file_in, line - 1, n + 1);
err_show();
exit(-1);
}
@@ -838,8 +833,8 @@ parse_str(int n)
str = eina_list_nth(params, n);
if (!str)
{
- ERR("%s: Error. %s:%i no parameter supplied as argument %i",
- progname, file_in, line - 1, n + 1);
+ ERR("%s:%i no parameter supplied as argument %i",
+ file_in, line - 1, n + 1);
err_show();
exit(-1);
}
@@ -863,8 +858,7 @@ _parse_enum(char *str, va_list va)
/* End of the list, nothing matched. */
if (!s)
{
- fprintf(stderr, "%s: Error. %s:%i token %s not one of:",
- progname, file_in, line - 1, str);
+ ERR("%s:%i token %s not one of:", file_in, line - 1, str);
s = va_arg(va2, char *);
while (s)
{
@@ -903,8 +897,8 @@ parse_enum(int n, ...)
str = eina_list_nth(params, n);
if (!str)
{
- ERR("%s: Error. %s:%i no parameter supplied as argument %i",
- progname, file_in, line - 1, n + 1);
+ ERR("%s:%i no parameter supplied as argument %i",
+ file_in, line - 1, n + 1);
err_show();
exit(-1);
}
@@ -941,8 +935,8 @@ parse_int(int n)
str = eina_list_nth(params, n);
if (!str)
{
- ERR("%s: Error. %s:%i no parameter supplied as argument %i",
- progname, file_in, line - 1, n + 1);
+ ERR("%s:%i no parameter supplied as argument %i",
+ file_in, line - 1, n + 1);
err_show();
exit(-1);
}
@@ -959,16 +953,16 @@ parse_int_range(int n, int f, int t)
str = eina_list_nth(params, n);
if (!str)
{
- ERR("%s: Error. %s:%i no parameter supplied as argument %i",
- progname, file_in, line - 1, n + 1);
+ ERR("%s:%i no parameter supplied as argument %i",
+ file_in, line - 1, n + 1);
err_show();
exit(-1);
}
i = my_atoi(str);
if ((i < f) || (i > t))
{
- ERR("%s: Error. %s:%i integer %i out of range of %i to %i inclusive",
- progname, file_in, line - 1, i, f, t);
+ ERR("%s:%i integer %i out of range of %i to %i inclusive",
+ file_in, line - 1, i, f, t);
err_show();
exit(-1);
}
@@ -984,16 +978,16 @@ parse_bool(int n)
str = eina_list_nth(params, n);
if (!str)
{
- ERR("%s: Error. %s:%i no parameter supplied as argument %i",
- progname, file_in, line - 1, n + 1);
+ ERR("%s:%i no parameter supplied as argument %i",
+ file_in, line - 1, n + 1);
err_show();
exit(-1);
}
if (!strstrip(str, buf, sizeof (buf)))
{
- ERR("%s: Error. %s:%i expression is too long",
- progname, file_in, line - 1);
+ ERR("%s:%i expression is too long",
+ file_in, line - 1);
return 0;
}
@@ -1005,8 +999,8 @@ parse_bool(int n)
i = my_atoi(str);
if ((i < 0) || (i > 1))
{
- ERR("%s: Error. %s:%i integer %i out of range of 0 to 1 inclusive",
- progname, file_in, line - 1, i);
+ ERR("%s:%i integer %i out of range of 0 to 1 inclusive",
+ file_in, line - 1, i);
err_show();
exit(-1);
}
@@ -1022,8 +1016,8 @@ parse_float(int n)
str = eina_list_nth(params, n);
if (!str)
{
- ERR("%s: Error. %s:%i no parameter supplied as argument %i",
- progname, file_in, line - 1, n + 1);
+ ERR("%s:%i no parameter supplied as argument %i",
+ file_in, line - 1, n + 1);
err_show();
exit(-1);
}
@@ -1040,16 +1034,16 @@ parse_float_range(int n, double f, double t)
str = eina_list_nth(params, n);
if (!str)
{
- ERR("%s: Error. %s:%i no parameter supplied as argument %i",
- progname, file_in, line - 1, n + 1);
+ ERR("%s:%i no parameter supplied as argument %i",
+ file_in, line - 1, n + 1);
err_show();
exit(-1);
}
i = my_atof(str);
if ((i < f) || (i > t))
{
- ERR("%s: Error. %s:%i float %3.3f out of range of %3.3f to %3.3f inclusive",
- progname, file_in, line - 1, i, f, t);
+ ERR("%s:%i float %3.3f out of range of %3.3f to %3.3f inclusive",
+ file_in, line - 1, i, f, t);
err_show();
exit(-1);
}
@@ -1069,8 +1063,8 @@ check_arg_count(int required_args)
if (num_args != required_args)
{
- ERR("%s: Error. %s:%i got %i arguments, but expected %i",
- progname, file_in, line - 1, num_args, required_args);
+ ERR("%s:%i got %i arguments, but expected %i",
+ file_in, line - 1, num_args, required_args);
err_show();
exit(-1);
}
@@ -1083,9 +1077,8 @@ check_min_arg_count(int min_required_args)
if (num_args < min_required_args)
{
- ERR("%s: Error. %s:%i got %i arguments, "
- "but expected at least %i",
- progname, file_in, line - 1, num_args, min_required_args);
+ ERR("%s:%i got %i arguments, but expected at least %i",
+ file_in, line - 1, num_args, min_required_args);
err_show();
exit(-1);
}
@@ -1112,8 +1105,8 @@ my_atoi(const char *s)
if (!s) return 0;
if (!strstrip(s, buf, sizeof(buf)))
{
- ERR("%s: Error. %s:%i expression is too long\n",
- progname, file_in, line - 1);
+ ERR("%s:%i expression is too long",
+ file_in, line - 1);
return 0;
}
_alphai(buf, &res);
@@ -1126,8 +1119,8 @@ _deltai(char *s, int *val)
if (!val) return NULL;
if ('(' != s[0])
{
- ERR("%s: Error. %s:%i unexpected character at %s\n",
- progname, file_in, line - 1, s);
+ ERR("%s:%i unexpected character at %s",
+ file_in, line - 1, s);
return s;
}
else
@@ -1157,8 +1150,8 @@ _funci(char *s, int *val)
}
else
{
- ERR("%s: Error. %s:%i unexpected character at %s\n",
- progname, file_in, line - 1, s);
+ ERR("%s:%i unexpected character at %s",
+ file_in, line - 1, s);
}
return s;
}
@@ -1180,7 +1173,7 @@ _gammai(char *s, int *val)
else
{
s = _funci(s, val);
-// ERR("%s: Error. %s:%i unexpected character at %s\n",
+// ERR("%s:%i unexpected character at %s",
// progname, file_in, line - 1, s);
}
return s;
@@ -1290,8 +1283,7 @@ _calci(char op, int a, int b)
case '/':
if (0 != b) a /= b;
else
- ERR("%s: Error. %s:%i divide by zero\n",
- progname, file_in, line - 1);
+ ERR("%s:%i divide by zero", file_in, line - 1);
return a;
case '*':
a *= b;
@@ -1299,12 +1291,10 @@ _calci(char op, int a, int b)
case '%':
if (0 != b) a = a % b;
else
- ERR("%s: Error. %s:%i modula by zero\n",
- progname, file_in, line - 1);
+ ERR("%s:%i modula by zero", file_in, line - 1);
return a;
default:
- ERR("%s: Error. %s:%i unexpected character '%c'\n",
- progname, file_in, line - 1, op);
+ ERR("%s:%i unexpected character '%c'", file_in, line - 1, op);
}
return a;
}
@@ -1321,8 +1311,7 @@ my_atof(const char *s)
if (!strstrip(s, buf, sizeof (buf)))
{
- ERR("%s: Error. %s:%i expression is too long",
- progname, file_in, line - 1);
+ ERR("%s:%i expression is too long", file_in, line - 1);
return 0;
}
_alphaf(buf, &res);
@@ -1335,8 +1324,7 @@ _deltaf(char *s, double *val)
if (!val) return NULL;
if ('(' != s[0])
{
- ERR("%s: Error. %s:%i unexpected character at %s",
- progname, file_in, line - 1, s);
+ ERR("%s:%i unexpected character at %s", file_in, line - 1, s);
return s;
}
else
@@ -1365,8 +1353,7 @@ _funcf(char *s, double *val)
}
else
{
- ERR("%s: Error. %s:%i unexpected character at %s\n",
- progname, file_in, line - 1, s);
+ ERR("%s:%i unexpected character at %s", file_in, line - 1, s);
}
return s;
}
@@ -1389,7 +1376,7 @@ _gammaf(char *s, double *val)
else
{
s = _funcf(s, val);
-// ERR("%s: Error. %s:%i unexpected character at %s\n",
+// ERR("%s:%i unexpected character at %s",
// progname, file_in, line - 1, s);
}
return s;
@@ -1503,8 +1490,7 @@ _calcf(char op, double a, double b)
case '/':
if (b != 0) a /= b;
else
- ERR("%s: Error. %s:%i divide by zero\n",
- progname, file_in, line - 1);
+ ERR("%s:%i divide by zero", file_in, line - 1);
return a;
case '*':
a *= b;
@@ -1512,12 +1498,10 @@ _calcf(char op, double a, double b)
case '%':
if (0 != b) a = (double)((int)a % (int)b);
else
- ERR("%s: Error. %s:%i modula by zero\n",
- progname, file_in, line - 1);
+ ERR("%s:%i modula by zero", file_in, line - 1);
return a;
default:
- ERR("%s: Error. %s:%i unexpected character '%c'\n",
- progname, file_in, line - 1, op);
+ ERR("%s:%i unexpected character '%c'", file_in, line - 1, op);
}
return a;
}
@@ -1527,8 +1511,7 @@ strstrip(const char *in, char *out, size_t size)
{
if ((size -1 ) < strlen(in))
{
- ERR("%s: Error. %s:%i expression is too long",
- progname, file_in, line - 1);
+ ERR("%s:%i expression is too long", file_in, line - 1);
return 0;
}
/* remove spaces and tabs */
diff --git a/src/bin/edje_cc_sources.c b/src/bin/edje_cc_sources.c
index d9cd0c1..4a6be70 100644
--- a/src/bin/edje_cc_sources.c
+++ b/src/bin/edje_cc_sources.c
@@ -66,8 +66,7 @@ source_fetch_file(const char *fil, const char *filname)
f = fopen(fil, "rb");
if (!f)
{
- ERR("%s: Warning. Cannot open file '%s'",
- progname, fil);
+ ERR("Cannot open file '%s'", fil);
exit(-1);
}
@@ -82,8 +81,7 @@ source_fetch_file(const char *fil, const char *filname)
tmp = fread(sf->file, sz, 1, f);
if (tmp != 1)
{
- ERR("%s: Warning file length for (%s) doesn't match !",
- progname, filname);
+ ERR("file length for (%s) doesn't match!", filname);
exit(-1);
}
}
@@ -228,7 +226,8 @@ source_fetch(void)
int
source_append(Eet_File *ef)
{
- return eet_data_write(ef, _srcfile_list_edd, "edje_sources", &srcfiles, 1);
+ return eet_data_write(ef, _srcfile_list_edd, "edje_sources", &srcfiles,
+ compress_mode);
}
SrcFile_List *
@@ -246,7 +245,8 @@ source_fontmap_save(Eet_File *ef, Eina_List *font_list)
Font_List fl;
fl.list = font_list;
- return eet_data_write(ef, _font_list_edd, "edje_source_fontmap", &fl, 1);
+ return eet_data_write(ef, _font_list_edd, "edje_source_fontmap", &fl,
+ compress_mode);
}
Font_List *
diff --git a/src/bin/edje_convert.c b/src/bin/edje_convert.c
index 63d11ba..bd6cf31 100644
--- a/src/bin/edje_convert.c
+++ b/src/bin/edje_convert.c
@@ -259,7 +259,7 @@ _edje_collection_convert(Eet_File *ef, Edje_Part_Collection_Directory_Entry *ce,
/* Change structure layout */
edc = calloc(1, sizeof (Edje_Part_Collection));
- if (!edc) error_and_abort(ef, "Not enough memory\n");
+ if (!edc) error_and_abort(ef, "Not enough memory");
ce->ref = edc;
EINA_LIST_FREE(oedc->programs, pg)
@@ -306,7 +306,7 @@ _edje_collection_convert(Eet_File *ef, Edje_Part_Collection_Directory_Entry *ce,
edc->parts_count = eina_list_count(oedc->parts);
edc->parts = calloc(edc->parts_count, sizeof (Edje_Part *));
if (edc->parts_count && !edc->parts)
- error_and_abort(ef, "Not enough memory\n");
+ error_and_abort(ef, "Not enough memory");
k = 0;
EINA_LIST_FREE(oedc->parts, part)
@@ -318,7 +318,7 @@ _edje_collection_convert(Eet_File *ef, Edje_Part_Collection_Directory_Entry *ce,
replacement = eina_mempool_malloc(ce->mp.part, sizeof (Edje_Part));
if (!replacement)
- error_and_abort(ef, "Not enough memory\n");
+ error_and_abort(ef, "Not enough memory");
replacement->name = part->name;
replacement->default_desc = _edje_description_convert(part->type, ce, part->default_desc);
diff --git a/src/bin/edje_convert_main.c b/src/bin/edje_convert_main.c
index bc3484d..e17d412 100644
--- a/src/bin/edje_convert_main.c
+++ b/src/bin/edje_convert_main.c
@@ -24,10 +24,9 @@ error_and_abort(Eet_File *ef, const char *fmt, ...)
{
va_list ap;
- fprintf(stderr, "%s: Error. ", progname);
-
va_start(ap, fmt);
- vfprintf(stderr, fmt, ap);
+ eina_log_vprint(_edje_cc_log_dom, EINA_LOG_LEVEL_CRITICAL,
+ "unknown", "unknown", 0, fmt, ap);
va_end(ap);
eet_close(ef);
exit(-1);
diff --git a/src/bin/edje_decc.c b/src/bin/edje_decc.c
index 56b81b7..01ece6a 100644
--- a/src/bin/edje_decc.c
+++ b/src/bin/edje_decc.c
@@ -19,9 +19,10 @@
#include "edje_decc.h"
int _edje_cc_log_dom = -1;
-char *progname = NULL;
+static const char *progname = NULL;
char *file_in = NULL;
char *file_out = NULL;
+int compress_mode = EET_COMPRESSION_DEFAULT;
Edje_File *edje_file = NULL;
SrcFile_List *srcfiles = NULL;
@@ -36,6 +37,87 @@ void output(void);
static int compiler_cmd_is_sane();
static int root_filename_is_sane();
+
+static void
+_edje_cc_log_cb(const Eina_Log_Domain *d,
+ Eina_Log_Level level,
+ const char *file,
+ const char *fnc,
+ int line,
+ const char *fmt,
+ __UNUSED__ void *data,
+ va_list args)
+{
+ if ((d->name) && (d->namelen == sizeof("edje_decc") - 1) &&
+ (memcmp(d->name, "edje_decc", sizeof("edje_decc") - 1) == 0))
+ {
+ const char *prefix;
+ Eina_Bool use_color = !eina_log_color_disable_get();
+
+ if (use_color)
+ {
+#ifndef _WIN32
+ fputs(eina_log_level_color_get(level), stderr);
+#else
+ int color;
+ switch (level)
+ {
+ case EINA_LOG_LEVEL_CRITICAL:
+ color = FOREGROUND_RED | FOREGROUND_INTENSITY;
+ break;
+ case EINA_LOG_LEVEL_ERR:
+ color = FOREGROUND_RED;
+ break;
+ case EINA_LOG_LEVEL_WARN:
+ color = FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_INTENSITY;
+ break;
+ case EINA_LOG_LEVEL_INFO:
+ color = FOREGROUND_GREEN | FOREGROUND_INTENSITY;
+ break;
+ case EINA_LOG_LEVEL_DBG:
+ color = FOREGROUND_BLUE | FOREGROUND_INTENSITY;
+ break;
+ default:
+ color = FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE;
+ }
+ SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), color);
+#endif
+ }
+
+ switch (level)
+ {
+ case EINA_LOG_LEVEL_CRITICAL:
+ prefix = "Critical. ";
+ break;
+ case EINA_LOG_LEVEL_ERR:
+ prefix = "Error. ";
+ break;
+ case EINA_LOG_LEVEL_WARN:
+ prefix = "Warning. ";
+ break;
+ default:
+ prefix = "";
+ }
+ fprintf(stderr, "%s: %s", progname, prefix);
+
+ if (use_color)
+ {
+#ifndef _WIN32
+ fputs(EINA_COLOR_RESET, stderr);
+#else
+ SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),
+ FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE);
+#endif
+ }
+
+
+ vfprintf(stderr, fmt, args);
+ putc('\n', stderr);
+ }
+ else
+ eina_log_print_cb_stderr(d, level, file, fnc, line, fmt, NULL, args);
+}
+
static void
main_help(void)
{
@@ -46,6 +128,7 @@ main_help(void)
" -main-out\tCreate a symbolic link to the main edc \n"
" -no-build-sh\tDon't output build.sh \n"
" -current-dir\tOutput to current directory \n"
+ " -quiet\t\tProduce less output\n"
"\n"
,progname);
}
@@ -69,7 +152,10 @@ main(int argc, char **argv)
eina_shutdown();
exit(-1);
}
- progname = argv[0];
+ progname = ecore_file_file_get(argv[0]);
+ eina_log_print_cb_set(_edje_cc_log_cb, NULL);
+ eina_log_domain_level_set("edje_decc", EINA_LOG_LEVEL_INFO);
+
for (i = 1; i < argc; i++)
{
if (!strcmp(argv[i], "-h"))
@@ -88,10 +174,12 @@ main(int argc, char **argv)
build_sh = 0;
else if (!strcmp(argv[i], "-current-dir"))
new_dir = 0;
+ else if (!strcmp(argv[i], "-quiet"))
+ eina_log_domain_level_set("edje_decc", EINA_LOG_LEVEL_WARN);
}
if (!file_in)
{
- ERR("%s: Error: no input file specified.", progname);
+ ERR("no input file specified.");
main_help();
exit(-1);
}
@@ -103,9 +191,9 @@ main(int argc, char **argv)
if (!decomp()) return -1;
output();
- fprintf(stderr, "WARNING! If any Image or audio data was encoded in a LOSSY way, then\n"
- "re-encoding will drop quality even more. You need access to the original\n"
- "data to ensure no loss of quality.\n");
+ WRN("If any Image or audio data was encoded in a LOSSY way, then "
+ "re-encoding will drop quality even more. "
+ "You need access to the original data to ensure no loss of quality.");
eet_close(ef);
edje_shutdown();
eina_log_domain_unregister(_edje_cc_log_dom);
@@ -120,27 +208,27 @@ decomp(void)
ef = eet_open(file_in, EET_FILE_MODE_READ);
if (!ef)
{
- ERR("ERROR: cannot open %s", file_in);
+ ERR("cannot open %s", file_in);
return 0;
}
srcfiles = source_load(ef);
if (!srcfiles || !srcfiles->list)
{
- ERR("ERROR: %s has no decompile information", file_in);
+ ERR("%s has no decompile information", file_in);
eet_close(ef);
return 0;
}
if (!eina_list_data_get(srcfiles->list) || !root_filename_is_sane())
{
- ERR("ERROR: Invalid root filename: '%s'", (char *) eina_list_data_get(srcfiles->list));
+ ERR("Invalid root filename: '%s'", (char *) eina_list_data_get(srcfiles->list));
eet_close(ef);
return 0;
}
edje_file = eet_data_read(ef, _edje_edd_edje_file, "edje/file");
if (!edje_file)
{
- ERR("ERROR: %s does not appear to be an edje file", file_in);
+ ERR("%s does not appear to be an edje file", file_in);
eet_close(ef);
return 0;
}
@@ -152,7 +240,7 @@ decomp(void)
}
else if (!compiler_cmd_is_sane())
{
- ERR("ERROR: invalid compiler executable: '%s'", edje_file->compiler);
+ ERR("invalid compiler executable: '%s'", edje_file->compiler);
eet_close(ef);
return 0;
}
@@ -224,7 +312,7 @@ output(void)
snprintf(buf, sizeof(buf), "edje/images/%i", ei->id);
evas_object_image_file_set(im, file_in, buf);
snprintf(out, sizeof(out), "%s/%s", outdir, ei->entry);
- printf("Output Image: %s\n", out);
+ INF("Output Image: %s", out);
pp = strdup(out);
p = strrchr(pp, '/');
*p = 0;
@@ -255,7 +343,7 @@ output(void)
char *pp;
snprintf(out, sizeof(out), "%s/%s", outdir, sf->name);
- INF("Output Source File: %s\n", out);
+ INF("Output Source File: %s", out);
pp = strdup(out);
p = strrchr(pp, '/');
*p = 0;
@@ -344,10 +432,10 @@ output(void)
if (build_sh)
{
snprintf(out, sizeof(out), "%s/build.sh", outdir);
- printf("Output Build Script: %s\n", out);
+ INF("Output Build Script: %s", out);
if (strstr(out, "../"))
{
- ERR("potential security violation. attempt to write in parent dir.\n");
+ ERR("potential security violation. attempt to write in parent dir.");
exit (-1);
}
f = fopen(out, "wb");
@@ -355,7 +443,7 @@ output(void)
fprintf(f, "%s $@ -id . -fd . %s -o %s.edj\n", edje_file->compiler, sf->name, outdir);
fclose(f);
- WRN("\n*** CAUTION ***\n"
+ WRN("*** CAUTION ***\n"
"Please check the build script for anything malicious "
"before running it!\n\n");
}
@@ -365,7 +453,7 @@ output(void)
snprintf(out, sizeof(out), "%s/%s", outdir, file_out);
if (ecore_file_symlink(sf->name, out) != EINA_TRUE)
{
- ERR("symlink %s -> %s failed\n", sf->name, out);
+ ERR("symlink %s -> %s failed", sf->name, out);
}
}
diff --git a/src/bin/edje_decc.h b/src/bin/edje_decc.h
index 43e988d..c562715 100644
--- a/src/bin/edje_decc.h
+++ b/src/bin/edje_decc.h
@@ -6,6 +6,7 @@
/* logging variables */
extern int _edje_cc_log_dom ;
#define EDJE_CC_DEFAULT_LOG_COLOR EINA_COLOR_CYAN
+
#ifdef ERR
# undef ERR
#endif
@@ -18,6 +19,14 @@ extern int _edje_cc_log_dom ;
# undef WRN
#endif
#define WRN(...) EINA_LOG_DOM_WARN(_edje_cc_log_dom, __VA_ARGS__)
+#ifdef CRIT
+# undef CRIT
+#endif
+#define CRIT(...) EINA_LOG_DOM_CRIT(_edje_cc_log_dom, __VA_ARGS__)
+#ifdef DBG
+# undef DBG
+#endif
+#define DBG(...) EINA_LOG_DOM_DBG(_edje_cc_log_dom, __VA_ARGS__)
/* types */
typedef struct _Font Font;
diff --git a/src/bin/edje_inspector.c b/src/bin/edje_inspector.c
index 676c829..9106f95 100644
--- a/src/bin/edje_inspector.c
+++ b/src/bin/edje_inspector.c
@@ -204,6 +204,8 @@ part_type_name_get(Edje_Part_Type t)
return "TABLE";
case EDJE_PART_TYPE_EXTERNAL:
return "EXTERNAL";
+ case EDJE_PART_TYPE_SPACER:
+ return "SPACER";
case EDJE_PART_TYPE_NONE:
case EDJE_PART_TYPE_LAST:
diff --git a/src/bin/edje_multisense_convert.c b/src/bin/edje_multisense_convert.c
index d37d218..f02e02e 100644
--- a/src/bin/edje_multisense_convert.c
+++ b/src/bin/edje_multisense_convert.c
@@ -21,7 +21,7 @@ _edje_multisense_encode(const char *filename, Edje_Sound_Sample *sample, double
enc_info = calloc(1, sizeof(Edje_Sound_Encode));
if (!enc_info)
{
- ERR("Error. while allocating memory to load file ");
+ ERR("while allocating memory to load file ");
exit(-1);
}
memset (&sfinfo, 0, sizeof (SF_INFO));
@@ -33,13 +33,13 @@ _edje_multisense_encode(const char *filename, Edje_Sound_Sample *sample, double
sfile = sf_open (filename, SFM_READ, &sfinfo);
if (!sfile)
{
- ERR("Error. Unable to open audio file : %s", filename);
+ ERR("Unable to open audio file: %s", filename);
exit(-1);
}
if (!sf_format_check(&sfinfo))
{
- ERR("Error. Unknown file, not a valid audio file");
+ ERR("Unknown file, not a valid audio file");
exit(-1);
}
diff --git a/src/bin/edje_player.c b/src/bin/edje_player.c
index 208fbb4..cac681b 100644
--- a/src/bin/edje_player.c
+++ b/src/bin/edje_player.c
@@ -37,6 +37,8 @@ struct opts {
char *title;
};
+static Eina_Bool _edje_load_or_show_error(Evas_Object *edje, const char *file, const char *group);
+
static Ecore_Evas *win;
static void
@@ -456,6 +458,17 @@ _create_bg(Evas *evas, const struct opts *opts)
return bg;
}
+static void
+_edje_reload(void *data __UNUSED__, Evas_Object *obj, const char *emission __UNUSED__, const char *source __UNUSED__)
+{
+ const char *file;
+ const char *group;
+ edje_object_signal_callback_del(obj, "edje,change,file", "edje", _edje_reload);
+
+ edje_object_file_get(obj, &file, &group);
+ _edje_load_or_show_error(obj, file, group);
+}
+
static Eina_Bool
_edje_load_or_show_error(Evas_Object *edje, const char *file, const char *group)
{
@@ -464,6 +477,7 @@ _edje_load_or_show_error(Evas_Object *edje, const char *file, const char *group)
if (edje_object_file_set(edje, file, group))
{
+ edje_object_signal_callback_add(edje, "edje,change,file", "edje", _edje_reload, NULL);;
evas_object_focus_set(edje, EINA_TRUE);
return EINA_TRUE;
}
diff --git a/src/bin/edje_watch.c b/src/bin/edje_watch.c
new file mode 100644
index 0000000..01033b6
--- /dev/null
+++ b/src/bin/edje_watch.c
@@ -0,0 +1,137 @@
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <Eina.h>
+#include <Ecore.h>
+#include <Eio.h>
+#ifdef HAVE_EVIL
+# include <Evil.h>
+#endif
+
+char watchfile[PATH_MAX];
+char *edje_cc_command = NULL;
+Eina_List *watching = NULL;
+Ecore_Timer *timeout = NULL;
+
+static void
+read_watch_file(const char *file)
+{
+ Eina_File *f;
+ Eina_Iterator *it;
+ Eina_File_Line *ln;
+ Eio_Monitor *mon;
+ Eina_List *r = NULL;
+
+ f = eina_file_open(file, EINA_FALSE);
+ if (!f) return ;
+
+ it = eina_file_map_lines(f);
+ if (!it) goto err;
+
+ EINA_ITERATOR_FOREACH(it, ln)
+ {
+ const char *path;
+
+ path = eina_stringshare_add_length(ln->start, ln->length);
+ r = eina_list_append(r, eio_monitor_add(path));
+ eina_stringshare_del(path);
+ }
+ eina_iterator_free(it);
+
+ EINA_LIST_FREE(watching, mon)
+ eio_monitor_del(mon);
+ watching = r;
+
+ err:
+ eina_file_close(f);
+}
+
+Eina_Bool
+rebuild(void *data __UNUSED__)
+{
+ double start, end;
+
+ start = ecore_time_get();
+ fprintf(stderr, "SYSTEM('%s')\n", edje_cc_command);
+ if (system(edje_cc_command) == 0)
+ read_watch_file(watchfile);
+ end = ecore_time_get();
+ fprintf(stderr, "DONE IN %f\n", end - start);
+
+ timeout = NULL;
+ return EINA_FALSE;
+}
+
+Eina_Bool
+some_change(void *data __UNUSED__, int type __UNUSED__, void *event __UNUSED__)
+{
+ Eio_Monitor_Event *ev = event;
+
+ fprintf(stderr, "EVENT %i on [%s]\n", type, ev->filename);
+ if (timeout) ecore_timer_del(timeout);
+ timeout = ecore_timer_add(0.5, rebuild, NULL);
+
+ return ECORE_CALLBACK_PASS_ON;
+}
+
+int
+main(int argc, char **argv)
+{
+ char *watchout;
+ Eina_Strbuf *buf;
+ double start, end;
+ int tfd;
+ int i;
+
+ eina_init();
+ ecore_init();
+ eio_init();
+
+ if (argc < 2) return -1;
+
+ ecore_event_handler_add(EIO_MONITOR_FILE_MODIFIED, some_change, NULL);
+ ecore_event_handler_add(EIO_MONITOR_FILE_CREATED, some_change, NULL);
+ ecore_event_handler_add(EIO_MONITOR_FILE_DELETED, some_change, NULL);
+ ecore_event_handler_add(EIO_MONITOR_FILE_CLOSED, some_change, NULL);
+
+#ifdef HAVE_EVIL
+ watchout = (char *)evil_tmpdir_get();
+#else
+ watchout = "/tmp";
+#endif
+
+ snprintf(watchfile, PATH_MAX, "%s/edje_watch-tmp-XXXXXX", watchout);
+
+ tfd = mkstemp(watchfile);
+ if (tfd < 0) return -1;
+ close(tfd);
+
+ buf = eina_strbuf_new();
+ if (!buf) return -1;
+
+ eina_strbuf_append_printf(buf, "%s/edje_cc -threads -fastcomp -w %s ", PACKAGE_BIN_DIR, watchfile);
+ for (i = 1; i < argc; ++i)
+ eina_strbuf_append_printf(buf, "%s ", argv[i]);
+
+ edje_cc_command = eina_strbuf_string_steal(buf);
+
+ eina_strbuf_free(buf);
+
+ start = ecore_time_get();
+ fprintf(stderr, "SYSTEM('%s')\n", edje_cc_command);
+ system(edje_cc_command);
+ read_watch_file(watchfile);
+ end = ecore_time_get();
+ fprintf(stderr, "DONE %f\n", end - start);
+
+ ecore_main_loop_begin();
+
+ unlink(watchfile);
+
+ eio_shutdown();
+ ecore_shutdown();
+ eina_shutdown();
+
+ return 1;
+}
diff --git a/src/bin/epp/cpplib.c b/src/bin/epp/cpplib.c
index 132d2a9..30c7f01 100644
--- a/src/bin/epp/cpplib.c
+++ b/src/bin/epp/cpplib.c
@@ -5489,6 +5489,7 @@ open_include_file(cpp_reader * pfile, char *filename,
&& !strncmp(searchptr->fname, filename, p - filename))
{
/* FILENAME is in SEARCHPTR, which we've already checked. */
+ using_file(filename);
return open(filename, O_RDONLY | O_BINARY, 0666);
}
if (p == filename)
@@ -5508,8 +5509,12 @@ open_include_file(cpp_reader * pfile, char *filename,
}
for (map = read_name_map(pfile, dir); map; map = map->map_next)
if (!strcmp(map->map_from, from))
- return open(map->map_to, O_RDONLY | O_BINARY, 0666);
+ {
+ using_file(map->map_to);
+ return open(map->map_to, O_RDONLY | O_BINARY, 0666);
+ }
+ using_file(filename);
return open(filename, O_RDONLY | O_BINARY, 0666);
}
@@ -5519,6 +5524,7 @@ static int
open_include_file(cpp_reader * pfile __UNUSED__, char *filename,
file_name_list * searchptr __UNUSED__)
{
+ using_file(filename);
return open(filename, O_RDONLY | O_BINARY, 0666);
}
@@ -6561,6 +6567,20 @@ cpp_handle_options(cpp_reader * pfile, int argc, char **argv)
i++, push_pending(pfile, "-D", argv[i]);
break;
+ case 'a':
+ {
+ if (!strcmp(argv[i], "-a"))
+ {
+ if (i + 1 == argc)
+ cpp_fatal("Filename missing after `-a` option");
+ else if (strcmp(argv[++i], "/dev/null"))
+ {
+ opts->watchfile = argv[i];
+ }
+ }
+ break;
+ }
+
case 'A':
{
char *p = NULL;
@@ -7425,3 +7445,17 @@ cpp_perror_with_name(cpp_reader * pfile, const char *name)
*
* Support for_lint flag.
*/
+
+extern cpp_options options;
+
+void
+using_file(const char *filename)
+{
+ FILE *f;
+
+ f = fopen(options.watchfile, "a");
+ if (!f) return ;
+ fputs(filename, f);
+ fputc('\n', f);
+ fclose(f);
+}
diff --git a/src/bin/epp/cpplib.h b/src/bin/epp/cpplib.h
index 5653dd2..a34a765 100644
--- a/src/bin/epp/cpplib.h
+++ b/src/bin/epp/cpplib.h
@@ -473,6 +473,9 @@ struct cpp_options {
/* Target-name to write with the dependency information. */
char *deps_target;
+
+ /* Target file to write all include file */
+ const char *watchfile;
};
#define CPP_TRADITIONAL(PFILE) (CPP_OPTIONS(PFILE)-> traditional)
@@ -636,6 +639,8 @@ void *xmalloc(unsigned size);
void *xrealloc(void *old, unsigned size);
void *xcalloc(unsigned number, unsigned size);
+void using_file(const char *filename);
+
#ifdef __EMX__
#define PATH_SEPARATOR ';'
#endif
diff --git a/src/examples/Makefile.am b/src/examples/Makefile.am
index 1dbe239..b83189e 100644
--- a/src/examples/Makefile.am
+++ b/src/examples/Makefile.am
@@ -22,6 +22,19 @@ EDCS = \
table.edc \
box.edc \
drag.edc \
+ edje_example.edc \
+ embryo_custom_state.edc \
+ embryo_pong.edc \
+ embryo_run_program.edc \
+ embryo_set_state.edc \
+ embryo_set_text.edc \
+ embryo_timer.edc \
+ external_elm_anchorblock.edc \
+ external_elm_button.edc \
+ external_elm_check.edc \
+ external_elm_panes.edc \
+ external_emotion_elm.edc \
+ toggle_using_filter.edc \
signals-messages.edc \
color-class.edc \
perspective.edc \
@@ -47,6 +60,7 @@ files_DATA = \
test.png \
Vera.ttf \
duck.wav \
+ edje_example.c \
edje-basic.c \
edje-swallow.c \
edje-text.c \
diff --git a/src/lib/Edje.h b/src/lib/Edje.h
index b477dbc..8cb9041 100644
--- a/src/lib/Edje.h
+++ b/src/lib/Edje.h
@@ -4,7 +4,7 @@
These routines are used for Edje.
@mainpage Edje Library Documentation
-@version 1.1
+@version 1.2
@date 2003-2012
Please see the @ref authors page for contact details.
@@ -197,7 +197,7 @@ part of Edje's API:
@author Davide Andreoli <dave@@gurumeditation.it>
@author Sebastian Dransfeld <sd@@tango.flipp.net>
@author Tom Hacohen <tom@@stosb.com>
-@author Aharon Hillel <a.hillel@@partner.samsung.com>
+@author Aharon Hillel <a.hillel@@samsung.com>
@author Shilpa Singh <shilpa.singh@samsung.com> <shilpasingh.o@gmail.com>
@author Mike Blumenkrantz <michael.blumenkrantz@gmail.com
@author Jaehwan Kim <jae.hwan.kim@samsung.com>
@@ -305,7 +305,7 @@ extern "C" {
#endif
#define EDJE_VERSION_MAJOR 1
-#define EDJE_VERSION_MINOR 2
+#define EDJE_VERSION_MINOR 6
typedef struct _Edje_Version
{
@@ -382,7 +382,8 @@ typedef enum _Edje_Part_Type
EDJE_PART_TYPE_TABLE = 9,
EDJE_PART_TYPE_EXTERNAL = 10,
EDJE_PART_TYPE_PROXY = 11,
- EDJE_PART_TYPE_LAST = 12
+ EDJE_PART_TYPE_SPACER = 12, /**< @since 1.7 */
+ EDJE_PART_TYPE_LAST = 13
} Edje_Part_Type;
typedef enum _Edje_Text_Effect
@@ -1382,6 +1383,11 @@ EAPI Eina_List *edje_color_class_list (void);
*
* This function updates all Edje members at the process level which
* belong to this text class with the new font attributes.
+ * If the @p size is 0 then the font size will be kept with the previous size.
+ * If the @p size is less then 0 then the font size will be calculated in the
+ * percentage. For example, if the @p size is -50, then the font size will be
+ * scaled to half of the original size and if the @p size is -10 then the font
+ * size will be scaled as much as 0.1x.
*
* @see edje_text_class_get().
*
@@ -3168,18 +3174,40 @@ EAPI void *edje_object_text_markup_filter_callback_del(Evas_Object *obj, const c
EAPI void *edje_object_text_markup_filter_callback_del_full(Evas_Object *obj, const char *part, Edje_Markup_Filter_Cb func, void *data);
/**
- * @brief Swallows an object into the edje.
+ * @brief "Swallows" an object into one of the Edje object @c SWALLOW
+ * parts.
*
- * @param obj A valid Evas_Object handle
- * @param part The part name
- * @param obj_swallow The object to swallow
+ * @param obj A valid Edje object handle
+ * @param part The swallow part's name
+ * @param obj_swallow The object to occupy that part
+ *
+ * Swallowing an object into an Edje object is, for a given part of
+ * type @c SWALLOW in the EDC group which gave life to @a obj, to set
+ * an external object to be controlled by @a obj, being displayed
+ * exactly over that part's region inside the whole Edje object's
+ * viewport.
*
- * Swallows the object into the edje part so that all geometry changes
- * for the part affect the swallowed object. (e.g. resize, move, show,
- * raise/lower, etc.).
+ * From this point on, @a obj will have total control over @a
+ * obj_swallow's geometry and visibility. For instance, if @a obj is
+ * visible, as in @c evas_object_show(), the swallowed object will be
+ * visible too -- if the given @c SWALLOW part it's in is also
+ * visible. Other actions on @a obj will also reflect on the swallowed
+ * object as well (e.g. resizing, moving, raising/lowering, etc.).
+ *
+ * Finally, all internal changes to @a part, specifically, will
+ * reflect on the displaying of @a obj_swallow, for example state
+ * changes leading to different visibility states, geometries,
+ * positions, etc.
*
* If an object has already been swallowed into this part, then it
- * will first be unswallowed before the new object is swallowed.
+ * will first be unswallowed (as in edje_object_part_unswallow())
+ * before the new object is swallowed.
+ *
+ * @note @a obj @b won't delete the swallowed object once it is
+ * deleted -- @a obj_swallow will get to an unparented state again.
+ *
+ * For more details on EDC @c SWALLOW parts, see @ref edcref "syntax
+ * reference".
*/
EAPI Eina_Bool edje_object_part_swallow (Evas_Object *obj, const char *part, Evas_Object *obj_swallow);
@@ -3646,6 +3674,15 @@ EAPI Evas_Object *edje_object_part_box_remove_at (Evas_Object *obj, con
EAPI Eina_Bool edje_object_part_box_remove_all (Evas_Object *obj, const char *part, Eina_Bool clear);
/**
+ * @brief Retrieve a list all accessibility part names
+ *
+ * @param obj A valid Evas_Object handle
+ * @return A list all accessibility part names on @p obj
+ * @since 1.7.0
+ */
+EAPI Eina_List * edje_object_access_part_list_get (const Evas_Object *obj);
+
+/**
* @brief Retrieve a child from a table
*
* @param obj A valid Evas_Object handle
@@ -3654,7 +3691,7 @@ EAPI Eina_Bool edje_object_part_box_remove_all (Evas_Object *obj, con
* @param row The row of the child to get
* @return The child Evas_Object
*/
-EAPI Evas_Object *edje_object_part_table_child_get (Evas_Object *obj, const char *part, unsigned int col, unsigned int row);
+EAPI Evas_Object *edje_object_part_table_child_get (const Evas_Object *obj, const char *part, unsigned int col, unsigned int row);
/**
* @brief Packs an object into the table.
diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am
index 5a76ef3..6f0edad 100644
--- a/src/lib/Makefile.am
+++ b/src/lib/Makefile.am
@@ -12,6 +12,7 @@ AM_CPPFLAGS = \
@EVIL_CFLAGS@ \
@EDJE_CFLAGS@ \
@ECORE_IMF_CFLAGS@ \
+@EIO_CFLAGS@ \
@EFL_EDJE_BUILD@ \
@REMIX_CFLAGS@ \
@SNDFILE_CFLAGS@
@@ -114,6 +115,10 @@ edje_amalgamation.c: $(base_sources) Makefile
@echo "# include <Ecore_IMF.h>" >> edje_amalgamation.c
@echo "#endif" >> edje_amalgamation.c
+ @echo "#ifdef HAVE_EIO" >> edje_amalgamation.c
+ @echo "# include <Eio.h>" >> edje_amalgamation.c
+ @echo "#endif" >> edje_amalgamation.c
+
@echo "#include <edje_private.h>" >> edje_amalgamation.c
@for f in $(base_sources); do \
@@ -123,7 +128,7 @@ edje_amalgamation.c: $(base_sources) Makefile
file="$$f" ; \
fi ; \
echo "/* file: $$file */" >> edje_amalgamation.c; \
- grep -v -e '^# *include \+.\(config\|\|Evil\|Eina\|Eet\|Evas\|Ecore\|Embryo\|Ecore_IMF\|string\|math\|limits\|sys/stat\|errno\|time\|unistd\|locale\|lua\|lauxlib\|edje_private\)[.]h.*' $$file >> edje_amalgamation.c; \
+ grep -v -e '^# *include \+.\(config\|\|Evil\|Eina\|Eet\|Evas\|Ecore\|Embryo\|Ecore_IMF\|Eio\|string\|math\|limits\|sys/stat\|errno\|time\|unistd\|locale\|lua\|lauxlib\|edje_private\)[.]h.*' $$file >> edje_amalgamation.c; \
done
@echo "edje_amalgamation.c generated"
@@ -131,7 +136,7 @@ else
libedje_la_SOURCES = $(base_sources)
endif
-libedje_la_LIBADD = @EDJE_LIBS@ @ECORE_IMF_LIBS@ @EVIL_LIBS@ @REMIX_LIBS@ @SNDFILE_LIBS@ -lm
+libedje_la_LIBADD = @EDJE_LIBS@ @ECORE_IMF_LIBS@ @EIO_LIBS@ @EVIL_LIBS@ @REMIX_LIBS@ @SNDFILE_LIBS@ -lm
libedje_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -version-info @version_info@ @release_info@
EXTRA_DIST = edje_private.h edje_container.h edje_convert.h
diff --git a/src/lib/edje_cache.c b/src/lib/edje_cache.c
index 477e6ec..77095e6 100644
--- a/src/lib/edje_cache.c
+++ b/src/lib/edje_cache.c
@@ -63,6 +63,7 @@ _edje_file_coll_open(Edje_File *edf, const char *coll)
INIT_EMP_BOTH(BOX, Edje_Part_Description_Box, ce);
INIT_EMP_BOTH(TABLE, Edje_Part_Description_Table, ce);
INIT_EMP_BOTH(EXTERNAL, Edje_Part_Description_External, ce);
+ INIT_EMP_BOTH(SPACER, Edje_Part_Description_Common, ce);
INIT_EMP(part, Edje_Part, ce);
snprintf(buf, sizeof(buf), "edje/collections/%i", id);
@@ -127,12 +128,57 @@ _edje_file_coll_open(Edje_File *edf, const char *coll)
return edc;
}
+#ifdef HAVE_EIO
+static Eina_Bool
+_edje_file_warn(void *data)
+{
+ Edje_File *edf = data;
+ Eina_List *l, *ll;
+ Edje *ed;
+
+ edf->references++;
+
+ EINA_LIST_FOREACH(edf->edjes, l, ed)
+ _edje_ref(ed);
+
+ EINA_LIST_FOREACH(edf->edjes, l, ed)
+ {
+ _edje_emit(ed, "edje,change,file", "edje");
+ }
+
+ EINA_LIST_FOREACH_SAFE(edf->edjes, l, ll, ed)
+ _edje_unref(ed);
+
+ edf->references--;
+
+ edf->timeout = NULL;
+ return EINA_FALSE;
+}
+
+static Eina_Bool
+_edje_file_change(void *data, int ev_type __UNUSED__, void *event)
+{
+ Edje_File *edf = data;
+ Eio_Monitor_Event *ev = event;
+
+ if (ev->monitor == edf->monitor)
+ {
+ if (edf->timeout) ecore_timer_del(edf->timeout);
+ edf->timeout = ecore_timer_add(0.5, _edje_file_warn, edf);
+ }
+ return ECORE_CALLBACK_PASS_ON;
+}
+#endif
+
static Edje_File *
_edje_file_open(const char *file, const char *coll, int *error_ret, Edje_Part_Collection **edc_ret, time_t mtime)
{
Edje_File *edf;
Edje_Part_Collection *edc;
Eet_File *ef;
+#ifdef HAVE_EIO
+ Ecore_Event_Handler *ev;
+#endif
ef = eet_open(file, EET_FILE_MODE_READ);
if (!ef)
@@ -150,6 +196,17 @@ _edje_file_open(const char *file, const char *coll, int *error_ret, Edje_Part_Co
edf->ef = ef;
edf->mtime = mtime;
+#ifdef HAVE_EIO
+ edf->monitor = eio_monitor_add(file);
+ ev = ecore_event_handler_add(EIO_MONITOR_FILE_DELETED, _edje_file_change, edf);
+ edf->handlers = eina_list_append(edf->handlers, ev);
+ ev = ecore_event_handler_add(EIO_MONITOR_FILE_MODIFIED, _edje_file_change, edf);
+ edf->handlers = eina_list_append(edf->handlers, ev);
+ ev = ecore_event_handler_add(EIO_MONITOR_FILE_CREATED, _edje_file_change, edf);
+ edf->handlers = eina_list_append(edf->handlers, ev);
+ ev = ecore_event_handler_add(EIO_MONITOR_SELF_DELETED, _edje_file_change, edf);
+ edf->handlers = eina_list_append(edf->handlers, ev);
+#endif
if (edf->version != EDJE_FILE_VERSION)
{
@@ -203,7 +260,7 @@ _edje_file_dangling(Edje_File *edf)
}
Edje_File *
-_edje_cache_file_coll_open(const char *file, const char *coll, int *error_ret, Edje_Part_Collection **edc_ret)
+_edje_cache_file_coll_open(const char *file, const char *coll, int *error_ret, Edje_Part_Collection **edc_ret, Edje *ed)
{
Edje_File *edf;
Eina_List *l, *hist;
@@ -259,6 +316,12 @@ open_new:
if (!edf)
return NULL;
+#ifdef HAVE_EIO
+ if (ed) edf->edjes = eina_list_append(edf->edjes, ed);
+#else
+ (void) ed;
+#endif
+
eina_hash_add(_edje_file_hash, file, edf);
return edf;
@@ -364,6 +427,12 @@ open:
edc->checked = 1;
}
}
+#ifdef HAVE_EIO
+ if (edc && ed) edf->edjes = eina_list_append(edf->edjes, ed);
+#else
+ (void) ed;
+#endif
+
if (edc_ret) *edc_ret = edc;
return edf;
diff --git a/src/lib/edje_calc.c b/src/lib/edje_calc.c
index 5d2ed08..8d57e52 100644
--- a/src/lib/edje_calc.c
+++ b/src/lib/edje_calc.c
@@ -232,6 +232,12 @@ _edje_get_description_by_orientation(Edje *ed, Edje_Part_Description_Common *src
ce->count.GROUP++;
memsize = sizeof(Edje_Part_Description_Common);
break;
+ case EDJE_PART_TYPE_SPACER:
+ desc_rtl = eina_mempool_malloc(ce->mp_rtl.SPACER,
+ sizeof (Edje_Part_Description_Common));
+ ce->count.SPACER++;
+ memsize = sizeof(Edje_Part_Description_Common);
+ break;
EDIT_ALLOC_POOL_RTL(TEXT, Text, text);
EDIT_ALLOC_POOL_RTL(TEXTBLOCK, Text, text);
EDIT_ALLOC_POOL_RTL(IMAGE, Image, image);
@@ -241,7 +247,7 @@ _edje_get_description_by_orientation(Edje *ed, Edje_Part_Description_Common *src
EDIT_ALLOC_POOL_RTL(EXTERNAL, External, external_params);
}
- if(desc_rtl)
+ if (desc_rtl)
memcpy(desc_rtl, src, memsize);
_edje_part_make_rtl(desc_rtl);
@@ -402,7 +408,7 @@ _edje_real_part_image_set(Edje *ed, Edje_Real_Part *ep, FLOAT_T pos)
FROM_DOUBLE(0.5))));
if (image_num > (image_count - 1))
image_num = image_count - 1;
- if (image_num == 0)
+ if (image_num <= 0)
{
image_id = _edje_image_find(ep->object, ed,
&ep->param1.set,
@@ -414,10 +420,10 @@ _edje_real_part_image_set(Edje *ed, Edje_Real_Part *ep, FLOAT_T pos)
{
if (image_num == (image_count - 1))
{
- image_id = _edje_image_find(ep->object, ed,
- &ep->param2->set,
- (Edje_Part_Description_Image*) ep->param2->description,
- NULL);
+ image_id = _edje_image_find(ep->object, ed,
+ &ep->param2->set,
+ (Edje_Part_Description_Image*) ep->param2->description,
+ NULL);
}
else
{
@@ -429,11 +435,13 @@ _edje_real_part_image_set(Edje *ed, Edje_Real_Part *ep, FLOAT_T pos)
}
if (image_id < 0)
{
- ERR("¨Part \"%s\" has description, "
- "\"%s\" %3.3f with a missing image id!!!",
+ ERR("¨Part \"%s\" description, "
+ "\"%s\" %3.3f with image %i index has a missing image id in a set of %i !!!",
ep->part->name,
ep->param1.description->state.name,
- ep->param1.description->state.value);
+ ep->param1.description->state.value,
+ image_num,
+ image_count);
}
else
{
@@ -661,6 +669,77 @@ _edje_recalc_do(Edje *ed)
edje_object_size_min_calc(ed->obj, &w, &h);
evas_object_size_hint_min_set(ed->obj, w, h);
}
+
+ if (!ed->collection) return ;
+
+ for (i = 0; i < ed->collection->limits.parts_count; i++)
+ {
+ const char *name;
+ unsigned char limit;
+ int part;
+
+ part = ed->collection->limits.parts[i].part;
+ name = ed->collection->parts[part]->name;
+ limit = ed->table_parts[part]->chosen_description->limit;
+ switch (limit)
+ {
+ case 0:
+ ed->collection->limits.parts[i].width = EDJE_PART_LIMIT_UNKNOWN;
+ ed->collection->limits.parts[i].height = EDJE_PART_LIMIT_UNKNOWN;
+ break;
+ case 1:
+ ed->collection->limits.parts[i].height = EDJE_PART_LIMIT_UNKNOWN;
+ break;
+ case 2:
+ ed->collection->limits.parts[i].width = EDJE_PART_LIMIT_UNKNOWN;
+ break;
+ case 3:
+ break;
+ }
+
+ if ((limit & 1) == 1)
+ {
+ if (ed->table_parts[part]->w > 0 &&
+ (ed->collection->limits.parts[i].width != EDJE_PART_LIMIT_OVER))
+ {
+ ed->collection->limits.parts[i].width = EDJE_PART_LIMIT_OVER;
+ _edje_emit(ed, "limit,width,over", name);
+ }
+ else if (ed->table_parts[part]->w < 0 &&
+ ed->collection->limits.parts[i].width != EDJE_PART_LIMIT_BELOW)
+ {
+ ed->collection->limits.parts[i].width = EDJE_PART_LIMIT_BELOW;
+ _edje_emit(ed, "limit,width,below", name);
+ }
+ else if (ed->table_parts[part]->w == 0 &&
+ ed->collection->limits.parts[i].width != EDJE_PART_LIMIT_ZERO)
+ {
+ ed->collection->limits.parts[i].width = EDJE_PART_LIMIT_ZERO;
+ _edje_emit(ed, "limit,width,zero", name);
+ }
+ }
+ if ((limit & 2) == 2)
+ {
+ if (ed->table_parts[part]->h > 0 &&
+ (ed->collection->limits.parts[i].height != EDJE_PART_LIMIT_OVER))
+ {
+ ed->collection->limits.parts[i].height = EDJE_PART_LIMIT_OVER;
+ _edje_emit(ed, "limit,height,over", name);
+ }
+ else if (ed->table_parts[part]->h < 0 &&
+ ed->collection->limits.parts[i].height != EDJE_PART_LIMIT_BELOW)
+ {
+ ed->collection->limits.parts[i].height = EDJE_PART_LIMIT_BELOW;
+ _edje_emit(ed, "limit,height,below", name);
+ }
+ else if (ed->table_parts[part]->h == 0 &&
+ ed->collection->limits.parts[i].height != EDJE_PART_LIMIT_ZERO)
+ {
+ ed->collection->limits.parts[i].height = EDJE_PART_LIMIT_ZERO;
+ _edje_emit(ed, "limit,height,zero", name);
+ }
+ }
+ }
}
void
@@ -1173,7 +1252,33 @@ _edje_part_recalc_single_textblock(FLOAT_T sc,
if (*maxh < *minh) *maxh = *minh;
}
}
- evas_object_textblock_valign_set(ep->object, chosen_desc->text.align.y);
+ if ((chosen_desc->text.fit_x) || (chosen_desc->text.fit_y))
+ {
+ double s = 1.0;
+
+ if (ep->part->scale) s = TO_DOUBLE(sc);
+ evas_object_scale_set(ep->object, s);
+ evas_object_textblock_size_formatted_get(ep->object, &tw, &th);
+ if (chosen_desc->text.fit_x)
+ {
+ if ((tw > 0) && (tw > params->w))
+ {
+ s = (s * params->w) / (double)tw;
+ evas_object_scale_set(ep->object, s);
+ evas_object_textblock_size_formatted_get(ep->object, &tw, &th);
+ }
+ }
+ if (chosen_desc->text.fit_y)
+ {
+ if ((th > 0) && (th > params->h))
+ {
+ s = (s * params->h) / (double)th;
+ evas_object_scale_set(ep->object, s);
+ evas_object_textblock_size_formatted_get(ep->object, &tw, &th);
+ }
+ }
+ }
+ evas_object_textblock_valign_set(ep->object, TO_DOUBLE(chosen_desc->text.align.y));
}
}
@@ -2015,23 +2120,26 @@ _edje_part_recalc_single(Edje *ed,
else if (ep->part->type == EDJE_PART_TYPE_PROXY)
_edje_part_recalc_single_fill(ep, &((Edje_Part_Description_Proxy *)desc)->proxy.fill, params);
- /* colors */
- if ((desc->color_class) && (*desc->color_class))
- cc = _edje_color_class_find(ed, desc->color_class);
-
- if (cc)
+ if (ep->part->type != EDJE_PART_TYPE_SPACER)
{
- params->color.r = (((int)cc->r + 1) * desc->color.r) >> 8;
- params->color.g = (((int)cc->g + 1) * desc->color.g) >> 8;
- params->color.b = (((int)cc->b + 1) * desc->color.b) >> 8;
- params->color.a = (((int)cc->a + 1) * desc->color.a) >> 8;
- }
- else
- {
- params->color.r = desc->color.r;
- params->color.g = desc->color.g;
- params->color.b = desc->color.b;
- params->color.a = desc->color.a;
+ /* colors */
+ if ((desc->color_class) && (*desc->color_class))
+ cc = _edje_color_class_find(ed, desc->color_class);
+
+ if (cc)
+ {
+ params->color.r = (((int)cc->r + 1) * desc->color.r) >> 8;
+ params->color.g = (((int)cc->g + 1) * desc->color.g) >> 8;
+ params->color.b = (((int)cc->b + 1) * desc->color.b) >> 8;
+ params->color.a = (((int)cc->a + 1) * desc->color.a) >> 8;
+ }
+ else
+ {
+ params->color.r = desc->color.r;
+ params->color.g = desc->color.g;
+ params->color.b = desc->color.b;
+ params->color.a = desc->color.a;
+ }
}
/* visible */
@@ -2049,6 +2157,8 @@ _edje_part_recalc_single(Edje *ed,
params->type.common.spec.image.t = img_desc->image.border.t;
params->type.common.spec.image.b = img_desc->image.border.b;
+
+ params->type.common.spec.image.border_scale_by = img_desc->image.border.scale_by;
break;
}
case EDJE_PART_TYPE_TEXT:
@@ -2087,6 +2197,7 @@ _edje_part_recalc_single(Edje *ed,
break;
}
+ case EDJE_PART_TYPE_SPACER:
case EDJE_PART_TYPE_RECTANGLE:
case EDJE_PART_TYPE_BOX:
case EDJE_PART_TYPE_TABLE:
@@ -2158,6 +2269,9 @@ _edje_proxy_recalc_apply(Edje *ed, Edje_Real_Part *ep, Edje_Calc_Params *p3, Edj
case EDJE_PART_TYPE_EXTERNAL:
evas_object_image_source_set(ep->object, pp->swallowed_object);
break;
+ case EDJE_PART_TYPE_SPACER:
+ /* FIXME: detect that at compile time and prevent it */
+ break;
}
evas_object_image_fill_set(ep->object, p3->type.common.fill.x, p3->type.common.fill.y,
@@ -2177,9 +2291,9 @@ _edje_image_recalc_apply(Edje *ed, Edje_Real_Part *ep, Edje_Calc_Params *p3, Edj
evas_object_image_smooth_scale_set(ep->object, p3->smooth);
if (chosen_desc->image.border.scale)
{
- if (chosen_desc->image.border.scale_by > FROM_DOUBLE(0.0))
+ if (p3->type.common.spec.image.border_scale_by > FROM_DOUBLE(0.0))
{
- FLOAT_T sc2 = MUL(sc, chosen_desc->image.border.scale_by);
+ FLOAT_T sc2 = MUL(sc, p3->type.common.spec.image.border_scale_by);
evas_object_image_border_scale_set(ep->object, TO_DOUBLE(sc2));
}
else
@@ -2187,9 +2301,9 @@ _edje_image_recalc_apply(Edje *ed, Edje_Real_Part *ep, Edje_Calc_Params *p3, Edj
}
else
{
- if (chosen_desc->image.border.scale_by > FROM_DOUBLE(0.0))
+ if (p3->type.common.spec.image.border_scale_by > FROM_DOUBLE(0.0))
evas_object_image_border_scale_set
- (ep->object, TO_DOUBLE(chosen_desc->image.border.scale_by));
+ (ep->object, TO_DOUBLE(p3->type.common.spec.image.border_scale_by));
else
evas_object_image_border_scale_set(ep->object, 1.0);
}
@@ -2410,6 +2524,8 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta
return;
}
+ pos = ep->description_pos;
+
if (ep->part->type == EDJE_PART_TYPE_PROXY)
{
Edje_Real_Part *pp;
@@ -2534,10 +2650,9 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta
#endif
}
- pos = ep->description_pos;
- pos2 = pos;
- if (pos2 < ZERO) pos2 = ZERO;
- else if (pos2 > FROM_INT(1)) pos2 = FROM_INT(1);
+ pos2 = pos;
+ if (pos2 < ZERO) pos2 = ZERO;
+ else if (pos2 > FROM_INT(1)) pos2 = FROM_INT(1);
beginning_pos = (pos < FROM_DOUBLE(0.5));
part_type = ep->part->type;
@@ -2598,6 +2713,7 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta
p3->type.common.spec.image.r = INTP(p1->type.common.spec.image.r, p2->type.common.spec.image.r, pos);
p3->type.common.spec.image.t = INTP(p1->type.common.spec.image.t, p2->type.common.spec.image.t, pos);
p3->type.common.spec.image.b = INTP(p1->type.common.spec.image.b, p2->type.common.spec.image.b, pos);
+ p3->type.common.spec.image.border_scale_by = INTP(p1->type.common.spec.image.border_scale_by, p2->type.common.spec.image.border_scale_by, pos);
case EDJE_PART_TYPE_PROXY:
p3->type.common.fill.x = INTP(p1->type.common.fill.x, p2->type.common.fill.x, pos);
p3->type.common.fill.y = INTP(p1->type.common.fill.y, p2->type.common.fill.y, pos);
@@ -2784,6 +2900,9 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta
/* FIXME: definitivly remove this code when we switch to new format. */
abort();
break;
+ case EDJE_PART_TYPE_SPACER:
+ /* We really should do nothing on SPACER part */
+ break;
}
/* Some object need special recalc. */
@@ -2815,6 +2934,9 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta
/* FIXME: definitivly remove this code when we switch to new format. */
abort();
break;
+ case EDJE_PART_TYPE_SPACER:
+ /* We really should do nothing on SPACER part */
+ break;
}
if (ep->swallowed_object)
@@ -2838,13 +2960,13 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta
mo = ep->swallowed_object;
}
else mo = ep->object;
- if (chosen_desc->map.on)
+ if (chosen_desc->map.on && ep->part->type != EDJE_PART_TYPE_SPACER)
{
- Evas_Map *map;
+ static Evas_Map *map = NULL;
ed->have_mapped_part = 1;
// create map and populate with part geometry
- map = evas_map_new(4);
+ if (!map) map = evas_map_new(4);
evas_map_util_points_populate_from_object(map, ep->object);
if (ep->part->type == EDJE_PART_TYPE_IMAGE)
{
@@ -2898,7 +3020,6 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta
evas_object_map_set(mo, map);
evas_object_map_enable_set(mo, 1);
- evas_map_free(map);
}
else
{
@@ -2922,5 +3043,4 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta
ep->invalidate = 0;
}
#endif
-
}
diff --git a/src/lib/edje_data.c b/src/lib/edje_data.c
index 46fd521..da30329 100644
--- a/src/lib/edje_data.c
+++ b/src/lib/edje_data.c
@@ -30,6 +30,7 @@ Eet_Data_Descriptor *_edje_edd_edje_part = NULL;
Eet_Data_Descriptor *_edje_edd_edje_part_pointer = NULL;
Eet_Data_Descriptor *_edje_edd_edje_part_description_variant = NULL;
Eet_Data_Descriptor *_edje_edd_edje_part_description_rectangle = NULL;
+Eet_Data_Descriptor *_edje_edd_edje_part_description_spacer = NULL;
Eet_Data_Descriptor *_edje_edd_edje_part_description_swallow = NULL;
Eet_Data_Descriptor *_edje_edd_edje_part_description_group = NULL;
Eet_Data_Descriptor *_edje_edd_edje_part_description_image = NULL;
@@ -41,6 +42,7 @@ Eet_Data_Descriptor *_edje_edd_edje_part_description_table = NULL;
Eet_Data_Descriptor *_edje_edd_edje_part_description_external = NULL;
Eet_Data_Descriptor *_edje_edd_edje_part_description_variant_list = NULL;
Eet_Data_Descriptor *_edje_edd_edje_part_description_rectangle_pointer = NULL;
+Eet_Data_Descriptor *_edje_edd_edje_part_description_spacer_pointer = NULL;
Eet_Data_Descriptor *_edje_edd_edje_part_description_swallow_pointer = NULL;
Eet_Data_Descriptor *_edje_edd_edje_part_description_group_pointer = NULL;
Eet_Data_Descriptor *_edje_edd_edje_part_description_image_pointer = NULL;
@@ -53,6 +55,7 @@ Eet_Data_Descriptor *_edje_edd_edje_part_description_external_pointer = NULL;
Eet_Data_Descriptor *_edje_edd_edje_part_image_id = NULL;
Eet_Data_Descriptor *_edje_edd_edje_part_image_id_pointer = NULL;
Eet_Data_Descriptor *_edje_edd_edje_external_param = NULL;
+Eet_Data_Descriptor *_edje_edd_edje_part_limit = NULL;
#define EMP(Type, Minus) \
Eina_Mempool *_emp_##Type = NULL; \
@@ -83,6 +86,7 @@ EMP(GROUP, group);
EMP(BOX, box);
EMP(TABLE, table);
EMP(EXTERNAL, external);
+EMP(SPACER, spacer);
EMP(part, part);
#define FREED(eed) \
@@ -105,7 +109,8 @@ struct {
{ EDJE_PART_TYPE_BOX, "box" },
{ EDJE_PART_TYPE_TABLE, "table" },
{ EDJE_PART_TYPE_EXTERNAL, "external" },
- { EDJE_PART_TYPE_PROXY, "proxy" }
+ { EDJE_PART_TYPE_PROXY, "proxy" },
+ { EDJE_PART_TYPE_SPACER, "spacer" }
};
static const char *
@@ -187,6 +192,7 @@ _edje_edd_shutdown(void)
FREED(_edje_edd_edje_part_pointer);
FREED(_edje_edd_edje_part_description_variant);
FREED(_edje_edd_edje_part_description_rectangle);
+ FREED(_edje_edd_edje_part_description_spacer);
FREED(_edje_edd_edje_part_description_swallow);
FREED(_edje_edd_edje_part_description_group);
FREED(_edje_edd_edje_part_description_image);
@@ -198,6 +204,7 @@ _edje_edd_shutdown(void)
FREED(_edje_edd_edje_part_description_external);
FREED(_edje_edd_edje_part_description_variant_list);
FREED(_edje_edd_edje_part_description_rectangle_pointer);
+ FREED(_edje_edd_edje_part_description_spacer_pointer);
FREED(_edje_edd_edje_part_description_swallow_pointer);
FREED(_edje_edd_edje_part_description_group_pointer);
FREED(_edje_edd_edje_part_description_image_pointer);
@@ -212,6 +219,7 @@ _edje_edd_shutdown(void)
FREED(_edje_edd_edje_external_param);
FREED(_edje_edd_edje_image_directory_set);
FREED(_edje_edd_edje_image_directory_set_entry);
+ FREED(_edje_edd_edje_part_limit);
}
#define EDJE_DEFINE_POINTER_TYPE(Type, Name) \
@@ -329,6 +337,7 @@ _edje_edd_init(void)
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection_directory_entry, Edje_Part_Collection_Directory_Entry, "count.BOX", count.BOX, EET_T_INT);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection_directory_entry, Edje_Part_Collection_Directory_Entry, "count.TABLE", count.TABLE, EET_T_INT);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection_directory_entry, Edje_Part_Collection_Directory_Entry, "count.EXTERNAL", count.EXTERNAL, EET_T_INT);
+ EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection_directory_entry, Edje_Part_Collection_Directory_Entry, "count.SPACER", count.SPACER, EET_T_INT);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection_directory_entry, Edje_Part_Collection_Directory_Entry, "count.part", count.part, EET_T_INT);
EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_Style_Tag);
@@ -447,6 +456,7 @@ _edje_edd_init(void)
EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "state.name", state.name, EET_T_STRING); \
EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "state.value", state.value, EET_T_DOUBLE); \
EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "visible", visible, EET_T_CHAR); \
+ EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "limit", limit, EET_T_CHAR); \
EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "align.x", align.x, EDJE_T_FLOAT); \
EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "align.y", align.y, EDJE_T_FLOAT); \
EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "fixed.w", fixed.w, EET_T_UCHAR); \
@@ -563,6 +573,13 @@ _edje_edd_init(void)
EDJE_DATA_DESCRIPTOR_DESCRIPTION_COMMON(_edje_edd_edje_part_description_rectangle, Edje_Part_Description_Common);
EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_Part_Description_Common);
+ eddc.func.mem_free = mem_free_spacer;
+ eddc.func.mem_alloc = mem_alloc_spacer;
+ _edje_edd_edje_part_description_spacer =
+ eet_data_descriptor_file_new(&eddc);
+ EDJE_DATA_DESCRIPTOR_DESCRIPTION_COMMON(_edje_edd_edje_part_description_spacer, Edje_Part_Description_Common);
+
+ EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_Part_Description_Common);
eddc.func.mem_free = mem_free_swallow;
eddc.func.mem_alloc = mem_alloc_swallow;
_edje_edd_edje_part_description_swallow =
@@ -726,6 +743,7 @@ _edje_edd_init(void)
EDJE_DATA_DESCRIPTOR_DESCRIPTION_COMMON_SUB(_edje_edd_edje_part_description_external, Edje_Part_Description_External, common);
EET_DATA_DESCRIPTOR_ADD_LIST(_edje_edd_edje_part_description_external, Edje_Part_Description_External, "external_params", external_params, _edje_edd_edje_external_param);
+ EDJE_DEFINE_POINTER_TYPE(Part_Description_Common, part_description_spacer);
EDJE_DEFINE_POINTER_TYPE(Part_Description_Common, part_description_rectangle);
EDJE_DEFINE_POINTER_TYPE(Part_Description_Common, part_description_swallow);
EDJE_DEFINE_POINTER_TYPE(Part_Description_Common, part_description_group);
@@ -742,6 +760,7 @@ _edje_edd_init(void)
eddc.func.type_set = _edje_description_variant_type_set;
_edje_edd_edje_part_description_variant = eet_data_descriptor_file_new(&eddc);
+ EET_DATA_DESCRIPTOR_ADD_MAPPING(_edje_edd_edje_part_description_variant, "spacer", _edje_edd_edje_part_description_spacer);
EET_DATA_DESCRIPTOR_ADD_MAPPING(_edje_edd_edje_part_description_variant, "rectangle", _edje_edd_edje_part_description_rectangle);
EET_DATA_DESCRIPTOR_ADD_MAPPING(_edje_edd_edje_part_description_variant, "swallow", _edje_edd_edje_part_description_swallow);
EET_DATA_DESCRIPTOR_ADD_MAPPING(_edje_edd_edje_part_description_variant, "group", _edje_edd_edje_part_description_group);
@@ -767,6 +786,7 @@ _edje_edd_init(void)
_edje_edd_edje_part_description_variant_list = eet_data_descriptor_file_new(&eddc);
EDJE_ADD_ARRAY_MAPPING(_edje_edd_edje_part_description_variant_list, "rectangle", rectangle);
+ EDJE_ADD_ARRAY_MAPPING(_edje_edd_edje_part_description_variant_list, "spacer", spacer);
EDJE_ADD_ARRAY_MAPPING(_edje_edd_edje_part_description_variant_list, "swallow", swallow);
EDJE_ADD_ARRAY_MAPPING(_edje_edd_edje_part_description_variant_list, "group", group);
EDJE_ADD_ARRAY_MAPPING(_edje_edd_edje_part_description_variant_list, "image", image);
@@ -846,9 +866,15 @@ _edje_edd_init(void)
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "select_mode", select_mode, EET_T_UCHAR);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "cursor_mode", cursor_mode, EET_T_UCHAR);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "multiline", multiline, EET_T_UCHAR);
+ EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "access", access, EET_T_UCHAR);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "api.name", api.name, EET_T_STRING);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "api.description", api.description, EET_T_STRING);
+ EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_Part_Limit);
+ _edje_edd_edje_part_limit = eet_data_descriptor_file_new(&eddc);
+
+ EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_limit, Edje_Part_Limit, "part", part, EET_T_INT);
+
EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_Part_Collection);
_edje_edd_edje_part_collection =
eet_data_descriptor_file_new(&eddc);
@@ -866,6 +892,7 @@ _edje_edd_init(void)
EDJE_DEFINE_POINTER_TYPE(Limit, limit);
EET_DATA_DESCRIPTOR_ADD_VAR_ARRAY(_edje_edd_edje_part_collection, Edje_Part_Collection, "limits.vertical", limits.vertical, _edje_edd_edje_limit_pointer);
EET_DATA_DESCRIPTOR_ADD_VAR_ARRAY(_edje_edd_edje_part_collection, Edje_Part_Collection, "limits.horizontal", limits.horizontal, _edje_edd_edje_limit_pointer);
+ EET_DATA_DESCRIPTOR_ADD_VAR_ARRAY(_edje_edd_edje_part_collection, Edje_Part_Collection, "limits.parts", limits.parts, _edje_edd_edje_part_limit);
EET_DATA_DESCRIPTOR_ADD_HASH(_edje_edd_edje_part_collection, Edje_Part_Collection, "data", data, _edje_edd_edje_string);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection, Edje_Part_Collection, "id", id, EET_T_INT);
diff --git a/src/lib/edje_edit.c b/src/lib/edje_edit.c
index eec5e04..3991542 100644
--- a/src/lib/edje_edit.c
+++ b/src/lib/edje_edit.c
@@ -1021,7 +1021,7 @@ edje_edit_group_add(Evas_Object *obj, const char *name)
//cd = _alloc(sizeof(Code));
//codes = eina_list_append(codes, cd);
#define EDIT_EMN(Tp, Sz, Ce) \
- Ce->mp.Tp = eina_mempool_add("chained_mempool", #Tp, NULL, sizeof (Sz), 10);
+ Ce->mp.Tp = eina_mempool_add("chained_mempool", #Tp, NULL, sizeof (Sz), 8);
EDIT_EMN(RECTANGLE, Edje_Part_Description_Common, de);
EDIT_EMN(TEXT, Edje_Part_Description_Text, de);
@@ -1032,6 +1032,7 @@ edje_edit_group_add(Evas_Object *obj, const char *name)
EDIT_EMN(BOX, Edje_Part_Description_Box, de);
EDIT_EMN(TABLE, Edje_Part_Description_Table, de);
EDIT_EMN(EXTERNAL, Edje_Part_Description_External, de);
+ EDIT_EMN(SPACER, Edje_Part_Description_Common, de);
EDIT_EMN(part, Edje_Part, de);
ed->file->collection_cache = eina_list_prepend(ed->file->collection_cache, pc);
@@ -2118,7 +2119,7 @@ _edje_edit_real_part_add(Evas_Object *obj, const char *name, Edje_Part_Type type
}
else if (ep->type == EDJE_PART_TYPE_TEXTBLOCK)
rp->object = evas_object_textblock_add(ed->base.evas);
- else
+ else if (ep->type != EDJE_PART_TYPE_SPACER)
ERR("wrong part type %i!", ep->type);
if (rp->object)
{
@@ -2969,6 +2970,10 @@ _edje_edit_state_alloc(int type, Edje *ed)
pd = eina_mempool_malloc(ce->mp.RECTANGLE, sizeof (Edje_Part_Description_Common));
ce->count.RECTANGLE++;
break;
+ case EDJE_PART_TYPE_SPACER:
+ pd = eina_mempool_malloc(ce->mp.SPACER, sizeof (Edje_Part_Description_Common));
+ ce->count.SPACER++;
+ break;
case EDJE_PART_TYPE_SWALLOW:
pd = eina_mempool_malloc(ce->mp.SWALLOW, sizeof (Edje_Part_Description_Common));
ce->count.SWALLOW++;
@@ -6572,7 +6577,7 @@ edje_edit_script_error_list_get(Evas_Object *obj)
#define BUF_APPENDF(FMT, ...) \
ret &= eina_strbuf_append_printf(buf, FMT, ##__VA_ARGS__)
-static const char *types[] = {"NONE", "RECT", "TEXT", "IMAGE", "SWALLOW", "TEXTBLOCK", "GRADIENT", "GROUP", "BOX", "TABLE", "EXTERNAL"};
+static const char *types[] = {"NONE", "RECT", "TEXT", "IMAGE", "SWALLOW", "TEXTBLOCK", "GRADIENT", "GROUP", "BOX", "TABLE", "EXTERNAL", "SPACER"};
static const char *effects[] = {"NONE", "PLAIN", "OUTLINE", "SOFT_OUTLINE", "SHADOW", "SOFT_SHADOW", "OUTLINE_SHADOW", "OUTLINE_SOFT_SHADOW ", "FAR_SHADOW ", "FAR_SOFT_SHADOW", "GLOW"};
static const char *prefers[] = {"NONE", "VERTICAL", "HORIZONTAL", "BOTH"};
diff --git a/src/lib/edje_embryo.c b/src/lib/edje_embryo.c
index 1ad2377..ffcbc64 100644
--- a/src/lib/edje_embryo.c
+++ b/src/lib/edje_embryo.c
@@ -871,14 +871,20 @@ _edje_embryo_fn_set_state(Embryo_Program *ep, Embryo_Cell *params)
double value = 0.0;
Edje_Real_Part *rp;
- CHKPARAM(3);
+ if (!(HASNPARAMS(2) || HASNPARAMS(3))) return -1;
+
ed = embryo_program_data_get(ep);
GETSTR(state, params[2]);
if ((!state)) return 0;
part_id = params[1];
if (part_id < 0) return 0;
- f = EMBRYO_CELL_TO_FLOAT(params[3]);
- value = (double)f;
+ if (HASNPARAMS(3))
+ {
+ f = EMBRYO_CELL_TO_FLOAT(params[3]);
+ value = (double)f;
+ }
+ else
+ value = 0.0;
rp = ed->table_parts[part_id % ed->table_parts_size];
if (rp)
{
diff --git a/src/lib/edje_entry.c b/src/lib/edje_entry.c
index 09109f6..0e074b9 100644
--- a/src/lib/edje_entry.c
+++ b/src/lib/edje_entry.c
@@ -1319,10 +1319,15 @@ _range_del_emit(Edje *ed, Evas_Textblock_Cursor *c __UNUSED__, Evas_Object *o __
{
size_t start, end;
char *tmp;
- Edje_Entry_Change_Info *info = calloc(1, sizeof(*info));
- info->insert = EINA_FALSE;
+ Edje_Entry_Change_Info *info;
+
start = evas_textblock_cursor_pos_get(en->sel_start);
end = evas_textblock_cursor_pos_get(en->sel_end);
+ if (start == end)
+ goto noop;
+
+ info = calloc(1, sizeof(*info));
+ info->insert = EINA_FALSE;
info->change.del.start = start;
info->change.del.end = end;
@@ -1333,6 +1338,7 @@ _range_del_emit(Edje *ed, Evas_Textblock_Cursor *c __UNUSED__, Evas_Object *o __
_edje_emit(ed, "entry,changed", en->rp->part->name);
_edje_emit_full(ed, "entry,changed,user", en->rp->part->name, info,
_free_entry_change_info);
+noop:
_sel_clear(en->cursor, en->rp->object, en);
}
@@ -1525,7 +1531,7 @@ _edje_key_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, v
if (shift) _sel_start(en->cursor, rp->object, en);
else _sel_clear(en->cursor, rp->object, en);
}
- /* If control is pressed, go to the start of the word */
+ /* If control is pressed, go to the end of the word */
if (control) evas_textblock_cursor_word_end(en->cursor);
evas_textblock_cursor_char_next(en->cursor);
if (en->select_allow)
@@ -1547,7 +1553,7 @@ _edje_key_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, v
evas_textblock_cursor_char_prev(en->cursor);
evas_textblock_cursor_word_start(en->cursor);
- _sel_extend(en->cursor, rp->object, en);
+ _sel_preextend(en->cursor, rp->object, en);
_range_del_emit(ed, en->cursor, rp->object, en);
}
@@ -2035,8 +2041,9 @@ _edje_part_mouse_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUS
Entry *en;
Evas_Coord x, y, w, h;
// Eina_Bool multiline;
- Evas_Textblock_Cursor *tc;
+ Evas_Textblock_Cursor *tc = NULL;
Eina_Bool dosel = EINA_FALSE;
+ Eina_Bool shift;
if (!rp) return;
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
en = rp->entry_data;
@@ -2063,8 +2070,7 @@ _edje_part_mouse_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUS
}
#endif
- _edje_entry_imf_context_reset(rp);
-
+ shift = evas_key_modifier_is_set(ev->modifiers, "Shift");
en->select_mod_start = EINA_FALSE;
en->select_mod_end = EINA_FALSE;
if (rp->part->select_mode == EDJE_ENTRY_SELECTION_MODE_DEFAULT)
@@ -2077,33 +2083,63 @@ _edje_part_mouse_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUS
if (ev->button == 2) dosel = EINA_FALSE;
if (dosel)
{
+ evas_object_geometry_get(rp->object, &x, &y, &w, &h);
+ cx = ev->canvas.x - x;
+ cy = ev->canvas.y - y;
if (ev->flags & EVAS_BUTTON_TRIPLE_CLICK)
{
- en->have_selection = EINA_FALSE;
- en->selecting = EINA_FALSE;
- _sel_clear(en->cursor, rp->object, en);
- tc = evas_object_textblock_cursor_new(rp->object);
- evas_textblock_cursor_copy(en->cursor, tc);
- evas_textblock_cursor_line_char_first(en->cursor);
- _sel_start(en->cursor, rp->object, en);
- evas_textblock_cursor_line_char_last(en->cursor);
- _sel_extend(en->cursor, rp->object, en);
-
+ if (shift)
+ {
+ tc = evas_object_textblock_cursor_new(rp->object);
+ evas_textblock_cursor_copy(en->cursor, tc);
+ if (evas_textblock_cursor_compare(en->cursor, en->sel_start) < 0)
+ evas_textblock_cursor_line_char_first(en->cursor);
+ else
+ evas_textblock_cursor_line_char_last(en->cursor);
+ _sel_extend(en->cursor, rp->object, en);
+ }
+ else
+ {
+ en->have_selection = EINA_FALSE;
+ en->selecting = EINA_FALSE;
+ _sel_clear(en->cursor, rp->object, en);
+ tc = evas_object_textblock_cursor_new(rp->object);
+ evas_textblock_cursor_copy(en->cursor, tc);
+ evas_textblock_cursor_line_char_first(en->cursor);
+ _sel_start(en->cursor, rp->object, en);
+ evas_textblock_cursor_line_char_last(en->cursor);
+ _sel_extend(en->cursor, rp->object, en);
+ }
goto end;
}
else if (ev->flags & EVAS_BUTTON_DOUBLE_CLICK)
{
- en->have_selection = EINA_FALSE;
- en->selecting = EINA_FALSE;
- _sel_clear(en->cursor, rp->object, en);
- tc = evas_object_textblock_cursor_new(rp->object);
- evas_textblock_cursor_copy(en->cursor, tc);
- evas_textblock_cursor_word_start(en->cursor);
- _sel_start(en->cursor, rp->object, en);
- evas_textblock_cursor_word_end(en->cursor);
- evas_textblock_cursor_char_next(en->cursor);
- _sel_extend(en->cursor, rp->object, en);
-
+ if (shift)
+ {
+ tc = evas_object_textblock_cursor_new(rp->object);
+ evas_textblock_cursor_copy(en->cursor, tc);
+ if (evas_textblock_cursor_compare(en->cursor, en->sel_start) < 0)
+ evas_textblock_cursor_word_start(en->cursor);
+ else
+ {
+ evas_textblock_cursor_word_end(en->cursor);
+ evas_textblock_cursor_char_next(en->cursor);
+ }
+ _sel_extend(en->cursor, rp->object, en);
+ }
+ else
+ {
+ en->have_selection = EINA_FALSE;
+ en->selecting = EINA_FALSE;
+ _sel_clear(en->cursor, rp->object, en);
+ tc = evas_object_textblock_cursor_new(rp->object);
+ evas_textblock_cursor_copy(en->cursor, tc);
+ evas_textblock_cursor_word_start(en->cursor);
+ _sel_start(en->cursor, rp->object, en);
+ evas_textblock_cursor_word_end(en->cursor);
+ evas_textblock_cursor_char_next(en->cursor);
+ _sel_extend(en->cursor, rp->object, en);
+ }
goto end;
}
}
@@ -2154,8 +2190,16 @@ _edje_part_mouse_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUS
_curs_lin_end(en->cursor, rp->object, en);
}
}
- if ((en->have_selection) &&
- (rp->part->select_mode == EDJE_ENTRY_SELECTION_MODE_EXPLICIT))
+ }
+ }
+ if (dosel)
+ {
+ if ((en->have_selection) &&
+ (rp->part->select_mode == EDJE_ENTRY_SELECTION_MODE_EXPLICIT))
+ {
+ if (shift)
+ _sel_extend(en->cursor, rp->object, en);
+ else
{
Eina_List *first, *last;
FLOAT_T sc;
@@ -2166,7 +2210,7 @@ _edje_part_mouse_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUS
{
Evas_Textblock_Rectangle *r1, *r2;
Evas_Coord d, d1, d2;
-
+
r1 = first->data;
r2 = last->data;
d = r1->x - cx;
@@ -2199,6 +2243,11 @@ _edje_part_mouse_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUS
}
}
}
+ }
+ else
+ {
+ if ((en->have_selection) && (shift))
+ _sel_extend(en->cursor, rp->object, en);
else
{
en->selecting = EINA_TRUE;
@@ -3293,6 +3342,7 @@ _edje_entry_user_insert(Edje_Real_Part *rp, const char *text)
}
info->change.insert.pos = evas_textblock_cursor_pos_get(en->cursor);
_text_filter_markup_prepend(en, en->cursor, text);
+ _anchors_get(en->cursor, rp->object, en);
_edje_emit(rp->edje, "entry,changed", rp->part->name);
_edje_emit_full(rp->edje, "entry,changed,user", rp->part->name,
info, _free_entry_change_info);
@@ -3467,8 +3517,13 @@ _edje_entry_input_panel_language_get(Edje_Real_Part *rp)
return en->input_panel_lang;
}
+#ifdef HAVE_ECORE_IMF
void
_edje_entry_input_panel_imdata_set(Edje_Real_Part *rp, const void *data, int len)
+#else
+void
+_edje_entry_input_panel_imdata_set(Edje_Real_Part *rp, const void *data __UNUSED__, int len __UNUSED__)
+#endif
{
Entry *en = rp->entry_data;
if (!en) return;
@@ -3478,8 +3533,13 @@ _edje_entry_input_panel_imdata_set(Edje_Real_Part *rp, const void *data, int len
#endif
}
+#ifdef HAVE_ECORE_IMF
void
_edje_entry_input_panel_imdata_get(Edje_Real_Part *rp, void *data, int *len)
+#else
+void
+_edje_entry_input_panel_imdata_get(Edje_Real_Part *rp, void *data __UNUSED__, int *len __UNUSED__)
+#endif
{
Entry *en = rp->entry_data;
if (!en) return;
@@ -3489,8 +3549,13 @@ _edje_entry_input_panel_imdata_get(Edje_Real_Part *rp, void *data, int *len)
#endif
}
+#ifdef HAVE_ECORE_IMF
void
_edje_entry_input_panel_return_key_type_set(Edje_Real_Part *rp, Edje_Input_Panel_Return_Key_Type return_key_type)
+#else
+void
+_edje_entry_input_panel_return_key_type_set(Edje_Real_Part *rp, Edje_Input_Panel_Return_Key_Type return_key_type __UNUSED__)
+#endif
{
Entry *en = rp->entry_data;
if (!en) return;
@@ -3512,8 +3577,13 @@ _edje_entry_input_panel_return_key_type_get(Edje_Real_Part *rp)
return EDJE_INPUT_PANEL_RETURN_KEY_TYPE_DEFAULT;
}
+#ifdef HAVE_ECORE_IMF
void
_edje_entry_input_panel_return_key_disabled_set(Edje_Real_Part *rp, Eina_Bool disabled)
+#else
+void
+_edje_entry_input_panel_return_key_disabled_set(Edje_Real_Part *rp, Eina_Bool disabled __UNUSED__)
+#endif
{
Entry *en = rp->entry_data;
if (!en) return;
@@ -4143,6 +4213,10 @@ _edje_entry_imf_event_preedit_changed_cb(void *data, Ecore_IMF_Context *ctx __UN
}
}
}
+ else
+ {
+ eina_strbuf_append(buf, preedit_string);
+ }
if ((rp->part->entry_mode == EDJE_ENTRY_EDIT_MODE_PASSWORD) &&
_edje_password_show_last)
{
diff --git a/src/lib/edje_load.c b/src/lib/edje_load.c
index fc2aea3..e6efc96 100644
--- a/src/lib/edje_load.c
+++ b/src/lib/edje_load.c
@@ -1,12 +1,38 @@
#include "edje_private.h"
+typedef struct _Edje_Table_Items Edje_Table_Items;
+struct _Edje_Table_Items
+{
+ Evas_Object *child;
+ const char *part;
+ unsigned short col;
+ unsigned short row;
+ unsigned short colspan;
+ unsigned short rowspan;
+};
+
+typedef struct _Edje_Drag_Items Edje_Drag_Items;
+struct _Edje_Drag_Items
+{
+ const char *part;
+ FLOAT_T x, y, w, h;
+ struct {
+ FLOAT_T x, y;
+ } step;
+ struct {
+ FLOAT_T x, y;
+ } page;
+};
+
#ifdef EDJE_PROGRAM_CACHE
static Eina_Bool _edje_collection_free_prog_cache_matches_free_cb(const Eina_Hash *hash, const void *key, void *data, void *fdata);
#endif
static void _edje_object_pack_item_hints_set(Evas_Object *obj, Edje_Pack_Element *it);
static void _cb_signal_repeat(void *data, Evas_Object *obj, const char *signal, const char *source);
-static Eina_List *_edje_swallows_collect(Edje *ed);
+static Eina_List *_edje_object_collect(Edje *ed);
+
+static int _sort_defined_boxes(const void *a, const void *b);
/************************** API Routines **************************/
@@ -89,7 +115,7 @@ edje_file_collection_list(const char *file)
int error_ret = 0;
if ((!file) || (!*file)) return NULL;
- edf = _edje_cache_file_coll_open(file, NULL, &error_ret, NULL);
+ edf = _edje_cache_file_coll_open(file, NULL, &error_ret, NULL, NULL);
if (edf)
{
Eina_Iterator *i;
@@ -129,7 +155,7 @@ edje_file_group_exists(const char *file, const char *glob)
if ((!file) || (!*file) || (!glob))
return EINA_FALSE;
- edf = _edje_cache_file_coll_open(file, NULL, &error_ret, NULL);
+ edf = _edje_cache_file_coll_open(file, NULL, &error_ret, NULL, NULL);
if (!edf)
return EINA_FALSE;
@@ -189,7 +215,7 @@ edje_file_data_get(const char *file, const char *key)
if (key)
{
- edf = _edje_cache_file_coll_open(file, NULL, &error_ret, NULL);
+ edf = _edje_cache_file_coll_open(file, NULL, &error_ret, NULL, NULL);
if (edf)
{
str = (char*) edje_string_get(eina_hash_find(edf->data, key));
@@ -280,7 +306,7 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g
Eina_List *textblocks = NULL;
Eina_List *sources = NULL;
Eina_List *externals = NULL;
- Eina_List *old_swallows;
+ Eina_List *collect = NULL;
unsigned int n;
Eina_List *parts = NULL;
int group_path_started = 0;
@@ -290,15 +316,25 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g
if (!file) file = "";
if (!group) group = "";
if (((ed->path) && (!strcmp(file, ed->path))) &&
- (ed->group) && (!strcmp(group, ed->group)))
- return 1;
+ (ed->group) && (!strcmp(group, ed->group)) &&
+ ed->file)
+ {
+ struct stat st;
+
+ if (stat(file, &st) != 0)
+ return 1;
+ if (st.st_mtime == ed->file->mtime)
+ return 1;
+ }
tev = evas_object_evas_get(obj);
evas_event_freeze(tev);
- old_swallows = _edje_swallows_collect(ed);
+
+ collect = _edje_object_collect(ed);
if (_edje_script_only(ed)) _edje_script_only_shutdown(ed);
if (_edje_lua_script_only(ed)) _edje_lua_script_only_shutdown(ed);
+
_edje_file_del(ed);
eina_stringshare_replace(&ed->path, file);
@@ -407,7 +443,8 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g
_edje_part_description_find(ed, rp, "default", 0.0);
rp->chosen_description = rp->param1.description;
if (!rp->param1.description)
- ERR("no default part description!");
+ ERR("no default part description for '%s'!",
+ rp->part->name);
switch (ep->type)
{
@@ -451,6 +488,10 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g
case EDJE_PART_TYPE_GRADIENT:
ERR("SPANK ! SPANK ! SPANK ! YOU ARE USING GRADIENT IN PART %s FROM GROUP %s INSIDE FILE %s !! THEY ARE NOW REMOVED !",
ep->name, group, file);
+ break;
+ case EDJE_PART_TYPE_SPACER:
+ rp->object = NULL;
+ break;
default:
ERR("wrong part type %i!", ep->type);
break;
@@ -515,7 +556,9 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g
if (rp->part->clip_to_id >= 0)
{
rp->clip_to = ed->table_parts[rp->part->clip_to_id % ed->table_parts_size];
- if (rp->clip_to)
+ if (rp->clip_to &&
+ rp->clip_to->object &&
+ rp->object)
{
evas_object_pass_events_set(rp->clip_to->object, 1);
evas_object_pointer_mode_set(rp->clip_to->object, EVAS_OBJECT_POINTER_MODE_NOGRAB);
@@ -817,23 +860,71 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g
}
/* reswallow any swallows that existed before setting the file */
- if (old_swallows)
- {
- while (old_swallows)
- {
- const char *name;
- Evas_Object *swallow;
+ if (collect)
+ {
+ Edje_User_Defined *eud;
+ Eina_List *boxes = NULL;
- name = eina_list_data_get(old_swallows);
- old_swallows = eina_list_remove_list(old_swallows, old_swallows);
+ EINA_LIST_FREE(collect, eud)
+ {
+ Evas_Object *child = NULL;
+
+ switch (eud->type)
+ {
+ case EDJE_USER_SWALLOW:
+ edje_object_part_swallow(obj, eud->part, eud->u.swallow.child);
+ child = eud->u.swallow.child;
+ break;
+ case EDJE_USER_BOX_PACK:
+ boxes = eina_list_append(boxes, eud);
+ eud = NULL;
+ break;
+ case EDJE_USER_TABLE_PACK:
+ edje_object_part_table_pack(obj, eud->part, eud->u.table.child,
+ eud->u.table.col, eud->u.table.row,
+ eud->u.table.colspan, eud->u.table.rowspan);
+ child = eud->u.table.child;
+ break;
+ case EDJE_USER_DRAG_STEP:
+ edje_object_part_drag_step_set(obj, eud->part,
+ eud->u.drag_position.x,
+ eud->u.drag_position.y);
+ break;
+ case EDJE_USER_DRAG_PAGE:
+ edje_object_part_drag_page_set(obj, eud->part,
+ eud->u.drag_position.x,
+ eud->u.drag_position.y);
+ break;
+ case EDJE_USER_DRAG_VALUE:
+ edje_object_part_drag_value_set(obj, eud->part,
+ eud->u.drag_position.x,
+ eud->u.drag_position.y);
+ break;
+ case EDJE_USER_DRAG_SIZE:
+ edje_object_part_drag_size_set(obj, eud->part,
+ eud->u.drag_size.w,
+ eud->u.drag_size.h);
+ break;
+ case EDJE_USER_STRING:
+ edje_object_part_text_set(obj, eud->part, eud->u.string.text);
+ eina_stringshare_del(eud->u.string.text);
+ break;
+ }
+ if (eud) _edje_user_definition_remove(eud, child);
+ }
- swallow = eina_list_data_get(old_swallows);
- old_swallows = eina_list_remove_list(old_swallows, old_swallows);
+ boxes = eina_list_sort(boxes, -1, _sort_defined_boxes);
+ EINA_LIST_FREE(boxes, eud)
+ {
+ edje_object_part_box_append(obj, eud->part, eud->u.box.child);
+ _edje_user_definition_remove(eud, eud->u.box.child);
+ }
+ }
- edje_object_part_swallow(obj, name, swallow);
- eina_stringshare_del(name);
- }
- }
+ if (edje_object_mirrored_get(obj))
+ edje_object_signal_emit(obj, "edje,state,rtl", "edje");
+ else
+ edje_object_signal_emit(obj, "edje,state,ltr", "edje");
_edje_recalc(ed);
_edje_thaw(ed);
@@ -893,7 +984,8 @@ _edje_file_add(Edje *ed)
if (!_edje_edd_edje_file) return;
ed->file = _edje_cache_file_coll_open(ed->path, ed->group,
&(ed->load_error),
- &(ed->collection));
+ &(ed->collection),
+ ed);
if (!ed->collection)
{
@@ -905,31 +997,98 @@ _edje_file_add(Edje *ed)
}
}
+static int
+_sort_defined_boxes(const void *a, const void *b)
+{
+ const Edje_User_Defined *euda = a;
+ const Edje_User_Defined *eudb = b;
+
+ if (euda->part - eudb->part != 0)
+ return euda->part - eudb->part;
+ return euda->u.box.index - eudb->u.box.index;
+}
+
static Eina_List *
-_edje_swallows_collect(Edje *ed)
+_edje_object_collect(Edje *ed)
{
- Eina_List *swallows = NULL;
- unsigned int i;
+ Edje_User_Defined *eud;
+ Eina_List *collect;
+ Eina_List *l;
- if (!ed->file || !ed->table_parts) return NULL;
- for (i = 0; i < ed->table_parts_size; i++)
- {
- Edje_Real_Part *rp;
+ collect = ed->user_defined;
+ ed->user_defined = NULL;
- rp = ed->table_parts[i];
- if (rp->part->type != EDJE_PART_TYPE_SWALLOW || !rp->swallowed_object) continue;
- swallows = eina_list_append(swallows, eina_stringshare_add(rp->part->name));
- swallows = eina_list_append(swallows, rp->swallowed_object);
+ EINA_LIST_FOREACH(collect, l, eud)
+ {
+ switch (eud->type)
+ {
+ case EDJE_USER_STRING:
+ eud->u.string.text = eina_stringshare_ref(eud->u.string.text);
+ break;
+ case EDJE_USER_BOX_PACK:
+ if (eud->u.box.index == -1)
+ {
+ Edje_User_Defined *search;
+ Edje_Real_Part *rp;
+ Eina_List *children;
+ Eina_List *ls;
+ Evas_Object *child;
+ int idx = 0;
+
+ rp = _edje_real_part_recursive_get(ed, eud->part);
+ if (rp->part->type != EDJE_PART_TYPE_BOX) continue ;
+
+ children = evas_object_box_children_get(rp->object);
+ EINA_LIST_FREE(children, child)
+ if (!evas_object_data_get(child, "\377 edje.box_item"))
+ {
+ EINA_LIST_FOREACH(l, ls, search)
+ {
+ if (search->type == EDJE_USER_BOX_PACK &&
+ search->u.box.child == child &&
+ search->part == eud->part /* beauty of stringshare ! */)
+ {
+ search->u.box.index = idx++;
+ break;
+ }
+ }
+ _edje_real_part_box_remove(rp, child);
+ }
+ }
+ break;
+ case EDJE_USER_TABLE_PACK:
+ {
+ Edje_Real_Part *rp;
+
+ rp = _edje_real_part_recursive_get(ed, eud->part);
+ if (rp->part->type != EDJE_PART_TYPE_TABLE) continue ;
+
+ _edje_real_part_table_unpack(rp, eud->u.table.child);
+ break;
+ }
+ case EDJE_USER_SWALLOW:
+ edje_object_part_unswallow(NULL, eud->u.swallow.child);
+ break;
+ case EDJE_USER_DRAG_STEP:
+ case EDJE_USER_DRAG_PAGE:
+ case EDJE_USER_DRAG_VALUE:
+ case EDJE_USER_DRAG_SIZE:
+ break;
+ }
}
- return swallows;
+
+ return collect;
}
void
_edje_file_del(Edje *ed)
{
- Evas *tev = evas_object_evas_get(ed->obj);
+ Edje_User_Defined *eud;
+ Evas *tev = NULL;
- evas_event_freeze(tev);
+ if (ed->obj) tev = evas_object_evas_get(ed->obj);
+
+ if (tev) evas_event_freeze(tev);
if (ed->freeze_calc)
{
_edje_freeze_calc_list = eina_list_remove(_edje_freeze_calc_list, ed);
@@ -948,10 +1107,20 @@ _edje_file_del(Edje *ed)
if (!((ed->file) && (ed->collection)))
{
- evas_event_thaw(tev);
- evas_event_thaw_eval(tev);
+ if (tev)
+ {
+ evas_event_thaw(tev);
+ evas_event_thaw_eval(tev);
+ }
return;
}
+
+ while (ed->user_defined)
+ {
+ eud = eina_list_data_get(ed->user_defined);
+ _edje_user_definition_free(eud);
+ }
+
if (ed->table_parts)
{
unsigned int i;
@@ -970,7 +1139,6 @@ _edje_file_del(Edje *ed)
}
if (rp->swallowed_object)
{
- _edje_real_part_swallow_clear(rp);
/* Objects swallowed by the app do not get deleted,
but those internally swallowed (GROUP type) do. */
switch (rp->part->type)
@@ -984,6 +1152,7 @@ _edje_file_del(Edje *ed)
default:
break;
}
+ _edje_real_part_swallow_clear(rp);
rp->swallowed_object = NULL;
}
if (rp->items)
@@ -1046,7 +1215,10 @@ _edje_file_del(Edje *ed)
}
if (ed->file)
{
- _edje_cache_file_unref(ed->file);
+#ifdef HAVE_EIO
+ ed->file->edjes = eina_list_remove(ed->file->edjes, ed);
+#endif
+ _edje_cache_file_unref(ed->file);
ed->file = NULL;
}
if (ed->actions)
@@ -1070,8 +1242,9 @@ _edje_file_del(Edje *ed)
free(pp);
}
}
+
if (ed->L) _edje_lua2_script_shutdown(ed);
- while (ed->subobjs) evas_object_del(ed->subobjs->data);
+ while (ed->subobjs) _edje_subobj_unregister(ed, ed->subobjs->data);
if (ed->table_parts) free(ed->table_parts);
ed->table_parts = NULL;
ed->table_parts_size = 0;
@@ -1079,14 +1252,20 @@ _edje_file_del(Edje *ed)
ed->table_programs = NULL;
ed->table_programs_size = 0;
ed->focused_part = NULL;
- evas_event_thaw(tev);
- evas_event_thaw_eval(tev);
+ if (tev)
+ {
+ evas_event_thaw(tev);
+ evas_event_thaw_eval(tev);
+ }
}
void
_edje_file_free(Edje_File *edf)
{
Edje_Color_Class *ecc;
+#ifdef HAVE_EIO
+ Ecore_Event_Handler *event;
+#endif
#define HASH_FREE(Hash) \
if (Hash) eina_hash_free(Hash); \
@@ -1156,6 +1335,12 @@ _edje_file_free(Edje_File *edf)
}
if (edf->collection_patterns) edje_match_patterns_free(edf->collection_patterns);
+#ifdef HAVE_EIO
+ if (edf->timeout) ecore_timer_del(edf->timeout);
+ EINA_LIST_FREE(edf->handlers, event)
+ ecore_event_handler_del(event);
+ eio_monitor_del(edf->monitor);
+#endif
if (edf->path) eina_stringshare_del(edf->path);
if (edf->free_strings && edf->compiler) eina_stringshare_del(edf->compiler);
_edje_textblock_style_cleanup(edf);
@@ -1272,6 +1457,7 @@ _edje_collection_free(Edje_File *edf, Edje_Part_Collection *ec, Edje_Part_Collec
eina_mempool_del(ce->mp.BOX);
eina_mempool_del(ce->mp.TABLE);
eina_mempool_del(ce->mp.EXTERNAL);
+ eina_mempool_del(ce->mp.SPACER);
eina_mempool_del(ce->mp.part);
memset(&ce->mp, 0, sizeof (ce->mp));
@@ -1285,6 +1471,7 @@ _edje_collection_free(Edje_File *edf, Edje_Part_Collection *ec, Edje_Part_Collec
eina_mempool_del(ce->mp_rtl.BOX);
eina_mempool_del(ce->mp_rtl.TABLE);
eina_mempool_del(ce->mp_rtl.EXTERNAL);
+ eina_mempool_del(ce->mp_rtl.SPACER);
memset(&ce->mp_rtl, 0, sizeof (ce->mp_rtl));
free(ec);
ce->ref = NULL;
@@ -1403,8 +1590,8 @@ _edje_object_pack_item_hints_set(Evas_Object *obj, Edje_Pack_Element *it)
evas_object_size_hint_request_set(obj, it->prefer.w, it->prefer.h);
evas_object_size_hint_max_set(obj, it->max.w, it->max.h);
evas_object_size_hint_padding_set(obj, it->padding.l, it->padding.r, it->padding.t, it->padding.b);
- evas_object_size_hint_align_set(obj, it->align.x, it->align.y);
- evas_object_size_hint_weight_set(obj, it->weight.x, it->weight.y);
+ evas_object_size_hint_align_set(obj, TO_DOUBLE(it->align.x), TO_DOUBLE(it->align.y));
+ evas_object_size_hint_weight_set(obj, TO_DOUBLE(it->weight.x), TO_DOUBLE(it->weight.y));
evas_object_size_hint_aspect_set(obj, it->aspect.mode, it->aspect.w, it->aspect.h);
evas_object_resize(obj, w, h);
@@ -1544,6 +1731,7 @@ _cb_signal_repeat(void *data, Evas_Object *obj, const char *sig, const char *sou
emsg.sig = sig;
emsg.src = alias ? alias : new_src;
emsg.data = NULL;
- _edje_message_send(ed_parent, EDJE_QUEUE_SCRIPT,
- EDJE_MESSAGE_SIGNAL, 0, &emsg);
+ if (ed_parent)
+ _edje_message_send(ed_parent, EDJE_QUEUE_SCRIPT,
+ EDJE_MESSAGE_SIGNAL, 0, &emsg);
}
diff --git a/src/lib/edje_lua2.c b/src/lib/edje_lua2.c
index fd88f31..32fb2e1 100644
--- a/src/lib/edje_lua2.c
+++ b/src/lib/edje_lua2.c
@@ -180,7 +180,7 @@ static const char *_elua_ecore_timer_meta = "ecore_timer_meta";
static int _elua_obj_gc(lua_State *L);
-static const struct luaL_reg _elua_edje_gc_funcs [] =
+static const struct luaL_Reg _elua_edje_gc_funcs [] =
{
{"__gc", _elua_obj_gc}, // garbage collector func for edje objects
@@ -635,7 +635,7 @@ static int _elua_text(lua_State *L);
//static int _elua_textblock(lua_State *L); /* XXX: disabled until there are enough textblock functions implemented to make it actually useful
static const char *_elua_edje_api = "edje";
-static const struct luaL_reg _elua_edje_funcs [] =
+static const struct luaL_Reg _elua_edje_funcs [] =
{
// add an echo too to make it more shelly
{"echo", _elua_echo}, // test func - echo (i know we have print. test)
@@ -1712,10 +1712,9 @@ static int _elua_color(lua_State *L);
static int _elua_obj_map(lua_State *L);
static int _elua_obj_map_enable(lua_State *L);
-static int _elua_obj_map_source(lua_State *L);
static const char *_elua_evas_api = "evas";
-static const struct luaL_reg _elua_evas_funcs [] =
+static const struct luaL_Reg _elua_evas_funcs [] =
{
{"del", _elua_obj_del}, // generic del any object created for edje (evas objects, timers, animators, transitions... everything)
@@ -1759,7 +1758,6 @@ static const struct luaL_reg _elua_evas_funcs [] =
// map api here
{"map", _elua_obj_map},
{"map_enable", _elua_obj_map_enable},
- {"map_source", _elua_obj_map_source},
{NULL, NULL} // end
};
@@ -2492,48 +2490,6 @@ _elua_obj_map_enable(lua_State *L) // Stack usage [
return 1;
}
-/**
-@page luaref
-@subsubsection evas_map_source evas_object:map_source(object)
-
-Sets the object as the map source for this object.
-
-Wraps evas_object_map_source_set().
-
-@param object The map source object.
-
-@return A userdata reference to the current map source object.
-
-@since 1.1.0
-*/
-static int
-_elua_obj_map_source(lua_State *L) // Stack usage [-3, +4, -]
-{
- Edje_Lua_Obj *obj = (Edje_Lua_Obj *)lua_touserdata(L, 1); // Stack usage [-0, +0, -]
- Edje_Lua_Evas_Object *elo = (Edje_Lua_Evas_Object *)obj;
- Evas_Object *o;
- Edje_Lua_Evas_Object *elo2;
- int n;
-
- if (!_elua_isa(obj, _elua_evas_meta)) return 0;
-
- n = lua_gettop(L); // Stack usage [-0, +0, -]
- if (n == 2)
- {
- Edje_Lua_Obj *obj2 = (Edje_Lua_Obj *)lua_touserdata(L, 2); // Stack usage [-0, +0, -]
- const Edje_Lua_Evas_Object *source = (Edje_Lua_Evas_Object *)obj2;
-
- if (!_elua_isa(obj2, _elua_evas_meta)) return 0;
- evas_object_map_source_set(elo->evas_obj, source->evas_obj);
- }
-
- if (!(o = evas_object_map_source_get(elo->evas_obj))) return 0;
- if (!(elo2 = evas_object_data_get(o, ELO))) return 0;
- _elua_ref_get(L, elo2); // Stack usage [-3, +4, -]
-
- return 1;
-}
-
//-------------
//-------------
/**
@@ -2548,7 +2504,7 @@ In the following, "animator_object" is a place holder for any lua variable that
holds a reference to an ecore animator object.
*/
static const char *_elua_ecore_animator_api = "ecore_animator";
-static const struct luaL_reg _elua_ecore_animator_funcs [] =
+static const struct luaL_Reg _elua_ecore_animator_funcs [] =
{
{NULL, NULL} // end
};
@@ -2568,7 +2524,7 @@ holds a reference to an ecore timer object.
*/
static const char *_elua_ecore_timer_api = "ecore_timer";
-static const struct luaL_reg _elua_ecore_timer_funcs [] =
+static const struct luaL_Reg _elua_ecore_timer_funcs [] =
{
{NULL, NULL} // end
};
@@ -2594,7 +2550,7 @@ static int _elua_edje_file(lua_State *L);
static const char *_elua_evas_edje_api = "evas_edje";
static const char *_elua_evas_edje_parent = "evas_edje_parent";
-static const struct luaL_reg _elua_evas_edje_funcs [] =
+static const struct luaL_Reg _elua_evas_edje_funcs [] =
{
{"file", _elua_edje_file}, // get or set edje file and group
@@ -2693,7 +2649,7 @@ static int _elua_image_image(lua_State *L);
static const char *_elua_evas_image_api = "evas_image";
static const char *_elua_evas_image_parent = "evas_image_parent";
-static const struct luaL_reg _elua_evas_image_funcs [] =
+static const struct luaL_Reg _elua_evas_image_funcs [] =
{
{"fill", _elua_image_fill}, // get or set the fill parameters
{"filled", _elua_image_filled}, // get or set the filled state (overrides fill())
@@ -2895,7 +2851,7 @@ static int _elua_line_xy(lua_State *L);
static const char *_elua_evas_line_api = "evas_line";
static const char *_elua_evas_line_parent = "evas_line_parent";
-static const struct luaL_reg _elua_evas_line_funcs [] =
+static const struct luaL_Reg _elua_evas_line_funcs [] =
{
{"xy", _elua_line_xy}, // get or set line coords
@@ -2977,7 +2933,7 @@ static int _elua_map_uv(lua_State *L);
static int _elua_map_zoom(lua_State *L);
static const char *_elua_evas_map_api = "ewas_map";
-static const struct luaL_reg _elua_evas_map_funcs [] =
+static const struct luaL_Reg _elua_evas_map_funcs [] =
{
{"alpha", _elua_map_alpha},
// {"dup", _elua_map_dup}, // not sure of proper api for this.
@@ -3540,7 +3496,7 @@ static int _elua_polygon_point(lua_State *L);
static const char *_elua_evas_polygon_api = "evas_polygon";
static const char *_elua_evas_polygon_parent = "evas_polygon_parent";
-static const struct luaL_reg _elua_evas_polygon_funcs [] =
+static const struct luaL_Reg _elua_evas_polygon_funcs [] =
{
{"clear", _elua_polygon_clear}, // clear all polygon points
{"point", _elua_polygon_point}, // add a polygon point
@@ -3620,7 +3576,7 @@ static int _elua_text_text(lua_State *L);
static const char *_elua_evas_text_api = "evas_text";
static const char *_elua_evas_text_parent = "evas_text_parent";
-static const struct luaL_reg _elua_evas_text_funcs [] =
+static const struct luaL_Reg _elua_evas_text_funcs [] =
{
{"font", _elua_text_font}, // get or set text font
{"text", _elua_text_text}, // get or set text
@@ -3747,7 +3703,7 @@ _elua_text_text(lua_State *L) // Stack usage [
static int _elua_bogan_nilfunc(lua_State *L);
static int _elua_bogan_index(lua_State *L);
-static const struct luaL_reg _elua_bogan_funcs [] =
+static const struct luaL_Reg _elua_bogan_funcs [] =
{
{"nilfunc", _elua_bogan_nilfunc}, // Just return a nil.
{"__index", _elua_bogan_index}, // Return the above func.
diff --git a/src/lib/edje_main.c b/src/lib/edje_main.c
index c01e6d3..833d1ee 100644
--- a/src/lib/edje_main.c
+++ b/src/lib/edje_main.c
@@ -51,6 +51,14 @@ edje_init(void)
goto shutdown_embryo;
}
+#ifdef HAVE_EIO
+ if (!eio_init())
+ {
+ ERR("Eio init failed");
+ goto shutdown_eet;
+ }
+#endif
+
_edje_scale = FROM_DOUBLE(1.0);
_edje_edd_init();
@@ -66,25 +74,25 @@ edje_init(void)
_edje_real_part_mp = eina_mempool_add("chained_mempool",
"Edje_Real_Part", NULL,
- sizeof (Edje_Real_Part), 128);
+ sizeof (Edje_Real_Part), 32);
if (!_edje_real_part_mp)
{
ERR("Mempool for Edje_Real_Part cannot be allocated.");
- goto shutdown_eet;
+ goto shutdown_all;
}
_edje_real_part_state_mp = eina_mempool_add("chained_mempool",
"Edje_Real_Part_State", NULL,
- sizeof (Edje_Real_Part_State), 256);
+ sizeof (Edje_Real_Part_State), 32);
if (!_edje_real_part_state_mp)
{
ERR("Mempool for Edje_Real_Part_State cannot be allocated.");
- goto shutdown_eet;
+ goto shutdown_all;
}
return _edje_init_count;
- shutdown_eet:
+ shutdown_all:
eina_mempool_del(_edje_real_part_state_mp);
eina_mempool_del(_edje_real_part_mp);
_edje_real_part_state_mp = NULL;
@@ -96,6 +104,10 @@ edje_init(void)
_edje_text_class_members_free();
_edje_text_class_hash_free();
_edje_edd_shutdown();
+#ifdef HAVE_EIO
+ eio_shutdown();
+ shutdown_eet:
+#endif
eet_shutdown();
shutdown_embryo:
embryo_shutdown();
@@ -134,6 +146,9 @@ _edje_shutdown_core(void)
_edje_text_class_hash_free();
_edje_edd_shutdown();
+#ifdef HAVE_EIO
+ eio_shutdown();
+#endif
eet_shutdown();
embryo_shutdown();
ecore_shutdown();
@@ -159,6 +174,11 @@ _edje_lib_unref(void)
EAPI int
edje_shutdown(void)
{
+ if (_edje_init_count <= 0)
+ {
+ ERR("Init count not greater than 0 in shutdown.");
+ return 0;
+ }
if (--_edje_init_count != 0)
return _edje_init_count;
diff --git a/src/lib/edje_match.c b/src/lib/edje_match.c
index f113f7b..375634e 100644
--- a/src/lib/edje_match.c
+++ b/src/lib/edje_match.c
@@ -449,7 +449,7 @@ edje_match_programs_exec_check_finals(const size_t *signal_finals,
}
static int
-edje_match_callback_exec_check_finals(const Edje_Patterns *singal_ppat,
+edje_match_callback_exec_check_finals(const Edje_Patterns *signal_ppat,
const Edje_Patterns *source_ppat,
const size_t *signal_finals,
const size_t *source_finals,
@@ -462,10 +462,14 @@ edje_match_callback_exec_check_finals(const Edje_Patterns *singal_ppat,
Eina_Bool prop
)
{
+ Edje_Signal_Callback *escb;
+ Eina_Array run;
size_t i;
size_t j;
int r = 1;
+ eina_array_step_set(&run, sizeof (Eina_Array), 4);
+
for (i = 0; i < signal_states->size; ++i)
{
if (signal_states->states[i].pos >= signal_finals[signal_states->states[i].idx])
@@ -475,8 +479,6 @@ edje_match_callback_exec_check_finals(const Edje_Patterns *singal_ppat,
if (signal_states->states[i].idx == source_states->states[j].idx
&& source_states->states[j].pos >= source_finals[source_states->states[j].idx])
{
- Edje_Signal_Callback *escb;
-
escb = eina_list_nth(callbacks, signal_states->states[i].idx);
if (escb)
{
@@ -484,19 +486,25 @@ edje_match_callback_exec_check_finals(const Edje_Patterns *singal_ppat,
if ((!escb->just_added)
&& (!escb->delete_me))
{
- escb->func(escb->data, ed->obj, sig, source);
+ eina_array_push(&run, escb);
r = 2;
}
- if (_edje_block_break(ed))
- return 0;
- if ((singal_ppat->delete_me) || (source_ppat->delete_me))
- return 0;
}
}
}
}
}
+ while ((escb = eina_array_pop(&run)))
+ {
+ escb->func(escb->data, ed->obj, sig, source);
+ if (_edje_block_break(ed))
+ return 0;
+ if ((signal_ppat->delete_me) || (source_ppat->delete_me))
+ return 0;
+ }
+ eina_array_flush(&run);
+
return r;
}
diff --git a/src/lib/edje_multisense.c b/src/lib/edje_multisense.c
index 43f51be..cd140f4 100644
--- a/src/lib/edje_multisense.c
+++ b/src/lib/edje_multisense.c
@@ -84,7 +84,7 @@ init_multisense_environment(void)
strncpy(ms_factory, ms_factory_env, BUF_LEN);
else
strcpy(ms_factory, "multisense_factory");
-
+
m = _edje_module_handle_load(ms_factory);
if (!m) goto err;
#ifdef HAVE_LIBREMIX
@@ -279,7 +279,7 @@ _player_job(void *data __UNUSED__, Ecore_Thread *th)
#endif
// disable and move outside of thread due to dlsym etc. thread issues
// Multisense_Data * msdata = init_multisense_environment();
-
+
if (!msdata) return;
fcntl(command_pipe[0], F_SETFL, O_NONBLOCK);
@@ -290,13 +290,17 @@ _player_job(void *data __UNUSED__, Ecore_Thread *th)
{
if (!msdata->remaining)
{
- //Cleanup already played sound sources
+ int err;
+
+ //Cleanup already played sound sources
EINA_LIST_FREE(msdata->snd_src_list, sound)
{
remix_destroy(msdata->msenv->remixenv, sound);
}
//wait for new sound
- select(command_pipe[0] + 1, &wait_fds, NULL, NULL, 0);
+ err = select(command_pipe[0] + 1, &wait_fds, NULL, NULL, 0);
+ if (ecore_thread_check(th))
+ break;
}
//read sound command , if any
sound_command_handler(msdata);
@@ -340,8 +344,13 @@ _edje_multisense_internal_sound_sample_play(Edje *ed, const char *sample_name, c
ssize_t size = 0;
#if defined(ENABLE_MULTISENSE) && defined(HAVE_LIBREMIX)
Edje_Multisense_Sound_Action command;
-
+
if ((!pipe_initialized) && (!player_thread)) return EINA_FALSE;
+ if (!sample_name)
+ {
+ ERR("Given Sample Name is NULL\n");
+ return EINA_FALSE;
+ }
command.action = EDJE_PLAY_SAMPLE;
command.ed = ed;
@@ -363,14 +372,20 @@ _edje_multisense_internal_sound_tone_play(Edje *ed, const char *tone_name, const
ssize_t size = 0;
#if defined(ENABLE_MULTISENSE) && defined(HAVE_LIBREMIX)
Edje_Multisense_Sound_Action command;
-
+
if ((!pipe_initialized) && (!player_thread)) return EINA_FALSE;
+ if (!tone_name)
+ {
+ ERR("Given Tone Name is NULL\n");
+ return EINA_FALSE;
+ }
+
command.action = EDJE_PLAY_TONE;
command.ed = ed;
strncpy(command.type.tone.tone_name, tone_name, BUF_LEN);
command.type.tone.duration = duration;
size = write(command_pipe[1], &command, sizeof(command));
-#else
+#else
// warning shh
(void) ed;
(void) duration;
@@ -390,8 +405,9 @@ _edje_multisense_init(void)
// init msdata outside of thread due to thread issues in dlsym etc.
if (!msdata) msdata = init_multisense_environment();
+
if (!player_thread)
- player_thread = ecore_thread_run(_player_job, _player_end, _player_cancel, NULL);
+ player_thread = ecore_thread_feedback_run(_player_job, NULL, _player_end, _player_cancel, NULL, EINA_TRUE);
#endif
}
@@ -399,11 +415,14 @@ void
_edje_multisense_shutdown(void)
{
#ifdef ENABLE_MULTISENSE
+ if (player_thread) ecore_thread_cancel(player_thread);
if (pipe_initialized)
{
+ int i = 42;
+
+ write(command_pipe[1], &i, sizeof (int));
close(command_pipe[1]);
close(command_pipe[0]);
}
- if (player_thread) ecore_thread_cancel(player_thread);
#endif
}
diff --git a/src/lib/edje_private.h b/src/lib/edje_private.h
index 051300f..48acb33 100644
--- a/src/lib/edje_private.h
+++ b/src/lib/edje_private.h
@@ -74,6 +74,10 @@ void *alloca (size_t);
#endif
#include <Embryo.h>
+#ifdef HAVE_EIO
+# include <Eio.h>
+#endif
+
#include "Edje.h"
EAPI extern int _edje_default_log_dom ;
@@ -191,7 +195,7 @@ struct _Edje_Smart_Api
/* increment this when you add new feature to edje file format without
* breaking backward compatibility.
*/
-#define EDJE_FILE_MINOR 3
+#define EDJE_FILE_MINOR 4
/* FIXME:
*
@@ -317,6 +321,7 @@ typedef struct _Edje_Part_Description_Spec_Box Edje_Part_Description_Spec_
typedef struct _Edje_Part_Description_Spec_Table Edje_Part_Description_Spec_Table;
typedef struct _Edje_Patterns Edje_Patterns;
typedef struct _Edje_Part_Box_Animation Edje_Part_Box_Animation;
+typedef struct _Edje_Part_Limit Edje_Part_Limit;
typedef struct _Edje Edje;
typedef struct _Edje_Real_Part_State Edje_Real_Part_State;
@@ -467,6 +472,13 @@ struct _Edje_File
Eet_File *ef;
+#ifdef HAVE_EIO
+ Eio_Monitor *monitor;
+ Eina_List *edjes;
+ Eina_List *handlers;
+ Ecore_Timer *timeout;
+#endif
+
unsigned char free_strings : 1;
unsigned char dangling : 1;
unsigned char warning : 1;
@@ -665,6 +677,7 @@ struct _Edje_Limit
TYPE GROUP; \
TYPE BOX; \
TYPE TABLE; \
+ TYPE SPACER; \
TYPE EXTERNAL;
struct _Edje_Part_Collection_Directory_Entry
@@ -715,6 +728,21 @@ struct _Edje_Pack_Element
unsigned short colspan, rowspan;
};
+typedef enum {
+ EDJE_PART_LIMIT_UNKNOWN = 0,
+ EDJE_PART_LIMIT_BELOW,
+ EDJE_PART_LIMIT_ZERO,
+ EDJE_PART_LIMIT_OVER
+} Edje_Part_Limit_State;
+
+struct _Edje_Part_Limit
+{
+ int part;
+
+ Edje_Part_Limit_State width; /* -1, 0 or 1 */
+ Edje_Part_Limit_State height; /* -1, 0, or 1 */
+};
+
/*----------*/
struct _Edje_Part_Collection
@@ -742,6 +770,9 @@ struct _Edje_Part_Collection
Edje_Limit **horizontal;
unsigned int horizontal_count;
+
+ Edje_Part_Limit *parts;
+ unsigned int parts_count;
} limits;
Edje_Part **parts; /* an array of Edje_Part */
@@ -838,6 +869,7 @@ struct _Edje_Part
unsigned char select_mode;
unsigned char cursor_mode;
unsigned char multiline;
+ unsigned char access; /* it will be used accessibility feature */
Edje_Part_Api api;
};
@@ -902,6 +934,7 @@ struct _Edje_Part_Description_Common
} persp;
unsigned char visible; /* is it shown */
+ unsigned char limit; /* 0 == no, 1 = width, 2 = height, 3 = both */
};
struct _Edje_Part_Description_Spec_Fill
@@ -1149,9 +1182,12 @@ struct _Edje
void *data;
} item_provider;
+ Eina_List *user_defined;
+
+ int walking_callbacks;
+
unsigned int dirty : 1;
unsigned int recalc : 1;
- unsigned int walking_callbacks : 1;
unsigned int delete_callbacks : 1;
unsigned int just_added_callbacks : 1;
unsigned int have_objects : 1;
@@ -1192,6 +1228,7 @@ struct _Edje_Calc_Params
union {
struct {
int l, r, t, b; // 16
+ FLOAT_T border_scale_by;
} image; // 16
} spec; // 16
} common; // 40
@@ -1536,6 +1573,52 @@ struct _Edje_Patterns
size_t finals[];
};
+typedef enum _Edje_User_Defined_Type
+{
+ EDJE_USER_SWALLOW,
+ EDJE_USER_BOX_PACK,
+ EDJE_USER_TABLE_PACK,
+ EDJE_USER_STRING,
+ EDJE_USER_DRAG_STEP,
+ EDJE_USER_DRAG_PAGE,
+ EDJE_USER_DRAG_VALUE,
+ EDJE_USER_DRAG_SIZE
+} Edje_User_Defined_Type;
+
+typedef struct _Edje_User_Defined Edje_User_Defined;
+struct _Edje_User_Defined
+{
+ Edje_User_Defined_Type type;
+ const char *part;
+ Edje *ed;
+
+ union {
+ struct {
+ const char *text;
+ } string;
+ struct {
+ Evas_Object *child;
+ } swallow;
+ struct {
+ Evas_Object *child;
+ int index;
+ } box;
+ struct {
+ Evas_Object *child;
+ unsigned short col;
+ unsigned short row;
+ unsigned short colspan;
+ unsigned short rowspan;
+ } table;
+ struct {
+ double x, y;
+ } drag_position;
+ struct {
+ double w, h;
+ } drag_size;
+ } u;
+};
+
Edje_Patterns *edje_match_collection_dir_init(const Eina_List *lst);
Edje_Patterns *edje_match_programs_signal_init(Edje_Program * const *array,
unsigned int count);
@@ -1609,6 +1692,7 @@ extern Eina_Mempool *_emp_GROUP;
extern Eina_Mempool *_emp_BOX;
extern Eina_Mempool *_emp_TABLE;
extern Eina_Mempool *_emp_EXTERNAL;
+extern Eina_Mempool *_emp_SPACER;
extern Eina_Mempool *_emp_part;
void _edje_part_pos_set(Edje *ed, Edje_Real_Part *ep, int mode, FLOAT_T pos, FLOAT_T v1, FLOAT_T v2);
@@ -1809,7 +1893,7 @@ void _edje_textblock_styles_del(Edje *ed);
void _edje_textblock_style_all_update(Edje *ed);
void _edje_textblock_style_parse_and_fix(Edje_File *edf);
void _edje_textblock_style_cleanup(Edje_File *edf);
-Edje_File *_edje_cache_file_coll_open(const char *file, const char *coll, int *error_ret, Edje_Part_Collection **edc_ret);
+Edje_File *_edje_cache_file_coll_open(const char *file, const char *coll, int *error_ret, Edje_Part_Collection **edc_ret, Edje *ed);
void _edje_cache_coll_clean(Edje_File *edf);
void _edje_cache_coll_flush(Edje_File *edf);
void _edje_cache_coll_unref(Edje_File *edf, Edje_Part_Collection *edc);
@@ -1818,6 +1902,7 @@ void _edje_cache_file_unref(Edje_File *edf);
void _edje_embryo_globals_init(Edje *ed);
#define CHKPARAM(n) if (params[0] != (sizeof(Embryo_Cell) * (n))) return -1;
+#define HASNPARAMS(n) (params[0] == (sizeof(Embryo_Cell) * (n)))
#define GETSTR(str, par) { \
Embryo_Cell *___cptr; \
int ___l; \
@@ -2057,6 +2142,7 @@ void _edje_lib_ref(void);
void _edje_lib_unref(void);
void _edje_subobj_register(Edje *ed, Evas_Object *ob);
+void _edje_subobj_unregister(Edje *ed, Evas_Object *ob);
void _edje_multisense_init(void);
void _edje_multisense_shutdown(void);
@@ -2065,6 +2151,9 @@ Eina_Bool _edje_multisense_internal_sound_tone_play(Edje *ed, const char *tone_n
void _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *state);
+void _edje_user_definition_remove(Edje_User_Defined *eud, Evas_Object *child);
+void _edje_user_definition_free(Edje_User_Defined *eud);
+
#ifdef HAVE_LIBREMIX
#include <remix/remix.h>
#endif
diff --git a/src/lib/edje_program.c b/src/lib/edje_program.c
index 648e8ee..3346cf8 100644
--- a/src/lib/edje_program.c
+++ b/src/lib/edje_program.c
@@ -992,7 +992,7 @@ _edje_emit_full(Edje *ed, const char *sig, const char *src, void *data, void (*f
break ;
default:
- ERR("SPANK SPANK SPANK !!!\nYou should never be here !");
+// ERR("SPANK SPANK SPANK !!!\nYou should never be here !");
break;
}
}
@@ -1148,21 +1148,16 @@ _edje_emit_handle(Edje *ed, const char *sig, const char *src,
Edje_Real_Part *rp;
rp = _edje_real_part_get(ed, pr->filter.part ? pr->filter.part : src);
- if (rp && !rp->program)
- exec = (rp->chosen_description->state.name == pr->filter.state);
- }
-
- pr->exec = exec;
-#if 0
- if (exec)
- {
- _edje_program_run(ed, pr, 0, sig, src);
- if (_edje_block_break(ed))
+ if (rp)
{
- goto break_prog;
+ if (rp->program)
+ exec = EINA_FALSE;
+ else
+ exec = (rp->chosen_description->state.name == pr->filter.state);
}
}
-#endif
+
+ pr->exec = exec;
}
EINA_LIST_FOREACH(matches, l, pr)
@@ -1280,7 +1275,7 @@ _edje_emit_cb(Edje *ed, const char *sig, const char *src, Edje_Message_Signal_Da
if (ed->just_added_callbacks)
_edje_callbacks_patterns_clean(ed);
- ed->walking_callbacks = 1;
+ ed->walking_callbacks++;
if (ed->callbacks)
{
@@ -1312,14 +1307,15 @@ _edje_emit_cb(Edje *ed, const char *sig, const char *src, Edje_Message_Signal_Da
{
escb->func(escb->data, ed->obj, sig, src);
if (_edje_block_break(ed))
- goto break_prog;
+ break;
}
}
}
break_prog:
- ed->walking_callbacks = 0;
- if ((ed->delete_callbacks) || (ed->just_added_callbacks))
+ ed->walking_callbacks--;
+ if (!ed->walking_callbacks &&
+ ((ed->delete_callbacks) || (ed->just_added_callbacks)))
{
ed->delete_callbacks = 0;
ed->just_added_callbacks = 0;
diff --git a/src/lib/edje_smart.c b/src/lib/edje_smart.c
index 59ccc46..2c74c50 100644
--- a/src/lib/edje_smart.c
+++ b/src/lib/edje_smart.c
@@ -112,6 +112,7 @@ _edje_smart_add(Evas_Object *obj)
ed->is_rtl = EINA_FALSE;
ed->have_objects = 1;
ed->references = 1;
+ ed->user_defined = NULL;
evas_object_geometry_get(obj, &(ed->x), &(ed->y), &(ed->w), &(ed->h));
ed->obj = obj;
diff --git a/src/lib/edje_text.c b/src/lib/edje_text.c
index 01faf99..8d81159 100644
--- a/src/lib/edje_text.c
+++ b/src/lib/edje_text.c
@@ -587,17 +587,17 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
part_get_geometry(ep, &tw, &th);
/* Handle alignment */
{
- double align_x;
- if (params->type.text.align.x < 0.0)
+ FLOAT_T align_x;
+ if (params->type.text.align.x < FROM_INT(0))
{
if (evas_object_text_direction_get(ep->object) ==
EVAS_BIDI_DIRECTION_RTL)
{
- align_x = 1.0;
+ align_x = FROM_INT(1);
}
else
{
- align_x = 0.0;
+ align_x = FROM_INT(0);
}
}
else
diff --git a/src/lib/edje_textblock_styles.c b/src/lib/edje_textblock_styles.c
index 13a68ad..bf7f330 100644
--- a/src/lib/edje_textblock_styles.c
+++ b/src/lib/edje_textblock_styles.c
@@ -176,7 +176,13 @@ _edje_textblock_style_all_update(Edje *ed)
/* Make sure the style contains a text_class */
EINA_LIST_FOREACH(stl->tags, ll, tag)
- if (tag->text_class) found = 1;
+ {
+ if (tag->text_class)
+ {
+ found = 1;
+ break;
+ }
+ }
/* No text classes , goto next style */
if (!found) continue;
@@ -198,11 +204,7 @@ _edje_textblock_style_all_update(Edje *ed)
eina_strbuf_append(txt, "='");
/* Configure fonts from text class if it exists */
- if ((tc = _edje_text_class_find(ed, tag->text_class)))
- {
- /* Only update if not clearing, If clear leave it at zero */
- if (tc->font) found = 1;
- }
+ tc = _edje_text_class_find(ed, tag->text_class);
/* Add and Ha`ndle tag parsed data */
eina_strbuf_append(txt, tag->value);
@@ -223,7 +225,7 @@ _edje_textblock_style_all_update(Edje *ed)
{
char font_size[32];
- if (found)
+ if (tc && tc->size)
snprintf(font_size, sizeof(font_size), "%f", (double) _edje_text_size_calc(tag->font_size, tc));
else
snprintf(font_size, sizeof(font_size), "%f", tag->font_size);
@@ -240,10 +242,9 @@ _edje_textblock_style_all_update(Edje *ed)
eina_strbuf_append(txt, " ");
eina_strbuf_append(txt, "font=");
- f = (found) ? tc->font : tag->font;
+ f = (tc && tc->font) ? tc->font : tag->font;
eina_strbuf_append_escaped(txt, f);
}
- found = 0;
eina_strbuf_append(txt, "'");
}
diff --git a/src/lib/edje_util.c b/src/lib/edje_util.c
index 07678f4..090e7a5 100644
--- a/src/lib/edje_util.c
+++ b/src/lib/edje_util.c
@@ -46,9 +46,95 @@ static Eina_Bool _edje_color_class_list_foreach(const Eina_Hash *hash, const voi
static Eina_Bool _edje_text_class_list_foreach(const Eina_Hash *hash, const void *key, void *data, void *fdata);
static void _edje_object_image_preload_cb(void *data, Evas *e, Evas_Object *obj, void *event_info);
static void _edje_object_signal_preload_cb(void *data, Evas_Object *obj, const char *emission, const char *source);
+static void _edje_user_def_del_cb(void *data, Evas *e __UNUSED__, Evas_Object *child __UNUSED__, void *einfo __UNUSED__);
+static void _edje_table_child_remove(Edje_Real_Part *rp, Evas_Object *child);
+static void _edje_box_child_remove(Edje_Real_Part *rp, Evas_Object *child);
Edje_Real_Part *_edje_real_part_recursive_get_helper(const Edje *ed, char **path);
+static Edje_User_Defined *
+_edje_user_definition_new(Edje_User_Defined_Type type, const char *part, Edje *ed)
+{
+ Edje_User_Defined *eud;
+
+ eud = malloc(sizeof (Edje_User_Defined));
+ if (!eud) return NULL;
+
+ eud->type = type;
+ eud->part = eina_stringshare_add(part);
+ eud->ed = ed;
+ ed->user_defined = eina_list_append(ed->user_defined, eud);
+
+ return eud;
+}
+
+void
+_edje_user_definition_remove(Edje_User_Defined *eud, Evas_Object *child)
+{
+ eud->ed->user_defined = eina_list_remove(eud->ed->user_defined, eud);
+
+ if (child) evas_object_event_callback_del_full(child, EVAS_CALLBACK_DEL, _edje_user_def_del_cb, eud);
+ eina_stringshare_del(eud->part);
+ free(eud);
+}
+
+void
+_edje_user_definition_free(Edje_User_Defined *eud)
+{
+ Evas_Object *child = NULL;
+ Edje_Real_Part *rp;
+
+ eud->ed->user_defined = eina_list_remove(eud->ed->user_defined, eud);
+
+ switch (eud->type)
+ {
+ case EDJE_USER_SWALLOW:
+ child = eud->u.swallow.child;
+ rp = _edje_real_part_recursive_get(eud->ed, eud->part);
+ if (rp)
+ {
+ _edje_real_part_swallow_clear(rp);
+ rp->swallowed_object = NULL;
+ rp->swallow_params.min.w = 0;
+ rp->swallow_params.min.h = 0;
+ rp->swallow_params.max.w = 0;
+ rp->swallow_params.max.h = 0;
+ rp->edje->dirty = 1;
+ rp->edje->recalc_call = 1;
+#ifdef EDJE_CALC_CACHE
+ rp->invalidate = 1;
+#endif
+ _edje_recalc_do(rp->edje);
+ }
+ break;
+ case EDJE_USER_BOX_PACK:
+ child = eud->u.box.child;
+ rp = _edje_real_part_recursive_get(eud->ed, eud->part);
+ _edje_box_child_remove(rp, child);
+ break;
+ case EDJE_USER_TABLE_PACK:
+ child = eud->u.table.child;
+ rp = _edje_real_part_recursive_get(eud->ed, eud->part);
+ _edje_table_child_remove(rp, child);
+ break;
+ case EDJE_USER_STRING:
+ case EDJE_USER_DRAG_STEP:
+ case EDJE_USER_DRAG_PAGE:
+ case EDJE_USER_DRAG_VALUE:
+ case EDJE_USER_DRAG_SIZE:
+ break;
+ }
+
+ _edje_user_definition_remove(eud, child);
+}
+
+static void
+_edje_user_def_del_cb(void *data, Evas *e __UNUSED__, Evas_Object *child __UNUSED__, void *einfo __UNUSED__)
+{
+ Edje_User_Defined *eud = data;
+
+ _edje_user_definition_free(eud);
+}
static void
_edje_class_member_direct_del(const char *class, Edje_List_Refcount *lookup, Eina_Hash *hash)
@@ -145,7 +231,6 @@ edje_freeze(void)
{
#ifdef FASTFREEZE
_edje_freeze_val++;
- INF("fr ++ ->%i", _edje_freeze_val);
#else
// FIXME: could just have a global freeze instead of per object
// above i tried.. but this broke some things. notable e17's menus. why?
@@ -185,7 +270,6 @@ edje_thaw(void)
{
#ifdef FASTFREEZE
_edje_freeze_val--;
- INF("fr -- ->%i", _edje_freeze_val);
if ((_edje_freeze_val <= 0) && (_edje_freeze_calc_count > 0))
{
Edje *ed;
@@ -732,23 +816,19 @@ edje_text_class_set(const char *text_class, const char *font, Evas_Font_Size siz
tc->font = eina_stringshare_add(font);
tc->size = size;
- return EINA_FALSE;
}
-
- /* If the class found is the same just return */
- if ((tc->size == size) && (tc->font) && (!strcmp(tc->font, font)))
- return EINA_TRUE;
-
- /* Update the class found */
- eina_stringshare_del(tc->font);
- tc->font = eina_stringshare_add(font);
- if (!tc->font)
+ else
{
- eina_hash_del(_edje_text_class_hash, text_class, tc);
- free(tc);
- return EINA_FALSE;
+ /* Match and the same, return */
+ if ((tc->size == size) ||
+ (tc->font == font) ||
+ (tc->font && font && !strcmp(tc->font, font)))
+ return EINA_TRUE;
+
+ /* Update the class found */
+ eina_stringshare_replace(&tc->font, font);
+ tc->size = size;
}
- tc->size = size;
/* Tell all members of the text class to recalc */
members = eina_hash_find(_edje_text_class_member_hash, text_class);
@@ -827,7 +907,7 @@ edje_object_text_class_set(Evas_Object *obj, const char *text_class, const char
{
Edje *ed;
Eina_List *l;
- Edje_Text_Class *tc;
+ Edje_Text_Class *tc = NULL;
unsigned int i;
ed = _edje_fetch(obj);
@@ -839,42 +919,32 @@ edje_object_text_class_set(Evas_Object *obj, const char *text_class, const char
if ((tc->name) && (!strcmp(tc->name, text_class)))
{
/* Match and the same, return */
- if ((tc->font) && (font) && (!strcmp(tc->font, font)) &&
- (tc->size == size))
- return EINA_TRUE;
-
- /* No font but size is the same, return */
- if ((!tc->font) && (!font) && (tc->size == size)) return EINA_TRUE;
+ if ((tc->size == size) ||
+ (tc->font == font) ||
+ (tc->font && font && !strcmp(tc->font, font)))
+ return EINA_TRUE;
/* Update new text class properties */
- if (tc->font) eina_stringshare_del(tc->font);
- if (font) tc->font = eina_stringshare_add(font);
- else tc->font = NULL;
+ eina_stringshare_replace(&tc->font, font);
tc->size = size;
-
- /* Update edje */
- ed->dirty = 1;
- ed->recalc_call = 1;
-#ifdef EDJE_CALC_CACHE
- ed->text_part_change = 1;
-#endif
- _edje_recalc(ed);
- return EINA_TRUE;
+ break;
}
}
- /* No matches, create a new text class */
- tc = calloc(1, sizeof(Edje_Text_Class));
- if (!tc) return EINA_FALSE;
- tc->name = eina_stringshare_add(text_class);
- if (!tc->name)
+ if (!tc)
{
- free(tc);
- return EINA_FALSE;
+ /* No matches, create a new text class */
+ tc = calloc(1, sizeof(Edje_Text_Class));
+ if (!tc) return EINA_FALSE;
+ tc->name = eina_stringshare_add(text_class);
+ if (!tc->name)
+ {
+ free(tc);
+ return EINA_FALSE;
+ }
+ tc->font = eina_stringshare_add(font);
+ tc->size = size;
}
- if (font) tc->font = eina_stringshare_add(font);
- else tc->font = NULL;
- tc->size = size;
for (i = 0; i < ed->table_parts_size; i++)
{
@@ -1117,11 +1187,38 @@ edje_object_part_text_style_user_peek(const Evas_Object *obj, const char *part)
return NULL;
}
+static void
+_edje_user_define_string(Edje *ed, const char *part, const char *raw_text)
+{
+ /* NOTE: This one is tricky, text is referenced in rp->text.text for the life of the
+ rp. So on edje_object_file_set, we should first ref it, before destroying the old
+ layout. */
+ Edje_User_Defined *eud;
+ Eina_List *l;
+
+ EINA_LIST_FOREACH(ed->user_defined, l, eud)
+ if (eud->type == EDJE_USER_STRING && !strcmp(eud->part, part))
+ {
+ if (!raw_text)
+ {
+ _edje_user_definition_free(eud);
+ return ;
+ }
+ eud->u.string.text = raw_text;
+ return ;
+ }
+
+ eud = _edje_user_definition_new(EDJE_USER_STRING, part, ed);
+ if (!eud) return ;
+ eud->u.string.text = raw_text;
+}
+
EAPI Eina_Bool
edje_object_part_text_set(Evas_Object *obj, const char *part, const char *text)
{
Edje *ed;
Edje_Real_Part *rp;
+ Eina_Bool r;
ed = _edje_fetch(obj);
if ((!ed) || (!part)) return EINA_FALSE;
@@ -1129,7 +1226,9 @@ edje_object_part_text_set(Evas_Object *obj, const char *part, const char *text)
if (!rp) return EINA_FALSE;
if ((rp->part->type != EDJE_PART_TYPE_TEXT) &&
(rp->part->type != EDJE_PART_TYPE_TEXTBLOCK)) return EINA_FALSE;
- return _edje_object_part_text_raw_set(obj, rp, part, text);
+ r = _edje_object_part_text_raw_set(obj, rp, part, text);
+ _edje_user_define_string(ed, part, rp->text.text);
+ return r;
}
/**
@@ -1173,6 +1272,7 @@ edje_object_part_text_escaped_set(Evas_Object *obj, const char *part, const char
{
Edje *ed;
Edje_Real_Part *rp;
+ Eina_Bool ret;
ed = _edje_fetch(obj);
if ((!ed) || (!part)) return EINA_FALSE;
@@ -1183,7 +1283,6 @@ edje_object_part_text_escaped_set(Evas_Object *obj, const char *part, const char
Eina_Strbuf *sbuf;
char *esc_start = NULL, *esc_end = NULL;
char *s, *p;
- Eina_Bool ret;
sbuf = eina_strbuf_new();
p = (char *)text;
@@ -1231,11 +1330,14 @@ edje_object_part_text_escaped_set(Evas_Object *obj, const char *part, const char
}
ret = _edje_object_part_text_raw_set
(obj, rp, part, eina_strbuf_string_get(sbuf));
+ _edje_user_define_string(ed, part, rp->text.text);
eina_strbuf_free(sbuf);
return ret;
}
if (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK) return EINA_FALSE;
- return _edje_object_part_text_raw_set(obj, rp, part, text);
+ ret = _edje_object_part_text_raw_set(obj, rp, part, text);
+ _edje_user_define_string(ed, part, rp->text.text);
+ return ret;
}
@@ -1367,6 +1469,7 @@ edje_object_part_text_unescaped_set(Evas_Object *obj, const char *part, const ch
ret = _edje_object_part_text_raw_set(obj, rp, part, text);
free(text);
}
+ _edje_user_define_string(ed, part, rp->text.text);
return ret;
}
@@ -2413,6 +2516,7 @@ edje_object_part_swallow(Evas_Object *obj, const char *part, Evas_Object *obj_sw
{
Edje *ed;
Edje_Real_Part *rp;
+ Edje_User_Defined *eud = NULL;
ed = _edje_fetch(obj);
if ((!ed) || (!part)) return EINA_FALSE;
@@ -2446,6 +2550,22 @@ edje_object_part_swallow(Evas_Object *obj, const char *part, Evas_Object *obj_sw
return EINA_FALSE;
}
_edje_real_part_swallow(rp, obj_swallow, EINA_TRUE);
+
+ if (rp->swallowed_object)
+ {
+ if (!eud)
+ {
+ eud = _edje_user_definition_new(EDJE_USER_SWALLOW, part, ed);
+ evas_object_event_callback_add(obj_swallow, EVAS_CALLBACK_DEL, _edje_user_def_del_cb, eud);
+ }
+ else ed->user_defined = eina_list_append(ed->user_defined, eud);
+
+ if (eud)
+ {
+ eud->u.swallow.child = obj_swallow;
+ }
+ }
+
return EINA_TRUE;
}
@@ -2713,7 +2833,7 @@ edje_box_layout_register(const char *name, Evas_Object_Box_Layout func, void *(*
}
EAPI void
-edje_object_part_unswallow(Evas_Object *obj __UNUSED__, Evas_Object *obj_swallow)
+edje_object_part_unswallow(Evas_Object *obj, Evas_Object *obj_swallow)
{
Edje_Real_Part *rp;
@@ -2727,24 +2847,34 @@ edje_object_part_unswallow(Evas_Object *obj __UNUSED__, Evas_Object *obj_swallow
ERR("cannot unswallow part %s: not swallow type!", rp->part->name);
return;
}
+
if (rp->swallowed_object == obj_swallow)
{
- evas_object_smart_member_del(rp->swallowed_object);
- evas_object_event_callback_del_full(rp->swallowed_object,
- EVAS_CALLBACK_FREE,
- _edje_object_part_swallow_free_cb,
- rp->edje->obj);
- evas_object_event_callback_del_full(rp->swallowed_object,
- EVAS_CALLBACK_CHANGED_SIZE_HINTS,
- _edje_object_part_swallow_changed_hints_cb,
- rp);
- evas_object_clip_unset(rp->swallowed_object);
- evas_object_data_del(rp->swallowed_object, "\377 edje.swallowing_part");
-
- if (rp->part->mouse_events)
- _edje_callbacks_del(rp->swallowed_object, rp->edje);
- _edje_callbacks_focus_del(rp->swallowed_object, rp->edje);
+ Edje_User_Defined *eud;
+ Eina_List *l;
+
+ if (obj)
+ {
+ Edje *ed;
+
+ ed = _edje_fetch(obj);
+ if (!ed && obj)
+ {
+ ERR("edje_object_part_unswallow called on a non Edje object ('%s').",
+ evas_object_type_get(obj));
+ }
+ else
+ {
+ EINA_LIST_FOREACH(ed->user_defined, l, eud)
+ if (eud->type == EDJE_USER_SWALLOW && eud->u.swallow.child == obj_swallow)
+ {
+ _edje_user_definition_free(eud);
+ return ;
+ }
+ }
+ }
+ _edje_real_part_swallow_clear(rp);
rp->swallowed_object = NULL;
rp->swallow_params.min.w = 0;
rp->swallow_params.min.h = 0;
@@ -3134,6 +3264,8 @@ edje_object_part_drag_value_set(Evas_Object *obj, const char *part, double dx, d
{
Edje *ed;
Edje_Real_Part *rp;
+ Edje_User_Defined *eud;
+ Eina_List *l;
ed = _edje_fetch(obj);
if ((!ed) || (!part)) return EINA_FALSE;
@@ -3141,6 +3273,24 @@ edje_object_part_drag_value_set(Evas_Object *obj, const char *part, double dx, d
if (!rp) return EINA_FALSE;
if (!rp->drag) return EINA_FALSE;
if (rp->drag->down.count > 0) return EINA_FALSE;
+
+ EINA_LIST_FOREACH(ed->user_defined, l, eud)
+ if (eud->type == EDJE_USER_DRAG_VALUE && !strcmp(part, eud->part))
+ {
+ eud->u.drag_position.x = dx;
+ eud->u.drag_position.y = dy;
+ break;
+ }
+ if (!eud)
+ {
+ eud = _edje_user_definition_new(EDJE_USER_DRAG_VALUE, part, ed);
+ if (eud)
+ {
+ eud->u.drag_position.x = dx;
+ eud->u.drag_position.y = dy;
+ }
+ }
+
if (rp->part->dragable.confine_id != -1)
{
dx = CLAMP(dx, 0.0, 1.0);
@@ -3199,12 +3349,32 @@ edje_object_part_drag_size_set(Evas_Object *obj, const char *part, double dw, do
{
Edje *ed;
Edje_Real_Part *rp;
+ Edje_User_Defined *eud;
+ Eina_List *l;
ed = _edje_fetch(obj);
if ((!ed) || (!part)) return EINA_FALSE;
rp = _edje_real_part_recursive_get(ed, part);
if (!rp) return EINA_FALSE;
if (!rp->drag) return EINA_FALSE;
+
+ EINA_LIST_FOREACH(ed->user_defined, l, eud)
+ if (eud->type == EDJE_USER_DRAG_SIZE && !strcmp(part, eud->part))
+ {
+ eud->u.drag_size.w = dw;
+ eud->u.drag_size.h = dh;
+ break;
+ }
+ if (!eud)
+ {
+ eud = _edje_user_definition_new(EDJE_USER_DRAG_SIZE, part, ed);
+ if (eud)
+ {
+ eud->u.drag_size.w = dw;
+ eud->u.drag_size.h = dh;
+ }
+ }
+
if (dw < 0.0) dw = 0.0;
else if (dw > 1.0) dw = 1.0;
if (dh < 0.0) dh = 0.0;
@@ -3255,12 +3425,32 @@ edje_object_part_drag_step_set(Evas_Object *obj, const char *part, double dx, do
{
Edje *ed;
Edje_Real_Part *rp;
+ Edje_User_Defined *eud;
+ Eina_List *l;
ed = _edje_fetch(obj);
if ((!ed) || (!part)) return EINA_FALSE;
rp = _edje_real_part_recursive_get(ed, part);
if (!rp) return EINA_FALSE;
if (!rp->drag) return EINA_FALSE;
+
+ EINA_LIST_FOREACH(ed->user_defined, l, eud)
+ if (eud->type == EDJE_USER_DRAG_STEP && !strcmp(part, eud->part))
+ {
+ eud->u.drag_position.x = dx;
+ eud->u.drag_position.y = dy;
+ break;
+ }
+ if (!eud)
+ {
+ eud = _edje_user_definition_new(EDJE_USER_DRAG_STEP, part, ed);
+ if (eud)
+ {
+ eud->u.drag_position.x = dx;
+ eud->u.drag_position.y = dy;
+ }
+ }
+
if (dx < 0.0) dx = 0.0;
else if (dx > 1.0) dx = 1.0;
if (dy < 0.0) dy = 0.0;
@@ -3307,12 +3497,32 @@ edje_object_part_drag_page_set(Evas_Object *obj, const char *part, double dx, do
{
Edje *ed;
Edje_Real_Part *rp;
+ Edje_User_Defined *eud;
+ Eina_List *l;
ed = _edje_fetch(obj);
if ((!ed) || (!part)) return EINA_FALSE;
rp = _edje_real_part_recursive_get(ed, part);
if (!rp) return EINA_FALSE;
if (!rp->drag) return EINA_FALSE;
+
+ EINA_LIST_FOREACH(ed->user_defined, l, eud)
+ if (eud->type == EDJE_USER_DRAG_PAGE && !strcmp(part, eud->part))
+ {
+ eud->u.drag_position.x = dx;
+ eud->u.drag_position.y = dy;
+ break;
+ }
+ if (!eud)
+ {
+ eud = _edje_user_definition_new(EDJE_USER_DRAG_PAGE, part, ed);
+ if (eud)
+ {
+ eud->u.drag_position.x = dx;
+ eud->u.drag_position.y = dy;
+ }
+ }
+
if (dx < 0.0) dx = 0.0;
else if (dx > 1.0) dx = 1.0;
if (dy < 0.0) dy = 0.0;
@@ -3360,6 +3570,8 @@ edje_object_part_drag_step(Evas_Object *obj, const char *part, double dx, double
Edje *ed;
Edje_Real_Part *rp;
FLOAT_T px, py;
+ Edje_User_Defined *eud;
+ Eina_List *l;
ed = _edje_fetch(obj);
if ((!ed) || (!part)) return EINA_FALSE;
@@ -3367,6 +3579,24 @@ edje_object_part_drag_step(Evas_Object *obj, const char *part, double dx, double
if (!rp) return EINA_FALSE;
if (!rp->drag) return EINA_FALSE;
if (rp->drag->down.count > 0) return EINA_FALSE;
+
+ EINA_LIST_FOREACH(ed->user_defined, l, eud)
+ if (eud->type == EDJE_USER_DRAG_STEP && !strcmp(part, eud->part))
+ {
+ eud->u.drag_position.x = dx;
+ eud->u.drag_position.y = dy;
+ break;
+ }
+ if (!eud)
+ {
+ eud = _edje_user_definition_new(EDJE_USER_DRAG_STEP, part, ed);
+ if (eud)
+ {
+ eud->u.drag_position.x = dx;
+ eud->u.drag_position.y = dy;
+ }
+ }
+
px = rp->drag->val.x;
py = rp->drag->val.y;
rp->drag->val.x = ADD(px, MUL(FROM_DOUBLE(dx),
@@ -3390,6 +3620,8 @@ edje_object_part_drag_page(Evas_Object *obj, const char *part, double dx, double
Edje *ed;
Edje_Real_Part *rp;
FLOAT_T px, py;
+ Edje_User_Defined *eud;
+ Eina_List *l;
ed = _edje_fetch(obj);
if ((!ed) || (!part)) return EINA_FALSE;
@@ -3397,6 +3629,24 @@ edje_object_part_drag_page(Evas_Object *obj, const char *part, double dx, double
if (!rp) return EINA_FALSE;
if (!rp->drag) return EINA_FALSE;
if (rp->drag->down.count > 0) return EINA_FALSE;
+
+ EINA_LIST_FOREACH(ed->user_defined, l, eud)
+ if (eud->type == EDJE_USER_DRAG_PAGE && !strcmp(part, eud->part))
+ {
+ eud->u.drag_position.x = dx;
+ eud->u.drag_position.y = dy;
+ break;
+ }
+ if (!eud)
+ {
+ eud = _edje_user_definition_new(EDJE_USER_DRAG_PAGE, part, ed);
+ if (eud)
+ {
+ eud->u.drag_position.x = dx;
+ eud->u.drag_position.y = dy;
+ }
+ }
+
px = rp->drag->val.x;
py = rp->drag->val.y;
rp->drag->val.x = ADD(px, MUL(FROM_DOUBLE(dx), MUL(rp->drag->page.x, rp->part->dragable.x)));
@@ -3434,6 +3684,7 @@ edje_object_part_box_append(Evas_Object *obj, const char *part, Evas_Object *chi
{
Edje *ed;
Edje_Real_Part *rp;
+ Eina_Bool r;
ed = _edje_fetch(obj);
if ((!ed) || (!part) || (!child)) return EINA_FALSE;
@@ -3442,7 +3693,20 @@ edje_object_part_box_append(Evas_Object *obj, const char *part, Evas_Object *chi
if (!rp) return EINA_FALSE;
if (rp->part->type != EDJE_PART_TYPE_BOX) return EINA_FALSE;
- return _edje_real_part_box_append(rp, child);
+ r = _edje_real_part_box_append(rp, child);
+
+ if (r)
+ {
+ Edje_User_Defined *eud;
+
+ eud = _edje_user_definition_new(EDJE_USER_BOX_PACK, part, ed);
+ if (!eud) return r;
+ eud->u.box.child = child;
+ eud->u.box.index = -1;
+
+ evas_object_event_callback_add(child, EVAS_CALLBACK_DEL, _edje_user_def_del_cb, eud);
+ }
+ return r;
}
EAPI Eina_Bool
@@ -3450,6 +3714,7 @@ edje_object_part_box_prepend(Evas_Object *obj, const char *part, Evas_Object *ch
{
Edje *ed;
Edje_Real_Part *rp;
+ Eina_Bool r;
ed = _edje_fetch(obj);
if ((!ed) || (!part)) return EINA_FALSE;
@@ -3458,7 +3723,19 @@ edje_object_part_box_prepend(Evas_Object *obj, const char *part, Evas_Object *ch
if (!rp) return EINA_FALSE;
if (rp->part->type != EDJE_PART_TYPE_BOX) return EINA_FALSE;
- return _edje_real_part_box_prepend(rp, child);
+ r = _edje_real_part_box_prepend(rp, child);
+
+ if (r)
+ {
+ Edje_User_Defined *eud;
+
+ eud = _edje_user_definition_new(EDJE_USER_BOX_PACK, part, ed);
+ if (!eud) return r;
+ eud->u.box.child = child;
+
+ evas_object_event_callback_add(child, EVAS_CALLBACK_DEL, _edje_user_def_del_cb, eud);
+ }
+ return r;
}
EAPI Eina_Bool
@@ -3466,6 +3743,7 @@ edje_object_part_box_insert_before(Evas_Object *obj, const char *part, Evas_Obje
{
Edje *ed;
Edje_Real_Part *rp;
+ Eina_Bool r;
ed = _edje_fetch(obj);
if ((!ed) || (!part)) return EINA_FALSE;
@@ -3474,7 +3752,19 @@ edje_object_part_box_insert_before(Evas_Object *obj, const char *part, Evas_Obje
if (!rp) return EINA_FALSE;
if (rp->part->type != EDJE_PART_TYPE_BOX) return EINA_FALSE;
- return _edje_real_part_box_insert_before(rp, child, reference);
+ r = _edje_real_part_box_insert_before(rp, child, reference);
+
+ if (r)
+ {
+ Edje_User_Defined *eud;
+
+ eud = _edje_user_definition_new(EDJE_USER_BOX_PACK, part, ed);
+ if (!eud) return r;
+ eud->u.box.child = child;
+
+ evas_object_event_callback_add(child, EVAS_CALLBACK_DEL, _edje_user_def_del_cb, eud);
+ }
+ return r;
}
EAPI Eina_Bool
@@ -3482,6 +3772,7 @@ edje_object_part_box_insert_at(Evas_Object *obj, const char *part, Evas_Object *
{
Edje *ed;
Edje_Real_Part *rp;
+ Eina_Bool r;
ed = _edje_fetch(obj);
if ((!ed) || (!part)) return EINA_FALSE;
@@ -3490,7 +3781,19 @@ edje_object_part_box_insert_at(Evas_Object *obj, const char *part, Evas_Object *
if (!rp) return EINA_FALSE;
if (rp->part->type != EDJE_PART_TYPE_BOX) return EINA_FALSE;
- return _edje_real_part_box_insert_at(rp, child, pos);
+ r = _edje_real_part_box_insert_at(rp, child, pos);
+
+ if (r)
+ {
+ Edje_User_Defined *eud;
+
+ eud = _edje_user_definition_new(EDJE_USER_BOX_PACK, part, ed);
+ if (!eud) return r;
+ eud->u.box.child = child;
+
+ evas_object_event_callback_add(child, EVAS_CALLBACK_DEL, _edje_user_def_del_cb, eud);
+ }
+ return r;
}
EAPI Evas_Object *
@@ -3498,6 +3801,7 @@ edje_object_part_box_remove(Evas_Object *obj, const char *part, Evas_Object *chi
{
Edje *ed;
Edje_Real_Part *rp;
+ Evas_Object *r;
ed = _edje_fetch(obj);
if ((!ed) || (!part)) return NULL;
@@ -3506,7 +3810,21 @@ edje_object_part_box_remove(Evas_Object *obj, const char *part, Evas_Object *chi
if (!rp) return NULL;
if (rp->part->type != EDJE_PART_TYPE_BOX) return NULL;
- return _edje_real_part_box_remove(rp, child);
+ r = _edje_real_part_box_remove(rp, child);
+
+ if (r)
+ {
+ Edje_User_Defined *eud;
+ Eina_List *l;
+
+ EINA_LIST_FOREACH(ed->user_defined, l, eud)
+ if (eud->type == EDJE_USER_BOX_PACK && eud->u.box.child == child && !strcmp(eud->part, part))
+ {
+ _edje_user_definition_free(eud);
+ return r;
+ }
+ }
+ return r;
}
EAPI Evas_Object *
@@ -3514,6 +3832,7 @@ edje_object_part_box_remove_at(Evas_Object *obj, const char *part, unsigned int
{
Edje *ed;
Edje_Real_Part *rp;
+ Evas_Object *r;
ed = _edje_fetch(obj);
if ((!ed) || (!part)) return NULL;
@@ -3522,7 +3841,21 @@ edje_object_part_box_remove_at(Evas_Object *obj, const char *part, unsigned int
if (!rp) return NULL;
if (rp->part->type != EDJE_PART_TYPE_BOX) return NULL;
- return _edje_real_part_box_remove_at(rp, pos);
+ r = _edje_real_part_box_remove_at(rp, pos);
+
+ if (r)
+ {
+ Edje_User_Defined *eud;
+ Eina_List *l;
+
+ EINA_LIST_FOREACH(ed->user_defined, l, eud)
+ if (eud->type == EDJE_USER_BOX_PACK && eud->u.box.child == r && !strcmp(eud->part, part))
+ {
+ _edje_user_definition_free(eud);
+ return r;
+ }
+ }
+ return r;
}
EAPI Eina_Bool
@@ -3530,6 +3863,7 @@ edje_object_part_box_remove_all(Evas_Object *obj, const char *part, Eina_Bool cl
{
Edje *ed;
Edje_Real_Part *rp;
+ Eina_Bool r;
ed = _edje_fetch(obj);
if ((!ed) || (!part)) return EINA_FALSE;
@@ -3538,8 +3872,41 @@ edje_object_part_box_remove_all(Evas_Object *obj, const char *part, Eina_Bool cl
if (!rp) return EINA_FALSE;
if (rp->part->type != EDJE_PART_TYPE_BOX) return EINA_FALSE;
- return _edje_real_part_box_remove_all(rp, clear);
+ r = _edje_real_part_box_remove_all(rp, clear);
+ if (r)
+ {
+ Edje_User_Defined *eud;
+ Eina_List *ll, *l;
+
+ EINA_LIST_FOREACH_SAFE(ed->user_defined, l, ll, eud)
+ if (eud->type == EDJE_USER_BOX_PACK && !strcmp(eud->part, part))
+ {
+ _edje_user_definition_free(eud);
+ return r;
+ }
+ }
+ return r;
+}
+
+EAPI Eina_List *
+edje_object_access_part_list_get(const Evas_Object *obj)
+{
+ Edje *ed;
+ Eina_List *access_parts = NULL;
+
+ ed = _edje_fetch(obj);
+ if ((!ed)) return NULL;
+
+ unsigned int i;
+ for (i = 0; i < ed->table_parts_size; i++)
+ {
+ Edje_Real_Part *rp;
+ rp = ed->table_parts[i];
+ if (rp->part->access)
+ access_parts = eina_list_append(access_parts, rp->part->name);
+ }
+ return access_parts;
}
static void
@@ -3714,10 +4081,34 @@ _edje_real_part_box_remove_all(Edje_Real_Part *rp, Eina_Bool clear)
}
static void
-_edje_table_child_del_cb(void *data, Evas *e __UNUSED__, Evas_Object *child __UNUSED__, void *einfo __UNUSED__)
+_edje_table_child_del_cb(void *data, Evas *e __UNUSED__, Evas_Object *child, void *einfo __UNUSED__)
{
+ Edje_User_Defined *eud;
+ Eina_List *l;
Edje_Real_Part *rp = data;
+ EINA_LIST_FOREACH(rp->edje->user_defined, l, eud)
+ if (rp->part->type == EDJE_PART_TYPE_BOX)
+ {
+ if (eud->type == EDJE_USER_BOX_PACK &&
+ eud->u.box.child == child &&
+ !strcmp(rp->part->name, eud->part))
+ {
+ _edje_user_definition_free(eud);
+ break;
+ }
+ }
+ else if (rp->part->type == EDJE_PART_TYPE_TABLE)
+ {
+ if (eud->type == EDJE_USER_TABLE_PACK &&
+ eud->u.table.child == child &&
+ !strcmp(rp->part->name, eud->part))
+ {
+ _edje_user_definition_free(eud);
+ break;
+ }
+ }
+
rp->edje->dirty = 1;
rp->edje->recalc_call = 1;
#ifdef EDJE_CALC_CACHE
@@ -3755,7 +4146,7 @@ _edje_table_child_remove(Edje_Real_Part *rp, Evas_Object *child)
}
EAPI Evas_Object *
-edje_object_part_table_child_get(Evas_Object *obj, const char *part, unsigned int col, unsigned int row)
+edje_object_part_table_child_get(const Evas_Object *obj, const char *part, unsigned int col, unsigned int row)
{
Edje *ed;
Edje_Real_Part *rp;
@@ -3775,6 +4166,8 @@ edje_object_part_table_pack(Evas_Object *obj, const char *part, Evas_Object *chi
{
Edje *ed;
Edje_Real_Part *rp;
+ Edje_User_Defined *eud;
+ Eina_Bool r;
ed = _edje_fetch(obj);
if ((!ed) || (!part)) return EINA_FALSE;
@@ -3783,7 +4176,21 @@ edje_object_part_table_pack(Evas_Object *obj, const char *part, Evas_Object *chi
if (!rp) return EINA_FALSE;
if (rp->part->type != EDJE_PART_TYPE_TABLE) return EINA_FALSE;
- return _edje_real_part_table_pack(rp, child_obj, col, row, colspan, rowspan);
+ r = _edje_real_part_table_pack(rp, child_obj, col, row, colspan, rowspan);
+ if (r)
+ {
+ eud = _edje_user_definition_new(EDJE_USER_TABLE_PACK, part, ed);
+ if (!eud) return r;
+
+ eud->u.table.child = child_obj;
+ eud->u.table.col = col;
+ eud->u.table.row = row;
+ eud->u.table.colspan = colspan;
+ eud->u.table.rowspan = rowspan;
+
+ evas_object_event_callback_add(child_obj, EVAS_CALLBACK_DEL, _edje_user_def_del_cb, eud);
+ }
+ return r;
}
EAPI Eina_Bool
@@ -3791,6 +4198,7 @@ edje_object_part_table_unpack(Evas_Object *obj, const char *part, Evas_Object *c
{
Edje *ed;
Edje_Real_Part *rp;
+ Eina_Bool r;
ed = _edje_fetch(obj);
if ((!ed) || (!part)) return EINA_FALSE;
@@ -3799,7 +4207,24 @@ edje_object_part_table_unpack(Evas_Object *obj, const char *part, Evas_Object *c
if (!rp) return EINA_FALSE;
if (rp->part->type != EDJE_PART_TYPE_TABLE) return EINA_FALSE;
- return _edje_real_part_table_unpack(rp, child_obj);
+ r = _edje_real_part_table_unpack(rp, child_obj);
+
+ if (r)
+ {
+ Edje_User_Defined *eud;
+ Eina_List *l;
+
+ EINA_LIST_FOREACH(ed->user_defined, l, eud)
+ if (eud->type == EDJE_USER_TABLE_PACK &&
+ eud->u.table.child == child_obj &&
+ !strcmp(part, eud->part))
+ {
+ _edje_user_definition_free(eud);
+ break;
+ }
+ }
+
+ return r;
}
EAPI Eina_Bool
@@ -4561,12 +4986,21 @@ _edje_block_violate(Edje *ed)
}
void
-_edje_object_part_swallow_free_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
+_edje_object_part_swallow_free_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
- Evas_Object *edje_obj;
+ Edje_Real_Part *rp;
+ Edje_User_Defined *eud;
+ Eina_List *l;
+
+ rp = data;
+
+ EINA_LIST_FOREACH(rp->edje->user_defined, l, eud)
+ if (eud->type == EDJE_USER_SWALLOW && eud->u.swallow.child == obj)
+ {
+ _edje_user_definition_free(eud);
+ break;
+ }
- edje_obj = data;
- edje_object_part_unswallow(edje_obj, obj);
return;
}
@@ -4640,7 +5074,7 @@ _edje_real_part_swallow_hints_update(Edje_Real_Part *rp)
}
rp->swallow_params.aspect.w = aw;
rp->swallow_params.aspect.h = ah;
- evas_object_data_set(rp->swallowed_object, "\377 edje.swallowing_part", rp);
+ evas_object_data_set(rp->swallowed_object, "\377 edje.swallowing_part", rp);
}
#ifdef EDJE_CALC_CACHE
@@ -4670,8 +5104,7 @@ _edje_real_part_swallow(Edje_Real_Part *rp,
{
if (rp->swallowed_object != obj_swallow)
{
- _edje_real_part_swallow_clear(rp);
- rp->swallowed_object = NULL;
+ edje_object_part_unswallow(rp->edje->obj, rp->swallowed_object);
}
else
{
@@ -4697,7 +5130,7 @@ _edje_real_part_swallow(Edje_Real_Part *rp,
evas_object_event_callback_add(rp->swallowed_object,
EVAS_CALLBACK_DEL,
_edje_object_part_swallow_free_cb,
- rp->edje->obj);
+ rp);
evas_object_event_callback_add(rp->swallowed_object,
EVAS_CALLBACK_CHANGED_SIZE_HINTS,
_edje_object_part_swallow_changed_hints_cb,
@@ -4733,9 +5166,9 @@ _edje_real_part_swallow_clear(Edje_Real_Part *rp)
{
evas_object_smart_member_del(rp->swallowed_object);
evas_object_event_callback_del_full(rp->swallowed_object,
- EVAS_CALLBACK_FREE,
+ EVAS_CALLBACK_DEL,
_edje_object_part_swallow_free_cb,
- rp->edje->obj);
+ rp);
evas_object_event_callback_del_full(rp->swallowed_object,
EVAS_CALLBACK_CHANGED_SIZE_HINTS,
_edje_object_part_swallow_changed_hints_cb,
@@ -4745,6 +5178,7 @@ _edje_real_part_swallow_clear(Edje_Real_Part *rp)
if (rp->part->mouse_events)
_edje_callbacks_del(rp->swallowed_object, rp->edje);
_edje_callbacks_focus_del(rp->swallowed_object, rp->edje);
+ rp->swallowed_object = NULL;
}
static void
@@ -4887,9 +5321,7 @@ static void
_cb_subobj_del(void *data, __UNUSED__ Evas *e, Evas_Object *obj, __UNUSED__ void *event_info)
{
Edje *ed = data;
- ed->subobjs = eina_list_remove(ed->subobjs, obj);
- evas_object_event_callback_del_full(obj, EVAS_CALLBACK_DEL,
- _cb_subobj_del, ed);
+ _edje_subobj_unregister(ed, obj);
}
void
@@ -4900,4 +5332,12 @@ _edje_subobj_register(Edje *ed, Evas_Object *ob)
_cb_subobj_del, ed);
}
+void
+_edje_subobj_unregister(Edje *ed, Evas_Object *obj)
+{
+ ed->subobjs = eina_list_remove(ed->subobjs, obj);
+ evas_object_event_callback_del_full(obj, EVAS_CALLBACK_DEL,
+ _cb_subobj_del, ed);
+}
+
/* vim:set ts=8 sw=3 sts=3 expandtab cino=>5n-2f0^-2{2(0W1st0 :*/
diff --git a/src/modules/alsa_snd_player/Makefile.am b/src/modules/alsa_snd_player/Makefile.am
index 8ec47e3..dd12c27 100644
--- a/src/modules/alsa_snd_player/Makefile.am
+++ b/src/modules/alsa_snd_player/Makefile.am
@@ -7,6 +7,7 @@ pkglibdir = $(REMIX_PLUGIN_DIR)
AM_CPPFLAGS = \
-I. \
@EDJE_CFLAGS@ \
+@EIO_CFLAGS@ \
@REMIX_CFLAGS@ \
@ALSA_CFLAGS@
diff --git a/src/modules/eet_snd_reader/Makefile.am b/src/modules/eet_snd_reader/Makefile.am
index f07a44a..171b7cc 100644
--- a/src/modules/eet_snd_reader/Makefile.am
+++ b/src/modules/eet_snd_reader/Makefile.am
@@ -5,6 +5,7 @@ pkglibdir = $(REMIX_PLUGIN_DIR)
AM_CPPFLAGS = \
-I. \
@EDJE_CFLAGS@ \
+@EIO_CFLAGS@ \
@REMIX_CFLAGS@
pkgdir = $(REMIX_PLUGIN_DIR)
diff --git a/src/modules/multisense_factory/Makefile.am b/src/modules/multisense_factory/Makefile.am
index f86f631..072d27d 100644
--- a/src/modules/multisense_factory/Makefile.am
+++ b/src/modules/multisense_factory/Makefile.am
@@ -11,6 +11,7 @@ AM_CPPFLAGS = \
-DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \
-DPACKAGE_EXAMPLES_DIR=\"$(datadir)/$(PACKAGE)/multisense_factory\" \
@EDJE_CFLAGS@ \
+@EIO_CFLAGS@ \
@REMIX_CFLAGS@
pkgdir = $(libdir)/edje/modules/multisense_factory/$(MODULE_ARCH)