From dd7595a3475407a7fa96a97393bae8c5220e8762 Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Wed, 4 Jan 2012 18:41:13 +1000 Subject: Add the base Enlightenment Foundation Libraries - eina, eet, evas, ecore, embryo, and edje. Note that embryo wont be used, but I'm not sure yet if you can build edje without it. --- libraries/evas/src/lib/include/Makefile.am | 13 + libraries/evas/src/lib/include/Makefile.in | 542 +++++++++ libraries/evas/src/lib/include/evas_blend_ops.h | 378 ++++++ libraries/evas/src/lib/include/evas_common.h | 1242 ++++++++++++++++++++ .../evas/src/lib/include/evas_common_soft16.h | 100 ++ libraries/evas/src/lib/include/evas_common_soft8.h | 184 +++ libraries/evas/src/lib/include/evas_inline.x | 259 ++++ libraries/evas/src/lib/include/evas_macros.h | 217 ++++ libraries/evas/src/lib/include/evas_mmx.h | 735 ++++++++++++ libraries/evas/src/lib/include/evas_options.h | 69 ++ libraries/evas/src/lib/include/evas_private.h | 1107 +++++++++++++++++ 11 files changed, 4846 insertions(+) create mode 100644 libraries/evas/src/lib/include/Makefile.am create mode 100644 libraries/evas/src/lib/include/Makefile.in create mode 100644 libraries/evas/src/lib/include/evas_blend_ops.h create mode 100644 libraries/evas/src/lib/include/evas_common.h create mode 100644 libraries/evas/src/lib/include/evas_common_soft16.h create mode 100644 libraries/evas/src/lib/include/evas_common_soft8.h create mode 100644 libraries/evas/src/lib/include/evas_inline.x create mode 100644 libraries/evas/src/lib/include/evas_macros.h create mode 100644 libraries/evas/src/lib/include/evas_mmx.h create mode 100644 libraries/evas/src/lib/include/evas_options.h create mode 100644 libraries/evas/src/lib/include/evas_private.h (limited to 'libraries/evas/src/lib/include') diff --git a/libraries/evas/src/lib/include/Makefile.am b/libraries/evas/src/lib/include/Makefile.am new file mode 100644 index 0000000..5c986c2 --- /dev/null +++ b/libraries/evas/src/lib/include/Makefile.am @@ -0,0 +1,13 @@ + +MAINTAINERCLEANFILES = Makefile.in + +EXTRA_DIST = \ +evas_inline.x \ +evas_private.h \ +evas_options.h \ +evas_macros.h \ +evas_mmx.h \ +evas_common.h \ +evas_common_soft8.h \ +evas_common_soft16.h \ +evas_blend_ops.h diff --git a/libraries/evas/src/lib/include/Makefile.in b/libraries/evas/src/lib/include/Makefile.in new file mode 100644 index 0000000..9d5c371 --- /dev/null +++ b/libraries/evas/src/lib/include/Makefile.in @@ -0,0 +1,542 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = src/lib/include +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/efl_attribute.m4 \ + $(top_srcdir)/m4/efl_coverage.m4 \ + $(top_srcdir)/m4/efl_doxygen.m4 \ + $(top_srcdir)/m4/efl_fnmatch.m4 \ + $(top_srcdir)/m4/efl_path_max.m4 $(top_srcdir)/m4/efl_tests.m4 \ + $(top_srcdir)/m4/evas_check_engine.m4 \ + $(top_srcdir)/m4/evas_check_loader.m4 \ + $(top_srcdir)/m4/evas_converter.m4 \ + $(top_srcdir)/m4/evas_dither.m4 \ + $(top_srcdir)/m4/evas_scaler.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) +am__v_GEN_0 = @echo " GEN " $@; +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) +am__v_at_0 = @ +SOURCES = +DIST_SOURCES = +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CHECK_CFLAGS = @CHECK_CFLAGS@ +CHECK_LIBS = @CHECK_LIBS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DIRECTFB_CFLAGS = @DIRECTFB_CFLAGS@ +DIRECTFB_LIBS = @DIRECTFB_LIBS@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +ECORE_EVAS_CFLAGS = @ECORE_EVAS_CFLAGS@ +ECORE_EVAS_LIBS = @ECORE_EVAS_LIBS@ +EDB_CFLAGS = @EDB_CFLAGS@ +EDB_LIBS = @EDB_LIBS@ +EDJE_CFLAGS = @EDJE_CFLAGS@ +EDJE_LIBS = @EDJE_LIBS@ +EET_CFLAGS = @EET_CFLAGS@ +EET_LIBS = @EET_LIBS@ +EFL_COVERAGE_CFLAGS = @EFL_COVERAGE_CFLAGS@ +EFL_COVERAGE_LIBS = @EFL_COVERAGE_LIBS@ +EFL_FNMATCH_LIBS = @EFL_FNMATCH_LIBS@ +EGREP = @EGREP@ +EINA_CFLAGS = @EINA_CFLAGS@ +EINA_LIBS = @EINA_LIBS@ +EVAS_CFLAGS = @EVAS_CFLAGS@ +EVAS_LIBS = @EVAS_LIBS@ +EVAS_SSE3_CFLAGS = @EVAS_SSE3_CFLAGS@ +EVIL_CFLAGS = @EVIL_CFLAGS@ +EVIL_LIBS = @EVIL_LIBS@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ +FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ +FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ +FREETYPE_LIBS = @FREETYPE_LIBS@ +FRIBIDI_CFLAGS = @FRIBIDI_CFLAGS@ +FRIBIDI_LIBS = @FRIBIDI_LIBS@ +GL_EET_CFLAGS = @GL_EET_CFLAGS@ +GL_EET_LIBS = @GL_EET_LIBS@ +GREP = @GREP@ +HARFBUZZ_CFLAGS = @HARFBUZZ_CFLAGS@ +HARFBUZZ_LIBS = @HARFBUZZ_LIBS@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LINEBREAK_CFLAGS = @LINEBREAK_CFLAGS@ +LINEBREAK_LIBS = @LINEBREAK_LIBS@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MODULE_ARCH = @MODULE_ARCH@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJC = @OBJC@ +OBJCDEPMODE = @OBJCDEPMODE@ +OBJCFLAGS = @OBJCFLAGS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ +PIXMAN_LIBS = @PIXMAN_LIBS@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PNG_CFLAGS = @PNG_CFLAGS@ +PNG_LIBS = @PNG_LIBS@ +RANLIB = @RANLIB@ +SDL_CFLAGS = @SDL_CFLAGS@ +SDL_LIBS = @SDL_LIBS@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SHM_OPEN_LINK = @SHM_OPEN_LINK@ +STRIP = @STRIP@ +SVG_CFLAGS = @SVG_CFLAGS@ +SVG_LIBS = @SVG_LIBS@ +VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ +VALGRIND_LIBS = @VALGRIND_LIBS@ +VERSION = @VERSION@ +VMAJ = @VMAJ@ +WIN32_CFLAGS = @WIN32_CFLAGS@ +WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ +XCB_CFLAGS = @XCB_CFLAGS@ +XCB_GL_CFLAGS = @XCB_GL_CFLAGS@ +XCB_GL_LIBS = @XCB_GL_LIBS@ +XCB_LIBS = @XCB_LIBS@ +XEXT_CFLAGS = @XEXT_CFLAGS@ +XEXT_LIBS = @XEXT_LIBS@ +XMKMF = @XMKMF@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +ac_ct_OBJC = @ac_ct_OBJC@ +altivec_cflags = @altivec_cflags@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +dlopen_libs = @dlopen_libs@ +docdir = @docdir@ +dvidir = @dvidir@ +edje_cc = @edje_cc@ +efl_doxygen = @efl_doxygen@ +efl_have_doxygen = @efl_have_doxygen@ +evas_engine_buffer_cflags = @evas_engine_buffer_cflags@ +evas_engine_buffer_libs = @evas_engine_buffer_libs@ +evas_engine_direct3d_cflags = @evas_engine_direct3d_cflags@ +evas_engine_direct3d_libs = @evas_engine_direct3d_libs@ +evas_engine_directfb_cflags = @evas_engine_directfb_cflags@ +evas_engine_directfb_libs = @evas_engine_directfb_libs@ +evas_engine_fb_cflags = @evas_engine_fb_cflags@ +evas_engine_fb_libs = @evas_engine_fb_libs@ +evas_engine_gl_cocoa_cflags = @evas_engine_gl_cocoa_cflags@ +evas_engine_gl_cocoa_libs = @evas_engine_gl_cocoa_libs@ +evas_engine_gl_common_libs = @evas_engine_gl_common_libs@ +evas_engine_gl_sdl_cflags = @evas_engine_gl_sdl_cflags@ +evas_engine_gl_sdl_libs = @evas_engine_gl_sdl_libs@ +evas_engine_gl_xcb_cflags = @evas_engine_gl_xcb_cflags@ +evas_engine_gl_xcb_libs = @evas_engine_gl_xcb_libs@ +evas_engine_gl_xlib_cflags = @evas_engine_gl_xlib_cflags@ +evas_engine_gl_xlib_libs = @evas_engine_gl_xlib_libs@ +evas_engine_psl1ght_cflags = @evas_engine_psl1ght_cflags@ +evas_engine_psl1ght_libs = @evas_engine_psl1ght_libs@ +evas_engine_software_16_ddraw_cflags = @evas_engine_software_16_ddraw_cflags@ +evas_engine_software_16_ddraw_libs = @evas_engine_software_16_ddraw_libs@ +evas_engine_software_16_sdl_cflags = @evas_engine_software_16_sdl_cflags@ +evas_engine_software_16_sdl_libs = @evas_engine_software_16_sdl_libs@ +evas_engine_software_16_wince_cflags = @evas_engine_software_16_wince_cflags@ +evas_engine_software_16_wince_libs = @evas_engine_software_16_wince_libs@ +evas_engine_software_16_x11_cflags = @evas_engine_software_16_x11_cflags@ +evas_engine_software_16_x11_libs = @evas_engine_software_16_x11_libs@ +evas_engine_software_8_x11_cflags = @evas_engine_software_8_x11_cflags@ +evas_engine_software_8_x11_libs = @evas_engine_software_8_x11_libs@ +evas_engine_software_ddraw_cflags = @evas_engine_software_ddraw_cflags@ +evas_engine_software_ddraw_libs = @evas_engine_software_ddraw_libs@ +evas_engine_software_gdi_cflags = @evas_engine_software_gdi_cflags@ +evas_engine_software_gdi_libs = @evas_engine_software_gdi_libs@ +evas_engine_software_sdl_cflags = @evas_engine_software_sdl_cflags@ +evas_engine_software_sdl_libs = @evas_engine_software_sdl_libs@ +evas_engine_software_xcb_cflags = @evas_engine_software_xcb_cflags@ +evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ +evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ +evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ +evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ +evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ +evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ +evas_image_loader_edb_libs = @evas_image_loader_edb_libs@ +evas_image_loader_eet_cflags = @evas_image_loader_eet_cflags@ +evas_image_loader_eet_libs = @evas_image_loader_eet_libs@ +evas_image_loader_generic_cflags = @evas_image_loader_generic_cflags@ +evas_image_loader_generic_libs = @evas_image_loader_generic_libs@ +evas_image_loader_gif_cflags = @evas_image_loader_gif_cflags@ +evas_image_loader_gif_libs = @evas_image_loader_gif_libs@ +evas_image_loader_ico_cflags = @evas_image_loader_ico_cflags@ +evas_image_loader_ico_libs = @evas_image_loader_ico_libs@ +evas_image_loader_jpeg_cflags = @evas_image_loader_jpeg_cflags@ +evas_image_loader_jpeg_libs = @evas_image_loader_jpeg_libs@ +evas_image_loader_pmaps_cflags = @evas_image_loader_pmaps_cflags@ +evas_image_loader_pmaps_libs = @evas_image_loader_pmaps_libs@ +evas_image_loader_png_cflags = @evas_image_loader_png_cflags@ +evas_image_loader_png_libs = @evas_image_loader_png_libs@ +evas_image_loader_psd_cflags = @evas_image_loader_psd_cflags@ +evas_image_loader_psd_libs = @evas_image_loader_psd_libs@ +evas_image_loader_svg_cflags = @evas_image_loader_svg_cflags@ +evas_image_loader_svg_libs = @evas_image_loader_svg_libs@ +evas_image_loader_tga_cflags = @evas_image_loader_tga_cflags@ +evas_image_loader_tga_libs = @evas_image_loader_tga_libs@ +evas_image_loader_tiff_cflags = @evas_image_loader_tiff_cflags@ +evas_image_loader_tiff_libs = @evas_image_loader_tiff_libs@ +evas_image_loader_wbmp_cflags = @evas_image_loader_wbmp_cflags@ +evas_image_loader_wbmp_libs = @evas_image_loader_wbmp_libs@ +evas_image_loader_xpm_cflags = @evas_image_loader_xpm_cflags@ +evas_image_loader_xpm_libs = @evas_image_loader_xpm_libs@ +exec_prefix = @exec_prefix@ +have_evas_engine_gl_x11 = @have_evas_engine_gl_x11@ +have_evas_engine_gl_xcb = @have_evas_engine_gl_xcb@ +have_evas_engine_gl_xlib = @have_evas_engine_gl_xlib@ +have_evas_engine_software_x11 = @have_evas_engine_software_x11@ +have_evas_engine_software_xcb = @have_evas_engine_software_xcb@ +have_evas_engine_software_xlib = @have_evas_engine_software_xlib@ +have_lcov = @have_lcov@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ +lt_enable_auto_import = @lt_enable_auto_import@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkgconfig_requires_private = @pkgconfig_requires_private@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +pthread_cflags = @pthread_cflags@ +pthread_libs = @pthread_libs@ +release_info = @release_info@ +requirement_evas = @requirement_evas@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +version_info = @version_info@ +MAINTAINERCLEANFILES = Makefile.in +EXTRA_DIST = \ +evas_inline.x \ +evas_private.h \ +evas_options.h \ +evas_macros.h \ +evas_mmx.h \ +evas_common.h \ +evas_common_soft8.h \ +evas_common_soft16.h \ +evas_blend_ops.h + +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/lib/include/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/lib/include/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +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) +clean: clean-am + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-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 + + +# 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/libraries/evas/src/lib/include/evas_blend_ops.h b/libraries/evas/src/lib/include/evas_blend_ops.h new file mode 100644 index 0000000..1ada384 --- /dev/null +++ b/libraries/evas/src/lib/include/evas_blend_ops.h @@ -0,0 +1,378 @@ +#ifndef EVAS_BLEND_OPS_H +#define EVAS_BLEND_OPS_H + +#if defined BUILD_MMX || defined BUILD_SSE +#include "evas_mmx.h" +#endif + +#include "config.h" + +#ifdef NEED_SSE3 +# if defined BUILD_SSE3 +# include +# endif +#endif + +/* src pixel flags: */ + +/* pixels none */ +#define SP_N 0 +/* pixels (argb default) */ +#define SP 1 +/* pixels are rgb (ie. alphas == 255) */ +#define SP_AN 2 +/* pixels alpha are sparse */ +#define SP_AS 3 +/* src pixels flags count */ +#define SP_LAST 4 + +/* src mask flags: */ + +/* mask none */ +#define SM_N 0 +/* mask (alpha) */ +#define SM 1 +/* mask alphas are 'trivial - ie. only 0 or 255 */ +#define SM_AT 2 +/* mask alphas are sparse */ +#define SM_AS 3 +/* src mask flags count */ +#define SM_LAST 4 + +/* src color flags: */ + +/* color is 0xffffffff */ +#define SC_N 0 +/* color (argb default) */ +#define SC 1 +/* color is rgb (ie. 0xffrrggbb) */ +#define SC_AN 2 +/* color is 'alpha' (ie. 0xaaaaaaaa) */ +#define SC_AA 3 +/* src color flags count */ +#define SC_LAST 4 + +/* dst pixels flags: */ + +/* pixels (argb default) */ +#define DP 0 +/* pixels are rgb (ie. alphas == 255) */ +#define DP_AN 1 +/* dst pixels flags count */ +#define DP_LAST 2 + +/* cpu types flags */ + +/* none, bad news */ +#define CPU_N 0 +/* cpu C */ +#define CPU_C 1 +/* cpu MMX */ +#define CPU_MMX 2 +/* cpu SSE */ +#define CPU_SSE 3 +/* cpu SSE2 */ +#define CPU_SSE2 4 +/* cpu flags count */ +#define CPU_NEON 5 +/* CPU SSE3 */ +#define CPU_SSE3 6 +/* cpu flags count */ +#define CPU_LAST 7 + + +/* some useful constants */ + +extern const DATA32 ALPHA_255; +extern const DATA32 ALPHA_256; + +/* some useful C macros */ + +#define MUL4_256(a, r, g, b, c) \ + ( (((((c) >> 8) & 0xff0000) * (a)) & 0xff000000) + \ + (((((c) & 0xff0000) * (r)) >> 8) & 0xff0000) + \ + (((((c) & 0xff00) * (g)) >> 8) & 0xff00) + \ + ((((c) & 0xff) * (b)) >> 8) ) + +#define MUL3_256(r, g, b, c) \ + ( (((((c) & 0xff0000) * (r)) >> 8) & 0xff0000) + \ + (((((c) & 0xff00) * (g)) >> 8) & 0xff00) + \ + ((((c) & 0xff) * (b)) >> 8) ) + +#define MUL_256(a, c) \ + ( (((((c) >> 8) & 0x00ff00ff) * (a)) & 0xff00ff00) + \ + (((((c) & 0x00ff00ff) * (a)) >> 8) & 0x00ff00ff) ) + +#define MUL4_SYM(x, y) \ + ( ((((((x) >> 16) & 0xff00) * (((y) >> 16) & 0xff00)) + 0xff0000) & 0xff000000) + \ + ((((((x) >> 8) & 0xff00) * (((y) >> 16) & 0xff)) + 0xff00) & 0xff0000) + \ + ((((((x) & 0xff00) * ((y) & 0xff00)) + 0xff00) >> 16) & 0xff00) + \ + (((((x) & 0xff) * ((y) & 0xff)) + 0xff) >> 8) ) + +#define MUL3_SYM(x, y) \ + ( ((((((x) >> 8) & 0xff00) * (((y) >> 16) & 0xff)) + 0xff00) & 0xff0000) + \ + ((((((x) & 0xff00) * ((y) & 0xff00)) + 0xff00) >> 16) & 0xff00) + \ + (((((x) & 0xff) * ((y) & 0xff)) + 0xff) >> 8) ) + +#define MUL_SYM(a, x) \ + ( (((((x) >> 8) & 0x00ff00ff) * (a) + 0xff00ff) & 0xff00ff00) + \ + (((((x) & 0x00ff00ff) * (a) + 0xff00ff) >> 8) & 0x00ff00ff) ) + +#define MUL_A_256(a, c) \ + ( ((((c) >> 8) & 0x00ff0000) * (a)) & 0xff000000 ) + +#define MUL_A_SYM(a, c) \ + ( (((((c) >> 8) & 0x00ff0000) * (a)) + 0x00ff0000) & 0xff000000 ) + +#define INTERP_256(a, c0, c1) \ + ( (((((((c0) >> 8) & 0xff00ff) - (((c1) >> 8) & 0xff00ff)) * (a)) \ + + ((c1) & 0xff00ff00)) & 0xff00ff00) + \ + (((((((c0) & 0xff00ff) - ((c1) & 0xff00ff)) * (a)) >> 8) \ + + ((c1) & 0xff00ff)) & 0xff00ff) ) + +#define INTERP_RGB_256(a, c0, c1) \ + ( (((((((c0) >> 8) & 0xff) - (((c1) >> 8) & 0xff)) * (a)) \ + + ((c1) & 0xff00)) & 0xff00) + \ + (((((((c0) & 0xff00ff) - ((c1) & 0xff00ff)) * (a)) >> 8) \ + + ((c1) & 0xff00ff)) & 0xff00ff) ) + +#define INTERP_A_256(a, c0, c1) \ + ( (((((((c0) >> 8) & 0xff0000) - (((c1) >> 8) & 0xff0000)) * (a)) \ + + ((c1) & 0xff000000)) & 0xff000000) ) + + +/* some useful MMX macros */ + +#ifdef BUILD_MMX +#define MOV_A2R(a, mma) \ + movd_m2r(a, mma); \ + punpcklwd_r2r(mma, mma); \ + punpckldq_r2r(mma, mma); + +#define MOV_P2R(c, mmc, mmz) \ + movd_m2r(c, mmc); \ + punpcklbw_r2r(mmz, mmc); + +#define MOV_R2P(mmc, c, mmz) \ + packuswb_r2r(mmz, mmc); \ + movd_r2m(mmc, c); + +#define MUL4_256_R2R(mmx, mmy) \ + pmullw_r2r(mmx, mmy); \ + psrlw_i2r(8, mmy); + +#define MUL4_SYM_R2R(mmx, mmy, mm255) \ + pmullw_r2r(mmx, mmy); \ + paddw_r2r(mm255, mmy); \ + psrlw_i2r(8, mmy); + +#define MOV_RA2R(mmx, mma) \ + movq_r2r(mmx, mma); \ + punpckhwd_r2r(mma, mma); \ + punpckhdq_r2r(mma, mma); + +#define MOV_PA2R(c, mma) \ + movd_m2r(c, mma); \ + punpcklbw_r2r(mma, mma); \ + punpckhwd_r2r(mma, mma); \ + punpckhdq_r2r(mma, mma); + +#define INTERP_256_R2R(mma, mmx, mmy, mm255) \ + psubw_r2r(mmy, mmx); \ + pmullw_r2r(mma, mmx); \ + psrlw_i2r(8, mmx); \ + paddw_r2r(mmx, mmy); \ + pand_r2r(mm255, mmy); + +#endif + + +/* some useful SSE3 inline functions */ + +#ifdef NEED_SSE3 +#ifdef BUILD_SSE3 + +static __m128i GA_MASK_SSE3; +static __m128i RB_MASK_SSE3; +static __m128i SYM4_MASK_SSE3; +static __m128i RGB_MASK_SSE3; +//static __m128i A_MASK_SSE3; + +static __m128i ALPHA_SSE3; + +EFL_ALWAYS_INLINE __m128i +mul_256_sse3(__m128i a, __m128i c) { + + /* prepare alpha for word multiplication */ + __m128i a_l = a; + __m128i a_h = a; + a_l = _mm_unpacklo_epi16(a_l, a_l); + a_h = _mm_unpackhi_epi16(a_h, a_h); + __m128i a0 = (__m128i) _mm_shuffle_ps( (__m128)a_l, (__m128)a_h, 0x88); + + /* first half of calc */ + __m128i c0 = c; + c0 = _mm_srli_epi32(c0, 8); + c0 = _mm_and_si128(GA_MASK_SSE3, c0); + c0 = _mm_mullo_epi16(a0, c0); + c0 = _mm_and_si128(RB_MASK_SSE3, c0); + + /* second half of calc */ + __m128i c1 = c; + c1 = _mm_and_si128(GA_MASK_SSE3, c1); + c1 = _mm_mullo_epi16(a0, c1); + c1 = _mm_srli_epi32(c1, 8); + c1 = _mm_and_si128(GA_MASK_SSE3, c1); + + /* combine */ + return _mm_add_epi32(c0, c1); +} + +EFL_ALWAYS_INLINE __m128i +sub4_alpha_sse3(__m128i c) { + + __m128i c0 = c; + + c0 = _mm_srli_epi32(c0, 24); + return _mm_sub_epi32(ALPHA_SSE3, c0); +} + +EFL_ALWAYS_INLINE __m128i +interp4_256_sse3(__m128i a, __m128i c0, __m128i c1) +{ + const __m128i zero = _mm_setzero_si128(); + + __m128i a_l = a; + __m128i a_h = a; + a_l = _mm_unpacklo_epi16(a_l, a_l); + a_h = _mm_unpackhi_epi16(a_h, a_h); + + __m128i a_t = _mm_slli_epi64(a_l, 32); + __m128i a_t0 = _mm_slli_epi64(a_h, 32); + + a_l = _mm_add_epi32(a_l, a_t); + a_h = _mm_add_epi32(a_h, a_t0); + + __m128i c0_l = c0; + __m128i c0_h = c0; + + c0_l = _mm_unpacklo_epi8(c0_l, zero); + c0_h = _mm_unpackhi_epi8(c0_h, zero); + + __m128i c1_l = c1; + __m128i c1_h = c1; + + c1_l = _mm_unpacklo_epi8(c1_l, zero); + c1_h = _mm_unpackhi_epi8(c1_h, zero); + + __m128i cl_sub = _mm_sub_epi16(c0_l, c1_l); + __m128i ch_sub = _mm_sub_epi16(c0_h, c1_h); + + cl_sub = _mm_mullo_epi16(cl_sub, a_l); + ch_sub = _mm_mullo_epi16(ch_sub, a_h); + + __m128i c1ls = _mm_slli_epi16(c1_l, 8); + __m128i c1hs = _mm_slli_epi16(c1_h, 8); + + cl_sub = _mm_add_epi16(cl_sub, c1ls); + ch_sub = _mm_add_epi16(ch_sub, c1hs); + + cl_sub = _mm_and_si128(cl_sub, RB_MASK_SSE3); + ch_sub = _mm_and_si128(ch_sub, RB_MASK_SSE3); + + cl_sub = _mm_srli_epi64(cl_sub, 8); + ch_sub = _mm_srli_epi64(ch_sub, 8); + + cl_sub = _mm_packus_epi16(cl_sub, cl_sub); + ch_sub = _mm_packus_epi16(ch_sub, ch_sub); + + return (__m128i) _mm_shuffle_ps( (__m128)cl_sub, (__m128)ch_sub, 0x44); +} + +EFL_ALWAYS_INLINE __m128i +mul_sym_sse3(__m128i a, __m128i c) { + + /* Prepare alpha for word mult */ + __m128i a_l = a; + __m128i a_h = a; + a_l = _mm_unpacklo_epi16(a_l, a_l); + a_h = _mm_unpackhi_epi16(a_h, a_h); + __m128i a0 = (__m128i) _mm_shuffle_ps( (__m128)a_l, (__m128)a_h, 0x88); + + /* first part */ + __m128i c0 = c; + c0 = _mm_srli_epi32(c0, 8); + c0 = _mm_and_si128(GA_MASK_SSE3, c0); + c0 = _mm_mullo_epi16(a0, c0); + c0 = _mm_add_epi32(c0, GA_MASK_SSE3); + c0 = _mm_and_si128(RB_MASK_SSE3, c0); + + /* second part */ + __m128i c1 = c; + c1 = _mm_and_si128(GA_MASK_SSE3, c1); + c1 = _mm_mullo_epi16(a0, c1); + c1 = _mm_add_epi32(c1, GA_MASK_SSE3); + c1 = _mm_srli_epi32(c1, 8); + c1 = _mm_and_si128(GA_MASK_SSE3, c1); + + return _mm_add_epi32(c0, c1); +} + +EFL_ALWAYS_INLINE __m128i +mul4_sym_sse3(__m128i x, __m128i y) { + + const __m128i zero = _mm_setzero_si128(); + + __m128i x_l = _mm_unpacklo_epi8(x, zero); + __m128i x_h = _mm_unpackhi_epi8(x, zero); + + __m128i y_l = _mm_unpacklo_epi8(y, zero); + __m128i y_h = _mm_unpackhi_epi8(y, zero); + + __m128i r_l = _mm_mullo_epi16(x_l, y_l); + __m128i r_h = _mm_mullo_epi16(x_h, y_h); + + r_l = _mm_add_epi16(r_l, SYM4_MASK_SSE3); + r_h = _mm_add_epi16(r_h, SYM4_MASK_SSE3); + + r_l = _mm_srli_epi16(r_l, 8); + r_h = _mm_srli_epi16(r_h, 8); + + return _mm_packus_epi16(r_l, r_h); +} + +EFL_ALWAYS_INLINE __m128i +mul3_sym_sse3(__m128i x, __m128i y) { + + __m128i res = mul4_sym_sse3(x, y); + return _mm_and_si128(res, RGB_MASK_SSE3); +} + +#define LOOP_ALIGNED_U1_A48_SSE3(DEST, LENGTH, UOP, A4OP, A8OP) \ + { \ + while((uintptr_t)DEST & 0xF && LENGTH) UOP \ + \ + while(LENGTH) { \ + switch(LENGTH) { \ + case 3: UOP \ + case 2: UOP \ + case 1: UOP \ + break; \ + case 7: \ + case 6: \ + case 5: \ + case 4: \ + A4OP \ + break; \ + default: \ + A8OP \ + break; \ + } \ + } \ + } + + +#endif +#endif + +#endif diff --git a/libraries/evas/src/lib/include/evas_common.h b/libraries/evas/src/lib/include/evas_common.h new file mode 100644 index 0000000..f817202 --- /dev/null +++ b/libraries/evas/src/lib/include/evas_common.h @@ -0,0 +1,1242 @@ +#ifndef EVAS_COMMON_H +#define EVAS_COMMON_H + +#ifdef HAVE_CONFIG_H +# include "config.h" /* so that EAPI in Evas.h is correctly defined */ +#endif + +#ifdef HAVE_EVIL +# include +#endif + +#ifdef HAVE_ESCAPE +# include +#endif + +#include +#include "Evas.h" +//#include "Evas_GL.h" + +#ifdef HAVE_PIXMAN +#include +#endif + +#include +#include +#include + +#ifndef HAVE_LROUND +/* right now i dont care about rendering bugs on platforms without lround + (e.g. windows/vc++... yay!) + FIXME: http://cgit.freedesktop.org/cairo/tree/src/cairo-misc.c#n487 +*/ +#define lround(x) (((x) < 0) ? (long int)ceil((x) - 0.5) : (long int)floor((x) + 0.5)) +#endif + +/* macros needed to log message through eina_log */ +extern EAPI int _evas_log_dom_global; +#ifdef _EVAS_DEFAULT_LOG_DOM +# undef _EVAS_DEFAULT_LOG_DOM +#endif +#define _EVAS_DEFAULT_LOG_DOM _evas_log_dom_global + +#ifdef EVAS_DEFAULT_LOG_COLOR +# undef EVAS_DEFAULT_LOG_COLOR +#endif +#define EVAS_DEFAULT_LOG_COLOR EINA_COLOR_BLUE + +#ifdef ERR +# undef ERR +#endif +#define ERR(...) EINA_LOG_DOM_ERR(_EVAS_DEFAULT_LOG_DOM, __VA_ARGS__) + +#ifdef DBG +# undef DBG +#endif +#define DBG(...) EINA_LOG_DOM_DBG(_EVAS_DEFAULT_LOG_DOM, __VA_ARGS__) + +#ifdef INF +# undef INF +#endif +#define INF(...) EINA_LOG_DOM_INFO(_EVAS_DEFAULT_LOG_DOM, __VA_ARGS__) + +#ifdef WRN +# undef WRN +#endif +#define WRN(...) EINA_LOG_DOM_WARN(_EVAS_DEFAULT_LOG_DOM, __VA_ARGS__) + +#ifdef CRIT +# undef CRIT +#endif +#define CRIT(...) EINA_LOG_DOM_CRIT(_EVAS_DEFAULT_LOG_DOM, __VA_ARGS__) + +#include "evas_options.h" + +#if defined(__ARM_ARCH_3M__) +# define __ARM_ARCH__ 40 +#endif +#if defined(__ARM_ARCH_4__) +# define __ARM_ARCH__ 40 +#endif +#if defined(__ARM_ARCH_4T__) +# define __ARM_ARCH__ 41 +#endif + +#if defined(__ARM_ARCH_5__) +# define __ARM_ARCH__ 50 +#endif +#if defined(__ARM_ARCH_5T__) +# define __ARM_ARCH__ 51 +#endif +#if defined(__ARM_ARCH_5E__) +# define __ARM_ARCH__ 52 +#endif +#if defined(__ARM_ARCH_5TE__) +# define __ARM_ARCH__ 53 +#endif +#if defined(__ARM_ARCH_5TEJ__) +# define __ARM_ARCH__ 54 +#endif + +#if defined(__ARM_ARCH_6__) +# define __ARM_ARCH__ 60 +#endif +#if defined(__ARM_ARCH_6J__) +# define __ARM_ARCH__ 61 +#endif +#if defined(__ARM_ARCH_6K__) +# define __ARM_ARCH__ 62 +#endif +#if defined(__ARM_ARCH_6Z__) +# define __ARM_ARCH__ 63 +#endif +#if defined(__ARM_ARCH_6ZK__) +# define __ARM_ARCH__ 64 +#endif +#if defined(__ARM_ARCH_6T2__) +# define __ARM_ARCH__ 65 +#endif + +#if defined(__ARM_ARCH_7__) +# define __ARM_ARCH__ 70 +#endif +#if defined(__ARM_ARCH_7A__) +# define __ARM_ARCH__ 71 +#endif +#if defined(__ARM_ARCH_7R__) +# define __ARM_ARCH__ 72 +#endif +#if defined(__ARM_ARCH_7M__) +# define __ARM_ARCH__ 73 +#endif + +#ifndef BUILD_PTHREAD +# undef BUILD_PIPE_RENDER +#endif + +#if defined(BUILD_ASYNC_PRELOAD) && !defined(BUILD_PTHREAD) +# define BUILD_PTHREAD +#endif + +#ifdef BUILD_PTHREAD + +#define LK(x) Eina_Lock x +#define LKI(x) eina_lock_new(&(x)) +#define LKD(x) eina_lock_free(&(x)) +#define LKL(x) eina_lock_take(&(x)) +#define LKT(x) eina_lock_take_try(&(x)) +#define LKU(x) eina_lock_release(&(x)) +#define LKDBG(x) eina_lock_debug(&(x)) + +# define TH(x) pthread_t x +# define THI(x) int x +# define TH_MAX 8 + +/* for rwlocks */ +#define RWLK(x) pthread_rwlock_t x +#define RWLKI(x) pthread_rwlock_init(&(x), NULL) +#define RWLKD(x) pthread_rwlock_destroy(&(x)) +#define RDLKL(x) pthread_rwlock_rdlock(&(x)) +#define WRLKL(x) pthread_rwlock_wrlock(&(x)) +#define RWLKU(x) pthread_rwlock_unlock(&(x)) + + +// even though in theory having every Nth rendered line done by a different +// thread might even out load across threads - it actually slows things down. +//#define EVAS_SLI 1 + +#else +# define LK(x) +# define LKI(x) +# define LKD(x) +# define LKL(x) +# define LKT(x) 1 +# define LKU(x) +# define TH(x) +# define THI(x) +# define TH_MAX 0 +# define LKDBG(x) + +/* for rwlocks */ +#define RWLK(x) +#define RWLKI(x) +#define RWLKD(x) +#define RDLKL(x) +#define WRLKL(x) +#define RWLKU(x) + +#endif + +#ifdef HAVE_ALLOCA_H +# include +#elif defined __GNUC__ +# define alloca __builtin_alloca +#elif defined _AIX +# define alloca __alloca +#elif defined _MSC_VER +# include +# define alloca _alloca +#else +# include +# ifdef __cplusplus +extern "C" +# endif +void *alloca (size_t); +#endif + +#include +#include +#include +#include +#include +#include +#include + +#ifndef _MSC_VER +# include +#endif + +#include +#include FT_FREETYPE_H +#include FT_GLYPH_H +#include FT_SIZES_H +#include FT_MODULE_H + +#ifdef __GNUC__ +# if __GNUC__ >= 4 +// BROKEN in gcc 4 on amd64 +//# pragma GCC visibility push(hidden) +# endif +#define LIKELY(x) __builtin_expect(!!(x), 1) +#define UNLIKELY(x) __builtin_expect(!!(x), 0) +#else +#define LIKELY(x) (x) +#define UNLIKELY(x) (x) +#endif + +/*****************************************************************************/ + +/* use exact rects for updates not tiles */ +/* #define RECTUPDATE */ +#define TILESIZE 8 +#define IMG_MAX_SIZE 65000 + +#define IMG_TOO_BIG(w, h) \ + ((((unsigned long long)w) * ((unsigned long long)h)) >= \ + ((1ULL << (29 * (sizeof(void *) / 4))) - 2048)) + +#ifdef BUILD_SMALL_DITHER_MASK +# define DM_TABLE _evas_dither_44 +# define DM_SIZE 4 +# define DM_BITS 4 +# define DM_DIV 16 +# define USE_DITHER_44 1 +#else +# define DM_TABLE _evas_dither_128128 +# define DM_SIZE 128 +# define DM_BITS 6 +# define DM_DIV 64 +# define USE_DITHER_128128 1 +#endif + +#define DM_MSK (DM_SIZE - 1) +#define DM_SHF(_b) (DM_BITS - (8 - _b)) +/* Supports negative right shifts */ +#define DM_SHR(x, _b) ((DM_SHF(_b) >= 0) ? \ + ((x) >> DM_SHF(_b)) : ((x) << -DM_SHF(_b))) + +/* if more than 1/ALPHA_SPARSE_INV_FRACTION is "alpha" (1-254) then sparse + * alpha flag gets set */ +#define ALPHA_SPARSE_INV_FRACTION 3 + +/*****************************************************************************/ + +#if defined(__ARM_ARCH_3M__) +# define __ARM_ARCH__ 40 +#endif +#if defined(__ARM_ARCH_4__) +# define __ARM_ARCH__ 40 +#endif +#if defined(__ARM_ARCH_4T__) +# define __ARM_ARCH__ 41 +#endif + +#if defined(__ARM_ARCH_5__) +# define __ARM_ARCH__ 50 +#endif +#if defined(__ARM_ARCH_5T__) +# define __ARM_ARCH__ 51 +#endif +#if defined(__ARM_ARCH_5E__) +# define __ARM_ARCH__ 52 +#endif +#if defined(__ARM_ARCH_5TE__) +# define __ARM_ARCH__ 53 +#endif +#if defined(__ARM_ARCH_5TEJ__) +# define __ARM_ARCH__ 54 +#endif + +#if defined(__ARM_ARCH_6__) +# define __ARM_ARCH__ 60 +#endif +#if defined(__ARM_ARCH_6J__) +# define __ARM_ARCH__ 61 +#endif +#if defined(__ARM_ARCH_6K__) +# define __ARM_ARCH__ 62 +#endif +#if defined(__ARM_ARCH_6Z__) +# define __ARM_ARCH__ 63 +#endif +#if defined(__ARM_ARCH_6ZK__) +# define __ARM_ARCH__ 64 +#endif +#if defined(__ARM_ARCH_6T2__) +# define __ARM_ARCH__ 65 +#endif + +#if defined(__ARM_ARCH_7__) +# define __ARM_ARCH__ 70 +#endif +#if defined(__ARM_ARCH_7A__) +# define __ARM_ARCH__ 71 +#endif +#if defined(__ARM_ARCH_7R__) +# define __ARM_ARCH__ 72 +#endif +#if defined(__ARM_ARCH_7M__) +# define __ARM_ARCH__ 73 +#endif + +#if defined(__ARM_ARCH__) && (__ARM_ARCH__ >= 52) +/* tested on ARMv6 (arm1136j-s), Nokia N800 CPU */ +#define pld(addr, off) \ + __asm__("pld [%[address], %[offset]]":: \ + [address] "r" (addr), [offset] "i" (off)) +#else +#define pld(addr, off) +#endif /* __ARMEL__ */ + +/*****************************************************************************/ + +#define UNROLL2(op...) op op +#define UNROLL4(op...) UNROLL2(op) UNROLL2(op) +#define UNROLL8(op...) UNROLL4(op) UNROLL4(op) +#define UNROLL16(op...) UNROLL8(op) UNROLL8(op) + +#define UNROLL8_PLD_WHILE(start, size, end, op) \ + pld(start, 0); \ + end = start + (size & ~7); \ + while (start < end) \ + { \ + pld(start, 32); \ + UNROLL8(op); \ + } \ + end += (size & 7); \ + pld(start, 32); \ + while (start < end) \ + { \ + op; \ + } + +/*****************************************************************************/ + +typedef unsigned long long DATA64; +typedef unsigned int DATA32; +typedef unsigned short DATA16; +typedef unsigned char DATA8; + +typedef struct _Image_Entry Image_Entry; +typedef struct _Image_Entry_Flags Image_Entry_Flags; +typedef struct _Image_Entry_Frame Image_Entry_Frame; +typedef struct _Image_Timestamp Image_Timestamp; +typedef struct _Engine_Image_Entry Engine_Image_Entry; +typedef struct _Evas_Cache_Target Evas_Cache_Target; +typedef struct _Evas_Preload_Pthread Evas_Preload_Pthread; + +typedef struct _RGBA_Image_Loadopts RGBA_Image_Loadopts; +#ifdef BUILD_PIPE_RENDER +typedef struct _RGBA_Pipe_Op RGBA_Pipe_Op; +typedef struct _RGBA_Pipe RGBA_Pipe; +typedef struct _RGBA_Pipe_Thread_Info RGBA_Pipe_Thread_Info; +#endif +typedef struct _RGBA_Image RGBA_Image; +typedef struct _RGBA_Image_Span RGBA_Image_Span; +typedef struct _RGBA_Draw_Context RGBA_Draw_Context; +typedef struct _RGBA_Polygon_Point RGBA_Polygon_Point; +typedef struct _RGBA_Map_Point RGBA_Map_Point; +typedef struct _RGBA_Font RGBA_Font; +typedef struct _RGBA_Font_Int RGBA_Font_Int; +typedef struct _RGBA_Font_Source RGBA_Font_Source; +typedef struct _RGBA_Font_Glyph RGBA_Font_Glyph; +typedef struct _RGBA_Gfx_Compositor RGBA_Gfx_Compositor; + +typedef struct _Cutout_Rect Cutout_Rect; +typedef struct _Cutout_Rects Cutout_Rects; + +typedef struct _Convert_Pal Convert_Pal; + +typedef struct _Tilebuf Tilebuf; +typedef struct _Tilebuf_Tile Tilebuf_Tile; +typedef struct _Tilebuf_Rect Tilebuf_Rect; + +typedef struct _Evas_Common_Transform Evas_Common_Transform; + +// RGBA_Map_Point +// all coords are 20.12 +// fp type - an int for now +typedef int FPc; +// fp # of bits of float accuracy +#define FP 8 +// fp half (half of an fp unit) +#define FPH (1 << (FP - 1)) +// one fp unit +#define FP1 (1 << (FP)) + +/* +typedef struct _Regionbuf Regionbuf; +typedef struct _Regionspan Regionspan; +*/ + +typedef void (*RGBA_Gfx_Func) (DATA32 *src, DATA8 *mask, DATA32 col, DATA32 *dst, int len); +typedef void (*RGBA_Gfx_Pt_Func) (DATA32 src, DATA8 mask, DATA32 col, DATA32 *dst); +typedef void (*Gfx_Func_Copy) (DATA32 *src, DATA32 *dst, int len); + +typedef void (*Gfx_Func_Convert) (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal); + +#include "../cache/evas_cache.h" + +/*****************************************************************************/ + +typedef enum _RGBA_Image_Flags +{ + RGBA_IMAGE_NOTHING = (0), +/* RGBA_IMAGE_HAS_ALPHA = (1 << 0), */ + RGBA_IMAGE_IS_DIRTY = (1 << 1), + RGBA_IMAGE_INDEXED = (1 << 2), + RGBA_IMAGE_ALPHA_ONLY = (1 << 3), + RGBA_IMAGE_ALPHA_TILES = (1 << 4), +/* RGBA_IMAGE_ALPHA_SPARSE = (1 << 5), */ +/* RGBA_IMAGE_LOADED = (1 << 6), */ +/* RGBA_IMAGE_NEED_DATA = (1 << 7) */ + RGBA_IMAGE_TODO_LOAD = (1 << 8), +} RGBA_Image_Flags; + +typedef enum _Convert_Pal_Mode +{ + PAL_MODE_NONE, + PAL_MODE_MONO, + PAL_MODE_GRAY4, + PAL_MODE_GRAY16, + PAL_MODE_GRAY64, + PAL_MODE_GRAY256, + PAL_MODE_RGB111, + PAL_MODE_RGB121, + PAL_MODE_RGB221, + PAL_MODE_RGB222, + PAL_MODE_RGB232, + PAL_MODE_RGB332, + PAL_MODE_RGB666, + PAL_MODE_LAST +} Convert_Pal_Mode; + +typedef enum _CPU_Features +{ + CPU_FEATURE_C = 0, + CPU_FEATURE_MMX = (1 << 0), + CPU_FEATURE_MMX2 = (1 << 1), + CPU_FEATURE_SSE = (1 << 2), + CPU_FEATURE_ALTIVEC = (1 << 3), + CPU_FEATURE_VIS = (1 << 4), + CPU_FEATURE_VIS2 = (1 << 5), + CPU_FEATURE_NEON = (1 << 6), + CPU_FEATURE_SSE3 = (1 << 7) +} CPU_Features; + +typedef enum _Font_Hint_Flags +{ + FONT_NO_HINT, + FONT_AUTO_HINT, + FONT_BYTECODE_HINT +} Font_Hint_Flags; + +typedef enum _Font_Rend_Flags +{ + FONT_REND_REGULAR = 0, + FONT_REND_SLANT = (1 << 0), + FONT_REND_WEIGHT = (1 << 1), +} Font_Rend_Flags; + +/*****************************************************************************/ + +#if 0 // filtering disabled +typedef struct _Filtered_Image Filtered_Image; +#endif + +struct _RGBA_Image_Loadopts +{ + int scale_down_by; // if > 1 then use this + double dpi; // if > 0.0 use this + unsigned int w, h; // if > 0 use this + unsigned int degree;//if>0 there is some info related with rotation + struct { + unsigned int x, y, w, h; + } region; + + Eina_Bool orientation; // if EINA_TRUE => should honor orientation information provided by file (like jpeg exif info) +}; + +struct _Image_Entry_Flags +{ + Eina_Bool loaded : 1; + Eina_Bool in_progress : 1; + Eina_Bool dirty : 1; + Eina_Bool activ : 1; + + Eina_Bool need_data : 1; + Eina_Bool lru_nodata : 1; + Eina_Bool cached : 1; + Eina_Bool alpha : 1; + + Eina_Bool lru : 1; + Eina_Bool alpha_sparse : 1; +#ifdef BUILD_ASYNC_PRELOAD + Eina_Bool preload_done : 1; + Eina_Bool delete_me : 1; + Eina_Bool pending : 1; +#endif + Eina_Bool animated : 1; + Eina_Bool rotated : 1; +}; + +struct _Image_Entry_Frame +{ + int index; + DATA32 *data; /* frame decoding data */ + void *info; /* special image type info */ + Eina_Bool loaded : 1; +}; + +struct _Evas_Cache_Target +{ + EINA_INLIST; + const void *target; + void *data; +}; + +struct _Image_Timestamp +{ + time_t mtime; + off_t size; + ino_t ino; +#ifdef _STAT_VER_LINUX + unsigned long int mtime_nsec; +#endif +}; + +struct _Image_Entry +{ + EINA_INLIST; + + Evas_Cache_Image *cache; + + const char *cache_key; + + const char *file; + const char *key; + + Evas_Cache_Target *targets; + Evas_Preload_Pthread *preload; + + Image_Timestamp tstamp; + + int references; +#ifdef EVAS_FRAME_QUEUING + LK(lock_references); // needed for accessing references +#endif + +#ifdef BUILD_PIPE_RENDER + RGBA_Pipe *pipe; +#ifdef EVAS_FRAME_QUEUING + LK(ref_fq_add); + LK(ref_fq_del); + Eina_Condition cond_fq_del; + int ref_fq[2]; // ref_fq[0] is for addition, ref_fq[1] is for deletion +#endif +#endif + + unsigned char scale; + + RGBA_Image_Loadopts load_opts; + int space; + unsigned int w; + unsigned int h; + + struct + { + unsigned int w; + unsigned int h; + } allocated; + + struct + { + void *module; + void *loader; + } info; + +#ifdef BUILD_ASYNC_PRELOAD + LK(lock); + LK(lock_cancel); + Eina_Bool unload_cancel : 1; +#endif + + Image_Entry_Flags flags; + Evas_Image_Scale_Hint scale_hint; + void *data1, *data2; + int server_id; + int connect_num; + int channel; + int load_error; + + /* for animation feature */ + int frame_count; + Evas_Image_Animated_Loop_Hint loop_hint; + int loop_count; + int cur_frame; + Eina_List *frames; +}; + +struct _Engine_Image_Entry +{ + EINA_INLIST; + + /* Upper Engine data. */ + Image_Entry *src; + + /* Cache stuff. */ + Evas_Cache_Engine_Image *cache; + const char *cache_key; + + struct + { + Eina_Bool cached : 1; + Eina_Bool activ : 1; + Eina_Bool dirty : 1; + Eina_Bool loaded : 1; + Eina_Bool need_parent : 1; + } flags; + + int references; + int w; + int h; +}; + +struct _Cutout_Rect +{ + int x, y, w, h; +}; + +struct _Cutout_Rects +{ + Cutout_Rect* rects; + int active; + int max; +}; + +struct _Evas_Common_Transform +{ + float mxx, mxy, mxz; + float myx, myy, myz; + float mzx, mzy, mzz; +}; + +struct _RGBA_Draw_Context +{ + struct { + Eina_Bool use : 1; + DATA32 col; + } mul; + struct { + DATA32 col; + } col; + struct RGBA_Draw_Context_clip { + int x, y, w, h; + Eina_Bool use : 1; + } clip; + struct { + int x, y, w, h; + RGBA_Image *mask; + } mask; + Cutout_Rects cutout; + struct { + struct { + void *(*gl_new) (void *data, RGBA_Font_Glyph *fg); + void (*gl_free) (void *ext_dat); + void (*gl_draw) (void *data, void *dest, void *context, RGBA_Font_Glyph *fg, int x, int y); + } func; + void *data; + } font_ext; + struct { + int color_space; + } interpolation; + struct { + int y, h; + } sli; + int render_op; + Eina_Bool anti_alias : 1; +}; + +#ifdef BUILD_PIPE_RENDER +#include "../engines/common/evas_map_image.h" +#include "../engines/common/evas_text_utils.h" + +struct _RGBA_Pipe_Op +{ + RGBA_Draw_Context context; + void (*op_func) (RGBA_Image *dst, RGBA_Pipe_Op *op, RGBA_Pipe_Thread_Info *info); + void (*free_func) (RGBA_Pipe_Op *op); + + union { + struct { + int x, y, w, h; + } rect; + struct { + int x0, y0, x1, y1; + } line; + struct { + RGBA_Polygon_Point *points; + } poly; + struct { + RGBA_Font *font; + int x, y; + Evas_Text_Props intl_props; + } text; + struct { + RGBA_Image *src; + int sx, sy, sw, sh, dx, dy, dw, dh; + int smooth; + char *text; + } image; + struct { + RGBA_Image *src; + RGBA_Map_Point *p; + int npoints; + int smooth; + int level; + } map; + } op; +}; + +#define PIPE_LEN 256 + +struct _RGBA_Pipe +{ + EINA_INLIST; + int op_num; + RGBA_Pipe_Op op[PIPE_LEN]; +}; + +struct _RGBA_Pipe_Thread_Info +{ + RGBA_Image *im; + int x, y, w, h; +}; +#endif + +struct _RGBA_Image +{ + Image_Entry cache_entry; + + RGBA_Image_Flags flags; + struct + { +/* void *module; */ +/* void *loader; */ +/* char *real_file; */ + char *comment; +// int format; + } info; + + void *extended_info; + int ref; + +/* unsigned char scale; */ + + /* Colorspace stuff. */ + struct { + void *data; + Eina_Bool no_free : 1; + Eina_Bool dirty : 1; + } cs; + + /* RGBA stuff */ + struct { + DATA32 *data; + Eina_Bool no_free : 1; + } image; + + struct { + DATA8 *mask; + Eina_Bool dirty: 1; + } mask; + +#if 0 // filtering disabled + Eina_List *filtered; +#endif + + struct { + LK(lock); + Eina_List *list; + unsigned long long orig_usage; + unsigned long long usage_count; + int populate_count; + unsigned long long newest_usage; + unsigned long long newest_usage_count; + } cache; + +#ifdef HAVE_PIXMAN + struct { + pixman_image_t *im; + } pixman; +#endif +}; + +struct _RGBA_Polygon_Point +{ + EINA_INLIST; + int x, y; +}; + +struct _RGBA_Map_Point +{ + FPc x, y; // x, y screenspace + float fx, fy, fz; // x, y, z in floats +// FPc x3, y3; // x, y 3d space + FPc z; // z in world space. optional + FPc u, v; // u, v in tex coords + DATA32 col; // color at this point + // for perspective correctness - only point 0 has relevant info + FPc px, py, z0, foc; +}; + +#if 0 // filtering disabled +struct _Filtered_Image +{ + void *key; + size_t keylen; + RGBA_Image *image; + int ref; +}; +#endif + +// for fonts... +///// +typedef struct _Fash_Item_Index_Map Fash_Item_Index_Map; +typedef struct _Fash_Int_Map Fash_Int_Map; +typedef struct _Fash_Int_Map2 Fash_Int_Map2; +typedef struct _Fash_Int Fash_Int; +struct _Fash_Item_Index_Map +{ + RGBA_Font_Int *fint; + int index; +}; +struct _Fash_Int_Map +{ + Fash_Item_Index_Map item[256]; +}; +struct _Fash_Int_Map2 +{ + Fash_Int_Map *bucket[256]; +}; +struct _Fash_Int +{ + Fash_Int_Map2 *bucket[256]; + void (*freeme) (Fash_Int *fash); +}; + +///// +typedef struct _Fash_Glyph_Map Fash_Glyph_Map; +typedef struct _Fash_Glyph_Map2 Fash_Glyph_Map2; +typedef struct _Fash_Glyph Fash_Glyph; +struct _Fash_Glyph_Map +{ + RGBA_Font_Glyph *item[256]; +}; +struct _Fash_Glyph_Map2 +{ + Fash_Glyph_Map *bucket[256]; +}; +struct _Fash_Glyph +{ + Fash_Glyph_Map2 *bucket[256]; + void (*freeme) (Fash_Glyph *fash); +}; +///// + +struct _RGBA_Font +{ + Eina_List *fonts; + Fash_Int *fash; + Font_Hint_Flags hinting; + int references; +#ifdef EVAS_FRAME_QUEUING + int ref_fq[2]; //ref_fq[0] is for addition, ref_fq[1] is for deletion + Eina_Condition cond_fq_del; + LK(ref_fq_add); + LK(ref_fq_del); +#endif + LK(lock); + unsigned char sizeok : 1; +}; + +#include "../engines/common/evas_font_ot.h" + +struct _RGBA_Font_Int +{ + EINA_INLIST; + RGBA_Font_Source *src; + Eina_Hash *kerning; + Fash_Glyph *fash; + unsigned int size; + int real_size; + int max_h; + int references; + int usage; + struct { + FT_Size size; +#ifdef USE_HARFBUZZ + void *hb_font; +#endif + } ft; + LK(ft_mutex); + Font_Hint_Flags hinting; + Font_Rend_Flags wanted_rend; /* The wanted rendering style */ + Font_Rend_Flags runtime_rend; /* The rendering we need to do on runtime + in order to comply with the wanted_rend. */ + unsigned char sizeok : 1; + unsigned char inuse : 1; +}; + +struct _RGBA_Font_Source +{ + const char *name; + const char *file; + void *data; + unsigned int current_size; + int data_size; + int references; + struct { + int orig_upem; + FT_Face face; + } ft; +}; + +struct _RGBA_Font_Glyph +{ + FT_UInt index; + FT_Glyph glyph; + FT_BitmapGlyph glyph_out; + /* this is a problem - only 1 engine at a time can extend such a font... grrr */ + void *ext_dat; + void (*ext_dat_free) (void *ext_dat); + RGBA_Font_Int *fi; +}; + +struct _RGBA_Gfx_Compositor +{ + const char *name; + + void (*init)(void); + void (*shutdown)(void); + + RGBA_Gfx_Func (*composite_pixel_span_get)(RGBA_Image *src, RGBA_Image *dst, int pixels); + RGBA_Gfx_Func (*composite_color_span_get)(DATA32 col, RGBA_Image *dst, int pixels); + RGBA_Gfx_Func (*composite_pixel_color_span_get)(RGBA_Image *src, DATA32 col, RGBA_Image *dst, int pixels); + RGBA_Gfx_Func (*composite_mask_color_span_get)(DATA32 col, RGBA_Image *dst, int pixels); + RGBA_Gfx_Func (*composite_pixel_mask_span_get)(RGBA_Image *src, RGBA_Image *dst, int pixels); + + RGBA_Gfx_Pt_Func (*composite_pixel_pt_get)(Image_Entry_Flags src_flags, RGBA_Image *dst); + RGBA_Gfx_Pt_Func (*composite_color_pt_get)(DATA32 col, RGBA_Image *dst); + RGBA_Gfx_Pt_Func (*composite_pixel_color_pt_get)(Image_Entry_Flags src_flags, DATA32 col, RGBA_Image *dst); + RGBA_Gfx_Pt_Func (*composite_mask_color_pt_get)(DATA32 col, RGBA_Image *dst); + RGBA_Gfx_Pt_Func (*composite_pixel_mask_pt_get)(Image_Entry_Flags src_flags, RGBA_Image *dst); +}; + +#define EVAS_RECT_SPLIT 1 +#ifdef EVAS_RECT_SPLIT +typedef struct list_node list_node_t; +typedef struct list list_t; +typedef struct rect rect_t; +typedef struct rect_node rect_node_t; + +struct list_node +{ + struct list_node *next; +}; + +struct list +{ + struct list_node *head; + struct list_node *tail; +}; + +struct rect +{ + short left; + short top; + short right; + short bottom; + short width; + short height; + int area; +}; + +struct rect_node +{ + struct list_node _lst; + struct rect rect; +}; +#endif /* EVAS_RECT_SPLIT */ + +struct _Tilebuf +{ + int outbuf_w; + int outbuf_h; + + struct { + int w, h; + } tile_size; + + struct { + int x, y, w, h; + } prev_add, prev_del; +#ifdef RECTUPDATE +/* + Regionbuf *rb; + */ +#elif defined(EVAS_RECT_SPLIT) + int need_merge; + list_t rects; +#else +/* + struct { + int w, h; + Tilebuf_Tile *tiles; + } tiles; + */ +#endif +}; + +struct _Tilebuf_Tile +{ + Eina_Bool redraw : 1; +/* FIXME: need these flags later - but not now */ +/* + Eina_Bool done : 1; + Eina_Bool edge : 1; + Eina_Bool from : 1; + + struct { + int dx, dy; + } vector; + */ +}; + +struct _Tilebuf_Rect +{ + EINA_INLIST; + int x, y, w, h; +}; +/* +struct _Regionbuf +{ + int w, h; + Regionspan **spans; +}; + +struct _Regionspan +{ + EINA_INLIST; + int x1, x2; +}; +*/ + +struct _Convert_Pal +{ + int references; + int count; + Convert_Pal_Mode colors; + DATA8 *lookup; + void *data; +}; + +/****/ + +/*****************************************************************************/ +#include "evas_macros.h" + +#ifndef WORDS_BIGENDIAN +/* x86 */ +#define A_VAL(p) (((DATA8 *)(p))[3]) +#define R_VAL(p) (((DATA8 *)(p))[2]) +#define G_VAL(p) (((DATA8 *)(p))[1]) +#define B_VAL(p) (((DATA8 *)(p))[0]) +#define AR_VAL(p) ((DATA16 *)(p)[1]) +#define GB_VAL(p) ((DATA16 *)(p)[0]) +#else +/* ppc */ +#define A_VAL(p) (((DATA8 *)(p))[0]) +#define R_VAL(p) (((DATA8 *)(p))[1]) +#define G_VAL(p) (((DATA8 *)(p))[2]) +#define B_VAL(p) (((DATA8 *)(p))[3]) +#define AR_VAL(p) ((DATA16 *)(p)[0]) +#define GB_VAL(p) ((DATA16 *)(p)[1]) +#endif + +#define RGB_JOIN(r,g,b) \ + (((r) << 16) + ((g) << 8) + (b)) + +#define ARGB_JOIN(a,r,g,b) \ + (((a) << 24) + ((r) << 16) + ((g) << 8) + (b)) + +#include "evas_blend_ops.h" + +#define _EVAS_RENDER_FILL -1 +#define _EVAS_RENDER_BLEND 0 +#define _EVAS_RENDER_BLEND_REL 1 +#define _EVAS_RENDER_COPY 2 +#define _EVAS_RENDER_COPY_REL 3 +#define _EVAS_RENDER_ADD 4 +#define _EVAS_RENDER_ADD_REL 5 +#define _EVAS_RENDER_SUB 6 +#define _EVAS_RENDER_SUB_REL 7 +#define _EVAS_RENDER_TINT 8 +#define _EVAS_RENDER_TINT_REL 9 +#define _EVAS_RENDER_MASK 10 +#define _EVAS_RENDER_MUL 11 +#define _EVAS_RENDER_CLIP 12 + +#define _EVAS_TEXTURE_REFLECT 0 +#define _EVAS_TEXTURE_REPEAT 1 +#define _EVAS_TEXTURE_RESTRICT 2 +#define _EVAS_TEXTURE_RESTRICT_REFLECT 3 +#define _EVAS_TEXTURE_RESTRICT_REPEAT 4 +#define _EVAS_TEXTURE_PAD 5 + +#define _EVAS_COLOR_SPACE_ARGB 0 +#define _EVAS_COLOR_SPACE_AHSV 1 + +/*****************************************************************************/ + +#define SCALE_SIZE_MAX ((1 << 15) - 1) + +#ifdef __cplusplus +extern "C" { +#endif + +/****/ +void evas_common_init (void); +void evas_common_shutdown (void); + +EAPI void evas_common_cpu_init (void); + +int evas_common_cpu_have_cpuid (void); +int evas_common_cpu_has_feature (unsigned int feature); +EAPI void evas_common_cpu_can_do (int *mmx, int *sse, int *sse2); +EAPI void evas_common_cpu_end_opt (void); + +/****/ +#include "../engines/common/evas_blend.h" + +EAPI Gfx_Func_Copy evas_common_draw_func_copy_get (int pixels, int reverse); + +/****/ +#include "../engines/common/evas_convert_color.h" +#include "../engines/common/evas_convert_colorspace.h" +#include "../engines/common/evas_convert_main.h" +#include "../engines/common/evas_convert_yuv.h" +#include "../engines/common/evas_scale_main.h" +#include "../engines/common/evas_scale_smooth.h" +#include "../engines/common/evas_scale_span.h" + +/****/ +#include "../engines/common/evas_image.h" + +/****/ +#include "../engines/common/evas_line.h" +#include "../engines/common/evas_polygon.h" +#include "../engines/common/evas_rectangle.h" + +/****/ +EAPI void evas_common_blit_init (void); + +EAPI void evas_common_blit_rectangle (const RGBA_Image *src, RGBA_Image *dst, int src_x, int src_y, int w, int h, int dst_x, int dst_y); + +/****/ +#include "../engines/common/evas_font.h" + +/****/ +EAPI void evas_common_tilebuf_init (void); + +EAPI Tilebuf *evas_common_tilebuf_new (int w, int h); +EAPI void evas_common_tilebuf_free (Tilebuf *tb); +EAPI void evas_common_tilebuf_set_tile_size (Tilebuf *tb, int tw, int th); +EAPI void evas_common_tilebuf_get_tile_size (Tilebuf *tb, int *tw, int *th); +EAPI int evas_common_tilebuf_add_redraw (Tilebuf *tb, int x, int y, int w, int h); +EAPI int evas_common_tilebuf_del_redraw (Tilebuf *tb, int x, int y, int w, int h); +EAPI int evas_common_tilebuf_add_motion_vector (Tilebuf *tb, int x, int y, int w, int h, int dx, int dy, int alpha); +EAPI void evas_common_tilebuf_clear (Tilebuf *tb); +EAPI Tilebuf_Rect *evas_common_tilebuf_get_render_rects (Tilebuf *tb); +EAPI void evas_common_tilebuf_free_render_rects (Tilebuf_Rect *rects); + +/* +Regionbuf *evas_common_regionbuf_new (int w, int h); +void evas_common_regionbuf_free (Regionbuf *rb); +void evas_common_regionbuf_clear (Regionbuf *rb); +void evas_common_regionbuf_span_add (Regionbuf *rb, int x1, int x2, int y); +void evas_common_regionbuf_span_del (Regionbuf *rb, int x1, int x2, int y); +Tilebuf_Rect *evas_common_regionbuf_rects_get (Regionbuf *rb); +*/ + +/****/ +#include "../engines/common/evas_draw.h" + +#include "../engines/common/evas_map_image.h" + +/****/ +#ifdef BUILD_PIPE_RENDER +# include "../engines/common/evas_pipe.h" +#endif + +void evas_font_dir_cache_free(void); + +/****/ + +/*****************************************************************************/ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/libraries/evas/src/lib/include/evas_common_soft16.h b/libraries/evas/src/lib/include/evas_common_soft16.h new file mode 100644 index 0000000..446319e --- /dev/null +++ b/libraries/evas/src/lib/include/evas_common_soft16.h @@ -0,0 +1,100 @@ +#ifndef EVAS_COMMON_SOFT16_H +#define EVAS_COMMON_SOFT16_H + +#include "evas_common.h" +#include "evas_private.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define RGB_565_UNPACKED_MASK 0x07e0f81f +#define RGB_565_UNPACK(rgb) \ + (((rgb) | ((rgb) << 16)) & RGB_565_UNPACKED_MASK) +#define RGB_565_PACK(rgb) \ + ((((rgb) & RGB_565_UNPACKED_MASK) | \ + ((rgb) & RGB_565_UNPACKED_MASK) >> 16) & 0xffff) +#define RGB_565_UNPACKED_BLEND(a, b, alpha) \ + ((b) + (a) - ((((b) * (alpha)) >> 5) & RGB_565_UNPACKED_MASK)) +#define RGB_565_UNPACKED_BLEND_UNMUL(a, b, alpha) \ + ((b) + ((((a) - (b)) * (alpha)) >> 5)) + +#define RGB_565_FROM_COMPONENTS(r, g, b) \ + (((((r) >> 3) & 0x1f) << 11) | \ + ((((g) >> 2) & 0x3f) << 5) | \ + (((b) >> 3) & 0x1f)) + +static inline unsigned int +_calc_stride(unsigned int w) +{ + unsigned int pad = w % 4; + if (!pad) return w; + else return w + 4 - pad; +} + +#define IMG_BYTE_SIZE(stride, height, has_alpha) \ + ((stride) * (height) * (!(has_alpha) ? 2 : 3)) + +typedef struct _Soft16_Image Soft16_Image; +struct _Soft16_Image +{ + Image_Entry cache_entry; + + RGBA_Image *source; + + int stride; // pixel stride - likely a multiple of 2 + DATA16 *pixels; // 16bpp pixels rgb565 + DATA8 *alpha; // 8bit alpha mask - optional. points into pixels + + struct + { +/* unsigned char have_alpha : 1; // 1 if we have halpha */ + unsigned char free_pixels : 1; // 1 if pixels should be freed + unsigned char free_alpha : 1; // 1 if alpha mask should be freed + } flags; +}; + +/** + * Image (evas_soft16_main.c) + */ +EAPI void evas_common_soft16_image_init(void); +EAPI void evas_common_soft16_image_shutdown(void); +EAPI Evas_Cache_Image *evas_common_soft16_image_cache_get(void); + +EAPI void evas_common_soft16_image_draw(Soft16_Image *src, Soft16_Image *dst, RGBA_Draw_Context *dc, 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, int smooth); +EAPI Soft16_Image *evas_common_soft16_image_alpha_set(Soft16_Image *im, int have_alpha); + +void evas_common_soft16_image_draw_unscaled(Soft16_Image *src, Soft16_Image *dst, RGBA_Draw_Context *dc, const Eina_Rectangle sr, const Eina_Rectangle dr, const Eina_Rectangle cr); +void evas_common_soft16_image_draw_scaled_sampled(Soft16_Image *src, Soft16_Image *dst, RGBA_Draw_Context *dc, const Eina_Rectangle sr, const Eina_Rectangle dr, const Eina_Rectangle cr); + +/* convert/dither functions */ +void evas_common_soft16_image_convert_from_rgb(Soft16_Image *im, const DATA32 *src); +void evas_common_soft16_image_convert_from_rgba(Soft16_Image *im, const DATA32 *src); + +/** + * Rectangle (evas_soft16_rectangle.c) + */ +EAPI void evas_common_soft16_rectangle_draw(Soft16_Image *dst, RGBA_Draw_Context *dc, int x, int y, int w, int h); + +/** + * Polygon (evas_soft16_polygon.c) + */ + EAPI void evas_common_soft16_polygon_draw(Soft16_Image *dst, RGBA_Draw_Context *dc, RGBA_Polygon_Point *points, int x, int y); + +/** + * Line (evas_soft16_line.c) + */ +EAPI void evas_common_soft16_line_draw(Soft16_Image *dst, RGBA_Draw_Context *dc, int x0, int y0, int x1, int y1); + +/** + * Font (evas_soft16_font.c) + */ +EAPI void *evas_common_soft16_font_glyph_new(void *data, RGBA_Font_Glyph *fg); +EAPI void evas_common_soft16_font_glyph_free(void *ext_dat); +EAPI void evas_common_soft16_font_glyph_draw(void *data, void *dest, void *context, RGBA_Font_Glyph *fg, int x, int y); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/libraries/evas/src/lib/include/evas_common_soft8.h b/libraries/evas/src/lib/include/evas_common_soft8.h new file mode 100644 index 0000000..d701842 --- /dev/null +++ b/libraries/evas/src/lib/include/evas_common_soft8.h @@ -0,0 +1,184 @@ +#ifndef EVAS_COMMON_SOFT8_H +#define EVAS_COMMON_SOFT8_H + +#include "evas_common.h" +#include "evas_private.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define GRY_8_BLEND(a, b, alpha) \ + ((b) + (a) - ((((b) * ((alpha) + 1)) >> 8) & 0xff)) + +#define GRY_8_BLEND_UNMUL(a, b, alpha) \ + ((b) + ((((a) - (b)) * ((alpha) + 1)) >> 8)) + +#if 0 +#define GRY_8_FROM_COMPONENTS(r, g, b) \ + (((307 * (r)) + \ + (604 * (g)) + \ + (113 * (b))) >> 10) + +#define GRY_8_FROM_RGB(rgb) \ + GRY_8_FROM_COMPONENTS(R_VAL(rgb), G_VAL(rgb), B_VAL(rgb)) +#endif + +//Y = R * 0.2126 + G * 0.7152 + B * 0.0722 + +#define GRY_8_FROM_COMPONENTS(r, g, b) \ + (((218 * (r)) + \ + (732 * (g)) + \ + (74 * (b))) >> 10) + +#define GRY_8_FROM_RGB(rgb) \ + GRY_8_FROM_COMPONENTS(R_VAL(rgb), G_VAL(rgb), B_VAL(rgb)) + +#define UNROLL2(op...) op op +#define UNROLL4(op...) UNROLL2(op) UNROLL2(op) +#define UNROLL8(op...) UNROLL4(op) UNROLL4(op) +#define UNROLL16(op...) UNROLL8(op) UNROLL8(op) + +#if defined(__ARM_ARCH_3M__) +# define __ARM_ARCH__ 40 +#endif +#if defined(__ARM_ARCH_4__) +# define __ARM_ARCH__ 40 +#endif +#if defined(__ARM_ARCH_4T__) +# define __ARM_ARCH__ 41 +#endif + +#if defined(__ARM_ARCH_5__) +# define __ARM_ARCH__ 50 +#endif +#if defined(__ARM_ARCH_5T__) +# define __ARM_ARCH__ 51 +#endif +#if defined(__ARM_ARCH_5E__) +# define __ARM_ARCH__ 52 +#endif +#if defined(__ARM_ARCH_5TE__) +# define __ARM_ARCH__ 53 +#endif +#if defined(__ARM_ARCH_5TEJ__) +# define __ARM_ARCH__ 54 +#endif + +#if defined(__ARM_ARCH_6__) +# define __ARM_ARCH__ 60 +#endif +#if defined(__ARM_ARCH_6J__) +# define __ARM_ARCH__ 61 +#endif +#if defined(__ARM_ARCH_6K__) +# define __ARM_ARCH__ 62 +#endif +#if defined(__ARM_ARCH_6Z__) +# define __ARM_ARCH__ 63 +#endif +#if defined(__ARM_ARCH_6ZK__) +# define __ARM_ARCH__ 64 +#endif +#if defined(__ARM_ARCH_6T2__) +# define __ARM_ARCH__ 65 +#endif + +#if defined(__ARM_ARCH_7__) +# define __ARM_ARCH__ 70 +#endif +#if defined(__ARM_ARCH_7A__) +# define __ARM_ARCH__ 71 +#endif +#if defined(__ARM_ARCH_7R__) +# define __ARM_ARCH__ 72 +#endif +#if defined(__ARM_ARCH_7M__) +# define __ARM_ARCH__ 73 +#endif + +#if defined(__ARM_ARCH__) && (__ARM_ARCH__ >= 52) +/* tested on ARMv6 (arm1136j-s), Nokia N800 CPU */ +#define pld(addr, off) \ + __asm__("pld [%[address], %[offset]]":: \ + [address] "r" (addr), [offset] "i" (off)) +#else +#define pld(addr, off) +#endif /* __ARMEL__ */ + +static inline unsigned int +_calc_stride(unsigned int w) +{ + unsigned int pad = w % 4; + if (!pad) return w; + else return w + 4 - pad; +} + +#define IMG_BYTE_SIZE(stride, height, has_alpha) \ + ((stride) * (height) * (!(has_alpha) ? 1 : 2)) + +typedef struct _Soft8_Image Soft8_Image; +struct _Soft8_Image +{ + Image_Entry cache_entry; + + RGBA_Image *source; + + int stride; // pixel stride + DATA8 *pixels; // 8bpp pixels gry8 + DATA8 *alpha; // 8bit alpha mask - optional. points into pixels + + void *extended_info; + + struct + { +/* unsigned char have_alpha : 1; // 1 if we have halpha */ + unsigned char free_pixels : 1; // 1 if pixels should be freed + unsigned char free_alpha : 1; // 1 if alpha mask should be freed + } flags; +}; + +/** + * Image (evas_soft8_main.c) + */ +EAPI void evas_common_soft8_image_init(void); +EAPI void evas_common_soft8_image_shutdown(void); +EAPI Evas_Cache_Image *evas_common_soft8_image_cache_get(void); + +EAPI void evas_common_soft8_image_draw(Soft8_Image *src, Soft8_Image *dst, RGBA_Draw_Context *dc, 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, int smooth); +EAPI Soft8_Image *evas_common_soft8_image_alpha_set(Soft8_Image *im, int have_alpha); + +void evas_common_soft8_image_draw_unscaled(Soft8_Image *src, Soft8_Image *dst, RGBA_Draw_Context *dc, const Eina_Rectangle sr, const Eina_Rectangle dr, const Eina_Rectangle cr); +void evas_common_soft8_image_draw_scaled_sampled(Soft8_Image *src, Soft8_Image *dst, RGBA_Draw_Context *dc, const Eina_Rectangle sr, const Eina_Rectangle dr, const Eina_Rectangle cr); + +/* convert/dither functions */ +void evas_common_soft8_image_convert_from_rgb(Soft8_Image *im, const DATA32 *src); +void evas_common_soft8_image_convert_from_rgba(Soft8_Image *im, const DATA32 *src); + +/** + * Rectangle (evas_soft8_rectangle.c) + */ +EAPI void evas_common_soft8_rectangle_draw(Soft8_Image *dst, RGBA_Draw_Context *dc, int x, int y, int w, int h); + +/** + * Polygon (evas_soft8_polygon.c) + */ +EAPI void evas_common_soft8_polygon_draw(Soft8_Image *dst, RGBA_Draw_Context *dc, RGBA_Polygon_Point *points, int x, int y); + +/** + * Line (evas_soft8_line.c) + */ +EAPI void evas_common_soft8_line_draw(Soft8_Image *dst, RGBA_Draw_Context *dc, int x0, int y0, int x1, int y1); + +/** + * Font (evas_soft8_font.c) + */ +EAPI void *evas_common_soft8_font_glyph_new(void *data, RGBA_Font_Glyph *fg); +EAPI void evas_common_soft8_font_glyph_free(void *ext_dat); +EAPI void evas_common_soft8_font_glyph_draw(void *data, void *dest, void *context, RGBA_Font_Glyph *fg, int x, int y); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/libraries/evas/src/lib/include/evas_inline.x b/libraries/evas/src/lib/include/evas_inline.x new file mode 100644 index 0000000..45f2b1f --- /dev/null +++ b/libraries/evas/src/lib/include/evas_inline.x @@ -0,0 +1,259 @@ +#ifndef EVAS_INLINE_H +#define EVAS_INLINE_H + +static inline void +_evas_object_event_new(void) +{ + _evas_event_counter++; +} + +static inline int +evas_object_was_visible(Evas_Object *obj) +{ + if ((obj->prev.visible) && + ((obj->prev.cache.clip.visible) || (obj->smart.smart)) && + ((obj->prev.cache.clip.a > 0 && obj->prev.render_op == EVAS_RENDER_BLEND) + || obj->prev.render_op != EVAS_RENDER_BLEND)) + { + if (obj->func->was_visible) + return obj->func->was_visible(obj); + return 1; + } + return 0; +} + +static inline void +evas_add_rect(Eina_Array *rects, int x, int y, int w, int h) +{ + Eina_Rectangle *r; + + NEW_RECT(r, x, y, w, h); + if (r) eina_array_push(rects, r); +} + +static inline Cutout_Rect* +evas_common_draw_context_cutouts_add(Cutout_Rects* rects, + int x, int y, int w, int h) +{ + Cutout_Rect* rect; + + if (rects->max < (rects->active + 1)) + { + rects->max += 128; + rects->rects = (Cutout_Rect *)realloc(rects->rects, sizeof(Cutout_Rect) * rects->max); + } + + rect = rects->rects + rects->active; + rect->x = x; + rect->y = y; + rect->w = w; + rect->h = h; + rects->active++; + + return rect; +} + +static inline int +evas_object_is_opaque(Evas_Object *obj) +{ + if (obj->smart.smart) return 0; + /* If a mask: Assume alpha */ + if (obj->cur.mask) return 0; + if (obj->cur.cache.clip.a == 255) + { + if (obj->func->is_opaque) + return obj->func->is_opaque(obj); + return 1; + } + if (obj->cur.render_op == EVAS_RENDER_COPY) + return 1; + return 0; +} + +static inline int +evas_event_freezes_through(Evas_Object *obj) +{ + if (obj->freeze_events) return 1; + if (obj->parent_cache.freeze_events_valid) + return obj->parent_cache.freeze_events; + if (!obj->smart.parent) return 0; + obj->parent_cache.freeze_events = + evas_event_freezes_through(obj->smart.parent); + obj->parent_cache.freeze_events_valid = EINA_TRUE; + return obj->parent_cache.freeze_events; +} + +static inline int +evas_event_passes_through(Evas_Object *obj) +{ + if (obj->pass_events) return 1; + if (obj->parent_cache.pass_events_valid) + return obj->parent_cache.pass_events; + if (!obj->smart.parent) return 0; + obj->parent_cache.pass_events = + evas_event_passes_through(obj->smart.parent); + obj->parent_cache.pass_events_valid = EINA_TRUE; + return obj->parent_cache.pass_events; +} + +static inline int +evas_object_is_visible(Evas_Object *obj) +{ /* post 1.0 -> enable? */ + if ((obj->cur.visible)/* && (obj->cur.color.a > 0)*/ && + ((obj->cur.cache.clip.visible) || (obj->smart.smart)) && + ((obj->cur.cache.clip.a > 0 && obj->cur.render_op == EVAS_RENDER_BLEND) + || obj->cur.render_op != EVAS_RENDER_BLEND)) + { + if (obj->func->is_visible) + return obj->func->is_visible(obj); + return 1; + } + return 0; +} + +static inline int +evas_object_clippers_is_visible(Evas_Object *obj) +{ + if (obj->cur.visible) + { + if (obj->cur.clipper) + return evas_object_clippers_is_visible(obj->cur.clipper); + return 1; + } + return 0; +} + +static inline int +evas_object_is_in_output_rect(Evas_Object *obj, int x, int y, int w, int h) +{ + /* assumes coords have been recalced */ + if ((RECTS_INTERSECT(x, y, w, h, + obj->cur.cache.clip.x, + obj->cur.cache.clip.y, + obj->cur.cache.clip.w, + obj->cur.cache.clip.h))) + return 1; + return 0; +} + +static inline int +evas_object_is_active(Evas_Object *obj) +{ + if (evas_object_is_visible(obj) || evas_object_was_visible(obj)) + { + if (obj->smart.smart) + { + int mapsmt = 0; + if (obj->smart.smart && (obj->cur.map && obj->cur.usemap)) mapsmt = 1; + if (!mapsmt) return 1; + if (evas_object_is_in_output_rect(obj, 0, 0, obj->layer->evas->output.w, + obj->layer->evas->output.h) || + evas_object_was_in_output_rect(obj, 0, 0, obj->layer->evas->output.w, + obj->layer->evas->output.h)) + return 1; + } + else + { + if (evas_object_is_in_output_rect(obj, 0, 0, obj->layer->evas->output.w, + obj->layer->evas->output.h) || + evas_object_was_in_output_rect(obj, 0, 0, obj->layer->evas->output.w, + obj->layer->evas->output.h)) + return 1; + } + } + return 0; +} + +static inline void +evas_object_coords_recalc(Evas_Object *obj) +{ +//// if (obj->cur.cache.geometry.validity == obj->layer->evas->output_validity) +//// return; +//// obj->cur.cache.geometry.x = +//// evas_coord_world_x_to_screen(obj->layer->evas, obj->cur.geometry.x); +//// obj->cur.cache.geometry.y = +//// evas_coord_world_y_to_screen(obj->layer->evas, obj->cur.geometry.y); +//// obj->cur.cache.geometry.w = +//// evas_coord_world_x_to_screen(obj->layer->evas, obj->cur.geometry.w) - +//// evas_coord_world_x_to_screen(obj->layer->evas, 0); +//// obj->cur.cache.geometry.h = +//// evas_coord_world_y_to_screen(obj->layer->evas, obj->cur.geometry.h) - +//// evas_coord_world_y_to_screen(obj->layer->evas, 0); + if (obj->func->coords_recalc) obj->func->coords_recalc(obj); +//// obj->cur.cache.geometry.validity = obj->layer->evas->output_validity; +} + +static inline void +evas_object_clip_recalc(Evas_Object *obj) +{ + int cx, cy, cw, ch, cvis, cr, cg, cb, ca; + int nx, ny, nw, nh, nvis, nr, ng, nb, na; + + if ((!obj->cur.cache.clip.dirty) && + !(!obj->cur.clipper || obj->cur.clipper->cur.cache.clip.dirty)) + return; + if (obj->layer->evas->events_frozen > 0) return; + evas_object_coords_recalc(obj); + if ((obj->cur.map) && (obj->cur.usemap)) + { + cx = obj->cur.map->normal_geometry.x; + cy = obj->cur.map->normal_geometry.y; + cw = obj->cur.map->normal_geometry.w; + ch = obj->cur.map->normal_geometry.h; + } + else + { + cx = obj->cur.geometry.x; + cy = obj->cur.geometry.y; + cw = obj->cur.geometry.w; + ch = obj->cur.geometry.h; + } +//// cx = obj->cur.cache.geometry.x; cy = obj->cur.cache.geometry.y; +//// cw = obj->cur.cache.geometry.w; ch = obj->cur.cache.geometry.h; + if (obj->cur.color.a == 0 && obj->cur.render_op == EVAS_RENDER_BLEND) cvis = 0; + else cvis = obj->cur.visible; + cr = obj->cur.color.r; cg = obj->cur.color.g; + cb = obj->cur.color.b; ca = obj->cur.color.a; + if (obj->cur.clipper) + { +// this causes problems... hmmm ????? + if (obj->cur.clipper->cur.cache.clip.dirty) + evas_object_clip_recalc(obj->cur.clipper); + + // I don't know why this test was here in the first place. As I have + // no issue showing up due to this, I keep it and move color out of it. +// breaks cliping of mapped images!!! + if (obj->cur.clipper->cur.map_parent == obj->cur.map_parent) + { + nx = obj->cur.clipper->cur.cache.clip.x; + ny = obj->cur.clipper->cur.cache.clip.y; + nw = obj->cur.clipper->cur.cache.clip.w; + nh = obj->cur.clipper->cur.cache.clip.h; + RECTS_CLIP_TO_RECT(cx, cy, cw, ch, nx, ny, nw, nh); + } + + nvis = obj->cur.clipper->cur.cache.clip.visible; + nr = obj->cur.clipper->cur.cache.clip.r; + ng = obj->cur.clipper->cur.cache.clip.g; + nb = obj->cur.clipper->cur.cache.clip.b; + na = obj->cur.clipper->cur.cache.clip.a; + cvis = cvis * nvis; + cr = (cr * (nr + 1)) >> 8; + cg = (cg * (ng + 1)) >> 8; + cb = (cb * (nb + 1)) >> 8; + ca = (ca * (na + 1)) >> 8; + } + if ((ca == 0 && obj->cur.render_op == EVAS_RENDER_BLEND) || (cw <= 0) || (ch <= 0)) cvis = 0; + obj->cur.cache.clip.x = cx; + obj->cur.cache.clip.y = cy; + obj->cur.cache.clip.w = cw; + obj->cur.cache.clip.h = ch; + obj->cur.cache.clip.visible = cvis; + obj->cur.cache.clip.r = cr; + obj->cur.cache.clip.g = cg; + obj->cur.cache.clip.b = cb; + obj->cur.cache.clip.a = ca; + obj->cur.cache.clip.dirty = 0; +} + +#endif diff --git a/libraries/evas/src/lib/include/evas_macros.h b/libraries/evas/src/lib/include/evas_macros.h new file mode 100644 index 0000000..ed29dbd --- /dev/null +++ b/libraries/evas/src/lib/include/evas_macros.h @@ -0,0 +1,217 @@ +#ifndef EVAS_MACROS_H +#define EVAS_MACROS_H + +#undef ABS +#define ABS(x) (((x) < 0) ? -(x) : (x)) + +#undef SGN +#define SGN(x) (((x) < 0) ? -1 : 1) + +#undef MIN +#define MIN(x, y) (((x) < (y)) ? (x) : (y)) + +#undef MAX +#define MAX(x, y) (((x) > (y)) ? (x) : (y)) + +#define SWAP32(x) (x) = \ + ((((x) & 0x000000ff ) << 24) | \ + (((x) & 0x0000ff00 ) << 8) | \ + (((x) & 0x00ff0000 ) >> 8) | \ + (((x) & 0xff000000 ) >> 24)) + +#define SWAP16(x) (x) = \ + ((((x) & 0x00ff ) << 8) | \ + (((x) & 0xff00 ) >> 8)) + +#define SPANS_COMMON(x1, w1, x2, w2) \ +(!(( (int)((x2) + (int)(w2)) <= (int)(x1)) || (int)((x2) >= (int)((x1) + (int)(w1))))) + +#define RECTS_INTERSECT(x, y, w, h, xx, yy, ww, hh) \ +((SPANS_COMMON((x), (w), (xx), (ww))) && (SPANS_COMMON((y), (h), (yy), (hh)))) + +#define RECTS_CLIP_TO_RECT(_x, _y, _w, _h, _cx, _cy, _cw, _ch) \ +{ \ + if (RECTS_INTERSECT(_x, _y, _w, _h, _cx, _cy, _cw, _ch)) \ + { \ + if ((int)_x < (int)(_cx)) \ + { \ + if ((int)_w + ((int)_x - (int)(_cx)) < 0) _w = 0; \ + else _w += ((int)_x - (int)(_cx)); \ + _x = (_cx); \ + } \ + if ((int)(_x + _w) > (int)((_cx) + (_cw))) \ + _w = (_cx) + (_cw) - _x; \ + if ((int)_y < (int)(_cy)) \ + { \ + if ((int)_h + ((int)_y - (int)(_cy)) < 0) _h = 0; \ + else _h += ((int)_y - (int)(_cy)); \ + _y = (_cy); \ + } \ + if ((int)(_y + _h) > (int)((_cy) + (_ch))) \ + _h = (_cy) + (_ch) - _y; \ + } \ + else \ + { \ + _w = 0; _h = 0; \ + } \ +} + + +#define INTERP_VAL(out, in1, in2, in3, in4, interp_x, interp_y) \ + { \ + int _v, _vv; \ + \ + _v = (256 - (interp_x)) * (in1); \ + if ((interp_x) > 0) _v += (interp_x) * (in2); \ + _v *= (256 - (interp_y)); \ + if ((interp_y) > 0) \ + { \ + _vv = (256 - (interp_x)) * (in3); \ + if ((interp_x) > 0) _vv += (interp_x) * (in4); \ + _vv *= (interp_y); \ + (out) = ((_v + _vv) >> 16); \ + } \ + else (out) = (_v >> 16); \ + } + +#define INTERP_2(in1, in2, interp, interp_inv) \ + ((in1 * interp_inv) + (in2 * interp)) >> 8 + + +#define CONVERT_LOOP_START_ROT_0() \ + src_ptr = src; \ + for (y = 0; y < h; y++) \ + { \ + for (x = 0; x < w; x++) \ + { + +#define CONVERT_LOOP_END_ROT_0() \ + dst_ptr++; \ + src_ptr++; \ + } \ + src_ptr += src_jump; \ + dst_ptr += dst_jump; \ + } + +#define CONVERT_LOOP_START_ROT_180() \ + src_ptr = src + (w - 1) + ((h - 1) * (w + src_jump)); \ + for (y = 0; y < h; y++) \ + { \ + for (x = 0; x < w; x++) \ + { + +#define CONVERT_LOOP_END_ROT_180() \ + dst_ptr++; \ + src_ptr--; \ + } \ + src_ptr = src + (w - 1) + ((h - y - 2) * (w + src_jump)); \ + dst_ptr += dst_jump; \ + } + +#define CONVERT_LOOP_START_ROT_270() \ + src_ptr = src + ((w - 1) * (h + src_jump)); \ + for (y = 0; y < h; y++) \ + { \ + for (x = 0; x < w; x++) \ + { + +#define CONVERT_LOOP_END_ROT_270() \ + dst_ptr++; \ + src_ptr -= (h + src_jump); \ + } \ + src_ptr = src + ((w - 1) * (h + src_jump)) + (y + 1); \ + dst_ptr += dst_jump; \ + } + +#define CONVERT_LOOP_START_ROT_90() \ + src_ptr = src + (h - 1); \ + for (y = 0; y < h; y++) \ + { \ + for (x = 0; x < w; x++) \ + { + +#define CONVERT_LOOP_END_ROT_90() \ + dst_ptr++; \ + src_ptr += (h + src_jump); \ + } \ + src_ptr = src + (h - 1) - y - 1; \ + dst_ptr += dst_jump; \ + } + +#define CONVERT_LOOP2_START_ROT_0() \ + src_ptr = src; \ + for (y = 0; y < h; y++) \ + { \ + for (x = 0; x < w; x++) \ + { + +#define CONVERT_LOOP2_INC_ROT_0() \ +src_ptr++; \ +x++; + +#define CONVERT_LOOP2_END_ROT_0() \ + dst_ptr+=2; \ + src_ptr++; \ + } \ + src_ptr += src_jump; \ + dst_ptr += dst_jump; \ + } + +#define CONVERT_LOOP2_START_ROT_180() \ + src_ptr = src + (w - 1) + ((h - 1) * (w + src_jump)); \ + for (y = 0; y < h; y++) \ + { \ + for (x = 0; x < w; x++) \ + { + +#define CONVERT_LOOP2_INC_ROT_180() \ +src_ptr--; \ +x++; + +#define CONVERT_LOOP2_END_ROT_180() \ + dst_ptr+=2; \ + src_ptr--; \ + } \ + src_ptr = src + (w - 1) + ((h - y - 2) * (w + src_jump)); \ + dst_ptr += dst_jump; \ + } + +#define CONVERT_LOOP2_START_ROT_270() \ + src_ptr = src + ((w - 1) * (h + src_jump)); \ + for (y = 0; y < h; y++) \ + { \ + for (x = 0; x < w; x++) \ + { + +#define CONVERT_LOOP2_INC_ROT_270() \ +src_ptr -= (h + src_jump); \ +x++; + +#define CONVERT_LOOP2_END_ROT_270() \ + dst_ptr+=2; \ + src_ptr -= (h + src_jump); \ + } \ + src_ptr = src + ((w - 1) * (h + src_jump)) + (y + 1); \ + dst_ptr += dst_jump; \ + } + +#define CONVERT_LOOP2_START_ROT_90() \ + src_ptr = src + (h - 1); \ + for (y = 0; y < h; y++) \ + { \ + for (x = 0; x < w; x++) \ + { + +#define CONVERT_LOOP2_INC_ROT_90() \ +src_ptr += (h + src_jump); \ +x++; + +#define CONVERT_LOOP2_END_ROT_90() \ + dst_ptr+=2; \ + src_ptr += (h + src_jump); \ + } \ + src_ptr = src + (h - 1) - y - 1; \ + dst_ptr += dst_jump; \ + } + +#endif diff --git a/libraries/evas/src/lib/include/evas_mmx.h b/libraries/evas/src/lib/include/evas_mmx.h new file mode 100644 index 0000000..e1095e1 --- /dev/null +++ b/libraries/evas/src/lib/include/evas_mmx.h @@ -0,0 +1,735 @@ +/* mmx.h + + MultiMedia eXtensions GCC interface library for IA32. + + To use this library, simply include this header file + and compile with GCC. You MUST have inlining enabled + in order for mmx_ok() to work; this can be done by + simply using -O on the GCC command line. + + Compiling with -DMMX_TRACE will cause detailed trace + output to be sent to stderr for each mmx operation. + This adds lots of code, and obviously slows execution to + a crawl, but can be very useful for debugging. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY + EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT + LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR ANY PARTICULAR PURPOSE. + + 1997-98 by H. Dietz and R. Fisher + + History: + 97-98* R.Fisher Early versions + 980501 R.Fisher Original Release + 980611* H.Dietz Rewrite, correctly implementing inlines, and + R.Fisher including direct register accesses. + 980616 R.Fisher Release of 980611 as 980616. + 980714 R.Fisher Minor corrections to Makefile, etc. + 980715 R.Fisher mmx_ok() now prevents optimizer from using + clobbered values. + mmx_ok() now checks if cpuid instruction is + available before trying to use it. + 980726* R.Fisher mm_support() searches for AMD 3DNow, Cyrix + Extended MMX, and standard MMX. It returns a + value which is positive if any of these are + supported, and can be masked with constants to + see which. mmx_ok() is now a call to this + 980726* R.Fisher Added i2r support for shift functions + 980919 R.Fisher Fixed AMD extended feature recognition bug. + 980921 R.Fisher Added definition/check for _MMX_H. + Added "float s[2]" to mmx_t for use with + 3DNow and EMMX. So same mmx_t can be used. + 981013 R.Fisher Fixed cpuid function 1 bug (looked at wrong reg) + Fixed psllq_i2r error in mmxtest.c + + * Unreleased (internal or interim) versions + + Notes: + It appears that the latest gas has the pand problem fixed, therefore + I'll undefine BROKEN_PAND by default. + String compares may be quicker than the multiple test/jumps in vendor + test sequence in mmx_ok(), but I'm not concerned with that right now. + + Acknowledgments: + Jussi Laako for pointing out the errors ultimately found to be + connected to the failure to notify the optimizer of clobbered values. + Roger Hardiman for reminding us that CPUID isn't everywhere, and that + someone may actually try to use this on a machine without CPUID. + Also for suggesting code for checking this. + Robert Dale for pointing out the AMD recognition bug. + Jimmy Mayfield and Carl Witty for pointing out the Intel recognition + bug. + Carl Witty for pointing out the psllq_i2r test bug. +*/ + +#ifndef _MMX_H +#define _MMX_H + +/* Warning: at this writing, the version of GAS packaged + with most Linux distributions does not handle the + parallel AND operation mnemonic correctly. If the + symbol BROKEN_PAND is defined, a slower alternative + coding will be used. If execution of mmxtest results + in an illegal instruction fault, define this symbol. +*/ +#undef BROKEN_PAND + + +/* The type of an value that fits in an MMX register + (note that long long constant values MUST be suffixed + by LL and unsigned long long values by ULL, lest + they be truncated by the compiler) +*/ +typedef union { + long long q; /* Quadword (64-bit) value */ + unsigned long long uq; /* Unsigned Quadword */ + int d[2]; /* 2 Doubleword (32-bit) values */ + unsigned int ud[2]; /* 2 Unsigned Doubleword */ + short w[4]; /* 4 Word (16-bit) values */ + unsigned short uw[4]; /* 4 Unsigned Word */ + char b[8]; /* 8 Byte (8-bit) values */ + unsigned char ub[8]; /* 8 Unsigned Byte */ + float s[2]; /* Single-precision (32-bit) value */ +} __attribute__ ((aligned (8))) mmx_t; + +/* Helper functions for the instruction macros that follow... + (note that memory-to-register, m2r, instructions are nearly + as efficient as register-to-register, r2r, instructions; + however, memory-to-memory instructions are really simulated + as a convenience, and are only 1/3 as efficient) +*/ + +/* These macros are a lot simpler without the tracing... +*/ + +#define mmx_i2r(op, imm, reg) \ + __asm__ __volatile__ (#op " $" #imm ", %%" #reg \ + : /* nothing */ \ + : /* nothing */); + +#define mmx_m2r(op, mem, reg) \ + __asm__ __volatile__ (#op " %0, %%" #reg \ + : /* nothing */ \ + : "m" (mem)) + +#define mmx_r2m(op, reg, mem) \ + __asm__ __volatile__ (#op " %%" #reg ", %0" \ + : "=m" (mem) \ + : /* nothing */ ) + +#define mmx_a2r(op, mem, reg) \ + __asm__ __volatile__ (#op " %0, %%" #reg \ + : /* nothing */ \ + : "m" (mem)) + +#define mmx_r2a(op, reg, mem) \ + __asm__ __volatile__ (#op " %%" #reg ", %0" \ + : "=m" (mem) \ + : /* nothing */ ) + +#define mmx_r2r(op, regs, regd) \ + __asm__ __volatile__ (#op " %" #regs ", %" #regd) + +#define mmx_m2m(op, mems, memd) \ + __asm__ __volatile__ ("movq %0, %%mm0\n\t" \ + #op " %1, %%mm0\n\t" \ + "movq %%mm0, %0" \ + : "=X" (memd) \ + : "X" (mems)) + +/* 1x64 MOVE Quadword + (this is both a load and a store... + in fact, it is the only way to store) +*/ +#define movq_m2r(var, reg) mmx_m2r(movq, var, reg) +#define movq_r2m(reg, var) mmx_r2m(movq, reg, var) +#define movq_r2r(regs, regd) mmx_r2r(movq, regs, regd) +#define movq(vars, vard) \ + __asm__ __volatile__ ("movq %1, %%mm0\n\t" \ + "movq %%mm0, %0" \ + : "=X" (vard) \ + : "X" (vars)) +#define movntq_r2m(reg, var) mmx_r2m(movntq, reg, var) + + +/* 1x32 MOVE Doubleword + (like movq, this is both load and store... + but is most useful for moving things between + mmx registers and ordinary registers) +*/ +#define movd_m2r(var, reg) mmx_a2r(movd, var, reg) +#define movd_r2m(reg, var) mmx_r2a(movd, reg, var) +#define movd_r2r(regs, regd) mmx_r2r(movd, regs, regd) +#define movd(vars, vard) \ + __asm__ __volatile__ ("movd %1, %%mm0\n\t" \ + "movd %%mm0, %0" \ + : "=X" (vard) \ + : "X" (vars)) + + +/* 2x32, 4x16, and 8x8 Parallel ADDs +*/ +#define paddd_m2r(var, reg) mmx_m2r(paddd, var, reg) +#define paddd_r2r(regs, regd) mmx_r2r(paddd, regs, regd) +#define paddd(vars, vard) mmx_m2m(paddd, vars, vard) + +#define paddw_m2r(var, reg) mmx_m2r(paddw, var, reg) +#define paddw_r2r(regs, regd) mmx_r2r(paddw, regs, regd) +#define paddw(vars, vard) mmx_m2m(paddw, vars, vard) + +#define paddb_m2r(var, reg) mmx_m2r(paddb, var, reg) +#define paddb_r2r(regs, regd) mmx_r2r(paddb, regs, regd) +#define paddb(vars, vard) mmx_m2m(paddb, vars, vard) + + +/* 4x16 and 8x8 Parallel ADDs using Saturation arithmetic +*/ +#define paddsw_m2r(var, reg) mmx_m2r(paddsw, var, reg) +#define paddsw_r2r(regs, regd) mmx_r2r(paddsw, regs, regd) +#define paddsw(vars, vard) mmx_m2m(paddsw, vars, vard) + +#define paddsb_m2r(var, reg) mmx_m2r(paddsb, var, reg) +#define paddsb_r2r(regs, regd) mmx_r2r(paddsb, regs, regd) +#define paddsb(vars, vard) mmx_m2m(paddsb, vars, vard) + + +/* 4x16 and 8x8 Parallel ADDs using Unsigned Saturation arithmetic +*/ +#define paddusw_m2r(var, reg) mmx_m2r(paddusw, var, reg) +#define paddusw_r2r(regs, regd) mmx_r2r(paddusw, regs, regd) +#define paddusw(vars, vard) mmx_m2m(paddusw, vars, vard) + +#define paddusb_m2r(var, reg) mmx_m2r(paddusb, var, reg) +#define paddusb_r2r(regs, regd) mmx_r2r(paddusb, regs, regd) +#define paddusb(vars, vard) mmx_m2m(paddusb, vars, vard) + + +/* 2x32, 4x16, and 8x8 Parallel SUBs +*/ +#define psubd_m2r(var, reg) mmx_m2r(psubd, var, reg) +#define psubd_r2r(regs, regd) mmx_r2r(psubd, regs, regd) +#define psubd(vars, vard) mmx_m2m(psubd, vars, vard) + +#define psubw_m2r(var, reg) mmx_m2r(psubw, var, reg) +#define psubw_r2r(regs, regd) mmx_r2r(psubw, regs, regd) +#define psubw(vars, vard) mmx_m2m(psubw, vars, vard) + +#define psubb_m2r(var, reg) mmx_m2r(psubb, var, reg) +#define psubb_r2r(regs, regd) mmx_r2r(psubb, regs, regd) +#define psubb(vars, vard) mmx_m2m(psubb, vars, vard) + + +/* 4x16 and 8x8 Parallel SUBs using Saturation arithmetic +*/ +#define psubsw_m2r(var, reg) mmx_m2r(psubsw, var, reg) +#define psubsw_r2r(regs, regd) mmx_r2r(psubsw, regs, regd) +#define psubsw(vars, vard) mmx_m2m(psubsw, vars, vard) + +#define psubsb_m2r(var, reg) mmx_m2r(psubsb, var, reg) +#define psubsb_r2r(regs, regd) mmx_r2r(psubsb, regs, regd) +#define psubsb(vars, vard) mmx_m2m(psubsb, vars, vard) + + +/* 4x16 and 8x8 Parallel SUBs using Unsigned Saturation arithmetic +*/ +#define psubusw_m2r(var, reg) mmx_m2r(psubusw, var, reg) +#define psubusw_r2r(regs, regd) mmx_r2r(psubusw, regs, regd) +#define psubusw(vars, vard) mmx_m2m(psubusw, vars, vard) + +#define psubusb_m2r(var, reg) mmx_m2r(psubusb, var, reg) +#define psubusb_r2r(regs, regd) mmx_r2r(psubusb, regs, regd) +#define psubusb(vars, vard) mmx_m2m(psubusb, vars, vard) + + +/* 4x16 Parallel MULs giving Low 4x16 portions of results +*/ +#define pmullw_m2r(var, reg) mmx_m2r(pmullw, var, reg) +#define pmullw_r2r(regs, regd) mmx_r2r(pmullw, regs, regd) +#define pmullw(vars, vard) mmx_m2m(pmullw, vars, vard) + + +/* 4x16 Parallel MULs giving High 4x16 portions of results +*/ +#define pmulhw_m2r(var, reg) mmx_m2r(pmulhw, var, reg) +#define pmulhw_r2r(regs, regd) mmx_r2r(pmulhw, regs, regd) +#define pmulhw(vars, vard) mmx_m2m(pmulhw, vars, vard) + + +/* 4x16->2x32 Parallel Mul-ADD + (muls like pmullw, then adds adjacent 16-bit fields + in the multiply result to make the final 2x32 result) +*/ +#define pmaddwd_m2r(var, reg) mmx_m2r(pmaddwd, var, reg) +#define pmaddwd_r2r(regs, regd) mmx_r2r(pmaddwd, regs, regd) +#define pmaddwd(vars, vard) mmx_m2m(pmaddwd, vars, vard) + + +/* 1x64 bitwise AND +*/ +#ifdef BROKEN_PAND +#define pand_m2r(var, reg) \ + { \ + mmx_m2r(pandn, (mmx_t) -1LL, reg); \ + mmx_m2r(pandn, var, reg); \ + } +#define pand_r2r(regs, regd) \ + { \ + mmx_m2r(pandn, (mmx_t) -1LL, regd); \ + mmx_r2r(pandn, regs, regd) \ + } +#define pand(vars, vard) \ + { \ + movq_m2r(vard, mm0); \ + mmx_m2r(pandn, (mmx_t) -1LL, mm0); \ + mmx_m2r(pandn, vars, mm0); \ + movq_r2m(mm0, vard); \ + } +#else +#define pand_m2r(var, reg) mmx_m2r(pand, var, reg) +#define pand_r2r(regs, regd) mmx_r2r(pand, regs, regd) +#define pand(vars, vard) mmx_m2m(pand, vars, vard) +#endif + + +/* 1x64 bitwise AND with Not the destination +*/ +#define pandn_m2r(var, reg) mmx_m2r(pandn, var, reg) +#define pandn_r2r(regs, regd) mmx_r2r(pandn, regs, regd) +#define pandn(vars, vard) mmx_m2m(pandn, vars, vard) + + +/* 1x64 bitwise OR +*/ +#define por_m2r(var, reg) mmx_m2r(por, var, reg) +#define por_r2r(regs, regd) mmx_r2r(por, regs, regd) +#define por(vars, vard) mmx_m2m(por, vars, vard) + + +/* 1x64 bitwise eXclusive OR +*/ +#define pxor_m2r(var, reg) mmx_m2r(pxor, var, reg) +#define pxor_r2r(regs, regd) mmx_r2r(pxor, regs, regd) +#define pxor(vars, vard) mmx_m2m(pxor, vars, vard) + + +/* 2x32, 4x16, and 8x8 Parallel CoMPare for EQuality + (resulting fields are either 0 or -1) +*/ +#define pcmpeqd_m2r(var, reg) mmx_m2r(pcmpeqd, var, reg) +#define pcmpeqd_r2r(regs, regd) mmx_r2r(pcmpeqd, regs, regd) +#define pcmpeqd(vars, vard) mmx_m2m(pcmpeqd, vars, vard) + +#define pcmpeqw_m2r(var, reg) mmx_m2r(pcmpeqw, var, reg) +#define pcmpeqw_r2r(regs, regd) mmx_r2r(pcmpeqw, regs, regd) +#define pcmpeqw(vars, vard) mmx_m2m(pcmpeqw, vars, vard) + +#define pcmpeqb_m2r(var, reg) mmx_m2r(pcmpeqb, var, reg) +#define pcmpeqb_r2r(regs, regd) mmx_r2r(pcmpeqb, regs, regd) +#define pcmpeqb(vars, vard) mmx_m2m(pcmpeqb, vars, vard) + + +/* 2x32, 4x16, and 8x8 Parallel CoMPare for Greater Than + (resulting fields are either 0 or -1) +*/ +#define pcmpgtd_m2r(var, reg) mmx_m2r(pcmpgtd, var, reg) +#define pcmpgtd_r2r(regs, regd) mmx_r2r(pcmpgtd, regs, regd) +#define pcmpgtd(vars, vard) mmx_m2m(pcmpgtd, vars, vard) + +#define pcmpgtw_m2r(var, reg) mmx_m2r(pcmpgtw, var, reg) +#define pcmpgtw_r2r(regs, regd) mmx_r2r(pcmpgtw, regs, regd) +#define pcmpgtw(vars, vard) mmx_m2m(pcmpgtw, vars, vard) + +#define pcmpgtb_m2r(var, reg) mmx_m2r(pcmpgtb, var, reg) +#define pcmpgtb_r2r(regs, regd) mmx_r2r(pcmpgtb, regs, regd) +#define pcmpgtb(vars, vard) mmx_m2m(pcmpgtb, vars, vard) + + +/* 1x64, 2x32, and 4x16 Parallel Shift Left Logical +*/ +#define psllq_i2r(imm, reg) mmx_i2r(psllq, imm, reg) +#define psllq_m2r(var, reg) mmx_m2r(psllq, var, reg) +#define psllq_r2r(regs, regd) mmx_r2r(psllq, regs, regd) +#define psllq(vars, vard) mmx_m2m(psllq, vars, vard) + +#define pslld_i2r(imm, reg) mmx_i2r(pslld, imm, reg) +#define pslld_m2r(var, reg) mmx_m2r(pslld, var, reg) +#define pslld_r2r(regs, regd) mmx_r2r(pslld, regs, regd) +#define pslld(vars, vard) mmx_m2m(pslld, vars, vard) + +#define psllw_i2r(imm, reg) mmx_i2r(psllw, imm, reg) +#define psllw_m2r(var, reg) mmx_m2r(psllw, var, reg) +#define psllw_r2r(regs, regd) mmx_r2r(psllw, regs, regd) +#define psllw(vars, vard) mmx_m2m(psllw, vars, vard) + + +/* 1x64, 2x32, and 4x16 Parallel Shift Right Logical +*/ +#define psrlq_i2r(imm, reg) mmx_i2r(psrlq, imm, reg) +#define psrlq_m2r(var, reg) mmx_m2r(psrlq, var, reg) +#define psrlq_r2r(regs, regd) mmx_r2r(psrlq, regs, regd) +#define psrlq(vars, vard) mmx_m2m(psrlq, vars, vard) + +#define psrld_i2r(imm, reg) mmx_i2r(psrld, imm, reg) +#define psrld_m2r(var, reg) mmx_m2r(psrld, var, reg) +#define psrld_r2r(regs, regd) mmx_r2r(psrld, regs, regd) +#define psrld(vars, vard) mmx_m2m(psrld, vars, vard) + +#define psrlw_i2r(imm, reg) mmx_i2r(psrlw, imm, reg) +#define psrlw_m2r(var, reg) mmx_m2r(psrlw, var, reg) +#define psrlw_r2r(regs, regd) mmx_r2r(psrlw, regs, regd) +#define psrlw(vars, vard) mmx_m2m(psrlw, vars, vard) + + +/* 2x32 and 4x16 Parallel Shift Right Arithmetic +*/ +#define psrad_i2r(imm, reg) mmx_i2r(psrad, imm, reg) +#define psrad_m2r(var, reg) mmx_m2r(psrad, var, reg) +#define psrad_r2r(regs, regd) mmx_r2r(psrad, regs, regd) +#define psrad(vars, vard) mmx_m2m(psrad, vars, vard) + +#define psraw_i2r(imm, reg) mmx_i2r(psraw, imm, reg) +#define psraw_m2r(var, reg) mmx_m2r(psraw, var, reg) +#define psraw_r2r(regs, regd) mmx_r2r(psraw, regs, regd) +#define psraw(vars, vard) mmx_m2m(psraw, vars, vard) + + +/* 2x32->4x16 and 4x16->8x8 PACK and Signed Saturate + (packs source and dest fields into dest in that order) +*/ +#define packssdw_m2r(var, reg) mmx_m2r(packssdw, var, reg) +#define packssdw_r2r(regs, regd) mmx_r2r(packssdw, regs, regd) +#define packssdw(vars, vard) mmx_m2m(packssdw, vars, vard) + +#define packsswb_m2r(var, reg) mmx_m2r(packsswb, var, reg) +#define packsswb_r2r(regs, regd) mmx_r2r(packsswb, regs, regd) +#define packsswb(vars, vard) mmx_m2m(packsswb, vars, vard) + + +/* 4x16->8x8 PACK and Unsigned Saturate + (packs source and dest fields into dest in that order) +*/ +#define packuswb_m2r(var, reg) mmx_m2r(packuswb, var, reg) +#define packuswb_r2r(regs, regd) mmx_r2r(packuswb, regs, regd) +#define packuswb(vars, vard) mmx_m2m(packuswb, vars, vard) + + +/* 2x32->1x64, 4x16->2x32, and 8x8->4x16 UNPaCK Low + (interleaves low half of dest with low half of source + as padding in each result field) +*/ +#define punpckldq_m2r(var, reg) mmx_m2r(punpckldq, var, reg) +#define punpckldq_r2r(regs, regd) mmx_r2r(punpckldq, regs, regd) +#define punpckldq(vars, vard) mmx_m2m(punpckldq, vars, vard) + +#define punpcklwd_m2r(var, reg) mmx_m2r(punpcklwd, var, reg) +#define punpcklwd_r2r(regs, regd) mmx_r2r(punpcklwd, regs, regd) +#define punpcklwd(vars, vard) mmx_m2m(punpcklwd, vars, vard) + +#define punpcklbw_m2r(var, reg) mmx_m2r(punpcklbw, var, reg) +#define punpcklbw_r2r(regs, regd) mmx_r2r(punpcklbw, regs, regd) +#define punpcklbw(vars, vard) mmx_m2m(punpcklbw, vars, vard) + + +/* 2x32->1x64, 4x16->2x32, and 8x8->4x16 UNPaCK High + (interleaves high half of dest with high half of source + as padding in each result field) +*/ +#define punpckhdq_m2r(var, reg) mmx_m2r(punpckhdq, var, reg) +#define punpckhdq_r2r(regs, regd) mmx_r2r(punpckhdq, regs, regd) +#define punpckhdq(vars, vard) mmx_m2m(punpckhdq, vars, vard) + +#define punpckhwd_m2r(var, reg) mmx_m2r(punpckhwd, var, reg) +#define punpckhwd_r2r(regs, regd) mmx_r2r(punpckhwd, regs, regd) +#define punpckhwd(vars, vard) mmx_m2m(punpckhwd, vars, vard) + +#define punpckhbw_m2r(var, reg) mmx_m2r(punpckhbw, var, reg) +#define punpckhbw_r2r(regs, regd) mmx_r2r(punpckhbw, regs, regd) +#define punpckhbw(vars, vard) mmx_m2m(punpckhbw, vars, vard) + +#define MOVE_8DWORDS_MMX(src,dst) \ + __asm__ ( \ + "movq (%1), %%mm0 \n" \ + "movq 0x8(%1), %%mm1 \n" \ + "movq 0x10(%1), %%mm2 \n" \ + "movq 0x18(%1), %%mm3 \n" \ + "movq %%mm0, (%0) \n" \ + "movq %%mm1, 0x8(%0) \n" \ + "movq %%mm2, 0x10(%0) \n" \ + "movq %%mm3, 0x18(%0) \n" \ + : \ + : "q" (dst), "r" (src) \ + : "memory", "st"); + +#define MOVE_10DWORDS_MMX(src,dst) \ + __asm__ ( \ + "movq (%1), %%mm0 \n" \ + "movq 0x8(%1), %%mm1 \n" \ + "movq 0x10(%1), %%mm2 \n" \ + "movq 0x18(%1), %%mm3 \n" \ + "movq 0x20(%1), %%mm4 \n" \ + "movq %%mm0, (%0) \n" \ + "movq %%mm1, 0x8(%0) \n" \ + "movq %%mm2, 0x10(%0) \n" \ + "movq %%mm3, 0x18(%0) \n" \ + "movq %%mm4, 0x20(%0) \n" \ + : \ + : "q" (dst), "r" (src) \ + : "memory", "st"); + +#define MOVE_16DWORDS_MMX(src,dst) \ + __asm__ ( \ + "movq (%1), %%mm0 \n" \ + "movq 0x8(%1), %%mm1 \n" \ + "movq 0x10(%1), %%mm2 \n" \ + "movq 0x18(%1), %%mm3 \n" \ + "movq 0x20(%1), %%mm4 \n" \ + "movq 0x28(%1), %%mm5 \n" \ + "movq 0x30(%1), %%mm6 \n" \ + "movq 0x38(%1), %%mm7 \n" \ + "movq %%mm0, (%0) \n" \ + "movq %%mm1, 0x8(%0) \n" \ + "movq %%mm2, 0x10(%0) \n" \ + "movq %%mm3, 0x18(%0) \n" \ + "movq %%mm4, 0x20(%0) \n" \ + "movq %%mm5, 0x28(%0) \n" \ + "movq %%mm6, 0x30(%0) \n" \ + "movq %%mm7, 0x38(%0) \n" \ + : \ + : "q" (dst), "r" (src) \ + : "memory", "st"); + +#define MOVE_16DWORDS_MMX2(src,dst) \ + __asm__ ( \ + "movq (%1), %%mm0 \n" \ + "movq 0x8(%1), %%mm1 \n" \ + "movq 0x10(%1), %%mm2 \n" \ + "movq 0x18(%1), %%mm3 \n" \ + "movq 0x20(%1), %%mm4 \n" \ + "movq 0x28(%1), %%mm5 \n" \ + "movq 0x30(%1), %%mm6 \n" \ + "movq 0x38(%1), %%mm7 \n" \ + "movntq %%mm0, (%0) \n" \ + "movntq %%mm1, 0x8(%0) \n" \ + "movntq %%mm2, 0x10(%0) \n" \ + "movntq %%mm3, 0x18(%0) \n" \ + "movntq %%mm4, 0x20(%0) \n" \ + "movntq %%mm5, 0x28(%0) \n" \ + "movntq %%mm6, 0x30(%0) \n" \ + "movntq %%mm7, 0x38(%0) \n" \ + : \ + : "q" (dst), "r" (src) \ + : "memory", "st"); + +#define MOVE_32DWORDS_SSE2(src,dst) \ + __asm__ ( \ + "movdqu (%1), %%xmm0 \n" \ + "movdqu 0x10(%1), %%xmm1 \n" \ + "movdqu 0x20(%1), %%xmm2 \n" \ + "movdqu 0x30(%1), %%xmm3 \n" \ + "movdqu 0x40(%1), %%xmm4 \n" \ + "movdqu 0x50(%1), %%xmm5 \n" \ + "movdqu 0x60(%1), %%xmm6 \n" \ + "movdqu 0x70(%1), %%xmm7 \n" \ + "movntdq %%xmm0, (%0) \n" \ + "movntdq %%xmm1, 0x10(%0) \n" \ + "movntdq %%xmm2, 0x20(%0) \n" \ + "movntdq %%xmm3, 0x30(%0) \n" \ + "movntdq %%xmm4, 0x40(%0) \n" \ + "movntdq %%xmm5, 0x50(%0) \n" \ + "movntdq %%xmm6, 0x60(%0) \n" \ + "movntdq %%xmm7, 0x70(%0) \n" \ + : \ + : "q" (dst), "r" (src) \ + : "memory", "st"); + +#define MOVE_32DWORDS_ALIGNED_SSE2(src,dst) \ + __asm__ ( \ + "movdqa (%1), %%xmm0 \n" \ + "movdqa 0x10(%1), %%xmm1 \n" \ + "movdqa 0x20(%1), %%xmm2 \n" \ + "movdqa 0x30(%1), %%xmm3 \n" \ + "movdqa 0x40(%1), %%xmm4 \n" \ + "movdqa 0x50(%1), %%xmm5 \n" \ + "movdqa 0x60(%1), %%xmm6 \n" \ + "movdqa 0x70(%1), %%xmm7 \n" \ + "movntdq %%xmm0, (%0) \n" \ + "movntdq %%xmm1, 0x10(%0) \n" \ + "movntdq %%xmm2, 0x20(%0) \n" \ + "movntdq %%xmm3, 0x30(%0) \n" \ + "movntdq %%xmm4, 0x40(%0) \n" \ + "movntdq %%xmm5, 0x50(%0) \n" \ + "movntdq %%xmm6, 0x60(%0) \n" \ + "movntdq %%xmm7, 0x70(%0) \n" \ + : \ + : "q" (dst), "r" (src) \ + : "memory", "st"); + +/* Empty MMx State + (used to clean-up when going from mmx to float use + of the registers that are shared by both; note that + there is no float-to-mmx operation needed, because + only the float tag word info is corruptible) +*/ + +#define emms() __asm__ __volatile__ ("emms":::"memory") +#define sfence() __asm__ __volatile__ ("sfence":::"memory") + +/* additions to detect mmx - */ +/* Raster */ + +#define CPUID_MMX (1 << 23) /* flags: mmx */ +#define CPUID_SSE (1 << 25) /* flags: xmm */ +#define CPUID_SSE2 (1 << 26) /* flags: ? */ + +/* +#ifdef __amd64 +#define have_cpuid(cpuid_ret) \ + __asm__ __volatile__ ( \ + ".align 32 \n" \ + " pushq %%rbx \n" \ + " pushfq \n" \ + " popq %%rax \n" \ + " movq %%rax, %%rbx \n" \ + " xorq $0x200000, %%rax \n" \ + " pushq %%rax \n" \ + " popfq \n" \ + " pushfq \n" \ + " popq %%rax \n" \ + " cmpq %%rax, %%rbx \n" \ + " je 1f \n" \ + " movl $1, %0 \n" \ + " jmp 2f \n" \ + "1: \n" \ + " movl $0, %0 \n" \ + "2: \n" \ + " popq %%rbx \n" \ + : "=m" (cpuid_ret) \ + ); + +#define get_cpuid(cpuid_ret) \ + __asm__ __volatile__ ( \ + ".align 32 \n" \ + " pushq %%rax \n" \ + " movl $1, %%eax \n" \ + " cpuid \n" \ + " test $0x00800000, %%edx\n" \ + "1: \n" \ + " movl %%edx, %0 \n" \ + " jmp 2f \n" \ + "2: \n" \ + " movl $0, %0 \n" \ + " popq %%rax \n" \ + : "=m" (cpuid_ret) \ + ); +#else +#define have_cpuid(cpuid_ret) \ + __asm__ __volatile__ ( \ + ".align 32 \n" \ + " pushl %%ebx \n" \ + " pushfl \n" \ + " popl %%eax \n" \ + " movl %%eax, %%ebx \n" \ + " xorl $0x200000, %%eax \n" \ + " pushl %%eax \n" \ + " popfl \n" \ + " pushfl \n" \ + " popl %%eax \n" \ + " cmpl %%eax, %%ebx \n" \ + " je 1f \n" \ + " movl $1, %0 \n" \ + " jmp 2f \n" \ + "1: \n" \ + " movl $0, %0 \n" \ + "2: \n" \ + " popl %%ebx \n" \ + : "=m" (cpuid_ret) \ + ); + +#define get_cpuid(cpuid_ret) \ + __asm__ __volatile__ ( \ + ".align 32 \n" \ + " pushl %%eax \n" \ + " movl $1, %%eax \n" \ + " cpuid \n" \ + " test $0x00800000, %%edx\n" \ + "1: \n" \ + " movl %%edx, %0 \n" \ + " jmp 2f \n" \ + "2: \n" \ + " movl $0, %0 \n" \ + " popl %%eax \n" \ + : "=m" (cpuid_ret) \ + ); +#endif + */ + +#define prefetch(var) \ + __asm__ __volatile__ ( \ + "prefetchnta (%0) \n" \ + : \ + : "r" (var) \ + ); +#define prefetch0(var) \ + __asm__ __volatile__ ( \ + "prefetcht0 (%0) \n" \ + : \ + : "r" (var) \ + ); +#define prefetch1(var) \ + __asm__ __volatile__ ( \ + "prefetcht1 (%0) \n" \ + : \ + : "r" (var) \ + ); +#define prefetch2(var) \ + __asm__ __volatile__ ( \ + "prefetcht2 (%0) \n" \ + : \ + : "r" (var) \ + ); +#define pshufw(r1, r2, imm) \ + __asm__ __volatile__ ( \ + "pshufw $" #imm ", %" #r1 ", %" #r2 " \n" \ + ); + +#define pshufhw(r1, r2, imm) \ + __asm__ __volatile__ ( \ + "pshufhw $" #imm ", %" #r1 ", %" #r2 " \n" \ + ); + +#define pshuflw(r1, r2, imm) \ + __asm__ __volatile__ ( \ + "pshuflw $" #imm ", %" #r1 ", %" #r2 " \n" \ + ); +#define pshufd(r1, r2, imm) \ + __asm__ __volatile__ ( \ + "pshufd $" #imm ", %" #r1 ", %" #r2 " \n" \ + ); + +/* 1x238 MOVE Doouble Quadword + (this is both a load and a store... + in fact, it is the only way to store) +*/ +#define movdqu_m2r(var, reg) mmx_m2r(movdqu, var, reg) +#define movdqu_r2m(reg, var) mmx_r2m(movdqu, reg, var) +#define movdqu_r2r(regs, regd) mmx_r2r(movdqu, regs, regd) +#define movdqu(vars, vard) \ + __asm__ __volatile__ ("movdqu %1, %%xmm0\n\t" \ + "movdqu %%xmm0, %0" \ + : "=X" (vard) \ + : "X" (vars)) +#define movdqa_m2r(var, reg) mmx_m2r(movdqa, var, reg) +#define movdqa_r2m(reg, var) mmx_r2m(movdqa, reg, var) +#define movdqa_r2r(regs, regd) mmx_r2r(movdqa, regs, regd) +#define movdqa(vars, vard) \ + __asm__ __volatile__ ("movdqa %1, %%xmm0\n\t" \ + "movdqa %%xmm0, %0" \ + : "=X" (vard) \ + : "X" (vars)) +#define movntdq_r2m(reg, var) mmx_r2m(movntdq, reg, var) + + +/* end additions */ + +#endif diff --git a/libraries/evas/src/lib/include/evas_options.h b/libraries/evas/src/lib/include/evas_options.h new file mode 100644 index 0000000..f6739c0 --- /dev/null +++ b/libraries/evas/src/lib/include/evas_options.h @@ -0,0 +1,69 @@ +#ifndef EVAS_OPTIONS_H +#define EVAS_OPTIONS_H 1 + +/* these may vary per OS */ + +/* what to build *//* small dither table is MUCH faster on ipaq */ +/*#define BUILD_SMALL_DITHER_MASK*/ + +/*#define HARD_CODED_P3*/ +/*#define HARD_CODED_P2*/ + +/*#define BUILD_CONVERT_1_GRY_1*/ +/*#define BUILD_CONVERT_4_GRY_1*/ +/*#define BUILD_CONVERT_4_GRY_4*/ +/*#define BUILD_CONVERT_8_GRY_1*/ +/*#define BUILD_CONVERT_8_GRY_4*/ +/*#define BUILD_CONVERT_8_GRY_16*/ +/*#define BUILD_CONVERT_8_GRY_64*/ +/*#define BUILD_CONVERT_8_GRY_256*/ +/*#define BUILD_CONVERT_8_RGB_332*/ +/*#define BUILD_CONVERT_8_RGB_666*/ +/*#define BUILD_CONVERT_8_RGB_232*/ +/*#define BUILD_CONVERT_8_RGB_222*/ +/*#define BUILD_CONVERT_8_RGB_221*/ +/*#define BUILD_CONVERT_8_RGB_121*/ +/*#define BUILD_CONVERT_8_RGB_111*/ +/*#define BUILD_CONVERT_16_RGB_565*/ +/*#define BUILD_CONVERT_16_RGB_555*/ +/*#define BUILD_CONVERT_16_RGB_444*/ +/*#define BUILD_CONVERT_16_RGB_454645*/ +/*#define BUILD_CONVERT_16_RGB_ROT0*/ +/*#define BUILD_CONVERT_16_RGB_ROT270*/ +/*#define BUILD_CONVERT_24_RGB_888*/ +/*#define BUILD_CONVERT_24_BGR_888*/ +/*#define BUILD_CONVERT_32_RGB_8888*/ +/*#define BUILD_CONVERT_32_BGR_8888*/ +/*#define BUILD_CONVERT_32_RGB_ROT0*/ +/*#define BUILD_CONVERT_32_RGB_ROT270*/ + +/*#define BUILD_SCALE_SAMPLE*/ +/*#define BUILD_SCALE_SMOOTH*/ +/*#define BUILD_SCALE_TRILINEAR*/ + +/*#define BUILD_MMX*/ +/*#define BUILD_SSE*/ +/*#define BUILD_SSE3*/ +/*#define BUILD_C*/ + +/*#define BUILD_LOADER_PNG*/ +/*#define BUILD_LOADER_JPEG*/ +/*#define BUILD_LOADER_EET*/ +/*#define BUILD_LOADER_EDB*/ + +/*#define BUILD_FMEMOPEN*/ + +/* check in that the user configured it right */ +#ifndef BUILD_MMX +# ifndef BUILD_SSE3 +# ifndef BUILD_SSE +# ifndef BUILD_C +# error "Please Read the README" + #endif +# endif +# endif +#endif + +#define DIRECT_SCALE + +#endif diff --git a/libraries/evas/src/lib/include/evas_private.h b/libraries/evas/src/lib/include/evas_private.h new file mode 100644 index 0000000..90498d0 --- /dev/null +++ b/libraries/evas/src/lib/include/evas_private.h @@ -0,0 +1,1107 @@ +#ifndef EVAS_PRIVATE_H +#define EVAS_PRIVATE_H + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include +#include "Evas.h" + +#include "../file/evas_module.h" +#include "../file/evas_path.h" +#include "../engines/common/evas_text_utils.h" +#include "../engines/common/language/evas_bidi_utils.h" +#include "../engines/common/language/evas_language_utils.h" + +#ifdef EVAS_MAGIC_DEBUG +/* complain when peole pass in wrong object types etc. */ +# define MAGIC_DEBUG +#endif + +#define RENDER_METHOD_INVALID 0x00000000 + +typedef struct _Evas_Layer Evas_Layer; +typedef struct _Evas_Size Evas_Size; +typedef struct _Evas_Aspect Evas_Aspect; +typedef struct _Evas_Border Evas_Border; +typedef struct _Evas_Double_Pair Evas_Double_Pair; +typedef struct _Evas_Size_Hints Evas_Size_Hints; +typedef struct _Evas_Font_Dir Evas_Font_Dir; +typedef struct _Evas_Font Evas_Font; +typedef struct _Evas_Font_Alias Evas_Font_Alias; +typedef struct _Evas_Font_Description Evas_Font_Description; +typedef struct _Evas_Data_Node Evas_Data_Node; +typedef struct _Evas_Func_Node Evas_Func_Node; +typedef RGBA_Image_Loadopts Evas_Image_Load_Opts; +typedef struct _Evas_Func Evas_Func; +typedef struct _Evas_Image_Load_Func Evas_Image_Load_Func; +typedef struct _Evas_Image_Save_Func Evas_Image_Save_Func; +typedef struct _Evas_Object_Func Evas_Object_Func; +typedef struct _Evas_Intercept_Func Evas_Intercept_Func; +typedef struct _Evas_Key_Grab Evas_Key_Grab; +typedef struct _Evas_Callbacks Evas_Callbacks; +typedef struct _Evas_Format Evas_Format; +typedef struct _Evas_Map_Point Evas_Map_Point; +typedef struct _Evas_Smart_Cb_Description_Array Evas_Smart_Cb_Description_Array; +typedef struct _Evas_Post_Callback Evas_Post_Callback; +typedef struct _Evas_Coord_Touch_Point Evas_Coord_Touch_Point; + +enum _Evas_Font_Style +{ + EVAS_FONT_STYLE_SLANT, + EVAS_FONT_STYLE_WEIGHT, + EVAS_FONT_STYLE_WIDTH +}; + +enum _Evas_Font_Slant +{ + EVAS_FONT_SLANT_NORMAL, + EVAS_FONT_SLANT_OBLIQUE, + EVAS_FONT_SLANT_ITALIC +}; + +enum _Evas_Font_Weight +{ + EVAS_FONT_WEIGHT_NORMAL, + EVAS_FONT_WEIGHT_THIN, + EVAS_FONT_WEIGHT_ULTRALIGHT, + EVAS_FONT_WEIGHT_LIGHT, + EVAS_FONT_WEIGHT_BOOK, + EVAS_FONT_WEIGHT_MEDIUM, + EVAS_FONT_WEIGHT_SEMIBOLD, + EVAS_FONT_WEIGHT_BOLD, + EVAS_FONT_WEIGHT_ULTRABOLD, + EVAS_FONT_WEIGHT_BLACK, + EVAS_FONT_WEIGHT_EXTRABLACK +}; + +enum _Evas_Font_Width +{ + EVAS_FONT_WIDTH_NORMAL, + EVAS_FONT_WIDTH_ULTRACONDENSED, + EVAS_FONT_WIDTH_EXTRACONDENSED, + EVAS_FONT_WIDTH_CONDENSED, + EVAS_FONT_WIDTH_SEMICONDENSED, + EVAS_FONT_WIDTH_SEMIEXPANDED, + EVAS_FONT_WIDTH_EXPANDED, + EVAS_FONT_WIDTH_EXTRAEXPANDED, + EVAS_FONT_WIDTH_ULTRAEXPANDED +}; + +typedef enum _Evas_Font_Style Evas_Font_Style; +typedef enum _Evas_Font_Slant Evas_Font_Slant; +typedef enum _Evas_Font_Weight Evas_Font_Weight; +typedef enum _Evas_Font_Width Evas_Font_Width; + +/* General types - used for script type chceking */ +#define OPAQUE_TYPE(type) struct __##type { int a; }; \ + typedef struct __##type type + +OPAQUE_TYPE(Evas_Font_Set); /* General type for RGBA_Font */ +OPAQUE_TYPE(Evas_Font_Instance); /* General type for RGBA_Font_Int */ +/* End of general types */ + +#define MAGIC_EVAS 0x70777770 +#define MAGIC_OBJ 0x71777770 +#define MAGIC_OBJ_RECTANGLE 0x71777771 +#define MAGIC_OBJ_LINE 0x71777772 +#define MAGIC_OBJ_POLYGON 0x71777774 +#define MAGIC_OBJ_IMAGE 0x71777775 +#define MAGIC_OBJ_TEXT 0x71777776 +#define MAGIC_OBJ_SMART 0x71777777 +#define MAGIC_OBJ_TEXTBLOCK 0x71777778 +#define MAGIC_SMART 0x72777770 +#define MAGIC_OBJ_SHAPE 0x72777773 +#define MAGIC_OBJ_CONTAINER 0x72777774 +#define MAGIC_OBJ_CUSTOM 0x72777775 +#define MAGIC_EVAS_GL 0x72777776 +#define MAGIC_MAP 0x72777777 + +#ifdef MAGIC_DEBUG +# define MAGIC_CHECK_FAILED(o, t, m) \ +{evas_debug_error(); \ + if (!o) evas_debug_input_null(); \ + else if (((t *)o)->magic == 0) evas_debug_magic_null(); \ + else evas_debug_magic_wrong((m), ((t *)o)->magic); \ +} +# define MAGIC_CHECK(o, t, m) \ +{if ((!o) || (!(((t *)o)->magic == (m)))) { \ +MAGIC_CHECK_FAILED(o, t, m) +# define MAGIC_CHECK_END() }} +#else +# define MAGIC_CHECK_FAILED(o, t, m) +# define MAGIC_CHECK(o, t, m) { if (!o) { +# define MAGIC_CHECK_END() }} +#endif + +#define NEW_RECT(_r, _x, _y, _w, _h) (_r) = eina_rectangle_new(_x, _y, _w, _h); + +#define MERR_NONE() _evas_alloc_error = EVAS_ALLOC_ERROR_NONE +#define MERR_FATAL() _evas_alloc_error = EVAS_ALLOC_ERROR_FATAL +#define MERR_BAD() _evas_alloc_error = EVAS_ALLOC_ERROR_RECOVERED + +#define EVAS_OBJECT_IMAGE_FREE_FILE_AND_KEY(o) \ + if ((o)->cur.file) \ + { \ + eina_stringshare_del((o)->cur.file); \ + if ((o)->prev.file == (o)->cur.file) \ + (o)->prev.file = NULL; \ + (o)->cur.file = NULL; \ + } \ + if ((o)->cur.key) \ + { \ + eina_stringshare_del((o)->cur.key); \ + if ((o)->prev.key == (o)->cur.key) \ + (o)->prev.key = NULL; \ + (o)->cur.key = NULL; \ + } \ + if ((o)->prev.file) \ + { \ + eina_stringshare_del((o)->prev.file); \ + (o)->prev.file = NULL; \ + } \ + if ((o)->prev.key) \ + { \ + eina_stringshare_del((o)->prev.key); \ + (o)->prev.key = NULL; \ + } + +struct _Evas_Coord_Touch_Point +{ + Evas_Coord x, y; // point's x, y position + int id; // id in order to distinguish each point + Evas_Touch_Point_State state; +}; + +struct _Evas_Key_Grab +{ + char *keyname; + Evas_Modifier_Mask modifiers; + Evas_Modifier_Mask not_modifiers; + Evas_Object *object; + Eina_Bool exclusive : 1; + Eina_Bool just_added : 1; + Eina_Bool delete_me : 1; +}; + +struct _Evas_Intercept_Func +{ + struct { + Evas_Object_Intercept_Show_Cb func; + void *data; + } show; + struct { + Evas_Object_Intercept_Hide_Cb func; + void *data; + } hide; + struct { + Evas_Object_Intercept_Move_Cb func; + void *data; + } move; + struct { + Evas_Object_Intercept_Resize_Cb func; + void *data; + } resize; + struct { + Evas_Object_Intercept_Raise_Cb func; + void *data; + } raise; + struct { + Evas_Object_Intercept_Lower_Cb func; + void *data; + } lower; + struct { + Evas_Object_Intercept_Stack_Above_Cb func; + void *data; + } stack_above; + struct { + Evas_Object_Intercept_Stack_Below_Cb func; + void *data; + } stack_below; + struct { + Evas_Object_Intercept_Layer_Set_Cb func; + void *data; + } layer_set; + struct { + Evas_Object_Intercept_Color_Set_Cb func; + void *data; + } color_set; + struct { + Evas_Object_Intercept_Clip_Set_Cb func; + void *data; + } clip_set; + struct { + Evas_Object_Intercept_Clip_Unset_Cb func; + void *data; + } clip_unset; +}; + +struct _Evas_Smart_Cb_Description_Array +{ + unsigned int size; + const Evas_Smart_Cb_Description **array; +}; + +struct _Evas_Smart +{ + DATA32 magic; + + int usage; + + const Evas_Smart_Class *smart_class; + + Evas_Smart_Cb_Description_Array callbacks; + + unsigned char delete_me : 1; + unsigned char class_allocated : 1; + +}; + +struct _Evas_Modifier +{ + struct { + int count; + char **list; + } mod; + Evas_Modifier_Mask mask; /* ok we have a max of 64 modifiers */ +}; + +struct _Evas_Lock +{ + struct { + int count; + char **list; + } lock; + Evas_Modifier_Mask mask; /* we have a max of 64 locks */ +}; + +struct _Evas_Post_Callback +{ + Evas_Object *obj; + Evas_Object_Event_Post_Cb func; + const void *data; + unsigned char delete_me : 1; +}; + +struct _Evas_Callbacks +{ + Eina_Inlist *callbacks; + int walking_list; + unsigned char deletions_waiting : 1; +}; + +struct _Evas +{ + EINA_INLIST; + + DATA32 magic; + + struct { + unsigned char inside : 1; + int mouse_grabbed; + DATA32 button; + Evas_Coord x, y; + struct { + Eina_List *in; + } object; + + } pointer; + + struct { + Evas_Coord x, y, w, h; + unsigned char changed : 1; + } viewport; + + struct { + int w, h; + DATA32 render_method; + unsigned char changed : 1; + } output; + + Eina_List *damages; + Eina_List *obscures; + + Evas_Layer *layers; + + Eina_Hash *name_hash; + + int output_validity; + + int walking_list; + int events_frozen; + + struct { + Evas_Module *module; + Evas_Func *func; + struct { + void *output; + + void *context; + } data; + + void *info; + int info_magic; + } engine; + + Eina_Array delete_objects; + Eina_Array active_objects; + Eina_Array restack_objects; + Eina_Array render_objects; + Eina_Array pending_objects; + Eina_Array obscuring_objects; + Eina_Array temporary_objects; + Eina_Array calculate_objects; + Eina_Array clip_changes; + + Eina_Clist calc_list; + Eina_Clist calc_done; + Eina_List *video_objects; + + Eina_List *post_events; // free me on evas_free + + Evas_Callbacks *callbacks; + + int delete_grabs; + int walking_grabs; + Eina_List *grabs; + + Eina_List *font_path; + + int in_smart_calc; + int smart_calc_count; + + Evas_Object *focused; + void *attach_data; + Evas_Modifier modifiers; + Evas_Lock locks; + unsigned int last_timestamp; + int last_mouse_down_counter; + int last_mouse_up_counter; + int nochange; + Evas_Font_Hinting_Flags hinting; + unsigned char changed : 1; + unsigned char delete_me : 1; + unsigned char invalidate : 1; + unsigned char cleanup : 1; + unsigned char focus : 1; + + Eina_List *touch_points; +}; + +struct _Evas_Layer +{ + EINA_INLIST; + + short layer; + Evas_Object *objects; + + Evas *evas; + + void *engine_data; + int usage; + unsigned char delete_me : 1; +}; + +struct _Evas_Size +{ + Evas_Coord w, h; +}; + +struct _Evas_Aspect +{ + Evas_Aspect_Control mode; + Evas_Size size; +}; + +struct _Evas_Border +{ + Evas_Coord l, r, t, b; +}; + +struct _Evas_Double_Pair +{ + double x, y; +}; + +struct _Evas_Size_Hints +{ + Evas_Size min, max, request; + Evas_Aspect aspect; + Evas_Double_Pair align, weight; + Evas_Border padding; +}; + +struct _Evas_Map_Point +{ + double x, y, z, px, py; + double u, v; + unsigned char r, g, b, a; +}; + +struct _Evas_Map +{ + DATA32 magic; + int count; // num of points + Evas_Coord_Rectangle normal_geometry; // bounding box of map geom actually + void *surface; // surface holding map if needed + int surface_w, surface_h; // current surface w & h alloc + Evas_Coord mx, my; // mouse x, y after conversion to map space + struct { + Evas_Coord px, py, z0, foc; + } persp; + Eina_Bool alpha : 1; + Eina_Bool smooth : 1; + Evas_Map_Point points[]; // actual points +}; + +#if 0 // filtering disabled +/* nash: Split into two bits */ +typedef struct Evas_Filter_Info +{ + Evas_Filter filter; + Evas_Filter_Mode mode; + + Eina_Bool dirty : 1; + + int datalen; + void *data; + void (*data_free)(void *); + + uint8_t *key; + uint32_t len; + Filtered_Image *cached; +} Evas_Filter_Info; + +typedef Eina_Bool (*Evas_Software_Filter_Fn)(Evas_Filter_Info *, RGBA_Image *, RGBA_Image *); + +int evas_filter_get_size(Evas_Filter_Info *info, int inw, int inh, + int *outw, int *outh, Eina_Bool inv); +Eina_Bool evas_filter_always_alpha(Evas_Filter_Info *info); +uint8_t *evas_filter_key_get(const Evas_Filter_Info *info, uint32_t *lenp); +// expose for use in engines +EAPI Evas_Software_Filter_Fn evas_filter_software_get(Evas_Filter_Info *info); +void evas_filter_free(Evas_Object *o); +#endif + +struct _Evas_Object +{ + EINA_INLIST; + + DATA32 magic; + + const char *type; + Evas_Layer *layer; + + struct { + Evas_Map *map; + Evas_Object *clipper; + Evas_Object *mask; + Evas_Object *map_parent; + double scale; + Evas_Coord_Rectangle geometry; + struct { + struct { + Evas_Coord x, y, w, h; + unsigned char r, g, b, a; + Eina_Bool visible : 1; + Eina_Bool dirty : 1; + } clip; + } cache; + short layer; + struct { + unsigned char r, g, b, a; + } color; + Eina_Bool usemap : 1; + Eina_Bool visible : 1; + Eina_Bool have_clipees : 1; + Eina_Bool anti_alias : 1; + Evas_Render_Op render_op : 4; + } cur, prev; + + char *name; + + Evas_Intercept_Func *interceptors; + + struct { + Eina_List *elements; + } data; + + Eina_List *grabs; + + Evas_Callbacks *callbacks; + + struct { + Eina_List *clipees; + Eina_List *changes; + } clip; + + const Evas_Object_Func *func; + + void *object_data; + + struct { + Evas_Smart *smart; + Evas_Object *parent; + } smart; + + struct { + Eina_List *proxies; + void *surface; + int w,h; + Eina_Bool redraw; + } proxy; + +#if 0 // filtering disabled + Evas_Filter_Info *filter; +#endif + + Evas_Size_Hints *size_hints; + + int last_mouse_down_counter; + int last_mouse_up_counter; + int mouse_grabbed; + + int last_event; + Evas_Callback_Type last_event_type; + + struct { + int in_move, in_resize; + } doing; + + unsigned int ref; + + unsigned char delete_me; + + unsigned char recalculate_cycle; + Eina_Clist calc_entry; + + Evas_Object_Pointer_Mode pointer_mode : 1; + + Eina_Bool store : 1; + Eina_Bool pass_events : 1; + Eina_Bool freeze_events : 1; + Eina_Bool repeat_events : 1; + struct { + Eina_Bool pass_events : 1; + Eina_Bool pass_events_valid : 1; + Eina_Bool freeze_events : 1; + Eina_Bool freeze_events_valid : 1; + } parent_cache; + Eina_Bool restack : 1; + Eina_Bool is_active : 1; + Eina_Bool precise_is_inside : 1; + Eina_Bool is_static_clip : 1; + + Eina_Bool render_pre : 1; + Eina_Bool rect_del : 1; + Eina_Bool mouse_in : 1; + Eina_Bool pre_render_done : 1; + Eina_Bool intercepted : 1; + Eina_Bool focused : 1; + Eina_Bool in_layer : 1; + Eina_Bool no_propagate : 1; + + Eina_Bool changed : 1; + Eina_Bool changed_move : 1; + Eina_Bool changed_move_only : 1; + Eina_Bool changed_nomove : 1; + Eina_Bool del_ref : 1; +}; + +struct _Evas_Func_Node +{ + EINA_INLIST; + void (*func) (); + void *data; + Evas_Callback_Type type; + Evas_Callback_Priority priority; + unsigned char delete_me : 1; +}; + +struct _Evas_Data_Node +{ + char *key; + void *data; +}; + +struct _Evas_Font_Dir +{ + Eina_Hash *lookup; + Eina_List *fonts; + Eina_List *aliases; + DATA64 dir_mod_time; + DATA64 fonts_dir_mod_time; + DATA64 fonts_alias_mod_time; +}; + +struct _Evas_Font +{ + struct { + const char *prop[14]; + } x; + struct { + const char *name; + } simple; + const char *path; + char type; +}; + +struct _Evas_Font_Alias +{ + const char *alias; + Evas_Font *fn; +}; + +struct _Evas_Font_Description +{ + int ref; + /* We assume everywhere this is stringshared */ + const char *name; + const char *fallbacks; + const char *lang; + + Evas_Font_Slant slant; + Evas_Font_Weight weight; + Evas_Font_Width width; + + Eina_Bool is_new : 1; +}; + +struct _Evas_Object_Func +{ + void (*free) (Evas_Object *obj); + void (*render) (Evas_Object *obj, void *output, void *context, void *surface, int x, int y); + void (*render_pre) (Evas_Object *obj); + void (*render_post) (Evas_Object *obj); + + unsigned int (*type_id_get) (Evas_Object *obj); + unsigned int (*visual_id_get) (Evas_Object *obj); + void *(*engine_data_get) (Evas_Object *obj); + + void (*store) (Evas_Object *obj); + void (*unstore) (Evas_Object *obj); + + int (*is_visible) (Evas_Object *obj); + int (*was_visible) (Evas_Object *obj); + + int (*is_opaque) (Evas_Object *obj); + int (*was_opaque) (Evas_Object *obj); + + int (*is_inside) (Evas_Object *obj, Evas_Coord x, Evas_Coord y); + int (*was_inside) (Evas_Object *obj, Evas_Coord x, Evas_Coord y); + + void (*coords_recalc) (Evas_Object *obj); + + void (*scale_update) (Evas_Object *obj); + + int (*has_opaque_rect) (Evas_Object *obj); + int (*get_opaque_rect) (Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h); + + int (*can_map) (Evas_Object *obj); +}; + +struct _Evas_Func +{ + void *(*info) (Evas *e); + void (*info_free) (Evas *e, void *info); + int (*setup) (Evas *e, void *info); + + void (*output_free) (void *data); + void (*output_resize) (void *data, int w, int h); + void (*output_tile_size_set) (void *data, int w, int h); + void (*output_redraws_rect_add) (void *data, int x, int y, int w, int h); + void (*output_redraws_rect_del) (void *data, int x, int y, int w, int h); + void (*output_redraws_clear) (void *data); + void *(*output_redraws_next_update_get) (void *data, int *x, int *y, int *w, int *h, int *cx, int *cy, int *cw, int *ch); + void (*output_redraws_next_update_push) (void *data, void *surface, int x, int y, int w, int h); + void (*output_flush) (void *data); + void (*output_idle_flush) (void *data); + void (*output_dump) (void *data); + + void *(*context_new) (void *data); + Eina_Bool (*canvas_alpha_get) (void *data, void *context); + void (*context_free) (void *data, void *context); + void (*context_clip_set) (void *data, void *context, int x, int y, int w, int h); + void (*context_clip_clip) (void *data, void *context, int x, int y, int w, int h); + void (*context_clip_unset) (void *data, void *context); + int (*context_clip_get) (void *data, void *context, int *x, int *y, int *w, int *h); + void (*context_mask_set) (void *data, void *context, void *mask, int x, int y, int w, int h); + void (*context_mask_unset) (void *data, void *context); + void (*context_color_set) (void *data, void *context, int r, int g, int b, int a); + int (*context_color_get) (void *data, void *context, int *r, int *g, int *b, int *a); + void (*context_multiplier_set) (void *data, void *context, int r, int g, int b, int a); + void (*context_multiplier_unset) (void *data, void *context); + int (*context_multiplier_get) (void *data, void *context, int *r, int *g, int *b, int *a); + void (*context_cutout_add) (void *data, void *context, int x, int y, int w, int h); + void (*context_cutout_clear) (void *data, void *context); + void (*context_anti_alias_set) (void *data, void *context, unsigned char aa); + unsigned char (*context_anti_alias_get) (void *data, void *context); + void (*context_color_interpolation_set) (void *data, void *context, int color_space); + int (*context_color_interpolation_get) (void *data, void *context); + void (*context_render_op_set) (void *data, void *context, int render_op); + int (*context_render_op_get) (void *data, void *context); + + void (*rectangle_draw) (void *data, void *context, void *surface, int x, int y, int w, int h); + + void (*line_draw) (void *data, void *context, void *surface, int x1, int y1, int x2, int y2); + + void *(*polygon_point_add) (void *data, void *context, void *polygon, int x, int y); + void *(*polygon_points_clear) (void *data, void *context, void *polygon); + void (*polygon_draw) (void *data, void *context, void *surface, void *polygon, int x, int y); + + void *(*image_load) (void *data, const char *file, const char *key, int *error, Evas_Image_Load_Opts *lo); + void *(*image_new_from_data) (void *data, int w, int h, DATA32 *image_data, int alpha, int cspace); + void *(*image_new_from_copied_data) (void *data, int w, int h, DATA32 *image_data, int alpha, int cspace); + void (*image_free) (void *data, void *image); + void (*image_size_get) (void *data, void *image, int *w, int *h); + void *(*image_size_set) (void *data, void *image, int w, int h); + void (*image_stride_get) (void *data, void *image, int *stride); + void *(*image_dirty_region) (void *data, void *image, int x, int y, int w, int h); + void *(*image_data_get) (void *data, void *image, int to_write, DATA32 **image_data, int *err); + void *(*image_data_put) (void *data, void *image, DATA32 *image_data); + void (*image_data_preload_request) (void *data, void *image, const void *target); + void (*image_data_preload_cancel) (void *data, void *image, const void *target); + void *(*image_alpha_set) (void *data, void *image, int has_alpha); + int (*image_alpha_get) (void *data, void *image); + void *(*image_border_set) (void *data, void *image, int l, int r, int t, int b); + void (*image_border_get) (void *data, void *image, int *l, int *r, int *t, int *b); + void (*image_draw) (void *data, void *context, void *surface, void *image, int src_x, int src_y, int src_w, int src_h, int dst_x, int dst_y, int dst_w, int dst_h, int smooth); + char *(*image_comment_get) (void *data, void *image, char *key); + char *(*image_format_get) (void *data, void *image); + void (*image_colorspace_set) (void *data, void *image, int cspace); + int (*image_colorspace_get) (void *data, void *image); + void (*image_mask_create) (void *data, void *image); + void *(*image_native_set) (void *data, void *image, void *native); + void *(*image_native_get) (void *data, void *image); + + void (*image_cache_flush) (void *data); + void (*image_cache_set) (void *data, int bytes); + int (*image_cache_get) (void *data); + + Evas_Font_Set *(*font_load) (void *data, const char *name, int size, Font_Rend_Flags wanted_rend); + Evas_Font_Set *(*font_memory_load) (void *data, char *name, int size, const void *fdata, int fdata_size, Font_Rend_Flags wanted_rend); + Evas_Font_Set *(*font_add) (void *data, Evas_Font_Set *font, const char *name, int size, Font_Rend_Flags wanted_rend); + Evas_Font_Set *(*font_memory_add) (void *data, Evas_Font_Set *font, char *name, int size, const void *fdata, int fdata_size, Font_Rend_Flags wanted_rend); + void (*font_free) (void *data, Evas_Font_Set *font); + int (*font_ascent_get) (void *data, Evas_Font_Set *font); + int (*font_descent_get) (void *data, Evas_Font_Set *font); + int (*font_max_ascent_get) (void *data, Evas_Font_Set *font); + int (*font_max_descent_get) (void *data, Evas_Font_Set *font); + void (*font_string_size_get) (void *data, Evas_Font_Set *font, const Evas_Text_Props *intl_props, int *w, int *h); + int (*font_inset_get) (void *data, Evas_Font_Set *font, const Evas_Text_Props *text_props); + int (*font_h_advance_get) (void *data, Evas_Font_Set *font, const Evas_Text_Props *intl_props); + int (*font_v_advance_get) (void *data, Evas_Font_Set *font, const Evas_Text_Props *intl_props); + int (*font_char_coords_get) (void *data, Evas_Font_Set *font, const Evas_Text_Props *intl_props, int pos, int *cx, int *cy, int *cw, int *ch); + int (*font_char_at_coords_get) (void *data, Evas_Font_Set *font, const Evas_Text_Props *intl_props, int x, int y, int *cx, int *cy, int *cw, int *ch); + void (*font_draw) (void *data, void *context, void *surface, Evas_Font_Set *font, int x, int y, int w, int h, int ow, int oh, const Evas_Text_Props *intl_props); + + void (*font_cache_flush) (void *data); + void (*font_cache_set) (void *data, int bytes); + int (*font_cache_get) (void *data); + + /* Engine functions will over time expand from here */ + + void (*font_hinting_set) (void *data, Evas_Font_Set *font, int hinting); + int (*font_hinting_can_hint) (void *data, int hinting); + +/* void (*image_rotation_set) (void *data, void *image); */ + + void (*image_scale_hint_set) (void *data, void *image, int hint); + int (*image_scale_hint_get) (void *data, void *image); + int (*font_last_up_to_pos) (void *data, Evas_Font_Set *font, const Evas_Text_Props *intl_props, int x, int y); + + void (*image_map_draw) (void *data, void *context, void *surface, void *image, int npoints, RGBA_Map_Point *p, int smooth, int level); + void *(*image_map_surface_new) (void *data, int w, int h, int alpha); + void (*image_map_surface_free) (void *data, void *surface); + + void (*image_content_hint_set) (void *data, void *surface, int hint); + int (*image_content_hint_get) (void *data, void *surface); + int (*font_pen_coords_get) (void *data, Evas_Font_Set *font, const Evas_Text_Props *intl_props, int pos, int *cpen_x, int *cy, int *cadv, int *ch); + Eina_Bool (*font_text_props_info_create) (void *data __UNUSED__, Evas_Font_Instance *fi, const Eina_Unicode *text, Evas_Text_Props *intl_props, const Evas_BiDi_Paragraph_Props *par_props, size_t pos, size_t len); + int (*font_right_inset_get) (void *data, Evas_Font_Set *font, const Evas_Text_Props *text_props); + +#if 0 // filtering disabled + void (*image_draw_filtered) (void *data, void *context, void *surface, void *image, Evas_Filter_Info *filter); + Filtered_Image *(*image_filtered_get) (void *image, uint8_t *key, size_t len); + Filtered_Image *(*image_filtered_save) (void *image, void *filtered, uint8_t *key, size_t len); + void (*image_filtered_free) (void *image, Filtered_Image *); +#endif + + /* EFL-GL Glue Layer */ + void *(*gl_surface_create) (void *data, void *config, int w, int h); + int (*gl_surface_destroy) (void *data, void *surface); + void *(*gl_context_create) (void *data, void *share_context); + int (*gl_context_destroy) (void *data, void *context); + int (*gl_make_current) (void *data, void *surface, void *context); + void *(*gl_string_query) (void *data, int name); + void *(*gl_proc_address_get) (void *data, const char *name); + int (*gl_native_surface_get) (void *data, void *surface, void *native_surface); + void *(*gl_api_get) (void *data); + + int (*image_load_error_get) (void *data, void *image); + int (*font_run_end_get) (void *data, Evas_Font_Set *font, Evas_Font_Instance **script_fi, Evas_Font_Instance **cur_fi, Evas_Script_Type script, const Eina_Unicode *text, int run_len); + + /* animated feature */ + Eina_Bool (*image_animated_get) (void *data, void *image); + int (*image_animated_frame_count_get) (void *data, void *image); + Evas_Image_Animated_Loop_Hint (*image_animated_loop_type_get) (void *data, void *image); + int (*image_animated_loop_count_get) (void *data, void *image); + double (*image_animated_frame_duration_get) (void *data, void *image, int start_frame, int frame_num); + Eina_Bool (*image_animated_frame_set) (void *data, void *image, int frame_index); + + /* max size query */ + void (*image_max_size_get) (void *data, int *maxw, int *maxh); +}; + +struct _Evas_Image_Load_Func +{ + Eina_Bool threadable; + Eina_Bool (*file_head) (Image_Entry *ie, const char *file, const char *key, int *error); + Eina_Bool (*file_data) (Image_Entry *ie, const char *file, const char *key, int *error); + double (*frame_duration) (Image_Entry *ie, const char *file, const int start, const int frame_num); +}; + +struct _Evas_Image_Save_Func +{ + int (*image_save) (RGBA_Image *im, const char *file, const char *key, int quality, int compress); +}; + +#ifdef __cplusplus +extern "C" { +#endif + +Evas_Object *evas_object_new(Evas *e); +void evas_object_free(Evas_Object *obj, int clean_layer); +void evas_object_inject(Evas_Object *obj, Evas *e); +void evas_object_release(Evas_Object *obj, int clean_layer); +void evas_object_change(Evas_Object *obj); +void evas_object_clip_changes_clean(Evas_Object *obj); +void evas_object_render_pre_visible_change(Eina_Array *rects, Evas_Object *obj, int is_v, int was_v); +void evas_object_render_pre_clipper_change(Eina_Array *rects, Evas_Object *obj); +void evas_object_render_pre_prev_cur_add(Eina_Array *rects, Evas_Object *obj); +void evas_object_render_pre_effect_updates(Eina_Array *rects, Evas_Object *obj, int is_v, int was_v); +void evas_rects_return_difference_rects(Eina_Array *rects, int x, int y, int w, int h, int xx, int yy, int ww, int hh); + +void evas_object_clip_dirty(Evas_Object *obj); +void evas_object_recalc_clippees(Evas_Object *obj); +Evas_Layer *evas_layer_new(Evas *e); +void evas_layer_pre_free(Evas_Layer *lay); +void evas_layer_free_objects(Evas_Layer *lay); +void evas_layer_clean(Evas *e); +Evas_Layer *evas_layer_find(Evas *e, short layer_num); +void evas_layer_add(Evas_Layer *lay); +void evas_layer_del(Evas_Layer *lay); + +int evas_object_was_in_output_rect(Evas_Object *obj, int x, int y, int w, int h); + +int evas_object_was_opaque(Evas_Object *obj); +int evas_object_is_inside(Evas_Object *obj, Evas_Coord x, Evas_Coord y); +int evas_object_was_inside(Evas_Object *obj, Evas_Coord x, Evas_Coord y); +int evas_object_clippers_was_visible(Evas_Object *obj); +void evas_object_clip_across_check(Evas_Object *obj); +void evas_object_clip_across_clippees_check(Evas_Object *obj); +void evas_object_mapped_clip_across_mark(Evas_Object *obj); +void evas_event_callback_call(Evas *e, Evas_Callback_Type type, void *event_info); +void evas_object_event_callback_call(Evas_Object *obj, Evas_Callback_Type type, void *event_info); +Eina_List *evas_event_objects_event_list(Evas *e, Evas_Object *stop, int x, int y); +int evas_mem_free(int mem_required); +int evas_mem_degrade(int mem_required); +void evas_debug_error(void); +void evas_debug_input_null(void); +void evas_debug_magic_null(void); +void evas_debug_magic_wrong(DATA32 expected, DATA32 supplied); +void evas_debug_generic(const char *str); +const char *evas_debug_magic_string_get(DATA32 magic); +void evas_object_smart_use(Evas_Smart *s); +void evas_object_smart_unuse(Evas_Smart *s); +void evas_smart_cb_descriptions_fix(Evas_Smart_Cb_Description_Array *a) EINA_ARG_NONNULL(1); +Eina_Bool evas_smart_cb_descriptions_resize(Evas_Smart_Cb_Description_Array *a, unsigned int size) EINA_ARG_NONNULL(1); +const Evas_Smart_Cb_Description *evas_smart_cb_description_find(const Evas_Smart_Cb_Description_Array *a, const char *name) EINA_ARG_NONNULL(1, 2) EINA_PURE; + +Eina_Bool _evas_object_image_preloading_get(const Evas_Object *obj); +void _evas_object_image_preloading_set(Evas_Object *obj, Eina_Bool preloading); +void _evas_object_image_preloading_check(Evas_Object *obj); +Evas_Object *_evas_object_image_video_parent_get(Evas_Object *obj); +void _evas_object_image_video_overlay_show(Evas_Object *obj); +void _evas_object_image_video_overlay_hide(Evas_Object *obj); +void evas_object_smart_del(Evas_Object *obj); +void evas_object_smart_cleanup(Evas_Object *obj); +void evas_object_smart_member_raise(Evas_Object *member); +void evas_object_smart_member_lower(Evas_Object *member); +void evas_object_smart_member_stack_above(Evas_Object *member, Evas_Object *other); +void evas_object_smart_member_stack_below(Evas_Object *member, Evas_Object *other); +const Eina_Inlist *evas_object_smart_members_get_direct(const Evas_Object *obj); +void _evas_object_smart_members_all_del(Evas_Object *obj); +void evas_call_smarts_calculate(Evas *e); +void *evas_mem_calloc(int size); +void _evas_post_event_callback_call(Evas *e); +void _evas_post_event_callback_free(Evas *e); +void evas_event_callback_list_post_free(Eina_Inlist **list); +void evas_object_event_callback_all_del(Evas_Object *obj); +void evas_object_event_callback_cleanup(Evas_Object *obj); +void evas_event_callback_all_del(Evas *e); +void evas_event_callback_cleanup(Evas *e); +void evas_object_inform_call_show(Evas_Object *obj); +void evas_object_inform_call_hide(Evas_Object *obj); +void evas_object_inform_call_move(Evas_Object *obj); +void evas_object_inform_call_resize(Evas_Object *obj); +void evas_object_inform_call_restack(Evas_Object *obj); +void evas_object_inform_call_changed_size_hints(Evas_Object *obj); +void evas_object_inform_call_image_preloaded(Evas_Object *obj); +void evas_object_inform_call_image_unloaded(Evas_Object *obj); +void evas_object_intercept_cleanup(Evas_Object *obj); +int evas_object_intercept_call_show(Evas_Object *obj); +int evas_object_intercept_call_hide(Evas_Object *obj); +int evas_object_intercept_call_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y); +int evas_object_intercept_call_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h); +int evas_object_intercept_call_raise(Evas_Object *obj); +int evas_object_intercept_call_lower(Evas_Object *obj); +int evas_object_intercept_call_stack_above(Evas_Object *obj, Evas_Object *above); +int evas_object_intercept_call_stack_below(Evas_Object *obj, Evas_Object *below); +int evas_object_intercept_call_layer_set(Evas_Object *obj, int l); +int evas_object_intercept_call_color_set(Evas_Object *obj, int r, int g, int b, int a); +int evas_object_intercept_call_clip_set(Evas_Object *obj, Evas_Object *clip); +int evas_object_intercept_call_clip_unset(Evas_Object *obj); +void evas_object_grabs_cleanup(Evas_Object *obj); +void evas_key_grab_free(Evas_Object *obj, const char *keyname, Evas_Modifier_Mask modifiers, Evas_Modifier_Mask not_modifiers); +void evas_font_dir_cache_free(void); +const char *evas_font_dir_cache_find(char *dir, char *font); +Eina_List *evas_font_dir_available_list(const Evas* evas); +void evas_font_dir_available_list_free(Eina_List *available); +void evas_font_free(Evas *evas, void *font); +void evas_fonts_zero_free(Evas *evas); +void evas_fonts_zero_presure(Evas *evas); +void evas_font_name_parse(Evas_Font_Description *fdesc, const char *name); +int evas_font_style_find(const char *start, const char *end, Evas_Font_Style style); +Evas_Font_Description *evas_font_desc_new(void); +Evas_Font_Description *evas_font_desc_dup(const Evas_Font_Description *fdesc); +void evas_font_desc_unref(Evas_Font_Description *fdesc); +int evas_font_desc_cmp(const Evas_Font_Description *a, const Evas_Font_Description *b); +Evas_Font_Description *evas_font_desc_ref(Evas_Font_Description *fdesc); +void * evas_font_load(Evas *evas, Evas_Font_Description *fdesc, const char *source, Evas_Font_Size size); +void evas_font_load_hinting_set(Evas *evas, void *font, int hinting); +void evas_object_smart_member_cache_invalidate(Evas_Object *obj, Eina_Bool pass_events, Eina_Bool freeze_events); +void evas_text_style_pad_get(Evas_Text_Style_Type style, int *l, int *r, int *t, int *b); +void _evas_object_text_rehint(Evas_Object *obj); +void _evas_object_textblock_rehint(Evas_Object *obj); + +extern int _evas_alloc_error; +extern int _evas_event_counter; + +struct _Evas_Imaging_Image +{ + RGBA_Image *image; +}; + +struct _Evas_Imaging_Font +{ + RGBA_Font *font; +}; + +int evas_async_events_init(void); +int evas_async_events_shutdown(void); +int evas_async_target_del(const void *target); + +void _evas_preload_thread_init(void); +void _evas_preload_thread_shutdown(void); +Evas_Preload_Pthread *evas_preload_thread_run(void (*func_heavy)(void *data), + void (*func_end)(void *data), + void (*func_cancel)(void *data), + const void *data); +Eina_Bool evas_preload_thread_cancel(Evas_Preload_Pthread *thread); + +void _evas_walk(Evas *e); +void _evas_unwalk(Evas *e); + +// expose for use in engines +EAPI int _evas_module_engine_inherit(Evas_Func *funcs, char *name); +EAPI const char *_evas_module_libdir_get(void); + +Eina_Bool evas_render_mapped(Evas *e, Evas_Object *obj, + void *context, void *surface, + int off_x, int off_y, int mapped, + int ecx, int ecy, int ecw, int ech); +void evas_render_invalidate(Evas *e); +void evas_render_object_recalc(Evas_Object *obj); + +Eina_Bool evas_map_inside_get(const Evas_Map *m, Evas_Coord x, Evas_Coord y); +Eina_Bool evas_map_coords_get(const Evas_Map *m, Evas_Coord x, Evas_Coord y, Evas_Coord *mx, Evas_Coord *my, int grab); + +Eina_List *evas_module_engine_list(void); + +/* for updating touch point list */ +void _evas_touch_point_append(Evas *e, int id, Evas_Coord x, Evas_Coord y); +void _evas_touch_point_update(Evas *e, int id, Evas_Coord x, Evas_Coord y, Evas_Touch_Point_State state); +void _evas_touch_point_remove(Evas *e, int id); + +/****************************************************************************/ +/*****************************************/ +/********************/ +#define MPOOL 1 + +#ifdef MPOOL +typedef struct _Evas_Mempool Evas_Mempool; + +struct _Evas_Mempool +{ + int count; + int num_allocs; + int num_frees; + Eina_Mempool *mp; +}; +# define EVAS_MEMPOOL(x) \ + static Evas_Mempool x = {0, 0, 0, NULL} +# define EVAS_MEMPOOL_INIT(x, nam, siz, cnt, ret) \ + do { \ + if (!x.mp) { \ + x.mp = eina_mempool_add("chained_mempool", nam, NULL, sizeof(siz), cnt); \ + if (!x.mp) { \ + return ret; \ + } \ + } \ + } while (0) +# define EVAS_MEMPOOL_ALLOC(x, siz) \ + eina_mempool_malloc(x.mp, sizeof(siz)) +# define EVAS_MEMPOOL_PREP(x, p, siz) \ + do { \ + x.count++; \ + x.num_allocs++; \ + memset(p, 0, sizeof(siz)); \ + } while (0) +# define EVAS_MEMPOOL_FREE(x, p) \ + do { \ + eina_mempool_free(x.mp, p); \ + x.count--; \ + x.num_frees++; \ + if (x.count <= 0) { \ + eina_mempool_del(x.mp); \ + x.mp = NULL; \ + x.count = 0; \ + } \ + } while (0) +#else +# define EVAS_MEMPOOL(x) +# define EVAS_MEMPOOL_INIT(x, nam, siz, cnt, ret) +# define EVAS_MEMPOOL_PREP(x, p, siz) +# define EVAS_MEMPOOL_ALLOC(x, siz) \ + calloc(1, sizeof(siz)) +# define EVAS_MEMPOOL_FREE(x, p) \ + free(p) +#endif +/********************/ +/*****************************************/ +/****************************************************************************/ + +#define EVAS_API_OVERRIDE(func, api, prefix) \ + (api)->func = prefix##func +#define EVAS_API_RESET(func, api) \ + (api)->func = NULL + +#include "evas_inline.x" + +#ifdef __cplusplus +} +#endif +#endif -- cgit v1.1