-# get rid of that stupid cache mechanism
-rm -f config.cache
-
-AC_INIT([edje], [0.9.93.063], [enlightenment-devel@lists.sourceforge.net])
-release="ver-pre-svn-05"
+##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
+##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
+m4_define([v_maj], [0])
+m4_define([v_min], [9])
+m4_define([v_mic], [9])
+m4_define([v_rev], m4_esyscmd([(svnversion . | grep -v exported || 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])
+##-- When doing snapshots - change soname. remove dnl on below line
+m4_define([relname], [ver-pre-svn-06])
+m4_define([v_rel], [-release relname])
+##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
+m4_ifdef([v_rev], [m4_define([v_ver], [v_maj.v_min.v_mic.v_rev])],
+[m4_define([v_ver], [v_maj.v_min.v_mic])])
+m4_define([lt_rev], m4_eval(v_maj + v_min))
+m4_define([lt_cur], v_mic)
+m4_define([lt_age], v_min)
+##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
+##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
+
+AC_INIT([edje], [v_ver], [enlightenment-devel@lists.sourceforge.net])
AC_PREREQ([2.52])
AC_CONFIG_SRCDIR([configure.ac])
AC_CONFIG_MACRO_DIR([m4])
define([AC_LIBTOOL_LANG_F77_CONFIG], [:])dnl
AC_PROG_LIBTOOL
-VMAJ=`echo $PACKAGE_VERSION | awk -F. '{printf("%s", $1);}'`
-VMIN=`echo $PACKAGE_VERSION | awk -F. '{printf("%s", $2);}'`
-VMIC=`echo $PACKAGE_VERSION | awk -F. '{printf("%s", $3);}'`
-SNAP=`echo $PACKAGE_VERSION | awk -F. '{printf("%s", $4);}'`
-version_info=`expr $VMAJ + $VMIN`":$VMIC:$VMIN"
+##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
+##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
+m4_ifdef([v_rev], , [m4_define([v_rev], [0])])
+m4_ifdef([v_rel], , [m4_define([v_rel], [])])
+AC_DEFINE_UNQUOTED(VMAJ, [v_maj], [Major version])
+AC_DEFINE_UNQUOTED(VMIN, [v_min], [Minor version])
+AC_DEFINE_UNQUOTED(VMIC, [v_mic], [Micro version])
+AC_DEFINE_UNQUOTED(VREV, [v_rev], [Revison])
+version_info="lt_rev:lt_cur:lt_age"
+release_info="v_rel"
AC_SUBST(version_info)
-
-case "$host_os" in
- mingw32ce* | cegcc*)
- ;;
- *)
- release_info="-release $release"
- ;;
-esac
AC_SUBST(release_info)
+##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
+##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
AC_DEFINE_UNQUOTED([SHARED_LIB_SUFFIX], ["$shrext_cmds"], [Suffix for shared objects])
-Revision 48959
-Last Changed Rev 48676
+Revision 49550
+Last Changed Rev 49543
void data_write(void);
void data_queue_part_lookup(Edje_Part_Collection *pc, char *name, int *dest);
void data_queue_program_lookup(Edje_Part_Collection *pc, char *name, int *dest);
-void data_queue_image_lookup(char *name, int *dest);
+void data_queue_image_lookup(char *name, int *dest, Eina_Bool *set);
void data_queue_part_slave_lookup(int *master, int *slave);
void data_queue_image_slave_lookup(int *master, int *slave);
void data_queue_spectrum_lookup(char *name, int *dest);
static void st_externals_external(void);
static void st_images_image(void);
+static void ob_images_set(void);
+static void st_images_set_name(void);
+static void ob_images_set_image(void);
+static void st_images_set_image_image(void);
+static void st_images_set_image_size(void);
static void st_fonts_font(void);
{
{"externals.external", st_externals_external},
{"images.image", st_images_image},
+ {"images.set.name", st_images_set_name},
+ {"images.set.image.image", st_images_set_image_image},
+ {"images.set.image.size", st_images_set_image_size},
{"fonts.font", st_fonts_font},
{"data.item", st_data_item},
{"data.file", st_data_file},
{"spectra.spectrum.color", st_spectrum_color},
{"collections.externals.external", st_externals_external}, /* dup */
{"collections.image", st_images_image}, /* dup */
+ {"collections.set.name", st_images_set_name}, /* dup */
+ {"collections.set.image.image", st_images_set_image_image}, /* dup */
+ {"collections.set.image.size", st_images_set_image_size}, /* dup */
{"collections.images.image", st_images_image}, /* dup */
+ {"collections.images.set.name", st_images_set_name}, /* dup */
+ {"collections.images.set.image.image", st_images_set_image_image}, /* dup */
+ {"collections.images.set.image.size", st_images_set_image_size}, /* dup */
{"collections.font", st_fonts_font}, /* dup */
{"collections.fonts.font", st_fonts_font}, /* dup */
{"collections.styles.style.name", st_styles_style_name}, /* dup */
{"collections.group.data.item", st_collections_group_data_item},
{"collections.group.externals.external", st_externals_external}, /* dup */
{"collections.group.image", st_images_image}, /* dup */
+ {"collections.group.set.name", st_images_set_name},
+ {"collections.group.set.image.image", st_images_set_image_image},
+ {"collections.group.set.image.size", st_images_set_image_size},
{"collections.group.images.image", st_images_image}, /* dup */
+ {"collections.group.images.set.name", st_images_set_name},
+ {"collections.group.images.set.image.image", st_images_set_image_image},
+ {"collections.group.images.set.image.size", st_images_set_image_size},
{"collections.group.font", st_fonts_font}, /* dup */
{"collections.group.fonts.font", st_fonts_font}, /* dup */
{"collections.group.styles.style.name", st_styles_style_name}, /* dup */
{"collections.group.color_classes.color_class.color2", st_color_class_color2}, /* dup */
{"collections.group.color_classes.color_class.color3", st_color_class_color3}, /* dup */
{"collections.group.parts.image", st_images_image}, /* dup */
+ {"collections.group.parts.set.name", st_images_set_name},
+ {"collections.group.parts.set.image.image", st_images_set_image_image},
+ {"collections.group.parts.set.image.size", st_images_set_image_size},
{"collections.group.parts.images.image", st_images_image}, /* dup */
+ {"collections.group.parts.images.set.name", st_images_set_name},
+ {"collections.group.parts.images.set.image.image", st_images_set_image_image},
+ {"collections.group.parts.images.set.image.size", st_images_set_image_size},
{"collections.group.parts.font", st_fonts_font}, /* dup */
{"collections.group.parts.fonts.font", st_fonts_font}, /* dup */
{"collections.group.parts.styles.style.name", st_styles_style_name}, /* dup */
{"collections.group.parts.part.select_mode", st_collections_group_parts_part_select_mode},
{"collections.group.parts.part.multiline", st_collections_group_parts_part_multiline},
{"collections.group.parts.part.image", st_images_image}, /* dup */
+ {"collections.group.parts.part.set.name", st_images_set_name},
+ {"collections.group.parts.part.set.image.image", st_images_set_image_image},
+ {"collections.group.parts.part.set.image.size", st_images_set_image_size},
{"collections.group.parts.part.images.image", st_images_image}, /* dup */
+ {"collections.group.parts.part.images.set.name", st_images_set_name},
+ {"collections.group.parts.part.images.set.image.image", st_images_set_image_image},
+ {"collections.group.parts.part.images.set.image.size", st_images_set_image_size},
{"collections.group.parts.part.font", st_fonts_font}, /* dup */
{"collections.group.parts.part.fonts.font", st_fonts_font}, /* dup */
{"collections.group.parts.part.styles.style.name", st_styles_style_name}, /* dup */
{"collections.group.parts.part.description.image.normal", st_collections_group_parts_part_description_image_normal},
{"collections.group.parts.part.description.image.tween", st_collections_group_parts_part_description_image_tween},
{"collections.group.parts.part.description.image.image", st_images_image}, /* dup */
+ {"collections.group.parts.part.description.image.set.name", st_images_set_name},
+ {"collections.group.parts.part.description.image.set.image.image", st_images_set_image_image},
+ {"collections.group.parts.part.description.image.set.image.size", st_images_set_image_size},
{"collections.group.parts.part.description.image.images.image", st_images_image}, /* dup */
+ {"collections.group.parts.part.description.image.images.set.name", st_images_set_name},
+ {"collections.group.parts.part.description.image.images.set.image.image", st_images_set_image_image},
+ {"collections.group.parts.part.description.image.images.set.image.size", st_images_set_image_size},
{"collections.group.parts.part.description.image.border", st_collections_group_parts_part_description_image_border},
{"collections.group.parts.part.description.image.middle", st_collections_group_parts_part_description_image_middle},
{"collections.group.parts.part.description.image.border_scale", st_collections_group_parts_part_description_image_border_scale},
{"collections.group.parts.part.description.params.bool", st_collections_group_parts_part_description_params_bool},
{"collections.group.parts.part.description.params.choice", st_collections_group_parts_part_description_params_choice},
{"collections.group.parts.part.description.images.image", st_images_image}, /* dup */
+ {"collections.group.parts.part.description.images.set.name", st_images_set_name},
+ {"collections.group.parts.part.description.images.set.image.image", st_images_set_image_image},
+ {"collections.group.parts.part.description.images.set.image.size", st_images_set_image_size},
{"collections.group.parts.part.description.font", st_fonts_font}, /* dup */
{"collections.group.parts.part.description.fonts.font", st_fonts_font}, /* dup */
{"collections.group.parts.part.description.styles.style.name", st_styles_style_name}, /* dup */
{"collections.group.parts.part.description.color_classes.color_class.color2", st_color_class_color2}, /* dup */
{"collections.group.parts.part.description.color_classes.color_class.color3", st_color_class_color3}, /* dup */
{"collections.group.parts.part.description.programs.image", st_images_image}, /* dup */
+ {"collections.group.parts.part.description.programs.set.name", st_images_set_name},
+ {"collections.group.parts.part.description.programs.set.image.image", st_images_set_image_image},
+ {"collections.group.parts.part.description.programs.set.image.size", st_images_set_image_size},
{"collections.group.parts.part.description.programs.images.image", st_images_image}, /* dup */
+ {"collections.group.parts.part.description.programs.images.set.name", st_images_set_name},
+ {"collections.group.parts.part.description.programs.images.set.image.image", st_images_set_image_image},
+ {"collections.group.parts.part.description.programs.images.set.image.size", st_images_set_image_size},
{"collections.group.parts.part.description.programs.font", st_fonts_font}, /* dup */
{"collections.group.parts.part.description.programs.fonts.font", st_fonts_font}, /* dup */
{"collections.group.parts.part.description.programs.program.name", st_collections_group_programs_program_name}, /* dup */
{"collections.group.parts.part.description.program.after", st_collections_group_programs_program_after}, /* dup */
{"collections.group.parts.part.description.program.api", st_collections_group_programs_program_api}, /* dup */
{"collections.group.parts.part.programs.image", st_images_image}, /* dup */
+ {"collections.group.parts.part.programs.set.name", st_images_set_name},
+ {"collections.group.parts.part.programs.set.image.image", st_images_set_image_image},
+ {"collections.group.parts.part.programs.set.image.size", st_images_set_image_size},
{"collections.group.parts.part.programs.images.image", st_images_image}, /* dup */
+ {"collections.group.parts.part.programs.images.set.name", st_images_set_name},
+ {"collections.group.parts.part.programs.images.set.image.image", st_images_set_image_image},
+ {"collections.group.parts.part.programs.images.set.image.size", st_images_set_image_size},
{"collections.group.parts.part.programs.font", st_fonts_font}, /* dup */
{"collections.group.parts.part.programs.fonts.font", st_fonts_font}, /* dup */
{"collections.group.parts.part.programs.program.name", st_collections_group_programs_program_name}, /* dup */
{"collections.group.parts.part.program.after", st_collections_group_programs_program_after}, /* dup */
{"collections.group.parts.part.program.api", st_collections_group_programs_program_api}, /* dup */
{"collections.group.parts.programs.image", st_images_image}, /* dup */
+ {"collections.group.parts.programs.set.name", st_images_set_name},
+ {"collections.group.parts.programs.set.image.image", st_images_set_image_image},
+ {"collections.group.parts.programs.set.image.size", st_images_set_image_size},
{"collections.group.parts.programs.images.image", st_images_image}, /* dup */
+ {"collections.group.parts.programs.images.set.name", st_images_set_name},
+ {"collections.group.parts.programs.images.set.image.image", st_images_set_image_image},
+ {"collections.group.parts.programs.images.set.image.size", st_images_set_image_size},
{"collections.group.parts.programs.font", st_fonts_font}, /* dup */
{"collections.group.parts.programs.fonts.font", st_fonts_font}, /* dup */
{"collections.group.parts.programs.program.name", st_collections_group_programs_program_name}, /* dup */
{"collections.group.programs.program.after", st_collections_group_programs_program_after},
{"collections.group.programs.program.api", st_collections_group_programs_program_api},
{"collections.group.programs.image", st_images_image}, /* dup */
+ {"collections.group.programs.set.name", st_images_set_name},
+ {"collections.group.programs.set.image.image", st_images_set_image_image},
+ {"collections.group.programs.set.image.size", st_images_set_image_size},
{"collections.group.programs.images.image", st_images_image}, /* dup */
+ {"collections.group.programs.images.set.name", st_images_set_name},
+ {"collections.group.programs.images.set.image.image", st_images_set_image_image},
+ {"collections.group.programs.images.set.image.size", st_images_set_image_size},
{"collections.group.programs.font", st_fonts_font}, /* dup */
{"collections.group.programs.fonts.font", st_fonts_font} /* dup */
};
{
{"externals", NULL},
{"images", NULL},
+ {"images.set", ob_images_set},
+ {"images.set.image", ob_images_set_image},
{"fonts", NULL},
{"data", NULL},
{"styles", NULL},
{"spectra.spectrum", ob_spectrum},
{"collections", ob_collections},
{"collections.externals", NULL}, /* dup */
+ {"collections.set", ob_images_set}, /* dup */
+ {"collections.set.image", ob_images_set_image}, /* dup */
{"collections.images", NULL}, /* dup */
+ {"collections.images.set", ob_images_set}, /* dup */
+ {"collections.images.set.image", ob_images_set_image}, /* dup */
{"collections.fonts", NULL}, /* dup */
{"collections.styles", NULL}, /* dup */
{"collections.styles.style", ob_styles_style}, /* dup */
{"collections.group.script", ob_collections_group_script},
{"collections.group.lua_script", ob_collections_group_lua_script},
{"collections.group.externals", NULL}, /* dup */
+ {"collections.group.set", ob_images_set}, /* dup */
+ {"collections.group.set.image", ob_images_set_image}, /* dup */
{"collections.group.images", NULL}, /* dup */
+ {"collections.group.images.set", ob_images_set}, /* dup */
+ {"collections.group.images.set.image", ob_images_set_image}, /* dup */
{"collections.group.fonts", NULL}, /* dup */
{"collections.group.styles", NULL}, /* dup */
{"collections.group.styles.style", ob_styles_style}, /* dup */
{"collections.group.color_classes", NULL}, /* dup */
{"collections.group.color_classes.color_class", ob_color_class}, /* dup */
{"collections.group.parts", NULL},
+ {"collections.group.parts.set", ob_images_set}, /* dup */
+ {"collections.group.parts.set.image", ob_images_set_image}, /* dup */
{"collections.group.parts.images", NULL}, /* dup */
+ {"collections.group.parts.images.set", ob_images_set}, /* dup */
+ {"collections.group.parts.images.set.image", ob_images_set_image}, /* dup */
{"collections.group.parts.fonts", NULL}, /* dup */
{"collections.group.parts.styles", NULL}, /* dup */
{"collections.group.parts.styles.style", ob_styles_style}, /* dup */
{"collections.group.parts.color_classes.color_class", ob_color_class}, /* dup */
{"collections.group.parts.part", ob_collections_group_parts_part},
{"collections.group.parts.part.dragable", NULL},
+ {"collections.group.parts.part.set", ob_images_set}, /* dup */
+ {"collections.group.parts.part.set.image", ob_images_set_image}, /* dup */
{"collections.group.parts.part.images", NULL}, /* dup */
+ {"collections.group.parts.part.images.set", ob_images_set}, /* dup */
+ {"collections.group.parts.part.images.set.image", ob_images_set_image}, /* dup */
{"collections.group.parts.part.fonts", NULL}, /* dup */
{"collections.group.parts.part.styles", NULL}, /* dup */
{"collections.group.parts.part.styles.style", ob_styles_style}, /* dup */
{"collections.group.parts.part.description.rel1", NULL},
{"collections.group.parts.part.description.rel2", NULL},
{"collections.group.parts.part.description.image", NULL}, /* dup */
+ {"collections.group.parts.part.description.image.set", ob_images_set}, /* dup */
+ {"collections.group.parts.part.description.image.set.image", ob_images_set_image}, /* dup */
{"collections.group.parts.part.description.image.images", NULL}, /* dup */
+ {"collections.group.parts.part.description.image.images.set", ob_images_set}, /* dup */
+ {"collections.group.parts.part.description.image.images.set.image", ob_images_set_image}, /* dup */
{"collections.group.parts.part.description.fill", NULL},
{"collections.group.parts.part.description.fill.origin", NULL},
{"collections.group.parts.part.description.fill.size", NULL},
{"collections.group.parts.part.description.text", NULL},
{"collections.group.parts.part.description.text.fonts", NULL}, /* dup */
{"collections.group.parts.part.description.images", NULL}, /* dup */
+ {"collections.group.parts.part.description.images.set", ob_images_set}, /* dup */
+ {"collections.group.parts.part.description.images.set.image", ob_images_set_image}, /* dup */
{"collections.group.parts.part.description.fonts", NULL}, /* dup */
{"collections.group.parts.part.description.styles", NULL}, /* dup */
{"collections.group.parts.part.description.styles.style", ob_styles_style}, /* dup */
{"collections.group.parts.part.description.program.script", ob_collections_group_programs_program_script}, /* dup */
{"collections.group.parts.part.description.program.lua_script", ob_collections_group_programs_program_lua_script}, /* dup */
{"collections.group.parts.part.description.programs", NULL}, /* dup */
+ {"collections.group.parts.part.description.programs.set", ob_images_set}, /* dup */
+ {"collections.group.parts.part.description.programs.set.image", ob_images_set_image}, /* dup */
{"collections.group.parts.part.description.programs.images", NULL}, /* dup */
+ {"collections.group.parts.part.description.programs.images.set", ob_images_set},
+ {"collections.group.parts.part.description.programs.images.set.image", ob_images_set_image}, /* dup */
{"collections.group.parts.part.description.programs.fonts", NULL}, /* dup */
{"collections.group.parts.part.description.programs.program", ob_collections_group_programs_program}, /* dup */
{"collections.group.parts.part.description.programs.program.script", ob_collections_group_programs_program_script}, /* dup */
{"collections.group.parts.part.program.script", ob_collections_group_programs_program_script}, /* dup */
{"collections.group.parts.part.program.lua_script", ob_collections_group_programs_program_lua_script}, /* dup */
{"collections.group.parts.part.programs", NULL}, /* dup */
+ {"collections.group.parts.part.programs.set", ob_images_set}, /* dup */
+ {"collections.group.parts.part.programs.set.image", ob_images_set_image}, /* dup */
{"collections.group.parts.part.programs.images", NULL}, /* dup */
+ {"collections.group.parts.part.programs.images.set", ob_images_set}, /* dup */
+ {"collections.group.parts.part.programs.images.set.image", ob_images_set_image}, /* dup */
{"collections.group.parts.part.programs.fonts", NULL}, /* dup */
{"collections.group.parts.part.programs.program", ob_collections_group_programs_program}, /* dup */
{"collections.group.parts.part.programs.program.script", ob_collections_group_programs_program_script}, /* dup */
{"collections.group.parts.program.script", ob_collections_group_programs_program_script}, /* dup */
{"collections.group.parts.program.lua_script", ob_collections_group_programs_program_lua_script}, /* dup */
{"collections.group.parts.programs", NULL}, /* dup */
+ {"collections.group.parts.programs.set", ob_images_set}, /* dup */
+ {"collections.group.parts.programs.set.image", ob_images_set_image}, /* dup */
{"collections.group.parts.programs.images", NULL}, /* dup */
+ {"collections.group.parts.programs.images.set", ob_images_set}, /* dup */
+ {"collections.group.parts.programs.images.set.image", ob_images_set_image}, /* dup */
{"collections.group.parts.programs.fonts", NULL}, /* dup */
{"collections.group.parts.programs.program", ob_collections_group_programs_program}, /* dup */
{"collections.group.parts.programs.program.script", ob_collections_group_programs_program_script}, /* dup */
{"collections.group.program.script", ob_collections_group_programs_program_script}, /* dup */
{"collections.group.program.lua_script", ob_collections_group_programs_program_lua_script}, /* dup */
{"collections.group.programs", NULL},
+ {"collections.group.programs.set", ob_images_set}, /* dup */
+ {"collections.group.programs.set.image", ob_images_set_image}, /* dup */
{"collections.group.programs.images", NULL}, /* dup */
+ {"collections.group.programs.images.set", ob_images_set}, /* dup */
+ {"collections.group.programs.images.set.image", ob_images_set_image}, /* dup */
{"collections.group.programs.fonts", NULL}, /* dup */
{"collections.group.programs.program", ob_collections_group_programs_program},
{"collections.group.programs.program.script", ob_collections_group_programs_program_script},
images {
image: "filename1.ext" COMP;
image: "filename2.ext" LOSSY 99;
+ set {
+ name: "image_name_used";
+ image {
+ image: "filename3.ext" LOSSY 90;
+ size: 201 201 500 500;
+ }
+ image {
+ image: "filename4.ext" COMP;
+ size: 51 51 200 200;
+ }
+ image {
+ image: "filename5.ext" COMP;
+ size: 11 11 50 50;
+ }
+ image {
+ image: "filename6.ext" RAW;
+ size: 0 0 10 10;
+ }
+ }
..
}
@description
The "images" block is used to list each image file that will be used in
the theme along with its compression method (if any).
- Besides the domcument's root, additional "images" blocks can be
+ Besides the document's root, additional "images" blocks can be
included inside other blocks, normally "collections", "group" and
- "part", easing mantienance of the file list when the theme is split
+ "part", easing maintenance of the file list when the theme is split
among multiple files.
@endblock
@page edcref
@block
+ set
+ @context
+ set {
+ name: "image_name_used";
+ image {
+ image: "filename3.ext" LOSSY 90;
+ size: 201 201 500 500;
+ }
+ image {
+ image: "filename4.ext" COMP;
+ size: 51 51 200 200;
+ }
+ image {
+ image: "filename5.ext" COMP;
+ size: 11 11 50 50;
+ }
+ image {
+ image: "filename6.ext" RAW;
+ size: 0 0 10 10;
+ }
+ }
+ @description
+ The "set" block is used to define an image with different content depending on their size.
+ Besides the document's root, additional "set" blocks can be
+ included inside other blocks, normally "collections", "group" and
+ "part", easing maintenance of the file list when the theme is split
+ among multiple files.
+ @endblock
+ */
+static void
+ob_images_set(void)
+{
+ Edje_Image_Directory_Set *set;
+
+ if (!edje_file->image_dir)
+ edje_file->image_dir = mem_alloc(SZ(Edje_Image_Directory));
+ set = mem_alloc(SZ(Edje_Image_Directory_Set));
+ set->id = eina_list_count(edje_file->image_dir->sets);
+ edje_file->image_dir->sets = eina_list_append(edje_file->image_dir->sets, set);
+}
+
+/**
+ @page edcref
+
+ @property
+ name
+ @parameters
+ [image name]
+ @effect
+ Define the name that refer to this image description.
+ @endproperty
+*/
+static void
+st_images_set_name(void)
+{
+ Edje_Image_Directory_Set *set;
+
+ check_arg_count(1);
+
+ set = eina_list_data_get(eina_list_last(edje_file->image_dir->sets));
+ set->name = parse_str(0);
+}
+
+static void
+ob_images_set_image(void)
+{
+ Edje_Image_Directory_Set_Entry *entry;
+ Edje_Image_Directory_Set *set;
+
+ set = eina_list_data_get(eina_list_last(edje_file->image_dir->sets));
+
+ entry = mem_alloc(SZ(Edje_Image_Directory_Set_Entry));
+
+ set->entries = eina_list_append(set->entries, entry);
+}
+
+static void
+st_images_set_image_image(void)
+{
+ Edje_Image_Directory_Set_Entry *entry;
+ Edje_Image_Directory_Set *set;
+ Edje_Image_Directory_Entry *img;
+ Eina_List *l;
+
+ set = eina_list_data_get(eina_list_last(edje_file->image_dir->sets));
+ entry = eina_list_data_get(eina_list_last(set->entries));
+
+ /* Add the image to the global pool with the same syntax. */
+ st_images_image();
+
+ entry->name = parse_str(0);
+
+ EINA_LIST_FOREACH(edje_file->image_dir->entries, l, img)
+ if (!strcmp(img->entry, entry->name))
+ {
+ entry->id = img->id;
+ return;
+ }
+}
+
+/**
+ @page edcref
+
+ @property
+ size
+ @parameters
+ [minw minh maxw mawh]
+ @effect
+ Define the minimal and maximal size that will select the specified image.
+ @endproperty
+*/
+static void
+st_images_set_image_size(void)
+{
+ Edje_Image_Directory_Set_Entry *entry;
+ Edje_Image_Directory_Set *set;
+
+ set = eina_list_data_get(eina_list_last(edje_file->image_dir->sets));
+ entry = eina_list_data_get(eina_list_last(set->entries));
+
+ entry->size.min.w = parse_int(0);
+ entry->size.min.h = parse_int(1);
+ entry->size.max.w = parse_int(2);
+ entry->size.max.h = parse_int(3);
+
+ if (entry->size.min.w > entry->size.max.w
+ || entry->size.min.h > entry->size.max.h)
+ {
+ ERR("%s: Error. parse error %s:%i. Image min and max size are not in the right order ([%i, %i] < [%i, %i])",
+ progname, file_in, line - 1,
+ entry->size.min.w, entry->size.min.h,
+ entry->size.max.w, entry->size.max.h);
+ exit(-1);
+ }
+}
+
+/**
+ @page edcref
+
+ @block
fonts
@context
fonts {
item->weight.y = FROM_DOUBLE(0.0);
item->aspect.w = 0;
item->aspect.h = 0;
- item->aspect.mode = EDJE_ASPECT_PREFER_NONE;
+ item->aspect.mode = EDJE_ASPECT_CONTROL_NONE;
item->options = NULL;
item->col = -1;
item->row = -1;
char *name;
name = parse_str(0);
- data_queue_image_lookup(name, &(ed->image.id));
+ data_queue_image_lookup(name, &(ed->image.id), &(ed->image.set));
free(name);
}
}
iid = mem_alloc(SZ(Edje_Part_Image_Id));
ed->image.tween_list = eina_list_append(ed->image.tween_list, iid);
name = parse_str(0);
- data_queue_image_lookup(name, &(iid->id));
+ data_queue_image_lookup(name, &(iid->id), &(iid->set));
free(name);
}
}
typedef struct _Part_Lookup Part_Lookup;
typedef struct _Program_Lookup Program_Lookup;
typedef struct _Group_Lookup Group_Lookup;
-typedef struct _String_Lookup Image_Lookup;
+typedef struct _Image_Lookup Image_Lookup;
typedef struct _String_Lookup Spectrum_Lookup;
typedef struct _Slave_Lookup Slave_Lookup;
typedef struct _Code_Lookup Code_Lookup;
int *dest;
};
+struct _Image_Lookup
+{
+ char *name;
+ int *dest;
+ Eina_Bool *set;
+};
+
struct _Slave_Lookup
{
int *master;
char *ptr;
int len;
int val;
+ Eina_Bool set;
};
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));
Eina_List *l;
Edje_Part_Description *data;
+ /* FIXME: check image set and sort them. */
if (!epd)
error_and_abort(ef, "Collection %i: default description missing "
"for part \"%s\"\n", pc->id, ep->name);
}
void
-data_queue_image_lookup(char *name, int *dest)
+data_queue_image_lookup(char *name, int *dest, Eina_Bool *set)
{
Image_Lookup *il;
image_lookups = eina_list_append(image_lookups, il);
il->name = mem_strdup(name);
il->dest = dest;
+ il->set = set;
}
void
*(il->dest) = -de->id - 1;
else
*(il->dest) = de->id;
+ *(il->set) = EINA_FALSE;
break;
}
}
+
+ if (!l)
+ {
+ Edje_Image_Directory_Set *set;
+
+ EINA_LIST_FOREACH(edje_file->image_dir->sets, l, set)
+ {
+ if ((set->name) && (!strcmp(set->name, il->name)))
+ {
+ handle_slave_lookup(image_slave_lookups, il->dest, set->id);
+ *(il->dest) = set->id;
+ *(il->set) = EINA_TRUE;
+ break;
+ }
+ }
+ }
}
if (!l)
cl->ptr = ptr;
cl->len = len;
- data_queue_image_lookup(name, &(cl->val));
+ data_queue_image_lookup(name, &(cl->val), &(cl->set));
code_lookups = eina_list_append(code_lookups, cl);
}
char buf[12];
int n;
+ /* FIXME !! Handle set in program */
n = eina_convert_itoa(cl->val, buf);
if (n > cl->len)
{
snprintf(buf, sizeof(buf), "cat %s | cpp -I%s %s > %s",
file_in, inc, def, tmpn);
ret = system(buf);
-#if defined (__MacOSX__) || ( defined (__MACH__) && defined (__APPLE__))
+#if defined (__MacOSX__) || ( defined (__MACH__) && defined (__APPLE__) ) || defined (__OpenBSD__)
if (ret == 0)
{
static char tmpn2[4096];
("Usage:\n"
"\t%s input_file.edj [-main-out file.edc] [-no-build-sh] [-current-dir]\n"
"\n"
+ " -main-out\tCreate a symbolic link to the main edc \n"
+ " -no-build-sh\tDon't output build.sh \n"
+ " -current-dir\tOutput to current directory \n"
+ "\n"
,progname);
}
progname = argv[0];
for (i = 1; i < argc; i++)
{
+ if (!strcmp(argv[i], "-h"))
+ {
+ main_help();
+ exit(0);
+ }
if (!file_in)
file_in = argv[i];
else if ((!strcmp(argv[i], "-main-out")) && (i < (argc - 1)))
#include <config.h>
#endif
-#include <Edje.h>
-#include <Ecore_Evas.h>
-#include <Ecore.h>
-#include <Ecore_Getopt.h>
-#include <Evas.h>
-
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <fcntl.h>
#include <ctype.h>
+#ifdef HAVE_EVIL
+# include <Evil.h>
+#endif
+
+#include <Evas.h>
+#include <Ecore.h>
+#include <Ecore_Getopt.h>
+#include <Ecore_Evas.h>
+#include <Edje.h>
+
struct opts {
char *file;
char *group;
#include <stdint.h>
#include <math.h>
+#include <float.h>
+#include <limits.h>
#include <Evas.h>
# endif
#endif
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define EDJE_VERSION_MAJOR 0
+#define EDJE_VERSION_MINOR 9
+
+ typedef struct _Edje_Version
+ {
+ int major;
+ int minor;
+ int micro;
+ int revision;
+ } Edje_Version;
+
+ EAPI extern Edje_Version *edje_version;
+
/**
* @file Edje.h
* @brief Edje Graphical Design Library
};
typedef struct _Edje_External_Param Edje_External_Param;
-#define EDJE_EXTERNAL_INT_UNSET 0xffffffff
-#define EDJE_EXTERNAL_DOUBLE_UNSET HUGE_VAL
+#define EDJE_EXTERNAL_INT_UNSET INT_MAX
+#define EDJE_EXTERNAL_DOUBLE_UNSET DBL_MAX
struct _Edje_External_Param_Info
{
* - #EDJE_EXTERNAL_TYPE_ABI_VERSION to declare.
* - edje_external_type_abi_version_get() to check.
*/
-
const char *module;
const char *module_name;
Evas_Object *(*add) (void *data, Evas *evas, Evas_Object *parent, const Eina_List *params, const char *part_name); /**< creates the object to be used by Edje as the part */
};
typedef struct _Edje_External_Type Edje_External_Type;
-
struct _Edje_External_Type_Info
{
const char *name;
};
typedef struct _Edje_External_Type_Info Edje_External_Type_Info;
-
-
-typedef void (*Edje_Signal_Cb) (void *data, Evas_Object *obj, const char *emission, const char *source);
-typedef void (*Edje_Text_Change_Cb) (void *data, Evas_Object *obj, const char *part);
+typedef void (*Edje_Signal_Cb) (void *data, Evas_Object *obj, const char *emission, const char *source);
+typedef void (*Edje_Text_Change_Cb) (void *data, Evas_Object *obj, const char *part);
typedef void (*Edje_Message_Handler_Cb) (void *data, Evas_Object *obj, Edje_Message_Type type, int id, void *msg);
-#ifdef __cplusplus
-extern "C" {
-#endif
-
/* edje_main.c */
EAPI int edje_init (void);
EAPI int edje_shutdown (void);
/* edje_util.c */
- EAPI Eina_Bool edje_color_class_set(const char *color_class, int r, int g, int b, int a, int r2, int g2, int b2, int a2, int r3, int g3, int b3, int a3);
- EAPI Eina_Bool edje_color_class_get(const char *color_class, int *r, int *g, int *b, int *a, int *r2, int *g2, int *b2, int *a2, int *r3, int *g3, int *b3, int *a3);
- EAPI void edje_color_class_del(const char *color_class);
- EAPI Eina_List * edje_color_class_list(void);
- EAPI Eina_Bool edje_text_class_set(const char *text_class, const char *font, Evas_Font_Size size);
- EAPI void edje_text_class_del(const char *text_class);
- EAPI Eina_List * edje_text_class_list(void);
+ EAPI Eina_Bool edje_color_class_set (const char *color_class, int r, int g, int b, int a, int r2, int g2, int b2, int a2, int r3, int g3, int b3, int a3);
+ EAPI Eina_Bool edje_color_class_get (const char *color_class, int *r, int *g, int *b, int *a, int *r2, int *g2, int *b2, int *a2, int *r3, int *g3, int *b3, int *a3);
+ EAPI void edje_color_class_del (const char *color_class);
+ EAPI Eina_List *edje_color_class_list (void);
+ EAPI Eina_Bool edje_text_class_set (const char *text_class, const char *font, Evas_Font_Size size);
+ EAPI void edje_text_class_del (const char *text_class);
+ EAPI Eina_List *edje_text_class_list (void);
EAPI void edje_extern_object_min_size_set (Evas_Object *obj, Evas_Coord minw, Evas_Coord minh);
EAPI void edje_extern_object_max_size_set (Evas_Object *obj, Evas_Coord maxw, Evas_Coord maxh);
- EAPI void edje_extern_object_aspect_set(Evas_Object *obj, Edje_Aspect_Control aspect, Evas_Coord aw, Evas_Coord ah);
- EAPI void edje_box_layout_register(const char *name, Evas_Object_Box_Layout func, void *(*layout_data_get)(void *), void (*layout_data_free)(void *), void (*free_data)(void *), void *data);
+ EAPI void edje_extern_object_aspect_set (Evas_Object *obj, Edje_Aspect_Control aspect, Evas_Coord aw, Evas_Coord ah);
+ EAPI void edje_box_layout_register (const char *name, Evas_Object_Box_Layout func, void *(*layout_data_get)(void *), void (*layout_data_free)(void *), void (*free_data)(void *), void *data);
/* edje_smart.c */
EAPI Evas_Object *edje_object_add (Evas *evas);
EAPI Eina_Bool edje_object_animation_get (const Evas_Object *obj);
/* edje_util.c */
- EAPI int edje_object_freeze (Evas_Object *obj);
- EAPI int edje_object_thaw (Evas_Object *obj);
- EAPI Eina_Bool edje_object_color_class_set (Evas_Object *obj, const char *color_class, int r, int g, int b, int a, int r2, int g2, int b2, int a2, int r3, int g3, int b3, int a3);
- EAPI Eina_Bool edje_object_color_class_get (const Evas_Object *o, const char *color_class, int *r, int *g, int *b, int *a, int *r2, int *g2, int *b2, int *a2, int *r3, int *g3, int *b3, int *a3);
- EAPI void edje_object_color_class_del (Evas_Object *obj, const char *color_class);
- EAPI Eina_Bool edje_object_text_class_set (Evas_Object *obj, const char *text_class, const char *font, Evas_Font_Size size);
- EAPI void edje_object_size_min_get (const Evas_Object *obj, Evas_Coord *minw, Evas_Coord *minh);
- EAPI void edje_object_size_max_get (const Evas_Object *obj, Evas_Coord *maxw, Evas_Coord *maxh);
- EAPI void edje_object_calc_force (Evas_Object *obj);
- EAPI void edje_object_size_min_calc (Evas_Object *obj, Evas_Coord *minw, Evas_Coord *minh);
- EAPI Eina_Bool edje_object_parts_extends_calc(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h);
+ EAPI int edje_object_freeze (Evas_Object *obj);
+ EAPI int edje_object_thaw (Evas_Object *obj);
+ EAPI Eina_Bool edje_object_color_class_set (Evas_Object *obj, const char *color_class, int r, int g, int b, int a, int r2, int g2, int b2, int a2, int r3, int g3, int b3, int a3);
+ EAPI Eina_Bool edje_object_color_class_get (const Evas_Object *o, const char *color_class, int *r, int *g, int *b, int *a, int *r2, int *g2, int *b2, int *a2, int *r3, int *g3, int *b3, int *a3);
+ EAPI void edje_object_color_class_del (Evas_Object *obj, const char *color_class);
+ EAPI Eina_Bool edje_object_text_class_set (Evas_Object *obj, const char *text_class, const char *font, Evas_Font_Size size);
+ EAPI void edje_object_size_min_get (const Evas_Object *obj, Evas_Coord *minw, Evas_Coord *minh);
+ EAPI void edje_object_size_max_get (const Evas_Object *obj, Evas_Coord *maxw, Evas_Coord *maxh);
+ EAPI void edje_object_calc_force (Evas_Object *obj);
+ EAPI void edje_object_size_min_calc (Evas_Object *obj, Evas_Coord *minw, Evas_Coord *minh);
+ EAPI Eina_Bool edje_object_parts_extends_calc (Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h);
EAPI void edje_object_size_min_restricted_calc(Evas_Object *obj, Evas_Coord *minw, Evas_Coord *minh, Evas_Coord restrictedw, Evas_Coord restrictedh);
- EAPI Eina_Bool edje_object_part_exists (const Evas_Object *obj, const char *part);
- EAPI const Evas_Object *edje_object_part_object_get (const Evas_Object *obj, const char *part);
- EAPI Eina_Bool edje_object_part_geometry_get (const Evas_Object *obj, const char *part, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h);
- EAPI void edje_object_text_change_cb_set (Evas_Object *obj, Edje_Text_Change_Cb func, void *data);
- EAPI Eina_Bool edje_object_part_text_set (Evas_Object *obj, const char *part, const char *text);
- EAPI const char *edje_object_part_text_get (const Evas_Object *obj, const char *part);
- EAPI Eina_Bool edje_object_part_text_unescaped_set(Evas_Object *obj, const char *part, const char *text_to_escape);
- EAPI char *edje_object_part_text_unescaped_get(const Evas_Object *obj, const char *part);
+ EAPI Eina_Bool edje_object_part_exists (const Evas_Object *obj, const char *part);
+ EAPI const Evas_Object *edje_object_part_object_get (const Evas_Object *obj, const char *part);
+ EAPI Eina_Bool edje_object_part_geometry_get (const Evas_Object *obj, const char *part, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h);
+
+ EAPI void edje_object_item_provider_set (Evas_Object *obj, Evas_Object *(*func) (void *data, Evas_Object *obj, const char *part, const char *item), void *data);
+
+ EAPI void edje_object_text_change_cb_set (Evas_Object *obj, Edje_Text_Change_Cb func, void *data);
+
+ EAPI Eina_Bool edje_object_part_text_set (Evas_Object *obj, const char *part, const char *text);
+ EAPI const char *edje_object_part_text_get (const Evas_Object *obj, const char *part);
+ EAPI Eina_Bool edje_object_part_text_unescaped_set (Evas_Object *obj, const char *part, const char *text_to_escape);
+ EAPI char *edje_object_part_text_unescaped_get (const Evas_Object *obj, const char *part);
EAPI const char *edje_object_part_text_selection_get (const Evas_Object *obj, const char *part);
EAPI void edje_object_part_text_select_none (const Evas_Object *obj, const char *part);
EAPI void edje_object_part_text_select_all (const Evas_Object *obj, const char *part);
EAPI void edje_object_part_text_insert (Evas_Object *obj, const char *part, const char *text);
- EAPI void edje_object_item_provider_set (Evas_Object *obj, Evas_Object *(*func) (void *data, Evas_Object *obj, const char *part, const char *item), void *data);
EAPI const Eina_List *edje_object_part_text_anchor_list_get (const Evas_Object *obj, const char *part);
EAPI const Eina_List *edje_object_part_text_anchor_geometry_get (const Evas_Object *obj, const char *part, const char *anchor);
EAPI const Eina_List *edje_object_part_text_item_list_get (const Evas_Object *obj, const char *part);
EAPI void edje_object_part_text_select_begin (const Evas_Object *obj, const char *part);
EAPI void edje_object_part_text_select_extend (const Evas_Object *obj, const char *part);
- EAPI Eina_Bool edje_object_part_text_cursor_next(const Evas_Object *obj, const char *part, Edje_Cursor cur);
- EAPI Eina_Bool edje_object_part_text_cursor_prev(const Evas_Object *obj, const char *part, Edje_Cursor cur);
- EAPI Eina_Bool edje_object_part_text_cursor_up(const Evas_Object *obj, const char *part, Edje_Cursor cur);
- EAPI Eina_Bool edje_object_part_text_cursor_down(const Evas_Object *obj, const char *part, Edje_Cursor cur);
- EAPI void edje_object_part_text_cursor_begin_set(const Evas_Object *obj, const char *part, Edje_Cursor cur);
- EAPI void edje_object_part_text_cursor_end_set(const Evas_Object *obj, const char *part, Edje_Cursor cur);
- EAPI void edje_object_part_text_cursor_copy(const Evas_Object *obj, const char *part, Edje_Cursor src, Edje_Cursor dst);
- EAPI void edje_object_part_text_cursor_line_begin_set(const Evas_Object *obj, const char *part, Edje_Cursor cur);
- EAPI void edje_object_part_text_cursor_line_end_set(const Evas_Object *obj, const char *part, Edje_Cursor cur);
- EAPI Eina_Bool edje_object_part_text_cursor_is_format_get(const Evas_Object *obj, const char *part, Edje_Cursor cur);
+ EAPI Eina_Bool edje_object_part_text_cursor_next (const Evas_Object *obj, const char *part, Edje_Cursor cur);
+ EAPI Eina_Bool edje_object_part_text_cursor_prev (const Evas_Object *obj, const char *part, Edje_Cursor cur);
+ EAPI Eina_Bool edje_object_part_text_cursor_up (const Evas_Object *obj, const char *part, Edje_Cursor cur);
+ EAPI Eina_Bool edje_object_part_text_cursor_down (const Evas_Object *obj, const char *part, Edje_Cursor cur);
+ EAPI void edje_object_part_text_cursor_begin_set (const Evas_Object *obj, const char *part, Edje_Cursor cur);
+ EAPI void edje_object_part_text_cursor_end_set (const Evas_Object *obj, const char *part, Edje_Cursor cur);
+ EAPI void edje_object_part_text_cursor_copy (const Evas_Object *obj, const char *part, Edje_Cursor src, Edje_Cursor dst);
+ EAPI void edje_object_part_text_cursor_line_begin_set (const Evas_Object *obj, const char *part, Edje_Cursor cur);
+ EAPI void edje_object_part_text_cursor_line_end_set (const Evas_Object *obj, const char *part, Edje_Cursor cur);
+ EAPI Eina_Bool edje_object_part_text_cursor_is_format_get (const Evas_Object *obj, const char *part, Edje_Cursor cur);
EAPI Eina_Bool edje_object_part_text_cursor_is_visible_format_get(const Evas_Object *obj, const char *part, Edje_Cursor cur);
- EAPI const char *edje_object_part_text_cursor_content_get(const Evas_Object *obj, const char *part, Edje_Cursor cur);
+ EAPI const char *edje_object_part_text_cursor_content_get (const Evas_Object *obj, const char *part, Edje_Cursor cur);
+ EAPI void edje_object_text_insert_filter_callback_add (Evas_Object *obj, const char *part, void (*func) (void *data, Evas_Object *obj, const char *part, char **text), const void *data);
+ EAPI void edje_object_text_insert_filter_callback_del (Evas_Object *obj, const char *part, void (*func) (void *data, Evas_Object *obj, const char *part, char **text), const void *data);
+
EAPI Eina_Bool edje_object_part_swallow (Evas_Object *obj, const char *part, Evas_Object *obj_swallow);
EAPI void edje_object_part_unswallow (Evas_Object *obj, Evas_Object *obj_swallow);
EAPI Evas_Object *edje_object_part_swallow_get (const Evas_Object *obj, const char *part);
EAPI Eina_Bool edje_object_part_drag_step (Evas_Object *obj, const char *part, double dx, double dy);
EAPI Eina_Bool edje_object_part_drag_page (Evas_Object *obj, const char *part, double dx, double dy);
- EAPI Evas_Object *edje_object_part_external_object_get(const Evas_Object *obj, const char *part);
- EAPI Eina_Bool edje_object_part_external_param_set(Evas_Object *obj, const char *part, const Edje_External_Param *param);
- EAPI Eina_Bool edje_object_part_external_param_get(const Evas_Object *obj, const char *part, Edje_External_Param *param);
- EAPI Edje_External_Param_Type edje_object_part_external_param_type_get(const Evas_Object *obj, const char *part, const char *param);
-
- EAPI Eina_Bool edje_object_part_box_append (Evas_Object *obj, const char *part, Evas_Object *child);
- EAPI Eina_Bool edje_object_part_box_prepend (Evas_Object *obj, const char *part, Evas_Object *child);
- EAPI Eina_Bool edje_object_part_box_insert_before (Evas_Object *obj, const char *part, Evas_Object *child, const Evas_Object *reference);
- EAPI Eina_Bool edje_object_part_box_insert_at (Evas_Object *obj, const char *part, Evas_Object *child, unsigned int pos);
- EAPI Evas_Object *edje_object_part_box_remove (Evas_Object *obj, const char *part, Evas_Object *child);
- EAPI Evas_Object *edje_object_part_box_remove_at (Evas_Object *obj, const char *part, unsigned int pos);
- EAPI Eina_Bool edje_object_part_box_remove_all (Evas_Object *obj, const char *part, Eina_Bool clear);
- EAPI Evas_Object *edje_object_part_table_child_get(Evas_Object *obj, const char *part, unsigned int col, unsigned int row);
- EAPI Eina_Bool edje_object_part_table_pack (Evas_Object *obj, const char *part, Evas_Object *child_obj, unsigned short col, unsigned short row, unsigned short colspan, unsigned short rowspan);
- EAPI Eina_Bool edje_object_part_table_unpack (Evas_Object *obj, const char *part, Evas_Object *child_obj);
+ EAPI Evas_Object *edje_object_part_external_object_get (const Evas_Object *obj, const char *part);
+ EAPI Eina_Bool edje_object_part_external_param_set (Evas_Object *obj, const char *part, const Edje_External_Param *param);
+ EAPI Eina_Bool edje_object_part_external_param_get (const Evas_Object *obj, const char *part, Edje_External_Param *param);
+ EAPI Edje_External_Param_Type edje_object_part_external_param_type_get (const Evas_Object *obj, const char *part, const char *param);
+
+ EAPI Eina_Bool edje_object_part_box_append (Evas_Object *obj, const char *part, Evas_Object *child);
+ EAPI Eina_Bool edje_object_part_box_prepend (Evas_Object *obj, const char *part, Evas_Object *child);
+ EAPI Eina_Bool edje_object_part_box_insert_before (Evas_Object *obj, const char *part, Evas_Object *child, const Evas_Object *reference);
+ EAPI Eina_Bool edje_object_part_box_insert_at (Evas_Object *obj, const char *part, Evas_Object *child, unsigned int pos);
+ EAPI Evas_Object *edje_object_part_box_remove (Evas_Object *obj, const char *part, Evas_Object *child);
+ EAPI Evas_Object *edje_object_part_box_remove_at (Evas_Object *obj, const char *part, unsigned int pos);
+ EAPI Eina_Bool edje_object_part_box_remove_all (Evas_Object *obj, const char *part, Eina_Bool clear);
+ EAPI Evas_Object *edje_object_part_table_child_get (Evas_Object *obj, const char *part, unsigned int col, unsigned int row);
+ EAPI Eina_Bool edje_object_part_table_pack (Evas_Object *obj, const char *part, Evas_Object *child_obj, unsigned short col, unsigned short row, unsigned short colspan, unsigned short rowspan);
+ EAPI Eina_Bool edje_object_part_table_unpack (Evas_Object *obj, const char *part, Evas_Object *child_obj);
EAPI Eina_Bool edje_object_part_table_col_row_size_get (const Evas_Object *obj, const char *part, int *cols, int *rows);
- EAPI Eina_Bool edje_object_part_table_clear (Evas_Object *obj, const char *part, Eina_Bool clear);
+ EAPI Eina_Bool edje_object_part_table_clear (Evas_Object *obj, const char *part, Eina_Bool clear);
/* edje_message_queue.c */
- EAPI void edje_object_message_send (Evas_Object *obj, Edje_Message_Type type, int id, void *msg);
- EAPI void edje_object_message_handler_set (Evas_Object *obj, Edje_Message_Handler_Cb func, void *data);
- EAPI void edje_object_message_signal_process (Evas_Object *obj);
+ EAPI void edje_object_message_send (Evas_Object *obj, Edje_Message_Type type, int id, void *msg);
+ EAPI void edje_object_message_handler_set (Evas_Object *obj, Edje_Message_Handler_Cb func, void *data);
+ EAPI void edje_object_message_signal_process (Evas_Object *obj);
- EAPI void edje_message_signal_process (void);
+ EAPI void edje_message_signal_process (void);
/* edje_external.c */
- EAPI Eina_Bool edje_external_type_register(const char *type_name, const Edje_External_Type *type_info);
- EAPI Eina_Bool edje_external_type_unregister(const char *type_name);
+ EAPI Eina_Bool edje_external_type_register (const char *type_name, const Edje_External_Type *type_info);
+ EAPI Eina_Bool edje_external_type_unregister (const char *type_name);
- EAPI void edje_external_type_array_register(const Edje_External_Type_Info *array);
- EAPI void edje_external_type_array_unregister(const Edje_External_Type_Info *array);
+ EAPI void edje_external_type_array_register (const Edje_External_Type_Info *array);
+ EAPI void edje_external_type_array_unregister (const Edje_External_Type_Info *array);
- EAPI unsigned int edje_external_type_abi_version_get(void) EINA_CONST;
+ EAPI unsigned int edje_external_type_abi_version_get (void) EINA_CONST;
- EAPI Eina_Iterator *edje_external_iterator_get(void);
- EAPI Edje_External_Param *edje_external_param_find(const Eina_List *params, const char *key);
- EAPI Eina_Bool edje_external_param_int_get(const Eina_List *params, const char *key, int *ret);
- EAPI Eina_Bool edje_external_param_double_get(const Eina_List *params, const char *key, double *ret);
- EAPI Eina_Bool edje_external_param_string_get(const Eina_List *params, const char *key, const char **ret);
- EAPI Eina_Bool edje_external_param_bool_get(const Eina_List *params, const char *key, Eina_Bool *ret);
- EAPI Eina_Bool edje_external_param_choice_get(const Eina_List *params, const char *key, const char **ret);
- EAPI const Edje_External_Param_Info *edje_external_param_info_get(const char *type_name);
- EAPI const Edje_External_Type *edje_external_type_get(const char *type_name);
+ EAPI Eina_Iterator *edje_external_iterator_get (void);
+ EAPI Edje_External_Param *edje_external_param_find (const Eina_List *params, const char *key);
+ EAPI Eina_Bool edje_external_param_int_get (const Eina_List *params, const char *key, int *ret);
+ EAPI Eina_Bool edje_external_param_double_get (const Eina_List *params, const char *key, double *ret);
+ EAPI Eina_Bool edje_external_param_string_get (const Eina_List *params, const char *key, const char **ret);
+ EAPI Eina_Bool edje_external_param_bool_get (const Eina_List *params, const char *key, Eina_Bool *ret);
+ EAPI Eina_Bool edje_external_param_choice_get (const Eina_List *params, const char *key, const char **ret);
+ EAPI const Edje_External_Param_Info *edje_external_param_info_get (const char *type_name);
+ EAPI const Edje_External_Type *edje_external_type_get (const char *type_name);
/* edje_module.c */
- EAPI Eina_Bool edje_module_load(const char *module);
- EAPI const Eina_List *edje_available_modules_get(void);
+ EAPI Eina_Bool edje_module_load (const char *module);
+ EAPI const Eina_List *edje_available_modules_get (void);
/* perspective info for maps inside edje objects */
typedef struct _Edje_Perspective Edje_Perspective;
//@}
+/** Add a new ttf font to the edje file.
+ *
+ * The newly created font will be available to all the groups in the edje,
+ * not only the current one.
+ *
+ * @param obj Object being edited.
+ * @param path Path to the font file to add into the Edje file.
+ * @param alias Name with which the font will be referred inside the Edje,
+ * can be NULL to use the filename.
+ *
+ * @return EINA_TRUE if the font got succesfully added, EINA_FALSE if not.
+ */
+EAPI Eina_Bool edje_edit_font_add(Evas_Object *obj, const char *path, const char *alias);
+
+/** Remove a ttf font to the edje file.
+ *
+ * The font exists at the file level, it's not per object. So deleting it
+ * will affect every group that is using it.
+ *
+ * @param obj Object being edited.
+ * @param alias Name by which the file is identified in the Edje file.
+ *
+ * @return EINA_TRUE if succesful, EINA_FALSE otherwise.
+ */
+EAPI Eina_Bool edje_edit_font_del(Evas_Object *obj, const char *alias);
+
/******************************************************************************/
/************************** TEXT STYLES *************************************/
/******************************************************************************/
*/
EAPI Eina_Bool edje_edit_part_name_set(Evas_Object *obj, const char *part, const char *new_name);
-/**Add a new ttf font to the edje file.
- * The newly created font will be available to all the groups in the edje, not only the current one.
- * If font can't be load EINA_FALSE is returned.
- */
-EAPI Eina_Bool ///@return EINA_TRUE on success or EINA_FALSE on failure
-edje_edit_font_add(
- Evas_Object *obj, ///< The edje object
- const char* path, ///< The file path to load the ttf font from
- const char* alias ///< The file alias, or NULL to use filename
-);
-
-/**Remove a ttf font to the edje file.
- * If font can't be deleted EINA_FALSE is returned.
- */
-EAPI Eina_Bool ///@return EINA_TRUE on success or EINA_FALSE on failure
-edje_edit_font_del(
- Evas_Object *obj, ///< The edje object
- const char* alias ///< The file alias
-);
-
-/**Get font name for a given part state. Remember to free the returned string using edje_edit_string_free().*/
-EAPI const char * ///@return The name of the font used in the given part state
-edje_edit_state_font_get(
- Evas_Object *obj, ///< The edje object
- const char *part, ///< The name of the part
- const char *state, ///< The name of the 'part state' (ex. "default")
- double value
-);
-
-/**Set font name for a given part state. */
-EAPI void
-edje_edit_state_font_set(
- Evas_Object *obj, ///< The edje object
- const char *part, ///< The name of the part
- const char *state, ///< The name of the 'part state' (ex. "default")
- double value,
- const char *font ///< The name of the font to use in the given part state
-);
-
/** Get the type of a part.
*
* @param obj Object being edited.
*/
EAPI void edje_edit_state_text_set(Evas_Object *obj, const char *part, const char *state, double value,const char *text);
+/** Get font name for a given part state.
+ *
+ * @param obj Object being edited.
+ * @param part The name of the part to get the font of.
+ * @param state The state of the part to get the font of.
+ * @param value Value of the state.
+ *
+ * @return Font used by the part or NULL if error or nothing is set.
+ */
+EAPI const char * edje_edit_state_font_get(Evas_Object *obj, const char *part, const char *state, double value);
+
+/** Set font name for a given part state.
+ *
+ * Font name can be any alias of an internal font in the Edje file and,
+ * if it doesn't match any, Edje will look for a font with the given name
+ * in the system fonts.
+ *
+ * @param obj Object being edited.
+ * @param part Part to set the font of.
+ * @param state State in which the font is set.
+ * @param value Value of the state.
+ * @param font The font name to use.
+ */
+EAPI void edje_edit_state_font_set(Evas_Object *obj, const char *part, const char *state, double value, const char *font);
+
/** Get the text size of a part state
*
* @param obj Object being edited.
if (data)
{
edc->script = embryo_program_new(data, size);
+ _edje_embryo_script_init(edc);
free(data);
}
if (epd2 != NULL && (epd1 != epd2 || (ep->part->type == EDJE_PART_TYPE_IMAGE && epd2->image.tween_list)))
{
if (!ep->param2)
- ep->param2 = eina_mempool_malloc(_edje_real_part_state_mp, sizeof (Edje_Real_Part_State));
+ {
+ ep->param2 = eina_mempool_malloc(_edje_real_part_state_mp, sizeof (Edje_Real_Part_State));
+ memset(ep->param2, 0, sizeof (Edje_Real_Part_State));
+ }
else if (ep->part->type == EDJE_PART_TYPE_EXTERNAL)
_edje_external_parsed_params_free(ep->swallowed_object, ep->param2->external_params);
ep->param2->external_params = NULL;
{
if (ep->part->type == EDJE_PART_TYPE_EXTERNAL)
_edje_external_parsed_params_free(ep->swallowed_object, ep->param2->external_params);
+ if (ep->param2)
+ free(ep->param2->set);
eina_mempool_free(_edje_real_part_state_mp, ep->param2);
ep->param2 = NULL;
}
}
}
+static int
+_edje_image_find(Evas_Object *obj, Edje *ed, Edje_Real_Part_Set **eps, Edje_Part_Description *st, Edje_Part_Image_Id *imid)
+{
+ Edje_Image_Directory_Set_Entry *entry;
+ Edje_Image_Directory_Set *set = NULL;
+ Eina_List *l;
+ int w = 0;
+ int h = 0;
+ int id;
+
+ if (!st && !imid)
+ return -1;
+
+ if (st && !st->image.set)
+ return st->image.id;
+
+ if (imid && !imid->set)
+ return imid->id;
+
+ if (imid)
+ id = imid->id;
+ else
+ id = st->image.id;
+
+ evas_object_geometry_get(obj, NULL, NULL, &w, &h);
+
+ if (eps && *eps)
+ {
+ if ((*eps)->id == id)
+ set = (*eps)->set;
+
+ if (set)
+ if ((*eps)->entry->size.min.w <= w && w <= (*eps)->entry->size.max.w)
+ if ((*eps)->entry->size.min.h <= h && h <= (*eps)->entry->size.max.h)
+ return (*eps)->entry->id;
+ }
+
+ if (!set)
+ set = eina_list_nth(ed->file->image_dir->sets, id);
+
+ EINA_LIST_FOREACH(set->entries, l, entry)
+ {
+ if (entry->size.min.w <= w && w <= entry->size.max.w)
+ if (entry->size.min.h <= h && h <= entry->size.max.h)
+ {
+ if (eps)
+ {
+ if (!*eps)
+ *eps = calloc(1, sizeof (Edje_Real_Part_Set));
+
+ if (*eps)
+ {
+ (*eps)->entry = entry;
+ (*eps)->set = set;
+ (*eps)->id = id;
+ }
+ }
+ return entry->id;
+ }
+ }
+
+ return -1;
+}
+
static void
_edje_image_recalc_apply(Edje *ed, Edje_Real_Part *ep, Edje_Calc_Params *p3, Edje_Part_Description *chosen_desc, FLOAT_T pos)
{
evas_object_image_border_center_fill_set(ep->object, EVAS_BORDER_FILL_NONE);
else if (chosen_desc->border.no_fill == 2)
evas_object_image_border_center_fill_set(ep->object, EVAS_BORDER_FILL_SOLID);
- image_id = ep->param1.description->image.id;
+
+ image_id = _edje_image_find(ep->object, ed,
+ &ep->param1.set, ep->param1.description, NULL);
if (image_id < 0)
{
Edje_Image_Directory_Entry *ie;
if (image_num > (image_count - 1))
image_num = image_count - 1;
if (image_num == 0)
- image_id = ep->param1.description->image.id;
+ {
+ image_id = _edje_image_find(ep->object, ed,
+ &ep->param1.set, ep->param1.description,
+ NULL);
+ }
else
if (ep->param2)
{
if (image_num == (image_count - 1))
- image_id = ep->param2->description->image.id;
+ {
+ image_id = _edje_image_find(ep->object, ed,
+ &ep->param2->set, ep->param2->description,
+ NULL);
+ }
else
{
Edje_Part_Image_Id *imid;
imid = eina_list_nth(ep->param2->description->image.tween_list,
image_num - 1);
- if (imid) image_id = imid->id;
+ image_id = _edje_image_find(ep->object, ed, NULL, NULL, imid);
}
}
if (image_id < 0)
EAPI Eet_Data_Descriptor *_edje_edd_edje_font_directory_entry = NULL;
EAPI Eet_Data_Descriptor *_edje_edd_edje_image_directory = NULL;
EAPI Eet_Data_Descriptor *_edje_edd_edje_image_directory_entry = NULL;
+EAPI Eet_Data_Descriptor *_edje_edd_edje_image_directory_set = NULL;
+EAPI Eet_Data_Descriptor *_edje_edd_edje_image_directory_set_entry = NULL;
EAPI Eet_Data_Descriptor *_edje_edd_edje_spectrum_directory = NULL;
EAPI Eet_Data_Descriptor *_edje_edd_edje_spectrum_directory_entry = NULL;
EAPI Eet_Data_Descriptor *_edje_edd_edje_spectrum_color = NULL;
FREED(_edje_edd_edje_part_description);
FREED(_edje_edd_edje_part_image_id);
FREED(_edje_edd_edje_external_param);
+ FREED(_edje_edd_edje_image_directory_set);
+ FREED(_edje_edd_edje_image_directory_set_entry);
}
void
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_image_directory_entry, Edje_Image_Directory_Entry, "source_param", source_param, EET_T_INT);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_image_directory_entry, Edje_Image_Directory_Entry, "id", id, EET_T_INT);
+ EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_Image_Directory_Set_Entry);
+ _edje_edd_edje_image_directory_set_entry =
+ eet_data_descriptor_file_new(&eddc);
+ EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_image_directory_set_entry, Edje_Image_Directory_Set_Entry, "name", name, EET_T_STRING);
+ EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_image_directory_set_entry, Edje_Image_Directory_Set_Entry, "id", id, EET_T_INT);
+ EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_image_directory_set_entry, Edje_Image_Directory_Set_Entry, "min.w", size.min.w, EET_T_INT);
+ EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_image_directory_set_entry, Edje_Image_Directory_Set_Entry, "min.h", size.min.h, EET_T_INT);
+ EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_image_directory_set_entry, Edje_Image_Directory_Set_Entry, "max.w", size.max.w, EET_T_INT);
+ EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_image_directory_set_entry, Edje_Image_Directory_Set_Entry, "max.h", size.max.h, EET_T_INT);
+
+ EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_Image_Directory_Set);
+ _edje_edd_edje_image_directory_set =
+ eet_data_descriptor_file_new(&eddc);
+ EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_image_directory_set, Edje_Image_Directory_Set, "name", name, EET_T_STRING);
+ EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_image_directory_set, Edje_Image_Directory_Set, "id", id, EET_T_INT);
+ EET_DATA_DESCRIPTOR_ADD_LIST(_edje_edd_edje_image_directory_set, Edje_Image_Directory_Set, "entries", entries, _edje_edd_edje_image_directory_set_entry);
+
EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_Image_Directory);
_edje_edd_edje_image_directory =
eet_data_descriptor_file_new(&eddc);
EET_DATA_DESCRIPTOR_ADD_LIST(_edje_edd_edje_image_directory, Edje_Image_Directory, "entries", entries, _edje_edd_edje_image_directory_entry);
+ EET_DATA_DESCRIPTOR_ADD_LIST(_edje_edd_edje_image_directory, Edje_Image_Directory, "sets", sets, _edje_edd_edje_image_directory_set);
/* spectrum directory */
EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_Spectrum_Color);
_edje_edd_edje_part_image_id =
eet_data_descriptor_file_new(&eddc);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_image_id, Edje_Part_Image_Id, "id", id, EET_T_INT);
+ EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_image_id, Edje_Part_Image_Id, "set", set, EET_T_UCHAR);
EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_External_Param);
_edje_edd_edje_external_param =
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "rel2.id_x", rel2.id_x, EET_T_INT);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "rel2.id_y", rel2.id_y, EET_T_INT);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "image.id", image.id, EET_T_INT);
+ EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "image.set", image.set, EET_T_UCHAR);
EET_DATA_DESCRIPTOR_ADD_LIST(_edje_edd_edje_part_description, Edje_Part_Description, "image.tween_list", image.tween_list, _edje_edd_edje_part_image_id);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Edje_Part_Description, "border.l", border.l, EET_T_INT);
_edje_collection_free_part_description_free(rp->custom->description, 0);
free(rp->drag);
+
+ if (rp->param2)
+ free(rp->param2->set);
eina_mempool_free(_edje_real_part_state_mp, rp->param2);
+
+ if (rp->custom)
+ free(rp->custom->set);
eina_mempool_free(_edje_real_part_state_mp, rp->custom);
_edje_unref(rp->edje);
int search;
//Code *cd;
- GET_ED_OR_RETURN(0);
+ GET_ED_OR_RETURN(EINA_FALSE);
//printf("ADD GROUP: %s \n", name);
/* check if a group with the same name already exists */
EINA_LIST_FOREACH(ed->file->collection_dir->entries, l, d)
if (!strcmp(d->entry, name))
- return 0;
+ return EINA_FALSE;
/* Create structs */
de = _alloc(sizeof(Edje_Part_Collection_Directory_Entry));
- if (!de) return 0;
+ if (!de) return EINA_FALSE;
pc = _alloc(sizeof(Edje_Part_Collection));
if (!pc)
{
free(de);
- return 0;
+ return EINA_FALSE;
}
/* Search first free id */
ed->file->collection_cache = eina_list_prepend(ed->file->collection_cache, pc);
_edje_cache_coll_clean(ed->file);
- return 1;
+ return EINA_TRUE;
}
/**
Eina_List *l;
Edje_Part_Collection_Directory_Entry *e;
- GET_ED_OR_RETURN(0);
+ GET_ED_OR_RETURN(EINA_FALSE);
EINA_LIST_FOREACH(ed->file->collection_dir->entries, l, e)
if (e->entry && !strcmp(e->entry, group))
- return 1;
- return 0;
+ return EINA_TRUE;
+ return EINA_FALSE;
}
EAPI Eina_Bool
Edje_Part_Collection *pc;
Edje_Part_Collection_Directory_Entry *pce;
- GET_ED_OR_RETURN(0);
+ GET_ED_OR_RETURN(EINA_FALSE);
- if (!new_name) return 0;
+ if (!new_name) return EINA_FALSE;
pc = ed->collection;
- if (!strcmp(pc->part, new_name)) return 1;
+ if (!strcmp(pc->part, new_name)) return EINA_TRUE;
- if (edje_edit_group_exist(obj, new_name)) return 0;
+ if (edje_edit_group_exist(obj, new_name)) return EINA_FALSE;
_edje_edit_group_references_update(obj, pc->part, new_name);
// eina_stringshare_del(pce->entry);
pce->entry = eina_stringshare_add(new_name);
- return 1;
+ return EINA_TRUE;
}
}
- return 0;
+ return EINA_FALSE;
}
EAPI int
Edje_Data *d;
Edje_Data *dd;
- GET_ED_OR_RETURN(0);
+ GET_ED_OR_RETURN(EINA_FALSE);
if (!itemname || !ed->file)
- return 0;
+ return EINA_FALSE;
EINA_LIST_FOREACH(ed->file->data, l, dd)
if (strcmp(dd->key, itemname) == 0)
- return 0;
+ return EINA_FALSE;
d = _alloc(sizeof(Edje_Data));
- if (!d) return 0;
+ if (!d) return EINA_FALSE;
d->key = (char*)eina_stringshare_add(itemname);
if (value) d->value = (char*)eina_stringshare_add(value);
ed->file->data = eina_list_append(ed->file->data, d);
- return 1;
+ return EINA_TRUE;
}
EAPI Eina_Bool
Eina_List *l;
Edje_Data *d;
- GET_ED_OR_RETURN(0);
+ GET_ED_OR_RETURN(EINA_FALSE);
if (!itemname || !ed->file || !ed->file->data)
return 0;
_edje_if_string_free(ed, d->value);
ed->file->data = eina_list_remove(ed->file->data, d);
free(d);
- return 1;
+ return EINA_TRUE;
}
}
- return 0;
+ return EINA_FALSE;
}
EAPI const char *
Eina_List *l;
Edje_Data *d;
- GET_ED_OR_RETURN(0);
+ GET_ED_OR_RETURN(EINA_FALSE);
if (!itemname || !value || !ed->file || !ed->file->data)
- return 0;
+ return EINA_FALSE;
EINA_LIST_FOREACH(ed->file->data, l, d)
if (strcmp(d->key, itemname) == 0)
{
_edje_if_string_free(ed, d->value);
d->value = (char*)eina_stringshare_add(value);
- return 1;
+ return EINA_TRUE;
}
- return 0;
+ return EINA_FALSE;
}
EAPI Eina_Bool
Eina_List *l;
Edje_Data *d;
- GET_ED_OR_RETURN(0);
+ GET_ED_OR_RETURN(EINA_FALSE);
if (!itemname || !newname || !ed->file || !ed->file->data)
- return 0;
+ return EINA_FALSE;
EINA_LIST_FOREACH(ed->file->data, l, d)
if (strcmp(d->key, itemname) == 0)
{
_edje_if_string_free(ed, d->key);
d->key = (char*)eina_stringshare_add(newname);
- return 1;
+ return EINA_TRUE;
}
- return 0;
+ return EINA_FALSE;
}
/***********************/
Eina_List *l;
Edje_Color_Class *cc;
- GET_ED_OR_RETURN(0);
+ GET_ED_OR_RETURN(EINA_FALSE);
if (!ed->file || !ed->file->color_classes)
- return 0;
+ return EINA_FALSE;
EINA_LIST_FOREACH(ed->file->color_classes, l, cc)
if (!strcmp(cc->name, class_name))
if (b3) *b3 = cc->b3;
if (a3) *a3 = cc->a3;
- return 1;
+ return EINA_TRUE;
}
- return 0;
+ return EINA_FALSE;
}
EAPI Eina_Bool
Eina_List *l;
Edje_Color_Class *cc;
- GET_ED_OR_RETURN(0);
+ GET_ED_OR_RETURN(EINA_FALSE);
if (!ed->file || !ed->file->color_classes)
- return 0;
+ return EINA_FALSE;
EINA_LIST_FOREACH(ed->file->color_classes, l, cc)
if (!strcmp(cc->name, class_name))
if (b3 > -1) cc->b3 = b3;
if (a3 > -1) cc->a3 = a3;
- return 1;
+ return EINA_TRUE;
}
- return 0;
+ return EINA_FALSE;
}
EAPI Eina_Bool
Edje_Color_Class *c;
Edje_Color_Class *cc;
- GET_ED_OR_RETURN(0);
+ GET_ED_OR_RETURN(EINA_FALSE);
if (!name || !ed->file)
- return 0;
+ return EINA_FALSE;
EINA_LIST_FOREACH(ed->file->color_classes, l, cc)
if (strcmp(cc->name, name) == 0)
- return 0;
+ return EINA_FALSE;
c = _alloc(sizeof(Edje_Color_Class));
- if (!c) return 0;
+ if (!c) return EINA_FALSE;
c->name = (char*)eina_stringshare_add(name);
c->r = c->g = c->b = c->a = 255;
ed->file->color_classes = eina_list_append(ed->file->color_classes, c);
- return 1;
+ return EINA_TRUE;
}
EAPI Eina_Bool
Eina_List *l;
Edje_Color_Class *cc;
- GET_ED_OR_RETURN(0);
+ GET_ED_OR_RETURN(EINA_FALSE);
if (!name || !ed->file || !ed->file->color_classes)
- return 0;
+ return EINA_FALSE;
EINA_LIST_FOREACH(ed->file->color_classes, l, cc)
if (strcmp(cc->name, name) == 0)
_edje_if_string_free(ed, cc->name);
ed->file->color_classes = eina_list_remove(ed->file->color_classes, cc);
free(cc);
- return 1;
+ return EINA_TRUE;
}
- return 0;
+ return EINA_FALSE;
}
EAPI Eina_Bool
Eina_List *l;
Edje_Color_Class *cc;
- GET_ED_OR_RETURN(0);
+ GET_ED_OR_RETURN(EINA_FALSE);
if (!ed->file || !ed->file->color_classes)
- return 0;
+ return EINA_FALSE;
EINA_LIST_FOREACH(ed->file->color_classes, l, cc)
if (!strcmp(cc->name, name))
{
_edje_if_string_free(ed, cc->name);
cc->name = (char*)eina_stringshare_add(newname);
- return 1;
+ return EINA_TRUE;
}
- return 0;
+ return EINA_FALSE;
}
edje_edit_style_add(Evas_Object * obj, const char* style)
{
Edje_Style *s;
- GET_ED_OR_RETURN(0);
+ GET_ED_OR_RETURN(EINA_FALSE);
//printf("ADD STYLE '%s'\n", style);
s = _edje_edit_style_get(ed, style);
- if (s) return 0;
+ if (s) return EINA_FALSE;
s = _alloc(sizeof(Edje_Style));
- if (!s) return 0;
+ if (!s) return EINA_FALSE;
s->name = (char*)eina_stringshare_add(style);
s->tags = NULL;
s->style = NULL;
ed->file->styles = eina_list_append(ed->file->styles, s);
- return 1;
+ return EINA_TRUE;
}
EAPI void
Edje_Style *s;
Edje_Style_Tag *t;
- GET_ED_OR_RETURN(0);
+ GET_ED_OR_RETURN(EINA_FALSE);
//printf("ADD TAG '%s' IN STYLE '%s'\n", tag_name, style);
t = _edje_edit_style_tag_get(ed, style, tag_name);
- if (t) return 0;
+ if (t) return EINA_FALSE;
s = _edje_edit_style_get(ed, style);
- if (!s) return 0;
+ if (!s) return EINA_FALSE;
t = _alloc(sizeof(Edje_Style_Tag));
- if (!t) return 0;
+ if (!t) return EINA_FALSE;
t->key = eina_stringshare_add(tag_name);
t->value = NULL;
t->font = NULL;
t->text_class = NULL;
s->tags = eina_list_append(s->tags, t);
- return 1;
+ return EINA_TRUE;
}
EAPI void
EAPI Eina_Bool
edje_edit_part_name_set(Evas_Object *obj, const char* part, const char* new_name)
{
- GET_RP_OR_RETURN(0);
+ GET_RP_OR_RETURN(EINA_FALSE);
- if (!new_name) return 0;
- if (!strcmp(part, new_name)) return 1;
- if (_edje_real_part_get(ed, new_name)) return 0;
+ if (!new_name) return EINA_FALSE;
+ if (!strcmp(part, new_name)) return EINA_TRUE;
+ if (_edje_real_part_get(ed, new_name)) return EINA_FALSE;
//printf("Set name of part: %s [new name: %s]\n", part, new_name);
_edje_if_string_free(ed, rp->part->name);
rp->part->name = (char *)eina_stringshare_add(new_name);
- return 1;
+ return EINA_TRUE;
}
Eina_Bool
Edje_Part *ep;
Edje_Real_Part *rp;
- GET_ED_OR_RETURN(0);
+ GET_ED_OR_RETURN(EINA_FALSE);
//printf("ADD PART: %s [type: %d]\n", name, type);
Edje_Part_Collection *pc;
int id;
- GET_RP_OR_RETURN(0);
+ GET_RP_OR_RETURN(EINA_FALSE);
//printf("REMOVE PART: %s\n", part);
EAPI Eina_Bool
edje_edit_part_exist(Evas_Object *obj, const char *part)
{
- GET_RP_OR_RETURN(0);
- return 1;
+ GET_RP_OR_RETURN(EINA_FALSE);
+ return EINA_TRUE;
}
EAPI const char*
Edje_Part_Collection *group;
Edje_Real_Part *prev;
- GET_RP_OR_RETURN(0);
+ GET_RP_OR_RETURN(EINA_FALSE);
//printf("RESTACK PART: %s BELOW\n", part);
- if (rp->part->id < 1) return 0;
+ if (rp->part->id < 1) return EINA_FALSE;
group = ed->collection;
/* update parts list */
if (rp->swallowed_object)
evas_object_stack_above(rp->swallowed_object, rp->object);
- return 1;
+ return EINA_TRUE;
}
EAPI Eina_Bool
Edje_Part_Collection *group;
Edje_Real_Part *next;
- GET_RP_OR_RETURN(0);
+ GET_RP_OR_RETURN(EINA_FALSE);
//printf("RESTACK PART: %s ABOVE\n", part);
- if (rp->part->id >= ed->table_parts_size - 1) return 0;
+ if (rp->part->id >= ed->table_parts_size - 1) return EINA_FALSE;
group = ed->collection;
if (rp->swallowed_object)
evas_object_stack_above(rp->swallowed_object, rp->object);
- return 1;
+ return EINA_TRUE;
}
EAPI Edje_Part_Type
{
Edje_Part_Description *pd;
- GET_RP_OR_RETURN(0);
+ GET_RP_OR_RETURN(EINA_FALSE);
pd = _edje_part_description_find_byname(eed, part, state, value);
- if (!pd) return 0;
+ if (!pd) return EINA_FALSE;
//printf("EDJE: Set state: %s %f\n", pd->state.name, pd->state.value);
_edje_part_description_apply(ed, rp, pd->state.name, pd->state.value, NULL, 0.0);
edje_object_calc_force(obj);
- return 1;
+ return EINA_TRUE;
}
EAPI const char *
Edje_Real_Part *clip;
Evas_Object *o, *oo;
- GET_RP_OR_RETURN(0);
+ GET_RP_OR_RETURN(EINA_FALSE);
/* unset clipping */
if (!clip_to)
edje_object_calc_force(obj);
- return 1;
+ return EINA_TRUE;
}
/* set clipping */
//printf("Set clip_to for part: %s [to: %s]\n", part, clip_to);
clip = _edje_real_part_get(ed, clip_to);
- if (!clip || !clip->part) return 0;
+ if (!clip || !clip->part) return EINA_FALSE;
o = clip->object;
while ((oo = evas_object_clip_get(o)))
{
if (o == rp->object)
- return 0;
+ return EINA_FALSE;
o = oo;
}
edje_object_calc_force(obj);
- return 1;
+ return EINA_TRUE;
}
EAPI Eina_Bool
edje_edit_part_mouse_events_get(Evas_Object *obj, const char *part)
{
- GET_RP_OR_RETURN(0);
+ GET_RP_OR_RETURN(EINA_FALSE);
//printf("Get mouse_events for part: %s [%d]\n", part, rp->part->mouse_events);
return rp->part->mouse_events;
}
EAPI Eina_Bool
edje_edit_part_repeat_events_get(Evas_Object *obj, const char *part)
{
- GET_RP_OR_RETURN(0);
+ GET_RP_OR_RETURN(EINA_FALSE);
//printf("Get repeat_events for part: %s [%d]\n", part, rp->part->repeat_events);
return rp->part->repeat_events;
EAPI Eina_Bool
edje_edit_part_source_set(Evas_Object *obj, const char *part, const char *source)
{
- GET_RP_OR_RETURN(0);
+ GET_RP_OR_RETURN(EINA_FALSE);
Evas_Object *child_obj;
//printf("Set source for part: %s [source: %s]\n", part, source);
if (rp->part->type == EDJE_PART_TYPE_EXTERNAL)
- return 0;
+ return EINA_FALSE;
_edje_if_string_free(ed, rp->part->source);
}
else
rp->part->source = NULL;
- return 1;
+ return EINA_TRUE;
}
EAPI int
int part_id;
int i;
- GET_PD_OR_RETURN(0);
+ GET_PD_OR_RETURN(EINA_FALSE);
//printf("Set name of state: %s in part: %s [new name: %s]\n",
// part, state, new_name);
EAPI Eina_Bool
edje_edit_state_exist(Evas_Object *obj, const char *part, const char *state, double value)
{
- GET_PD_OR_RETURN(0);
- return 1;
+ GET_PD_OR_RETURN(EINA_FALSE);
+ return EINA_TRUE;
}
EAPI Eina_Bool
Edje_Part_Image_Id *i;
Edje_External_Param *p;
Eina_List *l;
- GET_RP_OR_RETURN(0);
+ GET_RP_OR_RETURN(EINA_FALSE);
pdfrom = _edje_part_description_find_byname(eed, part, from, val_from);
if (!pdfrom)
- return 0;
+ return EINA_FALSE;
pdto = _edje_part_description_find_byname(eed, part, to, val_to);
if (!pdto)
{
pdto = _alloc(sizeof(Edje_Part_Description));
if (!pdto)
- return 0;
+ return EINA_FALSE;
/* No need to check for default desc, at this point it must exist */
rp->part->other_desc = eina_list_append(rp->part->other_desc, pdto);
pdto->state.name = eina_stringshare_add(to);
#undef PD_STRING_COPY
#undef PD_COPY
- return 1;
+ return EINA_TRUE;
}
//relative
EAPI Eina_Bool
edje_edit_state_visible_get(Evas_Object *obj, const char *part, const char *state, double value)
{
- GET_PD_OR_RETURN(0);
+ GET_PD_OR_RETURN(EINA_FALSE);
//printf("Get state visible flag of part: %s state: %s\n", part, state);
return pd->visible;
}
EAPI Eina_Bool
edje_edit_state_text_fit_x_get(Evas_Object *obj, const char *part, const char *state, double value)
{
- GET_PD_OR_RETURN(0);
+ GET_PD_OR_RETURN(EINA_FALSE);
//printf("GET TEXT_FIT_VERT of state: %s \n", state);
return pd->text.fit_x;
}
EAPI Eina_Bool
edje_edit_state_text_fit_y_get(Evas_Object *obj, const char *part, const char *state, double value)
{
- GET_PD_OR_RETURN(0);
+ GET_PD_OR_RETURN(EINA_FALSE);
//printf("GET TEXT_FIT_VERT of state: %s \n", state);
return pd->text.fit_y;
}
Edje_Image_Directory_Entry *de;
Edje_Image_Directory_Entry *i, *t;
- GET_ED_OR_RETURN(0);
+ GET_ED_OR_RETURN(EINA_FALSE);
- if (!name) return 0;
- if (!ed->file) return 0;
- if (!ed->path) return 0;
+ if (!name) return EINA_FALSE;
+ if (!ed->file) return EINA_FALSE;
+ if (!ed->path) return EINA_FALSE;
/* Create Image_Directory if not exist */
if (!ed->file->image_dir)
{
ed->file->image_dir = _alloc(sizeof(Edje_Image_Directory));
- if (!ed->file->image_dir) return 0;
+ if (!ed->file->image_dir) return EINA_FALSE;
}
/* Loop trough image directory to find if image exist */
t = NULL;
EINA_LIST_FOREACH(ed->file->image_dir->entries, l, i)
{
- if (!i) return 0;
+ if (!i) return EINA_FALSE;
if (i->id == id) t = i;
}
if (!t)
{
de = _alloc(sizeof(Edje_Image_Directory_Entry));
- if (!de) return 0;
+ if (!de) return EINA_FALSE;
}
else
{
ed->file->image_dir->entries =
eina_list_append(ed->file->image_dir->entries, de);
- return 1;
+ return EINA_TRUE;
}
EAPI int
Edje_Part_Image_Id *i;
int id;
- GET_PD_OR_RETURN(0);
+ GET_PD_OR_RETURN(EINA_FALSE);
id = _edje_image_id_find(obj, tween);
- if (id < 0) return 0;
+ if (id < EINA_FALSE) return 0;
/* alloc Edje_Part_Image_Id */
i = _alloc(sizeof(Edje_Part_Image_Id));
- if (!i) return 0;
+ if (!i) return EINA_FALSE;
i->id = id;
/* add to tween list */
pd->image.tween_list = eina_list_append(pd->image.tween_list, i);
- return 1;
+ return EINA_TRUE;
}
EAPI Eina_Bool
Edje_Part_Image_Id *i;
int id;
- GET_PD_OR_RETURN(0);
+ GET_PD_OR_RETURN(EINA_FALSE);
- if (!pd->image.tween_list) return 0;
+ if (!pd->image.tween_list) return EINA_FALSE;
id = _edje_image_id_find(obj, tween);
- if (id < 0) return 0;
+ if (id < 0) return EINA_FALSE;
EINA_LIST_FOREACH(pd->image.tween_list, l, i)
{
if (i->id == id)
{
pd->image.tween_list = eina_list_remove_list(pd->image.tween_list, l);
- return 1;
+ return EINA_TRUE;
}
}
- return 0;
+ return EINA_FALSE;
}
EAPI void
EAPI Eina_Bool
edje_edit_spectra_add(Evas_Object *obj, const char* name)
{
- GET_ED_OR_RETURN(0);
+ GET_ED_OR_RETURN(EINA_FALSE);
//printf("SPECTRA ADD [new name:%s]\n", name);
Edje_Spectrum_Directory_Entry *s;
- if (!ed->file) return 0;
+ if (!ed->file) return EINA_FALSE;
- if (_edje_edit_spectrum_entry_get(ed, name)) return 0;
+ if (_edje_edit_spectrum_entry_get(ed, name)) return EINA_FALSE;
if (!ed->file->spectrum_dir)
{
ed->file->spectrum_dir = _alloc(sizeof(Edje_Spectrum_Directory));
- if (!ed->file->spectrum_dir) return 0;
+ if (!ed->file->spectrum_dir) return EINA_FALSE;
}
s = _alloc(sizeof(Edje_Spectrum_Directory_Entry));
- if (!s) return 0;
+ if (!s) return EINA_FALSE;
ed->file->spectrum_dir->entries = eina_list_append(ed->file->spectrum_dir->entries, s);
s->id = eina_list_count(ed->file->spectrum_dir->entries) - 1; //TODO Search for id holes
s->entry = (char*)eina_stringshare_add(name);
s->filename = NULL;
s->color_list = NULL;
- return 1;
+ return EINA_TRUE;
}
EAPI Eina_Bool
{
Edje_Spectrum_Directory_Entry *s;
- GET_ED_OR_RETURN(0);
+ GET_ED_OR_RETURN(EINA_FALSE);
s = _edje_edit_spectrum_entry_get(ed, spectra);
- if (!s) return 0;
+ if (!s) return EINA_FALSE;
//printf("SPECTRA DEL %s\n", spectra);
}
free(s);
- return 1;
+ return EINA_TRUE;
}
EAPI Eina_Bool
{
Edje_Spectrum_Directory_Entry *s;
- GET_ED_OR_RETURN(0);
+ GET_ED_OR_RETURN(EINA_FALSE);
//printf("SET SPECTRA NAME for spectra: %s [new name:%s]\n", spectra, name);
s = _edje_edit_spectrum_entry_get(ed, spectra);
- if (!s) return 0;
+ if (!s) return EINA_FALSE;
_edje_if_string_free(ed, s->entry);
s->entry = (char*)eina_stringshare_add(name);
- return 1;
+ return EINA_TRUE;
}
EAPI int
{
Edje_Spectrum_Directory_Entry *s;
- GET_ED_OR_RETURN(0);
+ GET_ED_OR_RETURN(EINA_FALSE);
//printf("GET SPECTRA STOP NUM for spectra: %s\n", spectra);
s = _edje_edit_spectrum_entry_get(ed, spectra);
- if (!s) return 0;
+ if (!s) return EINA_FALSE;
return eina_list_count(s->color_list);
}
{
Edje_Spectrum_Directory_Entry *s;
Edje_Spectrum_Color *color;
- GET_ED_OR_RETURN(0);
+ GET_ED_OR_RETURN(EINA_FALSE);
//printf("SET SPECTRA STOP NUM for spectra: %s\n", spectra);
s = _edje_edit_spectrum_entry_get(ed, spectra);
- if (!s) return 0;
+ if (!s) return EINA_FALSE;
- if (num == eina_list_count(s->color_list)) return 1;
+ if (num == eina_list_count(s->color_list)) return EINA_TRUE;
//destroy all colors
while (s->color_list)
while (num)
{
color = _alloc(sizeof(Edje_Spectrum_Color));
- if (!color) return 0;
+ if (!color) return EINA_FALSE;
s->color_list = eina_list_append(s->color_list, color);
color->r = 255;
color->g = 255;
num--;
}
- return 1;
+ return EINA_TRUE;
}
EAPI Eina_Bool
{
Edje_Spectrum_Directory_Entry *s;
Edje_Spectrum_Color *color;
- GET_ED_OR_RETURN(0);
+ GET_ED_OR_RETURN(EINA_FALSE);
s = _edje_edit_spectrum_entry_get(ed, spectra);
- if (!s) return 0;
+ if (!s) return EINA_FALSE;
//printf("GET SPECTRA STOP COLOR for spectra: %s stopn: %d\n", spectra, stop_number);
color = eina_list_nth(s->color_list, stop_number);
- if (!color) return 0;
+ if (!color) return EINA_FALSE;
if (r) *r = color->r;
if (g) *g = color->g;
if (b) *b = color->b;
if (a) *a = color->a;
if (d) *d = color->d;
- return 1;
+ return EINA_TRUE;
}
EAPI Eina_Bool
{
Edje_Spectrum_Directory_Entry *s;
Edje_Spectrum_Color *color;
- GET_ED_OR_RETURN(0);
+ GET_ED_OR_RETURN(EINA_FALSE);
s = _edje_edit_spectrum_entry_get(ed, spectra);
- if (!s) return 0;
+ if (!s) return EINA_FALSE;
//printf("SET SPECTRA STOP COLOR for spectra: %s stopn: %d\n", spectra, stop_number);
color = eina_list_nth(s->color_list, stop_number);
- if (!color) return 0;
+ if (!color) return EINA_FALSE;
color->r = r;
color->g = g;
color->b = b;
edje_object_calc_force(obj);
- return 1;
+ return EINA_TRUE;
}
EAPI Eina_Bool
edje_edit_state_gradient_type_set(Evas_Object *obj, const char *part, const char *state, double value, const char *type)
{
- GET_PD_OR_RETURN(0);
- if (!type) return 0;
+ GET_PD_OR_RETURN(EINA_FALSE);
+ if (!type) return EINA_FALSE;
// printf("SET GRADIENT TYPE for part: %s state: %s TO: %s\n", part, state, type);
_edje_if_string_free(ed, pd->gradient.type);
pd->gradient.type = (char *)eina_stringshare_add(type);
edje_object_calc_force(obj);
- return 1;
+ return EINA_TRUE;
}
EAPI Eina_Bool
edje_edit_state_gradient_use_fill_get(Evas_Object *obj, const char *part, const char *state, double value)
{
- GET_PD_OR_RETURN(-1);
+ GET_PD_OR_RETURN(EINA_FALSE);
if (!pd->gradient.type)
- return -1;
+ return EINA_FALSE;
//~ if (!strcmp(pd->gradient.type, "linear"))
//~ return 0;
- return 1;
+ return EINA_TRUE;
}
EAPI const char *
{
Edje_Spectrum_Directory_Entry *s;
- GET_PD_OR_RETURN(0);
+ GET_PD_OR_RETURN(EINA_FALSE);
//printf("SET GRADIENT SPECTRA for part: %s state: %s [%s]\n", part, state, spectra);
s = _edje_edit_spectrum_entry_get(ed, spectra);
- if (!s) return 0;
+ if (!s) return EINA_FALSE;
pd->gradient.id = s->id;
edje_object_calc_force(obj);
- return 1;
+ return EINA_TRUE;
}
EAPI int
EAPI Eina_Bool
edje_edit_state_gradient_rel1_relative_x_set(Evas_Object *obj, const char *part, const char *state, double value, double val)
{
- GET_PD_OR_RETURN(0);
+ GET_PD_OR_RETURN(EINA_FALSE);
//printf("SET GRADIENT REL1 RELX for part: %s state: %s [TO %f]\n", part, state, val);
pd->gradient.rel1.relative_x = FROM_DOUBLE(val);
edje_object_calc_force(obj);
- return 1;
+ return EINA_TRUE;
}
EAPI Eina_Bool
edje_edit_state_gradient_rel1_relative_y_set(Evas_Object *obj, const char *part, const char *state, double value, double val)
{
- GET_PD_OR_RETURN(0);
+ GET_PD_OR_RETURN(EINA_FALSE);
//printf("SET GRADIENT REL1 RELY for part: %s state: %s [TO %f]\n", part, state, val);
pd->gradient.rel1.relative_y = FROM_DOUBLE(val);
edje_object_calc_force(obj);
- return 1;
+ return EINA_TRUE;
}
EAPI Eina_Bool
edje_edit_state_gradient_rel2_relative_x_set(Evas_Object *obj, const char *part, const char *state, double value, double val)
{
- GET_PD_OR_RETURN(0);
+ GET_PD_OR_RETURN(EINA_FALSE);
//printf("SET GRADIENT REL2 RELX for part: %s state: %s [TO %f]\n", part, state, val);
pd->gradient.rel2.relative_x = FROM_DOUBLE(val);
edje_object_calc_force(obj);
- return 1;
+ return EINA_TRUE;
}
EAPI Eina_Bool
edje_edit_state_gradient_rel2_relative_y_set(Evas_Object *obj, const char *part, const char *state, double value, double val)
{
- GET_PD_OR_RETURN(0);
+ GET_PD_OR_RETURN(EINA_FALSE);
//printf("SET GRADIENT REL2 RELY for part: %s state: %s [TO %f]\n", part, state, val);
pd->gradient.rel2.relative_y = FROM_DOUBLE(val);
edje_object_calc_force(obj);
- return 1;
+ return EINA_TRUE;
}
EAPI int
EAPI Eina_Bool
edje_edit_state_gradient_rel1_offset_x_set(Evas_Object *obj, const char *part, const char *state, double value, int val)
{
- GET_PD_OR_RETURN(0);
+ GET_PD_OR_RETURN(EINA_FALSE);
//printf("SET GRADIENT REL1 OFFSETX for part: %s state: %s [TO %d]\n", part, state, val);
pd->gradient.rel1.offset_x = val;
edje_object_calc_force(obj);
- return 1;
+ return EINA_TRUE;
}
EAPI Eina_Bool
edje_edit_state_gradient_rel1_offset_y_set(Evas_Object *obj, const char *part, const char *state, double value, int val)
{
- GET_PD_OR_RETURN(0);
+ GET_PD_OR_RETURN(EINA_FALSE);
//printf("SET GRADIENT REL1 OFFSETY for part: %s state: %s [TO %d]\n", part, state, val);
pd->gradient.rel1.offset_y = val;
edje_object_calc_force(obj);
- return 1;
+ return EINA_TRUE;
}
EAPI Eina_Bool
edje_edit_state_gradient_rel2_offset_x_set(Evas_Object *obj, const char *part, const char *state, double value, int val)
{
- GET_PD_OR_RETURN(0);
+ GET_PD_OR_RETURN(EINA_FALSE);
//printf("SET GRADIENT REL2 OFFSETX for part: %s state: %s [TO %d]\n", part, state, val);
pd->gradient.rel2.offset_x = val;
edje_object_calc_force(obj);
- return 1;
+ return EINA_TRUE;
}
EAPI Eina_Bool
edje_edit_state_gradient_rel2_offset_y_set(Evas_Object *obj, const char *part, const char *state, double value, int val)
{
- GET_PD_OR_RETURN(0);
+ GET_PD_OR_RETURN(EINA_FALSE);
//printf("SET GRADIENT REL2 OFFSETY for part: %s state: %s [TO %d]\n", part, state, val);
pd->gradient.rel2.offset_y = val;
edje_object_calc_force(obj);
- return 1;
+ return EINA_TRUE;
}
/******************/
Edje_Program *epr;
Edje_Part_Collection *pc;
- GET_ED_OR_RETURN(0);
+ GET_ED_OR_RETURN(EINA_FALSE);
//printf("ADD PROGRAM [new name: %s]\n", name);
//Check if program already exists
if (_edje_program_get_byname(obj, name))
- return 0;
+ return EINA_FALSE;
//Alloc Edje_Program or return
epr = _alloc(sizeof(Edje_Program));
- if (!epr) return 0;
+ if (!epr) return EINA_FALSE;
//Add program to group
pc = ed->collection;
_edje_programs_patterns_clean(ed);
_edje_programs_patterns_init(ed);
- return 1;
+ return EINA_TRUE;
}
EAPI Eina_Bool
EAPI Eina_Bool
edje_edit_program_exist(Evas_Object *obj, const char *prog)
{
- GET_EPR_OR_RETURN(0);
+ GET_EPR_OR_RETURN(EINA_FALSE);
- return 1;
+ return EINA_TRUE;
}
EAPI Eina_Bool
edje_edit_program_run(Evas_Object *obj, const char *prog)
{
- GET_ED_OR_RETURN(0);
- GET_EPR_OR_RETURN(0);
+ GET_ED_OR_RETURN(EINA_FALSE);
+ GET_EPR_OR_RETURN(EINA_FALSE);
_edje_program_run(ed, epr, 0, "", "");
- return 1;
+ return EINA_TRUE;
}
EAPI Eina_Bool
edje_edit_program_name_set(Evas_Object *obj, const char *prog, const char* new_name)
{
- GET_ED_OR_RETURN(0);
- GET_EPR_OR_RETURN(0);
+ GET_ED_OR_RETURN(EINA_FALSE);
+ GET_EPR_OR_RETURN(EINA_FALSE);
- if (!new_name) return 0;
+ if (!new_name) return EINA_FALSE;
- if (_edje_program_get_byname(obj, new_name)) return 0;
+ if (_edje_program_get_byname(obj, new_name)) return EINA_FALSE;
//printf("SET NAME for program: %s [new name: %s]\n", prog, new_name);
_edje_if_string_free(ed, epr->name);
epr->name = eina_stringshare_add(new_name);
- return 1;
+ return EINA_TRUE;
}
EAPI const char *
EAPI Eina_Bool
edje_edit_program_source_set(Evas_Object *obj, const char *prog, const char *source)
{
- GET_ED_OR_RETURN(0);
- GET_EPR_OR_RETURN(0);
+ GET_ED_OR_RETURN(EINA_FALSE);
+ GET_EPR_OR_RETURN(EINA_FALSE);
- if (!source) return 0;
+ if (!source) return EINA_FALSE;
//printf("SET SOURCE for program: %s [%s]\n", prog, source);
edje_match_patterns_free(ed->patterns.programs.sources_patterns);
ed->patterns.programs.sources_patterns = edje_match_programs_source_init(ed->collection->programs);
- return 1;
+ return EINA_TRUE;
}
EAPI const char *
EAPI Eina_Bool
edje_edit_program_filter_part_set(Evas_Object *obj, const char *prog, const char *filter_part)
{
- GET_ED_OR_RETURN(0);
- GET_EPR_OR_RETURN(0);
+ GET_ED_OR_RETURN(EINA_FALSE);
+ GET_EPR_OR_RETURN(EINA_FALSE);
- if (!filter_part) return 0;
+ if (!filter_part) return EINA_FALSE;
_edje_if_string_free(ed, epr->filter.part);
epr->filter.part = eina_stringshare_add(filter_part);
- return 1;
+ return EINA_TRUE;
}
EAPI const char *
EAPI Eina_Bool
edje_edit_program_filter_state_set(Evas_Object *obj, const char *prog, const char *filter_state)
{
- GET_ED_OR_RETURN(0);
- GET_EPR_OR_RETURN(0);
+ GET_ED_OR_RETURN(EINA_FALSE);
+ GET_EPR_OR_RETURN(EINA_FALSE);
- if (!filter_state) return 0;
+ if (!filter_state) return EINA_FALSE;
_edje_if_string_free(ed, epr->filter.state);
epr->filter.state = eina_stringshare_add(filter_state);
- return 1;
+ return EINA_TRUE;
}
EAPI const char *
EAPI Eina_Bool
edje_edit_program_signal_set(Evas_Object *obj, const char *prog, const char *signal)
{
- GET_ED_OR_RETURN(0);
- GET_EPR_OR_RETURN(0);
+ GET_ED_OR_RETURN(EINA_FALSE);
+ GET_EPR_OR_RETURN(EINA_FALSE);
- if (!signal) return 0;
+ if (!signal) return EINA_FALSE;
//printf("SET SIGNAL for program: %s [%s]\n", prog, signal);
edje_match_patterns_free(ed->patterns.programs.signals_patterns);
ed->patterns.programs.signals_patterns = edje_match_programs_signal_init(ed->collection->programs);
- return 1;
+ return EINA_TRUE;
}
EAPI const char *
EAPI Eina_Bool
edje_edit_program_state_set(Evas_Object *obj, const char *prog, const char *state)
{
- GET_ED_OR_RETURN(0);
- GET_EPR_OR_RETURN(0);
+ GET_ED_OR_RETURN(EINA_FALSE);
+ GET_EPR_OR_RETURN(EINA_FALSE);
//printf("SET STATE for program: %s\n", prog);
_edje_if_string_free(ed, epr->state);
epr->state = eina_stringshare_add(state);
- return 1;
+ return EINA_TRUE;
}
EAPI const char *
EAPI Eina_Bool
edje_edit_program_state2_set(Evas_Object *obj, const char *prog, const char *state2)
{
- GET_ED_OR_RETURN(0);
- GET_EPR_OR_RETURN(0);
+ GET_ED_OR_RETURN(EINA_FALSE);
+ GET_EPR_OR_RETURN(EINA_FALSE);
//printf("SET STATE2 for program: %s\n", prog);
_edje_if_string_free(ed, epr->state2);
epr->state2 = eina_stringshare_add(state2);
- return 1;
+ return EINA_TRUE;
}
EAPI double
EAPI Eina_Bool
edje_edit_program_value_set(Evas_Object *obj, const char *prog, double value)
{
- GET_EPR_OR_RETURN(0);
+ GET_EPR_OR_RETURN(EINA_FALSE);
//printf("SET VALUE for program: %s [%.2f]\n", prog, value);
epr->value = value;
- return 1;
+ return EINA_TRUE;
}
EAPI double
EAPI Eina_Bool
edje_edit_program_value2_set(Evas_Object *obj, const char *prog, double value)
{
- GET_EPR_OR_RETURN(0);
+ GET_EPR_OR_RETURN(EINA_FALSE);
//printf("SET VALUE for program: %s [%.2f]\n", prog, value);
epr->value2 = value;
- return 1;
+ return EINA_TRUE;
}
EAPI double
EAPI Eina_Bool
edje_edit_program_in_from_set(Evas_Object *obj, const char *prog, double seconds)
{
- GET_EPR_OR_RETURN(0);
+ GET_EPR_OR_RETURN(EINA_FALSE);
//printf("SET IN.FROM for program: %s [%f]\n", prog, epr->in.from);
epr->in.from = seconds;
- return 1;
+ return EINA_TRUE;
}
EAPI double
EAPI Eina_Bool
edje_edit_program_in_range_set(Evas_Object *obj, const char *prog, double seconds)
{
- GET_EPR_OR_RETURN(0);
+ GET_EPR_OR_RETURN(EINA_FALSE);
//printf("SET IN.RANGE for program: %s [%f]\n", prog, epr->in.range);
epr->in.range = seconds;
- return 1;
+ return EINA_TRUE;
}
EAPI Edje_Tween_Mode
EAPI Eina_Bool
edje_edit_program_transition_set(Evas_Object *obj, const char *prog, Edje_Tween_Mode transition)
{
- GET_EPR_OR_RETURN(0);
+ GET_EPR_OR_RETURN(EINA_FALSE);
//printf("GET TRANSITION for program: %s [%d]\n", prog, epr->tween.mode);
epr->tween.mode = transition;
- return 1;
+ return EINA_TRUE;
}
EAPI double
EAPI Eina_Bool
edje_edit_program_transition_time_set(Evas_Object *obj, const char *prog, double seconds)
{
- GET_EPR_OR_RETURN(0);
+ GET_EPR_OR_RETURN(EINA_FALSE);
//printf("GET TRANSITION_TIME for program: %s [%.4f]\n", prog, epr->tween.time);
epr->tween.time = FROM_DOUBLE(seconds);
- return 1;
+ return EINA_TRUE;
}
EAPI Edje_Action_Type
EAPI Eina_Bool
edje_edit_program_action_set(Evas_Object *obj, const char *prog, Edje_Action_Type action)
{
- GET_EPR_OR_RETURN(0);
+ GET_EPR_OR_RETURN(EINA_FALSE);
//printf("SET ACTION for program: %s [%d]\n", prog, action);
- if (action >= EDJE_ACTION_TYPE_LAST) return 0;
+ if (action >= EDJE_ACTION_TYPE_LAST) return EINA_FALSE;
epr->action = action;
- return 1;
+ return EINA_TRUE;
}
EAPI Eina_List *
EAPI Eina_Bool
edje_edit_program_targets_clear(Evas_Object *obj, const char *prog)
{
- GET_EPR_OR_RETURN(0);
+ GET_EPR_OR_RETURN(EINA_FALSE);
while (epr->targets)
{
free(prt);
}
- return 1;
+ return EINA_TRUE;
}
EAPI Eina_Bool
int id;
Edje_Program_Target *t;
- GET_ED_OR_RETURN(0);
- GET_EPR_OR_RETURN(0);
+ GET_ED_OR_RETURN(EINA_FALSE);
+ GET_EPR_OR_RETURN(EINA_FALSE);
if (epr->action == EDJE_ACTION_TYPE_STATE_SET)
{
Edje_Real_Part *rp;
rp = _edje_real_part_get(ed, target);
- if (!rp) return 0;
+ if (!rp) return EINA_FALSE;
id = rp->part->id;
}
else if (epr->action == EDJE_ACTION_TYPE_ACTION_STOP)
Edje_Program *tar;
tar = _edje_program_get_byname(obj, target);
- if (!tar) return 0;
+ if (!tar) return EINA_FALSE;
id = tar->id;
}
else
- return 0;
+ return EINA_FALSE;
t = _alloc(sizeof(Edje_Program_Target));
- if (!t) return 0;
+ if (!t) return EINA_FALSE;
t->id = id;
epr->targets = eina_list_append(epr->targets, t);
- return 1;
+ return EINA_TRUE;
}
EAPI Eina_Bool
EAPI Eina_Bool
edje_edit_program_afters_clear(Evas_Object *obj, const char *prog)
{
- GET_EPR_OR_RETURN(0);
+ GET_EPR_OR_RETURN(EINA_FALSE);
while (epr->after)
{
free(pa);
}
- return 1;
+ return EINA_TRUE;
}
EAPI Eina_Bool
Edje_Program *af;
Edje_Program_After *a;
- GET_EPR_OR_RETURN(0);
+ GET_EPR_OR_RETURN(EINA_FALSE);
af = _edje_program_get_byname(obj, after);
- if (!af) return 0;
+ if (!af) return EINA_FALSE;
a = _alloc(sizeof(Edje_Program_After));
- if (!a) return 0;
+ if (!a) return EINA_FALSE;
a->id = af->id;
epr->after = eina_list_append(epr->after, a);
- return 1;
+ return EINA_TRUE;
}
EAPI Eina_Bool
return 0;
}
+ memset(rp->custom, 0, sizeof (Edje_Real_Part_State));
+
*d = *parent;
d->state.name = (char *)eina_stringshare_add("custom");
}
void
-_edje_embryo_script_init(Edje *ed)
+_edje_embryo_script_init(Edje_Part_Collection *edc)
{
Embryo_Program *ep;
- if (!ed) return;
- if (!ed->collection) return;
- if (!ed->collection->script) return;
- ep = ed->collection->script;
- embryo_program_data_set(ep, ed);
+ if (!edc) return;
+ if (!edc->script) return;
+
+ ep = edc->script;
/* first advertise all the edje "script" calls */
embryo_program_native_call_add(ep, "get_int", _edje_embryo_fn_get_int);
embryo_program_native_call_add(ep, "set_int", _edje_embryo_fn_set_int);
embryo_program_native_call_add(ep, "external_param_set_choice", _edje_embryo_fn_external_param_set_choice);
embryo_program_native_call_add(ep, "external_param_get_bool", _edje_embryo_fn_external_param_get_bool);
embryo_program_native_call_add(ep, "external_param_set_bool", _edje_embryo_fn_external_param_set_bool);
-
-// embryo_program_vm_push(ed->collection->script);
-// _edje_embryo_globals_init(ed);
}
void
-_edje_embryo_script_shutdown(Edje *ed)
+_edje_embryo_script_shutdown(Edje_Part_Collection *edc)
{
- if (!ed) return;
- if (!ed->collection) return;
- if (!ed->collection->script) return;
- if (embryo_program_recursion_get(ed->collection->script) > 0) return;
-// embryo_program_vm_pop(ed->collection->script);
- embryo_program_free(ed->collection->script);
- ed->collection->script = NULL;
+ if (!edc) return;
+ if (!edc->script) return;
+ if (embryo_program_recursion_get(edc->script) > 0) return;
+ embryo_program_free(edc->script);
+ edc->script = NULL;
}
void
#endif
}
+// need one for markup and format too - how to do it? extra type param?
+static void
+_text_filter_prepend(Entry *en, const char *text)
+{
+ char *text2;
+ Edje_Text_Insert_Filter_Callback *cb;
+ Eina_List *l;
+
+ text2 = strdup(text);
+ EINA_LIST_FOREACH(en->rp->edje->text_insert_filter_callbacks, l, cb)
+ {
+ if (!strcmp(cb->part, en->rp->part->name))
+ {
+ cb->func(cb->data, en->rp->edje->obj, cb->part, &text2);
+ if (!text2) break;
+ }
+ }
+ if (text2)
+ {
+ evas_textblock_cursor_text_prepend(en->cursor, text2);
+// evas_textblock_cursor_format_prepend(en->cursor, text2);
+// evas_object_textblock_text_markup_prepend(en->cursor, text2);
+ free(text2);
+ }
+}
+
static void
_curs_update_from_curs(Evas_Textblock_Cursor *c, Evas_Object *o __UNUSED__, Entry *en)
{
}
else
{
+ //yy
evas_textblock_cursor_format_prepend(en->cursor, "\t");
_curs_update_from_curs(en->cursor, rp->object, en);
_anchors_get(en->cursor, rp->object, en);
if (en->have_selection)
_range_del(en->cursor, rp->object, en);
_sel_clear(en->cursor, rp->object, en);
+ //yy
evas_textblock_cursor_format_prepend(en->cursor, "\n");
_curs_update_from_curs(en->cursor, rp->object, en);
_anchors_get(en->cursor, rp->object, en);
if (en->have_selection)
_range_del(en->cursor, rp->object, en);
_sel_clear(en->cursor, rp->object, en);
+ //zz
evas_textblock_cursor_text_prepend(en->cursor, ev->string);
_curs_update_from_curs(en->cursor, rp->object, en);
_anchors_get(en->cursor, rp->object, en);
if (en->have_selection)
_range_del(en->cursor, rp->object, en);
_sel_clear(en->cursor, rp->object, en);
+ //xx
evas_object_textblock_text_markup_prepend(en->cursor, text);
_curs_update_from_curs(en->cursor, rp->object, en);
_anchors_get(en->cursor, rp->object, en);
Eina_List *l;
Anchor *an;
- if (!en) return 0;
+ if (!en) return EINA_FALSE;
EINA_LIST_FOREACH(en->anchors, l, an)
{
if (an->item) continue;
if (!strcmp(item, an->name))
{
evas_textblock_cursor_format_item_geometry_get(an->start, cx, cy, cw, ch);
- return 1;
+ return EINA_TRUE;
}
}
- return 0;
+ return EINA_FALSE;
}
const Eina_List *
{
Entry *en = rp->entry_data;
Evas_Textblock_Cursor *c = _cursor_get(rp, cur);
- if (!c) return 0;
+ if (!c) return EINA_FALSE;
if (!evas_textblock_cursor_char_next(c))
{
evas_textblock_cursor_eol_set(c, 0);
if (evas_textblock_cursor_node_next(c)) goto ok;
- else return 0;
+ else return EINA_FALSE;
}
ok:
_curs_update_from_curs(c, rp->object, rp->entry_data);
_edje_emit(rp->edje, "cursor,changed", rp->part->name);
_edje_entry_real_part_configure(rp);
- return 1;
+ return EINA_TRUE;
}
Eina_Bool
{
Entry *en = rp->entry_data;
Evas_Textblock_Cursor *c = _cursor_get(rp, cur);
- if (!c) return 0;
+ if (!c) return EINA_FALSE;
if (!evas_textblock_cursor_char_prev(c))
{
if (evas_textblock_cursor_node_prev(c)) goto ok;
- else return 0;
+ else return EINA_FALSE;
}
ok:
_curs_update_from_curs(c, rp->object, rp->entry_data);
_edje_emit(rp->edje, "cursor,changed", rp->part->name);
_edje_entry_real_part_configure(rp);
- return 1;
+ return EINA_TRUE;
}
Eina_Bool
Evas_Textblock_Cursor *c = _cursor_get(rp, cur);
Evas_Coord lx, ly, lw, lh, cx, cy, cw, ch;
int ln;
- if (!c) return 0;
+ if (!c) return EINA_FALSE;
ln = evas_textblock_cursor_line_geometry_get(c, NULL, NULL, NULL, NULL);
ln--;
- if (ln < 0) return 0;
+ if (ln < 0) return EINA_FALSE;
if (!evas_object_textblock_line_number_geometry_get(rp->object, ln,
&lx, &ly, &lw, &lh))
- return 0;
+ return EINA_FALSE;
evas_textblock_cursor_char_geometry_get(c, &cx, &cy, &cw, &ch);
if (!evas_textblock_cursor_char_coord_set(c, cx, ly + (lh / 2)))
{
_edje_emit(rp->edje, "cursor,changed", rp->part->name);
_edje_entry_real_part_configure(rp);
- return 1;
+ return EINA_TRUE;
}
Eina_Bool
Evas_Textblock_Cursor *c = _cursor_get(rp, cur);
Evas_Coord lx, ly, lw, lh, cx, cy, cw, ch;
int ln;
- if (!c) return 0;
+ if (!c) return EINA_FALSE;
ln = evas_textblock_cursor_line_geometry_get(c, NULL, NULL, NULL, NULL);
ln++;
if (!evas_object_textblock_line_number_geometry_get(rp->object, ln,
&lx, &ly, &lw, &lh))
- return 0;
+ return EINA_FALSE;
evas_textblock_cursor_char_geometry_get(c, &cx, &cy, &cw, &ch);
if (!evas_textblock_cursor_char_coord_set(c, cx, ly + (lh / 2)))
{
_edje_emit(rp->edje, "cursor,changed", rp->part->name);
_edje_entry_real_part_configure(rp);
- return 1;
+ return EINA_TRUE;
}
void
Entry *en = rp->entry_data;
Evas_Textblock_Cursor *c = _cursor_get(rp, cur);
if (!c) return;
- evas_textblock_cursor_node_last(c);
- _curs_update_from_curs(c, rp->object, rp->entry_data);
+ _curs_end(c, rp->object, rp->entry_data);
_sel_update(c, rp->object, rp->entry_data);
#ifdef HAVE_ECORE_IMF
_edje_entry_cursor_is_format_get(Edje_Real_Part *rp, Edje_Cursor cur)
{
Evas_Textblock_Cursor *c = _cursor_get(rp, cur);
- if (!c) return 0;
- if (evas_textblock_cursor_node_format_get(c)) return 1;
- return 0;
+ if (!c) return EINA_FALSE;
+ if (evas_textblock_cursor_node_format_get(c)) return EINA_TRUE;
+ return EINA_FALSE;
}
Eina_Bool
_edje_entry_cursor_is_visible_format_get(Edje_Real_Part *rp, Edje_Cursor cur)
{
Evas_Textblock_Cursor *c = _cursor_get(rp, cur);
- if (!c) return 0;
+ if (!c) return EINA_FALSE;
return evas_textblock_cursor_node_format_is_visible_get(c);
}
en->have_composition = EINA_FALSE;
}
+ //yy
evas_textblock_cursor_text_prepend(en->cursor, ev->str);
_curs_update_from_curs(en->cursor, rp->object, en);
en->have_composition = EINA_TRUE;
- evas_object_textblock_text_markup_prepend (en->cursor, preedit_string);
+ //xx
+ evas_object_textblock_text_markup_prepend(en->cursor, preedit_string);
_sel_extend(en->cursor, rp->object, en);
Edje_File *edf;
int error_ret = 0;
- if ((!file) || (!*file)) return 0;
+ if ((!file) || (!*file)) return EINA_FALSE;
edf = _edje_cache_file_coll_open(file, NULL, &error_ret, NULL);
if (edf != NULL)
{
{
edje_match_patterns_free(patterns);
_edje_cache_file_unref(edf);
- return 1;
+ return EINA_TRUE;
}
edje_match_patterns_free(patterns);
}
_edje_cache_file_unref(edf);
}
- return 0;
+ return EINA_FALSE;
}
_edje_ref(ed);
_edje_block(ed);
_edje_freeze(ed);
- if (ed->collection->script) _edje_embryo_script_init(ed);
+// if (ed->collection->script) _edje_embryo_script_init(ed);
_edje_var_init(ed);
for (i = 0; i < ed->table_parts_size; i++)
{
_edje_block_violate(ed);
_edje_var_shutdown(ed);
_edje_programs_patterns_clean(ed);
+// if (ed->collection)
+// {
+// if (ed->collection->script) _edje_embryo_script_shutdown(ed);
+// }
if (!((ed->file) && (ed->collection))) return;
if (ed->table_parts)
/* Cleanup optional part. */
free(rp->drag);
+ free(rp->param1.set);
+ if (rp->param2)
+ free(rp->param2->set);
eina_mempool_free(_edje_real_part_state_mp, rp->param2);
+
+ if (rp->custom)
+ free(rp->custom->set);
eina_mempool_free(_edje_real_part_state_mp, rp->custom);
_edje_unref(rp->edje);
edf = fdata;
if (edf->free_strings) eina_stringshare_del(data);
- return 1;
+ return EINA_TRUE;
}
void
Edje_Program *pr;
Edje_Part *ep;
+ _edje_embryo_script_shutdown(ec);
EINA_LIST_FREE(ec->programs, pr)
{
Edje_Program_Target *prt;
coll->part, coll->references);
_edje_collection_free(edf, coll);
- return 1;
+ return EINA_TRUE;
}
#ifdef EDJE_PROGRAM_CACHE
_edje_collection_free_prog_cache_matches_free_cb(const Eina_Hash *hash, const void *key, void *data, void *fdata)
{
eina_list_free((Eina_List *)data);
- return 1;
+ return EINA_TRUE;
key = NULL;
hash = NULL;
fdata = NULL;
return 0;
}
- res = luaL_checkint(L, -1);
+ res = luaL_optint(L, -1, ECORE_CALLBACK_CANCEL);
lua_pop(L, 1); // -- res
/*
#include "edje_private.h"
+static Edje_Version _version = { VMAJ, VMIN, VMIC, VREV };
+EAPI Edje_Version *edje_version = &_version;
+
static int _edje_init_count = 0;
int _edje_default_log_dom = -1;
Eina_Mempool *_edje_real_part_mp = NULL;
Eina_Mempool *_edje_real_part_state_mp = NULL;
-
-
/*============================================================================*
* API *
*============================================================================*/
if (tc->font) eina_stringshare_del(tc->font);
free(tc);
}
+ while (ed->text_insert_filter_callbacks)
+ {
+ Edje_Text_Insert_Filter_Callback *cb;
+
+ cb = eina_list_data_get(ed->text_insert_filter_callbacks);
+ ed->text_insert_filter_callbacks = eina_list_remove(ed->text_insert_filter_callbacks, cb);
+ eina_stringshare_del(cb->part);
+ free(cb);
+ }
free(ed);
}
#include "edje_private.h"
-static Ecore_Job *job = NULL;
-static Ecore_Timer *job_loss_timer = NULL;
+static int _injob = 0;
+static Ecore_Job *_job = NULL;
+static Ecore_Timer *_job_loss_timer = NULL;
static Eina_List *msgq = NULL;
static Eina_List *tmp_msgq = NULL;
static void
_edje_job(void *data __UNUSED__)
{
- if (job_loss_timer)
+ if (_job_loss_timer)
{
- ecore_timer_del(job_loss_timer);
- job_loss_timer = NULL;
+ ecore_timer_del(_job_loss_timer);
+ _job_loss_timer = NULL;
}
+ _job = NULL;
+ _injob++;
_edje_message_queue_process();
- job = NULL;
+ _injob--;
}
static int
_edje_job_loss_timer(void *data __UNUSED__)
{
- job_loss_timer = NULL;
- if (job) job = NULL;
+ _job_loss_timer = NULL;
+ if (!_job)
+ {
+ _job = ecore_job_add(_edje_job, NULL);
+ }
return 0;
}
_edje_message_shutdown(void)
{
_edje_message_queue_clear();
- if (job_loss_timer)
- ecore_timer_del(job_loss_timer);
- job = NULL;
- job_loss_timer = NULL;
+ if (_job_loss_timer)
+ {
+ ecore_timer_del(_job_loss_timer);
+ _job_loss_timer = NULL;
+ }
+ if (_job)
+ {
+ ecore_job_del(_job);
+ _job = NULL;
+ }
}
void
int i;
unsigned char *msg = NULL;
- if (!job)
- {
- job = ecore_job_add(_edje_job, NULL);
- if (job_loss_timer) ecore_timer_del(job_loss_timer);
- job_loss_timer = ecore_timer_add(0.05, _edje_job_loss_timer, NULL);
- }
em = _edje_message_new(ed, queue, type, id);
if (!em) return;
+ if (_job)
+ {
+ ecore_job_del(_job);
+ _job = NULL;
+ }
+ if (_injob > 0)
+ {
+ _job_loss_timer = ecore_timer_add(0.01, _edje_job_loss_timer, NULL);
+ }
+ else
+ {
+ if (!_job)
+ {
+ _job = ecore_job_add(_edje_job, NULL);
+ }
+ if (_job_loss_timer)
+ {
+ ecore_timer_del(_job_loss_timer);
+ _job_loss_timer = NULL;
+ }
+ }
switch (em->type)
{
case EDJE_MESSAGE_NONE:
Edje_Message_String *emsg2, *emsg3;
emsg2 = (Edje_Message_String *)emsg;
+
emsg3 = malloc(sizeof(Edje_Message_String));
emsg3->str = strdup(emsg2->str);
msg = (unsigned char *)emsg3;
typedef struct _Edje_Font_Directory_Entry Edje_Font_Directory_Entry;
typedef struct _Edje_Image_Directory Edje_Image_Directory;
typedef struct _Edje_Image_Directory_Entry Edje_Image_Directory_Entry;
+typedef struct _Edje_Image_Directory_Set Edje_Image_Directory_Set;
+typedef struct _Edje_Image_Directory_Set_Entry Edje_Image_Directory_Set_Entry;
typedef struct _Edje_Spectrum_Directory Edje_Spectrum_Directory;
typedef struct _Edje_Spectrum_Directory_Entry Edje_Spectrum_Directory_Entry;
typedef struct _Edje_Program Edje_Program;
struct _Edje_Image_Directory
{
Eina_List *entries; /* a list of Edje_Image_Directory_Entry */
+ Eina_List *sets; /* a list of Edje_Image_Directory_Set */
};
struct _Edje_Image_Directory_Entry
int id; /* the id no. of the image */
};
+struct _Edje_Image_Directory_Set
+{
+ char *name;
+ Eina_List *entries;
+
+ int id;
+};
+
+struct _Edje_Image_Directory_Set_Entry
+{
+ char *name;
+ int id;
+
+ struct {
+ struct {
+ int w;
+ int h;
+ } min, max;
+ } size;
+};
+
/*----------*/
struct _Edje_Spectrum_Directory
struct _Edje_Part_Image_Id
{
int id;
+ Eina_Bool set;
};
struct _Edje_Part_Description
Eina_List *tween_list; /* list of Edje_Part_Image_Id */
int id; /* the image id to use */
int scale_hint; /* evas scale hint */
+ Eina_Bool set; /* if image condition it's content */
} image;
struct {
typedef struct _Edje Edje;
typedef struct _Edje_Real_Part_State Edje_Real_Part_State;
typedef struct _Edje_Real_Part_Drag Edje_Real_Part_Drag;
+typedef struct _Edje_Real_Part_Set Edje_Real_Part_Set;
typedef struct _Edje_Real_Part Edje_Real_Part;
typedef struct _Edje_Running_Program Edje_Running_Program;
typedef struct _Edje_Signal_Callback Edje_Signal_Callback;
typedef struct _Edje_Var_Timer Edje_Var_Timer;
typedef struct _Edje_Var_Pool Edje_Var_Pool;
typedef struct _Edje_Signal_Source_Char Edje_Signal_Source_Char;
+typedef struct _Edje_Text_Insert_Filter_Callback Edje_Text_Insert_Filter_Callback;
struct _Edje_Signal_Source_Char
{
Edje_Program **table_programs;
Edje_Real_Part *focused_part;
Eina_List *subobjs;
+ Eina_List *text_insert_filter_callbacks;
void *script_only_data;
int table_programs_size;
int table_parts_size;
unsigned char smooth : 1; // 1
}; // 96
+struct _Edje_Real_Part_Set
+{
+ Edje_Image_Directory_Set_Entry *entry; // 4
+ Edje_Image_Directory_Set *set; // 4
+
+ int id; // 4
+};
+
struct _Edje_Real_Part_State
{
Edje_Part_Description *description; // 4
Edje_Calc_Params p; // 96
#endif
void *external_params; // 4
-}; // 24
-// WITH EDJE_CALC_CACHE 124
+ Edje_Real_Part_Set *set; // 4
+}; // 28
+// WITH EDJE_CALC_CACHE 128
struct _Edje_Real_Part_Drag
{
unsigned char delete_me : 1;
};
+struct _Edje_Text_Insert_Filter_Callback
+{
+ const char *part;
+ void (*func) (void *data, Evas_Object *obj, const char *part, char **text);
+ void *data;
+};
+
struct _Edje_Pending_Program
{
Edje *edje;
char *_edje_text_escape(const char *text);
char *_edje_text_unescape(const char *text);
-void _edje_embryo_script_init (Edje *ed);
-void _edje_embryo_script_shutdown (Edje *ed);
+void _edje_embryo_script_init (Edje_Part_Collection *edc);
+void _edje_embryo_script_shutdown (Edje_Part_Collection *edc);
void _edje_embryo_script_reset (Edje *ed);
void _edje_embryo_test_run (Edje *ed, const char *fname, const char *sig, const char *src);
Edje_Var *_edje_var_new (void);
Edje_Real_Part *rp;
ed = runp->edje;
- if (ed->delete_me) return 0;
+ if (ed->delete_me) return EINA_FALSE;
_edje_block(ed);
_edje_ref(ed);
_edje_freeze(ed);
_edje_unref(ed);
if (!ed->walking_actions) free(runp);
_edje_unblock(ed);
- return 0;
+ return EINA_FALSE;
}
break_prog:
_edje_recalc(ed);
_edje_thaw(ed);
_edje_unref(ed);
_edje_unblock(ed);
- return 1;
+ return EINA_TRUE;
}
void
evas_object_del(oid->obj);
free(oid);
- return 1;
+ return EINA_TRUE;
}
static void
Oid *oid = data;
evas_object_move(oid->obj, oid->ed->x + oid->x, oid->ed->y + oid->y);
- return 1;
+ return EINA_TRUE;
}
static void
Edje_Real_Part *rp;
ed = _edje_fetch(obj);
- if ((!ed) || (!part)) return 0;
+ if ((!ed) || (!part)) return EINA_FALSE;
rp = _edje_real_part_recursive_get(ed, (char *)part);
- if (!rp) return 0;
- return 1;
+ if (!rp) return EINA_FALSE;
+ return EINA_TRUE;
}
/**
return EINA_TRUE;
}
+/**
+ * @brief Set the function that provides item objects for named items in an edje entry text
+ *
+ * @param obj A valid Evas Object handle
+ * @param func The function to call (or NULL to disable) to get item objects
+ * @param data The data pointer to pass to the @p func callback
+ *
+ * Item objects may be deleted any time by Edje, and will be deleted when the
+ * Edje object is deleted (or file is set to a new file).
+ */
+EAPI void
+edje_object_item_provider_set(Evas_Object *obj, Evas_Object *(*func) (void *data, Evas_Object *obj, const char *part, const char *item), void *data)
+{
+ Edje *ed;
+
+ ed = _edje_fetch(obj);
+ if (!ed) return;
+ ed->item_provider.func = func;
+ ed->item_provider.data = data;
+}
+
/* FIXDOC: New Function */
/**
* @brief Set the object text callback.
}
/**
- * @brief Set the function that provides item objects for named items in an edje entry text
- *
- * @param obj A valid Evas Object handle
- * @param func The function to call (or NULL to disable) to get item objects
- * @param data The data pointer to pass to the @p func callback
- *
- * Item objects may be deleted any time by Edje, and will be deleted when the
- * Edje object is deleted (or file is set to a new file).
- */
-EAPI void
-edje_object_item_provider_set(Evas_Object *obj, Evas_Object *(*func) (void *data, Evas_Object *obj, const char *part, const char *item), void *data)
-{
- Edje *ed;
-
- ed = _edje_fetch(obj);
- if (!ed) return;
- ed->item_provider.func = func;
- ed->item_provider.data = data;
-}
-
-/**
* @brief Return a list of char anchor names.
*
* @param obj A valid Evas_Object handle
Edje_Real_Part *rp;
ed = _edje_fetch(obj);
- if ((!ed) || (!part)) return 0;
+ if ((!ed) || (!part)) return EINA_FALSE;
rp = _edje_real_part_recursive_get(ed, (char *)part);
- if (!rp) return 0;
+ if (!rp) return EINA_FALSE;
if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE)
return _edje_entry_item_geometry_get(rp, item, cx, cy, cw, ch);
- return 0;
+ return EINA_FALSE;
}
/**
Edje_Real_Part *rp;
ed = _edje_fetch(obj);
- if ((!ed) || (!part)) return 0;
+ if ((!ed) || (!part)) return EINA_FALSE;
rp = _edje_real_part_recursive_get(ed, (char *)part);
- if (!rp) return 0;
+ if (!rp) return EINA_FALSE;
if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE)
{
return _edje_entry_cursor_next(rp, cur);
}
- return 0;
+ return EINA_FALSE;
}
/**
Edje_Real_Part *rp;
ed = _edje_fetch(obj);
- if ((!ed) || (!part)) return 0;
+ if ((!ed) || (!part)) return EINA_FALSE;
rp = _edje_real_part_recursive_get(ed, (char *)part);
- if (!rp) return 0;
+ if (!rp) return EINA_FALSE;
if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE)
{
return _edje_entry_cursor_prev(rp, cur);
}
- return 0;
+ return EINA_FALSE;
}
/**
Edje_Real_Part *rp;
ed = _edje_fetch(obj);
- if ((!ed) || (!part)) return 0;
+ if ((!ed) || (!part)) return EINA_FALSE;
rp = _edje_real_part_recursive_get(ed, (char *)part);
- if (!rp) return 0;
+ if (!rp) return EINA_FALSE;
if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE)
{
return _edje_entry_cursor_up(rp, cur);
}
- return 0;
+ return EINA_FALSE;
}
/**
Edje_Real_Part *rp;
ed = _edje_fetch(obj);
- if ((!ed) || (!part)) return 0;
+ if ((!ed) || (!part)) return EINA_FALSE;
rp = _edje_real_part_recursive_get(ed, (char *)part);
- if (!rp) return 0;
+ if (!rp) return EINA_FALSE;
if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE)
{
return _edje_entry_cursor_down(rp, cur);
}
- return 0;
+ return EINA_FALSE;
}
/**
Edje_Real_Part *rp;
ed = _edje_fetch(obj);
- if ((!ed) || (!part)) return 0;
+ if ((!ed) || (!part)) return EINA_FALSE;
rp = _edje_real_part_recursive_get(ed, (char *)part);
- if (!rp) return 0;
+ if (!rp) return EINA_FALSE;
if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE)
{
return _edje_entry_cursor_is_format_get(rp, cur);
}
- return 0;
+ return EINA_FALSE;
}
/**
return NULL;
}
+EAPI void
+edje_object_text_insert_filter_callback_add(Evas_Object *obj, const char *part, void (*func) (void *data, Evas_Object *obj, const char *part, char **text), const void *data)
+{
+ Edje *ed;
+ Edje_Text_Insert_Filter_Callback *cb;
+
+ ed = _edje_fetch(obj);
+ if ((!ed) || (!part)) return;
+ cb = calloc(1, sizeof(Edje_Text_Insert_Filter_Callback));
+ cb->part = eina_stringshare_add(part);
+ cb->func = func;
+ cb->data = (void*) data;
+ ed->text_insert_filter_callbacks =
+ eina_list_append(ed->text_insert_filter_callbacks, cb);
+}
+
+EAPI void
+edje_object_text_insert_filter_callback_del(Evas_Object *obj, const char *part, void (*func) (void *data, Evas_Object *obj, const char *part, char **text), const void *data)
+{
+ Edje *ed;
+ Edje_Text_Insert_Filter_Callback *cb;
+ Eina_List *l;
+
+ ed = _edje_fetch(obj);
+ if ((!ed) || (!part)) return;
+ EINA_LIST_FOREACH(ed->text_insert_filter_callbacks, l, cb)
+ {
+ if ((!strcmp(cb->part, part)) && (cb->func == func) && (cb->data == data))
+ {
+ ed->text_insert_filter_callbacks =
+ eina_list_remove_list(ed->text_insert_filter_callbacks, l);
+ eina_stringshare_del(cb->part);
+ free(cb);
+ return;
+ }
+ }
+}
+
/**
* @brief Swallows an object into the edje.
*
return EINA_TRUE;
}
-
-
-
-
-
-
-
-
static void
_edje_perspective_obj_del(void *data, Evas *e, Evas_Object *obj, void *event_info)
{
EAPI Eina_Bool
edje_perspective_global_get(const Edje_Perspective *ps)
{
- if (!ps) return 0;
+ if (!ps) return EINA_FALSE;
return ps->global;
}
return ed->persp;
}
-
-
-
#define EDJE_PRELOAD_EMISSION "preload,done"
#define EDJE_PRELOAD_SOURCE NULL