From: Anas Nashif Date: Sat, 22 Dec 2012 00:23:43 +0000 (-0800) Subject: Imported Upstream version 1.7.4 X-Git-Tag: upstream/1.7.4^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0bfa0f58f6301c6352d9bf9a314a8b5fe487ef76;p=platform%2Fupstream%2Fevas.git Imported Upstream version 1.7.4 --- diff --git a/ChangeLog b/ChangeLog index ee0f391..653f744 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1097,3 +1097,48 @@ 2012-12-07 Luis Felipe Strano Moraes * Release 1.7.3 + +2012-12-12 ChunEon park + + * Fix the evas gl line incorrect position problem. + +2012-12-13 Cedric Bail + + * Fix uninitialized data in Evas_Smart initialization code. + * Fix potential segv in software engine native_set call. + * Fix uninitialized data in OpenGL engine native_set call. + +2012-12-13 Rafael Antognolli (antognolli) + + * Remove strange image_put from image_is_inside. Fixes crashes when + precise_is_inside is set on image objects. + +2012-12-14 Cedric Bail + + * Properly close async pipe fd on exec. + +2012-12-17 Vincent Torri + + * Add XML output to doc + * Add installation rule for doc + +2012-12-19 Gustavo Sverzut Barbierie (k-s) + + * Fixed RGBA_Image->flags.loaded for copied images. + * Fixed evas_object_image_is_inside() implementation. + +2012-12-19 Carsten Haitzler (The Rasterman) + + * Fixed 24bpp issue with rendering in evas. It shows itself + only under qemu/kvm with the cirruse driver that I have found. + In this case the screen is really 24bpp packed and this case + just never comes up on any vaguely modern gfx system. + +2012-12-21 Stefan Schmidt + + * Fix small memory leak in evas_bidi_utils error path + +2012-12-21 Luis Felipe Strano Moraes + + * 1.7.4 release + diff --git a/Makefile.am b/Makefile.am index 401600f..2934cf6 100644 --- a/Makefile.am +++ b/Makefile.am @@ -132,12 +132,16 @@ if BUILD_ENGINE_WAYLAND_EGL pkgconfig_DATA += evas-wayland-egl.pc endif -.PHONY: doc coverage +.PHONY: doc install-doc coverage doc: @echo "entering doc/" $(MAKE) -C doc doc +install-doc: + @echo "entering doc/" + make -C doc install-doc + # Unit tests if EFL_ENABLE_TESTS diff --git a/Makefile.in b/Makefile.in index cdcc337..9f7aa96 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1150,12 +1150,16 @@ uninstall-am: uninstall-binSCRIPTS uninstall-pkgconfigDATA uninstall-binSCRIPTS uninstall-pkgconfigDATA -.PHONY: doc coverage +.PHONY: doc install-doc coverage doc: @echo "entering doc/" $(MAKE) -C doc doc +install-doc: + @echo "entering doc/" + make -C doc install-doc + # Unit tests @EFL_ENABLE_TESTS_TRUE@check-local: diff --git a/NEWS b/NEWS index 30f2df7..d6f0c64 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,22 @@ +Evas 1.7.4 + +Changes since Evas 1.7.3: +------------------------- + +Fixes: + * Fix the gl line incorrect position drawing. + * Fix uninitialized data in Evas_Smart initialization code. + * Fix potential segv in software engine native_set call. + * Fix uninitialized data in OpenGL engine native_set call. + * Fix crash when precise_is_inside is set on an image, and events are generated from it. + * Properly close async pipe fd on exec. + * Fix the line drawing clipping problem on arm gl driver. + * Fix big rendering/conversion problem in kvm/qemu 24bpp. + * Fix Evas RGBA_Image->flags.loaded for copied images. + * Fix evas_object_image_is_inside() + * Fix small memory leak in evas_bidi_utils error path + + Evas 1.7.3 Changes since Evas 1.7.2 diff --git a/README b/README index ddfcda0..154bd46 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -Evas 1.7.0 +Evas 1.7.4 ****************************************************************************** diff --git a/config.h.in b/config.h.in index 201da6e..37a16fc 100644 --- a/config.h.in +++ b/config.h.in @@ -447,6 +447,9 @@ /* Define to 1 if you have Exotic. */ #undef HAVE_EXOTIC +/* Define to 1 if you have the `fcntl' function. */ +#undef HAVE_FCNTL + /* have fontconfig searching capabilities */ #undef HAVE_FONTCONFIG diff --git a/configure b/configure index fdcf524..058cae4 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for evas 1.7.3. +# Generated by GNU Autoconf 2.68 for evas 1.7.4. # # Report bugs to . # @@ -570,8 +570,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='evas' PACKAGE_TARNAME='evas' -PACKAGE_VERSION='1.7.3' -PACKAGE_STRING='evas 1.7.3' +PACKAGE_VERSION='1.7.4' +PACKAGE_STRING='evas 1.7.4' PACKAGE_BUGREPORT='enlightenment-devel@lists.sourceforge.net' PACKAGE_URL='' @@ -1808,7 +1808,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures evas 1.7.3 to adapt to many kinds of systems. +\`configure' configures evas 1.7.4 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1882,7 +1882,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of evas 1.7.3:";; + short | recursive ) echo "Configuration of evas 1.7.4:";; esac cat <<\_ACEOF @@ -2253,7 +2253,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -evas configure 1.7.3 +evas configure 1.7.4 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -3105,7 +3105,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by evas $as_me 1.7.3, which was +It was created by evas $as_me 1.7.4, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -3929,7 +3929,7 @@ fi # Define the identity of the package. PACKAGE='evas' - VERSION='1.7.3' + VERSION='1.7.4' cat >>confdefs.h <<_ACEOF @@ -12963,7 +12963,7 @@ _ACEOF cat >>confdefs.h <<_ACEOF -#define VMIC 3 +#define VMIC 4 _ACEOF @@ -12971,7 +12971,7 @@ cat >>confdefs.h <<_ACEOF #define VREV 0 _ACEOF -version_info="8:3:7" +version_info="8:4:7" release_info="" @@ -12990,7 +12990,7 @@ case "$host_os" in MODULE_ARCH="$host_os-$host_cpu" ;; *) - MODULE_ARCH="$host_os-$host_cpu-1.7.3" + MODULE_ARCH="$host_os-$host_cpu-1.7.4" ;; esac @@ -20270,12 +20270,13 @@ if test "$ac_res" != no; then : fi -for ac_func in siglongjmp +for ac_func in siglongjmp fcntl do : - ac_fn_c_check_func "$LINENO" "siglongjmp" "ac_cv_func_siglongjmp" -if test "x$ac_cv_func_siglongjmp" = xyes; then : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF -#define HAVE_SIGLONGJMP 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi @@ -34324,7 +34325,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by evas $as_me 1.7.3, which was +This file was extended by evas $as_me 1.7.4, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -34390,7 +34391,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -evas config.status 1.7.3 +evas config.status 1.7.4 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" @@ -36703,6 +36704,9 @@ echo " 32bpp Rotation 180......: $conv_32_rgb_rot_180" echo " 32bpp Rotation 270......: $conv_32_rgb_rot_270" echo echo "Documentation.............: ${build_doc}" +if test "x${build_doc}" = "xyes" ; then +echo " Installation..........: make install-doc" +fi echo "Examples..................: install:${install_examples} build:${build_examples}" if test "x${enable_tests}" = "xyes" ; then echo "Tests.....................: ${enable_tests} (make check)" diff --git a/configure.ac b/configure.ac index e996b77..7d3dd8c 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--## m4_define([v_maj], [1]) m4_define([v_min], [7]) -m4_define([v_mic], [3]) +m4_define([v_mic], [4]) m4_define([v_rev], m4_esyscmd([(svnversion "${SVN_REPO_PATH:-.}" | grep -v '\(export\|Unversioned directory\)' || echo 0) | awk -F : '{printf("%s\n", $1);}' | tr -d ' :MSP\n'])) m4_if(v_rev, [0], [m4_define([v_rev], m4_esyscmd([git log 2> /dev/null | (grep -m1 git-svn-id || echo 0) | sed -e 's/.*@\([0-9]*\).*/\1/' | tr -d '\n']))]) ##-- When released, remove the dnl on the below line @@ -544,7 +544,7 @@ AC_SUBST(lt_enable_auto_import) ### Checks for library functions AC_ISC_POSIX -AC_CHECK_FUNCS([siglongjmp]) +AC_CHECK_FUNCS([siglongjmp fcntl]) # alloca AC_FUNC_ALLOCA @@ -2092,6 +2092,9 @@ echo " 32bpp Rotation 180......: $conv_32_rgb_rot_180" echo " 32bpp Rotation 270......: $conv_32_rgb_rot_270" echo echo "Documentation.............: ${build_doc}" +if test "x${build_doc}" = "xyes" ; then +echo " Installation..........: make install-doc" +fi echo "Examples..................: install:${install_examples} build:${build_examples}" if test "x${enable_tests}" = "xyes" ; then echo "Tests.....................: ${enable_tests} (make check)" diff --git a/doc/Doxyfile.in b/doc/Doxyfile.in index 54456fe..076bc8b 100644 --- a/doc/Doxyfile.in +++ b/doc/Doxyfile.in @@ -101,7 +101,7 @@ GENERATE_MAN = YES MAN_OUTPUT = man MAN_EXTENSION = .3 MAN_LINKS = YES -GENERATE_XML = NO +GENERATE_XML = YES XML_SCHEMA = XML_DTD = GENERATE_AUTOGEN_DEF = NO diff --git a/doc/Makefile.am b/doc/Makefile.am index 10b19d5..c6501ae 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -1,6 +1,6 @@ MAINTAINERCLEANFILES = Makefile.in evas.dox -.PHONY: doc +.PHONY: doc install-doc PACKAGE_DOCNAME = $(PACKAGE_TARNAME)-$(PACKAGE_VERSION)-doc @@ -9,13 +9,15 @@ if EFL_BUILD_DOC doc-clean: rm -rf html/ latex/ man/ xml/ $(PACKAGE_DOCNAME).tar* -doc: all doc-clean +doc-build: all $(efl_doxygen) - cp $(srcdir)/img/* html/ - cp $(srcdir)/img/* latex/ + cp img/* html/ + cp img/* latex/ + +doc: doc-build rm -rf $(PACKAGE_DOCNAME).tar* mkdir -p $(PACKAGE_DOCNAME)/doc - cp -R html/ latex/ man/ $(PACKAGE_DOCNAME)/doc + cp -R html/ latex/ man/ xml/ $(PACKAGE_DOCNAME)/doc tar cf $(PACKAGE_DOCNAME).tar $(PACKAGE_DOCNAME)/ bzip2 -9 $(PACKAGE_DOCNAME).tar rm -rf $(PACKAGE_DOCNAME)/ @@ -25,11 +27,20 @@ doc: all doc-clean clean-local: doc-clean +install-doc: doc-build + install -d $(docdir) + cp -R html latex man xml $(docdir) + +uninstall-local: + rm -rf $(docdir)/html $(docdir)/latex $(docdir)/man $(docdir)/xml + else doc: @echo "Documentation not built. Run ./configure --help" +install-doc: doc + endif EXTRA_DIST = $(srcdir)/Doxyfile.in \ diff --git a/doc/Makefile.in b/doc/Makefile.in index 4bf7b35..62e3a40 100644 --- a/doc/Makefile.in +++ b/doc/Makefile.in @@ -470,6 +470,7 @@ maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) +@EFL_BUILD_DOC_FALSE@uninstall-local: @EFL_BUILD_DOC_FALSE@clean-local: clean: clean-am @@ -535,7 +536,7 @@ ps: ps-am ps-am: -uninstall-am: +uninstall-am: uninstall-local .MAKE: install-am install-strip @@ -549,21 +550,23 @@ uninstall-am: install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - uninstall uninstall-am + uninstall uninstall-am uninstall-local -.PHONY: doc +.PHONY: doc install-doc @EFL_BUILD_DOC_TRUE@doc-clean: @EFL_BUILD_DOC_TRUE@ rm -rf html/ latex/ man/ xml/ $(PACKAGE_DOCNAME).tar* -@EFL_BUILD_DOC_TRUE@doc: all doc-clean +@EFL_BUILD_DOC_TRUE@doc-build: all @EFL_BUILD_DOC_TRUE@ $(efl_doxygen) -@EFL_BUILD_DOC_TRUE@ cp $(srcdir)/img/* html/ -@EFL_BUILD_DOC_TRUE@ cp $(srcdir)/img/* latex/ +@EFL_BUILD_DOC_TRUE@ cp img/* html/ +@EFL_BUILD_DOC_TRUE@ cp img/* latex/ + +@EFL_BUILD_DOC_TRUE@doc: doc-build @EFL_BUILD_DOC_TRUE@ rm -rf $(PACKAGE_DOCNAME).tar* @EFL_BUILD_DOC_TRUE@ mkdir -p $(PACKAGE_DOCNAME)/doc -@EFL_BUILD_DOC_TRUE@ cp -R html/ latex/ man/ $(PACKAGE_DOCNAME)/doc +@EFL_BUILD_DOC_TRUE@ cp -R html/ latex/ man/ xml/ $(PACKAGE_DOCNAME)/doc @EFL_BUILD_DOC_TRUE@ tar cf $(PACKAGE_DOCNAME).tar $(PACKAGE_DOCNAME)/ @EFL_BUILD_DOC_TRUE@ bzip2 -9 $(PACKAGE_DOCNAME).tar @EFL_BUILD_DOC_TRUE@ rm -rf $(PACKAGE_DOCNAME)/ @@ -573,9 +576,18 @@ uninstall-am: @EFL_BUILD_DOC_TRUE@clean-local: doc-clean +@EFL_BUILD_DOC_TRUE@install-doc: doc-build +@EFL_BUILD_DOC_TRUE@ install -d $(docdir) +@EFL_BUILD_DOC_TRUE@ cp -R html latex man xml $(docdir) + +@EFL_BUILD_DOC_TRUE@uninstall-local: +@EFL_BUILD_DOC_TRUE@ rm -rf $(docdir)/html $(docdir)/latex $(docdir)/man $(docdir)/xml + @EFL_BUILD_DOC_FALSE@doc: @EFL_BUILD_DOC_FALSE@ @echo "Documentation not built. Run ./configure --help" +@EFL_BUILD_DOC_FALSE@install-doc: doc + # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff --git a/evas.pc.in b/evas.pc.in index f5c514a..7522ab4 100644 --- a/evas.pc.in +++ b/evas.pc.in @@ -1,7 +1,9 @@ +PACKAGE_TARNAME=@PACKAGE_TARNAME@ prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ +docdir=@docdir@ Name: evas Description: Evas canvas display library diff --git a/evas.spec b/evas.spec index f7c80e6..71fa727 100644 --- a/evas.spec +++ b/evas.spec @@ -85,7 +85,7 @@ Summary: Multi-platform Canvas Library Name: evas -Version: 1.7.3 +Version: 1.7.4 Release: %{_rel} License: BSD Group: System Environment/Libraries diff --git a/src/lib/Evas.h b/src/lib/Evas.h index 7a64071..47557a1 100644 --- a/src/lib/Evas.h +++ b/src/lib/Evas.h @@ -8217,6 +8217,8 @@ EAPI Evas_BiDi_Direction evas_object_text_direction_get(const Evas_Object *obj) * additional format directives using "tags" that can be set in the style see * @ref evas_textblock_style_set . * + * For more details see @ref evas_textblock_style_page + * * Textblock supports the following formats: * @li font - Font description in fontconfig like format, e.g: "Sans:style=Italic:lang=hi". or "Serif:style=Bold". * @li font_weight - Overrides the weight defined in "font". E.g: "font_weight=Bold" is the same as "font=:style=Bold". Supported weights: "normal", "thin", "ultralight", "light", "book", "medium", "semibold", "bold", "ultrabold", "black", and "extrablack". diff --git a/src/lib/cache/evas_cache_image.c b/src/lib/cache/evas_cache_image.c index 8d96964..4a6f04c 100644 --- a/src/lib/cache/evas_cache_image.c +++ b/src/lib/cache/evas_cache_image.c @@ -903,6 +903,7 @@ evas_cache_image_copied_data(Evas_Cache_Image *cache, return NULL; } im->references = 1; + im->flags.loaded = EINA_TRUE; if (cache->func.debug) cache->func.debug("copied-data", im); return im; } diff --git a/src/lib/canvas/evas_async_events.c b/src/lib/canvas/evas_async_events.c index 3f9fbd7..c984325 100644 --- a/src/lib/canvas/evas_async_events.c +++ b/src/lib/canvas/evas_async_events.c @@ -36,7 +36,7 @@ struct _Evas_Event_Async Eina_Bool _evas_fd_close_on_exec(int fd) { -#ifdef HAVE_EXECVP +#ifdef HAVE_FCNTL int flags; flags = fcntl(fd, F_GETFD); diff --git a/src/lib/canvas/evas_object_image.c b/src/lib/canvas/evas_object_image.c index eb8218b..aeabd20 100644 --- a/src/lib/canvas/evas_object_image.c +++ b/src/lib/canvas/evas_object_image.c @@ -3631,150 +3631,398 @@ evas_object_image_was_opaque(Evas_Object *obj) return 1; } -static int -evas_object_image_is_inside(Evas_Object *obj, Evas_Coord x, Evas_Coord y) +static inline Eina_Bool +_pixel_alpha_get(RGBA_Image *im, int x, int y, DATA8 *alpha, + int src_region_x, int src_region_y, int src_region_w, int src_region_h, + int dst_region_x, int dst_region_y, int dst_region_w, int dst_region_h) { - Evas_Object_Image *o; - DATA32 *data; - int w, h, stride, iw, ih; - int a; - int return_value; + int px, py, dx, dy, sx, sy, src_w, src_h; + double scale_w, scale_h; - o = (Evas_Object_Image *)(obj->object_data); + if ((dst_region_x > x) || (x >= (dst_region_x + dst_region_w)) || + (dst_region_y > y) || (y >= (dst_region_y + dst_region_h))) + { + *alpha = 0; + return EINA_FALSE; + } + + src_w = im->cache_entry.w; + src_h = im->cache_entry.h; + if ((src_w == 0) || (src_h == 0)) + { + *alpha = 0; + return EINA_TRUE; + } + + EINA_SAFETY_ON_TRUE_GOTO(src_region_x < 0, error_oob); + EINA_SAFETY_ON_TRUE_GOTO(src_region_y < 0, error_oob); + EINA_SAFETY_ON_TRUE_GOTO(src_region_x + src_region_w > src_w, error_oob); + EINA_SAFETY_ON_TRUE_GOTO(src_region_y + src_region_h > src_h, error_oob); + + scale_w = (double)dst_region_w / (double)src_region_w; + scale_h = (double)dst_region_h / (double)src_region_h; + + /* point at destination */ + dx = x - dst_region_x; + dy = y - dst_region_y; + + /* point at source */ + sx = dx / scale_w; + sy = dy / scale_h; + + /* pixel point (translated) */ + px = src_region_x + sx; + py = src_region_y + sy; + EINA_SAFETY_ON_TRUE_GOTO(px >= src_w, error_oob); + EINA_SAFETY_ON_TRUE_GOTO(py >= src_h, error_oob); + + switch (im->cache_entry.space) + { + case EVAS_COLORSPACE_ARGB8888: + { + DATA32 *pixel = im->image.data; + pixel += ((py * src_w) + px); + *alpha = ((*pixel) >> 24) & 0xff; + } + break; - x -= obj->cur.cache.clip.x; - y -= obj->cur.cache.clip.y; - w = obj->cur.cache.clip.w; - h = obj->cur.cache.clip.h; - iw = o->cur.image.w; - ih = o->cur.image.h; + default: + ERR("Colorspace %d not supported.", im->cache_entry.space); + *alpha = 0; + } - if ((x < 0) || (y < 0) || (x >= w) || (y >= h)) return 0; - if (!o->cur.has_alpha) return 1; + return EINA_TRUE; - // FIXME: proxy needs to be honored - if (obj->cur.map) + error_oob: + ERR("Invalid region src=(%d, %d, %d, %d), dst=(%d, %d, %d, %d), image=%dx%d", + src_region_x, src_region_y, src_region_w, src_region_h, + dst_region_x, dst_region_y, dst_region_w, dst_region_h, + src_w, src_h); + *alpha = 0; + return EINA_TRUE; +} + +static int +evas_object_image_is_inside(Evas_Object *obj, Evas_Coord px, Evas_Coord py) +{ + Evas_Object_Image *o; + int imagew, imageh, uvw, uvh; + void *pixels; + int is_inside = 0; + + /* the following code is similar to evas_object_image_render(), but doesn't + * draw, just get the pixels so we can check the transparency. + */ + o = (Evas_Object_Image *)(obj->object_data); + if (!o->cur.source) + { + pixels = o->engine_data; + imagew = o->cur.image.w; + imageh = o->cur.image.h; + uvw = imagew; + uvh = imageh; + } + else if (o->cur.source->proxy.surface && !o->cur.source->proxy.redraw) { - x = obj->cur.map->mx; - y = obj->cur.map->my; + pixels = o->cur.source->proxy.surface; + imagew = o->cur.source->proxy.w; + imageh = o->cur.source->proxy.h; + uvw = imagew; + uvh = imageh; + } + else if (o->cur.source->type == o_type && + ((Evas_Object_Image *)o->cur.source->object_data)->engine_data) + { + Evas_Object_Image *oi; + oi = o->cur.source->object_data; + pixels = oi->engine_data; + imagew = oi->cur.image.w; + imageh = oi->cur.image.h; + uvw = o->cur.source->cur.geometry.w; + uvh = o->cur.source->cur.geometry.h; } else { - int bl, br, bt, bb, bsl, bsr, bst, bsb; - - bl = o->cur.border.l; - br = o->cur.border.r; - bt = o->cur.border.t; - bb = o->cur.border.b; - if ((bl + br) > iw) - { - bl = iw / 2; - br = iw - bl; - } - if ((bl + br) > iw) - { - bl = iw / 2; - br = iw - bl; - } - if ((bt + bb) > ih) - { - bt = ih / 2; - bb = ih - bt; - } - if ((bt + bb) > ih) + o->proxyrendering = EINA_TRUE; + _proxy_subrender(obj->layer->evas, o->cur.source); + pixels = o->cur.source->proxy.surface; + imagew = o->cur.source->proxy.w; + imageh = o->cur.source->proxy.h; + uvw = imagew; + uvh = imageh; + o->proxyrendering = EINA_FALSE; + } + + if (pixels) + { + Evas_Coord idw, idh, idx, idy; + int ix, iy, iw, ih; + + /* TODO: not handling o->dirty_pixels && o->func.get_pixels, + * should we handle it now or believe they were done in the last render? + */ + if (o->dirty_pixels) { - bt = ih / 2; - bb = ih - bt; + if (o->func.get_pixels) + { + ERR("dirty_pixels && get_pixels not supported"); + } } - if (o->cur.border.scale != 1.0) + + /* TODO: not handling map, need to apply map to point */ + if ((obj->cur.map) && (obj->cur.map->count > 3) && (obj->cur.usemap)) { - bsl = ((double)bl * o->cur.border.scale); - bsr = ((double)br * o->cur.border.scale); - bst = ((double)bt * o->cur.border.scale); - bsb = ((double)bb * o->cur.border.scale); + evas_object_map_update(obj, 0, 0, imagew, imageh, uvw, uvh); + + ERR("map not supported"); } else { - bsl = bl; bsr = br; bst = bt; bsb = bb; - } - - w = o->cur.fill.w; - h = o->cur.fill.h; - x -= o->cur.fill.x; - y -= o->cur.fill.y; - x %= w; - y %= h; - - if (x < 0) x += w; - if (y < 0) y += h; - - if (o->cur.border.fill != EVAS_BORDER_FILL_DEFAULT) - { - if ((x > bsl) && (x < (w - bsr)) && - (y > bst) && (y < (h - bsb))) + RGBA_Image *im; + DATA32 *data = NULL; + int err = 0; + + im = obj->layer->evas->engine.func->image_data_get + (obj->layer->evas->engine.data.output, pixels, 0, &data, &err); + if ((!im) || (!data) || (err)) { - if (o->cur.border.fill == EVAS_BORDER_FILL_SOLID) return 1; - return 0; + ERR("Couldn't get image pixels RGBA_Image %p: im=%p, data=%p, err=%d", pixels, im, data, err); + goto end; } - } - - if (x < bsl) x = (x * bl) / bsl; - else if (x > (w - bsr)) x = iw - (((w - x) * br) / bsr); - else if ((bsl + bsr) < w) x = bl + (((x - bsl) * (iw - bl - br)) / (w - bsl - bsr)); - else return 1; - - if (y < bst) y = (y * bt) / bst; - else if (y > (h - bsb)) y = ih - (((h - y) * bb) / bsb); - else if ((bst + bsb) < h) y = bt + (((y - bst) * (ih - bt - bb)) / (h - bst - bsb)); - else return 1; - } - - if (x < 0) x = 0; - if (y < 0) y = 0; - if (x >= iw) x = iw - 1; - if (y >= ih) y = ih - 1; - - stride = o->cur.image.stride; - - o->engine_data = obj->layer->evas->engine.func->image_data_get - (obj->layer->evas->engine.data.output, - o->engine_data, - 0, - &data, - &o->load_error); - if (!data) - { - return_value = 0; - goto finish; - } + idx = evas_object_image_figure_x_fill(obj, o->cur.fill.x, o->cur.fill.w, &idw); + idy = evas_object_image_figure_y_fill(obj, o->cur.fill.y, o->cur.fill.h, &idh); + if (idw < 1) idw = 1; + if (idh < 1) idh = 1; + if (idx > 0) idx -= idw; + if (idy > 0) idy -= idh; + while ((int)idx < obj->cur.geometry.w) + { + Evas_Coord ydy; + int dobreak_w = 0; + ydy = idy; + ix = idx; + if ((o->cur.fill.w == obj->cur.geometry.w) && + (o->cur.fill.x == 0)) + { + dobreak_w = 1; + iw = obj->cur.geometry.w; + } + else + iw = ((int)(idx + idw)) - ix; + while ((int)idy < obj->cur.geometry.h) + { + int dobreak_h = 0; - switch (o->cur.cspace) - { - case EVAS_COLORSPACE_ARGB8888: - data = ((DATA32*)(data) + ((y * (stride >> 2)) + x)); - a = (*((DATA32*)(data)) >> 24) & 0xff; - break; - case EVAS_COLORSPACE_RGB565_A5P: - data = (void*) ((DATA16*)(data) + (h * (stride >> 1))); - data = (void*) ((DATA8*)(data) + ((y * (stride >> 1)) + x)); - a = (*((DATA8*)(data))) & 0x1f; - break; - default: - return_value = 1; - goto finish; - break; - } + iy = idy; + if ((o->cur.fill.h == obj->cur.geometry.h) && + (o->cur.fill.y == 0)) + { + ih = obj->cur.geometry.h; + dobreak_h = 1; + } + else + ih = ((int)(idy + idh)) - iy; + if ((o->cur.border.l == 0) && + (o->cur.border.r == 0) && + (o->cur.border.t == 0) && + (o->cur.border.b == 0) && + (o->cur.border.fill != 0)) + { + /* NOTE: render handles cserve2 here, + * we don't need to + */ + { + DATA8 alpha = 0; + if (_pixel_alpha_get(pixels, px, py, &alpha, 0, 0, imagew, imageh, obj->cur.geometry.x + ix, obj->cur.geometry.y + iy, iw, ih)) + { + is_inside = alpha > 0; + dobreak_h = 1; + dobreak_w = 1; + break; + } + } + } + else + { + int inx, iny, inw, inh, outx, outy, outw, outh; + int bl, br, bt, bb, bsl, bsr, bst, bsb; + int imw, imh, ox, oy; + DATA8 alpha = 0; - return_value = (a != 0); - goto finish; + ox = obj->cur.geometry.x + ix; + oy = obj->cur.geometry.y + iy; + imw = imagew; + imh = imageh; + bl = o->cur.border.l; + br = o->cur.border.r; + bt = o->cur.border.t; + bb = o->cur.border.b; + if ((bl + br) > iw) + { + bl = iw / 2; + br = iw - bl; + } + if ((bl + br) > imw) + { + bl = imw / 2; + br = imw - bl; + } + if ((bt + bb) > ih) + { + bt = ih / 2; + bb = ih - bt; + } + if ((bt + bb) > imh) + { + bt = imh / 2; + bb = imh - bt; + } + if (o->cur.border.scale != 1.0) + { + bsl = ((double)bl * o->cur.border.scale); + bsr = ((double)br * o->cur.border.scale); + bst = ((double)bt * o->cur.border.scale); + bsb = ((double)bb * o->cur.border.scale); + } + else + { + bsl = bl; bsr = br; bst = bt; bsb = bb; + } + // #-- + // | + inx = 0; iny = 0; + inw = bl; inh = bt; + outx = ox; outy = oy; + outw = bsl; outh = bst; + if (_pixel_alpha_get(pixels, px, py, &alpha, inx, iny, inw, inh, outx, outy, outw, outh)) + { + is_inside = alpha > 0; + dobreak_h = 1; + dobreak_w = 1; + break; + } - finish: + // .## + // | + inx = bl; iny = 0; + inw = imw - bl - br; inh = bt; + outx = ox + bsl; outy = oy; + outw = iw - bsl - bsr; outh = bst; + if (_pixel_alpha_get(pixels, px, py, &alpha, inx, iny, inw, inh, outx, outy, outw, outh)) + { + is_inside = alpha > 0; + dobreak_h = 1; + dobreak_w = 1; + break; + } + // --# + // | + inx = imw - br; iny = 0; + inw = br; inh = bt; + outx = ox + iw - bsr; outy = oy; + outw = bsr; outh = bst; + if (_pixel_alpha_get(pixels, px, py, &alpha, inx, iny, inw, inh, outx, outy, outw, outh)) + { + is_inside = alpha > 0; + dobreak_h = 1; + dobreak_w = 1; + break; + } + // .-- + // # + inx = 0; iny = bt; + inw = bl; inh = imh - bt - bb; + outx = ox; outy = oy + bst; + outw = bsl; outh = ih - bst - bsb; + if (_pixel_alpha_get(pixels, px, py, &alpha, inx, iny, inw, inh, outx, outy, outw, outh)) + { + is_inside = alpha > 0; + dobreak_h = 1; + dobreak_w = 1; + break; + } + // .--. + // |##| + if (o->cur.border.fill > EVAS_BORDER_FILL_NONE) + { + inx = bl; iny = bt; + inw = imw - bl - br; inh = imh - bt - bb; + outx = ox + bsl; outy = oy + bst; + outw = iw - bsl - bsr; outh = ih - bst - bsb; + if (_pixel_alpha_get(pixels, px, py, &alpha, inx, iny, inw, inh, outx, outy, outw, outh)) + { + is_inside = alpha > 0; + dobreak_h = 1; + dobreak_w = 1; + break; + } + } + // --. + // # + inx = imw - br; iny = bt; + inw = br; inh = imh - bt - bb; + outx = ox + iw - bsr; outy = oy + bst; + outw = bsr; outh = ih - bst - bsb; + if (_pixel_alpha_get(pixels, px, py, &alpha, inx, iny, inw, inh, outx, outy, outw, outh)) + { + is_inside = alpha > 0; + dobreak_h = 1; + dobreak_w = 1; + break; + } + // | + // #-- + inx = 0; iny = imh - bb; + inw = bl; inh = bb; + outx = ox; outy = oy + ih - bsb; + outw = bsl; outh = bsb; + if (_pixel_alpha_get(pixels, px, py, &alpha, inx, iny, inw, inh, outx, outy, outw, outh)) + { + is_inside = alpha > 0; + dobreak_h = 1; + dobreak_w = 1; + break; + } + // | + // .## + inx = bl; iny = imh - bb; + inw = imw - bl - br; inh = bb; + outx = ox + bsl; outy = oy + ih - bsb; + outw = iw - bsl - bsr; outh = bsb; + if (_pixel_alpha_get(pixels, px, py, &alpha, inx, iny, inw, inh, outx, outy, outw, outh)) + { + is_inside = alpha > 0; + dobreak_h = 1; + dobreak_w = 1; + break; + } + // | + // --# + inx = imw - br; iny = imh - bb; + inw = br; inh = bb; + outx = ox + iw - bsr; outy = oy + ih - bsb; + outw = bsr; outh = bsb; + if (_pixel_alpha_get(pixels, px, py, &alpha, inx, iny, inw, inh, outx, outy, outw, outh)) + { + is_inside = alpha > 0; + dobreak_h = 1; + dobreak_w = 1; + break; + } + } + idy += idh; + if (dobreak_h) break; + } + idx += idw; + idy = ydy; + if (dobreak_w) break; + } + } + } - obj->layer->evas->engine.func->image_data_put(obj->layer->evas->engine.data.output, - o->engine_data, - data); - return return_value; + end: + return is_inside; } static int diff --git a/src/lib/canvas/evas_object_textblock.c b/src/lib/canvas/evas_object_textblock.c index cd197c6..b757fa4 100644 --- a/src/lib/canvas/evas_object_textblock.c +++ b/src/lib/canvas/evas_object_textblock.c @@ -1,6 +1,6 @@ /** * @internal - * @section Evas_Object_Textblock_Internal Internal Textblock Object Tutorial + * @subsection Evas_Object_Textblock_Internal Internal Textblock Object Tutorial * * This explains the internal design of the Evas Textblock Object, it's assumed * that the reader of this section has already read @ref Evas_Object_Textblock_Tutorial "Textblock's usage docs.". @@ -1109,6 +1109,12 @@ static const char *passwordstr = NULL; static const char *underline_dash_widthstr = NULL; static const char *underline_dash_gapstr = NULL; +/** + * @page evas_textblock_style_page Evas Textblock Style Options + * + * @brief This page describes how to style text in an Evas Text Block. + */ + /** * @internal * Init the format strings. @@ -1118,6 +1124,53 @@ _format_command_init(void) { if (format_refcount == 0) { + /** + * @page evas_textblock_style_page Evas Textblock Style Options + * + * @section evas_textblock_style_index Index + * + * The following styling commands are accepted: + * @li @ref evas_textblock_style_font + * @li @ref evas_textblock_style_font_fallback + * @li @ref evas_textblock_style_font_size + * @li @ref evas_textblock_style_font_source + * @li @ref evas_textblock_style_font_weight + * @li @ref evas_textblock_style_font_style + * @li @ref evas_textblock_style_font_width + * @li @ref evas_textblock_style_lang + * @li @ref evas_textblock_style_color + * @li @ref evas_textblock_style_underline_color + * @li @ref evas_textblock_style_underline2_color + * @li @ref evas_textblock_style_underline_dash_color + * @li @ref evas_textblock_style_outline_color + * @li @ref evas_textblock_style_shadow_color + * @li @ref evas_textblock_style_glow_color + * @li @ref evas_textblock_style_glow2_color + * @li @ref evas_textblock_style_backing_color + * @li @ref evas_textblock_style_strikethrough_color + * @li @ref evas_textblock_style_align + * @li @ref evas_textblock_style_valign + * @li @ref evas_textblock_style_wrap + * @li @ref evas_textblock_style_left_margin + * @li @ref evas_textblock_style_right_margin + * @li @ref evas_textblock_style_underline + * @li @ref evas_textblock_style_strikethrough + * @li @ref evas_textblock_style_backing + * @li @ref evas_textblock_style_style + * @li @ref evas_textblock_style_tabstops + * @li @ref evas_textblock_style_linesize + * @li @ref evas_textblock_style_linerelsize + * @li @ref evas_textblock_style_linegap + * @li @ref evas_textblock_style_linerelgap + * @li @ref evas_textblock_style_item + * @li @ref evas_textblock_style_linefill + * @li @ref evas_textblock_style_ellipsis + * @li @ref evas_textblock_style_password + * @li @ref evas_textblock_style_underline_dash_width + * @li @ref evas_textblock_style_underline_dash_gap + * + * @section evas_textblock_style_contents Contents + */ fontstr = eina_stringshare_add("font"); font_fallbacksstr = eina_stringshare_add("font_fallbacks"); font_sizestr = eina_stringshare_add("font_size"); @@ -1271,14 +1324,45 @@ _format_command(Evas_Object *obj, Evas_Object_Textblock_Format *fmt, const char if (cmd == fontstr) { + /** + * @page evas_textblock_style_page Evas Textblock Style Options + * + * @subsection evas_textblock_style_font Font + * + * This sets the name of the font to be used. + * @code + * font= + * @endcode + */ evas_font_name_parse(fmt->font.fdesc, tmp_param); } else if (cmd == font_fallbacksstr) { + /** + * @page evas_textblock_style_page Evas Textblock Style Options + * + * @subsection evas_textblock_style_font_fallback Font fallback + * + * This sets the name of the fallback font to be used. This font will + * be used if the primary font is not available. + * @code + * font_fallbacks= + * @endcode + */ eina_stringshare_replace(&(fmt->font.fdesc->fallbacks), tmp_param); } else if (cmd == font_sizestr) { + /** + * @page evas_textblock_style_page Evas Textblock Style Options + * + * @subsection evas_textblock_style_font_size Font size + * + * This sets the the size of font in points to be used. + * @code + * font_size= + * @endcode + */ int v; v = atoi(tmp_param); @@ -1289,6 +1373,16 @@ _format_command(Evas_Object *obj, Evas_Object_Textblock_Format *fmt, const char } else if (cmd == font_sourcestr) { + /** + * @page evas_textblock_style_page Evas Textblock Style Options + * + * @subsection evas_textblock_style_font_source Font source + * + * Specify an object from which to search for the font. + * @code + * font_source= + * @endcode + */ if ((!fmt->font.source) || ((fmt->font.source) && (strcmp(fmt->font.source, tmp_param)))) { @@ -1298,65 +1392,295 @@ _format_command(Evas_Object *obj, Evas_Object_Textblock_Format *fmt, const char } else if (cmd == font_weightstr) { + /** + * @page evas_textblock_style_page Evas Textblock Style Options + * + * @subsection evas_textblock_style_font_weight Font weight + * + * Sets the weight of the font. The value must be one of: + * @li "normal" + * @li "thin" + * @li "ultralight" + * @li "light" + * @li "book" + * @li "medium" + * @li "semibold" + * @li "bold" + * @li "ultrabold" + * @li "black" + * @li "extrablack" + * @code + * font_weight= + * @endcode + */ fmt->font.fdesc->weight = evas_font_style_find(tmp_param, tmp_param + strlen(tmp_param), EVAS_FONT_STYLE_WEIGHT); } else if (cmd == font_stylestr) { + /** + * @page evas_textblock_style_page Evas Textblock Style Options + * + * @subsection evas_textblock_style_font_style Font style + * + * Sets the style of the font. The value must be one of: + * @li "normal" + * @li "oblique" + * @li "italic" + * @code + * font_style=