/src/bin/edje_convert
/src/bin/edje_decc
/src/bin/edje_player
-/src/bin/edje_watch
/stamp-h1
tags
/config.cache
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>
-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>
+Mikael Sans <sans.mikael@gmail.com>
\ No newline at end of file
edje_object_part_text_escaped_set() that converts escapes to
plain UTF8 if the part is TEXT.
-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
+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
-
-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).
-
-Improvements:
- * Allocate once and reuse Evas_Map.
- * Make edje_cc faster by improving the parser, mapping file in memory and using threads.
-
-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
-
Edje 1.2.0
Changes since Edje 1.1.0:
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
m4_define([v_maj], [1])
m4_define([v_min], [2])
-m4_define([v_mic], [99])
+m4_define([v_mic], [0])
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
-dnl m4_undefine([v_rev])
+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])
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
-AC_INIT([edje], [v_ver], [enlightenment-devel@lists.sourceforge.net])
+AC_INIT([edje], [v_ver]-beta, [enlightenment-devel@lists.sourceforge.net])
AC_PREREQ([2.52])
AC_CONFIG_SRCDIR([configure.ac])
AC_CONFIG_MACRO_DIR([m4])
case "$host_os" in
- mingw32ce*)
+ mingw32ce* | cegcc*)
MODULE_ARCH="$host_os-$host_cpu"
install_vim="no"
have_edje_cc="no"
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"
],
[have_ecore_imf="no"])
-PKG_CHECK_MODULES([EIO],
- [eio >= 1.0.0],
- [
- AC_DEFINE([HAVE_EIO], [1], [Eio is available for monitoring file assynchronously])
- have_eio="yes"
- requirement_edje="eio >= 1.0.0 ${requirement_edje}"
- ],
- [have_eio="no"])
-
# Enable Multisense use
want_multisense="yes"
AC_ARG_ENABLE([multisense],
],
[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
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
# 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.2.0 ecore-evas >= 1.2.0 ecore >= 1.2.0 evas >= 1.2.0 eet >= 1.6.0 eina >= 1.2.0])
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.2.0 ecore-evas >= 1.2.0 ecore >= 1.2.0 evas >= 1.2.0 eet >= 1.6.0 eina >= 1.2.0])
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.2.0 ecore >= 1.2.0 evas >= 1.2.0 eina >= 1.2.0])
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.2.0 ecore >= 1.2.0 evas >= 1.2.0 eina >= 1.2.0])
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.2.0 evas >= 1.2.0 eina >= 1.2.0])
fi
-if test "x${have_edje_watch}" = "xyes" ; then
- PKG_CHECK_MODULES([EDJE_WATCH],
- [ecore >= 1.2.0 eina >= 1.2.0 eio >= 1.0.0],
- [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])
mingw32ce*)
EDJE_CFLAGS="${EDJE_CFLAGS} -D_WIN32_WCE=0x0420"
;;
+ cegcc*)
+ EDJE_CFLAGS="${EDJE_CFLAGS} -mwin32 -D_WIN32_WCE=0x0420"
+ ;;
esac
lt_enable_auto_import=""
case "$host_os" in
- mingw*)
+ mingw* | cegcc*)
lt_enable_auto_import="-Wl,--enable-auto-import"
;;
esac
AC_FUNC_ALLOCA
case "$host_os" in
- mingw*)
+ mingw* | cegcc*)
AC_DEFINE([HAVE_REALPATH], [1], [Define to 1 if you have the `realpath' function.])
;;
*)
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"
endif
EXTRA_DIST = Doxyfile e.css foot.html head.html $(wildcard img/*.*) \
- $(wildcard examples/*.*) examples.dox
+ $(wildcard examples/*.*)
* declares two parts (blue and green rectangles) and an item data:
* @include basic.edc
*
- * We start by trying to access an @b unexistant group in the file, so
+ * We start by trying to acces 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:
* @until min. size is
*
* The next two calls are to make <b>size calculations</b> on our
- * object. Because of the minimum size declared for @c "part_one" part's
+ * object. Because of the minumim 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
*
* 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 process and object level.
+ * class at the proccess 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, although both will be
+ * but just in one of them we will set a specific color class, althoug 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
* 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 "mouse,move" signal so we need to register a callback to it.
+ * In this example we are only sensitive to the "mouve,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
- * coming from the part "part_image" and when this happens we will call the function _on_mouse_over passing
+ * comming from the part "part_image" and when this happens we will call the fuction _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.
*
* we need to now where is the ball and where is the mouse and we can easily discovery these things using
* this:
*
- * For the object position in the canvas:
+ * For the the object position in the canvas:
* @dontinclude signals2.c
* @skipline evas_object_geometry
*
* @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 beyond the canvas size. So here it is:
+ * we need to do something if the new position is beyound the canvas size. So here it is:
*
* @skip if
* @until y = 0
<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>
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 \
-DPACKAGE_LIB_DIR=\"$(libdir)\" \
-DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \
-DEPP_DIR=\"$(libdir)/$(PACKAGE)/utils\" \
-@EDJE_CFLAGS@ @EDJE_CC_CFLAGS@ @EIO_CFLAGS@ @EVIL_CFLAGS@ @SNDFILE_CFLAGS@
+@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_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_watch_LDFLAGS = @lt_enable_auto_import@
edje_decc_SOURCES = \
edje_decc.c \
edje_decc_CPPFLAGS = \
-I$(top_srcdir)/src/bin \
-I$(top_srcdir)/src/lib \
-@EDJE_CFLAGS@ @EDJE_DECC_CFLAGS@ @EIO_CFLAGS@ @EVIL_CFLAGS@
+@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_decc_LDFLAGS = @lt_enable_auto_import@
edje_player_CPPFLAGS = \
-I$(top_srcdir)/src/bin \
-I$(top_srcdir)/src/lib \
-@EDJE_PLAYER_CFLAGS@ @EVIL_CFLAGS@ @EIO_CFLAGS@
+@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_LDFLAGS = @lt_enable_auto_import@
edje_inspector_CPPFLAGS = \
-I$(top_srcdir)/src/bin \
-I$(top_srcdir)/src/lib \
-@EDJE_INSPECTOR_CFLAGS@ @EIO_CFLAGS@
+@EDJE_INSPECTOR_CFLAGS@
edje_inspector_LDADD = $(top_builddir)/src/lib/libedje.la @EDJE_INSPECTOR_LIBS@ @VORBISENC_LIBS@ @FLAC_LIBS@
edje_inspector_LDFLAGS = @lt_enable_auto_import@
edje_external_inspector_CPPFLAGS = \
-I$(top_srcdir)/src/bin \
-I$(top_srcdir)/src/lib \
-@EDJE_EXTERNAL_INSPECTOR_CFLAGS@ @EIO_CFLAGS@
+@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_LDFLAGS = @lt_enable_auto_import@
char *tmp_dir = NULL;
char *file_out = NULL;
char *progname = NULL;
-char *watchfile = NULL;
int verbose = 0;
int no_lossy = 0;
int no_save = 0;
int min_quality = 0;
int max_quality = 100;
-int compress_mode = EET_COMPRESSION_DEFAULT;
-int threads = 1;
static void
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"
"-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);
}
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]));
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)
exit(-1);
}
- using_file(file_in);
-
+ _on_edjecc = EINA_TRUE;
if (!edje_init())
exit(-1);
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 */
extern char *tmp_dir;
extern char *file_out;
extern char *progname;
-extern char *watchfile;
extern int verbose;
extern int no_lossy;
extern int no_comp;
extern Eina_List *aliases;
extern New_Object_Handler object_handlers[];
extern New_Statement_Handler statement_handlers[];
-extern int compress_mode;
-extern int threads;
+
#endif
switch (type)
{
- case EDJE_PART_TYPE_SPACER:
case EDJE_PART_TYPE_RECTANGLE:
case EDJE_PART_TYPE_SWALLOW:
case EDJE_PART_TYPE_GROUP:
if (!result)
{
- ERR("%s: Error. Unknown type %i of part %s in collection %s.", progname, type, part, collection);
- exit(-1);
+ ERR("%s: Error. Unknown type %i of part %s in collection %s.", progname, type, part, collection);
+ exit(-1);
}
return result;
0, sizeof (Edje_Image_Directory_Entry));
if (!edje_file->image_dir->entries)
{
- ERR("%s: Error. No enough memory.", progname);
- exit(-1);
+ ERR("%s: Error. No enough memory.", progname);
+ exit(-1);
}
img = edje_file->image_dir->entries + edje_file->image_dir->entries_count - 1;
0, sizeof (Edje_Image_Directory_Set));
if (!edje_file->image_dir->sets)
{
- ERR("%s: Error. Not enough memory.", progname);
- exit(-1);
+ ERR("%s: Error. Not enough memory.", progname);
+ exit(-1);
}
edje_file->image_dir->sets[edje_file->image_dir->sets_count - 1].id = edje_file->image_dir->sets_count - 1;
}
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("%s: Error. parse error %s:%i. There is already a basic format for the style",
+ progname, file_in, line - 1);
+ exit(-1);
}
tag = mem_alloc(SZ(Edje_Style_Tag));
tag->key = mem_strdup("DEFAULT");
{
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("%p: Error. A collection without a name was detected, that's not allowed.", progname);
+ exit(-1);
}
current_de = mem_alloc(SZ(Edje_Part_Collection_Directory_Entry));
pc->parts = realloc(pc->parts, pc->parts_count * sizeof (Edje_Part *));
if (!pc->parts)
{
- ERR("%s: Error. Not enough memory.", progname);
- exit(-1);
+ ERR("%s: Error. Not enough memory.", progname);
+ exit(-1);
}
current_part = pc->parts[pc->parts_count - 1] = ep;
@li TABLE
@li EXTERNAL
@li PROXY
- @li SPACER
@endproperty
*/
static 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 */
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("%s: Error. parse error %s:%i. "
+ "box attributes in non-BOX or TABLE part.",
+ progname, 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("%s: Error. Not enough memory.", progname);
+ exit(-1);
}
item = mem_alloc(SZ(Edje_Pack_Element_Parser));
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("%s: Error. parse error %s:%i. "
+ "table attributes in non-TABLE part.",
+ progname, file_in, line - 1);
+ exit(-1);
}
current_item->col = parse_int_range(0, 0, 0xffff);
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("%s: Error. parse error %s:%i. "
+ "table attributes in non-TABLE part.",
+ progname, file_in, line - 1);
+ exit(-1);
}
current_item->colspan = parse_int_range(0, 1, 0xffff);
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->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:
{
check_arg_count(1);
- if (current_part->type == EDJE_PART_TYPE_SPACER)
- {
- ERR("%s: Error. parse error %s:%i. "
- "SPACER part can't have a visibility defined",
- progname, file_in, line - 1);
- exit(-1);
- }
-
current_desc->visible = parse_bool(0);
}
{
check_arg_count(1);
- if (current_part->type == EDJE_PART_TYPE_SPACER)
- {
- ERR("%s: Error. parse error %s:%i. "
- "SPACER part can't have a color defined",
- progname, file_in, line - 1);
- exit(-1);
- }
-
current_desc->color_class = parse_str(0);
}
{
check_arg_count(4);
- if (current_part->type == EDJE_PART_TYPE_SPACER)
- {
- ERR("%s: Error. parse error %s:%i. "
- "SPACER part can't have a color defined",
- progname, 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);
{
check_arg_count(4);
- if (current_part->type == EDJE_PART_TYPE_SPACER)
- {
- ERR("%s: Error. parse error %s:%i. "
- "SPACER part can't have a color defined",
- progname, 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);
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("%s: Error. Setting color3 in part %s from %s not of type TEXT or TEXTBLOCK.", progname, current_part->name, pc->part);
+ exit(-1);
}
ed = (Edje_Part_Description_Text*)current_desc;
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("%s: Error. parse error %s:%i. "
+ "image attributes in non-IMAGE part.",
+ progname, file_in, line - 1);
+ exit(-1);
}
ed = (Edje_Part_Description_Image*) current_desc;
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("%s: Error. parse error %s:%i. "
+ "image attributes in non-IMAGE part.",
+ progname, file_in, line - 1);
+ exit(-1);
}
ed = (Edje_Part_Description_Image*) current_desc;
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("%s: Error. parse error %s:%i. "
+ "image attributes in non-IMAGE part.",
+ progname, file_in, line - 1);
+ exit(-1);
}
ed = (Edje_Part_Description_Image*) current_desc;
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("%s: Error. parse error %s:%i. "
+ "image attributes in non-IMAGE part.",
+ progname, file_in, line - 1);
+ exit(-1);
}
ed = (Edje_Part_Description_Image*) current_desc;
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("%s: Error. parse error %s:%i. "
+ "image attributes in non-IMAGE part.",
+ progname, file_in, line - 1);
+ exit(-1);
}
ed = (Edje_Part_Description_Image*) current_desc;
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("%s: Error. parse error %s:%i. "
+ "image attributes in non-IMAGE part.",
+ progname, file_in, line - 1);
+ exit(-1);
}
ed = (Edje_Part_Description_Image*) current_desc;
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("%s: Error. parse error %s:%i. "
+ "image attributes in non-IMAGE part.",
+ progname, file_in, line - 1);
+ exit(-1);
}
ed = (Edje_Part_Description_Image*) current_desc;
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("%s: Error. parse error %s:%i. "
+ "image attributes in non-IMAGE part.",
+ progname, file_in, line - 1);
+ exit(-1);
}
ed = (Edje_Part_Description_Image*) ep->default_desc;
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("%s: Error. parse error %s:%i. "
+ "text attributes in non-TEXT part.",
+ progname, file_in, line - 1);
+ exit(-1);
}
ed = (Edje_Part_Description_Text*) current_desc;
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("%s: Error. parse error %s:%i. "
+ "text attributes in non-TEXT part.",
+ progname, file_in, line - 1);
+ exit(-1);
}
ed = (Edje_Part_Description_Text*) current_desc;
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("%s: Error. parse error %s:%i. "
+ "text attributes in non-TEXT part.",
+ progname, file_in, line - 1);
+ exit(-1);
}
ed = (Edje_Part_Description_Text*) current_desc;
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("%s: Error. parse error %s:%i. "
+ "text attributes in non-TEXT part.",
+ progname, file_in, line - 1);
+ exit(-1);
}
ed = (Edje_Part_Description_Text*) current_desc;
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("%s: Error. parse error %s:%i. "
+ "text attributes in non-TEXT part.",
+ progname, file_in, line - 1);
+ exit(-1);
}
ed = (Edje_Part_Description_Text*) current_desc;
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("%s: Error. parse error %s:%i. "
+ "text attributes in non-TEXT part.",
+ progname, file_in, line - 1);
+ exit(-1);
}
ed = (Edje_Part_Description_Text*)current_desc;
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("%s: Error. parse error %s:%i. "
+ "text attributes in non-TEXT part.",
+ progname, file_in, line - 1);
+ exit(-1);
}
ed = (Edje_Part_Description_Text*) current_desc;
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("%s: Error. parse error %s:%i. "
+ "min size is bigger than max size.",
+ progname, file_in, line - 1);
+ exit(-1);
}
}
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("%s: Error. parse error %s:%i. "
+ "text attributes in non-TEXT part.",
+ progname, file_in, line - 1);
+ exit(-1);
}
ed = (Edje_Part_Description_Text*) current_desc;
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("%s: Error. parse error %s:%i. "
+ "text attributes in non-TEXT part.",
+ progname, file_in, line - 1);
+ exit(-1);
}
ed = (Edje_Part_Description_Text*)current_desc;
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("%s: Error. parse error %s:%i. "
+ "text attributes in non-TEXT part.",
+ progname, file_in, line - 1);
+ exit(-1);
}
ed = (Edje_Part_Description_Text*) current_desc;
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("%s: Error. parse error %s:%i. "
+ "text attributes in non-TEXT part.",
+ progname, file_in, line - 1);
+ exit(-1);
}
ed = (Edje_Part_Description_Text*) current_desc;
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("%s: Error. parse error %s:%i. "
+ "text attributes in non-TEXT part.",
+ progname, file_in, line - 1);
+ exit(-1);
}
ed = (Edje_Part_Description_Text*) current_desc;
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("%s: Error. parse error %s:%i. "
+ "text attributes in non-TEXT part.",
+ progname, file_in, line - 1);
+ exit(-1);
}
ed = (Edje_Part_Description_Text*) current_desc;
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("%s: Error. parse error %s:%i. "
+ "text attributes in non-TEXT part.",
+ progname, file_in, line - 1);
+ exit(-1);
}
ed = (Edje_Part_Description_Text*) current_desc;
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("%s: Error. parse error %s:%i. "
+ "box attributes in non-BOX part.",
+ progname, file_in, line - 1);
+ exit(-1);
}
ed = (Edje_Part_Description_Box*) current_desc;
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("%s: Error. parse error %s:%i. "
+ "box attributes in non-BOX part.",
+ progname, file_in, line - 1);
+ exit(-1);
}
ed = (Edje_Part_Description_Box*) current_desc;
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("%s: Error. parse error %s:%i. "
+ "box attributes in non-BOX part.",
+ progname, file_in, line - 1);
+ exit(-1);
}
ed = (Edje_Part_Description_Box*) current_desc;
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("%s: Error. parse error %s:%i. "
+ "box attributes in non-BOX part.",
+ progname, file_in, line - 1);
+ exit(-1);
}
ed = (Edje_Part_Description_Box*) current_desc;
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("%s: Error. parse error %s:%i. "
+ "table attributes in non-TABLE part.",
+ progname, file_in, line - 1);
+ exit(-1);
}
ed = (Edje_Part_Description_Table*) current_desc;
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("%s: Error. parse error %s:%i. "
+ "table attributes in non-TABLE part.",
+ progname, file_in, line - 1);
+ exit(-1);
}
ed = (Edje_Part_Description_Table*) current_desc;
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("%s: Error. parse error %s:%i. "
+ "table attributes in non-TABLE part.",
+ progname, file_in, line - 1);
+ exit(-1);
}
ed = (Edje_Part_Description_Table*) current_desc;
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("%s: Error. parse error %s:%i. "
+ "box attributes in non-TABLE part.",
+ progname, file_in, line - 1);
+ exit(-1);
}
ed = (Edje_Part_Description_Table*) current_desc;
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("%s: Error. parse error %s:%i. "
+ "params in non-EXTERNAL part.",
+ progname, file_in, line - 1);
+ exit(-1);
}
ed = (Edje_Part_Description_External*) current_desc;
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;
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 __UNUSED__, const char *fmt, ...)
+error_and_abort(Eet_File *ef, const char *fmt, ...)
{
va_list ap;
va_start(ap, fmt);
vfprintf(stderr, fmt, ap);
va_end(ap);
- unlink(file_out);
- exit(-1);
+ ABORT_WRITE(ef, file_out);
}
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 "
}
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. */
}
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)
{
}
}
-static void
-data_thread_head(void *data, Ecore_Thread *thread __UNUSED__)
+static int
+data_write_header(Eet_File *ef)
{
- Head_Write *hw = data;
int bytes = 0;
- char buf[PATH_MAX];
if (edje_file)
{
{
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)
- {
- snprintf(buf, sizeof(buf),
- "Collection %i: name missing.\n", ce->id);
- hw->errstr = strdup(buf);
- return;
- }
+ error_and_abort(ef, "Collection %i: name missing.\n", ce->id);
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)
- {
- snprintf(buf, sizeof(buf),
- "Collection %s (%i) can't find an correct alias.\n",
- ce->entry, ce->id);
- hw->errstr = strdup(buf);
- return;
- }
+ error_and_abort(ef, "Collection %s (%i) can't find an correct alias.\n", ce->entry, ce->id);
+
eina_iterator_free(it);
+
eina_hash_direct_add(edje_file->collection, ce->entry, ce);
}
}
- bytes = eet_data_write(hw->ef, edd_edje_file, "edje/file", edje_file,
- compress_mode);
+ bytes = eet_data_write(ef, edd_edje_file, "edje/file", edje_file, 1);
if (bytes <= 0)
- {
- snprintf(buf, sizeof(buf),
- "Unable to write \"edje_file\" entry to \"%s\" \n",
- file_out);
- hw->errstr = strdup(buf);
- return;
- }
+ error_and_abort(ef, "Unable to write \"edje_file\" entry to \"%s\" \n",
+ file_out);
}
if (verbose)
- printf("%s: Wrote %9i bytes (%4iKb) for \"edje_file\" header\n",
- progname, 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)
{
- error_and_abort(hw->ef, hw->errstr);
- free(hw->errstr);
+ printf("%s: Wrote %9i bytes (%4iKb) for \"edje_file\" header\n",
+ progname, bytes, (bytes + 512) / 1024);
}
- free(hw);
-}
-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);
- }
+ return bytes;
}
-static void
-data_thread_fonts(void *data, Ecore_Thread *thread __UNUSED__)
+static int
+data_write_fonts(Eet_File *ef, int *font_num, int *input_bytes, int *input_raw_bytes)
{
- Fonts_Write *fc = data;
- Eina_List *ll;
- Eina_File *f = NULL;
- void *m = NULL;
+ Eina_Iterator *it;
int bytes = 0;
- char buf[PATH_MAX];
- char buf2[PATH_MAX];
+ int total_bytes = 0;
+ Font *fn;
- 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;
+ if (!edje_file->fonts)
+ return 0;
- 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)
+ it = eina_hash_iterator_data_new(edje_file->fonts);
+ EINA_ITERATOR_FOREACH(it, fn)
{
- if (f) eina_file_close(f);
- snprintf(buf, sizeof(buf),
- "Unable to load font part \"%s\" entry to %s \n",
- fc->fn->file, file_out);
- fc->errstr = strdup(buf);
- return;
- }
+ void *fdata = NULL;
+ int fsize = 0;
+ Eina_List *ll;
+ FILE *f;
- snprintf(buf, sizeof(buf), "edje/fonts/%s", fc->fn->name);
- bytes = eet_write(fc->ef, buf, m, eina_file_size_get(f), compress_mode);
+ f = fopen(fn->file, "rb");
+ if (f)
+ {
+ long pos;
- 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 \n", fc->fn->file, buf, file_out);
- fc->errstr = strdup(buf2);
- return;
- }
+ 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 (verbose)
- printf("%s: Wrote %9i bytes (%4iKb) for \"%s\" font entry \"%s\" compress: [real: %2.1f%%]\n",
- progname, 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);
-}
+ EINA_LIST_FOREACH(fnt_dirs, ll, data)
+ {
+ 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), "%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_write_fonts(Eet_File *ef, int *font_num)
-{
- Eina_Iterator *it;
- Font *fn;
+ 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);
- if (!edje_file->fonts) return;
+ *font_num += 1;
+ total_bytes += bytes;
+ *input_bytes += fsize;
+ *input_raw_bytes += fsize;
- 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;
+ 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);
+ }
}
eina_iterator_free(it);
+
+ return total_bytes;
}
static void
"pgm",
"ppm",
"pnm",
- "bmp",
- "ico",
- "tga",
NULL
};
file, file_out, errmsg, hint);
}
-static void
-data_thread_image(void *data, Ecore_Thread *thread __UNUSED__)
+static int
+data_write_images(Eet_File *ef, int *image_num, int *input_bytes, int *input_raw_bytes)
{
- Image_Write *iw = data;
- char buf[PATH_MAX];
- unsigned int *start, *end;
- Eina_Bool opaque = EINA_TRUE;
+ unsigned int i;
int bytes = 0;
+ int total_bytes = 0;
- if ((iw->data) && (iw->w > 0) && (iw->h > 0))
+ if ((edje_file) && (edje_file->image_dir))
{
- 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(buf, sizeof(buf),
- "Unable to write image part "
- "\"%s\" as \"%s\" part entry to "
- "%s\n", iw->img->entry, buf, file_out);
- iw->errstr = strdup(buf);
- return;
- }
- }
- else
- {
- snprintf(buf, sizeof(buf),
- "Unable to load image part "
- "\"%s\" as \"%s\" part entry to "
- "%s\n", iw->img->entry, buf, file_out);
- iw->errstr = strdup(buf);
- return;
- }
+ Ecore_Evas *ee;
+ Evas *evas;
+ Edje_Image_Directory_Entry *img;
- if (verbose)
- {
- struct stat st;
+ ecore_init();
+ ecore_evas_init();
- if (!iw->path || (stat(iw->path, &st))) st.st_size = 0;
- 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, iw->img->entry,
- 100 - (100 * (double)bytes) / ((double)(iw->w * iw->h * 4)),
- 100 - (100 * (double)bytes) / ((double)(st.st_size))
- );
- }
-}
+ ee = ecore_evas_buffer_new(1, 1);
+ if (!ee)
+ error_and_abort(ef, "Cannot create buffer engine canvas for image "
+ "load.\n");
-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);
-}
+ evas = ecore_evas_get(ee);
+ for (i = 0; i < edje_file->image_dir->entries_count; i++)
+ {
+ img = &edje_file->image_dir->entries[i];
-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);
- }
-}
+ 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;
-static void
-data_write_images(Eet_File *ef, int *image_num)
-{
- int i;
- Ecore_Evas *ee;
- Evas *evas;
-
- if (!((edje_file) && (edje_file->image_dir))) return;
-
- 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 < (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))
- {
- }
- else
- {
- Evas_Object *im;
- Eina_List *ll;
- char *s;
- int load_err = EVAS_LOAD_ERROR_NONE;
- Image_Write *iw;
-
- iw = calloc(1, sizeof(Image_Write));
- iw->ef = ef;
- iw->img = img;
- iw->im = im = evas_object_image_add(evas);
- evas_object_event_callback_add(im,
- EVAS_CALLBACK_IMAGE_PRELOADED,
- data_image_preload_done,
- iw);
- EINA_LIST_FOREACH(img_dirs, ll, s)
- {
- 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++;
- evas_object_image_preload(im, 0);
- using_file(buf);
- break;
- }
- }
- if (load_err != EVAS_LOAD_ERROR_NONE)
- {
- 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++;
- evas_object_image_preload(im, 0);
- using_file(img->entry);
- }
- else
- error_and_abort_image_load_error
- (ef, img->entry, load_err);
- }
+ 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 (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();
}
+
+ return total_bytes;
}
-static void
-data_thread_sounds(void *data, Ecore_Thread *thread __UNUSED__)
+static int
+data_write_sounds(Eet_File * ef, int *sound_num, int *input_bytes, int *input_raw_bytes)
{
- Sound_Write *sw = data;
- Eina_List *ll;
-#ifdef HAVE_LIBSNDFILE
- Edje_Sound_Encode *enc_info;
-#endif
- 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 (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
- if (!f)
- {
- ERR("%s: Error: Unable to load sound data of: %s",
- progname, sw->sample->name);
- exit(-1);
- }
-
- 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("%s: Error: File access error when reading '%s'",
- progname, 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
- if (verbose)
+ int total_bytes = 0;
+
+ if ((edje_file) && (edje_file->sound_dir))
{
+ Eina_List *ll;
+ Edje_Sound_Sample *sample;
#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, 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", 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;
+ Edje_Sound_Encode *enc_info;
#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))
- {
+ 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;
for (i = 0; i < (int)edje_file->sound_dir->samples_count; i++)
{
- Sound_Write *sw;
+ sample = &edje_file->sound_dir->samples[i];
+ memset(&st, 0, sizeof(struct stat));
+
+ // 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,
+ 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);
+ }
+ size = st.st_size;
+ if (!size)
+ {
+ ERR("%s: Error. Unable to load sound source file : %s",
+ progname, sample->snd_src);
+ exit(-1);
+ }
+#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");
+#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);
- sw = calloc(1, sizeof(Sound_Write));
- if (!sw) continue;
- sw->ef = ef;
- sw->sample = &edje_file->sound_dir->samples[i];
- sw->i = i;
+#ifdef HAVE_LIBSNDFILE
+ //If encoded temporary file, delete it.
+ if (enc_info->encoded) unlink(enc_info->file);
+#endif
*sound_num += 1;
- pending_threads++;
- if (threads)
- ecore_thread_run(data_thread_sounds, data_thread_sounds_end, NULL, sw);
- else
+ total_bytes += bytes;
+ *input_bytes += size;
+ *input_raw_bytes += size;
+
+ if (verbose)
{
- data_thread_sounds(sw, NULL);
- data_thread_sounds_end(sw, NULL);
+#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);
+#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);
+#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;
+#endif
}
}
+ return total_bytes;
}
static void
}
}
-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),
- "Error. Unable to write \"%s\" part entry to %s\n",
- buf, file_out);
- gw->errstr = strdup(buf2);
- return;
- }
-
- if (verbose)
- printf("%s: Wrote %9i bytes (%4iKb) for \"%s\" aka \"%s\" collection entry\n",
- progname, 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
+static int
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)
{
- Group_Write *gw;
+ char buf[4096];
- gw = calloc(1, sizeof(Group_Write));
- if (!gw)
- {
- error_and_abort(ef,
- "Error. Cannot allocate memory for group writer\n");
- 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;
+ 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;
+
+ if (verbose)
+ {
+ printf("%s: Wrote %9i bytes (%4iKb) for \"%s\" aka \"%s\" collection entry\n",
+ progname, bytes, (bytes + 512) / 1024, buf, pc->part);
+ }
}
+
+ return total_bytes;
}
static void
}
static void
-data_thread_script(void *data, Ecore_Thread *thread __UNUSED__)
+compile_script_file(Eet_File *ef, const char *source, const char *output,
+ int script_num, int fd)
{
- Script_Write *sc = data;
FILE *f;
- int size;
- char buf[PATH_MAX];
+ char buf[4096];
+ int ret;
- f = fdopen(sc->tmpo_fd, "rb");
+ 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");
+
+ f = fdopen(fd, "rb");
if (!f)
- {
- snprintf(buf, sizeof(buf),
- "Unable to open script object \"%s\" for reading.\n",
- sc->tmpo);
- sc->errstr = strdup(buf);
- return;
- }
+ error_and_abort(ef, "Unable to open script object \"%s\" for reading.\n",
+ output);
fseek(f, 0, SEEK_END);
- size = ftell(f);
+ int size = ftell(f);
rewind(f);
if (size > 0)
{
- void *dat = malloc(size);
+ void *data = malloc(size);
- if (dat)
+ if (data)
{
- if (fread(dat, size, 1, f) != 1)
- {
- snprintf(buf, sizeof(buf),
- "Unable to read all of script object \"%s\"\n",
- 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\n", (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);
-}
+ if (fread(data, size, 1, f) != 1)
+ error_and_abort(ef, "Unable to read all of script object "
+ "\"%s\"\n", output);
-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);
+ snprintf(buf, sizeof(buf), "edje/scripts/embryo/compiled/%i", script_num);
+ eet_write(ef, buf, data, size, 1);
+ free(data);
+ }
}
- 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.\n");
- 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;
+ fclose(f);
}
static void
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;
- sc = calloc(1, sizeof(Script_Write));
- sc->ef = ef;
- sc->cd = cd;
- sc->i = i;
- // XXX: from here
- 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.\n", 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)
+
+ 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)
{
- unlink(sc->tmpn);
- error_and_abort(ef, "Unable to open temp file \"%s\" for script "
- "compilation.\n", sc->tmpn);
+ 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);
+ }
}
- create_script_file(ef, sc->tmpn, cd, sc->tmpn_fd);
- // XXX; to here -> can make set of threads that report back and then
- // spawn
- snprintf(buf, sizeof(buf),
- "embryo_cc -i %s/include -o %s %s",
- 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)
{
- Script_Lua_Writer *data;
+ Edje_Lua_Script_Writer_Struct *data;
void *old;
- data = (Script_Lua_Writer *)_data;
+ data = (Edje_Lua_Script_Writer_Struct *)_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;
#endif
void
-_edje_lua_error_and_abort(lua_State *L, int err_code, Script_Write *sc)
+_edje_lua_error_and_abort(lua_State * L, int err_code, Eet_File *ef)
{
- 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;
}
- snprintf(buf, sizeof(buf),
- "Lua %s error: %s\n", 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\n");
- 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\n", sc->i);
- sc->errstr = strdup(buf);
- return;
- }
-#ifdef LUA_BINARY
- free(dat.buf);
-#endif
- lua_close(L);
+ error_and_abort(ef, "Lua %s error: %s\n", err_type, lua_tostring(L, -1));
}
-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++)
{
- 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);
- }
- }
-}
+ 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
-static void
-data_thread_source(void *data, Ecore_Thread *thread __UNUSED__)
-{
- Eet_File *ef = data;
- source_append(ef);
-}
+ 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_end(void *data __UNUSED__, Ecore_Thread *thread __UNUSED__)
-{
- pending_threads--;
- if (pending_threads <= 0) ecore_main_loop_quit();
-}
+ luaL_buffinit(L, &b);
-static void
-data_thread_fontmap(void *data, Ecore_Thread *thread __UNUSED__)
-{
- Eet_File *ef = data;
- source_fontmap_save(ef, fonts);
-}
+ 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_end(void *data __UNUSED__, Ecore_Thread *thread __UNUSED__)
-{
- pending_threads--;
- if (pending_threads <= 0) ecore_main_loop_quit();
+ 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);
+ }
}
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)
{
check_groups(ef);
- ecore_thread_max_set(ecore_thread_max_get() * 2);
+ 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);
- pending_threads++;
- t = ecore_time_get();
- data_write_header(ef);
- if (verbose)
- {
- printf("header: %3.5f\n", ecore_time_get() - t); t = ecore_time_get();
- }
- data_write_groups(ef, &collection_num);
- if (verbose)
- {
- printf("groups: %3.5f\n", ecore_time_get() - t); t = ecore_time_get();
- }
+ total_bytes += data_write_groups(ef, &collection_num);
data_write_scripts(ef);
- if (verbose)
- {
- printf("scripts: %3.5f\n", ecore_time_get() - t); t = ecore_time_get();
- }
data_write_lua_scripts(ef);
- if (verbose)
- {
- printf("lua scripts: %3.5f\n", ecore_time_get() - t); t = ecore_time_get();
- }
- 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);
- }
- if (verbose)
- {
- printf("source: %3.5f\n", 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);
- }
- if (verbose)
- {
- printf("fontmap: %3.5f\n", ecore_time_get() - t); t = ecore_time_get();
- }
- data_write_images(ef, &image_num);
- if (verbose)
- {
- printf("images: %3.5f\n", ecore_time_get() - t); t = ecore_time_get();
- }
- data_write_fonts(ef, &font_num);
- if (verbose)
- {
- printf("fonts: %3.5f\n", ecore_time_get() - t); t = ecore_time_get();
- }
- data_write_sounds(ef, &sound_num);
- if (verbose)
- {
- printf("sounds: %3.5f\n", ecore_time_get() - t); t = ecore_time_get();
- }
- pending_threads--;
- if (pending_threads > 0) ecore_main_loop_begin();
- if (verbose)
- {
- printf("THREADS: %3.5f\n", 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;
eet_close(ef);
if (verbose)
- 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);
+ {
+ 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);
+ }
}
void
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;
-#ifdef NEWPARTLOOKUP
- char buf[256];
-#endif
+ Part_Lookup *pl;
-#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))
return;
}
}
-#endif
if (!name[0]) return;
pl = mem_alloc(SZ(Part_Lookup));
- part_lookups = eina_list_prepend(part_lookups, pl);
+ part_lookups = eina_list_append(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
{
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
strncpy(cl->ptr, buf, n);
}
}
-
-void
-using_file(const char *filename)
-{
- FILE *f;
-
- if (!watchfile) return;
- f = fopen(watchfile, "a");
- if (!f) return ;
- fputs(filename, f);
- fputc('\n', f);
- fclose(f);
-}
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;
- New_Object_Handler *oh;
- New_Statement_Handler *sh;
+ int i;
+ int handled = 0;
- fill_object_statement_hashes();
id = stack_id();
- oh = eina_hash_find(_new_object_hash, id);
- if (oh)
+ for (i = 0; i < object_handler_num(); i++)
{
- if (oh->func) oh->func();
+ if (!strcmp(object_handlers[i].type, id))
+ {
+ handled = 1;
+ if (object_handlers[i].func)
+ {
+ object_handlers[i].func();
+ }
+ break;
+ }
}
- else
+ if (!handled)
{
- sh = eina_hash_find(_new_statement_hash, id);
- if (!sh)
- {
- 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);
- }
+ for (i = 0; i < statement_handler_num(); i++)
+ {
+ if (!strcmp(statement_handlers[i].type, id))
+ {
+ free(id);
+ return;
+ }
+ }
+ }
+ if (!handled)
+ {
+ 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);
}
free(id);
}
new_statement(void)
{
char *id;
- New_Statement_Handler *sh;
+ int i;
+ int handled = 0;
- fill_object_statement_hashes();
id = stack_id();
- sh = eina_hash_find(_new_statement_hash, id);
- if (sh)
+ for (i = 0; i < statement_handler_num(); i++)
{
- if (sh->func) sh->func();
+ if (!strcmp(statement_handlers[i].type, id))
+ {
+ handled = 1;
+ if (statement_handlers[i].func)
+ {
+ statement_handlers[i].func();
+ }
+ break;
+ }
}
- else
+ if (!handled)
{
- ERR("%s: Error. %s:%i unhandled keyword %s",
- progname, file_in, line - 1,
- (char *)eina_list_data_get(eina_list_last(stack)));
+ 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);
+ exit(-1);
}
free(id);
}
eina_prefix_lib_get(pfx));
if (ecore_file_exists(buf2))
{
- snprintf(buf, sizeof(buf), "%s -a %s %s -I%s %s -o %s",
- buf2, watchfile ? watchfile : "/dev/null", file_in, inc, def, tmpn);
+ snprintf(buf, sizeof(buf), "%s %s -I%s %s -o %s",
+ buf2, file_in, inc, def, tmpn);
ret = system(buf);
}
else
int
source_append(Eet_File *ef)
{
- return eet_data_write(ef, _srcfile_list_edd, "edje_sources", &srcfiles,
- compress_mode);
+ return eet_data_write(ef, _srcfile_list_edd, "edje_sources", &srcfiles, 1);
}
SrcFile_List *
Font_List fl;
fl.list = font_list;
- return eet_data_write(ef, _font_list_edd, "edje_source_fontmap", &fl,
- compress_mode);
+ return eet_data_write(ef, _font_list_edd, "edje_source_fontmap", &fl, 1);
}
Font_List *
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;
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:
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
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)
{
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;
}
+++ /dev/null
-#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_Lines *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->line.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;
-}
&& !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)
}
for (map = read_name_map(pfile, dir); map; map = map->map_next)
if (!strcmp(map->map_from, from))
- {
- using_file(map->map_to);
- return open(map->map_to, O_RDONLY | O_BINARY, 0666);
- }
+ return open(map->map_to, O_RDONLY | O_BINARY, 0666);
- using_file(filename);
return open(filename, O_RDONLY | O_BINARY, 0666);
}
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);
}
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;
*
* 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);
-}
/* 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)
void *xrealloc(void *old, unsigned size);
void *xcalloc(unsigned number, unsigned size);
-void using_file(const char *filename);
-
#ifdef __EMX__
#define PATH_SEPARATOR ';'
#endif
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 \
test.png \
Vera.ttf \
duck.wav \
- edje_example.c \
edje-basic.c \
edje-swallow.c \
edje-text.c \
These routines are used for Edje.
@mainpage Edje Library Documentation
-@version 1.2
+@version 1.1
@date 2003-2012
Please see the @ref authors page for contact details.
@author Davide Andreoli <dave@@gurumeditation.it>
@author Sebastian Dransfeld <sd@@tango.flipp.net>
@author Tom Hacohen <tom@@stosb.com>
-@author Aharon Hillel <a.hillel@@samsung.com>
+@author Aharon Hillel <a.hillel@@partner.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>
EDJE_PART_TYPE_TABLE = 9,
EDJE_PART_TYPE_EXTERNAL = 10,
EDJE_PART_TYPE_PROXY = 11,
- EDJE_PART_TYPE_SPACER = 12, /**< @since 1.3 */
- EDJE_PART_TYPE_LAST = 13
+ EDJE_PART_TYPE_LAST = 12
} Edje_Part_Type;
typedef enum _Edje_Text_Effect
*
* 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().
*
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 one of the Edje object @c SWALLOW
- * parts.
+ * @brief Swallows an object into the edje.
*
- * @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.
- *
- * 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.).
+ * @param obj A valid Evas_Object handle
+ * @param part The part name
+ * @param obj_swallow The object to swallow
*
- * 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.
+ * 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.).
*
* If an object has already been swallowed into this part, then it
- * 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".
+ * will first be unswallowed before the new object is swallowed.
*/
EAPI Eina_Bool edje_object_part_swallow (Evas_Object *obj, const char *part, Evas_Object *obj_swallow);
@EVIL_CFLAGS@ \
@EDJE_CFLAGS@ \
@ECORE_IMF_CFLAGS@ \
-@EIO_CFLAGS@ \
@EFL_EDJE_BUILD@ \
@REMIX_CFLAGS@ \
@SNDFILE_CFLAGS@
@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 \
file="$$f" ; \
fi ; \
echo "/* file: $$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; \
+ 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; \
done
@echo "edje_amalgamation.c generated"
libedje_la_SOURCES = $(base_sources)
endif
-libedje_la_LIBADD = @EDJE_LIBS@ @ECORE_IMF_LIBS@ @EIO_LIBS@ @EVIL_LIBS@ @REMIX_LIBS@ @SNDFILE_LIBS@ -lm
+libedje_la_LIBADD = @EDJE_LIBS@ @ECORE_IMF_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
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);
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)
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)
{
}
Edje_File *
-_edje_cache_file_coll_open(const char *file, const char *coll, int *error_ret, Edje_Part_Collection **edc_ret, Edje *ed)
+_edje_cache_file_coll_open(const char *file, const char *coll, int *error_ret, Edje_Part_Collection **edc_ret)
{
Edje_File *edf;
Eina_List *l, *hist;
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;
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;
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);
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);
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,
if (*maxh < *minh) *maxh = *minh;
}
}
- evas_object_textblock_valign_set(ep->object, TO_DOUBLE(chosen_desc->text.align.y));
+ evas_object_textblock_valign_set(ep->object, chosen_desc->text.align.y);
}
}
else if (ep->part->type == EDJE_PART_TYPE_PROXY)
_edje_part_recalc_single_fill(ep, &((Edje_Part_Description_Proxy *)desc)->proxy.fill, params);
- if (ep->part->type != EDJE_PART_TYPE_SPACER)
- {
- /* colors */
- if ((desc->color_class) && (*desc->color_class))
- cc = _edje_color_class_find(ed, desc->color_class);
+ /* 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;
- }
+ 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 */
break;
}
- case EDJE_PART_TYPE_SPACER:
case EDJE_PART_TYPE_RECTANGLE:
case EDJE_PART_TYPE_BOX:
case EDJE_PART_TYPE_TABLE:
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,
return;
}
- pos = ep->description_pos;
-
if (ep->part->type == EDJE_PART_TYPE_PROXY)
{
Edje_Real_Part *pp;
#endif
}
- pos2 = pos;
- if (pos2 < ZERO) pos2 = ZERO;
- else if (pos2 > FROM_INT(1)) pos2 = FROM_INT(1);
+ pos = ep->description_pos;
+ 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;
/* 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. */
/* 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)
mo = ep->swallowed_object;
}
else mo = ep->object;
- if (chosen_desc->map.on && ep->part->type != EDJE_PART_TYPE_SPACER)
+ if (chosen_desc->map.on)
{
- static Evas_Map *map = NULL;
+ Evas_Map *map;
ed->have_mapped_part = 1;
// create map and populate with part geometry
- if (!map) map = evas_map_new(4);
+ map = evas_map_new(4);
evas_map_util_points_populate_from_object(map, ep->object);
if (ep->part->type == EDJE_PART_TYPE_IMAGE)
{
evas_object_map_set(mo, map);
evas_object_map_enable_set(mo, 1);
+ evas_map_free(map);
}
else
{
ep->invalidate = 0;
}
#endif
+
}
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;
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;
EMP(BOX, box);
EMP(TABLE, table);
EMP(EXTERNAL, external);
-EMP(SPACER, spacer);
EMP(part, part);
#define FREED(eed) \
{ EDJE_PART_TYPE_BOX, "box" },
{ EDJE_PART_TYPE_TABLE, "table" },
{ EDJE_PART_TYPE_EXTERNAL, "external" },
- { EDJE_PART_TYPE_PROXY, "proxy" },
- { EDJE_PART_TYPE_SPACER, "spacer" }
+ { EDJE_PART_TYPE_PROXY, "proxy" }
};
static const char *
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);
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);
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);
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 =
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);
_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);
//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), 8);
+ Ce->mp.Tp = eina_mempool_add("chained_mempool", #Tp, NULL, sizeof (Sz), 10);
EDIT_EMN(RECTANGLE, Edje_Part_Description_Common, de);
EDIT_EMN(TEXT, Edje_Part_Description_Text, de);
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);
}
else if (ep->type == EDJE_PART_TYPE_TEXTBLOCK)
rp->object = evas_object_textblock_add(ed->base.evas);
- else if (ep->type != EDJE_PART_TYPE_SPACER)
+ else
ERR("wrong part type %i!", ep->type);
if (rp->object)
{
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++;
#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", "SPACER"};
+static const char *types[] = {"NONE", "RECT", "TEXT", "IMAGE", "SWALLOW", "TEXTBLOCK", "GRADIENT", "GROUP", "BOX", "TABLE", "EXTERNAL"};
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"};
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;
#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;
#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;
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;
}
}
}
- else
- {
- eina_strbuf_append(buf, preedit_string);
- }
if ((rp->part->entry_mode == EDJE_ENTRY_EDIT_MODE_PASSWORD) &&
_edje_password_show_last)
{
#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_object_collect(Edje *ed);
-
-static int _sort_defined_boxes(const void *a, const void *b);
+static Eina_List *_edje_swallows_collect(Edje *ed);
/************************** API Routines **************************/
int error_ret = 0;
if ((!file) || (!*file)) return NULL;
- edf = _edje_cache_file_coll_open(file, NULL, &error_ret, NULL, NULL);
+ edf = _edje_cache_file_coll_open(file, NULL, &error_ret, NULL);
if (edf)
{
Eina_Iterator *i;
if ((!file) || (!*file) || (!glob))
return EINA_FALSE;
- edf = _edje_cache_file_coll_open(file, NULL, &error_ret, NULL, NULL);
+ edf = _edje_cache_file_coll_open(file, NULL, &error_ret, NULL);
if (!edf)
return EINA_FALSE;
if (key)
{
- edf = _edje_cache_file_coll_open(file, NULL, &error_ret, NULL, NULL);
+ edf = _edje_cache_file_coll_open(file, NULL, &error_ret, NULL);
if (edf)
{
str = (char*) edje_string_get(eina_hash_find(edf->data, key));
Eina_List *textblocks = NULL;
Eina_List *sources = NULL;
Eina_List *externals = NULL;
- Eina_List *collect = NULL;
+ Eina_List *old_swallows;
unsigned int n;
Eina_List *parts = NULL;
int group_path_started = 0;
if (!file) file = "";
if (!group) group = "";
if (((ed->path) && (!strcmp(file, ed->path))) &&
- (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;
- }
+ (ed->group) && (!strcmp(group, ed->group)))
+ return 1;
tev = evas_object_evas_get(obj);
evas_event_freeze(tev);
-
- collect = _edje_object_collect(ed);
+ old_swallows = _edje_swallows_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);
_edje_part_description_find(ed, rp, "default", 0.0);
rp->chosen_description = rp->param1.description;
if (!rp->param1.description)
- ERR("no default part description for '%s'!",
- rp->part->name);
+ ERR("no default part description!");
switch (ep->type)
{
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;
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 &&
- rp->clip_to->object &&
- rp->object)
+ if (rp->clip_to)
{
evas_object_pass_events_set(rp->clip_to->object, 1);
evas_object_pointer_mode_set(rp->clip_to->object, EVAS_OBJECT_POINTER_MODE_NOGRAB);
}
/* reswallow any swallows that existed before setting the file */
- if (collect)
- {
- Edje_User_Defined *eud;
- Eina_List *boxes = NULL;
+ if (old_swallows)
+ {
+ while (old_swallows)
+ {
+ const char *name;
+ Evas_Object *swallow;
- 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);
- }
+ name = 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);
- }
- }
+ swallow = eina_list_data_get(old_swallows);
+ old_swallows = eina_list_remove_list(old_swallows, old_swallows);
- 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_object_part_swallow(obj, name, swallow);
+ eina_stringshare_del(name);
+ }
+ }
_edje_recalc(ed);
_edje_thaw(ed);
if (!_edje_edd_edje_file) return;
ed->file = _edje_cache_file_coll_open(ed->path, ed->group,
&(ed->load_error),
- &(ed->collection),
- ed);
+ &(ed->collection));
if (!ed->collection)
{
}
}
-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_object_collect(Edje *ed)
+_edje_swallows_collect(Edje *ed)
{
- Edje_User_Defined *eud;
- Eina_List *collect;
- Eina_List *l;
-
- collect = ed->user_defined;
- ed->user_defined = NULL;
+ Eina_List *swallows = NULL;
+ unsigned int i;
- EINA_LIST_FOREACH(collect, l, eud)
+ if (!ed->file || !ed->table_parts) return NULL;
+ for (i = 0; i < ed->table_parts_size; i++)
{
- 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;
- }
- }
+ Edje_Real_Part *rp;
- return collect;
+ 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);
+ }
+ return swallows;
}
void
_edje_file_del(Edje *ed)
{
- Edje_User_Defined *eud;
- Evas *tev = NULL;
+ Evas *tev = evas_object_evas_get(ed->obj);
- if (ed->obj) tev = evas_object_evas_get(ed->obj);
-
- if (tev) evas_event_freeze(tev);
+ evas_event_freeze(tev);
if (ed->freeze_calc)
{
_edje_freeze_calc_list = eina_list_remove(_edje_freeze_calc_list, ed);
if (!((ed->file) && (ed->collection)))
{
- if (tev)
- {
- evas_event_thaw(tev);
- evas_event_thaw_eval(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;
}
if (ed->file)
{
-#ifdef HAVE_EIO
- ed->file->edjes = eina_list_remove(ed->file->edjes, ed);
-#endif
- _edje_cache_file_unref(ed->file);
+ _edje_cache_file_unref(ed->file);
ed->file = NULL;
}
if (ed->actions)
free(pp);
}
}
-
if (ed->L) _edje_lua2_script_shutdown(ed);
- while (ed->subobjs) _edje_subobj_unregister(ed, ed->subobjs->data);
+ while (ed->subobjs) evas_object_del(ed->subobjs->data);
if (ed->table_parts) free(ed->table_parts);
ed->table_parts = NULL;
ed->table_parts_size = 0;
ed->table_programs = NULL;
ed->table_programs_size = 0;
ed->focused_part = NULL;
- if (tev)
- {
- evas_event_thaw(tev);
- evas_event_thaw_eval(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); \
}
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);
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));
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;
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, 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_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_aspect_set(obj, it->aspect.mode, it->aspect.w, it->aspect.h);
evas_object_resize(obj, w, h);
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 [] =
// map api here
{"map", _elua_obj_map},
{"map_enable", _elua_obj_map_enable},
+ {"map_source", _elua_obj_map_source},
{NULL, NULL} // end
};
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;
+}
+
//-------------
//-------------
/**
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();
_edje_real_part_mp = eina_mempool_add("chained_mempool",
"Edje_Real_Part", NULL,
- sizeof (Edje_Real_Part), 32);
+ sizeof (Edje_Real_Part), 128);
if (!_edje_real_part_mp)
{
ERR("Mempool for Edje_Real_Part cannot be allocated.");
- goto shutdown_all;
+ goto shutdown_eet;
}
_edje_real_part_state_mp = eina_mempool_add("chained_mempool",
"Edje_Real_Part_State", NULL,
- sizeof (Edje_Real_Part_State), 32);
+ sizeof (Edje_Real_Part_State), 256);
if (!_edje_real_part_state_mp)
{
ERR("Mempool for Edje_Real_Part_State cannot be allocated.");
- goto shutdown_all;
+ goto shutdown_eet;
}
return _edje_init_count;
- shutdown_all:
+ shutdown_eet:
eina_mempool_del(_edje_real_part_state_mp);
eina_mempool_del(_edje_real_part_mp);
_edje_real_part_state_mp = NULL;
_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();
_edje_text_class_hash_free();
_edje_edd_shutdown();
-#ifdef HAVE_EIO
- eio_shutdown();
-#endif
eet_shutdown();
embryo_shutdown();
ecore_shutdown();
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;
#define BUF_LEN 64
#define SND_PROCESS_LENGTH 2048
-#ifdef HAVE_LIBREMIX
+#ifdef ENABLE_MULTISENSE
static Ecore_Thread *player_thread = NULL;
static int command_pipe[2];
static Eina_Bool pipe_initialized = EINA_FALSE;
Edje_Tone_Action tone;
} type;
};
-
-#ifdef HAVE_LIBREMIX
+#ifdef ENABLE_MULTISENSE
static Multisense_Data *
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
msdata->msenv->remixenv = remix_init();
-
- multisense_factory_init =
+#endif
+ multisense_factory_init =
eina_module_symbol_get(m, "multisense_factory_init");
if (multisense_factory_init) multisense_factory_init(msdata->msenv);
-
- msdata->multisense_sound_player_get =
+#ifdef HAVE_LIBREMIX
+ msdata->multisense_sound_player_get =
eina_module_symbol_get(m, "multisense_sound_player_get");
if (!msdata->multisense_sound_player_get) goto err;
msdata->player, msdata->player_layer,
REMIX_SAMPLES(0),
REMIX_SAMPLES(REMIX_COUNT_INFINITE));
+#endif
return msdata;
err:
if (msdata)
{
+#ifdef HAVE_LIBREMIX
if (msdata->deck) remix_destroy(msdata->msenv->remixenv, msdata->deck);
if (msdata->msenv->remixenv) remix_purge(msdata->msenv->remixenv);
+#endif
if (msdata->msenv) free(msdata->msenv);
free(msdata);
}
}
#endif
-#ifdef HAVE_LIBREMIX
+#if defined(ENABLE_MULTISENSE) && defined(HAVE_LIBREMIX)
static RemixBase *
-eet_sound_reader_get(Edje_Multisense_Env *msenv, const char *path, const char *sound_id, const double speed)
+eet_sound_reader_get(Edje_Multisense_Env *msenv, const char *path,
+ const char *sound_id, const double speed)
{
RemixPlugin *sf_plugin = NULL;
RemixBase * eet_snd_reader = NULL;
static RemixBase *
-edje_remix_sample_create(Multisense_Data *msdata, Edje*ed, Edje_Sample_Action *action)
+edje_remix_sample_create(Multisense_Data *msdata, Edje *ed, Edje_Sample_Action *action)
{
RemixBase *remix_snd = NULL;
Edje_Sound_Sample *sample;
}
static RemixBase *
-edje_remix_tone_create(Multisense_Data *msdata, Edje*ed, Edje_Tone_Action *action)
+edje_remix_tone_create(Multisense_Data *msdata, Edje *ed, Edje_Tone_Action *action)
{
Edje_Sound_Tone *tone;
RemixSquareTone *square = NULL;
RemixBase *sound;
if (read(command_pipe[0], &command, sizeof(command)) <= 0) return;
+
switch (command.action)
{
case EDJE_PLAY_SAMPLE:
}
#endif
-#ifdef HAVE_LIBREMIX
+#ifdef ENABLE_MULTISENSE
// msdata outside of thread due to thread issues in dlsym etc.
static Multisense_Data *msdata = NULL;
{
// cleanup msdata outside of thread due to thread issues in dlsym etc.
if (!msdata) return;
+#ifdef HAVE_LIBREMIX
//cleanup Remix stuffs
remix_destroy(msdata->msenv->remixenv, msdata->player);
remix_destroy(msdata->msenv->remixenv, msdata->deck);
remix_purge(msdata->msenv->remixenv);
-
+#endif
free(msdata->msenv);
free(msdata);
msdata = NULL;
_player_job(void *data __UNUSED__, Ecore_Thread *th)
{
fd_set wait_fds;
+#ifdef HAVE_LIBREMIX
RemixBase *sound;
RemixCount process_len;
-// disable and move outside of thread due to dlsym etc. thread issues
+#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);
FD_ZERO(&wait_fds);
FD_SET(command_pipe[0], &wait_fds);
-
+#ifdef HAVE_LIBREMIX
while (!ecore_thread_check(th))
{
if (!msdata->remaining)
{
remix_destroy(msdata->msenv->remixenv, sound);
}
-
+#endif
close(command_pipe[0]);
close(command_pipe[1]);
}
-#endif
-#ifdef HAVE_LIBREMIX
static void
_player_cancel(void *data __UNUSED__, Ecore_Thread *th __UNUSED__)
{
_msdata_free();
player_thread = NULL;
}
-#endif
-#ifdef HAVE_LIBREMIX
static void
_player_end(void *data __UNUSED__, Ecore_Thread *th __UNUSED__)
{
_edje_multisense_internal_sound_sample_play(Edje *ed, const char *sample_name, const double speed)
{
ssize_t size = 0;
-#ifdef ENABLE_MULTISENSE
+#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;
_edje_multisense_internal_sound_tone_play(Edje *ed, const char *tone_name, const double duration)
{
ssize_t size = 0;
-#ifdef ENABLE_MULTISENSE
+#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;
// 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);
#endif
#endif
#include <Embryo.h>
-#ifdef HAVE_EIO
-# include <Eio.h>
-#endif
-
#include "Edje.h"
EAPI extern int _edje_default_log_dom ;
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;
TYPE GROUP; \
TYPE BOX; \
TYPE TABLE; \
- TYPE SPACER; \
TYPE EXTERNAL;
struct _Edje_Part_Collection_Directory_Entry
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;
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);
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);
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 *ed);
+Edje_File *_edje_cache_file_coll_open(const char *file, const char *coll, int *error_ret, Edje_Part_Collection **edc_ret);
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);
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);
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
if (ed->just_added_callbacks)
_edje_callbacks_patterns_clean(ed);
- ed->walking_callbacks++;
+ ed->walking_callbacks = 1;
if (ed->callbacks)
{
{
escb->func(escb->data, ed->obj, sig, src);
if (_edje_block_break(ed))
- break;
+ goto break_prog;
}
}
}
break_prog:
- ed->walking_callbacks--;
- if (!ed->walking_callbacks &&
- ((ed->delete_callbacks) || (ed->just_added_callbacks)))
+ ed->walking_callbacks = 0;
+ if ((ed->delete_callbacks) || (ed->just_added_callbacks))
{
ed->delete_callbacks = 0;
ed->just_added_callbacks = 0;
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;
part_get_geometry(ep, &tw, &th);
/* Handle alignment */
{
- FLOAT_T align_x;
- if (params->type.text.align.x < FROM_INT(0))
+ double align_x;
+ if (params->type.text.align.x < 0.0)
{
if (evas_object_text_direction_get(ep->object) ==
EVAS_BIDI_DIRECTION_RTL)
{
- align_x = FROM_INT(1);
+ align_x = 1.0;
}
else
{
- align_x = FROM_INT(0);
+ align_x = 0.0;
}
}
else
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);
- _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(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)
{
#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?
{
#ifdef FASTFREEZE
_edje_freeze_val--;
+ INF("fr -- ->%i", _edje_freeze_val);
if ((_edje_freeze_val <= 0) && (_edje_freeze_calc_count > 0))
{
Edje *ed;
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;
if (!rp) return EINA_FALSE;
if ((rp->part->type != EDJE_PART_TYPE_TEXT) &&
(rp->part->type != EDJE_PART_TYPE_TEXTBLOCK)) return EINA_FALSE;
- r = _edje_object_part_text_raw_set(obj, rp, part, text);
- _edje_user_define_string(ed, part, rp->text.text);
- return r;
+ return _edje_object_part_text_raw_set(obj, rp, part, text);
}
/**
{
Edje *ed;
Edje_Real_Part *rp;
- Eina_Bool ret;
ed = _edje_fetch(obj);
if ((!ed) || (!part)) return EINA_FALSE;
Eina_Strbuf *sbuf;
char *esc_start = NULL, *esc_end = NULL;
char *s, *p;
+ Eina_Bool ret;
sbuf = eina_strbuf_new();
p = (char *)text;
}
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;
- ret = _edje_object_part_text_raw_set(obj, rp, part, text);
- _edje_user_define_string(ed, part, rp->text.text);
- return ret;
+ return _edje_object_part_text_raw_set(obj, rp, part, text);
}
ret = _edje_object_part_text_raw_set(obj, rp, part, text);
free(text);
}
- _edje_user_define_string(ed, part, rp->text.text);
return ret;
}
{
Edje *ed;
Edje_Real_Part *rp;
- Edje_User_Defined *eud = NULL;
- Eina_List *l;
ed = _edje_fetch(obj);
if ((!ed) || (!part)) return EINA_FALSE;
// XXX: by Sachiel, January 21th 2009, 19:30 UTC
_edje_recalc_do(ed);
- EINA_LIST_FOREACH(ed->user_defined, l, eud)
- if (eud->type == EDJE_USER_SWALLOW && !strcmp(part, eud->part))
- {
- ed->user_defined = eina_list_remove_list(ed->user_defined, l);
- if (!obj_swallow)
- {
- _edje_user_definition_free(eud);
- l = NULL;
- eud = NULL;
- break;
- }
- break;
- }
-
rp = evas_object_data_get(obj_swallow, "\377 edje.swallowing_part");
if (rp)
{
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;
}
}
EAPI void
-edje_object_part_unswallow(Evas_Object *obj, Evas_Object *obj_swallow)
+edje_object_part_unswallow(Evas_Object *obj __UNUSED__, Evas_Object *obj_swallow)
{
Edje_Real_Part *rp;
ERR("cannot unswallow part %s: not swallow type!", rp->part->name);
return;
}
-
if (rp->swallowed_object == obj_swallow)
{
- Edje_User_Defined *eud;
- Eina_List *l;
+ 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);
- 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);
- break;
- }
- }
- }
-
- _edje_real_part_swallow_clear(rp);
rp->swallowed_object = NULL;
rp->swallow_params.min.w = 0;
rp->swallow_params.min.h = 0;
{
Edje *ed;
Edje_Real_Part *rp;
- Edje_User_Defined *eud;
- Eina_List *l;
ed = _edje_fetch(obj);
if ((!ed) || (!part)) return EINA_FALSE;
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);
{
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;
{
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;
{
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;
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;
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),
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;
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)));
{
Edje *ed;
Edje_Real_Part *rp;
- Eina_Bool r;
ed = _edje_fetch(obj);
if ((!ed) || (!part) || (!child)) return EINA_FALSE;
if (!rp) return EINA_FALSE;
if (rp->part->type != EDJE_PART_TYPE_BOX) return EINA_FALSE;
- 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;
+ return _edje_real_part_box_append(rp, child);
}
EAPI Eina_Bool
{
Edje *ed;
Edje_Real_Part *rp;
- Eina_Bool r;
ed = _edje_fetch(obj);
if ((!ed) || (!part)) return EINA_FALSE;
if (!rp) return EINA_FALSE;
if (rp->part->type != EDJE_PART_TYPE_BOX) return EINA_FALSE;
- 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;
+ return _edje_real_part_box_prepend(rp, child);
}
EAPI Eina_Bool
{
Edje *ed;
Edje_Real_Part *rp;
- Eina_Bool r;
ed = _edje_fetch(obj);
if ((!ed) || (!part)) return EINA_FALSE;
if (!rp) return EINA_FALSE;
if (rp->part->type != EDJE_PART_TYPE_BOX) return EINA_FALSE;
- 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;
+ return _edje_real_part_box_insert_before(rp, child, reference);
}
EAPI Eina_Bool
{
Edje *ed;
Edje_Real_Part *rp;
- Eina_Bool r;
ed = _edje_fetch(obj);
if ((!ed) || (!part)) return EINA_FALSE;
if (!rp) return EINA_FALSE;
if (rp->part->type != EDJE_PART_TYPE_BOX) return EINA_FALSE;
- 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;
+ return _edje_real_part_box_insert_at(rp, child, pos);
}
EAPI Evas_Object *
{
Edje *ed;
Edje_Real_Part *rp;
- Evas_Object *r;
ed = _edje_fetch(obj);
if ((!ed) || (!part)) return NULL;
if (!rp) return NULL;
if (rp->part->type != EDJE_PART_TYPE_BOX) return NULL;
- 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;
+ return _edje_real_part_box_remove(rp, child);
}
EAPI Evas_Object *
{
Edje *ed;
Edje_Real_Part *rp;
- Evas_Object *r;
ed = _edje_fetch(obj);
if ((!ed) || (!part)) return NULL;
if (!rp) return NULL;
if (rp->part->type != EDJE_PART_TYPE_BOX) return NULL;
- 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;
+ return _edje_real_part_box_remove_at(rp, pos);
}
EAPI Eina_Bool
{
Edje *ed;
Edje_Real_Part *rp;
- Eina_Bool r;
ed = _edje_fetch(obj);
if ((!ed) || (!part)) return EINA_FALSE;
if (!rp) return EINA_FALSE;
if (rp->part->type != EDJE_PART_TYPE_BOX) return EINA_FALSE;
- r = _edje_real_part_box_remove_all(rp, clear);
- if (r)
- {
- Edje_User_Defined *eud;
- Eina_List *ll, *l;
+ return _edje_real_part_box_remove_all(rp, clear);
- 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;
}
static void
}
static void
-_edje_table_child_del_cb(void *data, Evas *e __UNUSED__, Evas_Object *child, void *einfo __UNUSED__)
+_edje_table_child_del_cb(void *data, Evas *e __UNUSED__, Evas_Object *child __UNUSED__, 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
{
Edje *ed;
Edje_Real_Part *rp;
- Edje_User_Defined *eud;
- Eina_Bool r;
ed = _edje_fetch(obj);
if ((!ed) || (!part)) return EINA_FALSE;
if (!rp) return EINA_FALSE;
if (rp->part->type != EDJE_PART_TYPE_TABLE) return EINA_FALSE;
- 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;
+ return _edje_real_part_table_pack(rp, child_obj, col, row, colspan, rowspan);
}
EAPI Eina_Bool
{
Edje *ed;
Edje_Real_Part *rp;
- Eina_Bool r;
ed = _edje_fetch(obj);
if ((!ed) || (!part)) return EINA_FALSE;
if (!rp) return EINA_FALSE;
if (rp->part->type != EDJE_PART_TYPE_TABLE) return EINA_FALSE;
- 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;
+ return _edje_real_part_table_unpack(rp, child_obj);
}
EAPI Eina_Bool
}
void
-_edje_object_part_swallow_free_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
+_edje_object_part_swallow_free_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__)
{
- 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;
- }
+ Evas_Object *edje_obj;
+ edje_obj = data;
+ edje_object_part_unswallow(edje_obj, obj);
return;
}
else evas_object_clip_set(rp->swallowed_object, rp->edje->base.clipper);
evas_object_stack_above(rp->swallowed_object, rp->object);
evas_object_event_callback_add(rp->swallowed_object,
- EVAS_CALLBACK_FREE,
+ EVAS_CALLBACK_DEL,
_edje_object_part_swallow_free_cb,
- rp);
+ rp->edje->obj);
evas_object_event_callback_add(rp->swallowed_object,
EVAS_CALLBACK_CHANGED_SIZE_HINTS,
_edje_object_part_swallow_changed_hints_cb,
evas_object_event_callback_del_full(rp->swallowed_object,
EVAS_CALLBACK_FREE,
_edje_object_part_swallow_free_cb,
- rp);
+ rp->edje->obj);
evas_object_event_callback_del_full(rp->swallowed_object,
EVAS_CALLBACK_CHANGED_SIZE_HINTS,
_edje_object_part_swallow_changed_hints_cb,
_cb_subobj_del(void *data, __UNUSED__ Evas *e, Evas_Object *obj, __UNUSED__ void *event_info)
{
Edje *ed = data;
- _edje_subobj_unregister(ed, obj);
+ ed->subobjs = eina_list_remove(ed->subobjs, obj);
+ evas_object_event_callback_del_full(obj, EVAS_CALLBACK_DEL,
+ _cb_subobj_del, ed);
}
void
_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 :*/
AM_CPPFLAGS = \
-I. \
@EDJE_CFLAGS@ \
-@EIO_CFLAGS@ \
@REMIX_CFLAGS@ \
@ALSA_CFLAGS@
AM_CPPFLAGS = \
-I. \
@EDJE_CFLAGS@ \
-@EIO_CFLAGS@ \
@REMIX_CFLAGS@
pkgdir = $(REMIX_PLUGIN_DIR)
-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)