From: HyungKyu Song Date: Fri, 15 Feb 2013 15:18:23 +0000 (+0900) Subject: Tizen 2.0 Release X-Git-Tag: submit/tizen_2.0/20130215.191826 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Ftags%2Fsubmit%2Ftizen_2.0%2F20130215.191826;p=framework%2Fuifw%2Fexpedite.git Tizen 2.0 Release --- diff --git a/AUTHORS b/AUTHORS index 7bf31c1..39e0b2e 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,2 +1,6 @@ The Rasterman (Carsten Haitzler) - +Tim Horton +Saumsung Electronics +Samsung SAIT +Bruno Tarquini +ChunEon Park (Hermet) diff --git a/COPYING b/COPYING index 474fcc5..324a4aa 100644 --- a/COPYING +++ b/COPYING @@ -1,28 +1,25 @@ -Copyright (C) 2000 Carsten Haitzler and various contributors (see AUTHORS) +Copyright notice for Expedite: -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: +Copyright (C) 2007-2011 Carsten Haitzler and various contributors (see AUTHORS) -The above copyright notice and this permission notice shall be included in -all copies of the Software and its Copyright notices. In addition publicly -documented acknowledgment must be given that this software has been used if no -source code of this software is made available publicly. This includes -acknowledgments in either Copyright notices, Manuals, Publicity and Marketing -documents or any documentation provided with any product containing this -software. This License does not apply to any software that links to the -libraries provided by this software (statically or dynamically), but only to -the software provided. +All rights reserved. -Please see the COPYING.PLAIN for a plain-english explanation of this notice -and it's intent. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/ChangeLog b/ChangeLog index e69de29..21b4dcd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -0,0 +1,15 @@ +2011-12-02 Carsten Haitzler (The Rasterman) + + 1.1.0 release + +2012-04-26 Carsten Haitzler (The Rasterman) + + 1.2.0 release + +2012-05-02 Cedric Bail + + * Do not allocate more than once Evas_Map. + +2012-08-30 Carsten Haitzler (The Rasterman) + + 1.7.0 release diff --git a/NEWS b/NEWS index e69de29..097213c 100644 --- a/NEWS +++ b/NEWS @@ -0,0 +1,18 @@ +Expedite 1.7.0 + +Changes since Expedite 1.2.0: +----------------------------- + +Improvements: + + * Don't over allocate Evas_Map. + +Expedite 1.2.0 + +Changes since Expedite 1.1.0: +----------------------------- + +Removals: + + * Evas SDL 16bpp engine suport + * Software_SDL engine (nos just use buffer engine) diff --git a/README b/README index 5726850..53afe80 100644 --- a/README +++ b/README @@ -1,3 +1,29 @@ -Expedite 0.6.0 +Expedite 1.7.99 + +****************************************************************************** + + FOR ANY ISSUES PLEASE EMAIL: + enlightenment-devel@lists.sourceforge.net + +****************************************************************************** + +Requirements: +------------- +Must have: + libc + libm + evas (at least 1.1.0) This is meant to be a detailed and comprehensive benchmark suite for Evas. + +The images can be interchanged for demonstration purposes. Logo.png should +have some areas of alpha to demonstrate transparency. + +------------------------------------------------------------------------------ +COMPILING AND INSTALLING: + + ./configure + make +(as root unless you are installing in your users directories): + make install + diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..54c56a6 --- /dev/null +++ b/configure.ac @@ -0,0 +1,277 @@ +dnl Process this file with autoconf to produce a configure script. + +# get rid of that stupid cache mechanism +rm -f config.cache + +AC_INIT([expedite], [1.7.99], [enlightenment-devel@lists.sourceforge.net]) +AC_PREREQ([2.52]) +AC_CONFIG_SRCDIR([configure.ac]) +AC_CONFIG_HEADERS([config.h]) +AC_CANONICAL_BUILD +AC_CANONICAL_HOST + +AM_INIT_AUTOMAKE([1.6 dist-bzip2]) +m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) + +PKG_PROG_PKG_CONFIG + + +### Additional options to configure + +## Simple X11 build/link + +## Evas engines + +AC_ARG_ENABLE(simple-x11, + [AC_HELP_STRING([--enable-simple-x11], [enable simple x11 linking])], + [want_evas_simple_x11=$enableval] +) + +# Software X11 +have_software_xlib="no" +have_software_xcb="no" +EXPEDITE_CHECK_ENGINE([software-x11], [Software X11], "yes") + +if test "x${have_software_x11}" = "xyes" ; then + have_software_xlib=`${PKG_CONFIG} --variable=Xlib evas-software-x11` + if test "x${have_software_xlib}" = "xstatic" ; then + have_software_xlib="yes" + fi + if test "x${have_software_xlib}" = "xyes" ; then + AC_DEFINE(HAVE_EVAS_SOFTWARE_XLIB, 1, [Evas Software Xlib Engine Support]) + fi + have_software_xcb=`${PKG_CONFIG} --variable=XCB evas-software-x11` + if test "x${have_software_xcb}" = "xstatic" ; then + have_software_xcb="yes" + fi + if test "x${have_software_xcb}" = "xyes" ; then + AC_DEFINE(HAVE_EVAS_SOFTWARE_XCB, 1, [Evas Software XCB Engine Support]) + fi +fi + +AM_CONDITIONAL([BUILD_SOFTWARE_XLIB], [test "x${have_software_xlib}" = "xyes"]) +AM_CONDITIONAL([BUILD_SOFTWARE_XCB], [test "x${have_software_xcb}" = "xyes"]) + +# XRender X11 +EXPEDITE_CHECK_ENGINE([xrender-x11], [XRender X11], "yes") + +# OpenGL X11 +EXPEDITE_CHECK_ENGINE([opengl-x11], [OpenGL X11], "yes") + +# XRender XCB +EXPEDITE_CHECK_ENGINE([xrender-xcb], [XRender XCB], "yes") + +# GDI +EXPEDITE_CHECK_ENGINE([software-gdi], [Software GDI], "yes", [gdi_libs="-lgdi32"]) +AC_SUBST(gdi_libs) + +# DirectDraw +EXPEDITE_CHECK_ENGINE([software-ddraw], [Software DirectDraw], "yes", [ddraw_libs="-lddraw -ldxguid -lgdi32"]) +AC_SUBST(ddraw_libs) + +# Direct3D +EXPEDITE_CHECK_ENGINE([direct3d], [Direct3D], "yes", [d3d_libs="-ld3d9 -ld3dx9d -lgdi32"]) +AC_SUBST(d3d_libs) + +# PSL1GHT +EXPEDITE_CHECK_ENGINE([psl1ght], [PSL1GHT], "yes") + +# GL SDL +EXPEDITE_CHECK_ENGINE([opengl-sdl], [OpenGL SDL], "yes") + +# FB +EXPEDITE_CHECK_ENGINE([fb], [Framebuffer], "yes") + +# DIRECTFB +EXPEDITE_CHECK_ENGINE([directfb], [DirectFB], "yes") + +# GL Cocoa +EXPEDITE_CHECK_ENGINE([opengl-cocoa], [OpenGL Cocoa], "yes", [gl_cocoa_libs="-framework Cocoa"]) +AC_SUBST(gl_cocoa_libs) + +# Software 16bit X11 +EXPEDITE_CHECK_ENGINE([software-16-x11], [Software 16 bits X11], "yes") + +# 16bit WinCE +EXPEDITE_CHECK_ENGINE([software-16-wince], [Software 16 bits WinCE], "yes", [wince_16_libs="-laygshell"]) +AC_SUBST(wince_16_libs) + +### Checks for programs + +AC_ISC_POSIX +m4_ifdef([AC_PROG_OBJC], + [ + AC_PROG_OBJC + _AM_DEPENDENCIES(OBJC) + ], + [ + AC_CHECK_TOOL([OBJC], [gcc]) + AC_SUBST([OBJC]) + AC_SUBST([OBJCFLAGS]) + ] +) +AC_PROG_CXX +AC_PROG_CC + +LT_PROG_RC + + + +### Checks for libraries + +# Evil library for compilation on Windows + +case "$host_os" in + mingw32*) + PKG_CHECK_MODULES([EVIL], [evil >= 1.6.99]) + AC_DEFINE(HAVE_EVIL, 1, [Set to 1 if Evil library is installed]) + ;; +esac + +# Eina + +PKG_CHECK_MODULES([EINA], eina >= 1.6.99) + +# Evas + +PKG_CHECK_MODULES([EVAS], evas >= 1.6.99 eet >= 1.6.99) + +# Xlib + +if test "x$have_software_xlib" = "xyes" -o "x$have_software_16_x11" = "xyes" -o "x$have_xrender_x11" = "xyes" -o "x$have_opengl_x11" = "xyes"; then + AC_PATH_XTRA + AC_CHECK_HEADERS([X11/Xlib.h X11/Xutil.h], + [have_xlib="yes"], + [have_xlib="no"]) + if test "x$want_evas_simple_x11" = "xyes"; then + x_libs="${x_libs} -lX11" + else + x_dir=${x_dir:-/usr/X11R6} + x_cflags=${x_cflags:--I${x_includes:-$x_dir/include}} + x_libs="${x_libs:--L${x_libraries:-$x_dir/lib}} -lX11" + fi +fi +AM_CONDITIONAL(BUILD_X11, [test "x$have_xlib" = "xyes"]) + +AC_SUBST(x_cflags) +AC_SUBST(x_libs) + +# XCB + +if test "x$have_software_xcb" = "xyes"; then + PKG_CHECK_MODULES([XCB], [xcb xcb-keysyms], [have_xcb="yes"], [have_xcb="no"]) +fi +AM_CONDITIONAL(BUILD_XCB, test "x$have_xcb" = "xyes") +if test "x$have_xcb" = "xyes"; then + AC_DEFINE(BUILD_XCB, 1, [build xcb support]) +fi + +# SDL + +PKG_CHECK_MODULES([SDL], [sdl], [have_sdl="yes"], [have_sdl="no"]) +AM_CONDITIONAL(BUILD_SDL, test "x$have_sdl" = "xyes") +if test "x$have_sdl" = "xyes"; then + AC_DEFINE(BUILD_SDL, 1, [build sdl support]) +fi + +# PSL1GHT +AM_CONDITIONAL(BUILD_PSL1GHT, test "x$have_psl1ght" = "xyes") + +# DirectFB + +if test "x$have_directfb" = "xyes"; then + PKG_CHECK_MODULES([DIRECTFB], [directfb], [have_directfb="yes"], [have_directfb="no"]) +fi +AM_CONDITIONAL(BUILD_DIRECTFB, test "x$have_directfb" = "xyes") + + +### Checks for header files + + +### Checks for types + + +### Checks for structures + + +### Checks for compiler characteristics + +AM_PROG_CC_STDC +AC_HEADER_STDC +AC_C_CONST +AM_PROG_CC_C_O +AC_C___ATTRIBUTE__ + +WIN32_CFLAGS="" +case "$host_os" in + cegcc*) + WIN32_CFLAGS="-mwin32" + ;; +esac +AC_SUBST(WIN32_CFLAGS) + +EXPEDITE_CXXFLAGS="" +AC_LANG_PUSH([C++]) +CXXFLAGS_save="${CXXFLAGS}" +CXXFLAGS="${CXXFLAGS} -fno-rtti -fno-exceptions" +AC_LINK_IFELSE( + [AC_LANG_PROGRAM([[]])], + [have_cxx_flags="yes"], + [have_cxx_flags="no"]) +AC_MSG_CHECKING([whether the compiler supports -fno-rtti -fno-exceptions]) +AC_MSG_RESULT([${have_cxx_flags}]) +CXXFLAGS="${CXXFLAGS_save}" +if test "x${have_cxx_flags}" = "xyes" ; then + EXPEDITE_CXXFLAGS="-fno-rtti -fno-exceptions" +fi +AC_LANG_POP([C++]) +AC_SUBST(EXPEDITE_CXXFLAGS) + + +### Checks for linker characteristics + +lt_enable_auto_import="" +case "$host_os" in + mingw* | cegcc*) + lt_enable_auto_import="-Wl,--enable-auto-import" + ;; +esac +AC_SUBST(lt_enable_auto_import) + + +### Checks for library functions + +AC_CHECK_FUNCS([sync]) + + +AC_OUTPUT([ +Makefile +expedite.spec +src/Makefile +src/bin/Makefile +data/Makefile +]) + +echo +echo " $PACKAGE $VERSION" +echo +echo " Engines:" +echo " Software X11.................: ${have_software_x11} (Xlib: ${have_software_xlib}) (XCB: ${have_software_xcb})" +echo " X Render X11.................: ${have_xrender_x11}" +echo " Open GL X11..................: ${have_opengl_x11}" +echo " X Render XCB.................: ${have_xrender_xcb}" +echo " Software GDI.................: ${have_software_gdi}" +echo " Software DirectDraw..........: ${have_software_ddraw}" +echo " Direct3D.....................: ${have_direct3d}" +echo " Software SDL.................: ${have_software_sdl}" +echo " Open GL SDL..................: ${have_opengl_sdl}" +echo " Open GL Cocoa................: ${have_opengl_cocoa}" +echo " FB...........................: ${have_fb}" +echo " DirectFB.....................: ${have_directfb}" +echo " PSL1GHT......................: ${have_psl1ght}" +echo " Software X11 16 bits.........: ${have_software_16_x11}" +echo " Software WinCE 16 bits.......: ${have_software_16_wince}" +echo +echo " Installation:" +echo " prefix.......................: ${prefix}" +echo diff --git a/data/3d.png b/data/3d.png new file mode 100644 index 0000000..6f5fcb8 Binary files /dev/null and b/data/3d.png differ diff --git a/data/Makefile.am b/data/Makefile.am index 9033614..939fc95 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -14,8 +14,8 @@ VeraSe.ttf \ VeraSeBd.ttf \ fonts.alias \ fonts.dir \ -bg.png \ logo.png \ +e-logo.png \ e.png \ image.png \ bar.png \ @@ -24,7 +24,6 @@ pan.png \ tp.png \ tp.yuv \ icon_sel.png \ -icon_sel2.png \ text_sel.png \ exit.png \ watch.png \ @@ -40,6 +39,22 @@ pulse.png \ typewriter.png \ warning.png \ im1.png \ -im2.png +im2.png \ +cube1.png \ +cube2.png \ +cube3.png \ +cube4.png \ +cube5.png \ +cube6.png \ +text.png \ +rect.png \ +blend.png \ +map.png \ +3d.png \ +data.png \ +widgets.png \ +e-logo-2.png \ +e-logo-mask.png \ +texture.png EXTRA_DIST = $(files_DATA) diff --git a/data/bar.png b/data/bar.png index ab380c4..cd5c3a7 100644 Binary files a/data/bar.png and b/data/bar.png differ diff --git a/data/blend.png b/data/blend.png new file mode 100644 index 0000000..bfd647b Binary files /dev/null and b/data/blend.png differ diff --git a/data/cube1.png b/data/cube1.png new file mode 100644 index 0000000..c2f4fda Binary files /dev/null and b/data/cube1.png differ diff --git a/data/cube2.png b/data/cube2.png new file mode 100644 index 0000000..5e69383 Binary files /dev/null and b/data/cube2.png differ diff --git a/data/cube3.png b/data/cube3.png new file mode 100644 index 0000000..1116611 Binary files /dev/null and b/data/cube3.png differ diff --git a/data/cube4.png b/data/cube4.png new file mode 100644 index 0000000..4ff7c73 Binary files /dev/null and b/data/cube4.png differ diff --git a/data/cube5.png b/data/cube5.png new file mode 100644 index 0000000..49c9acd Binary files /dev/null and b/data/cube5.png differ diff --git a/data/cube6.png b/data/cube6.png new file mode 100644 index 0000000..f512f75 Binary files /dev/null and b/data/cube6.png differ diff --git a/data/data.png b/data/data.png new file mode 100644 index 0000000..26b5a72 Binary files /dev/null and b/data/data.png differ diff --git a/data/e-logo-2.png b/data/e-logo-2.png new file mode 100644 index 0000000..0992bfb Binary files /dev/null and b/data/e-logo-2.png differ diff --git a/data/e-logo-mask.png b/data/e-logo-mask.png new file mode 100644 index 0000000..b71600c Binary files /dev/null and b/data/e-logo-mask.png differ diff --git a/data/e-logo.png b/data/e-logo.png new file mode 100644 index 0000000..113ee14 Binary files /dev/null and b/data/e-logo.png differ diff --git a/data/e.png b/data/e.png index 35b78ed..f14feff 100644 Binary files a/data/e.png and b/data/e.png differ diff --git a/data/exit.png b/data/exit.png index a3319ed..f27a0fa 100644 Binary files a/data/exit.png and b/data/exit.png differ diff --git a/data/frame.png b/data/frame.png index 0867f1b..cdb24af 100644 Binary files a/data/frame.png and b/data/frame.png differ diff --git a/data/icon_sel.png b/data/icon_sel.png index 6f89a4a..3075afd 100644 Binary files a/data/icon_sel.png and b/data/icon_sel.png differ diff --git a/data/logo.png b/data/logo.png index 46671b2..f2ba89d 100644 Binary files a/data/logo.png and b/data/logo.png differ diff --git a/data/map.png b/data/map.png new file mode 100644 index 0000000..7a13b5f Binary files /dev/null and b/data/map.png differ diff --git a/data/rect.png b/data/rect.png new file mode 100644 index 0000000..8f54d64 Binary files /dev/null and b/data/rect.png differ diff --git a/data/text.png b/data/text.png new file mode 100644 index 0000000..ef33aa9 Binary files /dev/null and b/data/text.png differ diff --git a/data/text_sel.png b/data/text_sel.png index 6b847fa..ac118d2 100644 Binary files a/data/text_sel.png and b/data/text_sel.png differ diff --git a/data/texture.png b/data/texture.png new file mode 100644 index 0000000..630726a Binary files /dev/null and b/data/texture.png differ diff --git a/data/widgets.png b/data/widgets.png new file mode 100644 index 0000000..350297f Binary files /dev/null and b/data/widgets.png differ diff --git a/debian/.svn/all-wcprops b/debian/.svn/all-wcprops new file mode 100644 index 0000000..54bc327 --- /dev/null +++ b/debian/.svn/all-wcprops @@ -0,0 +1,35 @@ +K 25 +svn:wc:ra_dav:version-url +V 43 +/svn/e/!svn/ver/40544/trunk/expedite/debian +END +control +K 25 +svn:wc:ra_dav:version-url +V 51 +/svn/e/!svn/ver/40544/trunk/expedite/debian/control +END +compat +K 25 +svn:wc:ra_dav:version-url +V 50 +/svn/e/!svn/ver/38399/trunk/expedite/debian/compat +END +changelog +K 25 +svn:wc:ra_dav:version-url +V 53 +/svn/e/!svn/ver/40270/trunk/expedite/debian/changelog +END +copyright +K 25 +svn:wc:ra_dav:version-url +V 53 +/svn/e/!svn/ver/38399/trunk/expedite/debian/copyright +END +rules +K 25 +svn:wc:ra_dav:version-url +V 49 +/svn/e/!svn/ver/39695/trunk/expedite/debian/rules +END diff --git a/debian/.svn/entries b/debian/.svn/entries new file mode 100644 index 0000000..7f25f37 --- /dev/null +++ b/debian/.svn/entries @@ -0,0 +1,198 @@ +10 + +dir +46864 +https://svn.enlightenment.org/svn/e/trunk/expedite/debian +https://svn.enlightenment.org/svn/e + + + +2009-05-08T05:20:44.706134Z +40544 +barbieri + + + + + + + + + + + + + + +7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 + +control +file + + + + +2010-03-04T12:30:52.000000Z +59e5940467768cd8df9da012d44eefd7 +2009-05-08T05:20:44.706134Z +40544 +barbieri + + + + + + + + + + + + + + + + + + + + + +477 + +compat +file + + + + +2010-03-04T12:30:52.000000Z +9ae0ea9e3c9c6e1b9b6252c8395efdc1 +2009-01-01T11:35:17.282485Z +38399 +quaker + + + + + + + + + + + + + + + + + + + + + +2 + +changelog +file + + + + +2010-03-04T12:30:52.000000Z +37edcdd83dacfb5c6f66b91c4cbdcff9 +2009-04-21T17:39:20.596180Z +40270 +quaker + + + + + + + + + + + + + + + + + + + + + +139 + +copyright +file + + + + +2010-03-04T12:30:52.000000Z +7ef9c1cdfd248847a5ae32f0093054bd +2009-01-01T11:35:17.282485Z +38399 +quaker + + + + + + + + + + + + + + + + + + + + + +233 + +rules +file + + + + +2010-03-04T12:30:52.000000Z +61bcf010ab933a886927aefe3e40c456 +2009-03-24T19:56:43.554016Z +39695 +quaker +has-props + + + + + + + + + + + + + + + + + + + + +274 + diff --git a/debian/.svn/prop-base/rules.svn-base b/debian/.svn/prop-base/rules.svn-base new file mode 100644 index 0000000..869ac71 --- /dev/null +++ b/debian/.svn/prop-base/rules.svn-base @@ -0,0 +1,5 @@ +K 14 +svn:executable +V 1 +* +END diff --git a/debian/.svn/text-base/changelog.svn-base b/debian/.svn/text-base/changelog.svn-base new file mode 100644 index 0000000..27a0119 --- /dev/null +++ b/debian/.svn/text-base/changelog.svn-base @@ -0,0 +1,5 @@ +expedite (0.6.0+svnYYYYMMDD-1) unstable; urgency=low + + * a SVN release. + + -- quaker Sat, 27 Dec 2008 14:48:46 +0100 diff --git a/debian/.svn/text-base/compat.svn-base b/debian/.svn/text-base/compat.svn-base new file mode 100644 index 0000000..1e8b314 --- /dev/null +++ b/debian/.svn/text-base/compat.svn-base @@ -0,0 +1 @@ +6 diff --git a/debian/.svn/text-base/control.svn-base b/debian/.svn/text-base/control.svn-base new file mode 100644 index 0000000..f2e18ea --- /dev/null +++ b/debian/.svn/text-base/control.svn-base @@ -0,0 +1,14 @@ +Source: expedite +Section: x11 +Priority: optional +Maintainer: quaker +Build-Depends: cdbs, debhelper (>= 6), libevas-dev, pkg-config, libtool, libxext-dev +Standards-Version: 3.8.1 +Homepage: http://www.enlightenment.org + +Package: expedite +Architecture: any +Depends: ${shlibs:Depends}, libevas-svn-01, libevas-engines, libevas-engines-extras +Description: Benchmarking suite for Evas + This is meant to be a detailed and comprehensive benchmark suite for Evas. + diff --git a/debian/.svn/text-base/copyright.svn-base b/debian/.svn/text-base/copyright.svn-base new file mode 100644 index 0000000..3ca1156 --- /dev/null +++ b/debian/.svn/text-base/copyright.svn-base @@ -0,0 +1,10 @@ +This package was debianized by quaker on +Sat, 27 Dec 2008 14:48:46 +0100. + +Author(s): + The Rasterman (Carsten Haitzler) + Tim Horton + +License: + See the COPYING file + diff --git a/debian/.svn/text-base/rules.svn-base b/debian/.svn/text-base/rules.svn-base new file mode 100644 index 0000000..6acb8ff --- /dev/null +++ b/debian/.svn/text-base/rules.svn-base @@ -0,0 +1,11 @@ +#!/usr/bin/make -f + +include /usr/share/cdbs/1/rules/debhelper.mk +include /usr/share/cdbs/1/class/autotools.mk + +DEB_CONFIGURE_SCRIPT := ./autogen.sh +DEB_MAKE_CLEAN_TARGET := distclean +DEB_CONFIGURE_EXTRA_FLAGS := --disable-rpath + +clean:: + [ ! -f Makefile ] || make distclean diff --git a/debian/SVN_REV b/debian/SVN_REV new file mode 100644 index 0000000..f801233 --- /dev/null +++ b/debian/SVN_REV @@ -0,0 +1,2 @@ +Revision 51480 +Last Changed Rev 51381 diff --git a/debian/_original/changelog b/debian/_original/changelog new file mode 100644 index 0000000..27a0119 --- /dev/null +++ b/debian/_original/changelog @@ -0,0 +1,5 @@ +expedite (0.6.0+svnYYYYMMDD-1) unstable; urgency=low + + * a SVN release. + + -- quaker Sat, 27 Dec 2008 14:48:46 +0100 diff --git a/debian/_original/compat b/debian/_original/compat new file mode 100644 index 0000000..1e8b314 --- /dev/null +++ b/debian/_original/compat @@ -0,0 +1 @@ +6 diff --git a/debian/_original/control b/debian/_original/control new file mode 100644 index 0000000..f2e18ea --- /dev/null +++ b/debian/_original/control @@ -0,0 +1,14 @@ +Source: expedite +Section: x11 +Priority: optional +Maintainer: quaker +Build-Depends: cdbs, debhelper (>= 6), libevas-dev, pkg-config, libtool, libxext-dev +Standards-Version: 3.8.1 +Homepage: http://www.enlightenment.org + +Package: expedite +Architecture: any +Depends: ${shlibs:Depends}, libevas-svn-01, libevas-engines, libevas-engines-extras +Description: Benchmarking suite for Evas + This is meant to be a detailed and comprehensive benchmark suite for Evas. + diff --git a/debian/_original/copyright b/debian/_original/copyright new file mode 100644 index 0000000..3ca1156 --- /dev/null +++ b/debian/_original/copyright @@ -0,0 +1,10 @@ +This package was debianized by quaker on +Sat, 27 Dec 2008 14:48:46 +0100. + +Author(s): + The Rasterman (Carsten Haitzler) + Tim Horton + +License: + See the COPYING file + diff --git a/debian/_original/rules b/debian/_original/rules new file mode 100755 index 0000000..6acb8ff --- /dev/null +++ b/debian/_original/rules @@ -0,0 +1,11 @@ +#!/usr/bin/make -f + +include /usr/share/cdbs/1/rules/debhelper.mk +include /usr/share/cdbs/1/class/autotools.mk + +DEB_CONFIGURE_SCRIPT := ./autogen.sh +DEB_MAKE_CLEAN_TARGET := distclean +DEB_CONFIGURE_EXTRA_FLAGS := --disable-rpath + +clean:: + [ ! -f Makefile ] || make distclean diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..5d0bc0f --- /dev/null +++ b/debian/changelog @@ -0,0 +1,335 @@ +expedite (1.2.0+svn.70375slp2+build02) unstable; urgency=low + + * Package Upload + * Git: slp/pkgs/e/expedite + * Tag: expedite_1.2.0+svn.70375slp2+build02 + + -- Myungjae Lee Wed, 25 Apr 2012 17:30:18 +0900 + +expedite (1.2.0+svn.70375slp2+build01) unstable; urgency=low + + * Package Upload + * Git: slp/pkgs/e/expedite + * Tag: expedite_1.2.0+svn.70375slp2+build01 + + -- Myungjae Lee Wed, 25 Apr 2012 15:16:03 +0900 + +expedite (1.2.0+svn.70214slp2+build01) unstable; urgency=low + + * Package Upload + * Git: slp/pkgs/e/expedite + * Tag: expedite_1.2.0+svn.70214slp2+build01 + + -- Hyoyoung Chang Wed, 18 Apr 2012 15:24:45 +0900 + +expedite (1.2.0+svn.69899slp2+build01) unstable; urgency=low + + * Package Upload + * Git: slp/pkgs/e/expedite + * Tag: expedite_1.2.0+svn.69899slp2+build01 + + -- Jeonghyun Yun Fri, 06 Apr 2012 18:26:37 +0900 + +expedite (1.0.0+svn.69595slp2+1) unstable; urgency=low + + * Package Upload + * Git: slp/pkgs/e/expedite + * Tag: expedite_1.0.0+svn.69595slp2+1 + + -- Jeonghyun Yun Wed, 28 Mar 2012 14:31:44 +0900 + +expedite (1.0.0+svn.68445slp2+1) unstable; urgency=low + + * Package upload + * Git: slp/pkgs/e/expedite + * Tag: expedite_1.0.0+svn.68445slp2+1 + + -- Jeonghyun Yun Fri, 02 Mar 2012 06:36:24 -0500 + +expedite (1.0.0+svn.67184slp2+1) unstable; urgency=low + + * Package Upload + * Git: slp/pkgs/e/expedite + * Tag: expedite_1.0.0+svn.67184slp2+1 + + -- Jaehwan Kim Wed, 15 Feb 2012 19:03:56 +0900 + +expedite (1.0.0+svn.66195slp2+1) unstable; urgency=low + + * Package Upload + * Git: slp/pkgs/e/expedite + * Tag: expedite_1.0.0+svn.66195slp2+1 + + -- Jaehwan Kim Mon, 16 Jan 2012 18:40:51 +0900 + +expedite (1.0.0+svn.65860slp2+1) unstable; urgency=low + + * Package Upload for migration + * Git: slp-scm.sec.samsung.net:slp/pkgs/e/expedite + * Tag: expedite_1.0.0+svn.65860slp2+1 + + -- Jaehwan Kim Thu, 08 Dec 2011 14:00:27 +0900 + +expedite (1.0.0+svn.65336slp2+1) unstable; urgency=low + + * Package Upload + * Git: slp-scm.sec.samsung.net:slp/pkgs/e/expedite + * Tag: expedite_1.0.0+svn.65336slp2+1 + + -- Jaehwan Kim Tue, 29 Nov 2011 14:17:22 +0900 + +expedite (1.0.0+svn.60246slp2+3) unstable; urgency=low + + * Upload Package for EFL core migration + * Git: 165.213.180.234:slp/pkgs/e/expedite + * Tag: expedite_1.0.0+svn.60246slp2+3 + + -- Jaehwan Kim Fri, 02 Sep 2011 18:49:35 +0900 + +expedite (1.0.0+svn.60246slp2+2) unstable; urgency=low + + * Upload Package for EFL core migration + * Git: 165.213.180.234:slp/pkgs/e/expedite + * Tag: expedite_1.0.0+svn.60246slp2+2 + + -- Jaehwan Kim Fri, 02 Sep 2011 18:48:38 +0900 + +expedite (1.0.0+svn.60246slp2+1) unstable; urgency=low + + * [SVN EFL Migration] expedite in SLP is merged with SVN r60246 + * Git: 165.213.180.234:slp/pkgs/e/expedite + * Tag: expedite_1.0.0+svn.60246slp2+1 + + -- Jaehwan Kim Fri, 24 Jun 2011 18:10:47 +0900 + +expedite (1.0.0+svn.57467slp2+8) unstable; urgency=low + + * [SVN EFL Migration] expedite in SLP is merged with SVN r57467 + * Git: 165.213.180.234:slp/pkgs/e/expedite + * Tag: expedite_1.0.0+svn.57467slp2+8 + + -- Jaehwan Kim Tue, 05 Apr 2011 15:55:43 +0900 + +expedite (1.0.0+svn.57467slp2+7) unstable; urgency=low + + * [SVN EFL Migration] expedite in SLP is merged with SVN r57467 + * Git: 165.213.180.234:slp/pkgs/e/expedite + * Tag: expedite_1.0.0+svn.57467slp2+7 + + -- Shinwoo Kim Tue, 29 Mar 2011 18:56:09 +0900 + +expedite (1.0.0+svn.57467slp2+6) unstable; urgency=low + + * [SVN EFL Migration] expedite in SLP is merged with SVN r57467 + * Git: 165.213.180.234:slp/pkgs/e/expedite + * Tag: expedite_1.0.0+svn.57467slp2+6 + + -- Myungjae Lee Wed, 09 Mar 2011 11:30:19 +0900 + +expedite (1.0.0+svn.57467slp2+5) unstable; urgency=low + + * [SVN EFL Migration] expedite in SLP is merged with SVN r57467 + * Git: 165.213.180.234:slp/pkgs/e/expedite + * Tag: expedite_1.0.0+svn.57467slp2+5 + + -- Myungjae Lee Wed, 09 Mar 2011 11:15:33 +0900 + +expedite (1.0.0+svn.57467slp2+4) unstable; urgency=low + + * Package Upload : Rollback + * Git: 165.213.180.234:/slp/pkgs/e/expedite + * Tag: expedite_1.0.0+svn.57467slp2+4 + + -- WooHyun Jung Tue, 08 Mar 2011 14:09:29 +0900 + +expedite (1.0.0+svn.57467slp2+3) unstable; urgency=low + + * Package Uplaod : Rollback + * Git: 165.213.180.234:/slp/pkgs/e/expedite + * Tag: expedite_1.0.0+svn.57467slp2+3 + + -- WooHyun Jung Tue, 08 Mar 2011 12:54:36 +0900 + +expedite (1.0.0+svn.57467slp2+2) unstable; urgency=low + + * Package Upload : rollback + * Git: 165.213.180.234:/slp/pkgs/e/expedite + * Tag: expedite_1.0.0+svn.57467slp2+2 + + -- WooHyun Jung Tue, 08 Mar 2011 11:23:45 +0900 + +expedite (1.0.0+svn.57467slp2+1) unstable; urgency=low + + * [SVN EFL Migration] expedite in SLP is merged with SVN r57467 + * Git: 165.213.180.234:slp/pkgs/e/expedite + * Tag: expedite_1.0.0+svn.57467slp2+1 + + -- Myungjae Lee Mon, 07 Mar 2011 17:28:46 +0900 + +expedite (1.0.0+svn.56235slp2+1) unstable; urgency=low + + * [SVN EFL Migration] expedite in SLP is merged with SVN r56235 + * Git: 165.213.180.234:slp/pkgs/e/expedite + * Tag: expedite_1.0.0+svn.56235slp2+1 + + -- WooHyun Jung Thu, 27 Jan 2011 12:25:33 +0900 + +expedite (1.0.0+svn.55982slp2+1) unstable; urgency=low + + * [SVN EFL Migration] expedite in SLP is merged with SVN r55982 + * Git: 165.213.180.234:slp/pkgs/e/expedite + * Tag: expedite_1.0.0+svn.55982slp2+1 + * Git: 165.213.180.234:slp/pkgs/e/expedite + * Tag: expedite_1.0.0+svn.55982slp2+1 + + -- WooHyun Jung Wed, 19 Jan 2011 16:24:19 +0900 + +expedite (1.0.0+svn.55243slp2+2) unstable; urgency=low + + * [SVN EFL Migration] expedite in SLP is merged with SVN r55243 + * Git: 165.213.180.234:slp/pkgs/e/expedite + * Tag: expedite_1.0.0+svn.55243slp2+2 + + -- Jaehwan Kim Mon, 03 Jan 2011 21:25:58 +0900 + +expedite (1.0.0+svn.55243slp2+1) unstable; urgency=low + + * [SVN's EFL Migration] expedite in SLP is merged with SVN r55243. + * Git: 165.213.180.234:slp/pkgs/e/expedite + * Tag: expedite_1.0.0+svn.55243slp2+1 + + -- Juyung Seo Tue, 14 Dec 2010 17:58:37 +0900 + +expedite (1.0.0+svn.54990slp2+2) unstable; urgency=low + + * [SVN's EFL Migration] expedite in SLP is merged with SVN r55243. + * Git: 165.213.180.234:slp/pkgs/e/expedite + * Tag: expedite_1.0.0+svn.54990slp2+2 + + -- Juyung Seo Tue, 14 Dec 2010 15:02:23 +0900 + +expedite (1.0.0+svn.54990slp2+1) unstable; urgency=low + + * [SVN 54990 Merge] + * Update to SVN Revision 54990. + * Git: 165.213.180.234:/git/slp/pkgs/expedite + * Tag: expedite_1.0.0+svn.54990slp2+1 + + -- Myoungwoon Kim Thu, 02 Dec 2010 14:46:15 +0900 + +expedite (1.0.0+svn.51480slp2+3) unstable; urgency=low + + * [SVN 54593 Merge] + * Update to SVN Revision 54593. + * Git: 165.213.180.234:/git/slp/pkgs/expedite + * Tag: expedite_1.0.0+svn.51480slp2+3 + + -- Juyung Seo Fri, 26 Nov 2010 16:00:39 +0900 + +expedite (1.0.0+svn.51480slp2+2) unstable; urgency=low + + * add as-needed + * Git: 165.213.180.234:/git/slp/pkgs/expedite + * Tag: expedite_1.0.0+svn.51480slp2+2 + + -- Jaehwan Kim Wed, 15 Sep 2010 16:33:59 +0900 + +expedite (1.0.0+svn.51480slp2+1) unstable; urgency=low + + * EFL 1.0 alpha upgrade + * Git: 165.213.180.234:/git/slp/pkgs/expedite + * Tag: expedite_1.0.0+svn.51480slp2+1 + + -- Jaehwan Kim Thu, 02 Sep 2010 13:38:59 +0900 + +expedite (0.6.0+svn.49170slp2+1) unstable; urgency=low + + * Git initialized. + * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/EFL-pkgs/expedite + * Tag: expedite_0.6.0+svn.49170slp2+1 + + -- Daniel Juyung Seo Sat, 19 Jun 2010 14:20:01 +0900 + +expedite (0.6.0-svn.49170slp2) unstable; urgency=low + + * Version changes. + + -- Daniel Juyung Seo Tue, 15 Jun 2010 19:02:52 +0900 + +expedite (0.6.0+svn.49170slp2) unstable; urgency=low + + * Version changes. + + -- Daniel Juyung Seo Tue, 15 Jun 2010 14:11:49 +0900 + +expedite (0.6.0+svn.49170slp2+3build01) unstable; urgency=low + + * EFL Update. (Revision 49170) + + -- Daniel Juyung Seo Tue, 15 Jun 2010 10:18:37 +0900 + +expedite (0.6.0+svn20100304slp2) unstable; urgency=low + + * change package version + + -- Jaehwan Kim Thu, 25 Mar 2010 16:07:11 +0900 + +expedite (0.6.0+svn20100304-1) unstable; urgency=low + + * EFL_update_revision_46864 + + -- Jaehwan Kim Wed, 10 Mar 2010 16:06:41 +0900 + +expedite (0.6.0+svn20100203-1) unstable; urgency=low + + * Reversion for -1EFL+ + + -- Jaehwan Kim Thu, 04 Feb 2010 14:56:21 +0900 + +expedite (0.6.0+svn20100203-1) unstable; urgency=low + + * EFL_update_revision_45828 + + -- Jaehwan Kim Wed, 03 Feb 2010 16:39:26 +0900 + +expedite (0.6.0+svn20100111-3) unstable; urgency=low + + * reupload EFL i686 + + -- Jaehwan Kim Tue, 12 Jan 2010 17:36:06 +0900 + +expedite (0.6.0+svn20100111-2) unstable; urgency=low + + * reupload EFL + + -- Jaehwan Kim Mon, 11 Jan 2010 22:17:37 +0900 + +expedite (0.6.0+svn20100111-1) unstable; urgency=low + + * update EFL revision 45026 + + -- Jaehwan Kim Mon, 11 Jan 2010 13:28:12 +0900 + +expedite (0.6.0+svn20091229-1) unstable; urgency=low + + * update EFL + + -- Jaehwan Kim Tue, 29 Dec 2009 14:27:08 +0900 + +expedite (0.6.0+svn20091112-2) unstable; urgency=low + + * svn stable version + + -- sangho park Thu, 19 Nov 2009 19:57:55 +0900 + +expedite (0.6.0+svn20091112-1) unstable; urgency=low + + * a SVN release. + + -- sangho park Fri, 13 Nov 2009 09:46:46 +0900 + +expedite (0.6.0+svnYYYYMMDD-1) unstable; urgency=low + + * a SVN release. + + -- quaker Sat, 27 Dec 2008 14:48:46 +0100 diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..7ed6ff8 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +5 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..0c68923 --- /dev/null +++ b/debian/control @@ -0,0 +1,16 @@ +Source: expedite +Section: x11 +Priority: optional +Maintainer: Jaehwan Kim , Juyung Seo , Myoungwoon Kim , Jeonghyun Yun +Original-Maintainer: Debian Pkg-e Team +Uploaders: quaker +Build-Depends: cdbs, debhelper (>= 6), libevas-dev, pkg-config, libtool, libxext-dev, libxrender-dev +Standards-Version: 3.8.1 +Homepage: http://www.enlightenment.org + +Package: expedite +Architecture: any +Depends: ${shlibs:Depends}, libevas, libevas-engines, libevas-engines-extras, libxrender1 +Description: Benchmarking suite for Evas + This is meant to be a detailed and comprehensive benchmark suite for Evas. + diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..3ca1156 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,10 @@ +This package was debianized by quaker on +Sat, 27 Dec 2008 14:48:46 +0100. + +Author(s): + The Rasterman (Carsten Haitzler) + Tim Horton + +License: + See the COPYING file + diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..b5b1787 --- /dev/null +++ b/debian/rules @@ -0,0 +1,14 @@ +#!/usr/bin/make -f + +include /usr/share/cdbs/1/rules/debhelper.mk +include /usr/share/cdbs/1/class/autotools.mk + +DEB_CONFIGURE_SCRIPT := ./autogen.sh +DEB_MAKE_CLEAN_TARGET := distclean +DEB_CONFIGURE_EXTRA_FLAGS := --with-eet-eet=eet --disable-xrender-x11 --disable-software-sdl + +CFLAGS += -fPIC +LDFLAGS += -Wl,--hash-style=both -Wl,--as-needed + +clean:: + [ ! -f Makefile ] || make distclean diff --git a/expedite.manifest b/expedite.manifest new file mode 100644 index 0000000..97e8c31 --- /dev/null +++ b/expedite.manifest @@ -0,0 +1,5 @@ + + + + + diff --git a/expedite.spec.in b/expedite.spec.in new file mode 100644 index 0000000..0e87ad9 --- /dev/null +++ b/expedite.spec.in @@ -0,0 +1,63 @@ +# Note that this is NOT a relocatable package +%define _missing_doc_files_terminate_build 0 +%{!?_rel:%{expand:%%global _rel 0.enl%{?dist}}} + +%define ver @VERSION@ +%define rel %{_rel} +%define prefix /usr + +Summary: expedite +Name: expedite +Version: %ver +Release: %rel +License: BSD +Group: System Environment/Desktops +Source: ftp://ftp.enlightenment.org/pub/enlightenment/expedite-%{ver}.tar.gz +BuildRoot: /var/tmp/expedite-root +Packager: The Rasterman +URL: http://www.enlightenment.org/ +BuildRequires: evas-devel +Requires: evas + +%description + +Expedite Evas benchmark/test suite + +%prep +rm -rf $RPM_BUILD_ROOT + +%setup -q + +%build +./configure --prefix=%prefix + +if [ "$SMP" != "" ]; then + (make "MAKE=make -k -j $SMP"; exit 0) + make +else + make +fi +########################################################################### + +%install +make DESTDIR=$RPM_BUILD_ROOT install + +%clean +rm -rf $RPM_BUILD_ROOT + +%post + +%postun + +%files +%defattr(-,root,root) +%attr(755,root,root) %{prefix}/bin/* +%attr(755,root,root) %{prefix}/share/expedite +%doc AUTHORS +%doc COPYING +%doc COPYING-PLAIN +%doc README + +%changelog +* Sat Jun 23 2001 The Rasterman +- Created spec file diff --git a/m4/ac_attribute.m4 b/m4/ac_attribute.m4 new file mode 100644 index 0000000..23479a9 --- /dev/null +++ b/m4/ac_attribute.m4 @@ -0,0 +1,47 @@ +dnl Copyright (C) 2004-2008 Kim Woelders +dnl Copyright (C) 2008 Vincent Torri +dnl That code is public domain and can be freely used or copied. +dnl Originally snatched from somewhere... + +dnl Macro for checking if the compiler supports __attribute__ + +dnl Usage: AC_C___ATTRIBUTE__ +dnl call AC_DEFINE for HAVE___ATTRIBUTE__ and __UNUSED__ +dnl if the compiler supports __attribute__, HAVE___ATTRIBUTE__ is +dnl defined to 1 and __UNUSED__ is defined to __attribute__((unused)) +dnl otherwise, HAVE___ATTRIBUTE__ is not defined and __UNUSED__ is +dnl defined to nothing. + +AC_DEFUN([AC_C___ATTRIBUTE__], +[ + +AC_MSG_CHECKING([for __attribute__]) + +AC_CACHE_VAL([ac_cv___attribute__], + [AC_TRY_COMPILE( + [ +#include + +int func(int x); +int foo(int x __attribute__ ((unused))) +{ + exit(1); +} + ], + [], + [ac_cv___attribute__="yes"], + [ac_cv___attribute__="no"] + )]) + +AC_MSG_RESULT($ac_cv___attribute__) + +if test "x${ac_cv___attribute__}" = "xyes" ; then + AC_DEFINE([HAVE___ATTRIBUTE__], [1], [Define to 1 if your compiler has __attribute__]) + AC_DEFINE([__UNUSED__], [__attribute__((unused))], [Macro declaring a function argument to be unused]) + else + AC_DEFINE([__UNUSED__], [], [Macro declaring a function argument to be unused]) +fi + +]) + +dnl End of ac_attribute.m4 diff --git a/m4/expedite_check_engine.m4 b/m4/expedite_check_engine.m4 index 2909a0d..03ccdc4 100644 --- a/m4/expedite_check_engine.m4 +++ b/m4/expedite_check_engine.m4 @@ -16,7 +16,7 @@ AC_MSG_CHECKING([whether $2 engine is to be built]) AC_MSG_RESULT($want_[]DOWN) if test "x$want_[]DOWN" = "xyes"; then - PKG_CHECK_EXISTS([evas-$1], + PKG_CHECK_EXISTS([evas-$1 >= 1.0.0], [ AC_DEFINE(HAVE_EVAS_[]UP, 1, [Evas $2 Engine Support]) have_[]DOWN="yes" diff --git a/packaging/expedite.spec b/packaging/expedite.spec new file mode 100644 index 0000000..cf0b374 --- /dev/null +++ b/packaging/expedite.spec @@ -0,0 +1,48 @@ +Summary: expedite +Name: expedite +Version: 1.7.1+svn.76823slp2+build02 +Release: 1 +License: BSD +Group: System Environment/Desktops +Source: %{name}-%{version}.tar.gz +Requires(post): /sbin/ldconfig +Requires(postun): /sbin/ldconfig +BuildRequires: eina-devel +BuildRequires: evas-devel +BuildRequires: libxrender-devel + + +%description +Expedite Evas benchmark/test suite + + +%prep +%setup -q + + +%build +%autogen --disable-static +%configure --disable-static \ + --with-eet-eet=eet --disable-xrender-x11 --disable-software-sdl +make %{?jobs:-j%jobs} + + +%install +rm -rf %{buildroot} +%make_install +mkdir -p %{buildroot}/usr/share/license +cp %{_builddir}/%{buildsubdir}/COPYING %{buildroot}/usr/share/license/%{name} + + +%post -p /sbin/ldconfig + + +%postun -p /sbin/ldconfig + + +%files +%defattr(-,root,root,-) +/usr/bin/expedite* +/usr/share/expedite +%manifest %{name}.manifest +/usr/share/license/%{name} diff --git a/src/bin/Makefile.am b/src/bin/Makefile.am index c5d93d9..fa7901a 100644 --- a/src/bin/Makefile.am +++ b/src/bin/Makefile.am @@ -6,33 +6,82 @@ AM_CPPFLAGS = \ -DPACKAGE_BIN_DIR=\"$(bindir)\" \ -DPACKAGE_LIB_DIR=\"$(libdir)\" \ -DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \ +@EINA_CFLAGS@ \ @EVAS_CFLAGS@ \ @x_cflags@ \ @SDL_CFLAGS@ \ @DIRECTFB_CFLAGS@ \ -@XCB_CFLAGS@ +@XCB_CFLAGS@ \ +@EVIL_CFLAGS@ bin_PROGRAMS = expedite +bin_SCRIPTS = expedite-cmp expedite_SOURCES = \ main.c main.h \ ui.c ui.h \ about.c about.h \ tests.h \ +widgets_file_icons.c \ +widgets_file_icons_2.c \ +widgets_file_icons_2_grouped.c \ +widgets_file_icons_2_same.c \ +widgets_file_icons_2_same_grouped.c \ +widgets_file_icons_3.c \ +widgets_file_icons_4.c \ +widgets_list_1.c \ +widgets_list_1_grouped.c \ +widgets_list_2.c \ +widgets_list_2_grouped.c \ +widgets_list_3.c \ +widgets_list_3_grouped.c \ +widgets_list_4.c \ +widgets_list_4_grouped.c \ image_blend_unscaled.c \ +image_blend_solid_middle_unscaled.c \ +image_blend_fade_unscaled.c \ +image_blend_fade_pow2_unscaled.c \ image_blend_solid_unscaled.c \ +image_blend_solid_fade_unscaled.c \ +image_blend_solid_fade_pow2_unscaled.c \ image_blend_nearest_scaled.c \ image_blend_nearest_solid_scaled.c \ image_blend_smooth_scaled.c \ image_blend_smooth_solid_scaled.c \ +image_blend_nearest_same_scaled.c \ +image_blend_nearest_solid_same_scaled.c \ +image_blend_smooth_same_scaled.c \ +image_blend_smooth_solid_same_scaled.c \ image_blend_border.c \ +image_blend_solid_middle_border.c \ image_blend_solid_border.c \ image_blend_border_recolor.c \ +image_map_rotate.c \ +image_map_solid_rotate.c \ +image_map_nearest_rotate.c \ +image_map_nearest_solid_rotate.c \ +image_map_color_rotate.c \ +image_map_color_solid_rotate.c \ +image_map_color_nearest_rotate.c \ +image_map_color_nearest_solid_rotate.c \ +image_map_color_alpha_rotate.c \ +image_map_color_alpha_solid_rotate.c \ +image_map_color_alpha_nearest_rotate.c \ +image_map_color_alpha_nearest_solid_rotate.c \ +image_map_3d_1.c \ +image_map_3d_2.c \ +image_map_3d_3.c \ +image_map_3d_4.c \ +image_map_3d_5.c \ +image_map_3d_6.c \ +image_map_3d_flow.c \ image_quality_scale.c \ image_data_argb.c \ image_data_argb_alpha.c \ image_data_ycbcr601pl.c \ image_data_ycbcr601pl_wide_stride.c \ +image_data_ycbcr601pl_map_solid_rotate.c \ +image_data_ycbcr601pl_map_nearest_solid_rotate.c \ image_crossfade.c \ text_basic.c \ text_styles.c \ @@ -40,9 +89,13 @@ text_styles_different_strings.c \ text_change.c \ textblock_basic.c \ textblock_intl.c \ +textblock_auto_align.c \ +textblock_text_append.c \ rect_blend.c \ +rect_blend_pow2.c \ rect_solid.c \ rect_blend_few.c \ +rect_blend_pow2_few.c \ rect_solid_few.c \ image_blend_occlude1_few.c \ image_blend_occlude2_few.c \ @@ -56,15 +109,47 @@ image_blend_occlude3_many.c \ image_blend_occlude1_very_many.c \ image_blend_occlude2_very_many.c \ image_blend_occlude3_very_many.c \ -poly_blend.c +poly_blend.c \ +proxy_image.c \ +proxy_text_fixed.c \ +proxy_text_random.c + +#image_mask.c \ +#image_mask_2.c \ +#image_mask_3.c \ +#image_mask_4.c \ +#image_mask_5.c \ +#image_mask_6.c \ +#image_mask_7.c \ +#image_mask_8.c \ +#image_mask_9.c \ +#image_mask_10.c \ +#image_mask_11.c \ +#image_mask_12.c \ +#image_mask_13.c \ +#image_mask_14.c \ +#image_mask_15.c \ +#filter_object_colors.c \ +#filter_object_colors_solid.c \ +#filter_object_sepia.c \ +#filter_object_sepia_solid.c \ +#filter_object_greyscale.c \ +#filter_object_greyscale_solid.c \ +#filter_object_invert.c \ +#filter_object_invert_solid.c \ +#filter_object_brightness.c \ +#filter_object_brightness_solid.c \ +#filter_object_blur.c \ +#filter_object_blur_solid.c expedite_CFLAGS = @WIN32_CFLAGS@ -expedite_LDADD = @EVAS_LIBS@ @SDL_LIBS@ @x_libs@ @ddraw_libs@ @ddraw_16_libs@ @d3d_libs@ @wince_16_libs@ @glew_libs@ @DIRECTFB_LIBS@ @XCB_LIBS@ -lm +expedite_CXXFLAGS = @EXPEDITE_CXXFLAGS@ +expedite_LDADD = @SDL_LIBS@ @x_libs@ @gdi_libs@ @ddraw_libs@ @d3d_libs@ @wince_16_libs@ @DIRECTFB_LIBS@ @XCB_LIBS@ @EVAS_LIBS@ @EINA_LIBS@ @EVIL_LIBS@ @gl_cocoa_libs@ -lm expedite_LDFLAGS = @lt_enable_auto_import@ -if BUILD_SOFTWARE_X11 +if BUILD_SOFTWARE_XLIB expedite_SOURCES += \ -engine_software_x11.c engine_software_x11.h +engine_software_xlib.c engine_software_xlib.h endif if BUILD_XRENDER_X11 @@ -82,6 +167,16 @@ expedite_SOURCES += \ engine_software_xcb.c engine_software_xcb.h endif +if BUILD_XRENDER_XCB +expedite_SOURCES += \ +engine_xrender_xcb.c engine_xrender_xcb.h +endif + +if BUILD_SOFTWARE_GDI +expedite_SOURCES += \ +engine_software_gdi.c engine_software_gdi.h +endif + if BUILD_SOFTWARE_DDRAW expedite_SOURCES += \ engine_software_ddraw.cpp engine_software_ddraw.h @@ -92,14 +187,19 @@ expedite_SOURCES += \ engine_direct3d.cpp engine_direct3d.h endif -if BUILD_OPENGL_GLEW +if BUILD_SDL expedite_SOURCES += \ -engine_gl_glew.c engine_gl_glew.h +engine_software_sdl.c engine_software_sdl.h endif -if BUILD_SOFTWARE_SDL +if BUILD_OPENGL_SDL expedite_SOURCES += \ -engine_software_sdl.c engine_software_sdl.h +engine_gl_sdl.c engine_gl_sdl.h +endif + +if BUILD_PSL1GHT +expedite_SOURCES += \ +engine_psl1ght.c endif if BUILD_FB @@ -112,18 +212,22 @@ expedite_SOURCES += \ engine_directfb.c engine_directfb.h endif -if BUILD_SOFTWARE_16_X11 +if BUILD_OPENGL_COCOA expedite_SOURCES += \ -engine_software_16_x11.c engine_software_16_x11.h +engine_gl_cocoa.m engine_gl_cocoa.h endif -if BUILD_SOFTWARE_16_DDRAW +if BUILD_SOFTWARE_16_X11 expedite_SOURCES += \ -engine_software_16_ddraw.cpp engine_software_16_ddraw.h +engine_software_16_x11.c engine_software_16_x11.h endif if BUILD_SOFTWARE_16_WINCE expedite_SOURCES += \ -engine_software_16_wince.c engine_software_16_wince.h +engine_software_16_wince.c engine_software_16_wince.h engine_software_16_wince.rc endif +.rc.lo: + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --tag=RC --mode=compile $(RC) $(RCFLAGS) $< -o $@ + +EXTRA_DIST = $(bin_SCRIPTS) diff --git a/src/bin/about.c b/src/bin/about.c index deb6bbe..f36fdbc 100644 --- a/src/bin/about.c +++ b/src/bin/about.c @@ -56,7 +56,7 @@ _cleanup(void) } static void -_loop(double t, int f) +_loop(double t __UNUSED__, int f __UNUSED__) { } diff --git a/src/bin/engine_direct3d.cpp b/src/bin/engine_direct3d.cpp index 6304781..1e3b4ab 100644 --- a/src/bin/engine_direct3d.cpp +++ b/src/bin/engine_direct3d.cpp @@ -5,6 +5,7 @@ static HWND window; +static HINSTANCE instance; static LRESULT CALLBACK @@ -39,9 +40,14 @@ MainWndProc(HWND hwnd, { PRECT rect = (PRECT)lParam; + evas_output_viewport_set(evas, 0, 0, + rect->right - rect->left, + rect->bottom - rect->top); evas_output_size_set(evas, rect->right - rect->left, rect->bottom - rect->top); + win_w = rect->right - rect->left; + win_h = rect->bottom - rect->top; return 0; } case WM_RBUTTONDOWN: @@ -165,31 +171,20 @@ MainWndProc(HWND hwnd, } } -int -engine_direct3d_args(int argc, char **argv) +Eina_Bool +engine_direct3d_args(const char *engine, int width, int height) { WNDCLASS wc; RECT rect; - HINSTANCE instance; HDC dc; MSG msg; Evas_Engine_Info_Direct3D *einfo; + DWORD style; int depth; int i; - int ok = 0; - - for (i = 1; i < argc; i++) - { - if ((!strcmp(argv[i], "-e")) && (i < (argc - 1))) - { - i++; - if (!strcmp(argv[i], "direct3d")) ok = 1; - } - } - if (!ok) return 0; instance = GetModuleHandle(NULL); - if (!instance) return 0; + if (!instance) return EINA_FALSE; wc.style = 0; wc.lpfnWndProc = MainWndProc; @@ -207,8 +202,8 @@ engine_direct3d_args(int argc, char **argv) rect.left = 0; rect.top = 0; - rect.right = win_w; - rect.bottom = win_h; + rect.right = width; + rect.bottom = height; AdjustWindowRect (&rect, WS_OVERLAPPEDWINDOW | WS_SIZEBOX, FALSE); window = CreateWindowEx(0, @@ -238,20 +233,24 @@ engine_direct3d_args(int argc, char **argv) einfo = (Evas_Engine_Info_Direct3D *)evas_engine_info_get(evas); if (!einfo) { - fprintf(stderr, "Evas does not support the Direct3D Engine\n"); + fprintf(stderr, "Evas does not support the Direct3D Engine\n"); goto destroy_window; } einfo->info.window = window; einfo->info.depth = depth; einfo->info.rotation = 0; - evas_engine_info_set(evas, (Evas_Engine_Info *)einfo); + if (!evas_engine_info_set(evas, (Evas_Engine_Info *)einfo)) + { + printf("Evas can not setup the informations of the Direct3D Engine\n"); + goto destroy_window; + } /* the second parameter is ignored, as it's the first call of ShowWindow */ ShowWindow(window, SW_SHOWDEFAULT); UpdateWindow(window); - return 1; + return EINA_TRUE; destroy_window: DestroyWindow(window); @@ -260,7 +259,7 @@ engine_direct3d_args(int argc, char **argv) free_library: FreeLibrary(instance); - return 0; + return EINA_FALSE; } void @@ -279,3 +278,11 @@ engine_direct3d_loop(void) goto again; } + +void +engine_direct3d_shutdown(void) +{ + DestroyWindow(window); + UnregisterClass("Evas_Direct3D_Test", instance); + FreeLibrary(instance); +} diff --git a/src/bin/engine_direct3d.h b/src/bin/engine_direct3d.h index 86bec74..2fa3bd1 100644 --- a/src/bin/engine_direct3d.h +++ b/src/bin/engine_direct3d.h @@ -7,8 +7,9 @@ extern "C" { #endif -int engine_direct3d_args(int argc, char **argv); +Eina_Bool engine_direct3d_args(const char *engine, int width, int height); void engine_direct3d_loop(void); +void engine_direct3d_shutdown(void); #ifdef __cplusplus diff --git a/src/bin/engine_directfb.c b/src/bin/engine_directfb.c index e6daa0e..acbc6f8 100644 --- a/src/bin/engine_directfb.c +++ b/src/bin/engine_directfb.c @@ -10,6 +10,9 @@ static DFBResult _err; static IDirectFBWindow *_dfb_window; static IDirectFBSurface *_dfb_surface; +#define DBG(...) do {} while (0) +//#define DBG(...) fprintf(stderr, __VA_ARGS__) + #define DFBCHECK(x...) \ { \ _err = x; \ @@ -19,30 +22,19 @@ static IDirectFBSurface *_dfb_surface; } \ } -int -engine_directfb_args(int argc, char **argv) +Eina_Bool +engine_directfb_args(const char *engine, int width, int height) { Evas_Engine_Info_DirectFB *einfo; DFBWindowDescription desc; int i; - int ok = 0; - - for (i = 1; i < argc; i++) - { - if ((!strcmp(argv[i], "-e")) && (i < (argc - 1))) - { - i++; - if (!strcmp(argv[i], "directfb")) ok = 1; - } - } - if (!ok) return 0; evas_output_method_set(evas, evas_render_method_lookup("directfb")); einfo = (Evas_Engine_Info_DirectFB *)evas_engine_info_get(evas); if (!einfo) { printf("Evas does not support the DirectFB Engine\n"); - return 0; + return EINA_FALSE; } DFBCHECK(DirectFBInit(NULL, NULL)); @@ -52,25 +44,29 @@ engine_directfb_args(int argc, char **argv) DFBCHECK(_dfb->CreateInputEventBuffer(_dfb, DICAPS_ALL, DFB_FALSE, &_input_event)); memset(&desc, 0, sizeof(DFBWindowDescription)); - desc.flags = (DWDESC_POSX | DWDESC_POSY | DWDESC_WIDTH | DWDESC_HEIGHT | DWDESC_CAPS); + desc.flags = (DWDESC_POSX | DWDESC_POSY | DWDESC_WIDTH | DWDESC_HEIGHT | DWDESC_PIXELFORMAT); desc.posx = 0; desc.posy = 0; - desc.width = win_w; - desc.height = win_h; - desc.caps = DWCAPS_ALPHACHANNEL; + desc.width = width; + desc.height = height; + desc.pixelformat = DSPF_ARGB; DFBCHECK(_layer->CreateWindow(_layer, &desc, &_dfb_window)); DFBCHECK(_dfb_window->AttachEventBuffer(_dfb_window, _window_event)); DFBCHECK(_dfb_window->SetOptions(_dfb_window, DWOP_NONE)); DFBCHECK(_dfb_window->SetOpacity(_dfb_window, 0xFF)); DFBCHECK(_dfb_window->GetSurface(_dfb_window, &_dfb_surface)); + DFBCHECK(_dfb_surface->SetPorterDuff(_dfb_surface, DSPD_SRC_OVER)); einfo->info.dfb = _dfb; einfo->info.surface = _dfb_surface; - einfo->info.flags = DSDRAW_BLEND; - evas_engine_info_set(evas, (Evas_Engine_Info *) einfo); + if (!evas_engine_info_set(evas, (Evas_Engine_Info *) einfo)) + { + printf("Evas can not setup the informations of the DirectFB Engine\n"); + return EINA_FALSE; + } - return 1; + return EINA_TRUE; } static void @@ -126,40 +122,44 @@ key_string(DFBInputDeviceKeySymbol sym) static void engine_directfb_event_window(const DFBWindowEvent *ev) { - fprintf(stderr, "===> Window Event (type=%#10x, window=%d) <===\n", - ev->type, ev->window_id); + DBG("===> Window Event (type=%#10x, window=%d) <===\n", + ev->type, ev->window_id); if (ev->type & DWET_POSITION) { - fprintf(stderr, "\tDWET_POSITION %d, %d\n", ev->x, ev->y); + DBG("\tDWET_POSITION %d, %d\n", ev->x, ev->y); } if (ev->type & DWET_SIZE) { - fprintf(stderr, "\tDWET_SIZE %dx%d\n", ev->w, ev->h); - evas_output_size_set(evas, ev->w, ev->h); + DBG("\tDWET_SIZE %dx%d\n", ev->w, ev->h); + evas_output_viewport_set(evas, 0, 0, + ev->w, ev->h); + evas_output_size_set(evas, ev->w, ev->h); + win_w = ev->w; + win_h = ev->h; } if (ev->type & DWET_CLOSE) { - fprintf(stderr, "\tDWET_CLOSE\n"); + DBG("\tDWET_CLOSE\n"); engine_directfb_quit(); } if (ev->type & DWET_DESTROYED) { - fprintf(stderr, "\tDWET_DESTROYED\n"); + DBG("\tDWET_DESTROYED\n"); engine_directfb_quit(); } if (ev->type & DWET_GOTFOCUS) { - fprintf(stderr, "\tDWET_GOTFOCUS\n"); + DBG("\tDWET_GOTFOCUS\n"); } if (ev->type & DWET_LOSTFOCUS) { - fprintf(stderr, "\tDWET_LOSTFOCUS\n"); + DBG("\tDWET_LOSTFOCUS\n"); } if (ev->type & DWET_KEYDOWN) @@ -167,7 +167,7 @@ engine_directfb_event_window(const DFBWindowEvent *ev) const char *k; k = key_string(ev->key_symbol); - fprintf(stderr, "\tDWET_KEYDOWN key_symbol=%s\n", k); + DBG("\tDWET_KEYDOWN key_symbol=%s\n", k); if (k) evas_event_feed_key_down(evas, k, k, NULL, NULL, 0, NULL); @@ -178,7 +178,7 @@ engine_directfb_event_window(const DFBWindowEvent *ev) const char *k; k = key_string(ev->key_symbol); - fprintf(stderr, "\tDWET_KEYUP key_symbol=%s\n", k); + DBG("\tDWET_KEYUP key_symbol=%s\n", k); if (k) evas_event_feed_key_up(evas, k, k, NULL, NULL, 0, NULL); @@ -186,51 +186,53 @@ engine_directfb_event_window(const DFBWindowEvent *ev) if (ev->type & DWET_BUTTONDOWN) { - fprintf(stderr, "\tDWET_BUTTONDOWN pos=(%d, %d) cur_pos=(%d, %d) " - "button=%#x buttons=%#x\n", - ev->x, ev->y, ev->cx, ev->cy, ev->button, ev->buttons); + DBG("\tDWET_BUTTONDOWN pos=(%d, %d) cur_pos=(%d, %d) " + "button=%#x buttons=%#x\n", + ev->x, ev->y, ev->cx, ev->cy, ev->button, ev->buttons); evas_event_feed_mouse_move(evas, ev->cx, ev->cy, 0, NULL); evas_event_feed_mouse_down(evas, ev->button, EVAS_BUTTON_NONE, 0, NULL); } if (ev->type & DWET_BUTTONUP) { - fprintf(stderr, "\tDWET_BUTTONUP pos=(%d, %d) cur_pos=(%d, %d) " - "button=%#x buttons=%#x\n", - ev->x, ev->y, ev->cx, ev->cy, ev->button, ev->buttons); + DBG("\tDWET_BUTTONUP pos=(%d, %d) cur_pos=(%d, %d) " + "button=%#x buttons=%#x\n", + ev->x, ev->y, ev->cx, ev->cy, ev->button, ev->buttons); evas_event_feed_mouse_move(evas, ev->cx, ev->cy, 0, NULL); evas_event_feed_mouse_up(evas, ev->button, EVAS_BUTTON_NONE, 0, NULL); } if (ev->type & DWET_MOTION) { - fprintf(stderr, "\tDWET_MOTION pos=(%d, %d) cur_pos=(%d, %d) " - "buttons=%#x\n", - ev->x, ev->y, ev->cx, ev->cy, ev->buttons); + DBG("\tDWET_MOTION pos=(%d, %d) cur_pos=(%d, %d) buttons=%#x\n", + ev->x, ev->y, ev->cx, ev->cy, ev->buttons); + /* Mouse Motion Compression [tm] */ + _layer->GetCursorPosition( _layer, (int*)&ev->x, (int*)&ev->y ); + evas_event_feed_mouse_move(evas, ev->x, ev->y, 0, NULL); } if (ev->type & DWET_LEAVE) { - fprintf(stderr, "\tDWET_LEAVE pos=(%d, %d) cur_pos=(%d, %d)\n", - ev->x, ev->y, ev->cx, ev->cy); + DBG("\tDWET_LEAVE pos=(%d, %d) cur_pos=(%d, %d)\n", + ev->x, ev->y, ev->cx, ev->cy); evas_event_feed_mouse_out(evas, 0, NULL); } if (ev->type & DWET_ENTER) { - fprintf(stderr, "\tDWET_ENTER pos=(%d, %d) cur_pos=(%d, %d)\n", - ev->x, ev->y, ev->cx, ev->cy); + DBG("\tDWET_ENTER pos=(%d, %d) cur_pos=(%d, %d)\n", + ev->x, ev->y, ev->cx, ev->cy); evas_event_feed_mouse_in(evas, 0, NULL); } if (ev->type & DWET_WHEEL) { - fprintf(stderr, "\tDWET_WHEEL step=%d\n", ev->step); + DBG("\tDWET_WHEEL step=%d\n", ev->step); } - fprintf(stderr, "\n"); + DBG("\n"); } void @@ -241,24 +243,35 @@ engine_directfb_loop(void) while ((_input_event->GetEvent(_input_event, &ev) == DFB_OK) || (_window_event->GetEvent(_window_event, &ev) == DFB_OK)) { - fprintf(stderr, "got dfb input event %d\n", ev.clazz); + DBG("got dfb input event %d\n", ev.clazz); switch (ev.clazz) { case DFEC_NONE: - fprintf(stderr, "No event?\n"); + DBG("No event?\n"); break; case DFEC_INPUT: - fprintf(stderr, "Input\n"); + DBG("Input\n"); break; case DFEC_WINDOW: engine_directfb_event_window((const DFBWindowEvent *)&ev); break; case DFEC_USER: - fprintf(stderr, "User\n"); + DBG("User\n"); break; case DFEC_UNIVERSAL: - fprintf(stderr, "Universal\n"); + DBG("Universal\n"); break; } } } + +void +engine_directfb_shutdown(void) +{ + DFBCHECK(_input_event->Release(_input_event)); + DFBCHECK(_window_event->Release(_window_event)); + DFBCHECK(_dfb_surface->Release(_dfb_surface)); + DFBCHECK(_dfb_window->Release(_dfb_window)); + DFBCHECK(_layer->Release(_layer)); + DFBCHECK(_dfb->Release(_dfb)); +} diff --git a/src/bin/engine_directfb.h b/src/bin/engine_directfb.h index 867c2e3..7f22382 100644 --- a/src/bin/engine_directfb.h +++ b/src/bin/engine_directfb.h @@ -1,7 +1,8 @@ #ifndef ENGINE_DIRECTFB_H #define ENGINE_DIRECTFB_H -int engine_directfb_args(int argc, char **argv); +Eina_Bool engine_directfb_args(const char *engine, int width, int height); void engine_directfb_loop(void); +void engine_directfb_shutdown(void); #endif diff --git a/src/bin/engine_fb.c b/src/bin/engine_fb.c index 1f0be45..863487a 100644 --- a/src/bin/engine_fb.c +++ b/src/bin/engine_fb.c @@ -2,29 +2,17 @@ #include -int -engine_fb_args(int argc, char **argv) +Eina_Bool +engine_fb_args(const char *engine __UNUSED__, int width __UNUSED__, int height __UNUSED__) { Evas_Engine_Info_FB *einfo; - int i; - int ok = 0; - - for (i = 1; i < argc; i++) - { - if ((!strcmp(argv[i], "-e")) && (i < (argc - 1))) - { - i++; - if (!strcmp(argv[i], "fb")) ok = 1; - } - } - if (!ok) return 0; evas_output_method_set(evas, evas_render_method_lookup("fb")); einfo = (Evas_Engine_Info_FB *)evas_engine_info_get(evas); if (!einfo) { printf("Evas does not support the FB Engine\n"); - return 0; + return EINA_FALSE; } einfo->info.virtual_terminal = 0; @@ -32,9 +20,13 @@ engine_fb_args(int argc, char **argv) einfo->info.device_number = 0; einfo->info.refresh = 0; einfo->info.rotation = 0; - evas_engine_info_set(evas, (Evas_Engine_Info *) einfo); + if (!evas_engine_info_set(evas, (Evas_Engine_Info *) einfo)) + { + printf("Evas can not setup the informations of the FB Engine\n"); + return EINA_FALSE; + } - return 1; + return EINA_TRUE; } void @@ -42,3 +34,9 @@ engine_fb_loop(void) { return; } + +void +engine_fb_shutdown(void) +{ + return; +} diff --git a/src/bin/engine_fb.h b/src/bin/engine_fb.h index ca4cb39..288208f 100644 --- a/src/bin/engine_fb.h +++ b/src/bin/engine_fb.h @@ -1,7 +1,8 @@ #ifndef ENGINE_FB_H #define ENGINE_FB_H -int engine_fb_args(int argc, char **argv); +Eina_Bool engine_fb_args(const char *engine, int width, int height); void engine_fb_loop(void); +void engine_fb_shutdown(void); #endif diff --git a/src/bin/engine_gl_cocoa.h b/src/bin/engine_gl_cocoa.h new file mode 100644 index 0000000..77430c9 --- /dev/null +++ b/src/bin/engine_gl_cocoa.h @@ -0,0 +1,8 @@ +#ifndef ENGINE_GL_COCOA_H +#define ENGINE_GL_COCOA_H + +int engine_gl_cocoa_args(int argc, char **argv); +void engine_gl_cocoa_loop(void); +void engine_gl_cocoa_shutdown(void); + +#endif diff --git a/src/bin/engine_gl_cocoa.m b/src/bin/engine_gl_cocoa.m new file mode 100644 index 0000000..a6878d7 --- /dev/null +++ b/src/bin/engine_gl_cocoa.m @@ -0,0 +1,231 @@ +/* NOTE: If you're using Expedite for performance testing, + set "Disable Beam Synchronization" in GL_Cocoa Debug. */ + +#include "main.h" + +#include +#include + +static NSView * evas_view; +static NSWindow * main_window; + + +int +engine_gl_cocoa_args(int argc, char **argv) +{ + Evas_Engine_Info_GL_Cocoa *einfo; + int i; + int ok = 0; + + /* + for (i = 1; i < argc; i++) + { + if ((!strcmp(argv[i], "-e")) && (i < (argc - 1))) + { + i++; + if (!strcmp(argv[i], "gl-cocoa")) ok = 1; + } + } + if (!ok) return 0; + */ + + evas_output_method_set(evas, evas_render_method_lookup("gl_cocoa")); + einfo = (Evas_Engine_Info_GL_Cocoa *)evas_engine_info_get(evas); + if (!einfo) + { + printf("Evas is a goat and can't run GL_COCOA ... or .... it's me the goat\n"); + return 0; + } + + // Set up the Cocoa runtime + [[NSAutoreleasePool alloc] init]; + [NSApplication sharedApplication]; + + // Register ourselves as a full-fledged Cocoa app, instead of a NSUIElement. + // This gives benefits like window focus and a dock icon! + ProcessSerialNumber psn = { 0, kCurrentProcess }; + TransformProcessType (&psn, kProcessTransformToForegroundApplication); + + [NSApp finishLaunching]; + // Create our main window, and embed an EvasGLView in it + main_window = [[NSWindow alloc] initWithContentRect:NSMakeRect(20,500,win_w,win_h) styleMask:(NSTitledWindowMask | NSClosableWindowMask | NSResizableWindowMask | NSMiniaturizableWindowMask) backing:NSBackingStoreBuffered defer:NO screen:nil]; + [main_window makeKeyAndOrderFront:NSApp]; + [main_window setTitle:@"Expedite"]; + [main_window makeMainWindow]; + [main_window setAcceptsMouseMovedEvents:YES]; + [NSApp activateIgnoringOtherApps:YES]; + + evas_output_size_set(evas, win_w, win_h); + evas_output_viewport_set(evas, 0, 0, win_w, win_h); + + einfo->window = main_window; + + //einfo->info.context = [evas_view context]; + if (!evas_engine_info_set(evas, (Evas_Engine_Info *) einfo)) + { + printf("Evas can not setup the informations of the GL_Cocoa Engine\n"); + exit(-1); + } + + evas_view = (NSView*)einfo->view; + [[main_window contentView] addSubview:evas_view]; + [evas_view display]; + + evas_damage_rectangle_add(evas,0,0, win_w ,win_h); + return 1; +} + +void +engine_gl_cocoa_loop(void) +{ + NSDate *date = [NSDate dateWithTimeIntervalSinceNow:0.001]; + + NSEvent *event = [NSApp nextEventMatchingMask:NSAnyEventMask + untilDate:date + inMode:NSDefaultRunLoopMode + dequeue:YES]; + [date release]; + + if (!event) return; + + if([event type] == NSMouseMoved || [event type] == NSLeftMouseDragged || [event type] == NSRightMouseDragged) + { + evas_event_feed_mouse_move(evas, [event locationInWindow].x, [event locationInWindow].y, 0, NULL); + + // Also notify on entering or leaving the window + NSPoint mouseLoc = [[event window] convertBaseToScreen:[event locationInWindow]]; + + if(NSPointInRect(mouseLoc, [[event window] frame])) + evas_event_feed_mouse_in(evas, 0, NULL); + else + evas_event_feed_mouse_out(evas, 0, NULL); + + [NSApp sendEvent:event]; + } + else if([event type] == NSLeftMouseDown) + { + evas_event_feed_mouse_move(evas, [event locationInWindow].x, [event locationInWindow].y, 0, NULL); + evas_event_feed_mouse_down(evas, 1, EVAS_BUTTON_NONE, 0, NULL); + + [NSApp sendEvent:event]; + } + else if([event type] == NSLeftMouseUp) + { + evas_event_feed_mouse_move(evas, [event locationInWindow].x, [event locationInWindow].y, 0, NULL); + evas_event_feed_mouse_up(evas, 1, EVAS_BUTTON_NONE, 0, NULL); + + [NSApp sendEvent:event]; + } + else if([event type] == NSRightMouseDown) + { + evas_event_feed_mouse_move(evas, [event locationInWindow].x, [event locationInWindow].y, 0, NULL); + evas_event_feed_mouse_down(evas, 3, EVAS_BUTTON_NONE, 0, NULL); + [NSApp sendEvent:event]; + } + else if([event type] == NSRightMouseUp) + { + evas_event_feed_mouse_move(evas, [event locationInWindow].x, [event locationInWindow].y, 0, NULL); + evas_event_feed_mouse_up(evas, 3, EVAS_BUTTON_NONE, 0, NULL); + [NSApp sendEvent:event]; + } + else if([event type] == NSKeyDown) + { + NSString * chars = [event charactersIgnoringModifiers]; + + switch([chars characterAtIndex:0]) + { + case NSLeftArrowFunctionKey: + evas_event_feed_key_down(evas, "Left", "Left", NULL, NULL, 0, NULL); + break; + case NSRightArrowFunctionKey: + evas_event_feed_key_down(evas, "Right", "Right", NULL, NULL, 0, NULL); + break; + case NSEnterCharacter: + case NSCarriageReturnCharacter: + evas_event_feed_key_down(evas, "Return", "Return", NULL, NULL, 0, NULL); + break; + case 's': + case '\e': + evas_event_feed_key_down(evas, "Escape", "Escape", NULL, NULL, 0, NULL); + break; + case 'q': + evas_event_feed_key_down(evas, "q", "q", NULL, NULL, 0, NULL); + break; + } + + [chars release]; + } + else if([event type] == NSKeyUp) + { + NSString * chars = [event charactersIgnoringModifiers]; + + switch([chars characterAtIndex:0]) + { + case NSLeftArrowFunctionKey: + evas_event_feed_key_up(evas, "Left", "Left", NULL, NULL, 0, NULL); + break; + case NSRightArrowFunctionKey: + evas_event_feed_key_up(evas, "Right", "Right", NULL, NULL, 0, NULL); + break; + case NSEnterCharacter: + case NSCarriageReturnCharacter: + evas_event_feed_key_up(evas, "Return", "Return", NULL, NULL, 0, NULL); + break; + case '\e': + evas_event_feed_key_up(evas, "Escape", "Escape", NULL, NULL, 0, NULL); + break; + case 'q': + if (evas_key_lock_is_set(evas_key_lock_get(evas), "Caps_Lock")) + evas_event_feed_key_up(evas, "Q", "Q", NULL, NULL, 0, NULL); + else + evas_event_feed_key_up(evas, "q", "q", NULL, NULL, 0, NULL); + break; + } + + [chars release]; + } + else if([event type] == NSFlagsChanged) + { + int flags = [event modifierFlags]; + + // Turn special key flags on + if(flags & NSShiftKeyMask) + evas_key_modifier_on(evas, "Shift"); + else if(flags & NSControlKeyMask) + evas_key_modifier_on(evas, "Control"); + else if(flags & NSAlternateKeyMask) + evas_key_modifier_on(evas, "Alt"); + else if(flags & NSCommandKeyMask) + evas_key_modifier_on(evas, "Super"); + else if(flags & NSAlphaShiftKeyMask) + { + if (evas_key_lock_is_set(evas_key_lock_get(evas), "Caps_Lock")) + evas_key_lock_off(evas, "Caps_Lock"); + else + evas_key_lock_on(evas, "Caps_Lock"); + } + + // Turn special key flags off + if(!(flags & NSShiftKeyMask)) + evas_key_modifier_off(evas, "Shift"); + else if(!(flags & NSControlKeyMask)) + evas_key_modifier_off(evas, "Control"); + else if(!(flags & NSAlternateKeyMask)) + evas_key_modifier_off(evas, "Alt"); + else if(!(flags & NSCommandKeyMask)) + evas_key_modifier_off(evas, "Super"); + } + else + { + [NSApp sendEvent:event]; + } + + [event release]; + [NSAutoreleasePool release]; +} + +void +engine_gl_cocoa_shutdown(void) +{ + /* If someone knows what to do here... */ +} diff --git a/src/bin/engine_gl_glew.c b/src/bin/engine_gl_glew.c index d4c32d6..43dae3b 100644 --- a/src/bin/engine_gl_glew.c +++ b/src/bin/engine_gl_glew.c @@ -7,6 +7,7 @@ static HWND window; +static HINSTANCE instance; static LRESULT CALLBACK MainWndProc(HWND hwnd, @@ -39,10 +40,15 @@ MainWndProc(HWND hwnd, case WM_SIZING: { PRECT rect = (PRECT)lParam; - + + evas_output_viewport_set(evas, 0, 0, + rect->right - rect->left, + rect->bottom - rect->top); evas_output_size_set(evas, rect->right - rect->left, rect->bottom - rect->top); + win_w = rect->right - rect->left; + win_h = rect->bottom - rect->top; return 0; } case WM_RBUTTONDOWN: @@ -166,36 +172,25 @@ MainWndProc(HWND hwnd, } } -int -engine_gl_glew_args(int argc, char **argv) +Eina_Bool +engine_gl_glew_args(const char *engine, int width, int height) { WNDCLASS wc; RECT rect; - HINSTANCE hinstance; HDC dc; Evas_Engine_Info_GL_Glew *einfo; + DWORD style; int depth; int i; - int ok = 0; - for (i = 1; i < argc; i++) - { - if ((!strcmp(argv[i], "-e")) && (i < (argc - 1))) - { - i++; - if (!strcmp(argv[i], "gl-glew")) ok = 1; - } - } - if (!ok) return 0; - - hinstance = GetModuleHandle(NULL); - if (!instance) return 0; + instance = GetModuleHandle(NULL); + if (!instance) return EINA_FALSE; wc.style = 0; wc.lpfnWndProc = MainWndProc; wc.cbClsExtra = 0; wc.cbWndExtra = 0; - wc.hInstance = hinstance; + wc.hInstance = instance; wc.hIcon = LoadIcon (NULL, IDI_APPLICATION); wc.hCursor = LoadCursor (NULL, IDC_ARROW); wc.hbrBackground = (HBRUSH)(1 + COLOR_BTNFACE); @@ -207,8 +202,8 @@ engine_gl_glew_args(int argc, char **argv) rect.left = 0; rect.top = 0; - rect.right = win_w; - rect.bottom = win_h; + rect.right = width; + rect.bottom = height; AdjustWindowRect (&rect, WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_OVERLAPPEDWINDOW | WS_SIZEBOX, FALSE); window = CreateWindowEx(0, @@ -217,7 +212,7 @@ engine_gl_glew_args(int argc, char **argv) WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_OVERLAPPEDWINDOW | WS_SIZEBOX, CW_USEDEFAULT, CW_USEDEFAULT, rect.right - rect.left, rect.bottom - rect.top, - NULL, NULL, hinstance, NULL); + NULL, NULL, instance, NULL); if (!window) goto unregister_class; @@ -227,6 +222,13 @@ engine_gl_glew_args(int argc, char **argv) if (!SetWindowLong(window, GWL_STYLE, style)) goto unregister_class; + dc = GetDC(NULL); + if (!dc) + goto destroy_window; + + depth = GetDeviceCaps(dc, BITSPIXEL); + ReleaseDC(NULL, dc); + evas_output_method_set(evas, evas_render_method_lookup("gl_glew")); einfo = (Evas_Engine_Info_GL_Glew *)evas_engine_info_get(evas); if (!einfo) @@ -237,13 +239,17 @@ engine_gl_glew_args(int argc, char **argv) einfo->info.window = window; einfo->info.depth = depth; - evas_engine_info_set(evas, (Evas_Engine_Info *) einfo); + if (!evas_engine_info_set(evas, (Evas_Engine_Info *) einfo)) + { + printf("Evas can not setup the informations of the GL Glew Engine\n"); + goto destroy_window; + } /* the second parameter is ignored, as it's the first call of ShowWindow */ ShowWindow(window, SW_SHOWDEFAULT); UpdateWindow(window); - return 1; + return EINA_TRUE; destroy_window: DestroyWindow(window); @@ -252,7 +258,7 @@ engine_gl_glew_args(int argc, char **argv) free_library: FreeLibrary(instance); - return 0; + return EINA_FALSE; } void @@ -271,3 +277,11 @@ engine_gl_glew_loop(void) goto again; } + +void +engine_gl_glew_shutdown(void) +{ + DestroyWindow(window); + UnregisterClass("Evas_Software_Gdi_Test", instance); + FreeLibrary(instance); +} diff --git a/src/bin/engine_gl_glew.h b/src/bin/engine_gl_glew.h index 8ba61f4..41439ed 100644 --- a/src/bin/engine_gl_glew.h +++ b/src/bin/engine_gl_glew.h @@ -2,8 +2,9 @@ #define __ENGINE_GL_GLEW_H__ -int engine_gl_glew_args(int argc, char **argv); +Eina_Bool engine_gl_glew_args(const char *engine, int width, int height); void engine_gl_glew_loop(void); +void engine_gl_glew_shutdown(void); #endif /* __ENGINE_GL_GLEW_H__ */ diff --git a/src/bin/engine_gl_sdl.c b/src/bin/engine_gl_sdl.c new file mode 100644 index 0000000..c30a008 --- /dev/null +++ b/src/bin/engine_gl_sdl.c @@ -0,0 +1,174 @@ +#include +#include "main.h" + +#include + +Eina_Bool +engine_gl_sdl_args(const char *engine, int width, int height) +{ + Evas_Engine_Info_GL_SDL *einfo; + int i; + + evas_output_method_set(evas, evas_render_method_lookup("gl_sdl")); + + einfo = (Evas_Engine_Info_GL_SDL *) evas_engine_info_get(evas); + if (!einfo) + { + printf("Evas wasn't build with GL SDL backend.\n"); + return EINA_FALSE; + } + + /* the following is specific to the engine */ + einfo->flags.fullscreen = fullscreen; + einfo->flags.noframe = 0; + + if (!evas_engine_info_set(evas, (Evas_Engine_Info *) einfo)) + { + printf("Evas could not initialize the GL SDL Engine\n"); + return EINA_FALSE; + } + + return EINA_TRUE; +} + +void +engine_gl_sdl_loop(void) +{ + SDL_Event event; + + while(SDL_PollEvent(&event)) + { + switch(event.type) + { + case SDL_MOUSEMOTION: + evas_event_feed_mouse_move(evas, event.motion.x, event.motion.y, 0, NULL); + break; + case SDL_MOUSEBUTTONDOWN: + evas_event_feed_mouse_move(evas, event.button.x, event.button.y, 0, NULL); + evas_event_feed_mouse_down(evas, event.button.button, EVAS_BUTTON_NONE, 0, NULL); + break; + case SDL_MOUSEBUTTONUP: + evas_event_feed_mouse_move(evas, event.button.x, event.button.y, 0, NULL); + evas_event_feed_mouse_up(evas, event.button.button, EVAS_BUTTON_NONE, 0, NULL); + break; + case SDL_VIDEORESIZE: + evas_output_viewport_set(evas, 0, 0, + event.resize.w, event.resize.w); + evas_output_size_set(evas, event.resize.w, event.resize.w); + evas_output_size_get(evas, &win_w, &win_h); + break; + case SDL_VIDEOEXPOSE: + evas_output_size_get(evas, &win_w, &win_h); + evas_damage_rectangle_add(evas, 0, 0, win_w, win_h); + break; + case SDL_KEYDOWN: + switch (event.key.keysym.sym) + { + case SDLK_LSHIFT: + case SDLK_RSHIFT: + evas_key_modifier_on(evas, "Shift"); + break; + case SDLK_RCTRL: + case SDLK_LCTRL: + evas_key_modifier_on(evas, "Control"); + break; + case SDLK_MENU: + case SDLK_RALT: + case SDLK_LALT: + evas_key_modifier_on(evas, "Alt"); + break; + case SDLK_LSUPER: + case SDLK_RSUPER: + evas_key_modifier_on(evas, "Super"); + break; + case SDLK_CAPSLOCK: + if (evas_key_lock_is_set(evas_key_lock_get(evas), "Caps_Lock")) + evas_key_lock_off(evas, "Caps_Lock"); + else + evas_key_lock_on(evas, "Caps_Lock"); + break; + case SDLK_NUMLOCK: + if (evas_key_lock_is_set(evas_key_lock_get(evas), "Num_Lock")) + evas_key_lock_off(evas, "Num_Lock"); + else + evas_key_lock_on(evas, "Num_Lock"); + break; + case SDLK_SCROLLOCK: + if (evas_key_lock_is_set(evas_key_lock_get(evas), "Scroll_Lock")) + evas_key_lock_off(evas, "Scroll_Lock"); + else + evas_key_lock_on(evas, "Scroll_Lock"); + break; + case SDLK_s: + case SDLK_ESCAPE: + evas_event_feed_key_down(evas, "Escape", "Escape", NULL, NULL, 0, NULL); + break; + case SDLK_KP_ENTER: + case SDLK_RETURN: + evas_event_feed_key_down(evas, "Return", "Return", NULL, NULL, 0, NULL); + break; + case SDLK_LEFT: evas_event_feed_key_down(evas, "Left", "Left", NULL, NULL, 0, NULL); break; + case SDLK_RIGHT: evas_event_feed_key_down(evas, "Right", "Right", NULL, NULL, 0, NULL); break; + case SDLK_q: + if (evas_key_lock_is_set(evas_key_lock_get(evas), "Caps_Lock")) + evas_event_feed_key_down(evas, "Q", "Q", NULL, NULL, 0, NULL); + else + evas_event_feed_key_down(evas, "q", "q", NULL, NULL, 0, NULL); + break; + default: + break; + } + break; + case SDL_KEYUP: + switch (event.key.keysym.sym) + { + case SDLK_LSHIFT: + case SDLK_RSHIFT: + evas_key_modifier_off(evas, "Shift"); + break; + case SDLK_RCTRL: + case SDLK_LCTRL: + evas_key_modifier_off(evas, "Control"); + break; + case SDLK_MENU: + case SDLK_RALT: + case SDLK_LALT: + evas_key_modifier_off(evas, "Alt"); + break; + case SDLK_LSUPER: + case SDLK_RSUPER: + evas_key_modifier_off(evas, "Super"); + break; + case SDLK_ESCAPE: evas_event_feed_key_up(evas, "Escape", "Escape", NULL, NULL, 0, NULL); break; + case SDLK_RETURN: evas_event_feed_key_up(evas, "Return", "Return", NULL, NULL, 0, NULL); break; + case SDLK_LEFT: evas_event_feed_key_up(evas, "Left", "Left", NULL, NULL, 0, NULL); break; + case SDLK_RIGHT: evas_event_feed_key_up(evas, "Right", "Right", NULL, NULL, 0, NULL); break; + case SDLK_q: + if (evas_key_lock_is_set(evas_key_lock_get(evas), "Caps_Lock")) + evas_event_feed_key_up(evas, "Q", "Q", NULL, NULL, 0, NULL); + else + evas_event_feed_key_up(evas, "q", "q", NULL, NULL, 0, NULL); + break; + default: + break; + } + break; + case SDL_QUIT: + case SDL_SYSWMEVENT: + case SDL_USEREVENT: + case SDL_ACTIVEEVENT: + case SDL_JOYAXISMOTION: + case SDL_JOYBALLMOTION: + case SDL_JOYHATMOTION: + case SDL_JOYBUTTONDOWN: + case SDL_JOYBUTTONUP: + default: + break; + } + } +} + +void +engine_gl_sdl_shutdown(void) +{ +} diff --git a/src/bin/engine_gl_sdl.h b/src/bin/engine_gl_sdl.h new file mode 100644 index 0000000..793db3d --- /dev/null +++ b/src/bin/engine_gl_sdl.h @@ -0,0 +1,8 @@ +#ifndef ENGINE_GL_SDL_H +#define ENGINE_GL_SDL_H + +Eina_Bool engine_gl_sdl_args(const char *engine, int width, int height); +void engine_gl_sdl_loop(void); +void engine_gl_sdl_shutdown(void); + +#endif diff --git a/src/bin/engine_gl_x11.c b/src/bin/engine_gl_x11.c index bf1d6e9..4c8fdd1 100644 --- a/src/bin/engine_gl_x11.c +++ b/src/bin/engine_gl_x11.c @@ -1,47 +1,39 @@ #include "main.h" #include +#include #include +#include #include static Display *disp = NULL; static Window win = 0; +static int first_expose = 0; -int -engine_gl_x11_args(int argc, char **argv) +Eina_Bool +engine_gl_x11_args(const char *engine __UNUSED__, int width, int height) { XSetWindowAttributes attr; XClassHint chint; XSizeHints szhints; Evas_Engine_Info_GL_X11 *einfo; - int i; - int ok = 0; - - for (i = 1; i < argc; i++) - { - if ((!strcmp(argv[i], "-e")) && (i < (argc - 1))) - { - i++; - if (!strcmp(argv[i], "gl")) ok = 1; - } - } - if (!ok) return 0; disp = XOpenDisplay(NULL); - if (!disp) return 0; + if (!disp) return EINA_FALSE; evas_output_method_set(evas, evas_render_method_lookup("gl_x11")); einfo = (Evas_Engine_Info_GL_X11 *)evas_engine_info_get(evas); if (!einfo) { printf("Evas does not support the OpenGL X11 Engine\n"); - return 0; + goto close_display; } einfo->info.display = disp; - einfo->info.visual = einfo->func.best_visual_get(disp, DefaultScreen(disp)); - einfo->info.colormap = einfo->func.best_colormap_get(disp, DefaultScreen(disp)); - einfo->info.depth = einfo->func.best_depth_get(disp, DefaultScreen(disp)); + einfo->info.screen = DefaultScreen(einfo->info.display); + einfo->info.visual = einfo->func.best_visual_get(einfo); + einfo->info.colormap = einfo->func.best_colormap_get(einfo); + einfo->info.depth = einfo->func.best_depth_get(einfo); attr.backing_store = NotUseful; attr.colormap = einfo->info.colormap; attr.border_pixel = 0; @@ -52,27 +44,52 @@ engine_gl_x11_args(int argc, char **argv) KeyPressMask | KeyReleaseMask; attr.bit_gravity = ForgetGravity; win = XCreateWindow(disp, DefaultRootWindow(disp), - 0, 0, win_w, win_h, 0, + 0, 0, width, height, 0, einfo->info.depth, InputOutput, einfo->info.visual, CWBackingStore | CWColormap | CWBackPixmap | CWBorderPixel | CWBitGravity | CWEventMask, &attr); + if (!win) + goto close_display; + einfo->info.drawable = win; - evas_engine_info_set(evas, (Evas_Engine_Info *) einfo); + if (!evas_engine_info_set(evas, (Evas_Engine_Info *) einfo)) + { + printf("Evas can not setup the informations of the OpenGL X11 Engine\n"); + goto destroy_window; + } + if (fullscreen) + { + Atom prop = XInternAtom(disp, "_NET_WM_STATE", False); + Atom state = XInternAtom(disp, "_NET_WM_STATE_FULLSCREEN", False); + unsigned long data = state; + XChangeProperty(disp, win, prop, XA_ATOM, 32, PropModeReplace, + (unsigned char*) &data, 1); + } + XStoreName(disp, win, "Expedite - Evas Test Suite"); chint.res_name = "expedite"; chint.res_class = "Expedite"; XSetClassHint(disp, win, &chint); szhints.flags = PMinSize | PMaxSize | PSize | USSize; - szhints.min_width = szhints.max_width = win_w; - szhints.min_height = szhints.max_height = win_h; + szhints.min_width = szhints.max_width = width; + szhints.min_height = szhints.max_height = height; XSetWMNormalHints(disp, win, &szhints); XMapWindow(disp, win); XSync(disp, False); - return 1; + while (!first_expose) + engine_gl_x11_loop(); + return EINA_TRUE; + + destroy_window: + XDestroyWindow(disp, win); + close_display: + XCloseDisplay(disp); + + return EINA_FALSE; } void @@ -108,6 +125,7 @@ engine_gl_x11_loop(void) evas_event_feed_mouse_move(evas, ev.xmotion.x, ev.xmotion.y, 0, NULL); break; case Expose: + first_expose = 1; evas_damage_rectangle_add(evas, ev.xexpose.x, ev.xexpose.y, @@ -115,9 +133,14 @@ engine_gl_x11_loop(void) ev.xexpose.height); break; case ConfigureNotify: + evas_output_viewport_set(evas, 0, 0, + ev.xconfigure.width, + ev.xconfigure.height); evas_output_size_set(evas, ev.xconfigure.width, ev.xconfigure.height); + win_w = ev.xconfigure.width; + win_h = ev.xconfigure.height; break; case EnterNotify: evas_event_feed_mouse_in(evas, 0, NULL); @@ -126,7 +149,7 @@ engine_gl_x11_loop(void) evas_event_feed_mouse_out(evas, 0, NULL); break; case KeyPress: - ks = XKeycodeToKeysym(ev.xkey.display, ev.xkey.keycode, 0); + ks = XkbKeycodeToKeysym(ev.xkey.display, ev.xkey.keycode, 0, 0); kstr = XKeysymToString(ks); if (kstr) { @@ -167,7 +190,7 @@ engine_gl_x11_loop(void) } break; case KeyRelease: - ks = XKeycodeToKeysym(ev.xkey.display, ev.xkey.keycode, 0); + ks = XkbKeycodeToKeysym(ev.xkey.display, ev.xkey.keycode, 0, 0); kstr = XKeysymToString(ks); if (kstr) { @@ -191,3 +214,10 @@ engine_gl_x11_loop(void) } goto again; } + +void +engine_gl_x11_shutdown(void) +{ + XDestroyWindow(disp, win); + XCloseDisplay(disp); +} diff --git a/src/bin/engine_gl_x11.h b/src/bin/engine_gl_x11.h index 917b28e..9702d8b 100644 --- a/src/bin/engine_gl_x11.h +++ b/src/bin/engine_gl_x11.h @@ -1,7 +1,8 @@ #ifndef ENGINE_GL_X11_H #define ENGINE_GL_X11_H -int engine_gl_x11_args(int argc, char **argv); +Eina_Bool engine_gl_x11_args(const char *engine, int width, int height); void engine_gl_x11_loop(void); +void engine_gl_x11_shutdown(void); #endif diff --git a/src/bin/engine_psl1ght.c b/src/bin/engine_psl1ght.c new file mode 100644 index 0000000..2661a6c --- /dev/null +++ b/src/bin/engine_psl1ght.c @@ -0,0 +1,284 @@ +#include "main.h" + +#include +#include +#include + +static int window_width = 0; +static int window_height = 0; + +Eina_Bool +engine_psl1ght_args(const char *engine, int width, int height) +{ + Evas_Engine_Info_PSL1GHT *einfo; + + evas_output_method_set(evas, evas_render_method_lookup("psl1ght")); + einfo = (Evas_Engine_Info_PSL1GHT *)evas_engine_info_get(evas); + if (!einfo) + { + printf("Evas does not support the PSL1GHT Engine\n"); + return EINA_FALSE; + } + + if (!evas_engine_info_set(evas, (Evas_Engine_Info *)einfo)) + { + printf("Evas can not setup the informations of the PSL1GHT Engine\n"); + return EINA_FALSE; + } + + window_width = width; + window_height = height; + ioMouseInit(1); + ioKbInit(1); + return EINA_TRUE; +} + +void +engine_psl1ght_loop(void) +{ + mouseInfo mouseinfo; + static int mouse_connected = FALSE; + static u8 mouse_buttons = 0; + static int mouse_x = 0; + static int mouse_y = 0; + KbInfo kbInfo; + static int keyboard_connected = FALSE; + static KbLed keyboard_leds = {{0}}; + static KbMkey keyboard_mods = {{0}}; + static u16 keyboard_old_key = 0; + int i; + + /* Check mouse events */ + ioMouseGetInfo(&mouseinfo); + + if (mouseinfo.status[0] == 1 && !mouse_connected) // Connected + { + mouse_connected = TRUE; + mouse_buttons = 0; + + // Old events in the queue are discarded + ioMouseClearBuf(0); + } + else if (mouseinfo.status[0] != 1 && mouse_connected) // Disconnected + { + mouse_connected = FALSE; + mouse_buttons = 0; + } + + if (mouse_connected) + { + mouseDataList datalist; + + ioMouseGetDataList(0, &datalist); + + for (i = 0; i < datalist.count; i++) { + u8 old_left = mouse_buttons & 1; + u8 new_left = datalist.list[i].buttons & 1; + u8 old_right = mouse_buttons & 2; + u8 new_right = datalist.list[i].buttons & 2; + u8 old_middle = mouse_buttons & 4; + u8 new_middle = datalist.list[i].buttons & 4; + + mouse_x += datalist.list[i].x_axis; + mouse_y += datalist.list[i].y_axis; + if (mouse_x < 0) mouse_x = 0; + if (mouse_y < 0) mouse_y = 0; + if (mouse_x > window_width) mouse_x = window_width; + if (mouse_y > window_height) mouse_x = window_height; + + evas_event_feed_mouse_move(evas, mouse_x, mouse_y, 0, NULL); + + if (old_left != new_left) + { + if (new_left) + evas_event_feed_mouse_down(evas, 1, EVAS_BUTTON_NONE, 0, NULL); + else + evas_event_feed_mouse_up(evas, 1, EVAS_BUTTON_NONE, 0, NULL); + } + if (old_right != new_right) + { + if (new_right) + evas_event_feed_mouse_down(evas, 3, EVAS_BUTTON_NONE, 0, NULL); + else + evas_event_feed_mouse_up(evas, 3, EVAS_BUTTON_NONE, 0, NULL); + } + if (old_middle != new_middle) + { + if (new_middle) + evas_event_feed_mouse_down(evas, 2, EVAS_BUTTON_NONE, 0, NULL); + else + evas_event_feed_mouse_up(evas, 2, EVAS_BUTTON_NONE, 0, NULL); + } + mouse_buttons = datalist.list[i].buttons; + } + } + + /* Check keyboard events */ + ioKbGetInfo(&kbInfo); + + if (kbInfo.status[0] == 1 && !keyboard_connected) + { + /* Connected */ + keyboard_connected = true; + + // Old events in the queue are discarded + ioKbClearBuf(0); + keyboard_leds._KbLedU.leds = 0; + keyboard_mods._KbMkeyU.mkeys = 0; + keyboard_old_key = 0; + + // Set raw keyboard code types to get scan codes + ioKbSetCodeType(0, KB_CODETYPE_ASCII); + ioKbSetReadMode(0, KB_RMODE_INPUTCHAR); + } + else if (kbInfo.status[0] != 1 && keyboard_connected) + { + /* Disconnected keyboard */ + keyboard_connected = FALSE; + } + + if (keyboard_connected) + { + KbData Keys; + + // Read data from the keyboard buffer + if (ioKbRead(0, &Keys) == 0 && Keys.nb_keycode > 0) + { + if (Keys.mkey._KbMkeyU._KbMkeyS.l_shift != + keyboard_mods._KbMkeyU._KbMkeyS.l_shift || + Keys.mkey._KbMkeyU._KbMkeyS.r_shift != + keyboard_mods._KbMkeyU._KbMkeyS.r_shift) + { + if (Keys.mkey._KbMkeyU._KbMkeyS.r_shift || + Keys.mkey._KbMkeyU._KbMkeyS.l_shift) + evas_key_modifier_on(evas, "Shift"); + else + evas_key_modifier_off(evas, "Shift"); + } + if (Keys.mkey._KbMkeyU._KbMkeyS.l_ctrl != + keyboard_mods._KbMkeyU._KbMkeyS.l_ctrl || + Keys.mkey._KbMkeyU._KbMkeyS.r_ctrl != + keyboard_mods._KbMkeyU._KbMkeyS.r_ctrl) + { + if (Keys.mkey._KbMkeyU._KbMkeyS.r_ctrl || + Keys.mkey._KbMkeyU._KbMkeyS.l_ctrl) + evas_key_modifier_on(evas, "Control"); + else + evas_key_modifier_off(evas, "Control"); + } + if (Keys.mkey._KbMkeyU._KbMkeyS.l_alt != + keyboard_mods._KbMkeyU._KbMkeyS.l_alt || + Keys.mkey._KbMkeyU._KbMkeyS.r_alt != + keyboard_mods._KbMkeyU._KbMkeyS.r_alt) + { + if (Keys.mkey._KbMkeyU._KbMkeyS.r_alt || + Keys.mkey._KbMkeyU._KbMkeyS.l_alt) + evas_key_modifier_on(evas, "Alt"); + else + evas_key_modifier_off(evas, "Alt"); + } + if (Keys.mkey._KbMkeyU._KbMkeyS.l_win != + keyboard_mods._KbMkeyU._KbMkeyS.l_win || + Keys.mkey._KbMkeyU._KbMkeyS.r_win != + keyboard_mods._KbMkeyU._KbMkeyS.r_win) + { + if (Keys.mkey._KbMkeyU._KbMkeyS.r_win || + Keys.mkey._KbMkeyU._KbMkeyS.l_win) + evas_key_modifier_on(evas, "Super"); + else + evas_key_modifier_off(evas, "Super"); + } + keyboard_mods = Keys.mkey; + + if (Keys.led._KbLedU._KbLedS.num_lock != + keyboard_leds._KbLedU._KbLedS.num_lock) + { + if (Keys.led._KbLedU._KbLedS.num_lock) + evas_key_lock_on(evas, "Num_Lock"); + else + evas_key_lock_on(evas, "Num_Lock"); + } + if (Keys.led._KbLedU._KbLedS.caps_lock != + keyboard_leds._KbLedU._KbLedS.caps_lock) + { + if (Keys.led._KbLedU._KbLedS.caps_lock) + evas_key_lock_on(evas, "Caps_Lock"); + else + evas_key_lock_on(evas, "Caps_Lock"); + } + if (Keys.led._KbLedU._KbLedS.scroll_lock != + keyboard_leds._KbLedU._KbLedS.scroll_lock) + { + if (Keys.led._KbLedU._KbLedS.scroll_lock) + evas_key_lock_on(evas, "Scroll_Lock"); + else + evas_key_lock_on(evas, "Scroll_Lock"); + } + keyboard_leds = Keys.led; + + for (i = 0; i < Keys.nb_keycode; i++) { + if (Keys.keycode[i] != keyboard_old_key) + { + u16 key = Keys.keycode[i]; + char *key_str = NULL; + + if (key == 0) + key = keyboard_old_key; + key_str = (char *)&key; + + printf ("Key %d is %X\n", i, key); + key &= ~KB_KEYPAD; + if (key & KB_RAWDAT) + { + key &= 0xFF; + if (key == KB_RAWKEY_ESCAPE) + key_str = "Escape"; + else if (key == KB_RAWKEY_ENTER) + key_str = "Return"; + else if (key == KB_RAWKEY_UP_ARROW) + key_str = "Up"; + else if (key == KB_RAWKEY_DOWN_ARROW) + key_str = "Down"; + else if (key == KB_RAWKEY_LEFT_ARROW) + key_str = "Left"; + else if (key == KB_RAWKEY_RIGHT_ARROW) + key_str = "Right"; + else + key_str = NULL; + } + else { + if (key == 0x0A) + key_str = "Return"; + else { + key_str[0] = key_str[1]; + key_str[1] = 0; + } + } + if (key_str) + { + if (Keys.keycode[i] != 0) + { + printf ("Key %s pressed\n", key_str); + evas_event_feed_key_up(evas, key_str, key_str, NULL, NULL, 0, NULL); + } + else { + evas_event_feed_key_down(evas, key_str, key_str, NULL, NULL, 0, NULL); + printf ("Key %s released\n", key_str); + } + } + keyboard_old_key = Keys.keycode[0]; + } + } + } + } + return; +} + +void +engine_psl1ght_shutdown(void) +{ + ioMouseEnd(); + ioKbEnd(); + return; +} + diff --git a/src/bin/engine_psl1ght.h b/src/bin/engine_psl1ght.h new file mode 100644 index 0000000..69610c5 --- /dev/null +++ b/src/bin/engine_psl1ght.h @@ -0,0 +1,8 @@ +#ifndef ENGINE_SOFTWARE_PSL1GHT_H +#define ENGINE_SOFTWARE_PSL1GHT_H + +Eina_Bool engine_psl1ght_args(const char *engine, int width, int height); +void engine_psl1ght_loop(void); +void engine_psl1ght_shutdown(void); + +#endif diff --git a/src/bin/engine_quartz.h b/src/bin/engine_quartz.h new file mode 100644 index 0000000..434c5d3 --- /dev/null +++ b/src/bin/engine_quartz.h @@ -0,0 +1,8 @@ +#ifndef ENGINE_QUARTZ_H +#define ENGINE_QUARTZ_H + +Eina_Bool engine_quartz_args(const char *engine, int width, int height); +void engine_quartz_loop(void); +void engine_quartz_shutdown(void); + +#endif diff --git a/src/bin/engine_quartz.m b/src/bin/engine_quartz.m new file mode 100644 index 0000000..8eaed60 --- /dev/null +++ b/src/bin/engine_quartz.m @@ -0,0 +1,254 @@ +/* NOTE: If you're using Expedite for performance testing, + set "Disable Beam Synchronization" in Quartz Debug. */ + +#include "main.h" + +#include +#include + +@interface EvasView : NSView +{ + CGContextRef ctx; +} +@end + +static EvasView * evas_view; +static NSWindow * main_window; + +@implementation EvasView + +- (id) init +{ + self = [super init]; + if (self != nil) + { + ctx = NULL; + } + return self; +} + +- (void)drawRect:(NSRect)rect +{ + if(ctx != NULL) + { + evas_damage_rectangle_add(evas, 0, 0, win_w, win_h); + return; + } + + ctx = [[NSGraphicsContext currentContext] graphicsPort]; + CGContextRetain(ctx); +} + +- (CGContextRef)context +{ + return ctx; +} + +@end + +Eina_Bool +engine_quartz_args(const char *engine, int width, int height) +{ + Evas_Engine_Info_Quartz *einfo; + int i; + + evas_output_method_set(evas, evas_render_method_lookup("quartz")); + einfo = (Evas_Engine_Info_Quartz *)evas_engine_info_get(evas); + if (!einfo) + { + printf("Evas does not support the Quartz Engine\n"); + return EINA_FALSE; + } + + // Set up the Cocoa runtime + [[NSAutoreleasePool alloc] init]; + [NSApplication sharedApplication]; + + // Register ourselves as a full-fledged Cocoa app, instead of a NSUIElement. + // This gives benefits like window focus and a dock icon! + ProcessSerialNumber psn = { 0, kCurrentProcess }; + TransformProcessType (&psn, kProcessTransformToForegroundApplication); + + [NSApp finishLaunching]; + + // Create our main window, and embed an EvasView in it + main_window = [[NSWindow alloc] initWithContentRect:NSMakeRect(20,500,width,height) styleMask:(NSTitledWindowMask | NSClosableWindowMask | NSResizableWindowMask | NSMiniaturizableWindowMask) backing:NSBackingStoreBuffered defer:NO screen:nil]; + [main_window makeKeyAndOrderFront:NSApp]; + [main_window setTitle:@"Expedite"]; + [main_window makeMainWindow]; + [main_window setAcceptsMouseMovedEvents:YES]; + [NSApp activateIgnoringOtherApps:YES]; + + evas_view = [[EvasView alloc] initWithFrame:NSMakeRect(0,0,width,height)]; + [[main_window contentView] addSubview:evas_view]; + + // drawRect: must be run at least once, to make sure we've set ctx + [evas_view display]; + + evas_output_size_set(evas, width, height); + evas_output_viewport_set(evas, 0, 0, width, height); + + einfo->info.context = [evas_view context]; + if (!evas_engine_info_set(evas, (Evas_Engine_Info *) einfo)) + { + printf("Evas can not setup the informations of the Quartz Engine\n"); + return EINA_FALSE; + } + + return EINA_TRUE; +} + +void +engine_quartz_loop(void) +{ + NSDate *date = [NSDate dateWithTimeIntervalSinceNow:0.001]; + + NSEvent *event = [NSApp nextEventMatchingMask:NSAnyEventMask + untilDate:date + inMode:NSDefaultRunLoopMode + dequeue:YES]; + [date release]; + + if (!event) return; + + if([event type] == NSMouseMoved || [event type] == NSLeftMouseDragged || [event type] == NSRightMouseDragged) + { + evas_event_feed_mouse_move(evas, [event locationInWindow].x, [event locationInWindow].y, 0, NULL); + + // Also notify on entering or leaving the window + NSPoint mouseLoc = [[event window] convertBaseToScreen:[event locationInWindow]]; + + if(NSPointInRect(mouseLoc, [[event window] frame])) + evas_event_feed_mouse_in(evas, 0, NULL); + else + evas_event_feed_mouse_out(evas, 0, NULL); + + [NSApp sendEvent:event]; + } + else if([event type] == NSLeftMouseDown) + { + evas_event_feed_mouse_move(evas, [event locationInWindow].x, [event locationInWindow].y, 0, NULL); + evas_event_feed_mouse_down(evas, 1, EVAS_BUTTON_NONE, 0, NULL); + + [NSApp sendEvent:event]; + } + else if([event type] == NSLeftMouseUp) + { + evas_event_feed_mouse_move(evas, [event locationInWindow].x, [event locationInWindow].y, 0, NULL); + evas_event_feed_mouse_up(evas, 1, EVAS_BUTTON_NONE, 0, NULL); + + [NSApp sendEvent:event]; + } + else if([event type] == NSRightMouseDown) + { + evas_event_feed_mouse_move(evas, [event locationInWindow].x, [event locationInWindow].y, 0, NULL); + evas_event_feed_mouse_down(evas, 3, EVAS_BUTTON_NONE, 0, NULL); + [NSApp sendEvent:event]; + } + else if([event type] == NSRightMouseUp) + { + evas_event_feed_mouse_move(evas, [event locationInWindow].x, [event locationInWindow].y, 0, NULL); + evas_event_feed_mouse_up(evas, 3, EVAS_BUTTON_NONE, 0, NULL); + [NSApp sendEvent:event]; + } + else if([event type] == NSKeyDown) + { + NSString * chars = [event charactersIgnoringModifiers]; + + switch([chars characterAtIndex:0]) + { + case NSLeftArrowFunctionKey: + evas_event_feed_key_down(evas, "Left", "Left", NULL, NULL, 0, NULL); + break; + case NSRightArrowFunctionKey: + evas_event_feed_key_down(evas, "Right", "Right", NULL, NULL, 0, NULL); + break; + case NSEnterCharacter: + case NSCarriageReturnCharacter: + evas_event_feed_key_down(evas, "Return", "Return", NULL, NULL, 0, NULL); + break; + case 's': + case '\e': + evas_event_feed_key_down(evas, "Escape", "Escape", NULL, NULL, 0, NULL); + break; + case 'q': + evas_event_feed_key_down(evas, "q", "q", NULL, NULL, 0, NULL); + break; + } + + [chars release]; + } + else if([event type] == NSKeyUp) + { + NSString * chars = [event charactersIgnoringModifiers]; + + switch([chars characterAtIndex:0]) + { + case NSLeftArrowFunctionKey: + evas_event_feed_key_up(evas, "Left", "Left", NULL, NULL, 0, NULL); + break; + case NSRightArrowFunctionKey: + evas_event_feed_key_up(evas, "Right", "Right", NULL, NULL, 0, NULL); + break; + case NSEnterCharacter: + case NSCarriageReturnCharacter: + evas_event_feed_key_up(evas, "Return", "Return", NULL, NULL, 0, NULL); + break; + case '\e': + evas_event_feed_key_up(evas, "Escape", "Escape", NULL, NULL, 0, NULL); + break; + case 'q': + if (evas_key_lock_is_set(evas_key_lock_get(evas), "Caps_Lock")) + evas_event_feed_key_up(evas, "Q", "Q", NULL, NULL, 0, NULL); + else + evas_event_feed_key_up(evas, "q", "q", NULL, NULL, 0, NULL); + break; + } + + [chars release]; + } + else if([event type] == NSFlagsChanged) + { + int flags = [event modifierFlags]; + + // Turn special key flags on + if(flags & NSShiftKeyMask) + evas_key_modifier_on(evas, "Shift"); + else if(flags & NSControlKeyMask) + evas_key_modifier_on(evas, "Control"); + else if(flags & NSAlternateKeyMask) + evas_key_modifier_on(evas, "Alt"); + else if(flags & NSCommandKeyMask) + evas_key_modifier_on(evas, "Super"); + else if(flags & NSAlphaShiftKeyMask) + { + if (evas_key_lock_is_set(evas_key_lock_get(evas), "Caps_Lock")) + evas_key_lock_off(evas, "Caps_Lock"); + else + evas_key_lock_on(evas, "Caps_Lock"); + } + + // Turn special key flags off + if(!(flags & NSShiftKeyMask)) + evas_key_modifier_off(evas, "Shift"); + else if(!(flags & NSControlKeyMask)) + evas_key_modifier_off(evas, "Control"); + else if(!(flags & NSAlternateKeyMask)) + evas_key_modifier_off(evas, "Alt"); + else if(!(flags & NSCommandKeyMask)) + evas_key_modifier_off(evas, "Super"); + } + else + { + [NSApp sendEvent:event]; + } + + [event release]; + [NSAutoreleasePool release]; +} + +void +engine_quartz_shutdown(void) +{ + /* If someone knows what to do here... */ +} diff --git a/src/bin/engine_software_16_wince.c b/src/bin/engine_software_16_wince.c index b58b55a..4506f2e 100644 --- a/src/bin/engine_software_16_wince.c +++ b/src/bin/engine_software_16_wince.c @@ -135,19 +135,46 @@ MainWndProc(HWND hwnd, if (_resume) _resume (backend); return 0; + case WM_SIZE: + { + Evas_Engine_Info_Software_16_WinCE *einfo; + + printf ("WM_SIZE %dx%d\n", LOWORD(lParam), HIWORD(lParam)); + einfo = (Evas_Engine_Info_Software_16_WinCE *)evas_engine_info_get(evas); + if (!einfo) + return 0; + + if (einfo->info.rotation != 0) + { + einfo->info.width = win_h; + einfo->info.height = win_w; + einfo->info.rotation = 90; + } + else + { + einfo->info.width = win_w; + einfo->info.height = win_h; + einfo->info.rotation = 0; + } + + evas_engine_info_set(evas, (Evas_Engine_Info *)einfo); + + return 0; + } default: return DefWindowProc(hwnd, uMsg, wParam, lParam); } } -int -engine_software_16_wince_args(int argc, char **argv) +Eina_Bool +engine_software_16_wince_args(const char *engine, int width, int height) { WNDCLASS wc; RECT rect; Evas_Engine_Info_Software_16_WinCE *einfo; - int width; - int height; + HWND task_bar; + HWND sip_window; + HWND sip_icon; int stride_x; int stride_y; int bpp; @@ -156,21 +183,15 @@ engine_software_16_wince_args(int argc, char **argv) int ok = 0; int i; - for (i = 1; i < argc; i++) - { - if ((!strcmp(argv[i], "-e")) && (i < (argc - 1))) - { - i++; - if (!strcmp(argv[i], "wince")) ok = 1; - if (!strcmp(argv[i], "wince-fb")) { ok = 1; backend = 1; } - if (!strcmp(argv[i], "wince-gapi")) { ok = 1; backend = 2; } - if (!strcmp(argv[i], "wince-ddraw")) { ok = 1; backend = 3; } - } - } - if (!ok) return 0; + if (!strcmp(engine, "wince")) ok = 1; + if (!strcmp(engine, "wince-fb")) { ok = 1; backend = 1; } + if (!strcmp(engine, "wince-gapi")) { ok = 1; backend = 2; } + if (!strcmp(engine, "wince-ddraw")) { ok = 1; backend = 3; } + if (!strcmp(engine, "wince-gdi")) { ok = 1; backend = 4; } + if (!ok) return EINA_FALSE; instance = GetModuleHandle(NULL); - if (!instance) return 0; + if (!instance) return EINA_FALSE; memset (&wc, 0, sizeof (wc)); wc.style = CS_HREDRAW | CS_VREDRAW; @@ -185,10 +206,7 @@ engine_software_16_wince_args(int argc, char **argv) wc.lpszClassName = L"Evas_Software_16_WinCE_Test"; if(!RegisterClass(&wc)) - { - FreeLibrary(instance); - return 0; - } + goto free_library; SetRect(&rect, 0, 0, GetSystemMetrics(SM_CXSCREEN), @@ -203,40 +221,41 @@ engine_software_16_wince_args(int argc, char **argv) rect.bottom - rect.top, NULL, NULL, instance, NULL); if (!window) - { - UnregisterClass(L"Evas_Software_16_WinCE_Test", instance); - FreeLibrary(instance); - return 0; - } - - SHFullScreen(window, - SHFS_HIDETASKBAR | SHFS_HIDESTARTICON | SHFS_HIDESIPBUTTON); + goto unregister_class; + + /* hide top level windows (Task bar, SIP and SIP button */ + task_bar = FindWindow(L"HHTaskBar", NULL); + ShowWindow(task_bar, SW_HIDE); + EnableWindow(task_bar, FALSE); + sip_window = FindWindow(L"SipWndClass", NULL); + ShowWindow(sip_window, SW_HIDE); + EnableWindow(sip_window, FALSE); + sip_icon = FindWindow(L"MS_SIPBUTTON", NULL); + ShowWindow(sip_icon, SW_HIDE); + EnableWindow(sip_icon, FALSE); if (!_wince_hardware_keys_register(window)) - { - DestroyWindow(window); - UnregisterClass(L"Evas_Software_16_WinCE_Test", instance); - FreeLibrary(instance); - return 0; - } + goto destroy_window; evas_output_method_set(evas, evas_render_method_lookup("software_16_wince")); + einfo = (Evas_Engine_Info_Software_16_WinCE *)evas_engine_info_get(evas); if (!einfo) { printf("Evas does not support the 16bit Software WinCE Engine\n"); - DestroyWindow(window); - UnregisterClass(L"Evas_Software_16_WinCE_Test", instance); - FreeLibrary(instance); - return 0; + goto destroy_window; } einfo->info.window = window; - einfo->info.width = win_w; - einfo->info.height = win_h; + einfo->info.width = width; + einfo->info.height = height; einfo->info.backend = backend; einfo->info.rotation = 0; - evas_engine_info_set(evas, (Evas_Engine_Info *)einfo); + if (!evas_engine_info_set(evas, (Evas_Engine_Info *) einfo)) + { + printf("Evas can not setup the informations of the 16 bits Software WinCE Engine\n"); + goto destroy_window; + } _suspend = einfo->func.suspend; _resume = einfo->func.resume; @@ -245,7 +264,22 @@ engine_software_16_wince_args(int argc, char **argv) ShowWindow(window, SW_SHOWDEFAULT); UpdateWindow(window); - return 1; + return EINA_TRUE; + + destroy_window: + DestroyWindow(window); + ShowWindow(task_bar, SW_SHOW); + EnableWindow(task_bar, TRUE); + ShowWindow(sip_window, SW_SHOW); + EnableWindow(sip_window, TRUE); + ShowWindow(sip_icon, SW_SHOW); + EnableWindow(sip_icon, TRUE); + unregister_class: + UnregisterClass(L"Evas_Software_16_WinCE_Test", instance); + free_library: + FreeLibrary(instance); + + return EINA_FALSE; } void @@ -264,3 +298,27 @@ engine_software_16_wince_loop(void) goto again; } + +void +engine_software_16_wince_shutdown(void) +{ + HWND task_bar; + HWND sip_window; + HWND sip_icon; + + DestroyWindow(window); + + /* show top level windows (Task bar, SIP and SIP button */ + task_bar = FindWindow(L"HHTaskBar", NULL); + ShowWindow(task_bar, SW_SHOW); + EnableWindow(task_bar, TRUE); + sip_window = FindWindow(L"SipWndClass", NULL); + ShowWindow(sip_window, SW_SHOW); + EnableWindow(sip_window, TRUE); + sip_icon = FindWindow(L"MS_SIPBUTTON", NULL); + ShowWindow(sip_icon, SW_SHOW); + EnableWindow(sip_icon, TRUE); + + UnregisterClass(L"Evas_Software_16_WinCE_Test", instance); + FreeLibrary(instance); +} diff --git a/src/bin/engine_software_16_wince.h b/src/bin/engine_software_16_wince.h index f78e0a2..10be16c 100644 --- a/src/bin/engine_software_16_wince.h +++ b/src/bin/engine_software_16_wince.h @@ -2,8 +2,9 @@ #define __ENGINE_SOFTWARE_16_WINCE_H__ -int engine_software_16_wince_args(int argc, char **argv); +Eina_Bool engine_software_16_wince_args(const char *engine, int width, int height); void engine_software_16_wince_loop(void); +void engine_software_16_wince_shutdown(void); #endif /* __ENGINE_SOFTWARE_16_WINCE_H__ */ diff --git a/src/bin/engine_software_16_wince.rc b/src/bin/engine_software_16_wince.rc new file mode 100644 index 0000000..2a185cd --- /dev/null +++ b/src/bin/engine_software_16_wince.rc @@ -0,0 +1 @@ +HI_RES_AWARE CEUX {1} diff --git a/src/bin/engine_software_16_x11.c b/src/bin/engine_software_16_x11.c index a0a516c..df2fa14 100644 --- a/src/bin/engine_software_16_x11.c +++ b/src/bin/engine_software_16_x11.c @@ -2,40 +2,31 @@ #include #include +#include #include static Display *disp = NULL; static Window win = 0; +static int first_expose = 0; -int -engine_software_16_x11_args(int argc, char **argv) +Eina_Bool +engine_software_16_x11_args(const char *engine, int width, int height) { XSetWindowAttributes attr; XClassHint chint; XSizeHints szhints; Evas_Engine_Info_Software_16_X11 *einfo; int i; - int ok = 0; - - for (i = 1; i < argc; i++) - { - if ((!strcmp(argv[i], "-e")) && (i < (argc - 1))) - { - i++; - if (!strcmp(argv[i], "x11-16")) ok = 1; - } - } - if (!ok) return 0; disp = XOpenDisplay(NULL); - if (!disp) return 0; + if (!disp) return EINA_FALSE; evas_output_method_set(evas, evas_render_method_lookup("software_16_x11")); einfo = (Evas_Engine_Info_Software_16_X11 *)evas_engine_info_get(evas); if (!einfo) { printf("Evas does not support the Software 16bit X11 Engine\n"); - return 0; + goto close_display; } einfo->info.display = disp; @@ -49,27 +40,52 @@ engine_software_16_x11_args(int argc, char **argv) KeyPressMask | KeyReleaseMask; attr.bit_gravity = ForgetGravity; win = XCreateWindow(disp, DefaultRootWindow(disp), - 0, 0, win_w, win_h, 0, + 0, 0, width, height, 0, DefaultDepth(disp, DefaultScreen(disp)), InputOutput, DefaultVisual(disp, DefaultScreen(disp)), CWBackingStore | CWColormap | CWBackPixmap | CWBorderPixel | CWBitGravity | CWEventMask, &attr); + if (!win) + goto close_display; + einfo->info.drawable = win; - evas_engine_info_set(evas, (Evas_Engine_Info *) einfo); + if (!evas_engine_info_set(evas, (Evas_Engine_Info *) einfo)) + { + printf("Evas can not setup the informations of the Software 16bit X11 Engine\n"); + goto destroy_window; + } + if (fullscreen) + { + Atom prop = XInternAtom(disp, "_NET_WM_STATE", False); + Atom state = XInternAtom(disp, "_NET_WM_STATE_FULLSCREEN", False); + unsigned long data = state; + XChangeProperty(disp, win, prop, XA_ATOM, 32, PropModeReplace, + (unsigned char*) &data, 1); + } + XStoreName(disp, win, "Expedite - Evas Test Suite"); chint.res_name = "expedite"; chint.res_class = "Expedite"; XSetClassHint(disp, win, &chint); szhints.flags = PMinSize | PMaxSize | PSize | USSize; - szhints.min_width = szhints.max_width = win_w; - szhints.min_height = szhints.max_height = win_h; + szhints.min_width = szhints.max_width = width; + szhints.min_height = szhints.max_height = height; XSetWMNormalHints(disp, win, &szhints); XMapWindow(disp, win); XSync(disp, False); - return 1; + while (!first_expose) + engine_software_16_x11_loop(); + return EINA_TRUE; + + destroy_window: + XDestroyWindow(disp, win); + close_display: + XCloseDisplay(disp); + + return EINA_FALSE; } void @@ -105,6 +121,7 @@ engine_software_16_x11_loop(void) evas_event_feed_mouse_move(evas, ev.xmotion.x, ev.xmotion.y, 0, NULL); break; case Expose: + first_expose = 1; evas_damage_rectangle_add(evas, ev.xexpose.x, ev.xexpose.y, @@ -112,9 +129,14 @@ engine_software_16_x11_loop(void) ev.xexpose.height); break; case ConfigureNotify: + evas_output_viewport_set(evas, 0, 0, + ev.xconfigure.width, + ev.xconfigure.height); evas_output_size_set(evas, ev.xconfigure.width, ev.xconfigure.height); + win_w = ev.xconfigure.width; + win_h = ev.xconfigure.height; break; case EnterNotify: evas_event_feed_mouse_in(evas, 0, NULL); @@ -188,3 +210,10 @@ engine_software_16_x11_loop(void) } goto again; } + +void +engine_software_16_x11_shutdown(void) +{ + XDestroyWindow(disp, win); + XCloseDisplay(disp); +} diff --git a/src/bin/engine_software_16_x11.h b/src/bin/engine_software_16_x11.h index 67f06a1..ae83725 100644 --- a/src/bin/engine_software_16_x11.h +++ b/src/bin/engine_software_16_x11.h @@ -1,7 +1,8 @@ #ifndef ENGINE_SOFTWARE_16_X11_H #define ENGINE_SOFTWARE_16_X11_H -int engine_software_16_x11_args(int argc, char **argv); +Eina_Bool engine_software_16_x11_args(const char *engine, int width, int height); void engine_software_16_x11_loop(void); +void engine_software_16_x11_shutdown(void); #endif diff --git a/src/bin/engine_software_ddraw.cpp b/src/bin/engine_software_ddraw.cpp index e39e409..c5ceb95 100644 --- a/src/bin/engine_software_ddraw.cpp +++ b/src/bin/engine_software_ddraw.cpp @@ -5,6 +5,7 @@ static HWND window; +static HINSTANCE instance; static LRESULT CALLBACK @@ -39,9 +40,14 @@ MainWndProc(HWND hwnd, { PRECT rect = (PRECT)lParam; + evas_output_viewport_set(evas, 0, 0, + rect->right - rect->left, + rect->bottom - rect->top); evas_output_size_set(evas, rect->right - rect->left, rect->bottom - rect->top); + win_w = rect->right - rect->left; + win_h = rect->bottom - rect->top; return 0; } case WM_RBUTTONDOWN: @@ -165,29 +171,17 @@ MainWndProc(HWND hwnd, } } -int -engine_software_ddraw_args(int argc, char **argv) +Eina_Bool +engine_software_ddraw_args(const char *engine, int width, int height) { WNDCLASS wc; RECT rect; - HINSTANCE instance; HDC dc; Evas_Engine_Info_Software_DDraw *einfo; DWORD style; DWORD exstyle; int depth; int i; - int ok = 0; - - for (i = 1; i < argc; i++) - { - if ((!strcmp(argv[i], "-e")) && (i < (argc - 1))) - { - i++; - if (!strcmp(argv[i], "ddraw")) ok = 1; - } - } - if (!ok) return 0; instance = GetModuleHandle(NULL); if (!instance) return 0; @@ -211,8 +205,8 @@ engine_software_ddraw_args(int argc, char **argv) rect.left = 0; rect.top = 0; - rect.right = win_w; - rect.bottom = win_h; + rect.right = width; + rect.bottom = height; AdjustWindowRectEx (&rect, style, FALSE, exstyle); window = CreateWindowEx(exstyle, @@ -229,7 +223,7 @@ engine_software_ddraw_args(int argc, char **argv) style = GetWindowLong(window, GWL_STYLE); style &= ~WS_THICKFRAME; if (!SetWindowLong(window, GWL_STYLE, style)) - goto unregister_class; + goto destroy_window; dc = GetDC(NULL); if (!dc) @@ -249,7 +243,11 @@ engine_software_ddraw_args(int argc, char **argv) einfo->info.window = window; einfo->info.depth = depth; einfo->info.rotation = 0; - evas_engine_info_set(evas, (Evas_Engine_Info *)einfo); + if (!evas_engine_info_set(evas, (Evas_Engine_Info *) einfo)) + { + printf("Evas can not setup the informations of the Software DirectDraw Engine\n"); + goto destroy_window; + } /* the second parameter is ignored, as it's the first call of ShowWindow */ ShowWindow(window, SW_SHOWDEFAULT); @@ -283,3 +281,11 @@ engine_software_ddraw_loop(void) goto again; } + +void +engine_software_ddraw_shutdown(void) +{ + DestroyWindow(window); + UnregisterClass("Evas_Software_DDraw_Test", instance); + FreeLibrary(instance); +} diff --git a/src/bin/engine_software_ddraw.h b/src/bin/engine_software_ddraw.h index aa58ba9..ec7e7c9 100644 --- a/src/bin/engine_software_ddraw.h +++ b/src/bin/engine_software_ddraw.h @@ -6,9 +6,9 @@ extern "C" { #endif - -int engine_software_ddraw_args(int argc, char **argv); +Eina_Bool engine_software_ddraw_args(const char *engine, int width, int height); void engine_software_ddraw_loop(void); +void engine_software_ddraw_shutdown(void); #ifdef __cplusplus diff --git a/src/bin/engine_software_gdi.c b/src/bin/engine_software_gdi.c new file mode 100644 index 0000000..92218b1 --- /dev/null +++ b/src/bin/engine_software_gdi.c @@ -0,0 +1,293 @@ +#include "main.h" + +#include +#include + + +static HWND window; +static HINSTANCE instance; + + +static LRESULT CALLBACK +MainWndProc(HWND hwnd, + UINT uMsg, + WPARAM wParam, + LPARAM lParam) +{ + switch (uMsg) + { + case WM_CREATE: + return 0; + case WM_DESTROY: + PostQuitMessage(0); + return 0; + case WM_CLOSE: + PostQuitMessage(0); + return 0; + case WM_WINDOWPOSCHANGED: { + PAINTSTRUCT ps; + HDC hdc; + + hdc = BeginPaint (window, &ps); + evas_damage_rectangle_add(evas, + ps.rcPaint.left, ps.rcPaint.top, + ps.rcPaint.right - ps.rcPaint.left, + ps.rcPaint.bottom - ps.rcPaint.top); + EndPaint(window, &ps); + return 0; + } + case WM_SIZING: + { + PRECT rect = (PRECT)lParam; + + evas_output_viewport_set(evas, 0, 0, + rect->right - rect->left, + rect->bottom - rect->top); + evas_output_size_set(evas, + rect->right - rect->left, + rect->bottom - rect->top); + win_w = rect->right - rect->left; + win_h = rect->bottom - rect->top; + return 0; + } + case WM_RBUTTONDOWN: + evas_event_feed_mouse_move(evas, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam), 0, NULL); + evas_event_feed_mouse_down(evas, 3, EVAS_BUTTON_NONE, 0, NULL); + return 0; + case WM_LBUTTONDOWN: + evas_event_feed_mouse_move(evas, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam), 0, NULL); + evas_event_feed_mouse_down(evas, 1, EVAS_BUTTON_NONE, 0, NULL); + return 0; + case WM_LBUTTONUP: + evas_event_feed_mouse_move(evas, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam), 0, NULL); + evas_event_feed_mouse_up(evas, 1, EVAS_BUTTON_NONE, 0, NULL); + return 0; + case WM_RBUTTONUP: + evas_event_feed_mouse_move(evas, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam), 0, NULL); + evas_event_feed_mouse_up(evas, 3, EVAS_BUTTON_NONE, 0, NULL); + return 0; + case WM_MOUSEMOVE: + if (!evas_pointer_inside_get(evas)) evas_event_feed_mouse_in(evas, 0, NULL); + evas_event_feed_mouse_move(evas, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam), 0, NULL); + return 0; + case WM_MOUSELEAVE: + evas_event_feed_mouse_out(evas, 0, NULL); + return 0; + /* FIXME : can't find an event when the mouse is entering */ + case WM_KEYDOWN: + case WM_SYSKEYDOWN: { + int key; + + key = LOWORD(wParam); + + if ((key == VK_SHIFT) || + (key == VK_LSHIFT) || + (key == VK_RSHIFT)) + evas_key_modifier_on(evas, "Shift"); + if ((key == VK_CONTROL) || + (key == VK_LCONTROL) || + (key == VK_RCONTROL)) + evas_key_modifier_on(evas, "Control"); + if ((key == VK_MENU) || + (key == VK_LMENU) || + (key == VK_RMENU)) + evas_key_modifier_on(evas, "Alt"); + if ((key == VK_LWIN) || + (key == VK_RWIN)) + evas_key_modifier_on(evas, "Super"); + + if (key == VK_CAPITAL) + { + if (evas_key_lock_is_set(evas_key_lock_get(evas), "Caps_Lock")) + evas_key_lock_off(evas, "Caps_Lock"); + else + evas_key_lock_on(evas, "Caps_Lock"); + } + if (key == VK_NUMLOCK) + { + if (evas_key_lock_is_set(evas_key_lock_get(evas), "Num_Lock")) + evas_key_lock_off(evas, "Num_Lock"); + else + evas_key_lock_on(evas, "Num_Lock"); + } + if (key == VK_SCROLL) + { + if (evas_key_lock_is_set(evas_key_lock_get(evas), "Scroll_Lock")) + evas_key_lock_off(evas, "Scroll_Lock"); + else + evas_key_lock_on(evas, "Scroll_Lock"); + } + if (key == VK_ESCAPE) + evas_event_feed_key_down(evas, "Escape", "Escape", NULL, NULL, 0, NULL); + if (key == VK_RETURN) + evas_event_feed_key_down(evas, "Return", "Return", NULL, NULL, 0, NULL); + if (key == VK_LEFT) + evas_event_feed_key_down(evas, "Left", "Left", NULL, NULL, 0, NULL); + if (key == VK_RIGHT) + evas_event_feed_key_down(evas, "Right", "Right", NULL, NULL, 0, NULL); + if (key == 81) + evas_event_feed_key_down(evas, "Q", "Q", NULL, NULL, 0, NULL); + if (key == 113) + evas_event_feed_key_down(evas, "q", "q", NULL, NULL, 0, NULL); + return 0; + } + case WM_KEYUP: + case WM_SYSKEYUP: { + int key; + + key = LOWORD(wParam); + + if ((key == VK_SHIFT) || + (key == VK_LSHIFT) || + (key == VK_RSHIFT)) + evas_key_modifier_off(evas, "Shift"); + if ((key == VK_CONTROL) || + (key == VK_LCONTROL) || + (key == VK_RCONTROL)) + evas_key_modifier_off(evas, "Control"); + if ((key == VK_MENU) || + (key == VK_LMENU) || + (key == VK_RMENU)) + evas_key_modifier_off(evas, "Alt"); + if ((key == VK_LWIN) || + (key == VK_RWIN)) + evas_key_modifier_off(evas, "Super"); + if (key == VK_ESCAPE) + evas_event_feed_key_up(evas, "Escape", "Escape", NULL, NULL, 0, NULL); + if (key == VK_RETURN) + evas_event_feed_key_up(evas, "Return", "Return", NULL, NULL, 0, NULL); + if (key == VK_LEFT) + evas_event_feed_key_up(evas, "Left", "Left", NULL, NULL, 0, NULL); + if (key == VK_RIGHT) + evas_event_feed_key_up(evas, "Right", "Right", NULL, NULL, 0, NULL); + if (key == 81) + evas_event_feed_key_up(evas, "Q", "Q", NULL, NULL, 0, NULL); + if (key == 113) + evas_event_feed_key_up(evas, "q", "q", NULL, NULL, 0, NULL); + return 0; + } + default: + return DefWindowProc(hwnd, uMsg, wParam, lParam); + } +} + +Eina_Bool +engine_software_gdi_args(const char *engine __UNUSED__, int width, int height) +{ + WNDCLASS wc; + RECT rect; + HDC dc; + Evas_Engine_Info_Software_Gdi *einfo; + DWORD style; + DWORD exstyle; + int depth; + + instance = GetModuleHandle(NULL); + if (!instance) return EINA_FALSE; + + wc.style = CS_HREDRAW | CS_VREDRAW; + wc.lpfnWndProc = MainWndProc; + wc.cbClsExtra = 0; + wc.cbWndExtra = 0; + wc.hInstance = instance; + wc.hIcon = LoadIcon(NULL, IDI_APPLICATION); + wc.hCursor = LoadCursor(NULL, IDC_ARROW); + wc.hbrBackground = GetSysColorBrush(COLOR_BTNFACE); + wc.lpszMenuName = NULL; + wc.lpszClassName = "Evas_Software_Gdi_Test"; + + if(!RegisterClass(&wc)) + goto free_library; + + style = WS_OVERLAPPEDWINDOW | WS_SIZEBOX; + exstyle = 0; + + rect.left = 0; + rect.top = 0; + rect.right = width; + rect.bottom = height; + AdjustWindowRectEx (&rect, style, FALSE, exstyle); + + window = CreateWindowEx(exstyle, + "Evas_Software_Gdi_Test", + "Evas_Software_Gdi_Test", + style, + CW_USEDEFAULT, CW_USEDEFAULT, + rect.right - rect.left, rect.bottom - rect.top, + NULL, NULL, instance, NULL); + if (!window) + goto destroy_window; + + /* make the window non resizable */ + style = GetWindowLong(window, GWL_STYLE); + style &= ~WS_THICKFRAME; + if (!SetWindowLong(window, GWL_STYLE, style)) + goto unregister_class; + + dc = GetDC(NULL); + if (!dc) + goto destroy_window; + + depth = GetDeviceCaps(dc, BITSPIXEL); + ReleaseDC(NULL, dc); + + evas_output_method_set(evas, evas_render_method_lookup("software_gdi")); + einfo = (Evas_Engine_Info_Software_Gdi *)evas_engine_info_get(evas); + if (!einfo) + { + fprintf(stderr, "Evas does not support the Software GDI Engine\n"); + goto destroy_window; + } + + einfo->info.window = window; + einfo->info.depth = depth; + einfo->info.rotation = 0; + einfo->info.borderless = 0; + einfo->info.fullscreen = 0; + einfo->info.region = 0; + if (!evas_engine_info_set(evas, (Evas_Engine_Info *) einfo)) + { + printf("Evas can not setup the informations of the Software GDI Engine\n"); + goto destroy_window; + } + + /* the second parameter is ignored, as it's the first call of ShowWindow */ + ShowWindow(window, SW_SHOWDEFAULT); + UpdateWindow(window); + + return EINA_TRUE; + + destroy_window: + DestroyWindow(window); + unregister_class: + UnregisterClass("Evas_Software_Gdi_Test", instance); + free_library: + FreeLibrary(instance); + + return EINA_FALSE; +} + +void +engine_software_gdi_loop(void) +{ + MSG msg; + int res; + + again: + if (!PeekMessage (&msg, window, 0, 0, PM_NOREMOVE)) + return; + + res = GetMessage (&msg, NULL, 0, 0); + TranslateMessage (&msg); + DispatchMessage (&msg); + + goto again; +} + +void +engine_software_gdi_shutdown(void) +{ + DestroyWindow(window); + UnregisterClass("Evas_Software_Gdi_Test", instance); + FreeLibrary(instance); +} diff --git a/src/bin/engine_software_gdi.h b/src/bin/engine_software_gdi.h new file mode 100644 index 0000000..47bd58a --- /dev/null +++ b/src/bin/engine_software_gdi.h @@ -0,0 +1,19 @@ +#ifndef __ENGINE_SOFTWARE_GDI_H__ +#define __ENGINE_SOFTWARE_GDI_H__ + + +#ifdef __cplusplus +extern "C" { +#endif + +Eina_Bool engine_software_gdi_args(const char *engine, int width, int height); +void engine_software_gdi_loop(void); +void engine_software_gdi_shutdown(void); + + +#ifdef __cplusplus +} +#endif + + +#endif /* __ENGINE_SOFTWARE_GDI_H__ */ diff --git a/src/bin/engine_software_sdl.c b/src/bin/engine_software_sdl.c index 188daf7..a786d9f 100644 --- a/src/bin/engine_software_sdl.c +++ b/src/bin/engine_software_sdl.c @@ -2,45 +2,75 @@ #include "main.h" #include -#include +#include -int -engine_software_sdl_args(int argc, char **argv) +static void * +_expedite_sdl_switch_buffer(void *data, void *dest __UNUSED__) { - Evas_Engine_Info_SDL *einfo; - int i; - int ok = 0; + SDL_Flip(data); + return ((SDL_Surface*)data)->pixels; +} + +Eina_Bool +engine_software_sdl_args(const char *engine, int width, int height) +{ + int ok = 0; + + if (!strcmp(engine, "sdl")) ok = 1; + if (!ok) return EINA_FALSE; - for (i = 1; i < argc; ++i) + if (ok == 1) { - if ((!strcmp(argv[i], "-e") && (i < (argc - 1)))) + Evas_Engine_Info_Buffer *einfo; + + evas_output_method_set(evas, evas_render_method_lookup("buffer")); + + einfo = (Evas_Engine_Info_Buffer *) evas_engine_info_get(evas); + if (einfo) { - i++; - if (!strcmp(argv[i], "sdl")) ok = 1; - if (!strcmp(argv[i], "sdl-16")) ok = 2; - } - } - if (!ok) return 0; + SDL_Init(SDL_INIT_NOPARACHUTE); - if (ok == 1) - evas_output_method_set(evas, evas_render_method_lookup("software_sdl")); - else - evas_output_method_set(evas, evas_render_method_lookup("software_16_sdl")); + if (SDL_InitSubSystem(SDL_INIT_VIDEO) < 0) + { + printf("SDL_Init failed with %s", SDL_GetError()); + SDL_Quit(); + return EINA_FALSE; + } - einfo = (Evas_Engine_Info_SDL *) evas_engine_info_get(evas); + einfo->info.depth_type = EVAS_ENGINE_BUFFER_DEPTH_RGB32; + einfo->info.switch_data = SDL_SetVideoMode(width, height, 32, SDL_HWSURFACE | SDL_DOUBLEBUF); + if (!einfo->info.switch_data) + { + printf("SDL_SetVideoMode failed !"); + return EINA_FALSE; + } - /* the following is specific to the engine */ - einfo->info.fullscreen = 0; - einfo->info.noframe = 0; + SDL_SetAlpha(einfo->info.switch_data, SDL_SRCALPHA, 0); + SDL_FillRect(einfo->info.switch_data, NULL, 0); - evas_engine_info_set(evas, (Evas_Engine_Info *) einfo); - return 1; + einfo->info.dest_buffer = ((SDL_Surface*)einfo->info.switch_data)->pixels; + einfo->info.dest_buffer_row_bytes = width * sizeof (int); + einfo->info.use_color_key = 0; + einfo->info.alpha_threshold = 0; + einfo->info.func.new_update_region = NULL; + einfo->info.func.free_update_region = NULL; + einfo->info.func.switch_buffer = _expedite_sdl_switch_buffer; + if (!evas_engine_info_set(evas, (Evas_Engine_Info *) einfo)) + { + printf("evas_engine_info_set() for engine 'sdl' with 'buffer' backend failed."); + return EINA_FALSE; + } + } + } + + return EINA_TRUE; } void engine_software_sdl_loop(void) { SDL_Event event; + int rmethod; while(SDL_PollEvent(&event)) { @@ -51,14 +81,48 @@ engine_software_sdl_loop(void) break; case SDL_MOUSEBUTTONDOWN: evas_event_feed_mouse_move(evas, event.button.x, event.button.y, 0, NULL); - evas_event_feed_mouse_down(evas, event.button.state, EVAS_BUTTON_NONE, 0, NULL); + evas_event_feed_mouse_down(evas, event.button.button, EVAS_BUTTON_NONE, 0, NULL); break; case SDL_MOUSEBUTTONUP: evas_event_feed_mouse_move(evas, event.button.x, event.button.y, 0, NULL); - evas_event_feed_mouse_up(evas, event.button.state, EVAS_BUTTON_NONE, 0, NULL); + evas_event_feed_mouse_up(evas, event.button.button, EVAS_BUTTON_NONE, 0, NULL); break; case SDL_VIDEORESIZE: - evas_output_size_set(evas, event.resize.w, event.resize.w); + rmethod = evas_output_method_get(evas); + if (rmethod == evas_render_method_lookup("buffer")) + { + Evas_Engine_Info_Buffer *einfo; + + einfo = (Evas_Engine_Info_Buffer *) evas_engine_info_get(evas); + if (einfo) + { + einfo->info.depth_type = EVAS_ENGINE_BUFFER_DEPTH_RGB32; + einfo->info.switch_data = SDL_SetVideoMode(event.resize.w, event.resize.h, 32, SDL_HWSURFACE | SDL_DOUBLEBUF); + if (!einfo->info.switch_data) + { + return ; + } + + SDL_SetAlpha(einfo->info.switch_data, SDL_SRCALPHA, 0); + SDL_FillRect(einfo->info.switch_data, NULL, 0); + + einfo->info.dest_buffer = ((SDL_Surface*)einfo->info.switch_data)->pixels; + einfo->info.dest_buffer_row_bytes = event.resize.w * sizeof (int); + einfo->info.use_color_key = 0; + einfo->info.alpha_threshold = 0; + einfo->info.func.new_update_region = NULL; + einfo->info.func.free_update_region = NULL; + einfo->info.func.switch_buffer = _expedite_sdl_switch_buffer; + if (!evas_engine_info_set(evas, (Evas_Engine_Info *) einfo)) + { + return ; + } + } + } + + evas_output_viewport_set(evas, 0, 0, + event.resize.h, event.resize.w); + evas_output_size_set(evas, event.resize.h, event.resize.w); evas_output_size_get(evas, &win_w, &win_h); break; case SDL_VIDEOEXPOSE: @@ -171,3 +235,8 @@ engine_software_sdl_loop(void) } } } + +void +engine_software_sdl_shutdown(void) +{ +} diff --git a/src/bin/engine_software_sdl.h b/src/bin/engine_software_sdl.h index 6bacf71..0641005 100644 --- a/src/bin/engine_software_sdl.h +++ b/src/bin/engine_software_sdl.h @@ -1,7 +1,8 @@ #ifndef ENGINE_SOFTWARE_SDL_H #define ENGINE_SOFTWARE_SDL_H -int engine_software_sdl_args(int argc, char **argv); +Eina_Bool engine_software_sdl_args(const char *engine, int width, int height); void engine_software_sdl_loop(void); +void engine_software_sdl_shutdown(void); #endif diff --git a/src/bin/engine_software_xcb.c b/src/bin/engine_software_xcb.c index afe6211..f1a8bbd 100644 --- a/src/bin/engine_software_xcb.c +++ b/src/bin/engine_software_xcb.c @@ -2,7 +2,7 @@ #include #include -#include +#include #define XK_MISCELLANY #include @@ -34,18 +34,19 @@ struct xcb_size_hints_t { static xcb_connection_t *conn = NULL; -static xcb_screen_t *screen = NULL; -static xcb_window_t win = 0; +static xcb_screen_t *screen = NULL; +static xcb_window_t win = 0; +static int first_expose = 0; -int -engine_software_xcb_args(int argc, char **argv) +Eina_Bool +engine_software_xcb_args(const char *engine, int width, int height) { struct xcb_size_hints_t hints; uint32_t value_list[6]; xcb_screen_iterator_t iter; - Evas_Engine_Info_Software_Xcb *einfo; + Evas_Engine_Info_Software_X11 *einfo; xcb_intern_atom_reply_t *reply; - char *str; + const char *str; xcb_intern_atom_cookie_t cookie1; xcb_intern_atom_cookie_t cookie2; xcb_intern_atom_cookie_t cookie3; @@ -58,45 +59,43 @@ engine_software_xcb_args(int argc, char **argv) xcb_atom_t wm_size_hint; uint32_t value_mask; int s; + int s_tmp; int l1; int l2; int i; - int ok = 0; - - for (i = 1; i < argc; i++) - { - if ((!strcmp(argv[i], "-e")) && (i < (argc - 1))) - { - i++; - if (!strcmp(argv[i], "xcb")) ok = 1; - } - } - if (!ok) return 0; conn = xcb_connect(NULL, &s); - if (!conn) return 0; + if (xcb_connection_has_error(conn)) return EINA_FALSE; + + cookie1 = xcb_intern_atom_unchecked(conn, 0, strlen("STRING"), "STRING"); + cookie2 = xcb_intern_atom_unchecked(conn, 0, strlen("WM_NAME"), "WM_NAME"); + cookie3 = xcb_intern_atom_unchecked(conn, 0, strlen("WM_CLASS"), "WM_CLASS"); + cookie4 = xcb_intern_atom_unchecked(conn, 0, strlen("WM_NORMAL_HINTS)"), "WM_NORMAL_HINTS)"); + cookie5 = xcb_intern_atom_unchecked(conn, 0, strlen("WM_SIZE_HINTS)"), "WM_SIZE_HINTS)"); + s_tmp = s; iter = xcb_setup_roots_iterator(xcb_get_setup(conn)); - for (; iter.rem; --s, xcb_screen_next (&iter)) - if (s == 0) + for (; iter.rem; --s_tmp, xcb_screen_next (&iter)) + if (s_tmp == 0) { screen = iter.data; break; } - evas_output_method_set(evas, evas_render_method_lookup("software_xcb")); - einfo = (Evas_Engine_Info_Software_Xcb *)evas_engine_info_get(evas); + evas_output_method_set(evas, evas_render_method_lookup("software_x11")); + einfo = (Evas_Engine_Info_Software_X11 *)evas_engine_info_get(evas); if (!einfo) { printf("Evas does not support the Software XCB Engine\n"); - return 0; + goto close_connection; } - einfo->info.conn = conn; + einfo->info.backend = EVAS_ENGINE_INFO_SOFTWARE_X11_BACKEND_XCB; + einfo->info.connection = conn; einfo->info.screen = screen; - einfo->info.visual = einfo->func.best_visual_get(screen); - einfo->info.colormap = einfo->func.best_colormap_get(screen); - einfo->info.depth = einfo->func.best_depth_get(screen); + einfo->info.visual = einfo->func.best_visual_get(1, conn, s); + einfo->info.colormap = einfo->func.best_colormap_get(1, conn, s); + einfo->info.depth = einfo->func.best_depth_get(1, conn, s); einfo->info.rotation = 0; einfo->info.debug = 0; @@ -117,30 +116,56 @@ engine_software_xcb_args(int argc, char **argv) value_list[5] = einfo->info.colormap; win = xcb_generate_id(conn); + if (!win) + goto close_connection; xcb_create_window(conn, einfo->info.depth, - win, screen->root, 0, 0, win_w, win_h, 0, + win, screen->root, 0, 0, width, height, 0, XCB_WINDOW_CLASS_INPUT_OUTPUT, - einfo->info.visual->visual_id, + ((xcb_visualtype_t *)einfo->info.visual)->visual_id, value_mask, value_list); einfo->info.drawable = win; - xcb_map_window(conn, win); - - evas_engine_info_set(evas, (Evas_Engine_Info *) einfo); + if (!evas_engine_info_set(evas, (Evas_Engine_Info *) einfo)) + { + printf("Evas can not setup the informations of the Software XCB Engine\n"); + goto destroy_window; + } + + if (fullscreen) + { + xcb_intern_atom_cookie_t cookie1; + xcb_intern_atom_cookie_t cookie2; + xcb_intern_atom_reply_t *reply; + xcb_atom_t prop; + xcb_atom_t type; + xcb_atom_t state; + + cookie1 = xcb_intern_atom_unchecked(conn, 0, strlen("_NET_WM_STATE"), "_NET_WM_STATE"); + cookie2 = xcb_intern_atom_unchecked(conn, 0, strlen("_NET_WM_STATE_FULLSCREEN"), "_NET_WM_STATE_FULLSCREEN"); + reply = xcb_intern_atom_reply(conn, cookie1, NULL); + prop = reply->atom; + free(reply); + reply = xcb_intern_atom_reply(conn, cookie2, NULL); + state = reply->atom; + free(reply); + xcb_change_property(conn, XCB_PROP_MODE_REPLACE, win, prop, XCB_ATOM_ATOM, 32, 1, (const void *)&state); + } -/* XStoreName(disp, win, "Expedite - Evas Test Suite"); */ + str = "expedite\0Expedite"; - cookie1 = xcb_intern_atom_unchecked(conn, 0, strlen("STRING"), "STRING"); - cookie2 = xcb_intern_atom_unchecked(conn, 0, strlen("WM_NAME"), "WM_NAME"); - cookie3 = xcb_intern_atom_unchecked(conn, 0, strlen("WM_CLASS"), "WM_CLASS"); - cookie4 = xcb_intern_atom_unchecked(conn, 0, strlen("WM_NORMAL_HINTS)"), "WM_NORMAL_HINTS)"); - cookie5 = xcb_intern_atom_unchecked(conn, 0, strlen("WM_SIZE_HINTS)"), "WM_SIZE_HINTS)"); + memset(&hints, 0, sizeof(hints)); + hints.flags = XCB_SIZE_US_SIZE_HINT | XCB_SIZE_P_SIZE_HINT | XCB_SIZE_P_MIN_SIZE_HINT | XCB_SIZE_P_MAX_SIZE_HINT; + hints.min_width = width; + hints.max_width = width; + hints.min_height = height; + hints.max_height = height; reply = xcb_intern_atom_reply(conn, cookie1, NULL); string = reply->atom; free(reply); + reply = xcb_intern_atom_reply(conn, cookie2, NULL); wm_name = reply->atom; free(reply); @@ -149,17 +174,6 @@ engine_software_xcb_args(int argc, char **argv) wm_name, string, 8, strlen("Expedite - Evas Test Suite"), "Expedite - Evas Test Suite"); -/* chint.res_name = "expedite"; */ -/* chint.res_class = "Expedite"; */ -/* XSetClassHint(disp, win, &chint); */ - - l1 = strlen("expedite"); - l2 = strlen("Expedite"); - str = (char *)malloc(l1 + l2 + 1); - memcpy(str, "expedite", l1); - str[l1] = '\0'; - memcpy(str + l1 + 1, "Expedite", l2); - reply = xcb_intern_atom_reply(conn, cookie3, NULL); wm_class = reply->atom; free(reply); @@ -167,19 +181,6 @@ engine_software_xcb_args(int argc, char **argv) xcb_change_property(conn, XCB_PROP_MODE_REPLACE, win, wm_class, string, 8, l1 + l2 + 1, str); - free(str); - -/* szhints.flags = PMinSize | PMaxSize | PSize | USSize; */ -/* szhints.min_width = szhints.max_width = win_w; */ -/* szhints.min_height = szhints.max_height = win_h; */ -/* XSetWMNormalHints(disp, win, &szhints); */ - - memset(&hints, 0, sizeof(hints)); - hints.flags = XCB_SIZE_US_SIZE_HINT | XCB_SIZE_P_SIZE_HINT | XCB_SIZE_P_MIN_SIZE_HINT | XCB_SIZE_P_MAX_SIZE_HINT; - hints.min_width = win_w; - hints.max_width = win_w; - hints.min_height = win_h; - hints.max_height = win_h; reply = xcb_intern_atom_reply(conn, cookie4, NULL); wm_normal_hint = reply->atom; @@ -193,9 +194,25 @@ engine_software_xcb_args(int argc, char **argv) wm_normal_hint, wm_size_hint, 32, sizeof(hints) / 4, &hints); - free(xcb_get_input_focus_reply(conn, xcb_get_input_focus_unchecked(conn), NULL)); + xcb_map_window(conn, win); - return 1; + free(xcb_get_input_focus_reply(conn, xcb_get_input_focus_unchecked(conn), NULL)); + + while (!first_expose) + engine_software_xcb_loop(); + return EINA_TRUE; + + destroy_window: + xcb_destroy_window(conn, win); + close_connection: + free(xcb_intern_atom_reply(conn, cookie1, NULL)); + free(xcb_intern_atom_reply(conn, cookie2, NULL)); + free(xcb_intern_atom_reply(conn, cookie3, NULL)); + free(xcb_intern_atom_reply(conn, cookie4, NULL)); + free(xcb_intern_atom_reply(conn, cookie5, NULL)); + xcb_disconnect(conn); + + return EINA_FALSE; } void @@ -245,6 +262,7 @@ engine_software_xcb_loop(void) e = (xcb_expose_event_t *)ev; + first_expose = 1; evas_damage_rectangle_add(evas, e->x, e->y, @@ -255,12 +273,17 @@ engine_software_xcb_loop(void) case XCB_CONFIGURE_NOTIFY: { xcb_configure_notify_event_t *e; - + e = (xcb_configure_notify_event_t *)ev; + evas_output_viewport_set(evas, 0, 0, + e->width, + e->height); evas_output_size_set(evas, e->width, e->height); + win_w = e->width; + win_h = e->height; break; } case XCB_ENTER_NOTIFY: @@ -274,7 +297,7 @@ engine_software_xcb_loop(void) xcb_key_press_event_t *e; xcb_key_symbols_t *kss; xcb_keysym_t ks; - char *str; + char *str = ""; e = (xcb_key_press_event_t *)ev; @@ -313,7 +336,7 @@ engine_software_xcb_loop(void) str = "Escape"; if (ks == XK_Return) str = "Return"; - if (ks == 71) + if (ks == 113) str = "q"; evas_event_feed_key_down(evas, str, str, NULL, NULL, 0, NULL); @@ -326,7 +349,7 @@ engine_software_xcb_loop(void) xcb_key_release_event_t *e; xcb_key_symbols_t *kss; xcb_keysym_t ks; - char *str; + char *str = ""; e = (xcb_key_release_event_t *)ev; @@ -351,7 +374,7 @@ engine_software_xcb_loop(void) str = "Escape"; if (ks == XK_Return) str = "Return"; - if (ks == 71) + if (ks == 113) str = "q"; evas_event_feed_key_up(evas, str, str, NULL, NULL, 0, NULL); @@ -367,3 +390,10 @@ engine_software_xcb_loop(void) goto again; } + +void +engine_software_xcb_shutdown(void) +{ + xcb_destroy_window(conn, win); + xcb_disconnect(conn); +} diff --git a/src/bin/engine_software_xcb.h b/src/bin/engine_software_xcb.h index a25136d..3cbf3b8 100644 --- a/src/bin/engine_software_xcb.h +++ b/src/bin/engine_software_xcb.h @@ -1,7 +1,8 @@ #ifndef ENGINE_SOFTWARE_XCB_H #define ENGINE_SOFTWARE_XCB_H -int engine_software_xcb_args(int argc, char **argv); +Eina_Bool engine_software_xcb_args(const char *engine, int width, int height); void engine_software_xcb_loop(void); +void engine_software_xcb_shutdown(void); #endif diff --git a/src/bin/engine_software_xlib.c b/src/bin/engine_software_xlib.c new file mode 100644 index 0000000..0273796 --- /dev/null +++ b/src/bin/engine_software_xlib.c @@ -0,0 +1,236 @@ +#include "main.h" + +#include +#include +#include +#include +#include + +static Display *disp = NULL; +static Window win = 0; +static int first_expose = 0; + +Eina_Bool +engine_software_xlib_args(const char *engine __UNUSED__, int width, int height) +{ + XSetWindowAttributes attr; + XClassHint chint; + XSizeHints szhints; + Evas_Engine_Info_Software_X11 *einfo; + + disp = XOpenDisplay(NULL); + if (!disp) return EINA_FALSE; + + evas_output_method_set(evas, evas_render_method_lookup("software_x11")); + einfo = (Evas_Engine_Info_Software_X11 *)evas_engine_info_get(evas); + if (!einfo) + { + printf("Evas does not support the Software Xlib Engine\n"); + goto close_display; + } + + einfo->info.backend = EVAS_ENGINE_INFO_SOFTWARE_X11_BACKEND_XLIB; + einfo->info.connection = disp; + einfo->info.screen = NULL; + einfo->info.visual = einfo->func.best_visual_get(0, disp, DefaultScreen(disp)); + einfo->info.colormap = einfo->func.best_colormap_get(0, disp, DefaultScreen(disp)); + einfo->info.depth = einfo->func.best_depth_get(0, disp, DefaultScreen(disp)); + einfo->info.rotation = 0; + einfo->info.debug = 0; +#ifdef EVAS_FRAME_QUEUING + { + char *render_mode; + render_mode = getenv("EVAS_RENDER_MODE"); + if (render_mode && !strcmp(render_mode, "non-blocking")) + { + einfo->render_mode = EVAS_RENDER_MODE_NONBLOCKING; + } + } +#endif + attr.backing_store = NotUseful; + attr.colormap = einfo->info.colormap; + attr.border_pixel = 0; + attr.background_pixmap = None; + attr.event_mask = + ExposureMask | ButtonPressMask | ButtonReleaseMask | PointerMotionMask | + StructureNotifyMask | EnterWindowMask | LeaveWindowMask | + KeyPressMask | KeyReleaseMask; + attr.bit_gravity = ForgetGravity; + win = XCreateWindow(disp, DefaultRootWindow(disp), + 0, 0, width, height, 0, + einfo->info.depth, InputOutput, + einfo->info.visual, + CWBackingStore | CWColormap | + CWBackPixmap | CWBorderPixel | + CWBitGravity | CWEventMask, + &attr); + if (!win) + goto close_display; + + einfo->info.drawable = win; + if (!evas_engine_info_set(evas, (Evas_Engine_Info *) einfo)) + { + printf("Evas can not setup the informations of the Software Xlib Engine\n"); + goto destroy_window; + } + + if (fullscreen) + { + Atom prop = XInternAtom(disp, "_NET_WM_STATE", False); + Atom state = XInternAtom(disp, "_NET_WM_STATE_FULLSCREEN", False); + unsigned long data = state; + XChangeProperty(disp, win, prop, XA_ATOM, 32, PropModeReplace, + (unsigned char*) &data, 1); + } + + XStoreName(disp, win, "Expedite - Evas Test Suite"); + chint.res_name = "expedite"; + chint.res_class = "Expedite"; + XSetClassHint(disp, win, &chint); + szhints.flags = PMinSize | PMaxSize | PSize | USSize; + szhints.min_width = szhints.max_width = width; + szhints.min_height = szhints.max_height = height; + XSetWMNormalHints(disp, win, &szhints); + XMapWindow(disp, win); + XSync(disp, False); + while (!first_expose) + engine_software_xlib_loop(); + return EINA_TRUE; + + destroy_window: + XDestroyWindow(disp, win); + close_display: + XCloseDisplay(disp); + + return EINA_FALSE; +} + +void +engine_software_xlib_loop(void) +{ + XEvent ev; + KeySym ks; + char *kstr; + + again: + if (!XCheckMaskEvent(disp, + ExposureMask | + StructureNotifyMask | + KeyPressMask | + KeyReleaseMask | + ButtonPressMask | + ButtonReleaseMask | + PointerMotionMask | + EnterWindowMask | + LeaveWindowMask, &ev)) + return; + switch (ev.type) + { + case ButtonPress: + evas_event_feed_mouse_move(evas, ev.xbutton.x, ev.xbutton.y, 0, NULL); + evas_event_feed_mouse_down(evas, ev.xbutton.button, EVAS_BUTTON_NONE, 0, NULL); + break; + case ButtonRelease: + evas_event_feed_mouse_move(evas, ev.xbutton.x, ev.xbutton.y, 0, NULL); + evas_event_feed_mouse_up(evas, ev.xbutton.button, EVAS_BUTTON_NONE, 0, NULL); + break; + case MotionNotify: + evas_event_feed_mouse_move(evas, ev.xmotion.x, ev.xmotion.y, 0, NULL); + break; + case Expose: + first_expose = 1; + evas_damage_rectangle_add(evas, + ev.xexpose.x, + ev.xexpose.y, + ev.xexpose.width, + ev.xexpose.height); + break; + case ConfigureNotify: + evas_output_viewport_set(evas, 0, 0, + ev.xconfigure.width, + ev.xconfigure.height); + evas_output_size_set(evas, + ev.xconfigure.width, + ev.xconfigure.height); + win_w = ev.xconfigure.width; + win_h = ev.xconfigure.height; + break; + case EnterNotify: + evas_event_feed_mouse_in(evas, 0, NULL); + break; + case LeaveNotify: + evas_event_feed_mouse_out(evas, 0, NULL); + break; + case KeyPress: + ks = XkbKeycodeToKeysym(ev.xkey.display, ev.xkey.keycode, 0, 0); + kstr = XKeysymToString(ks); + if (kstr) + { + if ((!strcmp(kstr, "Shift_L")) || + (!strcmp(kstr, "Shift_R"))) + evas_key_modifier_on(evas, "Shift"); + if ((!strcmp(kstr, "Control_L")) || + (!strcmp(kstr, "Control_R"))) + evas_key_modifier_on(evas, "Control"); + if ((!strcmp(kstr, "Alt_L")) || + (!strcmp(kstr, "Alt_R"))) + evas_key_modifier_on(evas, "Alt"); + if ((!strcmp(kstr, "Super_L")) || + (!strcmp(kstr, "Super_R"))) + evas_key_modifier_on(evas, "Super"); + if (!strcmp(kstr, "Caps_Lock")) + { + if (evas_key_lock_is_set(evas_key_lock_get(evas), "Caps_Lock")) + evas_key_lock_off(evas, "Caps_Lock"); + else + evas_key_lock_on(evas, "Caps_Lock"); + } + if (!strcmp(kstr, "Num_Lock")) + { + if (evas_key_lock_is_set(evas_key_lock_get(evas), "Num_Lock")) + evas_key_lock_off(evas, "Num_Lock"); + else + evas_key_lock_on(evas, "Num_Lock"); + } + if (!strcmp(kstr, "Scroll_Lock")) + { + if (evas_key_lock_is_set(evas_key_lock_get(evas), "Scroll_Lock")) + evas_key_lock_off(evas, "Scroll_Lock"); + else + evas_key_lock_on(evas, "Scroll_Lock"); + } + if (kstr) evas_event_feed_key_down(evas, kstr, kstr, NULL, NULL, 0, NULL); + } + break; + case KeyRelease: + ks = XkbKeycodeToKeysym(ev.xkey.display, ev.xkey.keycode, 0, 0); + kstr = XKeysymToString(ks); + if (kstr) + { + if ((!strcmp(kstr, "Shift_L")) || + (!strcmp(kstr, "Shift_R"))) + evas_key_modifier_off(evas, "Shift"); + if ((!strcmp(kstr, "Control_L")) || + (!strcmp(kstr, "Control_R"))) + evas_key_modifier_off(evas, "Control"); + if ((!strcmp(kstr, "Alt_L")) || + (!strcmp(kstr, "Alt_R"))) + evas_key_modifier_off(evas, "Alt"); + if ((!strcmp(kstr, "Super_L")) || + (!strcmp(kstr, "Super_R"))) + evas_key_modifier_off(evas, "Super"); + evas_event_feed_key_up(evas, kstr, kstr, NULL, NULL, 0, NULL); + } + break; + default: + break; + } + goto again; +} + +void +engine_software_xlib_shutdown(void) +{ + XDestroyWindow(disp, win); + XCloseDisplay(disp); +} diff --git a/src/bin/engine_software_xlib.h b/src/bin/engine_software_xlib.h new file mode 100644 index 0000000..f441d4c --- /dev/null +++ b/src/bin/engine_software_xlib.h @@ -0,0 +1,8 @@ +#ifndef ENGINE_SOFTWARE_XLIB_H +#define ENGINE_SOFTWARE_XLIB_H + +Eina_Bool engine_software_xlib_args(const char *engine, int width, int height); +void engine_software_xlib_loop(void); +void engine_software_xlib_shutdown(void); + +#endif diff --git a/src/bin/engine_xrender_x11.c b/src/bin/engine_xrender_x11.c index 11dd3b6..7e3023a 100644 --- a/src/bin/engine_xrender_x11.c +++ b/src/bin/engine_xrender_x11.c @@ -2,43 +2,36 @@ #include #include +#include #include static Display *disp = NULL; static Window win = 0; +static int first_expose = 0; -int -engine_xrender_x11_args(int argc, char **argv) +Eina_Bool +engine_xrender_x11_args(const char *engine, int width, int height) { XSetWindowAttributes attr; XClassHint chint; XSizeHints szhints; Evas_Engine_Info_XRender_X11 *einfo; int i; - int ok = 0; - - for (i = 1; i < argc; i++) - { - if ((!strcmp(argv[i], "-e")) && (i < (argc - 1))) - { - i++; - if (!strcmp(argv[i], "xr")) ok = 1; - } - } - if (!ok) return 0; disp = XOpenDisplay(NULL); - if (!disp) return 0; + if (!disp) return EINA_FALSE; evas_output_method_set(evas, evas_render_method_lookup("xrender_x11")); einfo = (Evas_Engine_Info_XRender_X11 *)evas_engine_info_get(evas); if (!einfo) { printf("Evas does not support the XRender X11 Engine\n"); - return 0; + goto close_display; } - einfo->info.display = disp; + einfo->info.backend = EVAS_ENGINE_INFO_XRENDER_BACKEND_XLIB; + einfo->info.connection = disp; + einfo->info.screen = NULL; einfo->info.visual = DefaultVisual(disp, DefaultScreen(disp)); attr.backing_store = NotUseful; attr.border_pixel = 0; @@ -49,27 +42,52 @@ engine_xrender_x11_args(int argc, char **argv) KeyPressMask | KeyReleaseMask; attr.bit_gravity = ForgetGravity; win = XCreateWindow(disp, DefaultRootWindow(disp), - 0, 0, win_w, win_h, 0, + 0, 0, width, height, 0, 0, InputOutput, einfo->info.visual, CWBackingStore | CWBackPixmap | CWBorderPixel | CWBitGravity | CWEventMask, &attr); + if (!win) + goto close_display; einfo->info.drawable = win; - evas_engine_info_set(evas, (Evas_Engine_Info *) einfo); + if (!evas_engine_info_set(evas, (Evas_Engine_Info *) einfo)) + { + printf("Evas can not setup the informations of the XRender X11 Engine\n"); + goto destroy_window; + } + + if (fullscreen) + { + Atom prop = XInternAtom(disp, "_NET_WM_STATE", False); + Atom state = XInternAtom(disp, "_NET_WM_STATE_FULLSCREEN", False); + unsigned long data = state; + XChangeProperty(disp, win, prop, XA_ATOM, 32, PropModeReplace, + (unsigned char*) &data, 1); + } + XStoreName(disp, win, "Expedite - Evas Test Suite"); chint.res_name = "expedite"; chint.res_class = "Expedite"; XSetClassHint(disp, win, &chint); szhints.flags = PMinSize | PMaxSize | PSize | USSize; - szhints.min_width = szhints.max_width = win_w; - szhints.min_height = szhints.max_height = win_h; + szhints.min_width = szhints.max_width = width; + szhints.min_height = szhints.max_height = height; XSetWMNormalHints(disp, win, &szhints); XMapWindow(disp, win); XSync(disp, False); - return 1; + while (!first_expose) + engine_xrender_x11_loop(); + return EINA_TRUE; + + destroy_window: + XDestroyWindow(disp, win); + close_display: + XCloseDisplay(disp); + + return EINA_FALSE; } void @@ -105,6 +123,7 @@ engine_xrender_x11_loop(void) evas_event_feed_mouse_move(evas, ev.xmotion.x, ev.xmotion.y, 0, NULL); break; case Expose: + first_expose = 1; evas_damage_rectangle_add(evas, ev.xexpose.x, ev.xexpose.y, @@ -112,9 +131,14 @@ engine_xrender_x11_loop(void) ev.xexpose.height); break; case ConfigureNotify: + evas_output_viewport_set(evas, 0, 0, + ev.xconfigure.width, + ev.xconfigure.height); evas_output_size_set(evas, ev.xconfigure.width, ev.xconfigure.height); + win_w = ev.xconfigure.width; + win_h = ev.xconfigure.height; break; case EnterNotify: evas_event_feed_mouse_in(evas, 0, NULL); @@ -188,3 +212,10 @@ engine_xrender_x11_loop(void) } goto again; } + +void +engine_xrender_x11_shutdown(void) +{ + XDestroyWindow(disp, win); + XCloseDisplay(disp); +} diff --git a/src/bin/engine_xrender_x11.h b/src/bin/engine_xrender_x11.h index 38a87d6..3643531 100644 --- a/src/bin/engine_xrender_x11.h +++ b/src/bin/engine_xrender_x11.h @@ -1,7 +1,8 @@ #ifndef ENGINE_XRENDER_X11_H #define ENGINE_XRENDER_X11_H -int engine_xrender_x11_args(int argc, char **argv); +Eina_Bool engine_xrender_x11_args(const char *engine, int width, int height); void engine_xrender_x11_loop(void); +void engine_xrender_x11_shutdown(void); #endif diff --git a/src/bin/engine_xrender_xcb.c b/src/bin/engine_xrender_xcb.c new file mode 100644 index 0000000..4ea668f --- /dev/null +++ b/src/bin/engine_xrender_xcb.c @@ -0,0 +1,405 @@ +#include "main.h" + +#include +#include +#include + +#define XK_MISCELLANY +#include + +enum { + XCB_SIZE_US_POSITION_HINT = 1 << 0, + XCB_SIZE_US_SIZE_HINT = 1 << 1, + XCB_SIZE_P_POSITION_HINT = 1 << 2, + XCB_SIZE_P_SIZE_HINT = 1 << 3, + XCB_SIZE_P_MIN_SIZE_HINT = 1 << 4, + XCB_SIZE_P_MAX_SIZE_HINT = 1 << 5, + XCB_SIZE_P_RESIZE_INC_HINT = 1 << 6, + XCB_SIZE_P_ASPECT_HINT = 1 << 7, + XCB_SIZE_BASE_SIZE_HINT = 1 << 8, + XCB_SIZE_P_WIN_GRAVITY_HINT = 1 << 9 +}; + +struct xcb_size_hints_t { + uint32_t flags; + int32_t x, y, width, height; + int32_t min_width, min_height; + int32_t max_width, max_height; + int32_t width_inc, height_inc; + int32_t min_aspect_num, min_aspect_den; + int32_t max_aspect_num, max_aspect_den; + int32_t base_width, base_height; + uint32_t win_gravity; +}; + + +static xcb_connection_t *conn = NULL; +static xcb_screen_t *screen = NULL; +static xcb_window_t win = 0; +static int first_expose = 0; + +static xcb_visualtype_t * +_engine_xrender_visual_get(xcb_connection_t *conn, xcb_screen_t *screen) +{ + xcb_depth_iterator_t iter_depth; + + iter_depth = xcb_screen_allowed_depths_iterator(screen); + for (; iter_depth.rem; xcb_depth_next (&iter_depth)) + { + xcb_visualtype_iterator_t iter_vis; + + iter_vis = xcb_depth_visuals_iterator(iter_depth.data); + for (; iter_vis.rem; xcb_visualtype_next (&iter_vis)) + { + if (screen->root_visual == iter_vis.data->visual_id) + return iter_vis.data; + } + } +} + +Eina_Bool +engine_xrender_xcb_args(const char *engine, int width, int height) +{ + struct xcb_size_hints_t hints; + uint32_t value_list[6]; + xcb_screen_iterator_t iter; + Evas_Engine_Info_XRender_X11 *einfo; + xcb_intern_atom_reply_t *reply; + char *str; + xcb_intern_atom_cookie_t cookie1; + xcb_intern_atom_cookie_t cookie2; + xcb_intern_atom_cookie_t cookie3; + xcb_intern_atom_cookie_t cookie4; + xcb_intern_atom_cookie_t cookie5; + xcb_atom_t string; + xcb_atom_t wm_name; + xcb_atom_t wm_class; + xcb_atom_t wm_normal_hint; + xcb_atom_t wm_size_hint; + uint32_t value_mask; + int s; + int s_tmp; + int l1; + int l2; + int i; + + conn = xcb_connect(NULL, &s); + if (xcb_connection_has_error(conn)) return EINA_FALSE; + + s_tmp = s; + iter = xcb_setup_roots_iterator(xcb_get_setup(conn)); + for (; iter.rem; --s_tmp, xcb_screen_next (&iter)) + if (s_tmp == 0) + { + screen = iter.data; + break; + } + + evas_output_method_set(evas, evas_render_method_lookup("xrender_x11")); + einfo = (Evas_Engine_Info_XRender_X11 *)evas_engine_info_get(evas); + if (!einfo) + { + printf("Evas does not support the XRender XCB Engine\n"); + goto close_connection; + } + + einfo->info.backend = EVAS_ENGINE_INFO_XRENDER_BACKEND_XCB; + einfo->info.connection = conn; + einfo->info.screen = screen; + einfo->info.visual = _engine_xrender_visual_get(conn, screen); + + value_mask = + XCB_CW_BACK_PIXMAP | XCB_CW_BORDER_PIXEL | XCB_CW_BIT_GRAVITY | + XCB_CW_BACKING_STORE | XCB_CW_EVENT_MASK | XCB_CW_COLORMAP; + + value_list[0] = XCB_NONE; + value_list[1] = 0; + value_list[2] = XCB_GRAVITY_BIT_FORGET; + value_list[3] = XCB_BACKING_STORE_NOT_USEFUL; + value_list[4] = + XCB_EVENT_MASK_KEY_PRESS | XCB_EVENT_MASK_KEY_RELEASE | + XCB_EVENT_MASK_BUTTON_PRESS | XCB_EVENT_MASK_BUTTON_RELEASE | + XCB_EVENT_MASK_ENTER_WINDOW | XCB_EVENT_MASK_LEAVE_WINDOW | + XCB_EVENT_MASK_POINTER_MOTION | XCB_EVENT_MASK_EXPOSURE | + XCB_EVENT_MASK_STRUCTURE_NOTIFY; + value_list[5] =screen->default_colormap; + + win = xcb_generate_id(conn); + if (!win) + goto close_connection; + xcb_create_window(conn, + screen->root_depth, + win, screen->root, 0, 0, width, height, 0, + XCB_WINDOW_CLASS_INPUT_OUTPUT, + ((xcb_visualtype_t *)einfo->info.visual)->visual_id, + value_mask, + value_list); + einfo->info.drawable = win; + + if (!evas_engine_info_set(evas, (Evas_Engine_Info *) einfo)) + { + printf("Evas can not setup the informations of the XRender XCB Engine\n"); + goto destroy_window; + } + +/* XStoreName(disp, win, "Expedite - Evas Test Suite"); */ + + cookie1 = xcb_intern_atom_unchecked(conn, 0, strlen("STRING"), "STRING"); + cookie2 = xcb_intern_atom_unchecked(conn, 0, strlen("WM_NAME"), "WM_NAME"); + cookie3 = xcb_intern_atom_unchecked(conn, 0, strlen("WM_CLASS"), "WM_CLASS"); + cookie4 = xcb_intern_atom_unchecked(conn, 0, strlen("WM_NORMAL_HINTS)"), "WM_NORMAL_HINTS)"); + cookie5 = xcb_intern_atom_unchecked(conn, 0, strlen("WM_SIZE_HINTS)"), "WM_SIZE_HINTS)"); + + reply = xcb_intern_atom_reply(conn, cookie1, NULL); + string = reply->atom; + free(reply); + reply = xcb_intern_atom_reply(conn, cookie2, NULL); + wm_name = reply->atom; + free(reply); + + xcb_change_property(conn, XCB_PROP_MODE_REPLACE, win, + wm_name, string, 8, + strlen("Expedite - Evas Test Suite"), "Expedite - Evas Test Suite"); + +/* chint.res_name = "expedite"; */ +/* chint.res_class = "Expedite"; */ +/* XSetClassHint(disp, win, &chint); */ + + l1 = strlen("expedite"); + l2 = strlen("Expedite"); + str = (char *)malloc(l1 + l2 + 1); + memcpy(str, "expedite", l1); + str[l1] = '\0'; + memcpy(str + l1 + 1, "Expedite", l2); + + reply = xcb_intern_atom_reply(conn, cookie3, NULL); + wm_class = reply->atom; + free(reply); + + xcb_change_property(conn, XCB_PROP_MODE_REPLACE, win, + wm_class, string, 8, + l1 + l2 + 1, str); + free(str); + +/* szhints.flags = PMinSize | PMaxSize | PSize | USSize; */ +/* szhints.min_width = szhints.max_width = width; */ +/* szhints.min_height = szhints.max_height = height; */ +/* XSetWMNormalHints(disp, win, &szhints); */ + + memset(&hints, 0, sizeof(hints)); + hints.flags = XCB_SIZE_US_SIZE_HINT | XCB_SIZE_P_SIZE_HINT | XCB_SIZE_P_MIN_SIZE_HINT | XCB_SIZE_P_MAX_SIZE_HINT; + hints.min_width = width; + hints.max_width = width; + hints.min_height = height; + hints.max_height = height; + + reply = xcb_intern_atom_reply(conn, cookie4, NULL); + wm_normal_hint = reply->atom; + free(reply); + + reply = xcb_intern_atom_reply(conn, cookie5, NULL); + wm_size_hint = reply->atom; + free(reply); + + xcb_change_property(conn, XCB_PROP_MODE_REPLACE, win, + wm_normal_hint, wm_size_hint, 32, + sizeof(hints) / 4, &hints); + + free(xcb_get_input_focus_reply(conn, xcb_get_input_focus_unchecked(conn), NULL)); + + xcb_map_window(conn, win); + + while (!first_expose) + engine_xrender_xcb_loop(); + return EINA_TRUE; + + destroy_window: + xcb_destroy_window(conn, win); + close_connection: + xcb_disconnect(conn); + + return EINA_FALSE; +} + +void +engine_xrender_xcb_loop(void) +{ + xcb_generic_event_t *ev; + + again: + ev = xcb_poll_for_event(conn); + if (!ev) + return; + + switch (ev->response_type) + { + case XCB_BUTTON_PRESS: + { + xcb_button_press_event_t *e; + + e = (xcb_button_press_event_t *)ev; + + evas_event_feed_mouse_move(evas, e->event_x, e->event_y, 0, NULL); + evas_event_feed_mouse_down(evas, e->detail, EVAS_BUTTON_NONE, 0, NULL); + break; + } + case XCB_BUTTON_RELEASE: + { + xcb_button_release_event_t *e; + + e = (xcb_button_release_event_t *)ev; + + evas_event_feed_mouse_move(evas, e->event_x, e->event_y, 0, NULL); + evas_event_feed_mouse_up(evas, e->detail, EVAS_BUTTON_NONE, 0, NULL); + break; + } + case XCB_MOTION_NOTIFY: + { + xcb_motion_notify_event_t *e; + + e = (xcb_motion_notify_event_t *)ev; + + evas_event_feed_mouse_move(evas, e->event_x, e->event_y, 0, NULL); + break; + } + case XCB_EXPOSE: + { + xcb_expose_event_t *e; + + e = (xcb_expose_event_t *)ev; + + first_expose = 1; + evas_damage_rectangle_add(evas, + e->x, + e->y, + e->width, + e->height); + break; + } + case XCB_CONFIGURE_NOTIFY: + { + xcb_configure_notify_event_t *e; + + e = (xcb_configure_notify_event_t *)ev; + + evas_output_viewport_set(evas, 0, 0, + e->width, + e->height); + evas_output_size_set(evas, + e->width, + e->height); + win_w = e->width; + win_h = e->height; + break; + } + case XCB_ENTER_NOTIFY: + evas_event_feed_mouse_in(evas, 0, NULL); + break; + case XCB_LEAVE_NOTIFY: + evas_event_feed_mouse_out(evas, 0, NULL); + break; + case XCB_KEY_PRESS: + { + xcb_key_press_event_t *e; + xcb_key_symbols_t *kss; + xcb_keysym_t ks; + char *str = ""; + + e = (xcb_key_press_event_t *)ev; + + kss = xcb_key_symbols_alloc(conn); + + ks = xcb_key_symbols_get_keysym(kss, e->detail, 0); + + if ((ks == XK_Shift_L) || (ks == XK_Shift_R)) + evas_key_modifier_on(evas, "Shift"); + else if ((ks == XK_Control_L) || (ks == XK_Control_R)) + evas_key_modifier_on(evas, "Control"); + else if ((ks == XK_Alt_L) || (ks == XK_Alt_R)) + evas_key_modifier_on(evas, "Alt"); + else if ((ks == XK_Super_L) || (ks == XK_Super_R)) + evas_key_modifier_on(evas, "Super"); + else if (ks == XK_Caps_Lock) + { + if (evas_key_lock_is_set(evas_key_lock_get(evas), "Caps_Lock")) + evas_key_lock_off(evas, "Caps_Lock"); + else + evas_key_lock_on(evas, "Caps_Lock"); + } + else if (ks == XK_Scroll_Lock) + { + if (evas_key_lock_is_set(evas_key_lock_get(evas), "Scroll_Lock")) + evas_key_lock_off(evas, "Scroll_Lock"); + else + evas_key_lock_on(evas, "Scroll_Lock"); + } + + if (ks == XK_Left) + str = "Left"; + if (ks == XK_Right) + str = "Right"; + if (ks == XK_Escape) + str = "Escape"; + if (ks == XK_Return) + str = "Return"; + if (ks == 113) + str = "q"; + + evas_event_feed_key_down(evas, str, str, NULL, NULL, 0, NULL); + + xcb_key_symbols_free(kss); + break; + } + case XCB_KEY_RELEASE: + { + xcb_key_release_event_t *e; + xcb_key_symbols_t *kss; + xcb_keysym_t ks; + char *str = ""; + + e = (xcb_key_release_event_t *)ev; + + kss = xcb_key_symbols_alloc(conn); + + ks = xcb_key_symbols_get_keysym(kss, e->detail, 0); + + if ((ks == XK_Shift_L) || (ks == XK_Shift_R)) + evas_key_modifier_on(evas, "Shift"); + else if ((ks == XK_Control_L) || (ks == XK_Control_R)) + evas_key_modifier_on(evas, "Control"); + else if ((ks == XK_Alt_L) || (ks == XK_Alt_R)) + evas_key_modifier_on(evas, "Alt"); + else if ((ks == XK_Super_L) || (ks == XK_Super_R)) + evas_key_modifier_on(evas, "Super"); + + if (ks == XK_Left) + str = "Left"; + if (ks == XK_Right) + str = "Right"; + if (ks == XK_Escape) + str = "Escape"; + if (ks == XK_Return) + str = "Return"; + if (ks == 113) + str = "q"; + + evas_event_feed_key_up(evas, str, str, NULL, NULL, 0, NULL); + + xcb_key_symbols_free(kss); + break; + } + default: + free(ev); + return; + } + free(ev); + + goto again; +} + +void +engine_xrender_xcb_shutdown(void) +{ + xcb_destroy_window(conn, win); + xcb_disconnect(conn); +} diff --git a/src/bin/engine_xrender_xcb.h b/src/bin/engine_xrender_xcb.h new file mode 100644 index 0000000..9d688a0 --- /dev/null +++ b/src/bin/engine_xrender_xcb.h @@ -0,0 +1,8 @@ +#ifndef ENGINE_XRENDER_XCB_H +#define ENGINE_XRENDER_XCB_H + +Eina_Bool engine_xrender_xcb_args(const char *engine, int width, int height); +void engine_xrender_xcb_loop(void); +void engine_xrender_xcb_shutdown(void); + +#endif diff --git a/src/bin/expedite-cmp b/src/bin/expedite-cmp new file mode 100755 index 0000000..2df01ad --- /dev/null +++ b/src/bin/expedite-cmp @@ -0,0 +1,248 @@ +#!/usr/bin/env python + +import sys +import os +import os.path +import csv +from optparse import OptionParser + +fmttext = '%(value)7.2f (%(percentual)+6.1f%%)' +fmthtml = '%(value)7.2f (%(percentual)+0.1f%%)' + + +parser = OptionParser(usage="%prog [options] .. ", + description="""\ +Generate reports comparing two or more outputs of expedite. + +Just run expedite and save output to a file and then feed them to this +program. The first file is used as base for comparison and other files +will print relative improvements. +""") +parser.add_option("-e", "--accepted-error", + help=("maximum error to accept as percentage 0.0-1.0. " + "[default=%default]"), + action="store", type="float", default=0.05) +parser.add_option("-r", "--report", + help=("kind of report to use. One of text or html. " + "[default=%default]"), + action="store", type="choice", default="text", + choices=["text", "html"]) +parser.add_option("-F", "--format", + help=("format to use as python format string, " + "valid keys are: value and percentual. " + "[defaults: html=\"%s\", text=\"%s\"]" % + (fmthtml, fmttext)), + action="store", type="str", default=None) +parser.add_option("-C", "--no-color", dest="color", + help="do not use color in reports.", + action="store_false", default=True) + +options, files = parser.parse_args() +if len(files) < 2: + raise SystemExit("need at least 2 files to compare") + +if options.format is None: + if options.report == "html": + options.format = fmthtml + else: + options.format = fmttext + +ref_f = files[0] +others_f = files[1:] + +max_test_name = 0 +data = {} +tests = [] +for f in files: + d = data[f] = {} + for row in csv.reader(open(f)): + t = row[1].strip() + if f == ref_f: + tests.append(t) + d[t] = float(row[0]) + max_test_name = max(len(t), max_test_name) + +def report_text(): + test_name_fmt = "%%%ds:" % max_test_name + + fmtsize = len(options.format % {"value": 12345.67, "percentual": 1234.56}) + hdrfmt = "%%%d.%ds" % (fmtsize, fmtsize) + + print test_name_fmt % "\\", + print "%7.7s" % (files[0][-7:],), + for f in files[1:]: + n, e = os.path.splitext(f) + print hdrfmt % n[-fmtsize:], + print + + if options.color and os.environ.get("TERM", "") in ( + "xterm", "xterm-color", "rxvt", "rxvt-unicode", "screen", + "Eterm", "aterm", "gnome", "interix"): + color_good = "\033[1;32m" + color_bad = "\033[1;31m" + color_equal = "\033[1;30m" + color_reset = "\033[0m" + else: + color_good = "" + color_bad = "" + color_equal = "" + color_reset = "" + + + def print_row(test): + print test_name_fmt % test, + ref_val = data[ref_f][test] + print "%7.2f" % ref_val, + for f in others_f: + try: + val = data[f][test] + except KeyError: + print "-?????-", + continue + + percent = (val - ref_val) / ref_val + if percent < -options.accepted_error: + c = color_bad + elif percent > options.accepted_error: + c = color_good + else: + c = color_equal + + fmt = options.format % {"value": val, "percentual": percent * 100} + if len(fmt) < fmtsize: + fmt = hdrfmt % fmt + print "%s%s%s" % (c, fmt, color_reset), + + print + + for t in tests: + print_row(t) + + +def report_html(): + import time + + fnames = [os.path.basename(f) for f in files] + print """\ + + + + + + expedite comparison sheet: %(files)s + + + +

Comparison sheet for %(files)s, created at %(date)s.

+ + + + \ +""" % {"files": ", ".join(fnames), + "date": time.asctime(), + } + + for f in fnames: + print """\ + \ +""" % f + print """\ + + + \ +""" + + def print_row(test): + ref_val = data[ref_f][test] + if "EVAS SPEED" in test.upper(): + extra_cls = ' class="overall-results"' + else: + extra_cls = "" + + print """\ + + + \ +""" % (extra_cls, test, ref_val) + + for f in others_f: + try: + val = data[f][test] + except KeyError: + print """\ + \ +""" + continue + + percent = (val - ref_val) / ref_val + if percent < -options.accepted_error: + c = 'bad' + elif percent > options.accepted_error: + c = 'good' + else: + c = 'equal' + + v = options.format % {"value": val, "percentual": percent * 100} + + print """\ + \ +""" % (c, v) + + print """\ + \ +""" + + for t in tests: + print_row(t) + + print """\ + +
\\%s
%s%7.2f-?????-%s
+ + +""" + +if options.report == "text": + report_text() +elif options.report == "html": + report_html() diff --git a/src/bin/filter_object_blur.c b/src/bin/filter_object_blur.c new file mode 100644 index 0000000..a7bac9b --- /dev/null +++ b/src/bin/filter_object_blur.c @@ -0,0 +1,107 @@ +#undef FNAME +#undef NAME +#undef ICON + +/* metadata */ +#define FNAME filter_object_blur +#define NAME "Filter Object Blur" +#define ICON "blend.png" + +#ifndef PROTO +# ifndef UI +# include "main.h" + +/* standard var */ +static int done = 0; +/* private data */ +static Evas_Object *o_images[OBNUM]; + +/* setup */ +static void _setup(void) +{ + int i; + Evas_Object *o,*src; + + for (i = 0; i < OBNUM; i++) + { + o = evas_object_image_add(evas); + evas_object_image_file_set(o, build_path("logo.png"), NULL); + evas_object_image_fill_set(o, 0, 0, 120, 160); + evas_object_resize(o, 120, 160); + evas_object_filter_set(o, EVAS_FILTER_BLUR); + evas_object_filter_param_int_set(o, "radius", 3); + evas_object_show(o); + src = o; + o_images[i] = src; + } + + done = 0; +} + +/* cleanup */ +static void _cleanup(void) +{ + int i; + for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]); +} + +/* loop - do things */ +static void _loop(double t, int f) +{ + int i; + Evas_Coord x, y, w, h; + for (i = 0; i < OBNUM; i++) + { + w = 120; + h = 160; + x = (win_w / 2) - (w / 2); + x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2); + y = (win_h / 2) - (h / 2); + y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h / 2); + evas_object_move(o_images[i], x, y); + } + FPS_STD(NAME); +} + +/* prepend special key handlers if interactive (before STD) */ +static void _key(char *key) +{ + KEY_STD; +} + + + + + + + + + + + + +/* template stuff - ignore */ +# endif +#endif + +#ifdef UI +_ui_menu_item_add(ICON, NAME, FNAME); +#endif + +#ifdef PROTO +void FNAME(void); +#endif + +#ifndef PROTO +# ifndef UI +void FNAME(void) +{ + ui_func_set(_key, _loop); + _setup(); +} +# endif +#endif +#undef FNAME +#undef NAME +#undef ICON + diff --git a/src/bin/filter_object_blur_solid.c b/src/bin/filter_object_blur_solid.c new file mode 100644 index 0000000..b61fd2c --- /dev/null +++ b/src/bin/filter_object_blur_solid.c @@ -0,0 +1,108 @@ +#undef FNAME +#undef NAME +#undef ICON + +/* metadata */ +#define FNAME filter_object_blur_solid +#define NAME "Filter Object Blur Solid" +#define ICON "blend.png" + +#ifndef PROTO +# ifndef UI +# include "main.h" + +/* standard var */ +static int done = 0; +/* private data */ +static Evas_Object *o_images[OBNUM]; + +/* setup */ +static void _setup(void) +{ + int i; + Evas_Object *o,*src; + + for (i = 0; i < OBNUM; i++) + { + o = evas_object_image_add(evas); + evas_object_image_file_set(o, build_path("image.png"), NULL); + evas_object_image_fill_set(o, 0, 0, 120, 160); + evas_object_resize(o, 120, 160); + evas_object_filter_set(o, EVAS_FILTER_BLUR); + evas_object_filter_param_int_set(o, "radius", 5); + evas_object_layer_set(o,1); + evas_object_show(o); + src = o; + o_images[i] = src; + } + + done = 0; +} + +/* cleanup */ +static void _cleanup(void) +{ + int i; + for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]); +} + +/* loop - do things */ +static void _loop(double t, int f) +{ + int i; + Evas_Coord x, y, w, h; + for (i = 0; i < OBNUM; i++) + { + w = 120; + h = 160; + x = (win_w / 2) - (w / 2); + x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2); + y = (win_h / 2) - (h / 2); + y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h / 2); + evas_object_move(o_images[i], x, y); + } + FPS_STD(NAME); +} + +/* prepend special key handlers if interactive (before STD) */ +static void _key(char *key) +{ + KEY_STD; +} + + + + + + + + + + + + +/* template stuff - ignore */ +# endif +#endif + +#ifdef UI +_ui_menu_item_add(ICON, NAME, FNAME); +#endif + +#ifdef PROTO +void FNAME(void); +#endif + +#ifndef PROTO +# ifndef UI +void FNAME(void) +{ + ui_func_set(_key, _loop); + _setup(); +} +# endif +#endif +#undef FNAME +#undef NAME +#undef ICON + diff --git a/src/bin/filter_object_brightness.c b/src/bin/filter_object_brightness.c new file mode 100644 index 0000000..a1d5ef6 --- /dev/null +++ b/src/bin/filter_object_brightness.c @@ -0,0 +1,109 @@ +#undef FNAME +#undef NAME +#undef ICON + +/* metadata */ +#define FNAME filter_object_brightness +#define NAME "Filter Object Brightness" +#define ICON "blend.png" + +#ifndef PROTO +# ifndef UI +# include "main.h" + +/* standard var */ +static int done = 0; +/* private data */ +static Evas_Object *o_images[OBNUM]; + +/* setup */ +static void _setup(void) +{ + int i; + Evas_Object *o,*src; + + for (i = 0; i < OBNUM; i++) + { + o = evas_object_image_add(evas); + evas_object_image_file_set(o, build_path("logo.png"), NULL); + evas_object_image_fill_set(o, 0, 0, 120, 160); + evas_object_resize(o, 120, 160); + evas_object_filter_set(o, EVAS_FILTER_BRIGHTNESS); + evas_object_filter_param_float_set(o, "adjust", i / (double)OBNUM); + evas_object_show(o); + src = o; + o_images[i] = src; + } + + done = 0; +} + +/* cleanup */ +static void _cleanup(void) +{ + int i; + for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]); +} + +/* loop - do things */ +static void _loop(double t, int f) +{ + int i; + Evas_Coord x, y, w, h; + for (i = 0; i < OBNUM; i++) + { + w = 120; + h = 160; + x = (win_w / 2) - (w / 2); + x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2); + y = (win_h / 2) - (h / 2); + y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h / 2); + evas_object_move(o_images[i], x, y); + evas_object_filter_param_float_set(o_images[i], "adjust", + ((i + f) % OBNUM) / (2.0 * OBNUM) - 1); + } + FPS_STD(NAME); +} + +/* prepend special key handlers if interactive (before STD) */ +static void _key(char *key) +{ + KEY_STD; +} + + + + + + + + + + + + +/* template stuff - ignore */ +# endif +#endif + +#ifdef UI +_ui_menu_item_add(ICON, NAME, FNAME); +#endif + +#ifdef PROTO +void FNAME(void); +#endif + +#ifndef PROTO +# ifndef UI +void FNAME(void) +{ + ui_func_set(_key, _loop); + _setup(); +} +# endif +#endif +#undef FNAME +#undef NAME +#undef ICON + diff --git a/src/bin/filter_object_brightness_solid.c b/src/bin/filter_object_brightness_solid.c new file mode 100644 index 0000000..849482e --- /dev/null +++ b/src/bin/filter_object_brightness_solid.c @@ -0,0 +1,111 @@ +#undef FNAME +#undef NAME +#undef ICON + +/* metadata */ +#define FNAME filter_object_brightness_solid +#define NAME "Filter Object Brightness Solid" +#define ICON "blend.png" + +#ifndef PROTO +# ifndef UI +# include "main.h" + +/* standard var */ +static int done = 0; +/* private data */ +static Evas_Object *o_images[OBNUM]; + +/* setup */ +static void _setup(void) +{ + int i; + Evas_Object *o,*src; + + for (i = 0; i < OBNUM; i++) + { + o = evas_object_image_add(evas); + evas_object_image_file_set(o, build_path("image.png"), NULL); + evas_object_image_fill_set(o, 0, 0, 120, 160); + evas_object_resize(o, 120, 160); + evas_object_filter_set(o, EVAS_FILTER_BRIGHTNESS); + evas_object_filter_param_float_set(o, "adjust", + i / (2.0 * OBNUM) - 1.0); + evas_object_layer_set(o,1); + evas_object_show(o); + src = o; + o_images[i] = src; + } + + done = 0; +} + +/* cleanup */ +static void _cleanup(void) +{ + int i; + for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]); +} + +/* loop - do things */ +static void _loop(double t, int f) +{ + int i; + Evas_Coord x, y, w, h; + for (i = 0; i < OBNUM; i++) + { + w = 120; + h = 160; + x = (win_w / 2) - (w / 2); + x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2); + y = (win_h / 2) - (h / 2); + y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h / 2); + evas_object_move(o_images[i], x, y); + evas_object_filter_param_float_set(o_images[i], "adjust", + (((i + f) % OBNUM) * 2.0) / (OBNUM) - 1.0); + } + FPS_STD(NAME); +} + +/* prepend special key handlers if interactive (before STD) */ +static void _key(char *key) +{ + KEY_STD; +} + + + + + + + + + + + + +/* template stuff - ignore */ +# endif +#endif + +#ifdef UI +_ui_menu_item_add(ICON, NAME, FNAME); +#endif + +#ifdef PROTO +void FNAME(void); +#endif + +#ifndef PROTO +# ifndef UI +void FNAME(void) +{ + ui_func_set(_key, _loop); + _setup(); +} +# endif +#endif +#undef FNAME +#undef NAME +#undef ICON + diff --git a/src/bin/filter_object_colors.c b/src/bin/filter_object_colors.c new file mode 100644 index 0000000..2b66799 --- /dev/null +++ b/src/bin/filter_object_colors.c @@ -0,0 +1,111 @@ +#undef FNAME +#undef NAME +#undef ICON + +/* metadata */ +#define FNAME filter_object_colors +#define NAME "Filter Object Colors" +#define ICON "blend.png" + +#ifndef PROTO +# ifndef UI +# include "main.h" + +/* standard var */ +static int done = 0; +/* private data */ +static Evas_Object *o_images[OBNUM]; + +/* setup */ +static void _setup(void) +{ + int i; + Evas_Object *o,*src; + Evas_Filter filters[3] = { + EVAS_FILTER_GREYSCALE, + EVAS_FILTER_INVERT, + EVAS_FILTER_SEPIA + }; + + for (i = 0; i < OBNUM; i++) + { + o = evas_object_image_add(evas); + evas_object_image_file_set(o, build_path("logo.png"), NULL); + evas_object_image_fill_set(o, 0, 0, 120, 160); + evas_object_resize(o, 120, 160); + evas_object_filter_set(o, filters[i % 3]); + evas_object_show(o); + src = o; + o_images[i] = src; + } + + done = 0; +} + +/* cleanup */ +static void _cleanup(void) +{ + int i; + for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]); +} + +/* loop - do things */ +static void _loop(double t, int f) +{ + int i; + Evas_Coord x, y, w, h; + for (i = 0; i < OBNUM; i++) + { + w = 120; + h = 160; + x = (win_w / 2) - (w / 2); + x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2); + y = (win_h / 2) - (h / 2); + y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h / 2); + evas_object_move(o_images[i], x, y); + } + FPS_STD(NAME); +} + +/* prepend special key handlers if interactive (before STD) */ +static void _key(char *key) +{ + KEY_STD; +} + + + + + + + + + + + + +/* template stuff - ignore */ +# endif +#endif + +#ifdef UI +_ui_menu_item_add(ICON, NAME, FNAME); +#endif + +#ifdef PROTO +void FNAME(void); +#endif + +#ifndef PROTO +# ifndef UI +void FNAME(void) +{ + ui_func_set(_key, _loop); + _setup(); +} +# endif +#endif +#undef FNAME +#undef NAME +#undef ICON + diff --git a/src/bin/filter_object_colors_solid.c b/src/bin/filter_object_colors_solid.c new file mode 100644 index 0000000..534ab81 --- /dev/null +++ b/src/bin/filter_object_colors_solid.c @@ -0,0 +1,112 @@ +#undef FNAME +#undef NAME +#undef ICON + +/* metadata */ +#define FNAME filter_object_colors_solid +#define NAME "Filter Object Colors Solid" +#define ICON "blend.png" + +#ifndef PROTO +# ifndef UI +# include "main.h" + +/* standard var */ +static int done = 0; +/* private data */ +static Evas_Object *o_images[OBNUM]; + +/* setup */ +static void _setup(void) +{ + int i; + Evas_Object *o,*src; + Evas_Filter filters[3] = { + EVAS_FILTER_GREYSCALE, + EVAS_FILTER_INVERT, + EVAS_FILTER_SEPIA + }; + + for (i = 0; i < OBNUM; i++) + { + o = evas_object_image_add(evas); + evas_object_image_file_set(o, build_path("image.png"), NULL); + evas_object_image_fill_set(o, 0, 0, 120, 160); + evas_object_resize(o, 120, 160); + evas_object_filter_set(o, filters[i % 3]); + evas_object_layer_set(o,1); + evas_object_show(o); + src = o; + o_images[i] = src; + } + + done = 0; +} + +/* cleanup */ +static void _cleanup(void) +{ + int i; + for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]); +} + +/* loop - do things */ +static void _loop(double t, int f) +{ + int i; + Evas_Coord x, y, w, h; + for (i = 0; i < OBNUM; i++) + { + w = 120; + h = 160; + x = (win_w / 2) - (w / 2); + x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2); + y = (win_h / 2) - (h / 2); + y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h / 2); + evas_object_move(o_images[i], x, y); + } + FPS_STD(NAME); +} + +/* prepend special key handlers if interactive (before STD) */ +static void _key(char *key) +{ + KEY_STD; +} + + + + + + + + + + + + +/* template stuff - ignore */ +# endif +#endif + +#ifdef UI +_ui_menu_item_add(ICON, NAME, FNAME); +#endif + +#ifdef PROTO +void FNAME(void); +#endif + +#ifndef PROTO +# ifndef UI +void FNAME(void) +{ + ui_func_set(_key, _loop); + _setup(); +} +# endif +#endif +#undef FNAME +#undef NAME +#undef ICON + diff --git a/src/bin/filter_object_greyscale.c b/src/bin/filter_object_greyscale.c new file mode 100644 index 0000000..0d41ddd --- /dev/null +++ b/src/bin/filter_object_greyscale.c @@ -0,0 +1,106 @@ +#undef FNAME +#undef NAME +#undef ICON + +/* metadata */ +#define FNAME filter_object_greyscale +#define NAME "Filter Object Greyscale" +#define ICON "blend.png" + +#ifndef PROTO +# ifndef UI +# include "main.h" + +/* standard var */ +static int done = 0; +/* private data */ +static Evas_Object *o_images[OBNUM]; + +/* setup */ +static void _setup(void) +{ + int i; + Evas_Object *o,*src; + + for (i = 0; i < OBNUM; i++) + { + o = evas_object_image_add(evas); + evas_object_image_file_set(o, build_path("logo.png"), NULL); + evas_object_image_fill_set(o, 0, 0, 120, 160); + evas_object_resize(o, 120, 160); + evas_object_filter_set(o, EVAS_FILTER_GREYSCALE); + evas_object_show(o); + src = o; + o_images[i] = src; + } + + done = 0; +} + +/* cleanup */ +static void _cleanup(void) +{ + int i; + for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]); +} + +/* loop - do things */ +static void _loop(double t, int f) +{ + int i; + Evas_Coord x, y, w, h; + for (i = 0; i < OBNUM; i++) + { + w = 120; + h = 160; + x = (win_w / 2) - (w / 2); + x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2); + y = (win_h / 2) - (h / 2); + y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h / 2); + evas_object_move(o_images[i], x, y); + } + FPS_STD(NAME); +} + +/* prepend special key handlers if interactive (before STD) */ +static void _key(char *key) +{ + KEY_STD; +} + + + + + + + + + + + + +/* template stuff - ignore */ +# endif +#endif + +#ifdef UI +_ui_menu_item_add(ICON, NAME, FNAME); +#endif + +#ifdef PROTO +void FNAME(void); +#endif + +#ifndef PROTO +# ifndef UI +void FNAME(void) +{ + ui_func_set(_key, _loop); + _setup(); +} +# endif +#endif +#undef FNAME +#undef NAME +#undef ICON + diff --git a/src/bin/filter_object_greyscale_solid.c b/src/bin/filter_object_greyscale_solid.c new file mode 100644 index 0000000..98373f5 --- /dev/null +++ b/src/bin/filter_object_greyscale_solid.c @@ -0,0 +1,107 @@ +#undef FNAME +#undef NAME +#undef ICON + +/* metadata */ +#define FNAME filter_object_greyscale_solid +#define NAME "Filter Object Greyscale Solid" +#define ICON "blend.png" + +#ifndef PROTO +# ifndef UI +# include "main.h" + +/* standard var */ +static int done = 0; +/* private data */ +static Evas_Object *o_images[OBNUM]; + +/* setup */ +static void _setup(void) +{ + int i; + Evas_Object *o,*src; + + for (i = 0; i < OBNUM; i++) + { + o = evas_object_image_add(evas); + evas_object_image_file_set(o, build_path("image.png"), NULL); + evas_object_image_fill_set(o, 0, 0, 120, 160); + evas_object_resize(o, 120, 160); + evas_object_filter_set(o, EVAS_FILTER_GREYSCALE); + evas_object_layer_set(o,1); + evas_object_show(o); + src = o; + o_images[i] = src; + } + + done = 0; +} + +/* cleanup */ +static void _cleanup(void) +{ + int i; + for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]); +} + +/* loop - do things */ +static void _loop(double t, int f) +{ + int i; + Evas_Coord x, y, w, h; + for (i = 0; i < OBNUM; i++) + { + w = 120; + h = 160; + x = (win_w / 2) - (w / 2); + x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2); + y = (win_h / 2) - (h / 2); + y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h / 2); + evas_object_move(o_images[i], x, y); + } + FPS_STD(NAME); +} + +/* prepend special key handlers if interactive (before STD) */ +static void _key(char *key) +{ + KEY_STD; +} + + + + + + + + + + + + +/* template stuff - ignore */ +# endif +#endif + +#ifdef UI +_ui_menu_item_add(ICON, NAME, FNAME); +#endif + +#ifdef PROTO +void FNAME(void); +#endif + +#ifndef PROTO +# ifndef UI +void FNAME(void) +{ + ui_func_set(_key, _loop); + _setup(); +} +# endif +#endif +#undef FNAME +#undef NAME +#undef ICON + diff --git a/src/bin/filter_object_invert.c b/src/bin/filter_object_invert.c new file mode 100644 index 0000000..506dd59 --- /dev/null +++ b/src/bin/filter_object_invert.c @@ -0,0 +1,106 @@ +#undef FNAME +#undef NAME +#undef ICON + +/* metadata */ +#define FNAME filter_object_invert +#define NAME "Filter Object Invert" +#define ICON "blend.png" + +#ifndef PROTO +# ifndef UI +# include "main.h" + +/* standard var */ +static int done = 0; +/* private data */ +static Evas_Object *o_images[OBNUM]; + +/* setup */ +static void _setup(void) +{ + int i; + Evas_Object *o,*src; + + for (i = 0; i < OBNUM; i++) + { + o = evas_object_image_add(evas); + evas_object_image_file_set(o, build_path("logo.png"), NULL); + evas_object_image_fill_set(o, 0, 0, 120, 160); + evas_object_resize(o, 120, 160); + evas_object_filter_set(o, EVAS_FILTER_INVERT); + evas_object_show(o); + src = o; + o_images[i] = src; + } + + done = 0; +} + +/* cleanup */ +static void _cleanup(void) +{ + int i; + for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]); +} + +/* loop - do things */ +static void _loop(double t, int f) +{ + int i; + Evas_Coord x, y, w, h; + for (i = 0; i < OBNUM; i++) + { + w = 120; + h = 160; + x = (win_w / 2) - (w / 2); + x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2); + y = (win_h / 2) - (h / 2); + y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h / 2); + evas_object_move(o_images[i], x, y); + } + FPS_STD(NAME); +} + +/* prepend special key handlers if interactive (before STD) */ +static void _key(char *key) +{ + KEY_STD; +} + + + + + + + + + + + + +/* template stuff - ignore */ +# endif +#endif + +#ifdef UI +_ui_menu_item_add(ICON, NAME, FNAME); +#endif + +#ifdef PROTO +void FNAME(void); +#endif + +#ifndef PROTO +# ifndef UI +void FNAME(void) +{ + ui_func_set(_key, _loop); + _setup(); +} +# endif +#endif +#undef FNAME +#undef NAME +#undef ICON + diff --git a/src/bin/filter_object_invert_solid.c b/src/bin/filter_object_invert_solid.c new file mode 100644 index 0000000..03e4eaa --- /dev/null +++ b/src/bin/filter_object_invert_solid.c @@ -0,0 +1,107 @@ +#undef FNAME +#undef NAME +#undef ICON + +/* metadata */ +#define FNAME filter_object_invert_solid +#define NAME "Filter Object Invert Solid" +#define ICON "blend.png" + +#ifndef PROTO +# ifndef UI +# include "main.h" + +/* standard var */ +static int done = 0; +/* private data */ +static Evas_Object *o_images[OBNUM]; + +/* setup */ +static void _setup(void) +{ + int i; + Evas_Object *o,*src; + + for (i = 0; i < OBNUM; i++) + { + o = evas_object_image_add(evas); + evas_object_image_file_set(o, build_path("image.png"), NULL); + evas_object_image_fill_set(o, 0, 0, 120, 160); + evas_object_resize(o, 120, 160); + evas_object_filter_set(o, EVAS_FILTER_INVERT); + evas_object_layer_set(o,1); + evas_object_show(o); + src = o; + o_images[i] = src; + } + + done = 0; +} + +/* cleanup */ +static void _cleanup(void) +{ + int i; + for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]); +} + +/* loop - do things */ +static void _loop(double t, int f) +{ + int i; + Evas_Coord x, y, w, h; + for (i = 0; i < OBNUM; i++) + { + w = 120; + h = 160; + x = (win_w / 2) - (w / 2); + x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2); + y = (win_h / 2) - (h / 2); + y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h / 2); + evas_object_move(o_images[i], x, y); + } + FPS_STD(NAME); +} + +/* prepend special key handlers if interactive (before STD) */ +static void _key(char *key) +{ + KEY_STD; +} + + + + + + + + + + + + +/* template stuff - ignore */ +# endif +#endif + +#ifdef UI +_ui_menu_item_add(ICON, NAME, FNAME); +#endif + +#ifdef PROTO +void FNAME(void); +#endif + +#ifndef PROTO +# ifndef UI +void FNAME(void) +{ + ui_func_set(_key, _loop); + _setup(); +} +# endif +#endif +#undef FNAME +#undef NAME +#undef ICON + diff --git a/src/bin/filter_object_sepia.c b/src/bin/filter_object_sepia.c new file mode 100644 index 0000000..e9db58a --- /dev/null +++ b/src/bin/filter_object_sepia.c @@ -0,0 +1,106 @@ +#undef FNAME +#undef NAME +#undef ICON + +/* metadata */ +#define FNAME filter_object_sepia +#define NAME "Filter Object Sepia" +#define ICON "blend.png" + +#ifndef PROTO +# ifndef UI +# include "main.h" + +/* standard var */ +static int done = 0; +/* private data */ +static Evas_Object *o_images[OBNUM]; + +/* setup */ +static void _setup(void) +{ + int i; + Evas_Object *o,*src; + + for (i = 0; i < OBNUM; i++) + { + o = evas_object_image_add(evas); + evas_object_image_file_set(o, build_path("logo.png"), NULL); + evas_object_image_fill_set(o, 0, 0, 120, 160); + evas_object_resize(o, 120, 160); + evas_object_filter_set(o, EVAS_FILTER_SEPIA); + evas_object_show(o); + src = o; + o_images[i] = src; + } + + done = 0; +} + +/* cleanup */ +static void _cleanup(void) +{ + int i; + for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]); +} + +/* loop - do things */ +static void _loop(double t, int f) +{ + int i; + Evas_Coord x, y, w, h; + for (i = 0; i < OBNUM; i++) + { + w = 120; + h = 160; + x = (win_w / 2) - (w / 2); + x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2); + y = (win_h / 2) - (h / 2); + y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h / 2); + evas_object_move(o_images[i], x, y); + } + FPS_STD(NAME); +} + +/* prepend special key handlers if interactive (before STD) */ +static void _key(char *key) +{ + KEY_STD; +} + + + + + + + + + + + + +/* template stuff - ignore */ +# endif +#endif + +#ifdef UI +_ui_menu_item_add(ICON, NAME, FNAME); +#endif + +#ifdef PROTO +void FNAME(void); +#endif + +#ifndef PROTO +# ifndef UI +void FNAME(void) +{ + ui_func_set(_key, _loop); + _setup(); +} +# endif +#endif +#undef FNAME +#undef NAME +#undef ICON + diff --git a/src/bin/filter_object_sepia_solid.c b/src/bin/filter_object_sepia_solid.c new file mode 100644 index 0000000..3f092cf --- /dev/null +++ b/src/bin/filter_object_sepia_solid.c @@ -0,0 +1,107 @@ +#undef FNAME +#undef NAME +#undef ICON + +/* metadata */ +#define FNAME filter_object_sepia_solid +#define NAME "Filter Object Sepia Solid" +#define ICON "blend.png" + +#ifndef PROTO +# ifndef UI +# include "main.h" + +/* standard var */ +static int done = 0; +/* private data */ +static Evas_Object *o_images[OBNUM]; + +/* setup */ +static void _setup(void) +{ + int i; + Evas_Object *o,*src; + + for (i = 0; i < OBNUM; i++) + { + o = evas_object_image_add(evas); + evas_object_image_file_set(o, build_path("image.png"), NULL); + evas_object_image_fill_set(o, 0, 0, 120, 160); + evas_object_resize(o, 120, 160); + evas_object_filter_set(o, EVAS_FILTER_SEPIA); + evas_object_layer_set(o,1); + evas_object_show(o); + src = o; + o_images[i] = src; + } + + done = 0; +} + +/* cleanup */ +static void _cleanup(void) +{ + int i; + for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]); +} + +/* loop - do things */ +static void _loop(double t, int f) +{ + int i; + Evas_Coord x, y, w, h; + for (i = 0; i < OBNUM; i++) + { + w = 120; + h = 160; + x = (win_w / 2) - (w / 2); + x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2); + y = (win_h / 2) - (h / 2); + y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h / 2); + evas_object_move(o_images[i], x, y); + } + FPS_STD(NAME); +} + +/* prepend special key handlers if interactive (before STD) */ +static void _key(char *key) +{ + KEY_STD; +} + + + + + + + + + + + + +/* template stuff - ignore */ +# endif +#endif + +#ifdef UI +_ui_menu_item_add(ICON, NAME, FNAME); +#endif + +#ifdef PROTO +void FNAME(void); +#endif + +#ifndef PROTO +# ifndef UI +void FNAME(void) +{ + ui_func_set(_key, _loop); + _setup(); +} +# endif +#endif +#undef FNAME +#undef NAME +#undef ICON + diff --git a/src/bin/image_blend_border.c b/src/bin/image_blend_border.c index e946334..10d5b85 100644 --- a/src/bin/image_blend_border.c +++ b/src/bin/image_blend_border.c @@ -5,7 +5,7 @@ /* metadata */ #define FNAME image_blend_border_start #define NAME "Image Blend Border" -#define ICON "flower.png" +#define ICON "blend.png" #ifndef PROTO # ifndef UI @@ -26,7 +26,7 @@ static void _setup(void) o = evas_object_image_add(evas); o_images[i] = o; evas_object_image_file_set(o, build_path("bar.png"), NULL); - evas_object_image_border_set(o, 8, 8, 8, 8); + evas_object_image_border_set(o, 6, 6, 6, 6); evas_object_show(o); } done = 0; diff --git a/src/bin/image_blend_border_recolor.c b/src/bin/image_blend_border_recolor.c index f1047dd..3e11840 100644 --- a/src/bin/image_blend_border_recolor.c +++ b/src/bin/image_blend_border_recolor.c @@ -5,7 +5,7 @@ /* metadata */ #define FNAME image_blend_border_recolor_start #define NAME "Image Blend Border Recolor" -#define ICON "flower.png" +#define ICON "blend.png" #ifndef PROTO # ifndef UI diff --git a/src/bin/image_blend_fade_pow2_unscaled.c b/src/bin/image_blend_fade_pow2_unscaled.c new file mode 100644 index 0000000..f31acaa --- /dev/null +++ b/src/bin/image_blend_fade_pow2_unscaled.c @@ -0,0 +1,106 @@ +#undef FNAME +#undef NAME +#undef ICON + +/* metadata */ +#define FNAME image_blend_fade_pow2_unscaled_start +#define NAME "Image Blend Fade Power 2 Unscaled" +#define ICON "blend.png" + +#ifndef PROTO +# ifndef UI +# include "main.h" + +/* standard var */ +static int done = 0; +/* private data */ +static Evas_Object *o_images[OBNUM]; + +/* setup */ +static void _setup(void) +{ + int i; + Evas_Object *o; + for (i = 0; i < OBNUM; i++) + { + int a; + + o = evas_object_image_add(evas); + o_images[i] = o; + evas_object_image_file_set(o, build_path("logo.png"), NULL); + evas_object_image_fill_set(o, 0, 0, 120, 160); + evas_object_resize(o, 120, 160); + a = 256 - (1 << ((rnd() % 8) + 1)); + if (a < 128) a = 128; + evas_object_color_set(o, a, a, a, a); + evas_object_show(o); + } + done = 0; +} + +/* cleanup */ +static void _cleanup(void) +{ + int i; + for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]); +} + +/* loop - do things */ +static void _loop(double t, int f) +{ + int i; + Evas_Coord x, y, w, h; + for (i = 0; i < OBNUM; i++) + { + w = 120; + h = 160; + x = (win_w / 2) - (w / 2); + x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2); + y = (win_h / 2) - (h / 2); + y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h / 2); + evas_object_move(o_images[i], x, y); + } + FPS_STD(NAME); +} + +/* prepend special key handlers if interactive (before STD) */ +static void _key(char *key) +{ + KEY_STD; +} + + + + + + + + + + + + +/* template stuff - ignore */ +# endif +#endif + +#ifdef UI +_ui_menu_item_add(ICON, NAME, FNAME); +#endif + +#ifdef PROTO +void FNAME(void); +#endif + +#ifndef PROTO +# ifndef UI +void FNAME(void) +{ + ui_func_set(_key, _loop); + _setup(); +} +# endif +#endif +#undef FNAME +#undef NAME +#undef ICON diff --git a/src/bin/image_blend_fade_unscaled.c b/src/bin/image_blend_fade_unscaled.c new file mode 100644 index 0000000..658110f --- /dev/null +++ b/src/bin/image_blend_fade_unscaled.c @@ -0,0 +1,105 @@ +#undef FNAME +#undef NAME +#undef ICON + +/* metadata */ +#define FNAME image_blend_fade_unscaled_start +#define NAME "Image Blend Fade Unscaled" +#define ICON "blend.png" + +#ifndef PROTO +# ifndef UI +# include "main.h" + +/* standard var */ +static int done = 0; +/* private data */ +static Evas_Object *o_images[OBNUM]; + +/* setup */ +static void _setup(void) +{ + int i; + Evas_Object *o; + for (i = 0; i < OBNUM; i++) + { + int a; + + o = evas_object_image_add(evas); + o_images[i] = o; + evas_object_image_file_set(o, build_path("logo.png"), NULL); + evas_object_image_fill_set(o, 0, 0, 120, 160); + evas_object_resize(o, 120, 160); + a = rnd()&0xff; + evas_object_color_set(o, a, a, a, a); + evas_object_show(o); + } + done = 0; +} + +/* cleanup */ +static void _cleanup(void) +{ + int i; + for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]); +} + +/* loop - do things */ +static void _loop(double t, int f) +{ + int i; + Evas_Coord x, y, w, h; + for (i = 0; i < OBNUM; i++) + { + w = 120; + h = 160; + x = (win_w / 2) - (w / 2); + x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2); + y = (win_h / 2) - (h / 2); + y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h / 2); + evas_object_move(o_images[i], x, y); + } + FPS_STD(NAME); +} + +/* prepend special key handlers if interactive (before STD) */ +static void _key(char *key) +{ + KEY_STD; +} + + + + + + + + + + + + +/* template stuff - ignore */ +# endif +#endif + +#ifdef UI +_ui_menu_item_add(ICON, NAME, FNAME); +#endif + +#ifdef PROTO +void FNAME(void); +#endif + +#ifndef PROTO +# ifndef UI +void FNAME(void) +{ + ui_func_set(_key, _loop); + _setup(); +} +# endif +#endif +#undef FNAME +#undef NAME +#undef ICON diff --git a/src/bin/image_blend_nearest_same_scaled.c b/src/bin/image_blend_nearest_same_scaled.c new file mode 100644 index 0000000..52ba6d7 --- /dev/null +++ b/src/bin/image_blend_nearest_same_scaled.c @@ -0,0 +1,104 @@ +#undef FNAME +#undef NAME +#undef ICON + +/* metadata */ +#define FNAME image_blend_nearest_same_scaled_start +#define NAME "Image Blend Nearest Same Scaled" +#define ICON "blend.png" + +#ifndef PROTO +# ifndef UI +# include "main.h" + +/* standard var */ +static int done = 0; +/* private data */ +static Evas_Object *o_images[OBNUM]; + +/* setup */ +static void _setup(void) +{ + int i; + Evas_Object *o; + for (i = 0; i < OBNUM; i++) + { + o = evas_object_image_add(evas); + o_images[i] = o; + evas_object_image_file_set(o, build_path("logo.png"), NULL); + evas_object_image_smooth_scale_set(o, 0); + evas_object_show(o); + } + done = 0; +} + +/* cleanup */ +static void _cleanup(void) +{ + int i; + for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]); +} + +/* loop - do things */ +static void _loop(double t, int f) +{ + int i; + Evas_Coord x, y, w, h, w0, h0; + for (i = 0; i < OBNUM; i++) + { + w0 = 80; + h0 = 80; + w = 40 + ((i % 3) * (w0 / 2)); + h = 40 + ((i % 3) * (h0 / 2)); + x = (win_w / 2) - (w / 2); + x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w0 / 2); + y = (win_h / 2) - (h / 2); + y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h0 / 2); + evas_object_move(o_images[i], x, y); + evas_object_resize(o_images[i], w, h); + evas_object_image_fill_set(o_images[i], 0, 0, w, h); + } + FPS_STD(NAME); +} + +/* prepend special key handlers if interactive (before STD) */ +static void _key(char *key) +{ + KEY_STD; +} + + + + + + + + + + + + +/* template stuff - ignore */ +# endif +#endif + +#ifdef UI +_ui_menu_item_add(ICON, NAME, FNAME); +#endif + +#ifdef PROTO +void FNAME(void); +#endif + +#ifndef PROTO +# ifndef UI +void FNAME(void) +{ + ui_func_set(_key, _loop); + _setup(); +} +# endif +#endif +#undef FNAME +#undef NAME +#undef ICON diff --git a/src/bin/image_blend_nearest_scaled.c b/src/bin/image_blend_nearest_scaled.c index 9f09e75..47a431e 100644 --- a/src/bin/image_blend_nearest_scaled.c +++ b/src/bin/image_blend_nearest_scaled.c @@ -5,7 +5,7 @@ /* metadata */ #define FNAME image_blend_nearest_scaled_start #define NAME "Image Blend Nearest Scaled" -#define ICON "flower.png" +#define ICON "blend.png" #ifndef PROTO # ifndef UI diff --git a/src/bin/image_blend_nearest_solid_same_scaled.c b/src/bin/image_blend_nearest_solid_same_scaled.c new file mode 100644 index 0000000..e8979b4 --- /dev/null +++ b/src/bin/image_blend_nearest_solid_same_scaled.c @@ -0,0 +1,104 @@ +#undef FNAME +#undef NAME +#undef ICON + +/* metadata */ +#define FNAME image_blend_nearest_solid_same_scaled_start +#define NAME "Image Blend Nearest Solid Same Scaled" +#define ICON "blend.png" + +#ifndef PROTO +# ifndef UI +# include "main.h" + +/* standard var */ +static int done = 0; +/* private data */ +static Evas_Object *o_images[OBNUM]; + +/* setup */ +static void _setup(void) +{ + int i; + Evas_Object *o; + for (i = 0; i < OBNUM; i++) + { + o = evas_object_image_add(evas); + o_images[i] = o; + evas_object_image_file_set(o, build_path("image.png"), NULL); + evas_object_image_smooth_scale_set(o, 0); + evas_object_show(o); + } + done = 0; +} + +/* cleanup */ +static void _cleanup(void) +{ + int i; + for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]); +} + +/* loop - do things */ +static void _loop(double t, int f) +{ + int i; + Evas_Coord x, y, w, h, w0, h0; + for (i = 0; i < OBNUM; i++) + { + w0 = 80; + h0 = 80; + w = 40 + ((i % 3) * (w0 / 2)); + h = 40 + ((i % 3) * (h0 / 2)); + x = (win_w / 2) - (w / 2); + x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w0 / 2); + y = (win_h / 2) - (h / 2); + y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h0 / 2); + evas_object_move(o_images[i], x, y); + evas_object_resize(o_images[i], w, h); + evas_object_image_fill_set(o_images[i], 0, 0, w, h); + } + FPS_STD(NAME); +} + +/* prepend special key handlers if interactive (before STD) */ +static void _key(char *key) +{ + KEY_STD; +} + + + + + + + + + + + + +/* template stuff - ignore */ +# endif +#endif + +#ifdef UI +_ui_menu_item_add(ICON, NAME, FNAME); +#endif + +#ifdef PROTO +void FNAME(void); +#endif + +#ifndef PROTO +# ifndef UI +void FNAME(void) +{ + ui_func_set(_key, _loop); + _setup(); +} +# endif +#endif +#undef FNAME +#undef NAME +#undef ICON diff --git a/src/bin/image_blend_nearest_solid_scaled.c b/src/bin/image_blend_nearest_solid_scaled.c index ddb1e51..1bd75df 100644 --- a/src/bin/image_blend_nearest_solid_scaled.c +++ b/src/bin/image_blend_nearest_solid_scaled.c @@ -5,7 +5,7 @@ /* metadata */ #define FNAME image_blend_nearest_solid_scaled_start #define NAME "Image Blend Nearest Solid Scaled" -#define ICON "flower.png" +#define ICON "blend.png" #ifndef PROTO # ifndef UI diff --git a/src/bin/image_blend_occlude1.c b/src/bin/image_blend_occlude1.c index 5020ad6..098ee57 100644 --- a/src/bin/image_blend_occlude1.c +++ b/src/bin/image_blend_occlude1.c @@ -5,7 +5,7 @@ /* metadata */ #define FNAME image_blend_occlude1_start #define NAME "Image Blend Occlude 1" -#define ICON "flower.png" +#define ICON "blend.png" #ifndef PROTO # ifndef UI diff --git a/src/bin/image_blend_occlude1_few.c b/src/bin/image_blend_occlude1_few.c index a8fbd7c..c0ba2dc 100644 --- a/src/bin/image_blend_occlude1_few.c +++ b/src/bin/image_blend_occlude1_few.c @@ -5,7 +5,7 @@ /* metadata */ #define FNAME image_blend_occlude1_few_start #define NAME "Image Blend Occlude 1 Few" -#define ICON "flower.png" +#define ICON "blend.png" #ifndef PROTO # ifndef UI diff --git a/src/bin/image_blend_occlude1_many.c b/src/bin/image_blend_occlude1_many.c index 3fe8b77..02a0f09 100644 --- a/src/bin/image_blend_occlude1_many.c +++ b/src/bin/image_blend_occlude1_many.c @@ -5,7 +5,7 @@ /* metadata */ #define FNAME image_blend_occlude1_many_start #define NAME "Image Blend Occlude 1 Many" -#define ICON "flower.png" +#define ICON "blend.png" #ifndef PROTO # ifndef UI diff --git a/src/bin/image_blend_occlude1_very_many.c b/src/bin/image_blend_occlude1_very_many.c index 837557b..51b44f8 100644 --- a/src/bin/image_blend_occlude1_very_many.c +++ b/src/bin/image_blend_occlude1_very_many.c @@ -5,7 +5,7 @@ /* metadata */ #define FNAME image_blend_occlude1_very_many_start #define NAME "Image Blend Occlude 1 Very Many" -#define ICON "flower.png" +#define ICON "blend.png" #ifndef PROTO # ifndef UI diff --git a/src/bin/image_blend_occlude2.c b/src/bin/image_blend_occlude2.c index 3647eac..4557bce 100644 --- a/src/bin/image_blend_occlude2.c +++ b/src/bin/image_blend_occlude2.c @@ -5,7 +5,7 @@ /* metadata */ #define FNAME image_blend_occlude2_start #define NAME "Image Blend Occlude 2" -#define ICON "flower.png" +#define ICON "blend.png" #ifndef PROTO # ifndef UI diff --git a/src/bin/image_blend_occlude2_few.c b/src/bin/image_blend_occlude2_few.c index d717852..8aca4b1 100644 --- a/src/bin/image_blend_occlude2_few.c +++ b/src/bin/image_blend_occlude2_few.c @@ -5,7 +5,7 @@ /* metadata */ #define FNAME image_blend_occlude2_few_start #define NAME "Image Blend Occlude 2 Few" -#define ICON "flower.png" +#define ICON "blend.png" #ifndef PROTO # ifndef UI diff --git a/src/bin/image_blend_occlude2_many.c b/src/bin/image_blend_occlude2_many.c index de2f1f7..b0ab9ba 100644 --- a/src/bin/image_blend_occlude2_many.c +++ b/src/bin/image_blend_occlude2_many.c @@ -5,7 +5,7 @@ /* metadata */ #define FNAME image_blend_occlude2_many_start #define NAME "Image Blend Occlude 2 Many" -#define ICON "flower.png" +#define ICON "blend.png" #ifndef PROTO # ifndef UI diff --git a/src/bin/image_blend_occlude2_very_many.c b/src/bin/image_blend_occlude2_very_many.c index 30b5880..776ada8 100644 --- a/src/bin/image_blend_occlude2_very_many.c +++ b/src/bin/image_blend_occlude2_very_many.c @@ -5,7 +5,7 @@ /* metadata */ #define FNAME image_blend_occlude2_very_many_start #define NAME "Image Blend Occlude 2 Very Many" -#define ICON "flower.png" +#define ICON "blend.png" #ifndef PROTO # ifndef UI diff --git a/src/bin/image_blend_occlude3.c b/src/bin/image_blend_occlude3.c index 46d9836..fa69b97 100644 --- a/src/bin/image_blend_occlude3.c +++ b/src/bin/image_blend_occlude3.c @@ -5,7 +5,7 @@ /* metadata */ #define FNAME image_blend_occlude3_start #define NAME "Image Blend Occlude 3" -#define ICON "flower.png" +#define ICON "blend.png" #ifndef PROTO # ifndef UI diff --git a/src/bin/image_blend_occlude3_few.c b/src/bin/image_blend_occlude3_few.c index 2d38fae..92166f1 100644 --- a/src/bin/image_blend_occlude3_few.c +++ b/src/bin/image_blend_occlude3_few.c @@ -5,7 +5,7 @@ /* metadata */ #define FNAME image_blend_occlude3_few_start #define NAME "Image Blend Occlude 3 Few" -#define ICON "flower.png" +#define ICON "blend.png" #ifndef PROTO # ifndef UI diff --git a/src/bin/image_blend_occlude3_many.c b/src/bin/image_blend_occlude3_many.c index 7979a43..aecb5ee 100644 --- a/src/bin/image_blend_occlude3_many.c +++ b/src/bin/image_blend_occlude3_many.c @@ -5,7 +5,7 @@ /* metadata */ #define FNAME image_blend_occlude3_many_start #define NAME "Image Blend Occlude 3 Many" -#define ICON "flower.png" +#define ICON "blend.png" #ifndef PROTO # ifndef UI diff --git a/src/bin/image_blend_occlude3_very_many.c b/src/bin/image_blend_occlude3_very_many.c index d7797df..ea353ba 100644 --- a/src/bin/image_blend_occlude3_very_many.c +++ b/src/bin/image_blend_occlude3_very_many.c @@ -5,7 +5,7 @@ /* metadata */ #define FNAME image_blend_occlude3_very_many_start #define NAME "Image Blend Occlude 3 Very Many" -#define ICON "flower.png" +#define ICON "blend.png" #ifndef PROTO # ifndef UI diff --git a/src/bin/image_blend_smooth_same_scaled.c b/src/bin/image_blend_smooth_same_scaled.c new file mode 100644 index 0000000..a1e6fc3 --- /dev/null +++ b/src/bin/image_blend_smooth_same_scaled.c @@ -0,0 +1,104 @@ +#undef FNAME +#undef NAME +#undef ICON + +/* metadata */ +#define FNAME image_blend_smooth_same_scaled_start +#define NAME "Image Blend Smooth Same Scaled" +#define ICON "blend.png" + +#ifndef PROTO +# ifndef UI +# include "main.h" + +/* standard var */ +static int done = 0; +/* private data */ +static Evas_Object *o_images[OBNUM]; + +/* setup */ +static void _setup(void) +{ + int i; + Evas_Object *o; + for (i = 0; i < OBNUM; i++) + { + o = evas_object_image_add(evas); + o_images[i] = o; + evas_object_image_file_set(o, build_path("logo.png"), NULL); + evas_object_image_smooth_scale_set(o, 1); + evas_object_show(o); + } + done = 0; +} + +/* cleanup */ +static void _cleanup(void) +{ + int i; + for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]); +} + +/* loop - do things */ +static void _loop(double t, int f) +{ + int i; + Evas_Coord x, y, w, h, w0, h0; + for (i = 0; i < OBNUM; i++) + { + w0 = 80; + h0 = 80; + w = 40 + ((i % 3) * (w0 / 2)); + h = 40 + ((i % 3) * (h0 / 2)); + x = (win_w / 2) - (w / 2); + x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w0 / 2); + y = (win_h / 2) - (h / 2); + y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h0 / 2); + evas_object_move(o_images[i], x, y); + evas_object_resize(o_images[i], w, h); + evas_object_image_fill_set(o_images[i], 0, 0, w, h); + } + FPS_STD(NAME); +} + +/* prepend special key handlers if interactive (before STD) */ +static void _key(char *key) +{ + KEY_STD; +} + + + + + + + + + + + + +/* template stuff - ignore */ +# endif +#endif + +#ifdef UI +_ui_menu_item_add(ICON, NAME, FNAME); +#endif + +#ifdef PROTO +void FNAME(void); +#endif + +#ifndef PROTO +# ifndef UI +void FNAME(void) +{ + ui_func_set(_key, _loop); + _setup(); +} +# endif +#endif +#undef FNAME +#undef NAME +#undef ICON diff --git a/src/bin/image_blend_smooth_scaled.c b/src/bin/image_blend_smooth_scaled.c index 7c86bdb..b2086f0 100644 --- a/src/bin/image_blend_smooth_scaled.c +++ b/src/bin/image_blend_smooth_scaled.c @@ -5,7 +5,7 @@ /* metadata */ #define FNAME image_blend_smooth_scaled_start #define NAME "Image Blend Smooth Scaled" -#define ICON "flower.png" +#define ICON "blend.png" #ifndef PROTO # ifndef UI diff --git a/src/bin/image_blend_smooth_solid_same_scaled.c b/src/bin/image_blend_smooth_solid_same_scaled.c new file mode 100644 index 0000000..41366a3 --- /dev/null +++ b/src/bin/image_blend_smooth_solid_same_scaled.c @@ -0,0 +1,104 @@ +#undef FNAME +#undef NAME +#undef ICON + +/* metadata */ +#define FNAME image_blend_smooth_solid_same_scaled_start +#define NAME "Image Blend Smooth Solid Same Scaled" +#define ICON "blend.png" + +#ifndef PROTO +# ifndef UI +# include "main.h" + +/* standard var */ +static int done = 0; +/* private data */ +static Evas_Object *o_images[OBNUM]; + +/* setup */ +static void _setup(void) +{ + int i; + Evas_Object *o; + for (i = 0; i < OBNUM; i++) + { + o = evas_object_image_add(evas); + o_images[i] = o; + evas_object_image_file_set(o, build_path("image.png"), NULL); + evas_object_image_smooth_scale_set(o, 1); + evas_object_show(o); + } + done = 0; +} + +/* cleanup */ +static void _cleanup(void) +{ + int i; + for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]); +} + +/* loop - do things */ +static void _loop(double t, int f) +{ + int i; + Evas_Coord x, y, w, h, w0, h0; + for (i = 0; i < OBNUM; i++) + { + w0 = 80; + h0 = 80; + w = 40 + ((i % 3) * (w0 / 2)); + h = 40 + ((i % 3) * (h0 / 2)); + x = (win_w / 2) - (w / 2); + x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w0 / 2); + y = (win_h / 2) - (h / 2); + y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h0 / 2); + evas_object_move(o_images[i], x, y); + evas_object_resize(o_images[i], w, h); + evas_object_image_fill_set(o_images[i], 0, 0, w, h); + } + FPS_STD(NAME); +} + +/* prepend special key handlers if interactive (before STD) */ +static void _key(char *key) +{ + KEY_STD; +} + + + + + + + + + + + + +/* template stuff - ignore */ +# endif +#endif + +#ifdef UI +_ui_menu_item_add(ICON, NAME, FNAME); +#endif + +#ifdef PROTO +void FNAME(void); +#endif + +#ifndef PROTO +# ifndef UI +void FNAME(void) +{ + ui_func_set(_key, _loop); + _setup(); +} +# endif +#endif +#undef FNAME +#undef NAME +#undef ICON diff --git a/src/bin/image_blend_smooth_solid_scaled.c b/src/bin/image_blend_smooth_solid_scaled.c index c5d9e0b..e4028bd 100644 --- a/src/bin/image_blend_smooth_solid_scaled.c +++ b/src/bin/image_blend_smooth_solid_scaled.c @@ -5,7 +5,7 @@ /* metadata */ #define FNAME image_blend_smooth_solid_scaled_start #define NAME "Image Blend Smooth Solid Scaled" -#define ICON "flower.png" +#define ICON "blend.png" #ifndef PROTO # ifndef UI diff --git a/src/bin/image_blend_solid_border.c b/src/bin/image_blend_solid_border.c index 7662606..2e1b0bb 100644 --- a/src/bin/image_blend_solid_border.c +++ b/src/bin/image_blend_solid_border.c @@ -5,7 +5,7 @@ /* metadata */ #define FNAME image_blend_solid_border_start #define NAME "Image Blend Solid Border" -#define ICON "flower.png" +#define ICON "blend.png" #ifndef PROTO # ifndef UI diff --git a/src/bin/image_blend_solid_fade_pow2_unscaled.c b/src/bin/image_blend_solid_fade_pow2_unscaled.c new file mode 100644 index 0000000..1af71db --- /dev/null +++ b/src/bin/image_blend_solid_fade_pow2_unscaled.c @@ -0,0 +1,106 @@ +#undef FNAME +#undef NAME +#undef ICON + +/* metadata */ +#define FNAME image_blend_solid_fade_pow2_unscaled_start +#define NAME "Image Blend Solid Fade Power 2 Unscaled" +#define ICON "blend.png" + +#ifndef PROTO +# ifndef UI +# include "main.h" + +/* standard var */ +static int done = 0; +/* private data */ +static Evas_Object *o_images[OBNUM]; + +/* setup */ +static void _setup(void) +{ + int i; + Evas_Object *o; + for (i = 0; i < OBNUM; i++) + { + int a; + + o = evas_object_image_add(evas); + o_images[i] = o; + evas_object_image_file_set(o, build_path("image.png"), NULL); + evas_object_image_fill_set(o, 0, 0, 120, 160); + evas_object_resize(o, 120, 160); + a = 256 - (1 << ((rnd() % 8) + 1)); + if (a < 128) a = 128; + evas_object_color_set(o, a, a, a, a); + evas_object_show(o); + } + done = 0; +} + +/* cleanup */ +static void _cleanup(void) +{ + int i; + for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]); +} + +/* loop - do things */ +static void _loop(double t, int f) +{ + int i; + Evas_Coord x, y, w, h; + for (i = 0; i < OBNUM; i++) + { + w = 120; + h = 160; + x = (win_w / 2) - (w / 2); + x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2); + y = (win_h / 2) - (h / 2); + y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h / 2); + evas_object_move(o_images[i], x, y); + } + FPS_STD(NAME); +} + +/* prepend special key handlers if interactive (before STD) */ +static void _key(char *key) +{ + KEY_STD; +} + + + + + + + + + + + + +/* template stuff - ignore */ +# endif +#endif + +#ifdef UI +_ui_menu_item_add(ICON, NAME, FNAME); +#endif + +#ifdef PROTO +void FNAME(void); +#endif + +#ifndef PROTO +# ifndef UI +void FNAME(void) +{ + ui_func_set(_key, _loop); + _setup(); +} +# endif +#endif +#undef FNAME +#undef NAME +#undef ICON diff --git a/src/bin/image_blend_solid_fade_unscaled.c b/src/bin/image_blend_solid_fade_unscaled.c new file mode 100644 index 0000000..6a6cb9f --- /dev/null +++ b/src/bin/image_blend_solid_fade_unscaled.c @@ -0,0 +1,105 @@ +#undef FNAME +#undef NAME +#undef ICON + +/* metadata */ +#define FNAME image_blend_solid_fade_unscaled_start +#define NAME "Image Blend Solid Fade Unscaled" +#define ICON "blend.png" + +#ifndef PROTO +# ifndef UI +# include "main.h" + +/* standard var */ +static int done = 0; +/* private data */ +static Evas_Object *o_images[OBNUM]; + +/* setup */ +static void _setup(void) +{ + int i; + Evas_Object *o; + for (i = 0; i < OBNUM; i++) + { + int a; + + o = evas_object_image_add(evas); + o_images[i] = o; + evas_object_image_file_set(o, build_path("image.png"), NULL); + evas_object_image_fill_set(o, 0, 0, 120, 160); + evas_object_resize(o, 120, 160); + a = rnd()&0xff; + evas_object_color_set(o, a, a, a, a); + evas_object_show(o); + } + done = 0; +} + +/* cleanup */ +static void _cleanup(void) +{ + int i; + for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]); +} + +/* loop - do things */ +static void _loop(double t, int f) +{ + int i; + Evas_Coord x, y, w, h; + for (i = 0; i < OBNUM; i++) + { + w = 120; + h = 160; + x = (win_w / 2) - (w / 2); + x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2); + y = (win_h / 2) - (h / 2); + y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h / 2); + evas_object_move(o_images[i], x, y); + } + FPS_STD(NAME); +} + +/* prepend special key handlers if interactive (before STD) */ +static void _key(char *key) +{ + KEY_STD; +} + + + + + + + + + + + + +/* template stuff - ignore */ +# endif +#endif + +#ifdef UI +_ui_menu_item_add(ICON, NAME, FNAME); +#endif + +#ifdef PROTO +void FNAME(void); +#endif + +#ifndef PROTO +# ifndef UI +void FNAME(void) +{ + ui_func_set(_key, _loop); + _setup(); +} +# endif +#endif +#undef FNAME +#undef NAME +#undef ICON diff --git a/src/bin/image_blend_solid_middle_border.c b/src/bin/image_blend_solid_middle_border.c new file mode 100644 index 0000000..5a7d6f9 --- /dev/null +++ b/src/bin/image_blend_solid_middle_border.c @@ -0,0 +1,105 @@ +#undef FNAME +#undef NAME +#undef ICON + +/* metadata */ +#define FNAME image_blend_solid_middle_border +#define NAME "Image Blend Solid Middle Border" +#define ICON "blend.png" + +#ifndef PROTO +# ifndef UI +# include "main.h" + +/* standard var */ +static int done = 0; +/* private data */ +static Evas_Object *o_images[OBNUM]; + +/* setup */ +static void _setup(void) +{ + int i; + Evas_Object *o; + for (i = 0; i < OBNUM; i++) + { + o = evas_object_image_add(evas); + o_images[i] = o; + evas_object_image_file_set(o, build_path("bar.png"), NULL); + evas_object_image_border_set(o, 6, 6, 6, 6); + evas_object_image_border_center_fill_set(o, EVAS_BORDER_FILL_SOLID); + evas_object_show(o); + } + done = 0; +} + +/* cleanup */ +static void _cleanup(void) +{ + int i; + for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]); +} + +/* loop - do things */ +static void _loop(double t, int f) +{ + int i; + Evas_Coord x, y, w, h, w0, h0; + for (i = 0; i < OBNUM; i++) + { + w0 = 80; + h0 = 80; + w = 5 + ((1.0 + cos((double)(f + (i * 10)) / (7.4 * SLOW) )) * w0 * 2); + h = 5 + ((1.0 + sin((double)(f + (i * 19)) / (12.6 * SLOW) )) * h0 * 2); + x = (win_w / 2) - (w / 2); + x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w0 / 2); + y = (win_h / 2) - (h / 2); + y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h0 / 2); + evas_object_move(o_images[i], x, y); + evas_object_resize(o_images[i], w, h); + evas_object_image_fill_set(o_images[i], 0, 0, w, h); + } + FPS_STD(NAME); +} + +/* prepend special key handlers if interactive (before STD) */ +static void _key(char *key) +{ + KEY_STD; +} + + + + + + + + + + + + +/* template stuff - ignore */ +# endif +#endif + +#ifdef UI +_ui_menu_item_add(ICON, NAME, FNAME); +#endif + +#ifdef PROTO +void FNAME(void); +#endif + +#ifndef PROTO +# ifndef UI +void FNAME(void) +{ + ui_func_set(_key, _loop); + _setup(); +} +# endif +#endif +#undef FNAME +#undef NAME +#undef ICON diff --git a/src/bin/image_blend_solid_middle_unscaled.c b/src/bin/image_blend_solid_middle_unscaled.c new file mode 100644 index 0000000..b2a30ca --- /dev/null +++ b/src/bin/image_blend_solid_middle_unscaled.c @@ -0,0 +1,103 @@ +#undef FNAME +#undef NAME +#undef ICON + +/* metadata */ +#define FNAME image_blend_solid_middle_unscaled_start +#define NAME "Image Blend Solid Middle Unscaled" +#define ICON "blend.png" + +#ifndef PROTO +# ifndef UI +# include "main.h" + +/* standard var */ +static int done = 0; +/* private data */ +static Evas_Object *o_images[OBNUM]; + +/* setup */ +static void _setup(void) +{ + int i; + Evas_Object *o; + for (i = 0; i < OBNUM; i++) + { + o = evas_object_image_add(evas); + o_images[i] = o; + evas_object_image_file_set(o, build_path("logo.png"), NULL); + evas_object_image_fill_set(o, 0, 0, 120, 160); + evas_object_resize(o, 120, 160); + evas_object_image_border_set(o, 43, 48, 48, 83); + evas_object_image_border_center_fill_set(o, EVAS_BORDER_FILL_SOLID); + evas_object_show(o); + } + done = 0; +} + +/* cleanup */ +static void _cleanup(void) +{ + int i; + for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]); +} + +/* loop - do things */ +static void _loop(double t, int f) +{ + int i; + Evas_Coord x, y, w, h; + for (i = 0; i < OBNUM; i++) + { + w = 120; + h = 160; + x = (win_w / 2) - (w / 2); + x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2); + y = (win_h / 2) - (h / 2); + y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h / 2); + evas_object_move(o_images[i], x, y); + } + FPS_STD(NAME); +} + +/* prepend special key handlers if interactive (before STD) */ +static void _key(char *key) +{ + KEY_STD; +} + + + + + + + + + + + + +/* template stuff - ignore */ +# endif +#endif + +#ifdef UI +_ui_menu_item_add(ICON, NAME, FNAME); +#endif + +#ifdef PROTO +void FNAME(void); +#endif + +#ifndef PROTO +# ifndef UI +void FNAME(void) +{ + ui_func_set(_key, _loop); + _setup(); +} +# endif +#endif +#undef FNAME +#undef NAME +#undef ICON diff --git a/src/bin/image_blend_solid_unscaled.c b/src/bin/image_blend_solid_unscaled.c index b7f20a5..136323e 100644 --- a/src/bin/image_blend_solid_unscaled.c +++ b/src/bin/image_blend_solid_unscaled.c @@ -5,7 +5,7 @@ /* metadata */ #define FNAME image_blend_solid_unscaled_start #define NAME "Image Blend Solid Unscaled" -#define ICON "flower.png" +#define ICON "blend.png" #ifndef PROTO # ifndef UI diff --git a/src/bin/image_blend_unscaled.c b/src/bin/image_blend_unscaled.c index db37283..02feb60 100644 --- a/src/bin/image_blend_unscaled.c +++ b/src/bin/image_blend_unscaled.c @@ -5,7 +5,7 @@ /* metadata */ #define FNAME image_blend_unscaled_start #define NAME "Image Blend Unscaled" -#define ICON "flower.png" +#define ICON "blend.png" #ifndef PROTO # ifndef UI diff --git a/src/bin/image_crossfade.c b/src/bin/image_crossfade.c index c1139a5..3a824a8 100644 --- a/src/bin/image_crossfade.c +++ b/src/bin/image_crossfade.c @@ -5,7 +5,7 @@ /* metadata */ #define FNAME image_crossfade_start #define NAME "Image Crossfade" -#define ICON "mushroom.png" +#define ICON "blend.png" #ifndef PROTO # ifndef UI diff --git a/src/bin/image_data_argb.c b/src/bin/image_data_argb.c index 5c66efc..90f6779 100644 --- a/src/bin/image_data_argb.c +++ b/src/bin/image_data_argb.c @@ -5,7 +5,7 @@ /* metadata */ #define FNAME image_data_argb_start #define NAME "Image Data ARGB" -#define ICON "mushroom.png" +#define ICON "data.png" #ifndef PROTO # ifndef UI @@ -26,6 +26,7 @@ static void _setup(void) { o = evas_object_image_add(evas); o_images[i] = o; + evas_object_image_content_hint_set(o, EVAS_IMAGE_CONTENT_HINT_DYNAMIC); evas_object_image_colorspace_set(o, EVAS_COLORSPACE_ARGB8888); evas_object_image_size_set(o, 640, 480); evas_object_image_alpha_set(o, 0); @@ -46,12 +47,12 @@ static void _cleanup(void) /* loop - do things */ static void _loop(double t, int f) { - int i; + int i, st; Evas_Coord x, y, w, h; for (i = 0; i < 1; i++) { unsigned int *data, *p; - int ff; + w = 640; h = 480; x = (win_w / 2) - (w / 2); @@ -60,18 +61,19 @@ static void _loop(double t, int f) evas_object_resize(o_images[i], w, h); evas_object_image_fill_set(o_images[i], 0, 0, w, h); data = evas_object_image_data_get(o_images[i], 1); + st = evas_object_image_stride_get(o_images[i]) >> 2; p = data; - ff = (f ^ (f << 8) ^ (f << 16) ^ (f << 24)); - for (y = 0; y < 480; y++) + for (y = 0; y < h; y++) { - for (x = 0; x < 640; x++) + for (x = 0; x < w; x++) { *p = ((((x * y) + f) << 8) ^ (x - y - f)) | 0xff000000; p++; } + p += (st - w); } evas_object_image_data_set(o_images[i], data); - evas_object_image_data_update_add(o_images[i], 0, 0, 640, 480); + evas_object_image_data_update_add(o_images[i], 0, 0, w, h); } FPS_STD(NAME); } diff --git a/src/bin/image_data_argb_alpha.c b/src/bin/image_data_argb_alpha.c index 04e6299..1498fb7 100644 --- a/src/bin/image_data_argb_alpha.c +++ b/src/bin/image_data_argb_alpha.c @@ -5,7 +5,7 @@ /* metadata */ #define FNAME image_data_argb_alpha_start #define NAME "Image Data ARGB Alpha" -#define ICON "mushroom.png" +#define ICON "data.png" #ifndef PROTO # ifndef UI @@ -26,6 +26,7 @@ static void _setup(void) { o = evas_object_image_add(evas); o_images[i] = o; + evas_object_image_content_hint_set(o, EVAS_IMAGE_CONTENT_HINT_DYNAMIC); evas_object_image_colorspace_set(o, EVAS_COLORSPACE_ARGB8888); evas_object_image_size_set(o, 640, 480); evas_object_image_alpha_set(o, 1); @@ -46,12 +47,12 @@ static void _cleanup(void) /* loop - do things */ static void _loop(double t, int f) { - int i; + int i, st; Evas_Coord x, y, w, h; for (i = 0; i < 1; i++) { unsigned int *data, *p; - int ff, a, r, g, b; + int a, r, g, b; w = 640; h = 480; x = (win_w / 2) - (w / 2); @@ -60,11 +61,11 @@ static void _loop(double t, int f) evas_object_resize(o_images[i], w, h); evas_object_image_fill_set(o_images[i], 0, 0, w, h); data = evas_object_image_data_get(o_images[i], 1); + st = evas_object_image_stride_get(o_images[i]) >> 2; p = data; - ff = (f ^ (f << 8) ^ (f << 16) ^ (f << 24)); - for (y = 0; y < 480; y++) + for (y = 0; y < h; y++) { - for (x = 0; x < 640; x++) + for (x = 0; x < w; x++) { r = (x * y / 7) + f; g = (x / 2); @@ -80,9 +81,10 @@ static void _loop(double t, int f) *p = (a << 24) | (r << 16) | (g << 8) | b; p++; } + p += (st - w); } evas_object_image_data_set(o_images[i], data); - evas_object_image_data_update_add(o_images[i], 0, 0, 640, 480); + evas_object_image_data_update_add(o_images[i], 0, 0, w, h); } FPS_STD(NAME); } diff --git a/src/bin/image_data_ycbcr601pl.c b/src/bin/image_data_ycbcr601pl.c index 55f68a8..d3be38f 100644 --- a/src/bin/image_data_ycbcr601pl.c +++ b/src/bin/image_data_ycbcr601pl.c @@ -5,7 +5,7 @@ /* metadata */ #define FNAME image_data_ycbcr601pl_start #define NAME "Image Data YCbCr 601 Pointer List" -#define ICON "mushroom.png" +#define ICON "data.png" #ifndef PROTO # ifndef UI @@ -23,12 +23,14 @@ static void _setup(void) { int i, y; FILE *f; + size_t r; unsigned char **data, **lp; Evas_Object *o; for (i = 0; i < 1; i++) { o = evas_object_image_add(evas); o_images[i] = o; + evas_object_image_content_hint_set(o, EVAS_IMAGE_CONTENT_HINT_DYNAMIC); evas_object_image_colorspace_set(o, EVAS_COLORSPACE_YCBCR422P601_PL); evas_object_image_size_set(o, 640, 480); evas_object_image_alpha_set(o, 0); @@ -41,9 +43,9 @@ static void _setup(void) f = fopen(build_path("tp.yuv"), "rb"); if (f) { - fread(yp, 640 * 480, 1, f); - fread(up, 320 * 240, 1, f); - fread(vp, 320 * 240, 1, f); + r = fread(yp, 640 * 480, 1, f); + r = fread(up, 320 * 240, 1, f); + r = fread(vp, 320 * 240, 1, f); fclose(f); } data = evas_object_image_data_get(o_images[i], 1); diff --git a/src/bin/image_data_ycbcr601pl_map_nearest_solid_rotate.c b/src/bin/image_data_ycbcr601pl_map_nearest_solid_rotate.c new file mode 100644 index 0000000..3b827fa --- /dev/null +++ b/src/bin/image_data_ycbcr601pl_map_nearest_solid_rotate.c @@ -0,0 +1,149 @@ +#undef FNAME +#undef NAME +#undef ICON + +/* metadata */ +#define FNAME image_data_ycbcr601pl_map_nearest_solid_rotate_start +#define NAME "Image Data YCbCr 601 Pointer List Map Nearest Solid Rotate" +#define ICON "data.png" + +#ifndef PROTO +# ifndef UI +# include "main.h" + +/* standard var */ +static int done = 0; + +/* private data */ +static Evas_Object *o_images[1]; +static unsigned char *yp = NULL, *up = NULL, *vp = NULL; + +/* setup */ +static void _setup(void) +{ + int i, y; + FILE *f; + unsigned char **data, **lp; + size_t r; + Evas_Object *o; + for (i = 0; i < 1; i++) + { + o = evas_object_image_add(evas); + o_images[i] = o; + evas_object_image_content_hint_set(o, EVAS_IMAGE_CONTENT_HINT_DYNAMIC); + evas_object_image_colorspace_set(o, EVAS_COLORSPACE_YCBCR422P601_PL); + evas_object_image_size_set(o, 640, 480); + evas_object_image_alpha_set(o, 0); + evas_object_image_fill_set(o, 0, 0, 640, 480); + evas_object_resize(o, 640, 480); + evas_object_image_smooth_scale_set(o, 0); + evas_object_show(o); + yp = malloc(640 * 480); + up = malloc(320 * 240); + vp = malloc(320 * 240); + f = fopen(build_path("tp.yuv"), "rb"); + if (f) + { + r = fread(yp, 640 * 480, 1, f); + r = fread(up, 320 * 240, 1, f); + r = fread(vp, 320 * 240, 1, f); + fclose(f); + } + data = evas_object_image_data_get(o_images[i], 1); + lp = data; + for (y = 0; y < 480; y++) + { + *lp = yp + (y * 640); + lp++; + } + for (y = 0; y < 240; y++) + { + *lp = up + (y * 320); + lp++; + } + for (y = 0; y < 240; y++) + { + *lp = vp + (y * 320); + lp++; + } + evas_object_image_data_set(o_images[i], data); + } + done = 0; +} + +/* cleanup */ +static void _cleanup(void) +{ + int i; + for (i = 0; i < 1; i++) evas_object_del(o_images[i]); + free(yp); + free(up); + free(vp); +} + +/* loop - do things */ +static void _loop(double t, int f) +{ + int i; + static Evas_Map *m = NULL; + Evas_Coord x, y, w, h; + if (!m) m = evas_map_new(4); + evas_map_smooth_set(m, 0); + for (i = 0; i < 1; i++) + { + w = 640; + h = 480; + x = (win_w / 2) - (w / 2); + y = (win_h / 2) - (h / 2); + + evas_map_util_points_populate_from_geometry(m, x, y, w, h, 0); + + evas_map_util_rotate(m, f, x + (w / 2), y + (h / 2)); + + evas_object_map_enable_set(o_images[i], 1); + evas_object_map_set(o_images[i], m); + } + FPS_STD(NAME); +} + +/* prepend special key handlers if interactive (before STD) */ +static void _key(char *key) +{ + KEY_STD; +} + + + + + + + + + + + + +/* template stuff - ignore */ +# endif +#endif + +#ifdef UI +_ui_menu_item_add(ICON, NAME, FNAME); +#endif + +#ifdef PROTO +void FNAME(void); +#endif + +#ifndef PROTO +# ifndef UI +void FNAME(void) +{ + ui_func_set(_key, _loop); + _setup(); +} +# endif +#endif +#undef FNAME +#undef NAME +#undef ICON diff --git a/src/bin/image_data_ycbcr601pl_map_solid_rotate.c b/src/bin/image_data_ycbcr601pl_map_solid_rotate.c new file mode 100644 index 0000000..290f716 --- /dev/null +++ b/src/bin/image_data_ycbcr601pl_map_solid_rotate.c @@ -0,0 +1,147 @@ +#undef FNAME +#undef NAME +#undef ICON + +/* metadata */ +#define FNAME image_data_ycbcr601pl_map_solid_rotate_start +#define NAME "Image Data YCbCr 601 Pointer List Map Solid Rotate" +#define ICON "data.png" + +#ifndef PROTO +# ifndef UI +# include "main.h" + +/* standard var */ +static int done = 0; + +/* private data */ +static Evas_Object *o_images[1]; +static unsigned char *yp = NULL, *up = NULL, *vp = NULL; + +/* setup */ +static void _setup(void) +{ + int i, y; + FILE *f; + unsigned char **data, **lp; + size_t r; + Evas_Object *o; + for (i = 0; i < 1; i++) + { + o = evas_object_image_add(evas); + o_images[i] = o; + evas_object_image_content_hint_set(o, EVAS_IMAGE_CONTENT_HINT_DYNAMIC); + evas_object_image_colorspace_set(o, EVAS_COLORSPACE_YCBCR422P601_PL); + evas_object_image_size_set(o, 640, 480); + evas_object_image_alpha_set(o, 0); + evas_object_image_fill_set(o, 0, 0, 640, 480); + evas_object_resize(o, 640, 480); + evas_object_show(o); + yp = malloc(640 * 480); + up = malloc(320 * 240); + vp = malloc(320 * 240); + f = fopen(build_path("tp.yuv"), "rb"); + if (f) + { + r = fread(yp, 640 * 480, 1, f); + r = fread(up, 320 * 240, 1, f); + r = fread(vp, 320 * 240, 1, f); + fclose(f); + } + data = evas_object_image_data_get(o_images[i], 1); + lp = data; + for (y = 0; y < 480; y++) + { + *lp = yp + (y * 640); + lp++; + } + for (y = 0; y < 240; y++) + { + *lp = up + (y * 320); + lp++; + } + for (y = 0; y < 240; y++) + { + *lp = vp + (y * 320); + lp++; + } + evas_object_image_data_set(o_images[i], data); + } + done = 0; +} + +/* cleanup */ +static void _cleanup(void) +{ + int i; + for (i = 0; i < 1; i++) evas_object_del(o_images[i]); + free(yp); + free(up); + free(vp); +} + +/* loop - do things */ +static void _loop(double t, int f) +{ + int i; + static Evas_Map *m = NULL; + Evas_Coord x, y, w, h; + if (!m) m = evas_map_new(4); + for (i = 0; i < 1; i++) + { + w = 640; + h = 480; + x = (win_w / 2) - (w / 2); + y = (win_h / 2) - (h / 2); + + evas_map_util_points_populate_from_geometry(m, x, y, w, h, 0); + + evas_map_util_rotate(m, f, x + (w / 2), y + (h / 2)); + + evas_object_map_enable_set(o_images[i], 1); + evas_object_map_set(o_images[i], m); + } + FPS_STD(NAME); +} + +/* prepend special key handlers if interactive (before STD) */ +static void _key(char *key) +{ + KEY_STD; +} + + + + + + + + + + + + +/* template stuff - ignore */ +# endif +#endif + +#ifdef UI +_ui_menu_item_add(ICON, NAME, FNAME); +#endif + +#ifdef PROTO +void FNAME(void); +#endif + +#ifndef PROTO +# ifndef UI +void FNAME(void) +{ + ui_func_set(_key, _loop); + _setup(); +} +# endif +#endif +#undef FNAME +#undef NAME +#undef ICON diff --git a/src/bin/image_data_ycbcr601pl_wide_stride.c b/src/bin/image_data_ycbcr601pl_wide_stride.c index 3651977..e46e94b 100644 --- a/src/bin/image_data_ycbcr601pl_wide_stride.c +++ b/src/bin/image_data_ycbcr601pl_wide_stride.c @@ -5,7 +5,7 @@ /* metadata */ #define FNAME image_data_ycbcr601pl_wide_stride_start #define NAME "Image Data YCbCr 601 Pointer List Wide Stride" -#define ICON "mushroom.png" +#define ICON "data.png" #ifndef PROTO # ifndef UI @@ -23,12 +23,14 @@ static void _setup(void) { int i, y; FILE *f; + size_t r; unsigned char **data, **lp; Evas_Object *o; for (i = 0; i < 1; i++) { o = evas_object_image_add(evas); o_images[i] = o; + evas_object_image_content_hint_set(o, EVAS_IMAGE_CONTENT_HINT_DYNAMIC); evas_object_image_colorspace_set(o, EVAS_COLORSPACE_YCBCR422P601_PL); evas_object_image_size_set(o, 320, 480); evas_object_image_alpha_set(o, 0); @@ -41,9 +43,9 @@ static void _setup(void) f = fopen(build_path("tp.yuv"), "rb"); if (f) { - fread(yp, 640 * 480, 1, f); - fread(up, 320 * 240, 1, f); - fread(vp, 320 * 240, 1, f); + r = fread(yp, 640 * 480, 1, f); + r = fread(up, 320 * 240, 1, f); + r = fread(vp, 320 * 240, 1, f); fclose(f); } data = evas_object_image_data_get(o_images[i], 1); diff --git a/src/bin/image_map_3d_1.c b/src/bin/image_map_3d_1.c new file mode 100644 index 0000000..d3b65b8 --- /dev/null +++ b/src/bin/image_map_3d_1.c @@ -0,0 +1,259 @@ +#undef FNAME +#undef NAME +#undef ICON + +/* metadata */ +#define FNAME image_map_3d_1_start +#define NAME "Image Map 3D 1" +#define ICON "3d.png" + +#ifndef PROTO +# ifndef UI +# include "main.h" + +typedef struct _Point +{ + Evas_Coord x, y, z, u, v; +} Point; + +typedef struct _Side +{ + Evas_Object *o; + Point pt[4]; +} Side; + +typedef struct _Cube +{ + Side side[6]; +} Cube; + +/* standard var */ +static int done = 0; + +/* private data */ +static Cube *cubes[5]; + +#define POINT(n, p, xx, yy, zz, uu, vv) \ + c->side[n].pt[p].x = xx; \ + c->side[n].pt[p].y = yy; \ + c->side[n].pt[p].z = zz; \ + c->side[n].pt[p].u = uu; \ + c->side[n].pt[p].v = vv + +static Cube * +_cube_new(Evas_Coord w, Evas_Coord h, Evas_Coord d) +{ + Cube *c; + int i; + + w -= (w / 2); + h -= (h / 2); + d -= (d / 2); + c = calloc(1, sizeof(Cube)); + for (i = 0; i < 6; i++) + { + Evas_Object *o; + char buf[256]; + o = evas_object_image_add(evas); + c->side[i].o = o; + snprintf(buf, sizeof(buf), "cube%i.png", i + 1); + evas_object_image_file_set(o, build_path(buf), NULL); + evas_object_image_fill_set(o, 0, 0, 256, 256); + evas_object_resize(o, 256, 256); + evas_object_image_smooth_scale_set(o, 0); + evas_object_show(o); + } + POINT(0, 0, -w, -h, -d, 0, 0); + POINT(0, 1, w, -h, -d, 256, 0); + POINT(0, 2, w, h, -d, 256, 256); + POINT(0, 3, -w, h, -d, 0, 256); + + POINT(1, 0, w, -h, -d, 0, 0); + POINT(1, 1, w, -h, d, 256, 0); + POINT(1, 2, w, h, d, 256, 256); + POINT(1, 3, w, h, -d, 0, 256); + + POINT(2, 0, w, -h, d, 0, 0); + POINT(2, 1, -w, -h, d, 256, 0); + POINT(2, 2, -w, h, d, 256, 256); + POINT(2, 3, w, h, d, 0, 256); + + POINT(3, 0, -w, -h, d, 0, 0); + POINT(3, 1, -w, -h, -d, 256, 0); + POINT(3, 2, -w, h, -d, 256, 256); + POINT(3, 3, -w, h, d, 0, 256); + + POINT(4, 0, -w, -h, d, 0, 0); + POINT(4, 1, w, -h, d, 256, 0); + POINT(4, 2, w, -h, -d, 256, 256); + POINT(4, 3, -w, -h, -d, 0, 256); + + POINT(5, 0, -w, h, -d, 0, 0); + POINT(5, 1, w, h, -d, 256, 0); + POINT(5, 2, w, h, d, 256, 256); + POINT(5, 3, -w, h, d, 0, 256); + + return c; +} + +static void +_cube_pos(Cube *c, + Evas_Coord x, Evas_Coord y, Evas_Coord z, + double dx, double dy, double dz) +{ + static Evas_Map *m = NULL; + int i, j, order[6], sorted; + Evas_Coord mz[6]; + + if (!m) m = evas_map_new(4); + evas_map_smooth_set(m, 0); + + for (i = 0; i < 6; i++) + { + Evas_Coord tz[4]; + + for (j = 0; j < 4; j++) + { + evas_map_point_coord_set(m, j, + c->side[i].pt[j].x + x, + c->side[i].pt[j].y + y, + c->side[i].pt[j].z + z); + evas_map_point_image_uv_set(m, j, + c->side[i].pt[j].u, + c->side[i].pt[j].v); + evas_map_point_color_set(m, j, 255, 255, 255, 255); + } + evas_map_util_3d_rotate(m, dx, dy, dz, x, y, z); + evas_map_util_3d_lighting(m, -1000, -1000, -1000, + 255, 255, 255, + 20, 20, 20); + evas_map_util_3d_perspective(m, (win_w / 2), (win_h / 2), 0, 512); + if (evas_map_util_clockwise_get(m)) + { + evas_object_map_enable_set(c->side[i].o, 1); + evas_object_map_set(c->side[i].o, m); + evas_object_show(c->side[i].o); + } + else + evas_object_hide(c->side[i].o); + + order[i] = i; + for (j = 0; j < 4; j++) + evas_map_point_coord_get(m, j, NULL, NULL, &(tz[j])); + mz[i] = (tz[0] + tz[1] + tz[2] + tz[3]) / 4; + } + sorted = 0; + do + { + sorted = 1; + for (i = 0; i < 5; i++) + { + if (mz[order[i]] > mz[order[i + 1]]) + { + j = order[i]; + order[i] = order[i + 1]; + order[i + 1] = j; + sorted = 0; + } + } + } + while (!sorted); + + evas_object_raise(c->side[order[0]].o); + for (i = 1; i < 6; i++) + evas_object_stack_below(c->side[order[i]].o, c->side[order[i - 1]].o); +} + +static void +_cube_free(Cube *c) +{ + int i; + + for (i = 0; i < 6; i++) evas_object_del(c->side[i].o); + free(c); +} + +/* setup */ +static void _setup(void) +{ + cubes[0] = _cube_new(128, 128, 256); + cubes[1] = _cube_new(256, 128, 128); + cubes[2] = _cube_new(256, 256, 128); + cubes[3] = _cube_new(128, 256, 128); + cubes[4] = _cube_new(256, 256, 256); + + done = 0; +} + +/* cleanup */ +static void _cleanup(void) +{ + _cube_free(cubes[0]); + _cube_free(cubes[1]); + _cube_free(cubes[2]); + _cube_free(cubes[3]); + _cube_free(cubes[4]); +} + +/* loop - do things */ +static void _loop(double t, int f) +{ + _cube_pos(cubes[0], + (win_w / 2) - 640, (win_h / 2) - 256, 512, + f / 2.0, f, f / 3.0); + _cube_pos(cubes[1], + (win_w / 2) + 512, (win_h / 2) - 128, 384, + f / 3.0, f / 2.0, f / 4.0); + _cube_pos(cubes[2], + (win_w / 2) - 384, (win_h / 2) + 128, 256, + f / 2.0, f / 3.0, f); + _cube_pos(cubes[3], + (win_w / 2) + 256, (win_h / 2) + 64, 128, + f, f / 5.0, f / 2.0); + _cube_pos(cubes[4], + (win_w / 2), (win_h / 2), 0, + f / 4.0, f / 3.0, f / 5.0); + FPS_STD(NAME); +} + +/* prepend special key handlers if interactive (before STD) */ +static void _key(char *key) +{ + KEY_STD; +} + + + + + + + + + + + + +/* template stuff - ignore */ +# endif +#endif + +#ifdef UI +_ui_menu_item_add(ICON, NAME, FNAME); +#endif + +#ifdef PROTO +void FNAME(void); +#endif + +#ifndef PROTO +# ifndef UI +void FNAME(void) +{ + ui_func_set(_key, _loop); + _setup(); +} +# endif +#endif +#undef FNAME +#undef NAME +#undef ICON diff --git a/src/bin/image_map_3d_2.c b/src/bin/image_map_3d_2.c new file mode 100644 index 0000000..9d10462 --- /dev/null +++ b/src/bin/image_map_3d_2.c @@ -0,0 +1,257 @@ +#undef FNAME +#undef NAME +#undef ICON + +/* metadata */ +#define FNAME image_map_3d_2_start +#define NAME "Image Map 3D 2" +#define ICON "3d.png" + +#ifndef PROTO +# ifndef UI +# include "main.h" + +typedef struct _Point +{ + Evas_Coord x, y, z, u, v; +} Point; + +typedef struct _Side +{ + Evas_Object *o; + Point pt[4]; +} Side; + +typedef struct _Cube +{ + Side side[6]; +} Cube; + +/* standard var */ +static int done = 0; + +/* private data */ +static Cube *cubes[5]; + +#define POINT(n, p, xx, yy, zz, uu, vv) \ + c->side[n].pt[p].x = xx; \ + c->side[n].pt[p].y = yy; \ + c->side[n].pt[p].z = zz; \ + c->side[n].pt[p].u = uu; \ + c->side[n].pt[p].v = vv + +static Cube * +_cube_new(Evas_Coord w, Evas_Coord h, Evas_Coord d) +{ + Cube *c; + int i; + + w -= (w / 2); + h -= (h / 2); + d -= (d / 2); + c = calloc(1, sizeof(Cube)); + for (i = 0; i < 6; i++) + { + Evas_Object *o; + char buf[256]; + o = evas_object_image_add(evas); + c->side[i].o = o; + snprintf(buf, sizeof(buf), "cube%i.png", i + 1); + evas_object_image_file_set(o, build_path(buf), NULL); + evas_object_image_fill_set(o, 0, 0, 256, 256); + evas_object_resize(o, 256, 256); + evas_object_show(o); + } + POINT(0, 0, -w, -h, -d, 0, 0); + POINT(0, 1, w, -h, -d, 256, 0); + POINT(0, 2, w, h, -d, 256, 256); + POINT(0, 3, -w, h, -d, 0, 256); + + POINT(1, 0, w, -h, -d, 0, 0); + POINT(1, 1, w, -h, d, 256, 0); + POINT(1, 2, w, h, d, 256, 256); + POINT(1, 3, w, h, -d, 0, 256); + + POINT(2, 0, w, -h, d, 0, 0); + POINT(2, 1, -w, -h, d, 256, 0); + POINT(2, 2, -w, h, d, 256, 256); + POINT(2, 3, w, h, d, 0, 256); + + POINT(3, 0, -w, -h, d, 0, 0); + POINT(3, 1, -w, -h, -d, 256, 0); + POINT(3, 2, -w, h, -d, 256, 256); + POINT(3, 3, -w, h, d, 0, 256); + + POINT(4, 0, -w, -h, d, 0, 0); + POINT(4, 1, w, -h, d, 256, 0); + POINT(4, 2, w, -h, -d, 256, 256); + POINT(4, 3, -w, -h, -d, 0, 256); + + POINT(5, 0, -w, h, -d, 0, 0); + POINT(5, 1, w, h, -d, 256, 0); + POINT(5, 2, w, h, d, 256, 256); + POINT(5, 3, -w, h, d, 0, 256); + + return c; +} + +static void +_cube_pos(Cube *c, + Evas_Coord x, Evas_Coord y, Evas_Coord z, + double dx, double dy, double dz) +{ + static Evas_Map *m = NULL; + int i, j, order[6], sorted; + Evas_Coord mz[6]; + + if (!m) m = evas_map_new(4); + + for (i = 0; i < 6; i++) + { + Evas_Coord tz[4]; + + for (j = 0; j < 4; j++) + { + evas_map_point_coord_set(m, j, + c->side[i].pt[j].x + x, + c->side[i].pt[j].y + y, + c->side[i].pt[j].z + z); + evas_map_point_image_uv_set(m, j, + c->side[i].pt[j].u, + c->side[i].pt[j].v); + evas_map_point_color_set(m, j, 255, 255, 255, 255); + } + evas_map_util_3d_rotate(m, dx, dy, dz, x, y, z); + evas_map_util_3d_lighting(m, -1000, -1000, -1000, + 255, 255, 255, + 20, 20, 20); + evas_map_util_3d_perspective(m, (win_w / 2), (win_h / 2), 0, 512); + if (evas_map_util_clockwise_get(m)) + { + evas_object_map_enable_set(c->side[i].o, 1); + evas_object_map_set(c->side[i].o, m); + evas_object_show(c->side[i].o); + } + else + evas_object_hide(c->side[i].o); + + order[i] = i; + for (j = 0; j < 4; j++) + evas_map_point_coord_get(m, j, NULL, NULL, &(tz[j])); + mz[i] = (tz[0] + tz[1] + tz[2] + tz[3]) / 4; + } + sorted = 0; + do + { + sorted = 1; + for (i = 0; i < 5; i++) + { + if (mz[order[i]] > mz[order[i + 1]]) + { + j = order[i]; + order[i] = order[i + 1]; + order[i + 1] = j; + sorted = 0; + } + } + } + while (!sorted); + + evas_object_raise(c->side[order[0]].o); + for (i = 1; i < 6; i++) + evas_object_stack_below(c->side[order[i]].o, c->side[order[i - 1]].o); +} + +static void +_cube_free(Cube *c) +{ + int i; + + for (i = 0; i < 6; i++) evas_object_del(c->side[i].o); + free(c); +} + +/* setup */ +static void _setup(void) +{ + cubes[0] = _cube_new(128, 128, 256); + cubes[1] = _cube_new(256, 128, 128); + cubes[2] = _cube_new(256, 256, 128); + cubes[3] = _cube_new(128, 256, 128); + cubes[4] = _cube_new(256, 256, 256); + + done = 0; +} + +/* cleanup */ +static void _cleanup(void) +{ + _cube_free(cubes[0]); + _cube_free(cubes[1]); + _cube_free(cubes[2]); + _cube_free(cubes[3]); + _cube_free(cubes[4]); +} + +/* loop - do things */ +static void _loop(double t, int f) +{ + _cube_pos(cubes[0], + (win_w / 2) - 640, (win_h / 2) - 256, 512, + f / 2.0, f, f / 3.0); + _cube_pos(cubes[1], + (win_w / 2) + 512, (win_h / 2) - 128, 384, + f / 3.0, f / 2.0, f / 4.0); + _cube_pos(cubes[2], + (win_w / 2) - 384, (win_h / 2) + 128, 256, + f / 2.0, f / 3.0, f); + _cube_pos(cubes[3], + (win_w / 2) + 256, (win_h / 2) + 64, 128, + f, f / 5.0, f / 2.0); + _cube_pos(cubes[4], + (win_w / 2), (win_h / 2), 0, + f / 4.0, f / 3.0, f / 5.0); + FPS_STD(NAME); +} + +/* prepend special key handlers if interactive (before STD) */ +static void _key(char *key) +{ + KEY_STD; +} + + + + + + + + + + + + +/* template stuff - ignore */ +# endif +#endif + +#ifdef UI +_ui_menu_item_add(ICON, NAME, FNAME); +#endif + +#ifdef PROTO +void FNAME(void); +#endif + +#ifndef PROTO +# ifndef UI +void FNAME(void) +{ + ui_func_set(_key, _loop); + _setup(); +} +# endif +#endif +#undef FNAME +#undef NAME +#undef ICON diff --git a/src/bin/image_map_3d_3.c b/src/bin/image_map_3d_3.c new file mode 100644 index 0000000..09ce38d --- /dev/null +++ b/src/bin/image_map_3d_3.c @@ -0,0 +1,253 @@ +#undef FNAME +#undef NAME +#undef ICON + +/* metadata */ +#define FNAME image_map_3d_3_start +#define NAME "Image Map 3D 3" +#define ICON "3d.png" + +#ifndef PROTO +# ifndef UI +# include "main.h" + +typedef struct _Point +{ + Evas_Coord x, y, z, u, v; +} Point; + +typedef struct _Side +{ + Evas_Object *o; + Point pt[4]; +} Side; + +typedef struct _Cube +{ + Side side[6]; +} Cube; + +/* standard var */ +static int done = 0; + +/* private data */ +static Cube *cubes[5]; + +#define POINT(n, p, xx, yy, zz, uu, vv) \ + c->side[n].pt[p].x = xx; \ + c->side[n].pt[p].y = yy; \ + c->side[n].pt[p].z = zz; \ + c->side[n].pt[p].u = uu; \ + c->side[n].pt[p].v = vv + +static Cube * +_cube_new(Evas_Coord w, Evas_Coord h, Evas_Coord d) +{ + Cube *c; + int i; + + w -= (w / 2); + h -= (h / 2); + d -= (d / 2); + c = calloc(1, sizeof(Cube)); + for (i = 0; i < 6; i++) + { + Evas_Object *o; + char buf[256]; + o = evas_object_image_add(evas); + c->side[i].o = o; + snprintf(buf, sizeof(buf), "cube%i.png", i + 1); + evas_object_image_file_set(o, build_path(buf), NULL); + evas_object_image_fill_set(o, 0, 0, 256, 256); + evas_object_resize(o, 256, 256); + evas_object_image_smooth_scale_set(o, 0); + evas_object_show(o); + } + POINT(0, 0, -w, -h, -d, 0, 0); + POINT(0, 1, w, -h, -d, 256, 0); + POINT(0, 2, w, h, -d, 256, 256); + POINT(0, 3, -w, h, -d, 0, 256); + + POINT(1, 0, w, -h, -d, 0, 0); + POINT(1, 1, w, -h, d, 256, 0); + POINT(1, 2, w, h, d, 256, 256); + POINT(1, 3, w, h, -d, 0, 256); + + POINT(2, 0, w, -h, d, 0, 0); + POINT(2, 1, -w, -h, d, 256, 0); + POINT(2, 2, -w, h, d, 256, 256); + POINT(2, 3, w, h, d, 0, 256); + + POINT(3, 0, -w, -h, d, 0, 0); + POINT(3, 1, -w, -h, -d, 256, 0); + POINT(3, 2, -w, h, -d, 256, 256); + POINT(3, 3, -w, h, d, 0, 256); + + POINT(4, 0, -w, -h, d, 0, 0); + POINT(4, 1, w, -h, d, 256, 0); + POINT(4, 2, w, -h, -d, 256, 256); + POINT(4, 3, -w, -h, -d, 0, 256); + + POINT(5, 0, -w, h, -d, 0, 0); + POINT(5, 1, w, h, -d, 256, 0); + POINT(5, 2, w, h, d, 256, 256); + POINT(5, 3, -w, h, d, 0, 256); + + return c; +} + +static void +_cube_pos(Cube *c, + Evas_Coord x, Evas_Coord y, Evas_Coord z, + double dx, double dy, double dz) +{ + static Evas_Map *m = NULL; + int i, j, order[6], sorted; + Evas_Coord mz[6]; + + if (!m) m = evas_map_new(4); + evas_map_smooth_set(m, 0); + + for (i = 0; i < 6; i++) + { + Evas_Coord tz[4]; + + for (j = 0; j < 4; j++) + { + evas_map_point_coord_set(m, j, + c->side[i].pt[j].x + x, + c->side[i].pt[j].y + y, + c->side[i].pt[j].z + z); + evas_map_point_image_uv_set(m, j, + c->side[i].pt[j].u, + c->side[i].pt[j].v); + evas_map_point_color_set(m, j, 255, 255, 255, 128); + } + evas_map_util_3d_rotate(m, dx, dy, dz, x, y, z); + evas_map_util_3d_lighting(m, -1000, -1000, -1000, + 255, 255, 255, + 20, 20, 20); + evas_map_util_3d_perspective(m, (win_w / 2), (win_h / 2), 0, 512); + evas_object_map_enable_set(c->side[i].o, 1); + evas_object_map_set(c->side[i].o, m); + + order[i] = i; + for (j = 0; j < 4; j++) + evas_map_point_coord_get(m, j, NULL, NULL, &(tz[j])); + mz[i] = (tz[0] + tz[1] + tz[2] + tz[3]) / 4; + } + sorted = 0; + do + { + sorted = 1; + for (i = 0; i < 5; i++) + { + if (mz[order[i]] > mz[order[i + 1]]) + { + j = order[i]; + order[i] = order[i + 1]; + order[i + 1] = j; + sorted = 0; + } + } + } + while (!sorted); + + evas_object_raise(c->side[order[0]].o); + for (i = 1; i < 6; i++) + evas_object_stack_below(c->side[order[i]].o, c->side[order[i - 1]].o); +} + +static void +_cube_free(Cube *c) +{ + int i; + + for (i = 0; i < 6; i++) evas_object_del(c->side[i].o); + free(c); +} + +/* setup */ +static void _setup(void) +{ + cubes[0] = _cube_new(128, 128, 256); + cubes[1] = _cube_new(256, 128, 128); + cubes[2] = _cube_new(256, 256, 128); + cubes[3] = _cube_new(128, 256, 128); + cubes[4] = _cube_new(256, 256, 256); + + done = 0; +} + +/* cleanup */ +static void _cleanup(void) +{ + _cube_free(cubes[0]); + _cube_free(cubes[1]); + _cube_free(cubes[2]); + _cube_free(cubes[3]); + _cube_free(cubes[4]); +} + +/* loop - do things */ +static void _loop(double t, int f) +{ + _cube_pos(cubes[0], + (win_w / 2) - 640, (win_h / 2) - 256, 512, + f / 2.0, f, f / 3.0); + _cube_pos(cubes[1], + (win_w / 2) + 512, (win_h / 2) - 128, 384, + f / 3.0, f / 2.0, f / 4.0); + _cube_pos(cubes[2], + (win_w / 2) - 384, (win_h / 2) + 128, 256, + f / 2.0, f / 3.0, f); + _cube_pos(cubes[3], + (win_w / 2) + 256, (win_h / 2) + 64, 128, + f, f / 5.0, f / 2.0); + _cube_pos(cubes[4], + (win_w / 2), (win_h / 2), 0, + f / 4.0, f / 3.0, f / 5.0); + FPS_STD(NAME); +} + +/* prepend special key handlers if interactive (before STD) */ +static void _key(char *key) +{ + KEY_STD; +} + + + + + + + + + + + + +/* template stuff - ignore */ +# endif +#endif + +#ifdef UI +_ui_menu_item_add(ICON, NAME, FNAME); +#endif + +#ifdef PROTO +void FNAME(void); +#endif + +#ifndef PROTO +# ifndef UI +void FNAME(void) +{ + ui_func_set(_key, _loop); + _setup(); +} +# endif +#endif +#undef FNAME +#undef NAME +#undef ICON diff --git a/src/bin/image_map_3d_4.c b/src/bin/image_map_3d_4.c new file mode 100644 index 0000000..9f54835 --- /dev/null +++ b/src/bin/image_map_3d_4.c @@ -0,0 +1,251 @@ +#undef FNAME +#undef NAME +#undef ICON + +/* metadata */ +#define FNAME image_map_3d_4_start +#define NAME "Image Map 3D 4" +#define ICON "3d.png" + +#ifndef PROTO +# ifndef UI +# include "main.h" + +typedef struct _Point +{ + Evas_Coord x, y, z, u, v; +} Point; + +typedef struct _Side +{ + Evas_Object *o; + Point pt[4]; +} Side; + +typedef struct _Cube +{ + Side side[6]; +} Cube; + +/* standard var */ +static int done = 0; + +/* private data */ +static Cube *cubes[5]; + +#define POINT(n, p, xx, yy, zz, uu, vv) \ + c->side[n].pt[p].x = xx; \ + c->side[n].pt[p].y = yy; \ + c->side[n].pt[p].z = zz; \ + c->side[n].pt[p].u = uu; \ + c->side[n].pt[p].v = vv + +static Cube * +_cube_new(Evas_Coord w, Evas_Coord h, Evas_Coord d) +{ + Cube *c; + int i; + + w -= (w / 2); + h -= (h / 2); + d -= (d / 2); + c = calloc(1, sizeof(Cube)); + for (i = 0; i < 6; i++) + { + Evas_Object *o; + char buf[256]; + o = evas_object_image_add(evas); + c->side[i].o = o; + snprintf(buf, sizeof(buf), "cube%i.png", i + 1); + evas_object_image_file_set(o, build_path(buf), NULL); + evas_object_image_fill_set(o, 0, 0, 256, 256); + evas_object_resize(o, 256, 256); + evas_object_show(o); + } + POINT(0, 0, -w, -h, -d, 0, 0); + POINT(0, 1, w, -h, -d, 256, 0); + POINT(0, 2, w, h, -d, 256, 256); + POINT(0, 3, -w, h, -d, 0, 256); + + POINT(1, 0, w, -h, -d, 0, 0); + POINT(1, 1, w, -h, d, 256, 0); + POINT(1, 2, w, h, d, 256, 256); + POINT(1, 3, w, h, -d, 0, 256); + + POINT(2, 0, w, -h, d, 0, 0); + POINT(2, 1, -w, -h, d, 256, 0); + POINT(2, 2, -w, h, d, 256, 256); + POINT(2, 3, w, h, d, 0, 256); + + POINT(3, 0, -w, -h, d, 0, 0); + POINT(3, 1, -w, -h, -d, 256, 0); + POINT(3, 2, -w, h, -d, 256, 256); + POINT(3, 3, -w, h, d, 0, 256); + + POINT(4, 0, -w, -h, d, 0, 0); + POINT(4, 1, w, -h, d, 256, 0); + POINT(4, 2, w, -h, -d, 256, 256); + POINT(4, 3, -w, -h, -d, 0, 256); + + POINT(5, 0, -w, h, -d, 0, 0); + POINT(5, 1, w, h, -d, 256, 0); + POINT(5, 2, w, h, d, 256, 256); + POINT(5, 3, -w, h, d, 0, 256); + + return c; +} + +static void +_cube_pos(Cube *c, + Evas_Coord x, Evas_Coord y, Evas_Coord z, + double dx, double dy, double dz) +{ + static Evas_Map *m = NULL; + int i, j, order[6], sorted; + Evas_Coord mz[6]; + + if (!m) m = evas_map_new(4); + + for (i = 0; i < 6; i++) + { + Evas_Coord tz[4]; + + for (j = 0; j < 4; j++) + { + evas_map_point_coord_set(m, j, + c->side[i].pt[j].x + x, + c->side[i].pt[j].y + y, + c->side[i].pt[j].z + z); + evas_map_point_image_uv_set(m, j, + c->side[i].pt[j].u, + c->side[i].pt[j].v); + evas_map_point_color_set(m, j, 255, 255, 255, 128); + } + evas_map_util_3d_rotate(m, dx, dy, dz, x, y, z); + evas_map_util_3d_lighting(m, -1000, -1000, -1000, + 255, 255, 255, + 20, 20, 20); + evas_map_util_3d_perspective(m, (win_w / 2), (win_h / 2), 0, 512); + evas_object_map_enable_set(c->side[i].o, 1); + evas_object_map_set(c->side[i].o, m); + + order[i] = i; + for (j = 0; j < 4; j++) + evas_map_point_coord_get(m, j, NULL, NULL, &(tz[j])); + mz[i] = (tz[0] + tz[1] + tz[2] + tz[3]) / 4; + } + sorted = 0; + do + { + sorted = 1; + for (i = 0; i < 5; i++) + { + if (mz[order[i]] > mz[order[i + 1]]) + { + j = order[i]; + order[i] = order[i + 1]; + order[i + 1] = j; + sorted = 0; + } + } + } + while (!sorted); + + evas_object_raise(c->side[order[0]].o); + for (i = 1; i < 6; i++) + evas_object_stack_below(c->side[order[i]].o, c->side[order[i - 1]].o); +} + +static void +_cube_free(Cube *c) +{ + int i; + + for (i = 0; i < 6; i++) evas_object_del(c->side[i].o); + free(c); +} + +/* setup */ +static void _setup(void) +{ + cubes[0] = _cube_new(128, 128, 256); + cubes[1] = _cube_new(256, 128, 128); + cubes[2] = _cube_new(256, 256, 128); + cubes[3] = _cube_new(128, 256, 128); + cubes[4] = _cube_new(256, 256, 256); + + done = 0; +} + +/* cleanup */ +static void _cleanup(void) +{ + _cube_free(cubes[0]); + _cube_free(cubes[1]); + _cube_free(cubes[2]); + _cube_free(cubes[3]); + _cube_free(cubes[4]); +} + +/* loop - do things */ +static void _loop(double t, int f) +{ + _cube_pos(cubes[0], + (win_w / 2) - 640, (win_h / 2) - 256, 512, + f / 2.0, f, f / 3.0); + _cube_pos(cubes[1], + (win_w / 2) + 512, (win_h / 2) - 128, 384, + f / 3.0, f / 2.0, f / 4.0); + _cube_pos(cubes[2], + (win_w / 2) - 384, (win_h / 2) + 128, 256, + f / 2.0, f / 3.0, f); + _cube_pos(cubes[3], + (win_w / 2) + 256, (win_h / 2) + 64, 128, + f, f / 5.0, f / 2.0); + _cube_pos(cubes[4], + (win_w / 2), (win_h / 2), 0, + f / 4.0, f / 3.0, f / 5.0); + FPS_STD(NAME); +} + +/* prepend special key handlers if interactive (before STD) */ +static void _key(char *key) +{ + KEY_STD; +} + + + + + + + + + + + + +/* template stuff - ignore */ +# endif +#endif + +#ifdef UI +_ui_menu_item_add(ICON, NAME, FNAME); +#endif + +#ifdef PROTO +void FNAME(void); +#endif + +#ifndef PROTO +# ifndef UI +void FNAME(void) +{ + ui_func_set(_key, _loop); + _setup(); +} +# endif +#endif +#undef FNAME +#undef NAME +#undef ICON diff --git a/src/bin/image_map_3d_5.c b/src/bin/image_map_3d_5.c new file mode 100644 index 0000000..9d5c390 --- /dev/null +++ b/src/bin/image_map_3d_5.c @@ -0,0 +1,239 @@ +#undef FNAME +#undef NAME +#undef ICON + +/* metadata */ +#define FNAME image_map_3d_5_start +#define NAME "Image Map 3D 5" +#define ICON "3d.png" + +#ifndef PROTO +# ifndef UI +# include "main.h" + +typedef struct _Point +{ + Evas_Coord x, y, z, u, v; +} Point; + +typedef struct _Side +{ + Evas_Object *o; + Point pt[4]; +} Side; + +typedef struct _Cube +{ + Side side[6]; +} Cube; + +/* standard var */ +static int done = 0; + +/* private data */ +static Cube *cubes[1]; + +#define POINT(n, p, xx, yy, zz, uu, vv) \ + c->side[n].pt[p].x = xx; \ + c->side[n].pt[p].y = yy; \ + c->side[n].pt[p].z = zz; \ + c->side[n].pt[p].u = uu; \ + c->side[n].pt[p].v = vv + +static Cube * +_cube_new(Evas_Coord w, Evas_Coord h, Evas_Coord d) +{ + Cube *c; + int i; + + w -= (w / 2); + h -= (h / 2); + d -= (d / 2); + c = calloc(1, sizeof(Cube)); + for (i = 0; i < 6; i++) + { + Evas_Object *o; + char buf[256]; + o = evas_object_image_add(evas); + c->side[i].o = o; + snprintf(buf, sizeof(buf), "im%i.png", (i % 2) + 1); + evas_object_image_file_set(o, build_path(buf), NULL); + evas_object_image_fill_set(o, 0, 0, 720, 420); + evas_object_resize(o, 720, 420); + evas_object_image_smooth_scale_set(o, 0); + evas_object_show(o); + } + POINT(0, 0, -w, -h, -d, 0, 0); + POINT(0, 1, w, -h, -d, 720, 0); + POINT(0, 2, w, h, -d, 720, 420); + POINT(0, 3, -w, h, -d, 0, 420); + + POINT(1, 0, w, -h, -d, 0, 0); + POINT(1, 1, w, -h, d, 720, 0); + POINT(1, 2, w, h, d, 720, 420); + POINT(1, 3, w, h, -d, 0, 420); + + POINT(2, 0, w, -h, d, 0, 0); + POINT(2, 1, -w, -h, d, 720, 0); + POINT(2, 2, -w, h, d, 720, 420); + POINT(2, 3, w, h, d, 0, 420); + + POINT(3, 0, -w, -h, d, 0, 0); + POINT(3, 1, -w, -h, -d, 720, 0); + POINT(3, 2, -w, h, -d, 720, 420); + POINT(3, 3, -w, h, d, 0, 420); + + POINT(4, 0, -w, -h, d, 0, 0); + POINT(4, 1, w, -h, d, 720, 0); + POINT(4, 2, w, -h, -d, 720, 420); + POINT(4, 3, -w, -h, -d, 0, 420); + + POINT(5, 0, -w, h, -d, 0, 0); + POINT(5, 1, w, h, -d, 720, 0); + POINT(5, 2, w, h, d, 720, 420); + POINT(5, 3, -w, h, d, 0, 420); + + return c; +} + +static void +_cube_pos(Cube *c, + Evas_Coord x, Evas_Coord y, Evas_Coord z, + double dx, double dy, double dz) +{ + static Evas_Map *m = NULL; + int i, j, order[6], sorted; + Evas_Coord mz[6]; + + if (!m) m = evas_map_new(4); + evas_map_smooth_set(m, 0); + + for (i = 0; i < 6; i++) + { + Evas_Coord tz[4]; + + for (j = 0; j < 4; j++) + { + evas_map_point_coord_set(m, j, + c->side[i].pt[j].x + x, + c->side[i].pt[j].y + y, + c->side[i].pt[j].z + z); + evas_map_point_image_uv_set(m, j, + c->side[i].pt[j].u, + c->side[i].pt[j].v); + evas_map_point_color_set(m, j, 255, 255, 255, 255); + } + evas_map_util_3d_rotate(m, dx, dy, dz, x, y, z); + evas_map_util_3d_lighting(m, -1000, win_h / 2, -1000, + 255, 255, 255, + 20, 20, 20); + evas_map_util_3d_perspective(m, (win_w / 2), (win_h / 2), -360, 720); + if (evas_map_util_clockwise_get(m)) + { + evas_object_map_enable_set(c->side[i].o, 1); + evas_object_map_set(c->side[i].o, m); + evas_object_show(c->side[i].o); + } + else + evas_object_hide(c->side[i].o); + + order[i] = i; + for (j = 0; j < 4; j++) + evas_map_point_coord_get(m, j, NULL, NULL, &(tz[j])); + mz[i] = (tz[0] + tz[1] + tz[2] + tz[3]) / 4; + } + sorted = 0; + do + { + sorted = 1; + for (i = 0; i < 5; i++) + { + if (mz[order[i]] > mz[order[i + 1]]) + { + j = order[i]; + order[i] = order[i + 1]; + order[i + 1] = j; + sorted = 0; + } + } + } + while (!sorted); + + evas_object_raise(c->side[order[0]].o); + for (i = 1; i < 6; i++) + evas_object_stack_below(c->side[order[i]].o, c->side[order[i - 1]].o); +} + +static void +_cube_free(Cube *c) +{ + int i; + + for (i = 0; i < 6; i++) evas_object_del(c->side[i].o); + free(c); +} + +/* setup */ +static void _setup(void) +{ + cubes[0] = _cube_new(720, 420, 720); + + done = 0; +} + +/* cleanup */ +static void _cleanup(void) +{ + _cube_free(cubes[0]); +} + +/* loop - do things */ +static void _loop(double t, int f) +{ + _cube_pos(cubes[0], + (win_w / 2), (win_h / 2), 0, + 0, f, 0); + FPS_STD(NAME); +} + +/* prepend special key handlers if interactive (before STD) */ +static void _key(char *key) +{ + KEY_STD; +} + + + + + + + + + + + + +/* template stuff - ignore */ +# endif +#endif + +#ifdef UI +_ui_menu_item_add(ICON, NAME, FNAME); +#endif + +#ifdef PROTO +void FNAME(void); +#endif + +#ifndef PROTO +# ifndef UI +void FNAME(void) +{ + ui_func_set(_key, _loop); + _setup(); +} +# endif +#endif +#undef FNAME +#undef NAME +#undef ICON diff --git a/src/bin/image_map_3d_6.c b/src/bin/image_map_3d_6.c new file mode 100644 index 0000000..fd0c419 --- /dev/null +++ b/src/bin/image_map_3d_6.c @@ -0,0 +1,236 @@ +#undef FNAME +#undef NAME +#undef ICON + +/* metadata */ +#define FNAME image_map_3d_6_start +#define NAME "Image Map 3D 6" +#define ICON "3d.png" + +#ifndef PROTO +# ifndef UI +# include "main.h" + +typedef struct _Point +{ + Evas_Coord x, y, z, u, v; +} Point; + +typedef struct _Side +{ + Evas_Object *o; + Point pt[4]; +} Side; + +typedef struct _Cube +{ + Side side[6]; +} Cube; + +/* standard var */ +static int done = 0; + +/* private data */ +static Cube *cubes[1]; + +#define POINT(n, p, xx, yy, zz, uu, vv) \ + c->side[n].pt[p].x = xx; \ + c->side[n].pt[p].y = yy; \ + c->side[n].pt[p].z = zz; \ + c->side[n].pt[p].u = uu; \ + c->side[n].pt[p].v = vv + +static Cube * +_cube_new(Evas_Coord w, Evas_Coord h, Evas_Coord d) +{ + Cube *c; + int i; + + w -= (w / 2); + h -= (h / 2); + d -= (d / 2); + c = calloc(1, sizeof(Cube)); + for (i = 0; i < 6; i++) + { + Evas_Object *o; + char buf[256]; + o = evas_object_image_add(evas); + c->side[i].o = o; + snprintf(buf, sizeof(buf), "im%i.png", (i % 2) + 1); + evas_object_image_file_set(o, build_path(buf), NULL); + evas_object_image_fill_set(o, 0, 0, 720, 420); + evas_object_resize(o, 720, 420); + evas_object_image_smooth_scale_set(o, 0); + evas_object_show(o); + } + POINT(0, 0, -w, -h, -d, 0, 0); + POINT(0, 1, w, -h, -d, 720, 0); + POINT(0, 2, w, h, -d, 720, 420); + POINT(0, 3, -w, h, -d, 0, 420); + + POINT(1, 0, w, -h, -d, 0, 0); + POINT(1, 1, w, -h, d, 720, 0); + POINT(1, 2, w, h, d, 720, 420); + POINT(1, 3, w, h, -d, 0, 420); + + POINT(2, 0, w, -h, d, 0, 0); + POINT(2, 1, -w, -h, d, 720, 0); + POINT(2, 2, -w, h, d, 720, 420); + POINT(2, 3, w, h, d, 0, 420); + + POINT(3, 0, -w, -h, d, 0, 0); + POINT(3, 1, -w, -h, -d, 720, 0); + POINT(3, 2, -w, h, -d, 720, 420); + POINT(3, 3, -w, h, d, 0, 420); + + POINT(4, 0, -w, -h, d, 0, 0); + POINT(4, 1, w, -h, d, 720, 0); + POINT(4, 2, w, -h, -d, 720, 420); + POINT(4, 3, -w, -h, -d, 0, 420); + + POINT(5, 0, -w, h, -d, 0, 0); + POINT(5, 1, w, h, -d, 720, 0); + POINT(5, 2, w, h, d, 720, 420); + POINT(5, 3, -w, h, d, 0, 420); + + return c; +} + +static void +_cube_pos(Cube *c, + Evas_Coord x, Evas_Coord y, Evas_Coord z, + double dx, double dy, double dz) +{ + static Evas_Map *m = NULL; + int i, j, order[6], sorted; + Evas_Coord mz[6]; + + if (!m) m = evas_map_new(4); + evas_map_smooth_set(m, 0); + + for (i = 0; i < 6; i++) + { + Evas_Coord tz[4]; + + for (j = 0; j < 4; j++) + { + evas_map_point_coord_set(m, j, + c->side[i].pt[j].x + x, + c->side[i].pt[j].y + y, + c->side[i].pt[j].z + z); + evas_map_point_image_uv_set(m, j, + c->side[i].pt[j].u, + c->side[i].pt[j].v); + evas_map_point_color_set(m, j, 255, 255, 255, 255); + } + evas_map_util_3d_rotate(m, dx, dy, dz, x, y, z); + evas_map_util_3d_perspective(m, (win_w / 2), (win_h / 2), -360, 720); + if (evas_map_util_clockwise_get(m)) + { + evas_object_map_enable_set(c->side[i].o, 1); + evas_object_map_set(c->side[i].o, m); + evas_object_show(c->side[i].o); + } + else + evas_object_hide(c->side[i].o); + + order[i] = i; + for (j = 0; j < 4; j++) + evas_map_point_coord_get(m, j, NULL, NULL, &(tz[j])); + mz[i] = (tz[0] + tz[1] + tz[2] + tz[3]) / 4; + } + sorted = 0; + do + { + sorted = 1; + for (i = 0; i < 5; i++) + { + if (mz[order[i]] > mz[order[i + 1]]) + { + j = order[i]; + order[i] = order[i + 1]; + order[i + 1] = j; + sorted = 0; + } + } + } + while (!sorted); + + evas_object_raise(c->side[order[0]].o); + for (i = 1; i < 6; i++) + evas_object_stack_below(c->side[order[i]].o, c->side[order[i - 1]].o); +} + +static void +_cube_free(Cube *c) +{ + int i; + + for (i = 0; i < 6; i++) evas_object_del(c->side[i].o); + free(c); +} + +/* setup */ +static void _setup(void) +{ + cubes[0] = _cube_new(720, 420, 720); + + done = 0; +} + +/* cleanup */ +static void _cleanup(void) +{ + _cube_free(cubes[0]); +} + +/* loop - do things */ +static void _loop(double t, int f) +{ + _cube_pos(cubes[0], + (win_w / 2), (win_h / 2), 0, + 0, f, 0); + FPS_STD(NAME); +} + +/* prepend special key handlers if interactive (before STD) */ +static void _key(char *key) +{ + KEY_STD; +} + + + + + + + + + + + + +/* template stuff - ignore */ +# endif +#endif + +#ifdef UI +_ui_menu_item_add(ICON, NAME, FNAME); +#endif + +#ifdef PROTO +void FNAME(void); +#endif + +#ifndef PROTO +# ifndef UI +void FNAME(void) +{ + ui_func_set(_key, _loop); + _setup(); +} +# endif +#endif +#undef FNAME +#undef NAME +#undef ICON diff --git a/src/bin/image_map_3d_flow.c b/src/bin/image_map_3d_flow.c new file mode 100644 index 0000000..80c1b0c --- /dev/null +++ b/src/bin/image_map_3d_flow.c @@ -0,0 +1,227 @@ +#undef FNAME +#undef NAME +#undef ICON + +/* metadata */ +#define FNAME image_map_3d_flow_start +#define NAME "Image Map 3D Flow" +#define ICON "3d.png" + +#ifndef PROTO +# ifndef UI +# include "main.h" + +/* standard var */ +static int done = 0; + +#define CNUM 48 + +/* private data */ +static Evas_Object *o_images[CNUM]; +static Evas_Object *o_reflec[CNUM]; + +/* setup */ +static void _setup(void) +{ + int i; + Evas_Object *o; + for (i = 0; i < CNUM; i++) + { + char buf[256]; + + o = evas_object_image_add(evas); + o_images[i] = o; + snprintf(buf, sizeof(buf), "cube%i.png", (i % 6) + 1); + evas_object_image_file_set(o, build_path(buf), NULL); + evas_object_image_fill_set(o, 0, 0, 256, 256); + evas_object_resize(o, 256, 256); + evas_object_image_smooth_scale_set(o, 0); + evas_object_show(o); + + o = evas_object_image_add(evas); + o_reflec[i] = o; + snprintf(buf, sizeof(buf), "cube%i.png", (i % 6) + 1); + evas_object_image_file_set(o, build_path(buf), NULL); + evas_object_image_fill_set(o, 0, 0, 256, 256); + evas_object_resize(o, 256, 256); + evas_object_image_smooth_scale_set(o, 0); + evas_object_show(o); + } + done = 0; +} + +/* cleanup */ +static void _cleanup(void) +{ + int i; + for (i = 0; i < CNUM; i++) evas_object_del(o_images[i]); + for (i = 0; i < CNUM; i++) evas_object_del(o_reflec[i]); +} + +/* loop - do things */ +static void _loop(double t, int f) +{ + int i; + static Evas_Map *m = NULL; + Evas_Coord x, y, xx, yy, w, h, c, z; + int center = 150; + double ang, n; + + if (!m) m = evas_map_new(4); + evas_map_smooth_set(m, 0); + + for (i = 0; i < CNUM; i++) + { + x = (win_w / 2); + y = (win_h / 2); + w = 256; + h = 256; + + c = (i - (CNUM / 2)) * (w / 4); + c += (f % (6 * (w / 4))); + + ang = (double)c / (double)center; + if (ang > 0.0) ang = ang * ang; + else ang = -ang * ang; + ang *= -90.0; + if (ang > 90.0) ang = 90.0; + else if (ang < -90.0) ang = -90.0; + + if ((c > (-center)) && (c <= (center))) + { + n = (double)c / (double)center; + if (c > 0) + { + n = 1.0 - n; + n = 1.0 - (n * n); + } + else + { + n = -(-1.0 - n); + n = -(1.0 - (n * n)); + } + c = n * center * 2.0; + } + else if (c <= (-center)) + c = (c + center) - (center * 2); + else if (c > (center)) + c = (c - center) + (center * 2); + + z = 0; + if ((c > (-center)) && (c <= (center))) + { + z = (c * (w / 2)) / center; + if (z < 0) z = -z; + z = (w / 2) - z; + } + + x += c; + + x -= (w / 2); + xx = x + w; + + y -= (h / 2); + yy = y + h; + + if (c <= 0) + { + evas_object_raise(o_images[i]); + evas_object_raise(o_reflec[i]); + } + else + { + evas_object_lower(o_images[i]); + evas_object_lower(o_reflec[i]); + } + + evas_map_point_coord_set (m, 0, x, y, -z); + evas_map_point_image_uv_set(m, 0, 0, 0); + evas_map_point_color_set (m, 0, 255, 255, 255, 255); + + evas_map_point_coord_set (m, 1, xx, y, -z); + evas_map_point_image_uv_set(m, 1, 256, 0); + evas_map_point_color_set (m, 1, 255, 255, 255, 255); + + evas_map_point_coord_set (m, 2, xx, yy, -z); + evas_map_point_image_uv_set(m, 2, 256, 256); + evas_map_point_color_set (m, 2, 255, 255, 255, 255); + + evas_map_point_coord_set (m, 3, x, yy, -z); + evas_map_point_image_uv_set(m, 3, 0, 256); + evas_map_point_color_set (m, 3, 255, 255, 255, 255); + + evas_map_util_3d_rotate(m, 0, ang, 0, + x + (w / 2), y + (h / 2), 0); + evas_map_util_3d_perspective(m, (win_w / 2), (win_h / 2), -256, 512); + + evas_object_map_enable_set(o_images[i], 1); + evas_object_map_set(o_images[i], m); + + evas_map_point_coord_set (m, 0, x, yy, -z); + evas_map_point_image_uv_set(m, 0, 0, 256); + evas_map_point_color_set (m, 0, 128, 128, 128, 128); + + evas_map_point_coord_set (m, 1, xx, yy, -z); + evas_map_point_image_uv_set(m, 1, 256, 256); + evas_map_point_color_set (m, 1, 128, 128, 128, 128); + + evas_map_point_coord_set (m, 2, xx, yy + h, -z); + evas_map_point_image_uv_set(m, 2, 256, 0); + evas_map_point_color_set (m, 2, 0, 0, 0, 0); + + evas_map_point_coord_set (m, 3, x, yy + h, -z); + evas_map_point_image_uv_set(m, 3, 0, 0); + evas_map_point_color_set (m, 3, 0, 0, 0, 0); + + evas_map_util_3d_rotate(m, 0, ang, 0, + x + (w / 2), y + (h / 2), 0); + evas_map_util_3d_perspective(m, (win_w / 2), (win_h / 2), -256, 512); + + evas_object_map_enable_set(o_reflec[i], 1); + evas_object_map_set(o_reflec[i], m); + } + + FPS_STD(NAME); +} + +/* prepend special key handlers if interactive (before STD) */ +static void _key(char *key) +{ + KEY_STD; +} + + + + + + + + + + + + +/* template stuff - ignore */ +# endif +#endif + +#ifdef UI +_ui_menu_item_add(ICON, NAME, FNAME); +#endif + +#ifdef PROTO +void FNAME(void); +#endif + +#ifndef PROTO +# ifndef UI +void FNAME(void) +{ + ui_func_set(_key, _loop); + _setup(); +} +# endif +#endif +#undef FNAME +#undef NAME +#undef ICON diff --git a/src/bin/image_map_color_alpha_nearest_rotate.c b/src/bin/image_map_color_alpha_nearest_rotate.c new file mode 100644 index 0000000..a515c25 --- /dev/null +++ b/src/bin/image_map_color_alpha_nearest_rotate.c @@ -0,0 +1,117 @@ +#undef FNAME +#undef NAME +#undef ICON + +/* metadata */ +#define FNAME image_map_color_alpha_nearest_rotate_start +#define NAME "Image Map Color Alpha Nearest Rotate" +#define ICON "map.png" + +#ifndef PROTO +# ifndef UI +# include "main.h" + +/* standard var */ +static int done = 0; + +/* private data */ +static Evas_Object *o_images[OBNUM]; + +/* setup */ +static void _setup(void) +{ + int i; + Evas_Object *o; + for (i = 0; i < (OBNUM / 2); i++) + { + o = evas_object_image_add(evas); + o_images[i] = o; + evas_object_image_file_set(o, build_path("logo.png"), NULL); + evas_object_image_fill_set(o, 0, 0, 120, 160); + evas_object_resize(o, 120, 160); + evas_object_image_smooth_scale_set(o, 0); + evas_object_show(o); + } + done = 0; +} + +/* cleanup */ +static void _cleanup(void) +{ + int i; + for (i = 0; i < (OBNUM / 2); i++) evas_object_del(o_images[i]); +} + +/* loop - do things */ +static void _loop(double t, int f) +{ + int i; + static Evas_Map *m = NULL; + Evas_Coord x, y, w, h; + if (!m) m = evas_map_new(4); + evas_map_smooth_set(m, 0); + for (i = 0; i < (OBNUM / 2); i++) + { + w = 120; + h = 160; + x = (win_w / 2) - (w / 2); + x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2); + y = (win_h / 2) - (h / 2); + y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h / 2); + + evas_map_util_points_populate_from_geometry(m, x, y, w, h, 0); + + evas_map_point_color_set(m, 0, 255, 255, 255, 255); + evas_map_point_color_set(m, 1, 255, 0, 0, 255); + evas_map_point_color_set(m, 2, 0, 0, 255, 255); + evas_map_point_color_set(m, 3, 0, 0, 0, 0); + + evas_map_util_rotate(m, f, x + (w / 2), y + (h / 2)); + + evas_object_map_enable_set(o_images[i], 1); + evas_object_map_set(o_images[i], m); + } + FPS_STD(NAME); +} + +/* prepend special key handlers if interactive (before STD) */ +static void _key(char *key) +{ + KEY_STD; +} + + + + + + + + + + + + +/* template stuff - ignore */ +# endif +#endif + +#ifdef UI +_ui_menu_item_add(ICON, NAME, FNAME); +#endif + +#ifdef PROTO +void FNAME(void); +#endif + +#ifndef PROTO +# ifndef UI +void FNAME(void) +{ + ui_func_set(_key, _loop); + _setup(); +} +# endif +#endif +#undef FNAME +#undef NAME +#undef ICON diff --git a/src/bin/image_map_color_alpha_nearest_solid_rotate.c b/src/bin/image_map_color_alpha_nearest_solid_rotate.c new file mode 100644 index 0000000..c8012dd --- /dev/null +++ b/src/bin/image_map_color_alpha_nearest_solid_rotate.c @@ -0,0 +1,117 @@ +#undef FNAME +#undef NAME +#undef ICON + +/* metadata */ +#define FNAME image_map_color_alpha_nearest_solid_rotate_start +#define NAME "Image Map Color Alpha Nearest Solid Rotate" +#define ICON "map.png" + +#ifndef PROTO +# ifndef UI +# include "main.h" + +/* standard var */ +static int done = 0; + +/* private data */ +static Evas_Object *o_images[OBNUM]; + +/* setup */ +static void _setup(void) +{ + int i; + Evas_Object *o; + for (i = 0; i < (OBNUM / 2); i++) + { + o = evas_object_image_add(evas); + o_images[i] = o; + evas_object_image_file_set(o, build_path("image.png"), NULL); + evas_object_image_fill_set(o, 0, 0, 120, 160); + evas_object_resize(o, 120, 160); + evas_object_image_smooth_scale_set(o, 0); + evas_object_show(o); + } + done = 0; +} + +/* cleanup */ +static void _cleanup(void) +{ + int i; + for (i = 0; i < (OBNUM / 2); i++) evas_object_del(o_images[i]); +} + +/* loop - do things */ +static void _loop(double t, int f) +{ + int i; + static Evas_Map *m = NULL; + Evas_Coord x, y, w, h; + if (!m) m = evas_map_new(4); + evas_map_smooth_set(m, 0); + for (i = 0; i < (OBNUM / 2); i++) + { + w = 120; + h = 160; + x = (win_w / 2) - (w / 2); + x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2); + y = (win_h / 2) - (h / 2); + y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h / 2); + + evas_map_util_points_populate_from_geometry(m, x, y, w, h, 0); + + evas_map_point_color_set(m, 0, 255, 255, 255, 255); + evas_map_point_color_set(m, 1, 255, 0, 0, 255); + evas_map_point_color_set(m, 2, 0, 0, 255, 255); + evas_map_point_color_set(m, 3, 0, 0, 0, 0); + + evas_map_util_rotate(m, f, x + (w / 2), y + (h / 2)); + + evas_object_map_enable_set(o_images[i], 1); + evas_object_map_set(o_images[i], m); + } + FPS_STD(NAME); +} + +/* prepend special key handlers if interactive (before STD) */ +static void _key(char *key) +{ + KEY_STD; +} + + + + + + + + + + + + +/* template stuff - ignore */ +# endif +#endif + +#ifdef UI +_ui_menu_item_add(ICON, NAME, FNAME); +#endif + +#ifdef PROTO +void FNAME(void); +#endif + +#ifndef PROTO +# ifndef UI +void FNAME(void) +{ + ui_func_set(_key, _loop); + _setup(); +} +# endif +#endif +#undef FNAME +#undef NAME +#undef ICON diff --git a/src/bin/image_map_color_alpha_rotate.c b/src/bin/image_map_color_alpha_rotate.c new file mode 100644 index 0000000..9b7511d --- /dev/null +++ b/src/bin/image_map_color_alpha_rotate.c @@ -0,0 +1,115 @@ +#undef FNAME +#undef NAME +#undef ICON + +/* metadata */ +#define FNAME image_map_color_alpha_rotate_start +#define NAME "Image Map Color Alpha Rotate" +#define ICON "map.png" + +#ifndef PROTO +# ifndef UI +# include "main.h" + +/* standard var */ +static int done = 0; + +/* private data */ +static Evas_Object *o_images[OBNUM]; + +/* setup */ +static void _setup(void) +{ + int i; + Evas_Object *o; + for (i = 0; i < (OBNUM / 2); i++) + { + o = evas_object_image_add(evas); + o_images[i] = o; + evas_object_image_file_set(o, build_path("logo.png"), NULL); + evas_object_image_fill_set(o, 0, 0, 120, 160); + evas_object_resize(o, 120, 160); + evas_object_show(o); + } + done = 0; +} + +/* cleanup */ +static void _cleanup(void) +{ + int i; + for (i = 0; i < (OBNUM / 2); i++) evas_object_del(o_images[i]); +} + +/* loop - do things */ +static void _loop(double t, int f) +{ + int i; + static Evas_Map *m = NULL; + Evas_Coord x, y, w, h; + if (!m) m = evas_map_new(4); + for (i = 0; i < (OBNUM / 2); i++) + { + w = 120; + h = 160; + x = (win_w / 2) - (w / 2); + x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2); + y = (win_h / 2) - (h / 2); + y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h / 2); + + evas_map_util_points_populate_from_geometry(m, x, y, w, h, 0); + + evas_map_point_color_set(m, 0, 255, 255, 255, 255); + evas_map_point_color_set(m, 1, 255, 0, 0, 255); + evas_map_point_color_set(m, 2, 0, 0, 255, 255); + evas_map_point_color_set(m, 3, 0, 0, 0, 0); + + evas_map_util_rotate(m, f, x + (w / 2), y + (h / 2)); + + evas_object_map_enable_set(o_images[i], 1); + evas_object_map_set(o_images[i], m); + } + FPS_STD(NAME); +} + +/* prepend special key handlers if interactive (before STD) */ +static void _key(char *key) +{ + KEY_STD; +} + + + + + + + + + + + + +/* template stuff - ignore */ +# endif +#endif + +#ifdef UI +_ui_menu_item_add(ICON, NAME, FNAME); +#endif + +#ifdef PROTO +void FNAME(void); +#endif + +#ifndef PROTO +# ifndef UI +void FNAME(void) +{ + ui_func_set(_key, _loop); + _setup(); +} +# endif +#endif +#undef FNAME +#undef NAME +#undef ICON diff --git a/src/bin/image_map_color_alpha_solid_rotate.c b/src/bin/image_map_color_alpha_solid_rotate.c new file mode 100644 index 0000000..d748b8d --- /dev/null +++ b/src/bin/image_map_color_alpha_solid_rotate.c @@ -0,0 +1,114 @@ +#undef FNAME +#undef NAME +#undef ICON + +/* metadata */ +#define FNAME image_map_color_alpha_solid_rotate_start +#define NAME "Image Map Color Alpha Solid Rotate" +#define ICON "map.png" + +#ifndef PROTO +# ifndef UI +# include "main.h" + +/* standard var */ +static int done = 0; + +/* private data */ +static Evas_Object *o_images[OBNUM]; + +/* setup */ +static void _setup(void) +{ + int i; + Evas_Object *o; + for (i = 0; i < (OBNUM / 2); i++) + { + o = evas_object_image_add(evas); + o_images[i] = o; + evas_object_image_file_set(o, build_path("image.png"), NULL); + evas_object_image_fill_set(o, 0, 0, 120, 160); + evas_object_resize(o, 120, 160); + evas_object_show(o); + } + done = 0; +} + +/* cleanup */ +static void _cleanup(void) +{ + int i; + for (i = 0; i < (OBNUM / 2); i++) evas_object_del(o_images[i]); +} + +/* loop - do things */ +static void _loop(double t, int f) +{ + int i; + static Evas_Map *m = NULL; + Evas_Coord x, y, w, h; + if (!m) m = evas_map_new(4); + for (i = 0; i < (OBNUM / 2); i++) + { + w = 120; + h = 160; + x = (win_w / 2) - (w / 2); + x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2); + y = (win_h / 2) - (h / 2); + y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h / 2); + + evas_map_util_points_populate_from_geometry(m, x, y, w, h, 0); + + evas_map_point_color_set(m, 0, 255, 255, 255, 255); + evas_map_point_color_set(m, 1, 255, 0, 0, 255); + evas_map_point_color_set(m, 2, 0, 0, 255, 255); + evas_map_point_color_set(m, 3, 0, 0, 0, 0); + + evas_map_util_rotate(m, f, x + (w / 2), y + (h / 2)); + evas_object_map_enable_set(o_images[i], 1); + evas_object_map_set(o_images[i], m); + } + FPS_STD(NAME); +} + +/* prepend special key handlers if interactive (before STD) */ +static void _key(char *key) +{ + KEY_STD; +} + + + + + + + + + + + + +/* template stuff - ignore */ +# endif +#endif + +#ifdef UI +_ui_menu_item_add(ICON, NAME, FNAME); +#endif + +#ifdef PROTO +void FNAME(void); +#endif + +#ifndef PROTO +# ifndef UI +void FNAME(void) +{ + ui_func_set(_key, _loop); + _setup(); +} +# endif +#endif +#undef FNAME +#undef NAME +#undef ICON diff --git a/src/bin/image_map_color_nearest_rotate.c b/src/bin/image_map_color_nearest_rotate.c new file mode 100644 index 0000000..1cfcc1f --- /dev/null +++ b/src/bin/image_map_color_nearest_rotate.c @@ -0,0 +1,117 @@ +#undef FNAME +#undef NAME +#undef ICON + +/* metadata */ +#define FNAME image_map_color_nearest_rotate_start +#define NAME "Image Map Color Nearest Rotate" +#define ICON "map.png" + +#ifndef PROTO +# ifndef UI +# include "main.h" + +/* standard var */ +static int done = 0; + +/* private data */ +static Evas_Object *o_images[OBNUM]; + +/* setup */ +static void _setup(void) +{ + int i; + Evas_Object *o; + for (i = 0; i < (OBNUM / 2); i++) + { + o = evas_object_image_add(evas); + o_images[i] = o; + evas_object_image_file_set(o, build_path("logo.png"), NULL); + evas_object_image_fill_set(o, 0, 0, 120, 160); + evas_object_resize(o, 120, 160); + evas_object_image_smooth_scale_set(o, 0); + evas_object_show(o); + } + done = 0; +} + +/* cleanup */ +static void _cleanup(void) +{ + int i; + for (i = 0; i < (OBNUM / 2); i++) evas_object_del(o_images[i]); +} + +/* loop - do things */ +static void _loop(double t, int f) +{ + int i; + static Evas_Map *m = NULL; + Evas_Coord x, y, w, h; + if (!m) m = evas_map_new(4); + evas_map_smooth_set(m, 0); + for (i = 0; i < (OBNUM / 2); i++) + { + w = 120; + h = 160; + x = (win_w / 2) - (w / 2); + x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2); + y = (win_h / 2) - (h / 2); + y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h / 2); + + evas_map_util_points_populate_from_geometry(m, x, y, w, h, 0); + + evas_map_point_color_set(m, 0, 255, 255, 255, 255); + evas_map_point_color_set(m, 1, 255, 0, 0, 255); + evas_map_point_color_set(m, 2, 0, 0, 255, 255); + evas_map_point_color_set(m, 3, 0, 255, 0, 255); + + evas_map_util_rotate(m, f, x + (w / 2), y + (h / 2)); + + evas_object_map_enable_set(o_images[i], 1); + evas_object_map_set(o_images[i], m); + } + FPS_STD(NAME); +} + +/* prepend special key handlers if interactive (before STD) */ +static void _key(char *key) +{ + KEY_STD; +} + + + + + + + + + + + + +/* template stuff - ignore */ +# endif +#endif + +#ifdef UI +_ui_menu_item_add(ICON, NAME, FNAME); +#endif + +#ifdef PROTO +void FNAME(void); +#endif + +#ifndef PROTO +# ifndef UI +void FNAME(void) +{ + ui_func_set(_key, _loop); + _setup(); +} +# endif +#endif +#undef FNAME +#undef NAME +#undef ICON diff --git a/src/bin/image_map_color_nearest_solid_rotate.c b/src/bin/image_map_color_nearest_solid_rotate.c new file mode 100644 index 0000000..868f59c --- /dev/null +++ b/src/bin/image_map_color_nearest_solid_rotate.c @@ -0,0 +1,117 @@ +#undef FNAME +#undef NAME +#undef ICON + +/* metadata */ +#define FNAME image_map_color_nearest_solid_rotate_start +#define NAME "Image Map Color Nearest Solid Rotate" +#define ICON "map.png" + +#ifndef PROTO +# ifndef UI +# include "main.h" + +/* standard var */ +static int done = 0; + +/* private data */ +static Evas_Object *o_images[OBNUM]; + +/* setup */ +static void _setup(void) +{ + int i; + Evas_Object *o; + for (i = 0; i < (OBNUM / 2); i++) + { + o = evas_object_image_add(evas); + o_images[i] = o; + evas_object_image_file_set(o, build_path("image.png"), NULL); + evas_object_image_fill_set(o, 0, 0, 120, 160); + evas_object_resize(o, 120, 160); + evas_object_image_smooth_scale_set(o, 0); + evas_object_show(o); + } + done = 0; +} + +/* cleanup */ +static void _cleanup(void) +{ + int i; + for (i = 0; i < (OBNUM / 2); i++) evas_object_del(o_images[i]); +} + +/* loop - do things */ +static void _loop(double t, int f) +{ + int i; + static Evas_Map *m = NULL; + Evas_Coord x, y, w, h; + if (!m) m = evas_map_new(4); + evas_map_smooth_set(m, 0); + for (i = 0; i < (OBNUM / 2); i++) + { + w = 120; + h = 160; + x = (win_w / 2) - (w / 2); + x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2); + y = (win_h / 2) - (h / 2); + y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h / 2); + + evas_map_util_points_populate_from_geometry(m, x, y, w, h, 0); + + evas_map_point_color_set(m, 0, 255, 255, 255, 255); + evas_map_point_color_set(m, 1, 255, 0, 0, 255); + evas_map_point_color_set(m, 2, 0, 0, 255, 255); + evas_map_point_color_set(m, 3, 0, 255, 0, 255); + + evas_map_util_rotate(m, f, x + (w / 2), y + (h / 2)); + + evas_object_map_enable_set(o_images[i], 1); + evas_object_map_set(o_images[i], m); + } + FPS_STD(NAME); +} + +/* prepend special key handlers if interactive (before STD) */ +static void _key(char *key) +{ + KEY_STD; +} + + + + + + + + + + + + +/* template stuff - ignore */ +# endif +#endif + +#ifdef UI +_ui_menu_item_add(ICON, NAME, FNAME); +#endif + +#ifdef PROTO +void FNAME(void); +#endif + +#ifndef PROTO +# ifndef UI +void FNAME(void) +{ + ui_func_set(_key, _loop); + _setup(); +} +# endif +#endif +#undef FNAME +#undef NAME +#undef ICON diff --git a/src/bin/image_map_color_rotate.c b/src/bin/image_map_color_rotate.c new file mode 100644 index 0000000..026e456 --- /dev/null +++ b/src/bin/image_map_color_rotate.c @@ -0,0 +1,115 @@ +#undef FNAME +#undef NAME +#undef ICON + +/* metadata */ +#define FNAME image_map_color_rotate_start +#define NAME "Image Map Color Rotate" +#define ICON "map.png" + +#ifndef PROTO +# ifndef UI +# include "main.h" + +/* standard var */ +static int done = 0; + +/* private data */ +static Evas_Object *o_images[OBNUM]; + +/* setup */ +static void _setup(void) +{ + int i; + Evas_Object *o; + for (i = 0; i < (OBNUM / 2); i++) + { + o = evas_object_image_add(evas); + o_images[i] = o; + evas_object_image_file_set(o, build_path("logo.png"), NULL); + evas_object_image_fill_set(o, 0, 0, 120, 160); + evas_object_resize(o, 120, 160); + evas_object_show(o); + } + done = 0; +} + +/* cleanup */ +static void _cleanup(void) +{ + int i; + for (i = 0; i < (OBNUM / 2); i++) evas_object_del(o_images[i]); +} + +/* loop - do things */ +static void _loop(double t, int f) +{ + int i; + static Evas_Map *m = NULL; + Evas_Coord x, y, w, h; + if (!m) m = evas_map_new(4); + for (i = 0; i < (OBNUM / 2); i++) + { + w = 120; + h = 160; + x = (win_w / 2) - (w / 2); + x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2); + y = (win_h / 2) - (h / 2); + y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h / 2); + + evas_map_util_points_populate_from_geometry(m, x, y, w, h, 0); + + evas_map_point_color_set(m, 0, 255, 255, 255, 255); + evas_map_point_color_set(m, 1, 255, 0, 0, 255); + evas_map_point_color_set(m, 2, 0, 0, 255, 255); + evas_map_point_color_set(m, 3, 0, 255, 0, 255); + + evas_map_util_rotate(m, f, x + (w / 2), y + (h / 2)); + + evas_object_map_enable_set(o_images[i], 1); + evas_object_map_set(o_images[i], m); + } + FPS_STD(NAME); +} + +/* prepend special key handlers if interactive (before STD) */ +static void _key(char *key) +{ + KEY_STD; +} + + + + + + + + + + + + +/* template stuff - ignore */ +# endif +#endif + +#ifdef UI +_ui_menu_item_add(ICON, NAME, FNAME); +#endif + +#ifdef PROTO +void FNAME(void); +#endif + +#ifndef PROTO +# ifndef UI +void FNAME(void) +{ + ui_func_set(_key, _loop); + _setup(); +} +# endif +#endif +#undef FNAME +#undef NAME +#undef ICON diff --git a/src/bin/image_map_color_solid_rotate.c b/src/bin/image_map_color_solid_rotate.c new file mode 100644 index 0000000..91e4a3a --- /dev/null +++ b/src/bin/image_map_color_solid_rotate.c @@ -0,0 +1,115 @@ +#undef FNAME +#undef NAME +#undef ICON + +/* metadata */ +#define FNAME image_map_color_solid_rotate_start +#define NAME "Image Map Color Solid Rotate" +#define ICON "map.png" + +#ifndef PROTO +# ifndef UI +# include "main.h" + +/* standard var */ +static int done = 0; + +/* private data */ +static Evas_Object *o_images[OBNUM]; + +/* setup */ +static void _setup(void) +{ + int i; + Evas_Object *o; + for (i = 0; i < (OBNUM / 2); i++) + { + o = evas_object_image_add(evas); + o_images[i] = o; + evas_object_image_file_set(o, build_path("image.png"), NULL); + evas_object_image_fill_set(o, 0, 0, 120, 160); + evas_object_resize(o, 120, 160); + evas_object_show(o); + } + done = 0; +} + +/* cleanup */ +static void _cleanup(void) +{ + int i; + for (i = 0; i < (OBNUM / 2); i++) evas_object_del(o_images[i]); +} + +/* loop - do things */ +static void _loop(double t, int f) +{ + int i; + static Evas_Map *m = NULL; + Evas_Coord x, y, w, h; + if (!m) m = evas_map_new(4); + for (i = 0; i < (OBNUM / 2); i++) + { + w = 120; + h = 160; + x = (win_w / 2) - (w / 2); + x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2); + y = (win_h / 2) - (h / 2); + y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h / 2); + + evas_map_util_points_populate_from_geometry(m, x, y, w, h, 0); + + evas_map_point_color_set(m, 0, 255, 255, 255, 255); + evas_map_point_color_set(m, 1, 255, 0, 0, 255); + evas_map_point_color_set(m, 2, 0, 0, 255, 255); + evas_map_point_color_set(m, 3, 0, 255, 0, 255); + + evas_map_util_rotate(m, f, x + (w / 2), y + (h / 2)); + + evas_object_map_enable_set(o_images[i], 1); + evas_object_map_set(o_images[i], m); + } + FPS_STD(NAME); +} + +/* prepend special key handlers if interactive (before STD) */ +static void _key(char *key) +{ + KEY_STD; +} + + + + + + + + + + + + +/* template stuff - ignore */ +# endif +#endif + +#ifdef UI +_ui_menu_item_add(ICON, NAME, FNAME); +#endif + +#ifdef PROTO +void FNAME(void); +#endif + +#ifndef PROTO +# ifndef UI +void FNAME(void) +{ + ui_func_set(_key, _loop); + _setup(); +} +# endif +#endif +#undef FNAME +#undef NAME +#undef ICON diff --git a/src/bin/image_map_nearest_rotate.c b/src/bin/image_map_nearest_rotate.c new file mode 100644 index 0000000..aaa8ff7 --- /dev/null +++ b/src/bin/image_map_nearest_rotate.c @@ -0,0 +1,112 @@ +#undef FNAME +#undef NAME +#undef ICON + +/* metadata */ +#define FNAME image_map_nearest_rotate_start +#define NAME "Image Map Nearest Rotate" +#define ICON "map.png" + +#ifndef PROTO +# ifndef UI +# include "main.h" + +/* standard var */ +static int done = 0; + +/* private data */ +static Evas_Object *o_images[OBNUM]; + +/* setup */ +static void _setup(void) +{ + int i; + Evas_Object *o; + for (i = 0; i < (OBNUM / 2); i++) + { + o = evas_object_image_add(evas); + o_images[i] = o; + evas_object_image_file_set(o, build_path("logo.png"), NULL); + evas_object_image_fill_set(o, 0, 0, 120, 160); + evas_object_resize(o, 120, 160); + evas_object_image_smooth_scale_set(o, 0); + evas_object_show(o); + } + done = 0; +} + +/* cleanup */ +static void _cleanup(void) +{ + int i; + for (i = 0; i < (OBNUM / 2); i++) evas_object_del(o_images[i]); +} + +/* loop - do things */ +static void _loop(double t, int f) +{ + int i; + static Evas_Map *m = NULL; + Evas_Coord x, y, w, h; + if (!m) m = evas_map_new(4); + evas_map_smooth_set(m, 0); + for (i = 0; i < (OBNUM / 2); i++) + { + w = 120; + h = 160; + x = (win_w / 2) - (w / 2); + x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2); + y = (win_h / 2) - (h / 2); + y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h / 2); + + evas_map_util_points_populate_from_geometry(m, x, y, w, h, 0); + + evas_map_util_rotate(m, f, x + (w / 2), y + (h / 2)); + + evas_object_map_enable_set(o_images[i], 1); + evas_object_map_set(o_images[i], m); + } + FPS_STD(NAME); +} + +/* prepend special key handlers if interactive (before STD) */ +static void _key(char *key) +{ + KEY_STD; +} + + + + + + + + + + + + +/* template stuff - ignore */ +# endif +#endif + +#ifdef UI +_ui_menu_item_add(ICON, NAME, FNAME); +#endif + +#ifdef PROTO +void FNAME(void); +#endif + +#ifndef PROTO +# ifndef UI +void FNAME(void) +{ + ui_func_set(_key, _loop); + _setup(); +} +# endif +#endif +#undef FNAME +#undef NAME +#undef ICON diff --git a/src/bin/image_map_nearest_solid_rotate.c b/src/bin/image_map_nearest_solid_rotate.c new file mode 100644 index 0000000..3c2696f --- /dev/null +++ b/src/bin/image_map_nearest_solid_rotate.c @@ -0,0 +1,112 @@ +#undef FNAME +#undef NAME +#undef ICON + +/* metadata */ +#define FNAME image_map_nearest_solid_rotate_start +#define NAME "Image Map Nearest Solid Rotate" +#define ICON "map.png" + +#ifndef PROTO +# ifndef UI +# include "main.h" + +/* standard var */ +static int done = 0; + +/* private data */ +static Evas_Object *o_images[OBNUM]; + +/* setup */ +static void _setup(void) +{ + int i; + Evas_Object *o; + for (i = 0; i < (OBNUM / 2); i++) + { + o = evas_object_image_add(evas); + o_images[i] = o; + evas_object_image_file_set(o, build_path("image.png"), NULL); + evas_object_image_fill_set(o, 0, 0, 120, 160); + evas_object_resize(o, 120, 160); + evas_object_image_smooth_scale_set(o, 0); + evas_object_show(o); + } + done = 0; +} + +/* cleanup */ +static void _cleanup(void) +{ + int i; + for (i = 0; i < (OBNUM / 2); i++) evas_object_del(o_images[i]); +} + +/* loop - do things */ +static void _loop(double t, int f) +{ + int i; + static Evas_Map *m = NULL; + Evas_Coord x, y, w, h; + if (!m) m = evas_map_new(4); + evas_map_smooth_set(m, 0); + for (i = 0; i < (OBNUM / 2); i++) + { + w = 120; + h = 160; + x = (win_w / 2) - (w / 2); + x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2); + y = (win_h / 2) - (h / 2); + y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h / 2); + + evas_map_util_points_populate_from_geometry(m, x, y, w, h, 0); + + evas_map_util_rotate(m, f, x + (w / 2), y + (h / 2)); + + evas_object_map_enable_set(o_images[i], 1); + evas_object_map_set(o_images[i], m); + } + FPS_STD(NAME); +} + +/* prepend special key handlers if interactive (before STD) */ +static void _key(char *key) +{ + KEY_STD; +} + + + + + + + + + + + + +/* template stuff - ignore */ +# endif +#endif + +#ifdef UI +_ui_menu_item_add(ICON, NAME, FNAME); +#endif + +#ifdef PROTO +void FNAME(void); +#endif + +#ifndef PROTO +# ifndef UI +void FNAME(void) +{ + ui_func_set(_key, _loop); + _setup(); +} +# endif +#endif +#undef FNAME +#undef NAME +#undef ICON diff --git a/src/bin/image_map_rotate.c b/src/bin/image_map_rotate.c new file mode 100644 index 0000000..d84f84b --- /dev/null +++ b/src/bin/image_map_rotate.c @@ -0,0 +1,110 @@ +#undef FNAME +#undef NAME +#undef ICON + +/* metadata */ +#define FNAME image_map_rotate_start +#define NAME "Image Map Rotate" +#define ICON "map.png" + +#ifndef PROTO +# ifndef UI +# include "main.h" + +/* standard var */ +static int done = 0; + +/* private data */ +static Evas_Object *o_images[OBNUM]; + +/* setup */ +static void _setup(void) +{ + int i; + Evas_Object *o; + for (i = 0; i < (OBNUM / 2); i++) + { + o = evas_object_image_add(evas); + o_images[i] = o; + evas_object_image_file_set(o, build_path("logo.png"), NULL); + evas_object_image_fill_set(o, 0, 0, 120, 160); + evas_object_resize(o, 120, 160); + evas_object_show(o); + } + done = 0; +} + +/* cleanup */ +static void _cleanup(void) +{ + int i; + for (i = 0; i < (OBNUM / 2); i++) evas_object_del(o_images[i]); +} + +/* loop - do things */ +static void _loop(double t, int f) +{ + int i; + static Evas_Map *m = NULL; + Evas_Coord x, y, w, h; + if (!m) m = evas_map_new(4); + for (i = 0; i < (OBNUM / 2); i++) + { + w = 120; + h = 160; + x = (win_w / 2) - (w / 2); + x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2); + y = (win_h / 2) - (h / 2); + y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h / 2); + + evas_map_util_points_populate_from_geometry(m, x, y, w, h, 0); + + evas_map_util_rotate(m, f, x + (w / 2), y + (h / 2)); + + evas_object_map_enable_set(o_images[i], 1); + evas_object_map_set(o_images[i], m); + } + FPS_STD(NAME); +} + +/* prepend special key handlers if interactive (before STD) */ +static void _key(char *key) +{ + KEY_STD; +} + + + + + + + + + + + + +/* template stuff - ignore */ +# endif +#endif + +#ifdef UI +_ui_menu_item_add(ICON, NAME, FNAME); +#endif + +#ifdef PROTO +void FNAME(void); +#endif + +#ifndef PROTO +# ifndef UI +void FNAME(void) +{ + ui_func_set(_key, _loop); + _setup(); +} +# endif +#endif +#undef FNAME +#undef NAME +#undef ICON diff --git a/src/bin/image_map_solid_rotate.c b/src/bin/image_map_solid_rotate.c new file mode 100644 index 0000000..fc0b3ce --- /dev/null +++ b/src/bin/image_map_solid_rotate.c @@ -0,0 +1,110 @@ +#undef FNAME +#undef NAME +#undef ICON + +/* metadata */ +#define FNAME image_map_solid_rotate_start +#define NAME "Image Map Solid Rotate" +#define ICON "map.png" + +#ifndef PROTO +# ifndef UI +# include "main.h" + +/* standard var */ +static int done = 0; + +/* private data */ +static Evas_Object *o_images[OBNUM]; + +/* setup */ +static void _setup(void) +{ + int i; + Evas_Object *o; + for (i = 0; i < (OBNUM / 2); i++) + { + o = evas_object_image_add(evas); + o_images[i] = o; + evas_object_image_file_set(o, build_path("image.png"), NULL); + evas_object_image_fill_set(o, 0, 0, 120, 160); + evas_object_resize(o, 120, 160); + evas_object_show(o); + } + done = 0; +} + +/* cleanup */ +static void _cleanup(void) +{ + int i; + for (i = 0; i < (OBNUM / 2); i++) evas_object_del(o_images[i]); +} + +/* loop - do things */ +static void _loop(double t, int f) +{ + int i; + static Evas_Map *m = NULL; + Evas_Coord x, y, w, h; + if (!m) m = evas_map_new(4); + for (i = 0; i < (OBNUM / 2); i++) + { + w = 120; + h = 160; + x = (win_w / 2) - (w / 2); + x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2); + y = (win_h / 2) - (h / 2); + y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h / 2); + + evas_map_util_points_populate_from_geometry(m, x, y, w, h, 0); + + evas_map_util_rotate(m, f, x + (w / 2), y + (h / 2)); + + evas_object_map_enable_set(o_images[i], 1); + evas_object_map_set(o_images[i], m); + } + FPS_STD(NAME); +} + +/* prepend special key handlers if interactive (before STD) */ +static void _key(char *key) +{ + KEY_STD; +} + + + + + + + + + + + + +/* template stuff - ignore */ +# endif +#endif + +#ifdef UI +_ui_menu_item_add(ICON, NAME, FNAME); +#endif + +#ifdef PROTO +void FNAME(void); +#endif + +#ifndef PROTO +# ifndef UI +void FNAME(void) +{ + ui_func_set(_key, _loop); + _setup(); +} +# endif +#endif +#undef FNAME +#undef NAME +#undef ICON diff --git a/src/bin/image_mask.c b/src/bin/image_mask.c new file mode 100644 index 0000000..3677990 --- /dev/null +++ b/src/bin/image_mask.c @@ -0,0 +1,110 @@ +#undef FNAME +#undef NAME +#undef ICON + +/* metadata */ +#define FNAME image_mask +#define NAME "Image Mask" +#define ICON "blend.png" + +#ifndef PROTO +# ifndef UI +# include "main.h" + +/* standard var */ +static int done = 0; +/* private data */ +static Evas_Object *o_images[OBNUM]; + +/* setup */ +static void _setup(void) +{ + int i; + Evas_Object *o; + for (i = 0; i < OBNUM; i+= 2) + { + o = evas_object_image_add(evas); + o_images[i] = o; + evas_object_image_file_set(o, build_path("image.png"), NULL); + evas_object_image_fill_set(o, 0, 0, 120, 160); + evas_object_resize(o, 120, 160); + evas_object_show(o); + + o = evas_object_image_add(evas); + o_images[i + 1] = o; + evas_object_image_file_set(o, build_path("e-logo.png"), NULL); + evas_object_image_fill_set(o, 0, 0, 120, 160); + evas_object_resize(o, 120, 160); + evas_object_show(o); + evas_object_clip_set(o_images[i],o); + } + done = 0; +} + +/* cleanup */ +static void _cleanup(void) +{ + int i; + for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]); +} + +/* loop - do things */ +static void _loop(double t, int f) +{ + int i; + Evas_Coord x, y, w, h; + for (i = 0; i < OBNUM; i+= 2) + { + w = 120; + h = 160; + x = (win_w / 2) - (w / 2); + x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2); + y = (win_h / 2) - (h / 2); + y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h / 2); + evas_object_move(o_images[i], x, y); + evas_object_move(o_images[i + 1], x, y); + } + FPS_STD(NAME); +} + +/* prepend special key handlers if interactive (before STD) */ +static void _key(char *key) +{ + KEY_STD; +} + + + + + + + + + + + + +/* template stuff - ignore */ +# endif +#endif + +#ifdef UI +_ui_menu_item_add(ICON, NAME, FNAME); +#endif + +#ifdef PROTO +void FNAME(void); +#endif + +#ifndef PROTO +# ifndef UI +void FNAME(void) +{ + ui_func_set(_key, _loop); + _setup(); +} +# endif +#endif +#undef FNAME +#undef NAME +#undef ICON diff --git a/src/bin/image_mask_10.c b/src/bin/image_mask_10.c new file mode 100644 index 0000000..721c56e --- /dev/null +++ b/src/bin/image_mask_10.c @@ -0,0 +1,118 @@ +#undef FNAME +#undef NAME +#undef ICON + +/* metadata */ +#define FNAME image_mask_10 +#define NAME "Image Mask 10" +#define ICON "blend.png" + +#ifndef PROTO +# ifndef UI +# include "main.h" + +/* standard var */ +static int done = 0; +/* private data */ +static Evas_Object *o_images[1]; +static Evas_Object *o_mask; + +/* setup */ +static void _setup(void) +{ + int i; + Evas_Object *o; + + o = evas_object_image_add(evas); + o_mask = o; + evas_object_image_file_set(o, build_path("e-logo-mask.png"), NULL); + evas_object_image_fill_set(o, 0, 0, 720, 420); + evas_object_resize(o, 720, 420); + evas_object_move(o, (win_w - 720) / 2, (win_h - 420) / 2); + evas_object_show(o); + + for (i = 0; i < 1; i++) + { + o = evas_object_image_add(evas); + o_images[i] = o; + evas_object_image_file_set(o, build_path("texture.png"), NULL); + evas_object_image_fill_set(o, 0, 0, win_w * 4, win_h * 4); + evas_object_resize(o, win_w * 4, win_h * 4); + evas_object_clip_set(o, o_mask); + evas_object_show(o); + } + done = 0; +} + +/* cleanup */ +static void _cleanup(void) +{ + int i; + for (i = 0; i < 1; i++) evas_object_del(o_images[i]); + evas_object_del(o_mask); +} + +/* loop - do things */ +static void _loop(double t, int f) +{ + int i; + static Evas_Map *m = NULL; + Evas_Coord x, y, w, h; + if (!m) m = evas_map_new(4); + for (i = 0; i < 1; i++) + { + w = win_w * 4; + h = win_h * 4; + x = (win_w / 2) - (w / 2); + y = (win_h / 2) - (h / 2); + evas_map_util_points_populate_from_geometry(m, + -win_w, -win_h, + win_w * 4, win_h * 4, 0); + evas_map_util_rotate(m, f, win_w / 2, win_h / 2); + evas_object_map_enable_set(o_images[i], 1); + evas_object_map_set(o_images[i], m); + } + FPS_STD(NAME); +} + +/* prepend special key handlers if interactive (before STD) */ +static void _key(char *key) +{ + KEY_STD; +} + + + + + + + + + + + + +/* template stuff - ignore */ +# endif +#endif + +#ifdef UI +_ui_menu_item_add(ICON, NAME, FNAME); +#endif + +#ifdef PROTO +void FNAME(void); +#endif + +#ifndef PROTO +# ifndef UI +void FNAME(void) +{ + ui_func_set(_key, _loop); + _setup(); +} +# endif +#endif +#undef FNAME +#undef NAME +#undef ICON diff --git a/src/bin/image_mask_11.c b/src/bin/image_mask_11.c new file mode 100644 index 0000000..8489bc9 --- /dev/null +++ b/src/bin/image_mask_11.c @@ -0,0 +1,122 @@ +#undef FNAME +#undef NAME +#undef ICON + +/* metadata */ +#define FNAME image_mask_11 +#define NAME "Image Mask 11" +#define ICON "blend.png" + +#ifndef PROTO +# ifndef UI +# include "main.h" + +/* standard var */ +static int done = 0; +/* private data */ +static Evas_Object *o_images[OBNUM]; +static Evas_Object *o_mask; + +/* setup */ +static void _setup(void) +{ + int i; + Evas_Object *o; + + o = evas_object_image_add(evas); + o_mask = o; + evas_object_image_file_set(o, build_path("e-logo-mask.png"), NULL); + evas_object_image_fill_set(o, 0, 0, 720, 420); + evas_object_resize(o, 720, 420); + evas_object_move(o, (win_w - 720) / 2, (win_h - 420) / 2); + evas_object_show(o); + + for (i = 0; i < OBNUM; i++) + { + o = evas_object_image_add(evas); + o_images[i] = o; + evas_object_image_file_set(o, build_path("logo.png"), NULL); + evas_object_image_fill_set(o, 0, 0, 120, 160); + evas_object_resize(o, 120, 160); + evas_object_clip_set(o, o_mask); + evas_object_show(o); + } + done = 0; +} + +/* cleanup */ +static void _cleanup(void) +{ + int i; + for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]); + evas_object_del(o_mask); +} + +/* loop - do things */ +static void _loop(double t, int f) +{ + int i; + static Evas_Map *m = NULL; + Evas_Coord x, y, w, h; + for (i = 0; i < OBNUM; i++) + { + w = 120; + h = 160; + x = (win_w / 2) - (w / 2); + x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2); + y = (win_h / 2) - (h / 2); + y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h / 2); + evas_object_move(o_images[i], x, y); + } + if (!m) m = evas_map_new(4); + evas_map_util_points_populate_from_geometry(m, + (win_w - 720) / 2, + (win_h - 420) / 2, + 720, 420, 0); + evas_map_util_rotate(m, f, win_w / 2, win_h / 2); + evas_object_map_enable_set(o_mask, 1); + evas_object_map_set(o_mask, m); + FPS_STD(NAME); +} + +/* prepend special key handlers if interactive (before STD) */ +static void _key(char *key) +{ + KEY_STD; +} + + + + + + + + + + + + +/* template stuff - ignore */ +# endif +#endif + +#ifdef UI +_ui_menu_item_add(ICON, NAME, FNAME); +#endif + +#ifdef PROTO +void FNAME(void); +#endif + +#ifndef PROTO +# ifndef UI +void FNAME(void) +{ + ui_func_set(_key, _loop); + _setup(); +} +# endif +#endif +#undef FNAME +#undef NAME +#undef ICON diff --git a/src/bin/image_mask_12.c b/src/bin/image_mask_12.c new file mode 100644 index 0000000..fb94e58 --- /dev/null +++ b/src/bin/image_mask_12.c @@ -0,0 +1,119 @@ +#undef FNAME +#undef NAME +#undef ICON + +/* metadata */ +#define FNAME image_mask_12 +#define NAME "Image Mask 12" +#define ICON "blend.png" + +#ifndef PROTO +# ifndef UI +# include "main.h" + +/* standard var */ +static int done = 0; +/* private data */ +static Evas_Object *o_images[OBNUM]; +static Evas_Object *o_mask; + +/* setup */ +static void _setup(void) +{ + int i; + Evas_Object *o; + + o = evas_object_text_add(evas); + o_mask = o; + evas_object_text_font_set(o, "Vera-Bold", 150); + evas_object_show(o); + + for (i = 0; i < OBNUM; i++) + { + o = evas_object_image_add(evas); + o_images[i] = o; + evas_object_image_file_set(o, build_path("texture.png"), NULL); + evas_object_image_fill_set(o, 0, 0, 500, 444); + evas_object_resize(o, win_w * 4, win_h * 4); +// evas_object_clip_set(o, o_mask); + evas_object_show(o); + } + done = 0; +} + +/* cleanup */ +static void _cleanup(void) +{ + int i; + for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]); + evas_object_del(o_mask); +} + +/* loop - do things */ +static void _loop(double t, int f) +{ + int i; + Evas_Coord x, y, w, h; + const char *strs[] = { + "Big", "Smelly", "Fish", "Pants", "Octopus", "Garden", "There", "I", + "Am", "You", "Are", "Erogenous", "We", "Stick", "Wet", "Fishy", + "Fiddly", "Family", "Lair", "Monkeys", "Magazine" + }; + for (i = 0; i < OBNUM; i++) + { + w = win_w * 4; + h = win_h * 4; + x = (win_w / 2) - (w / 2); + x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (500 / 2); + y = (win_h / 2) - (h / 2); + y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (444 / 2); + evas_object_move(o_images[i], x, y); + } + evas_object_text_text_set(o_mask, strs[rnd() % (sizeof(strs) / sizeof(char *))]); + evas_object_color_set(o_mask, 255, 255, 255, 255); + evas_object_geometry_get(o_mask, NULL, NULL, &w, &h); + evas_object_move(o_mask, (win_w - w) / 2, (win_h - h) / 2); + FPS_STD(NAME); +} + +/* prepend special key handlers if interactive (before STD) */ +static void _key(char *key) +{ + KEY_STD; +} + + + + + + + + + + + + +/* template stuff - ignore */ +# endif +#endif + +#ifdef UI +_ui_menu_item_add(ICON, NAME, FNAME); +#endif + +#ifdef PROTO +void FNAME(void); +#endif + +#ifndef PROTO +# ifndef UI +void FNAME(void) +{ + ui_func_set(_key, _loop); + _setup(); +} +# endif +#endif +#undef FNAME +#undef NAME +#undef ICON diff --git a/src/bin/image_mask_13.c b/src/bin/image_mask_13.c new file mode 100644 index 0000000..559b657 --- /dev/null +++ b/src/bin/image_mask_13.c @@ -0,0 +1,119 @@ +#undef FNAME +#undef NAME +#undef ICON + +/* metadata */ +#define FNAME image_mask_13 +#define NAME "Image Mask 13" +#define ICON "blend.png" + +#ifndef PROTO +# ifndef UI +# include "main.h" + +/* standard var */ +static int done = 0; +/* private data */ +static Evas_Object *o_images[OBNUM]; +static Evas_Object *o_mask; + +/* setup */ +static void _setup(void) +{ + int i; + Evas_Object *o; + + o = evas_object_text_add(evas); + o_mask = o; + evas_object_text_font_set(o, "Vera-Bold", 150); + evas_object_show(o); + + for (i = 0; i < OBNUM; i++) + { + o = evas_object_image_add(evas); + o_images[i] = o; + evas_object_image_file_set(o, build_path("logo.png"), NULL); + evas_object_image_fill_set(o, 0, 0, 120, 160); + evas_object_resize(o, 120, 160); + evas_object_show(o); + evas_object_clip_set(o, o_mask); + } + done = 0; +} + +/* cleanup */ +static void _cleanup(void) +{ + int i; + for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]); + evas_object_del(o_mask); +} + +/* loop - do things */ +static void _loop(double t, int f) +{ + int i; + Evas_Coord x, y, w, h; + const char *strs[] = { + "Big", "Smelly", "Fish", "Pants", "Octopus", "Garden", "There", "I", + "Am", "You", "Are", "Erogenous", "We", "Stick", "Wet", "Fishy", + "Fiddly", "Family", "Lair", "Monkeys", "Magazine" + }; + for (i = 0; i < OBNUM; i++) + { + w = 120; + h = 160; + x = (win_w / 2) - (w / 2); + x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2); + y = (win_h / 2) - (h / 2); + y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h / 2); + evas_object_move(o_images[i], x, y); + } + evas_object_text_text_set(o_mask, strs[rnd() % (sizeof(strs) / sizeof(char *))]); + evas_object_color_set(o_mask, 255, 255, 255, 255); + evas_object_geometry_get(o_mask, NULL, NULL, &w, &h); + evas_object_move(o_mask, (win_w - w) / 2, (win_h - h) / 2); + FPS_STD(NAME); +} + +/* prepend special key handlers if interactive (before STD) */ +static void _key(char *key) +{ + KEY_STD; +} + + + + + + + + + + + + +/* template stuff - ignore */ +# endif +#endif + +#ifdef UI +_ui_menu_item_add(ICON, NAME, FNAME); +#endif + +#ifdef PROTO +void FNAME(void); +#endif + +#ifndef PROTO +# ifndef UI +void FNAME(void) +{ + ui_func_set(_key, _loop); + _setup(); +} +# endif +#endif +#undef FNAME +#undef NAME +#undef ICON diff --git a/src/bin/image_mask_14.c b/src/bin/image_mask_14.c new file mode 100644 index 0000000..a2a5d83 --- /dev/null +++ b/src/bin/image_mask_14.c @@ -0,0 +1,118 @@ +#undef FNAME +#undef NAME +#undef ICON + +/* metadata */ +#define FNAME image_mask_14 +#define NAME "Image Mask 14" +#define ICON "blend.png" + +#ifndef PROTO +# ifndef UI +# include "main.h" + +/* standard var */ +static int done = 0; +/* private data */ +static Evas_Object *o_images[OBNUM]; +static Evas_Object *o_mask; + +/* setup */ +static void _setup(void) +{ + int i; + Evas_Object *o; + + o = evas_object_image_add(evas); + o_mask = o; + evas_object_image_file_set(o, build_path("e-logo-mask.png"), NULL); + evas_object_image_fill_set(o, 0, 0, 720, 420); + evas_object_resize(o, 720, 420); + evas_object_move(o, (win_w - 720) / 2, (win_h - 420) / 2); + evas_object_show(o); + + for (i = 0; i < OBNUM; i++) + { + o = evas_object_image_add(evas); + o_images[i] = o; + evas_object_image_file_set(o, build_path("logo.png"), NULL); + evas_object_image_fill_set(o, 0, 0, 120, 160); + evas_object_resize(o, 120, 160); + evas_object_image_smooth_scale_set(o, 1); + evas_object_clip_set(o, o_mask); + evas_object_show(o); + } + done = 0; +} + +/* cleanup */ +static void _cleanup(void) +{ + int i; + for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]); + evas_object_del(o_mask); +} + +/* loop - do things */ +static void _loop(double t, int f) +{ + int i; + Evas_Coord x, y, w, h, w0, h0; + for (i = 0; i < OBNUM; i++) + { + w0 = 80; + h0 = 80; + w = 5 + ((1.0 + cos((double)(f + (i * 10)) / (7.4 * SLOW) )) * w0 * 2); + h = 5 + ((1.0 + sin((double)(f + (i * 19)) / (12.6 * SLOW) )) * h0 * 2); + x = (win_w / 2) - (w / 2); + x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w0 / 2); + y = (win_h / 2) - (h / 2); + y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h0 / 2); + evas_object_move(o_images[i], x, y); + evas_object_resize(o_images[i], w, h); + evas_object_image_fill_set(o_images[i], 0, 0, w, h); + } + FPS_STD(NAME); +} + +/* prepend special key handlers if interactive (before STD) */ +static void _key(char *key) +{ + KEY_STD; +} + + + + + + + + + + + + +/* template stuff - ignore */ +# endif +#endif + +#ifdef UI +_ui_menu_item_add(ICON, NAME, FNAME); +#endif + +#ifdef PROTO +void FNAME(void); +#endif + +#ifndef PROTO +# ifndef UI +void FNAME(void) +{ + ui_func_set(_key, _loop); + _setup(); +} +# endif +#endif +#undef FNAME +#undef NAME +#undef ICON diff --git a/src/bin/image_mask_15.c b/src/bin/image_mask_15.c new file mode 100644 index 0000000..f6a1abe --- /dev/null +++ b/src/bin/image_mask_15.c @@ -0,0 +1,118 @@ +#undef FNAME +#undef NAME +#undef ICON + +/* metadata */ +#define FNAME image_mask_15 +#define NAME "Image Mask 15" +#define ICON "blend.png" + +#ifndef PROTO +# ifndef UI +# include "main.h" + +/* standard var */ +static int done = 0; +/* private data */ +static Evas_Object *o_images[OBNUM]; +static Evas_Object *o_mask; + +/* setup */ +static void _setup(void) +{ + int i; + Evas_Object *o; + + o = evas_object_image_add(evas); + o_mask = o; + evas_object_image_file_set(o, build_path("e-logo-mask.png"), NULL); + evas_object_image_fill_set(o, 0, 0, 720, 420); + evas_object_resize(o, 720, 420); + evas_object_move(o, (win_w - 720) / 2, (win_h - 420) / 2); + evas_object_show(o); + + for (i = 0; i < OBNUM; i++) + { + o = evas_object_image_add(evas); + o_images[i] = o; + evas_object_image_file_set(o, build_path("logo.png"), NULL); + evas_object_image_fill_set(o, 0, 0, 120, 160); + evas_object_resize(o, 120, 160); + evas_object_image_smooth_scale_set(o, 0); + evas_object_clip_set(o, o_mask); + evas_object_show(o); + } + done = 0; +} + +/* cleanup */ +static void _cleanup(void) +{ + int i; + for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]); + evas_object_del(o_mask); +} + +/* loop - do things */ +static void _loop(double t, int f) +{ + int i; + Evas_Coord x, y, w, h, w0, h0; + for (i = 0; i < OBNUM; i++) + { + w0 = 80; + h0 = 80; + w = 5 + ((1.0 + cos((double)(f + (i * 10)) / (7.4 * SLOW) )) * w0 * 2); + h = 5 + ((1.0 + sin((double)(f + (i * 19)) / (12.6 * SLOW) )) * h0 * 2); + x = (win_w / 2) - (w / 2); + x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w0 / 2); + y = (win_h / 2) - (h / 2); + y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h0 / 2); + evas_object_move(o_images[i], x, y); + evas_object_resize(o_images[i], w, h); + evas_object_image_fill_set(o_images[i], 0, 0, w, h); + } + FPS_STD(NAME); +} + +/* prepend special key handlers if interactive (before STD) */ +static void _key(char *key) +{ + KEY_STD; +} + + + + + + + + + + + + +/* template stuff - ignore */ +# endif +#endif + +#ifdef UI +_ui_menu_item_add(ICON, NAME, FNAME); +#endif + +#ifdef PROTO +void FNAME(void); +#endif + +#ifndef PROTO +# ifndef UI +void FNAME(void) +{ + ui_func_set(_key, _loop); + _setup(); +} +# endif +#endif +#undef FNAME +#undef NAME +#undef ICON diff --git a/src/bin/image_mask_2.c b/src/bin/image_mask_2.c new file mode 100644 index 0000000..550bd3a --- /dev/null +++ b/src/bin/image_mask_2.c @@ -0,0 +1,110 @@ +#undef FNAME +#undef NAME +#undef ICON + +/* metadata */ +#define FNAME image_mask_2 +#define NAME "Image Mask 2" +#define ICON "blend.png" + +#ifndef PROTO +# ifndef UI +# include "main.h" + +/* standard var */ +static int done = 0; +/* private data */ +static Evas_Object *o_images[OBNUM]; + +/* setup */ +static void _setup(void) +{ + int i; + Evas_Object *o; + for (i = 0; i < OBNUM; i+= 2) + { + o = evas_object_image_add(evas); + o_images[i] = o; + evas_object_image_file_set(o, build_path("e-logo.png"), NULL); + evas_object_image_fill_set(o, 0, 0, 120, 160); + evas_object_resize(o, 120, 160); + evas_object_show(o); + + o = evas_object_image_add(evas); + o_images[i + 1] = o; + evas_object_image_file_set(o, build_path("e-logo-2.png"), NULL); + evas_object_image_fill_set(o, 0, 0, 120, 160); + evas_object_resize(o, 120, 160); + evas_object_show(o); + evas_object_clip_set(o_images[i], o); + } + done = 0; +} + +/* cleanup */ +static void _cleanup(void) +{ + int i; + for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]); +} + +/* loop - do things */ +static void _loop(double t, int f) +{ + int i; + Evas_Coord x, y, w, h; + for (i = 0; i < OBNUM; i+= 2) + { + w = 120; + h = 160; + x = (win_w / 2) - (w / 2); + x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2); + y = (win_h / 2) - (h / 2); + y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h / 2); + evas_object_move(o_images[i], x, y); + evas_object_move(o_images[i + 1], x, y); + } + FPS_STD(NAME); +} + +/* prepend special key handlers if interactive (before STD) */ +static void _key(char *key) +{ + KEY_STD; +} + + + + + + + + + + + + +/* template stuff - ignore */ +# endif +#endif + +#ifdef UI +_ui_menu_item_add(ICON, NAME, FNAME); +#endif + +#ifdef PROTO +void FNAME(void); +#endif + +#ifndef PROTO +# ifndef UI +void FNAME(void) +{ + ui_func_set(_key, _loop); + _setup(); +} +# endif +#endif +#undef FNAME +#undef NAME +#undef ICON diff --git a/src/bin/image_mask_3.c b/src/bin/image_mask_3.c new file mode 100644 index 0000000..39978b3 --- /dev/null +++ b/src/bin/image_mask_3.c @@ -0,0 +1,110 @@ +#undef FNAME +#undef NAME +#undef ICON + +/* metadata */ +#define FNAME image_mask_3 +#define NAME "Image Mask 3" +#define ICON "blend.png" + +#ifndef PROTO +# ifndef UI +# include "main.h" + +/* standard var */ +static int done = 0; +/* private data */ +static Evas_Object *o_images[OBNUM]; + +/* setup */ +static void _setup(void) +{ + int i; + Evas_Object *o; + for (i = 0; i < OBNUM; i+= 2) + { + o = evas_object_image_add(evas); + o_images[i] = o; + evas_object_image_file_set(o, build_path("e-logo-2.png"), NULL); + evas_object_image_fill_set(o, 0, 0, 120, 160); + evas_object_resize(o, 120, 160); + evas_object_show(o); + + o = evas_object_image_add(evas); + o_images[i + 1] = o; + evas_object_image_file_set(o, build_path("logo.png"), NULL); + evas_object_image_fill_set(o, 0, 0, 120, 160); + evas_object_resize(o, 120, 160); + evas_object_show(o); + evas_object_clip_set(o_images[i], o); + } + done = 0; +} + +/* cleanup */ +static void _cleanup(void) +{ + int i; + for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]); +} + +/* loop - do things */ +static void _loop(double t, int f) +{ + int i; + Evas_Coord x, y, w, h; + for (i = 0; i < OBNUM; i+= 2) + { + w = 120; + h = 160; + x = (win_w / 2) - (w / 2); + x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2); + y = (win_h / 2) - (h / 2); + y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h / 2); + evas_object_move(o_images[i], x, y); + evas_object_move(o_images[i + 1], x, y); + } + FPS_STD(NAME); +} + +/* prepend special key handlers if interactive (before STD) */ +static void _key(char *key) +{ + KEY_STD; +} + + + + + + + + + + + + +/* template stuff - ignore */ +# endif +#endif + +#ifdef UI +_ui_menu_item_add(ICON, NAME, FNAME); +#endif + +#ifdef PROTO +void FNAME(void); +#endif + +#ifndef PROTO +# ifndef UI +void FNAME(void) +{ + ui_func_set(_key, _loop); + _setup(); +} +# endif +#endif +#undef FNAME +#undef NAME +#undef ICON diff --git a/src/bin/image_mask_4.c b/src/bin/image_mask_4.c new file mode 100644 index 0000000..1657437 --- /dev/null +++ b/src/bin/image_mask_4.c @@ -0,0 +1,113 @@ +#undef FNAME +#undef NAME +#undef ICON + +/* metadata */ +#define FNAME image_mask_4 +#define NAME "Image Mask 4" +#define ICON "blend.png" + +#ifndef PROTO +# ifndef UI +# include "main.h" + +/* standard var */ +static int done = 0; +/* private data */ +static Evas_Object *o_images[OBNUM]; +static Evas_Object *o_mask; + +/* setup */ +static void _setup(void) +{ + int i; + Evas_Object *o; + + o = evas_object_image_add(evas); + o_mask = o; + evas_object_image_file_set(o, build_path("e-logo-mask.png"), NULL); + evas_object_image_fill_set(o, 0, 0, 720, 420); + evas_object_resize(o, 720, 420); + evas_object_move(o, (win_w - 720) / 2, (win_h - 420) / 2); + evas_object_show(o); + + for (i = 0; i < OBNUM; i++) + { + o = evas_object_image_add(evas); + o_images[i] = o; + evas_object_image_file_set(o, build_path("logo.png"), NULL); + evas_object_image_fill_set(o, 0, 0, 120, 160); + evas_object_resize(o, 120, 160); + evas_object_clip_set(o, o_mask); + evas_object_show(o); + } + done = 0; +} + +/* cleanup */ +static void _cleanup(void) +{ + int i; + for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]); + evas_object_del(o_mask); +} + +/* loop - do things */ +static void _loop(double t, int f) +{ + int i; + Evas_Coord x, y, w, h; + for (i = 0; i < OBNUM; i++) + { + w = 120; + h = 160; + x = (win_w / 2) - (w / 2); + x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2); + y = (win_h / 2) - (h / 2); + y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h / 2); + evas_object_move(o_images[i], x, y); + } + FPS_STD(NAME); +} + +/* prepend special key handlers if interactive (before STD) */ +static void _key(char *key) +{ + KEY_STD; +} + + + + + + + + + + + + +/* template stuff - ignore */ +# endif +#endif + +#ifdef UI +_ui_menu_item_add(ICON, NAME, FNAME); +#endif + +#ifdef PROTO +void FNAME(void); +#endif + +#ifndef PROTO +# ifndef UI +void FNAME(void) +{ + ui_func_set(_key, _loop); + _setup(); +} +# endif +#endif +#undef FNAME +#undef NAME +#undef ICON diff --git a/src/bin/image_mask_5.c b/src/bin/image_mask_5.c new file mode 100644 index 0000000..288a120 --- /dev/null +++ b/src/bin/image_mask_5.c @@ -0,0 +1,113 @@ +#undef FNAME +#undef NAME +#undef ICON + +/* metadata */ +#define FNAME image_mask_5 +#define NAME "Image Mask 5" +#define ICON "blend.png" + +#ifndef PROTO +# ifndef UI +# include "main.h" + +/* standard var */ +static int done = 0; +/* private data */ +static Evas_Object *o_images[OBNUM]; +static Evas_Object *o_mask; + +/* setup */ +static void _setup(void) +{ + int i; + Evas_Object *o; + + o = evas_object_image_add(evas); + o_mask = o; + evas_object_image_file_set(o, build_path("e-logo-2.png"), NULL); + evas_object_image_fill_set(o, 0, 0, 120, 160); + evas_object_resize(o, 120, 160); + evas_object_move(o, (win_w - 120) / 2, (win_h - 160) / 2); + evas_object_show(o); + + for (i = 0; i < OBNUM; i++) + { + o = evas_object_image_add(evas); + o_images[i] = o; + evas_object_image_file_set(o, build_path("logo.png"), NULL); + evas_object_image_fill_set(o, 0, 0, 120, 160); + evas_object_resize(o, 120, 160); + evas_object_clip_set(o, o_mask); + evas_object_show(o); + } + done = 0; +} + +/* cleanup */ +static void _cleanup(void) +{ + int i; + for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]); + evas_object_del(o_mask); +} + +/* loop - do things */ +static void _loop(double t, int f) +{ + int i; + Evas_Coord x, y, w, h; + for (i = 0; i < OBNUM; i++) + { + w = 120; + h = 160; + x = (win_w / 2) - (w / 2); + x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2); + y = (win_h / 2) - (h / 2); + y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h / 2); + evas_object_move(o_images[i], x, y); + } + FPS_STD(NAME); +} + +/* prepend special key handlers if interactive (before STD) */ +static void _key(char *key) +{ + KEY_STD; +} + + + + + + + + + + + + +/* template stuff - ignore */ +# endif +#endif + +#ifdef UI +_ui_menu_item_add(ICON, NAME, FNAME); +#endif + +#ifdef PROTO +void FNAME(void); +#endif + +#ifndef PROTO +# ifndef UI +void FNAME(void) +{ + ui_func_set(_key, _loop); + _setup(); +} +# endif +#endif +#undef FNAME +#undef NAME +#undef ICON diff --git a/src/bin/image_mask_6.c b/src/bin/image_mask_6.c new file mode 100644 index 0000000..caac8f0 --- /dev/null +++ b/src/bin/image_mask_6.c @@ -0,0 +1,113 @@ +#undef FNAME +#undef NAME +#undef ICON + +/* metadata */ +#define FNAME image_mask_6 +#define NAME "Image Mask 6" +#define ICON "blend.png" + +#ifndef PROTO +# ifndef UI +# include "main.h" + +/* standard var */ +static int done = 0; +/* private data */ +static Evas_Object *o_images[OBNUM]; +static Evas_Object *o_mask; + +/* setup */ +static void _setup(void) +{ + int i; + Evas_Object *o; + + o = evas_object_image_add(evas); + o_mask = o; + evas_object_image_file_set(o, build_path("e-logo-mask.png"), NULL); + evas_object_image_fill_set(o, 0, 0, 720, 420); + evas_object_resize(o, 720, 420); + evas_object_move(o, (win_w - 720) / 2, (win_h - 420) / 2); + evas_object_show(o); + + for (i = 0; i < OBNUM; i++) + { + o = evas_object_image_add(evas); + o_images[i] = o; + evas_object_image_file_set(o, build_path("logo.png"), NULL); + evas_object_image_fill_set(o, 0, 0, 120 / 2, 160 / 2); + evas_object_resize(o, 120 / 2, 160 / 2); + evas_object_clip_set(o, o_mask); + evas_object_show(o); + } + done = 0; +} + +/* cleanup */ +static void _cleanup(void) +{ + int i; + for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]); + evas_object_del(o_mask); +} + +/* loop - do things */ +static void _loop(double t, int f) +{ + int i; + Evas_Coord x, y, w, h; + for (i = 0; i < OBNUM; i++) + { + w = 120 / 2; + h = 160 / 2; + x = (win_w / 2) - (w / 2); + x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2); + y = (win_h / 2) - (h / 2); + y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h / 2); + evas_object_move(o_images[i], x, y); + } + FPS_STD(NAME); +} + +/* prepend special key handlers if interactive (before STD) */ +static void _key(char *key) +{ + KEY_STD; +} + + + + + + + + + + + + +/* template stuff - ignore */ +# endif +#endif + +#ifdef UI +_ui_menu_item_add(ICON, NAME, FNAME); +#endif + +#ifdef PROTO +void FNAME(void); +#endif + +#ifndef PROTO +# ifndef UI +void FNAME(void) +{ + ui_func_set(_key, _loop); + _setup(); +} +# endif +#endif +#undef FNAME +#undef NAME +#undef ICON diff --git a/src/bin/image_mask_7.c b/src/bin/image_mask_7.c new file mode 100644 index 0000000..a8ccb87 --- /dev/null +++ b/src/bin/image_mask_7.c @@ -0,0 +1,118 @@ +#undef FNAME +#undef NAME +#undef ICON + +/* metadata */ +#define FNAME image_mask_7 +#define NAME "Image Mask 7" +#define ICON "blend.png" + +#ifndef PROTO +# ifndef UI +# include "main.h" + +/* standard var */ +static int done = 0; +/* private data */ +static Evas_Object *o_images[OBNUM]; +static Evas_Object *o_mask; + +/* setup */ +static void _setup(void) +{ + int i; + Evas_Object *o; + + o = evas_object_image_add(evas); + o_mask = o; + evas_object_image_file_set(o, build_path("e-logo-2.png"), NULL); + evas_object_image_fill_set(o, 0, 0, 120, 160); + evas_object_resize(o, 120, 160); + evas_object_move(o, (win_w - 120) / 2, (win_h - 160) / 2); + evas_object_show(o); + + for (i = 0; i < OBNUM; i++) + { + o = evas_object_image_add(evas); + o_images[i] = o; + evas_object_image_file_set(o, build_path("logo.png"), NULL); + evas_object_image_fill_set(o, 0, 0, 120, 160); + evas_object_resize(o, 120, 160); + evas_object_clip_set(o, o_mask); + evas_object_show(o); + } + done = 0; +} + +/* cleanup */ +static void _cleanup(void) +{ + int i; + for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]); + evas_object_del(o_mask); +} + +/* loop - do things */ +static void _loop(double t, int f) +{ + int i; + Evas_Coord x, y, w, h; + for (i = 0; i < OBNUM; i++) + { + w = 120; + h = 160; + x = (win_w / 2) - (w / 2); + x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2); + y = (win_h / 2) - (h / 2); + y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h / 2); + evas_object_move(o_images[i], x, y); + } + w = 10 + (110 + (110 * sin((double)(f) / (14.3 * SLOW)))); + h = 10 + (150 + (150 * sin((double)(f) / (21.7 * SLOW)))); + evas_object_image_fill_set(o_mask, 0, 0, w, h); + evas_object_resize(o_mask, w, h); + evas_object_move(o_mask, (win_w - w) / 2, (win_h - h) / 2); + FPS_STD(NAME); +} + +/* prepend special key handlers if interactive (before STD) */ +static void _key(char *key) +{ + KEY_STD; +} + + + + + + + + + + + + +/* template stuff - ignore */ +# endif +#endif + +#ifdef UI +_ui_menu_item_add(ICON, NAME, FNAME); +#endif + +#ifdef PROTO +void FNAME(void); +#endif + +#ifndef PROTO +# ifndef UI +void FNAME(void) +{ + ui_func_set(_key, _loop); + _setup(); +} +# endif +#endif +#undef FNAME +#undef NAME +#undef ICON diff --git a/src/bin/image_mask_8.c b/src/bin/image_mask_8.c new file mode 100644 index 0000000..961a44d --- /dev/null +++ b/src/bin/image_mask_8.c @@ -0,0 +1,113 @@ +#undef FNAME +#undef NAME +#undef ICON + +/* metadata */ +#define FNAME image_mask_8 +#define NAME "Image Mask 8" +#define ICON "blend.png" + +#ifndef PROTO +# ifndef UI +# include "main.h" + +/* standard var */ +static int done = 0; +/* private data */ +static Evas_Object *o_images[1]; +static Evas_Object *o_mask; + +/* setup */ +static void _setup(void) +{ + int i; + Evas_Object *o; + + o = evas_object_image_add(evas); + o_mask = o; + evas_object_image_file_set(o, build_path("e-logo-mask.png"), NULL); + evas_object_image_fill_set(o, 0, 0, 720, 420); + evas_object_resize(o, 720, 420); + evas_object_move(o, (win_w - 720) / 2, (win_h - 420) / 2); + evas_object_show(o); + + for (i = 0; i < 1; i++) + { + o = evas_object_image_add(evas); + o_images[i] = o; + evas_object_image_file_set(o, build_path("texture.png"), NULL); + evas_object_image_fill_set(o, 0, 0, 500, 444); + evas_object_resize(o, win_w * 4, win_h * 4); + evas_object_clip_set(o, o_mask); + evas_object_show(o); + } + done = 0; +} + +/* cleanup */ +static void _cleanup(void) +{ + int i; + for (i = 0; i < 1; i++) evas_object_del(o_images[i]); + evas_object_del(o_mask); +} + +/* loop - do things */ +static void _loop(double t, int f) +{ + int i; + Evas_Coord x, y, w, h; + for (i = 0; i < 1; i++) + { + w = win_w * 4; + h = win_h * 4; + x = (win_w / 2) - (w / 2); + x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (500 / 2); + y = (win_h / 2) - (h / 2); + y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (444 / 2); + evas_object_move(o_images[i], x, y); + } + FPS_STD(NAME); +} + +/* prepend special key handlers if interactive (before STD) */ +static void _key(char *key) +{ + KEY_STD; +} + + + + + + + + + + + + +/* template stuff - ignore */ +# endif +#endif + +#ifdef UI +_ui_menu_item_add(ICON, NAME, FNAME); +#endif + +#ifdef PROTO +void FNAME(void); +#endif + +#ifndef PROTO +# ifndef UI +void FNAME(void) +{ + ui_func_set(_key, _loop); + _setup(); +} +# endif +#endif +#undef FNAME +#undef NAME +#undef ICON diff --git a/src/bin/image_mask_9.c b/src/bin/image_mask_9.c new file mode 100644 index 0000000..f39d80e --- /dev/null +++ b/src/bin/image_mask_9.c @@ -0,0 +1,123 @@ +#undef FNAME +#undef NAME +#undef ICON + +/* metadata */ +#define FNAME image_mask_9 +#define NAME "Image Mask 9" +#define ICON "blend.png" + +#ifndef PROTO +# ifndef UI +# include "main.h" + +/* standard var */ +static int done = 0; +/* private data */ +static Evas_Object *o_images[1]; +static Evas_Object *o_mask; + +/* setup */ +static void _setup(void) +{ + int i; + Evas_Object *o; + + o = evas_object_image_add(evas); + o_mask = o; + evas_object_image_file_set(o, build_path("e-logo-mask.png"), NULL); + evas_object_image_fill_set(o, 0, 0, 720, 420); + evas_object_resize(o, 720, 420); + evas_object_move(o, (win_w - 720) / 2, (win_h - 420) / 2); + evas_object_show(o); + + for (i = 0; i < 1; i++) + { + o = evas_object_image_add(evas); + o_images[i] = o; + evas_object_image_file_set(o, build_path("texture.png"), NULL); + evas_object_image_fill_set(o, 0, 0, 500, 444); + evas_object_resize(o, win_w * 4, win_h * 4); + evas_object_clip_set(o, o_mask); + evas_object_show(o); + } + done = 0; +} + +/* cleanup */ +static void _cleanup(void) +{ + int i; + for (i = 0; i < 1; i++) evas_object_del(o_images[i]); + evas_object_del(o_mask); +} + +/* loop - do things */ +static void _loop(double t, int f) +{ + int i; + static Evas_Map *m = NULL; + Evas_Coord x, y, w, h; + for (i = 0; i < 1; i++) + { + w = win_w * 4; + h = win_h * 4; + x = (win_w / 2) - (w / 2); + x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (500 / 2); + y = (win_h / 2) - (h / 2); + y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (444 / 2); + evas_object_move(o_images[i], x, y); + } + if (!m) m = evas_map_new(4); + + evas_map_util_points_populate_from_geometry(m, + (win_w - 720) / 2, + (win_h - 420) / 2, + 720, 420, 0); + evas_map_util_rotate(m, f, win_w / 2, win_h / 2); + evas_object_map_enable_set(o_mask, 1); + evas_object_map_set(o_mask, m); + FPS_STD(NAME); +} + +/* prepend special key handlers if interactive (before STD) */ +static void _key(char *key) +{ + KEY_STD; +} + + + + + + + + + + + + +/* template stuff - ignore */ +# endif +#endif + +#ifdef UI +_ui_menu_item_add(ICON, NAME, FNAME); +#endif + +#ifdef PROTO +void FNAME(void); +#endif + +#ifndef PROTO +# ifndef UI +void FNAME(void) +{ + ui_func_set(_key, _loop); + _setup(); +} +# endif +#endif +#undef FNAME +#undef NAME +#undef ICON diff --git a/src/bin/image_quality_scale.c b/src/bin/image_quality_scale.c index 5c1b3ea..57dbe9c 100644 --- a/src/bin/image_quality_scale.c +++ b/src/bin/image_quality_scale.c @@ -5,7 +5,7 @@ /* metadata */ #define FNAME image_quality_scale_start #define NAME "Image Quality Scale" -#define ICON "mushroom.png" +#define ICON "data.png" #ifndef PROTO # ifndef UI diff --git a/src/bin/main.c b/src/bin/main.c index 736e249..7f01a04 100644 --- a/src/bin/main.c +++ b/src/bin/main.c @@ -1,11 +1,16 @@ #include "main.h" Evas *evas = NULL; +const char *profile = "n800"; int win_w = 720, win_h = 420; +const char *engine = NULL; +int loops = LOOPS; +int fullscreen = 0; static char *datadir = NULL; static int go = 1; static void (*loop_func) (void) = NULL; +static void (*shutdown_func) (void) = NULL; /* this guarantees that "random" numbers will always be the same set regardless * of what os/system/etc we are on - as often i need just some "random" set of @@ -1107,7 +1112,6 @@ build_path(const char *filename) int engine_abort(void) { - fprintf(stderr, "go: %i\n", go); go = 0; return go; } @@ -1118,43 +1122,165 @@ engine_loop(void) loop_func(); } +void +engine_shutdown(void) +{ + shutdown_func(); +} + static int _engine_go(void) { return go; } +static const Expedite_Engine engines[] = { +#if HAVE_EVAS_SOFTWARE_XLIB + { "xlib", engine_software_xlib_args, engine_software_xlib_loop, engine_software_xlib_shutdown }, +#endif +#if HAVE_EVAS_XRENDER_X11 + { "xr", engine_xrender_x11_args, engine_xrender_x11_loop, engine_xrender_x11_shutdown }, +#endif +#if HAVE_EVAS_OPENGL_X11 + { "gl", engine_gl_x11_args, engine_gl_x11_loop, engine_gl_x11_shutdown }, +#endif +#if HAVE_EVAS_SOFTWARE_XCB + { "xcb", engine_software_xcb_args, engine_software_xcb_loop, engine_software_xcb_shutdown }, +#endif +#if HAVE_EVAS_XRENDER_XCB + { "xrxcb", engine_xrender_xcb_args, engine_xrender_xcb_loop, engine_xrender_xcb_shutdown }, +#endif +#if HAVE_EVAS_SOFTWARE_GDI + { "gdi", engine_software_gdi_args, engine_software_gdi_loop, engine_software_gdi_shutdown }, +#endif +#if HAVE_EVAS_SOFTWARE_DDRAW + { "ddraw", engine_software_ddraw_args, engine_software_ddraw_loop, engine_software_ddraw_shutdown }, +#endif +#if HAVE_EVAS_DIRECT3D + { "direct3d",engine_direct3d_args, engine_direct3d_loop, engine_direct3d_shutdown }, +#endif +#if BUILD_SDL + { "sdl", engine_software_sdl_args, engine_software_sdl_loop, engine_software_sdl_shutdown }, +#endif +#if HAVE_EVAS_OPENGL_SDL + { "gl-sdl",engine_gl_sdl_args, engine_gl_sdl_loop, engine_gl_sdl_shutdown }, +#endif +#if HAVE_EVAS_FB + { "fb", engine_fb_args, engine_fb_loop, engine_fb_shutdown }, +#endif +#if HAVE_EVAS_DIRECTFB + { "directfb",engine_directfb_args, engine_directfb_loop, engine_directfb_shutdown }, +#endif +#if HAVE_EVAS_OPENGL_COCOA + { "gl-cocoa", engine_gl_cocoa_args, engine_gl_cocoa_loop, engine_gl_cocoa_shutdown }, +#endif +#if HAVE_EVAS_PSL1GHT + { "psl1ght", engine_psl1ght_args, engine_psl1ght_loop, engine_psl1ght_shutdown }, +#endif +#if HAVE_EVAS_SOFTWARE_16_X11 + { "x11-16",engine_software_16_x11_args, engine_software_16_x11_loop, engine_software_16_x11_shutdown }, +#endif +#if HAVE_EVAS_SOFTWARE_16_DDRAW + { "ddraw-16",engine_software_16_ddraw_args, engine_software_16_ddraw_loop, engine_software_16_ddraw_shutdown }, +#endif +#if HAVE_EVAS_SOFTWARE_16_WINCE + { "wince", engine_software_16_wince_args, engine_software_16_wince_loop, engine_software_16_wince_shutdown }, + { "wince-fb", engine_software_16_wince_args, engine_software_16_wince_loop, engine_software_16_wince_shutdown }, + { "wince-gapi", engine_software_16_wince_args, engine_software_16_wince_loop, engine_software_16_wince_shutdown }, + { "wince-ddraw", engine_software_16_wince_args, engine_software_16_wince_loop, engine_software_16_wince_shutdown }, + { "wince-gdi", engine_software_16_wince_args, engine_software_16_wince_loop, engine_software_16_wince_shutdown }, +#endif + { NULL, NULL, NULL, NULL } +}; + +static const Expedite_Resolution resolutions[] = { + { "qvga", 320 , 240 }, + { "qvga-p", 240 , 320 }, + { "hvga", 320 , 480 }, + { "hvga-p", 480 , 320 }, + { "vga", 640 , 480 }, + { "vga-p", 480 , 640 }, + { "wvga", 800 , 480 }, + { "wvga-p", 480 , 800 }, + { "svga", 800 , 600 }, + { "svga-p", 600 , 800 }, + { "xga", 1024, 768 }, + { "xga-p", 768 , 1024}, + { "wxga", 1280, 768 }, + { "wxga-p", 768 , 1280}, + { "n800", 720 , 420 }, + { "pal", 720 , 576 }, + { "480p", 720 , 480 }, + { "720p", 1280, 720 }, + { "1080p", 1920, 1080}, + { "wsvga", 1024, 600 }, + { "wsvga-p", 600 , 1024}, + { NULL, 0, 0 } +}; + +static void +_help(void) +{ + int i; + + fprintf(stderr, + "No engine selected.\n" + "\n" + "Options:\n" + " -datadir path/to/data\n" + " -a (autorun all tests)\n" + " -c NUM (loop count for test)\n" + " -l (list tests)\n" + " -t TEST-NUM\n" + " -e ENGINE\n" + " -p PROFILE\n" + " -f use netwm fullscreen request (requires x11 + wm)\n" + "\n" + "Where ENGINE can be one of:\n"); + for (i = 0; engines[i].name; ++i) + fprintf(stderr, " %s", engines[i].name); + + fprintf(stderr, + "\n" + "Where PROFILE can be one of:\n"); + + for (i = 0; resolutions[i].name; ++i) + fprintf(stderr, " %s", resolutions[i].name); + + fprintf(stderr, "\n"); + exit(-1); +} static int _profile_parse(int argc, char **argv) { - int i; + int i, j; for (i = 1; i < argc; i++) { if ((!strcmp(argv[i], "-p")) && (i < (argc - 1))) { i++; - if (!strcmp(argv[i], "qvga")) {win_w = 320 ; win_h = 240 ;} - else if (!strcmp(argv[i], "qvga-p")) {win_w = 240 ; win_h = 320 ;} - else if (!strcmp(argv[i], "vga")) {win_w = 640 ; win_h = 480 ;} - else if (!strcmp(argv[i], "vga-p")) {win_w = 480 ; win_h = 640 ;} - else if (!strcmp(argv[i], "wvga")) {win_w = 800 ; win_h = 480 ;} - else if (!strcmp(argv[i], "wvga-p")) {win_w = 480 ; win_h = 800 ;} - else if (!strcmp(argv[i], "svga")) {win_w = 800 ; win_h = 600 ;} - else if (!strcmp(argv[i], "svga-p")) {win_w = 600 ; win_h = 800 ;} - else if (!strcmp(argv[i], "xga")) {win_w = 1024; win_h = 768 ;} - else if (!strcmp(argv[i], "xga-p")) {win_w = 768 ; win_h = 1024;} - else if (!strcmp(argv[i], "wxga")) {win_w = 1280; win_h = 768 ;} - else if (!strcmp(argv[i], "wxga-p")) {win_w = 768 ; win_h = 1280;} - else if (!strcmp(argv[i], "n800")) {win_w = 720 ; win_h = 420 ;} - else if (!strcmp(argv[i], "pal")) {win_w = 720 ; win_h = 576 ;} - else if (!strcmp(argv[i], "720p")) {win_w = 1280; win_h = 720 ;} - else - { - printf("Invalid profile: %s\n", argv[i]); - return 0; - } + for (j = 0; resolutions[j].name; ++j) + if (!strcmp(argv[i], resolutions[j].name)) + { + profile = resolutions[j].name; + win_w = resolutions[j].width; + win_h = resolutions[j].height; + break; + } + + if (!resolutions[j].name) + _help(); } + else if ((!strcmp(argv[i], "-c")) && (i < (argc - 1))) + { + i++; + loops = atoi(argv[i]); + } + else if (!strcmp(argv[i], "-f")) + { + fullscreen = 1; + } } return 1; } @@ -1179,123 +1305,34 @@ _engine_args(int argc, char **argv) char buf[4096]; char *prefix; int profile_ok; + int i, j; /* FIXME: parse args for geometry, engine etc. */ profile_ok = _profile_parse(argc, argv); -#if HAVE_EVAS_SOFTWARE_X11 - if (engine_software_x11_args(argc, argv)) - loop_func = engine_software_x11_loop; -#endif -#if HAVE_EVAS_XRENDER_X11 - if (engine_xrender_x11_args(argc, argv)) - loop_func = engine_xrender_x11_loop; -#endif -#if HAVE_EVAS_OPENGL_X11 - if (engine_gl_x11_args(argc, argv)) - loop_func = engine_gl_x11_loop; -#endif -#if HAVE_EVAS_SOFTWARE_XCB - if (engine_software_xcb_args(argc, argv)) - loop_func = engine_software_xcb_loop; -#endif -#if HAVE_EVAS_SOFTWARE_DDRAW - if (engine_software_ddraw_args(argc, argv)) - loop_func = engine_software_ddraw_loop; -#endif -#if HAVE_EVAS_DIRECT3D - if (engine_direct3d_args(argc, argv)) - loop_func = engine_direct3d_loop; -#endif -#if HAVE_EVAS_OPENGL_GLEW - if (engine_gl_glew_args(argc, argv)) - loop_func = engine_gl_glew_loop; -#endif -#if HAVE_EVAS_SOFTWARE_SDL - if (engine_software_sdl_args(argc, argv)) - loop_func = engine_software_sdl_loop; -#endif -#if HAVE_EVAS_FB - if (engine_fb_args(argc, argv)) - loop_func = engine_fb_loop; -#endif -#if HAVE_EVAS_DIRECTFB - if (engine_directfb_args(argc, argv)) - loop_func = engine_directfb_loop; -#endif -#if HAVE_EVAS_SOFTWARE_16_X11 - if (engine_software_16_x11_args(argc, argv)) - loop_func = engine_software_16_x11_loop; -#endif -#if HAVE_EVAS_SOFTWARE_16_DDRAW - if (engine_software_16_ddraw_args(argc, argv)) - loop_func = engine_software_16_ddraw_loop; -#endif -#if HAVE_EVAS_SOFTWARE_16_WINCE - if (engine_software_16_wince_args(argc, argv)) - loop_func = engine_software_16_wince_loop; -#endif + + evas_output_size_set(evas, win_w, win_h); + evas_output_viewport_set(evas, 0, 0, win_w, win_h); + + for (i = 1; i < argc; ++i) + if ((!strcmp(argv[i], "-e")) && (i < (argc - 1))) + { + ++i; + + for (j = 0; engines[j].name; ++j) + if (!strcmp(argv[i], engines[j].name)) + { + engine = engines[j].name; + if (engines[j].init(engines[j].name, win_w, win_h)) + { + loop_func = engines[j].loop; + shutdown_func = engines[j].shutdown; + } + break; + } + } + if ((!loop_func) || (!profile_ok)) - { - fprintf(stderr, - "No engine selected.\n" - "\n" - "Options:\n" - " -datadir path/to/data\n" - " -a (autorun all tests)\n" - " -e ENGINE\n" - " -p PROFILE\n" - "\n" - "Where ENGINE can be one of:\n" - " " -#if HAVE_EVAS_SOFTWARE_X11 - " x11" -#endif -#if HAVE_EVAS_XRENDER_X11 - " xr" -#endif -#if HAVE_EVAS_OPENGL_X11 - " gl" -#endif -#if HAVE_EVAS_SOFTWARE_XCB - " xcb" -#endif -#if HAVE_EVAS_SOFTWARE_DDRAW - " ddraw" -#endif -#if HAVE_EVAS_DIRECT3D - " direct3d" -#endif -#if HAVE_EVAS_OPENGL_GLEW - " gl-glew" -#endif -#if HAVE_EVAS_SOFTWARE_SDL - " sdl sdl-16" -#endif -#if HAVE_EVAS_FB - " fb" -#endif -#if HAVE_EVAS_DIRECTFB - " directfb" -#endif -#if HAVE_EVAS_SOFTWARE_16_X11 - " x11-16" -#endif -#if HAVE_EVAS_SOFTWARE_16_DDRAW - " ddraw-16" -#endif -#if HAVE_EVAS_SOFTWARE_16_WINCE - " wince" - " wince-fb" - " wince-gapi" - " wince-ddraw" -#endif - "\n" - "Where PROFILE can be one of:\n" - " qvga qvga-p vga vga-p wvga wvga-p svga svga-p xga xga-p wxga wxga-p\n" - " n800 pal 720p\n" - ); - exit(-1); - } + _help(); datadir = _datadir_parse(argc, argv); @@ -1307,8 +1344,6 @@ _engine_args(int argc, char **argv) snprintf(buf, 4096, "%s", prefix); - evas_output_size_set(evas, win_w, win_h); - evas_output_viewport_set(evas, 0, 0, win_w, win_h); evas_key_modifier_add(evas, "Shift"); evas_key_modifier_add(evas, "Control"); evas_key_modifier_add(evas, "Alt"); @@ -1317,13 +1352,18 @@ _engine_args(int argc, char **argv) evas_key_lock_add(evas, "Num_Lock"); evas_key_lock_add(evas, "Scroll_Lock"); evas_font_path_append(evas, buf); - evas_image_cache_set(evas, 0 * 1024 * 1024); - evas_font_cache_set(evas, 0 * 1024 * 1024); +// BLAH +// evas_image_cache_set(evas, 4 * 1024 * 1024); +// evas_font_cache_set(evas, 1 * 1024 * 1024); } int main(int argc, char **argv) { +#if defined (HAVE_EVAS_SOFTWARE_XLIB) || defined (HAVE_EVAS_XRENDER_X11) ||defined (HAVE_EVAS_OPENGL_X11) || defined (HAVE_EVAS_SOFTWARE_16_X11) + XInitThreads(); +#endif + evas_init(); evas = evas_new(); @@ -1331,15 +1371,17 @@ main(int argc, char **argv) ui_args(argc, argv); evas_font_hinting_set(evas, EVAS_FONT_HINTING_AUTO); - + while (_engine_go()) { - ui_loop(); engine_loop(); + ui_loop(); evas_render(evas); } + evas_free(evas); + engine_shutdown(); evas_shutdown(); return 0; } diff --git a/src/bin/main.h b/src/bin/main.h index 69b58bb..f7d3cc3 100644 --- a/src/bin/main.h +++ b/src/bin/main.h @@ -8,17 +8,29 @@ #include #include #include +#include #include -#include #include +#if defined (HAVE_EVAS_SOFTWARE_XLIB) || defined (HAVE_EVAS_XRENDER_X11) ||defined (HAVE_EVAS_OPENGL_X11) || defined (HAVE_EVAS_SOFTWARE_16_X11) +#include +#endif + +#ifndef _MSC_VER +# include +#endif + #ifdef _WIN32 # include #endif +#ifdef HAVE_EVIL +# include +#endif + #include -#if HAVE_EVAS_SOFTWARE_X11 -#include "engine_software_x11.h" +#if HAVE_EVAS_SOFTWARE_XLIB +#include "engine_software_xlib.h" #endif #if HAVE_EVAS_XRENDER_X11 #include "engine_xrender_x11.h" @@ -29,24 +41,36 @@ #if HAVE_EVAS_SOFTWARE_XCB #include "engine_software_xcb.h" #endif +#if HAVE_EVAS_XRENDER_XCB +#include "engine_xrender_xcb.h" +#endif +#if HAVE_EVAS_SOFTWARE_GDI +#include "engine_software_gdi.h" +#endif #if HAVE_EVAS_SOFTWARE_DDRAW #include "engine_software_ddraw.h" #endif #if HAVE_EVAS_DIRECT3D #include "engine_direct3d.h" #endif -#if HAVE_EVAS_OPENGL_GLEW -#include "engine_gl_glew.h" -#endif -#if HAVE_EVAS_SOFTWARE_SDL +#if BUILD_SDL #include "engine_software_sdl.h" #endif +#if HAVE_EVAS_OPENGL_SDL +#include "engine_gl_sdl.h" +#endif #if HAVE_EVAS_FB #include "engine_fb.h" #endif #if HAVE_EVAS_DIRECTFB #include "engine_directfb.h" #endif +#if HAVE_EVAS_OPENGL_COCOA +#include "engine_gl_cocoa.h" +#endif +#if HAVE_EVAS_PSL1GHT +#include "engine_psl1ght.h" +#endif #if HAVE_EVAS_SOFTWARE_16_X11 #include "engine_software_16_x11.h" #endif @@ -57,13 +81,41 @@ #include "engine_software_16_wince.h" #endif +#ifdef __cplusplus +extern "C" +{ +#endif + #include "ui.h" #include "about.h" +#define EVAS_FRAME_QUEUING // for test + #define OBNUM 128 +#define LOOPS 128 extern Evas *evas; extern int win_w, win_h; +extern int loops; +extern int fullscreen; + +typedef struct _Expedite_Resolution Expedite_Resolution; +typedef struct _Expedite_Engine Expedite_Engine; + +struct _Expedite_Resolution +{ + const char *name; + int width; + int height; +}; + +struct _Expedite_Engine +{ + const char *name; + Eina_Bool (*init)(const char *engine, int width, int height); + void (*loop)(void); + void (*shutdown)(void); +}; void srnd(void); unsigned int rnd(void); @@ -72,6 +124,10 @@ const char *build_path(const char *filename); void engine_loop(void); int engine_abort(void); +#ifdef __cplusplus +} +#endif + #define KEY_STD \ if ((!strcmp(key, "Escape")) || (!strcmp(key, "q")) || (!strcmp(key, "Q")) || (!strcmp(key, "Return"))) \ { \ @@ -80,7 +136,7 @@ int engine_abort(void); } #define FPS_STD(x) \ - if ((f >= 32) && (!done)) \ + if ((f >= loops) && (!done)) \ { \ double fps; \ fps = (double)f / t; \ diff --git a/src/bin/poly_blend.c b/src/bin/poly_blend.c index 0e1b31a..7ec9ebf 100644 --- a/src/bin/poly_blend.c +++ b/src/bin/poly_blend.c @@ -5,7 +5,7 @@ /* metadata */ #define FNAME poly_blend_start #define NAME "Polygon Blend" -#define ICON "flower.png" +#define ICON "rect.png" #ifndef PROTO # ifndef UI @@ -103,7 +103,7 @@ static void _loop(double t, int f) x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (win_w / 4); y = (win_h / 2) - (h / 2); y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (win_h / 4); - poly(o, i, x, y); + evas_object_move(o, x, y); } FPS_STD(NAME); } diff --git a/src/bin/proxy_image.c b/src/bin/proxy_image.c new file mode 100644 index 0000000..f1debcd --- /dev/null +++ b/src/bin/proxy_image.c @@ -0,0 +1,111 @@ +#undef FNAME +#undef NAME +#undef ICON + +/* metadata */ +#define FNAME image_blend_unscaled_proxy_start +#define NAME "Image Blend Unscaled Proxy" +#define ICON "blend.png" + +#ifndef PROTO +# ifndef UI +# include "main.h" + +/* standard var */ +static int done = 0; +/* private data */ +static Evas_Object *o_images[OBNUM]; + +/* setup */ +static void _setup(void) +{ + int i; + Evas_Object *o,*src; + + o = evas_object_image_add(evas); + evas_object_image_file_set(o, build_path("logo.png"), NULL); + evas_object_image_fill_set(o, 0, 0, 120, 160); + evas_object_resize(o, 120, 160); + evas_object_show(o); + src = o; + o_images[0] = src; + + for (i = 1; i < OBNUM; i++) + { + o = evas_object_image_add(evas); + o_images[i] = o; + evas_object_image_source_set(o, src); + evas_object_resize(o, 120, 160); + evas_object_image_fill_set(o, 0,0,120,160); + evas_object_show(o); + } + done = 0; +} + +/* cleanup */ +static void _cleanup(void) +{ + int i; + for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]); +} + +/* loop - do things */ +static void _loop(double t, int f) +{ + int i; + Evas_Coord x, y, w, h; + for (i = 0; i < OBNUM; i++) + { + w = 120; + h = 160; + x = (win_w / 2) - (w / 2); + x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2); + y = (win_h / 2) - (h / 2); + y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h / 2); + evas_object_move(o_images[i], x, y); + } + FPS_STD(NAME); +} + +/* prepend special key handlers if interactive (before STD) */ +static void _key(char *key) +{ + KEY_STD; +} + + + + + + + + + + + + +/* template stuff - ignore */ +# endif +#endif + +#ifdef UI +_ui_menu_item_add(ICON, NAME, FNAME); +#endif + +#ifdef PROTO +void FNAME(void); +#endif + +#ifndef PROTO +# ifndef UI +void FNAME(void) +{ + ui_func_set(_key, _loop); + _setup(); +} +# endif +#endif +#undef FNAME +#undef NAME +#undef ICON + diff --git a/src/bin/proxy_image_offscreen.c b/src/bin/proxy_image_offscreen.c new file mode 100644 index 0000000..b147142 --- /dev/null +++ b/src/bin/proxy_image_offscreen.c @@ -0,0 +1,114 @@ +/** + * This tests that proxy works fine if the proxy (of an image) works when + * offscreen. + */ +#undef FNAME +#undef NAME +#undef ICON + +/* metadata */ +#define FNAME image_blend_unscaled_proxy_start +#define NAME "Proxy Offscreen" +#define ICON "blend.png" + +#ifndef PROTO +# ifndef UI +# include "main.h" + +/* standard var */ +static int done = 0; +/* private data */ +static Evas_Object *o_images[OBNUM]; + +/* setup */ +static void _setup(void) +{ + int i; + Evas_Object *o,*src; + + o = evas_object_image_add(evas); + evas_object_image_file_set(o, build_path("logo.png"), NULL); + evas_object_image_fill_set(o, 0, 0, 120, 160); + evas_object_resize(o, 120, 160); + evas_object_move(o, -400, -300); + src = o; + + for (i = 0; i < OBNUM / 2; i++) + { + o = evas_object_image_add(evas); + o_images[i] = o; + evas_object_image_source_set(o, src); + evas_object_resize(o, 120, 160); + evas_object_image_fill_set(o, 0,0,120,160); + evas_object_show(o); + } + done = 0; +} + +/* cleanup */ +static void _cleanup(void) +{ + int i; + for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]); +} + +/* loop - do things */ +static void _loop(double t, int f) +{ + int i; + Evas_Coord x, y, w, h; + for (i = 0; i < OBNUM; i++) + { + w = 120; + h = 160; + x = (win_w / 2) - (w / 2); + x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2); + y = (win_h / 2) - (h / 2); + y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h / 2); + evas_object_move(o_images[i], x, y); + } + FPS_STD(NAME); +} + +/* prepend special key handlers if interactive (before STD) */ +static void _key(char *key) +{ + KEY_STD; +} + + + + + + + + + + + + +/* template stuff - ignore */ +# endif +#endif + +#ifdef UI +_ui_menu_item_add(ICON, NAME, FNAME); +#endif + +#ifdef PROTO +void FNAME(void); +#endif + +#ifndef PROTO +# ifndef UI +void FNAME(void) +{ + ui_func_set(_key, _loop); + _setup(); +} +# endif +#endif +#undef FNAME +#undef NAME +#undef ICON + diff --git a/src/bin/proxy_text_fixed.c b/src/bin/proxy_text_fixed.c new file mode 100644 index 0000000..c589a57 --- /dev/null +++ b/src/bin/proxy_text_fixed.c @@ -0,0 +1,123 @@ +#undef FNAME +#undef NAME +#undef ICON + +/* metadata */ +#define FNAME proxy_text_fixed +#define NAME "Proxy Text Fixed" +#define ICON "text.png" + +#ifndef PROTO +# ifndef UI +# include "main.h" + +/* standard var */ +static int done = 0; + +/* private data */ +static Evas_Object *o_texts[OBNUM]; + +/* setup */ +static void _setup(void) +{ + int i,w,h; + Evas_Object *o,*s; + Evas_Text_Style_Type st; + + st = EVAS_TEXT_STYLE_SHADOW; + for (i = 0; st <= EVAS_TEXT_STYLE_FAR_SOFT_SHADOW; i++) + { + o = evas_object_text_add(evas); + o_texts[i] = o; + evas_object_text_font_set(o, "Vera-Bold", 20); + evas_object_text_text_set(o, "This is a test string"); + evas_object_text_style_set(o, st); + evas_object_color_set(o, 255, 255, 255, 255); + evas_object_text_shadow_color_set(o, 0, 0, 0, 24); + evas_object_text_glow_color_set(o, 100, 80, 40, 100); + evas_object_text_glow2_color_set(o, 50, 10, 5, 50); + evas_object_text_outline_color_set(o, 0, 0, 0, 255); + evas_object_show(o); + st++; + } + + for ( ; i < OBNUM ; i ++) + { + s = o_texts[i % st]; + o = evas_object_image_add(evas); + o_texts[i] = o; + evas_object_image_source_set(o, s); + evas_object_geometry_get(s, NULL, NULL, &w, &h); + evas_object_resize(o, w, h); + evas_object_image_fill_set(o, 0, 0, w, h); + evas_object_show(o); + } + + done = 0; +} + +/* cleanup */ +static void _cleanup(void) +{ + int i; + for (i = 0; i < OBNUM; i++) evas_object_del(o_texts[i]); +} + +/* loop - do things */ +static void _loop(double t, int f) +{ + int i; + Evas_Coord x, y, w, h; + for (i = 0; i < OBNUM; i++) + { + evas_object_geometry_get(o_texts[i], NULL, NULL, &w, &h); + x = (win_w / 2) - (w / 2); + x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2); + y = (win_h / 2) - (h / 2); + y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (w / 2); + evas_object_move(o_texts[i], x, y); + } + FPS_STD(NAME); +} + +/* prepend special key handlers if interactive (before STD) */ +static void _key(char *key) +{ + KEY_STD; +} + + + + + + + + + + + + +/* template stuff - ignore */ +# endif +#endif + +#ifdef UI +_ui_menu_item_add(ICON, NAME, FNAME); +#endif + +#ifdef PROTO +void FNAME(void); +#endif + +#ifndef PROTO +# ifndef UI +void FNAME(void) +{ + ui_func_set(_key, _loop); + _setup(); +} +# endif +#endif +#undef FNAME +#undef NAME +#undef ICON diff --git a/src/bin/proxy_text_random.c b/src/bin/proxy_text_random.c new file mode 100644 index 0000000..32fbfba --- /dev/null +++ b/src/bin/proxy_text_random.c @@ -0,0 +1,143 @@ +#undef FNAME +#undef NAME +#undef ICON + +/* metadata */ +#define FNAME proxy_text_random +#define NAME "Proxy Text Random" +#define ICON "text.png" + +#ifndef PROTO +# ifndef UI +# include "main.h" + +/* standard var */ +static int done = 0; + +/* private data */ +static Evas_Object *o_texts[OBNUM]; + +/* setup */ +static void _setup(void) +{ + int i = 0; + Evas_Object *o; + Evas_Coord x, y, w, h; + char buf[1024]; + const char *strs[] = { + "Big", "Smelly", "Fish", "Pants", "Octopus", "Garden", "There", "I", + "Am", "You", "Are", "Erogenous", "We", "Stick", "Wet", "Fishy", + "Fiddly", "Family", "Lair", "Monkeys", "Magazine" + }; + srnd(); + o = evas_object_text_add(evas); + o_texts[0] = o; + evas_object_text_font_set(o, "Vera-Bold", 20); + snprintf(buf, sizeof(buf), "%s %s %s %s.", + strs[rnd() % (sizeof(strs) / sizeof(char *))], + strs[rnd() % (sizeof(strs) / sizeof(char *))], + strs[rnd() % (sizeof(strs) / sizeof(char *))], + strs[rnd() % (sizeof(strs) / sizeof(char *))]); + evas_object_text_text_set(o, buf); + evas_object_color_set(o, 0, 0, 0, 255); + evas_object_geometry_get(o, NULL, NULL, &w, &h); + x = (win_w / 2) - (w / 2); + x += sin((double)((i * 13)) / (36.7 * SLOW)) * (w / 2); + y = (win_h / 2) - (h / 2); + y += cos((double)((i * 28)) / (43.8 * SLOW)) * (w / 2); + evas_object_move(o, x, y); + evas_object_show(o); + for (i = 1 ; i < OBNUM ; i ++) + { + o = evas_object_image_add(evas); + o_texts[i] = o; + evas_object_image_source_set(o, o_texts[0]); + evas_object_geometry_get(o_texts[0], NULL, NULL, &w, &h); + evas_object_resize(o, w, h); + evas_object_image_fill_set(o, 0, 0, w, h); + x = (win_w / 2) - (w / 2); + x += sin((double)((i * 13)) / (36.7 * SLOW)) * (w / 2); + y = (win_h / 2) - (h / 2); + y += cos((double)((i * 28)) / (43.8 * SLOW)) * (w / 2); + evas_object_move(o, x, y); + + evas_object_show(o); + } + + + done = 0; +} + +/* cleanup */ +static void _cleanup(void) +{ + int i; + for (i = 0; i < OBNUM; i++) evas_object_del(o_texts[i]); +} + +/* loop - do things */ +static void _loop(double t, int f) +{ + int i,w,h; + char buf[1024]; + const char *strs[] = { + "Big", "Smelly", "Fish", "Pants", "Octopus", "Garden", "There", "I", + "Am", "You", "Are", "Erogenous", "We", "Stick", "Wet", "Fishy", + "Fiddly", "Family", "Lair", "Monkeys", "Magazine" + }; + snprintf(buf, sizeof(buf), "%s %s %s %s.", + strs[rnd() % (sizeof(strs) / sizeof(char *))], + strs[rnd() % (sizeof(strs) / sizeof(char *))], + strs[rnd() % (sizeof(strs) / sizeof(char *))], + strs[rnd() % (sizeof(strs) / sizeof(char *))]); + evas_object_text_text_set(o_texts[0], buf); + evas_object_geometry_get(o_texts[0], NULL, NULL, &w, &h); + for (i = 1; i < OBNUM; i++) + { + evas_object_resize(o_texts[i],w,h); + evas_object_image_fill_set(o_texts[i],0,0,w,h); + } + FPS_STD(NAME); +} + +/* prepend special key handlers if interactive (before STD) */ +static void _key(char *key) +{ + KEY_STD; +} + + + + + + + + + + + + +/* template stuff - ignore */ +# endif +#endif + +#ifdef UI +_ui_menu_item_add(ICON, NAME, FNAME); +#endif + +#ifdef PROTO +void FNAME(void); +#endif + +#ifndef PROTO +# ifndef UI +void FNAME(void) +{ + ui_func_set(_key, _loop); + _setup(); +} +# endif +#endif +#undef FNAME +#undef NAME +#undef ICON diff --git a/src/bin/rect_blend.c b/src/bin/rect_blend.c index 8149500..fb5cb8e 100644 --- a/src/bin/rect_blend.c +++ b/src/bin/rect_blend.c @@ -5,7 +5,7 @@ /* metadata */ #define FNAME rect_blend_start #define NAME "Rect Blend" -#define ICON "flower.png" +#define ICON "rect.png" #ifndef PROTO # ifndef UI diff --git a/src/bin/rect_blend_few.c b/src/bin/rect_blend_few.c index 52a9056..15bab8a 100644 --- a/src/bin/rect_blend_few.c +++ b/src/bin/rect_blend_few.c @@ -5,7 +5,7 @@ /* metadata */ #define FNAME rect_blend_few_start #define NAME "Rect Blend Few" -#define ICON "flower.png" +#define ICON "rect.png" #ifndef PROTO # ifndef UI diff --git a/src/bin/rect_blend_pow2.c b/src/bin/rect_blend_pow2.c new file mode 100644 index 0000000..381170d --- /dev/null +++ b/src/bin/rect_blend_pow2.c @@ -0,0 +1,110 @@ +#undef FNAME +#undef NAME +#undef ICON + +/* metadata */ +#define FNAME rect_blend_pow2_start +#define NAME "Rect Blend Power 2" +#define ICON "rect.png" + +#ifndef PROTO +# ifndef UI +# include "main.h" + +/* standard var */ +static int done = 0; +/* private data */ +static Evas_Object *o_images[OBNUM]; + +/* setup */ +static void _setup(void) +{ + int i; + Evas_Object *o; + srnd(); + for (i = 0; i < OBNUM; i++) + { + int r, g, b, a; + + o = evas_object_rectangle_add(evas); + o_images[i] = o; + a = 256 - (1 << ((rnd() % 8) + 1)); + if (a < 128) a = 128; + r = ((rnd()&0xff) * a) / 255; + g = ((rnd()&0xff) * a) / 255; + b = ((rnd()&0xff) * a) / 255; + evas_object_color_set(o, r, g, b, a); + evas_object_show(o); + } + done = 0; +} + +/* cleanup */ +static void _cleanup(void) +{ + int i; + for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]); +} + +/* loop - do things */ +static void _loop(double t, int f) +{ + int i; + Evas_Coord x, y, w, h, w0, h0; + for (i = 0; i < OBNUM; i++) + { + w0 = 80; + h0 = 80; + w = 5 + ((1.0 + cos((double)(f + (i * 10)) / (7.4 * SLOW) )) * w0 * 2); + h = 5 + ((1.0 + sin((double)(f + (i * 19)) / (12.6 * SLOW) )) * h0 * 2); + x = (win_w / 2) - (w / 2); + x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w0 / 2); + y = (win_h / 2) - (h / 2); + y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h0 / 2); + evas_object_move(o_images[i], x, y); + evas_object_resize(o_images[i], w, h); + } + FPS_STD(NAME); +} + +/* prepend special key handlers if interactive (before STD) */ +static void _key(char *key) +{ + KEY_STD; +} + + + + + + + + + + + + +/* template stuff - ignore */ +# endif +#endif + +#ifdef UI +_ui_menu_item_add(ICON, NAME, FNAME); +#endif + +#ifdef PROTO +void FNAME(void); +#endif + +#ifndef PROTO +# ifndef UI +void FNAME(void) +{ + ui_func_set(_key, _loop); + _setup(); +} +# endif +#endif +#undef FNAME +#undef NAME +#undef ICON diff --git a/src/bin/rect_blend_pow2_few.c b/src/bin/rect_blend_pow2_few.c new file mode 100644 index 0000000..7c1f409 --- /dev/null +++ b/src/bin/rect_blend_pow2_few.c @@ -0,0 +1,113 @@ +#undef FNAME +#undef NAME +#undef ICON + +/* metadata */ +#define FNAME rect_blend_pow2_few_start +#define NAME "Rect Blend Power 2 Few" +#define ICON "rect.png" + +#ifndef PROTO +# ifndef UI +# include "main.h" + +#undef OBNUM +#define OBNUM 3 + +/* standard var */ +static int done = 0; +/* private data */ +static Evas_Object *o_images[OBNUM]; + +/* setup */ +static void _setup(void) +{ + int i; + Evas_Object *o; + srnd(); + for (i = 0; i < OBNUM; i++) + { + int r, g, b, a; + + o = evas_object_rectangle_add(evas); + o_images[i] = o; + a = 256 - (1 << ((rnd() % 8) + 1)); + if (a < 128) a = 128; + r = ((rnd()&0xff) * a) / 255; + g = ((rnd()&0xff) * a) / 255; + b = ((rnd()&0xff) * a) / 255; + evas_object_color_set(o, r, g, b, a); + evas_object_show(o); + } + done = 0; +} + +/* cleanup */ +static void _cleanup(void) +{ + int i; + for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]); +} + +/* loop - do things */ +static void _loop(double t, int f) +{ + int i; + Evas_Coord x, y, w, h, w0, h0; + for (i = 0; i < OBNUM; i++) + { + w0 = 80; + h0 = 80; + w = 5 + ((1.0 + cos((double)(f + (i * 10)) / (7.4 * SLOW) )) * w0 * 2); + h = 5 + ((1.0 + sin((double)(f + (i * 19)) / (12.6 * SLOW) )) * h0 * 2); + x = (win_w / 2) - (w / 2); + x += sin((double)(f + (i * 113)) / (36.7 * SLOW)) * (w0 / 2); + y = (win_h / 2) - (h / 2); + y += cos((double)(f + (i * 228)) / (43.8 * SLOW)) * (h0 / 2); + evas_object_move(o_images[i], x, y); + evas_object_resize(o_images[i], w, h); + } + FPS_STD(NAME); +} + +/* prepend special key handlers if interactive (before STD) */ +static void _key(char *key) +{ + KEY_STD; +} + + + + + + + + + + + + +/* template stuff - ignore */ +# endif +#endif + +#ifdef UI +_ui_menu_item_add(ICON, NAME, FNAME); +#endif + +#ifdef PROTO +void FNAME(void); +#endif + +#ifndef PROTO +# ifndef UI +void FNAME(void) +{ + ui_func_set(_key, _loop); + _setup(); +} +# endif +#endif +#undef FNAME +#undef NAME +#undef ICON diff --git a/src/bin/rect_solid.c b/src/bin/rect_solid.c index 8496ff7..c51df40 100644 --- a/src/bin/rect_solid.c +++ b/src/bin/rect_solid.c @@ -5,7 +5,7 @@ /* metadata */ #define FNAME rect_solid_start #define NAME "Rect Solid" -#define ICON "flower.png" +#define ICON "rect.png" #ifndef PROTO # ifndef UI diff --git a/src/bin/rect_solid_few.c b/src/bin/rect_solid_few.c index 87ed9f6..1976d3d 100644 --- a/src/bin/rect_solid_few.c +++ b/src/bin/rect_solid_few.c @@ -5,7 +5,7 @@ /* metadata */ #define FNAME rect_solid_few_start #define NAME "Rect Solid Few" -#define ICON "flower.png" +#define ICON "rect.png" #ifndef PROTO # ifndef UI diff --git a/src/bin/tests.h b/src/bin/tests.h index bb0999d..8607950 100644 --- a/src/bin/tests.h +++ b/src/bin/tests.h @@ -1,17 +1,63 @@ +#include "widgets_file_icons.c" +#include "widgets_file_icons_2.c" +#include "widgets_file_icons_2_grouped.c" +#include "widgets_file_icons_2_same.c" +#include "widgets_file_icons_2_same_grouped.c" +#include "widgets_file_icons_3.c" +#include "widgets_file_icons_4.c" +#include "widgets_list_1.c" +#include "widgets_list_1_grouped.c" +#include "widgets_list_2.c" +#include "widgets_list_2_grouped.c" +#include "widgets_list_3.c" +#include "widgets_list_3_grouped.c" +#include "widgets_list_4.c" +#include "widgets_list_4_grouped.c" #include "image_blend_unscaled.c" +#include "image_blend_solid_middle_unscaled.c" +#include "image_blend_fade_unscaled.c" +#include "image_blend_fade_pow2_unscaled.c" #include "image_blend_solid_unscaled.c" +#include "image_blend_solid_fade_unscaled.c" +#include "image_blend_solid_fade_pow2_unscaled.c" #include "image_blend_nearest_scaled.c" #include "image_blend_nearest_solid_scaled.c" #include "image_blend_smooth_scaled.c" #include "image_blend_smooth_solid_scaled.c" +#include "image_blend_nearest_same_scaled.c" +#include "image_blend_nearest_solid_same_scaled.c" +#include "image_blend_smooth_same_scaled.c" +#include "image_blend_smooth_solid_same_scaled.c" #include "image_blend_border.c" +#include "image_blend_solid_middle_border.c" #include "image_blend_solid_border.c" #include "image_blend_border_recolor.c" +#include "image_map_rotate.c" +#include "image_map_solid_rotate.c" +#include "image_map_nearest_rotate.c" +#include "image_map_nearest_solid_rotate.c" +#include "image_map_color_rotate.c" +#include "image_map_color_solid_rotate.c" +#include "image_map_color_nearest_rotate.c" +#include "image_map_color_nearest_solid_rotate.c" +#include "image_map_color_alpha_rotate.c" +#include "image_map_color_alpha_solid_rotate.c" +#include "image_map_color_alpha_nearest_rotate.c" +#include "image_map_color_alpha_nearest_solid_rotate.c" +#include "image_map_3d_1.c" +#include "image_map_3d_2.c" +#include "image_map_3d_3.c" +#include "image_map_3d_4.c" +#include "image_map_3d_5.c" +#include "image_map_3d_6.c" +#include "image_map_3d_flow.c" #include "image_quality_scale.c" #include "image_data_argb.c" #include "image_data_argb_alpha.c" #include "image_data_ycbcr601pl.c" #include "image_data_ycbcr601pl_wide_stride.c" +#include "image_data_ycbcr601pl_map_solid_rotate.c" +#include "image_data_ycbcr601pl_map_nearest_solid_rotate.c" #include "image_crossfade.c" #include "text_basic.c" #include "text_styles.c" @@ -19,9 +65,13 @@ #include "text_change.c" #include "textblock_basic.c" #include "textblock_intl.c" +#include "textblock_auto_align.c" +#include "textblock_text_append.c" #include "rect_blend.c" +#include "rect_blend_pow2.c" #include "rect_solid.c" #include "rect_blend_few.c" +#include "rect_blend_pow2_few.c" #include "rect_solid_few.c" #include "image_blend_occlude1_few.c" #include "image_blend_occlude2_few.c" @@ -36,3 +86,35 @@ #include "image_blend_occlude2_very_many.c" #include "image_blend_occlude3_very_many.c" #include "poly_blend.c" +#include "proxy_image.c" +#include "proxy_text_fixed.c" +#include "proxy_text_random.c" +#if 0 // test disabled - evas having code disabled +#include "image_mask.c" +#include "image_mask_2.c" +#include "image_mask_3.c" +#include "image_mask_4.c" +#include "image_mask_5.c" +#include "image_mask_6.c" +#include "image_mask_7.c" +#include "image_mask_8.c" +#include "image_mask_9.c" +#include "image_mask_10.c" +#include "image_mask_11.c" +#include "image_mask_12.c" +#include "image_mask_13.c" +#include "image_mask_14.c" +#include "image_mask_15.c" +#include "filter_object_colors.c" +#include "filter_object_colors_solid.c" +#include "filter_object_invert.c" +#include "filter_object_invert_solid.c" +#include "filter_object_greyscale.c" +#include "filter_object_greyscale_solid.c" +#include "filter_object_brightness.c" +#include "filter_object_brightness_solid.c" +#include "filter_object_sepia.c" +#include "filter_object_sepia_solid.c" +#include "filter_object_blur.c" +#include "filter_object_blur_solid.c" +#endif diff --git a/src/bin/text_basic.c b/src/bin/text_basic.c index fdff93d..80c5353 100644 --- a/src/bin/text_basic.c +++ b/src/bin/text_basic.c @@ -5,7 +5,7 @@ /* metadata */ #define FNAME text_basic_start #define NAME "Text Basic" -#define ICON "mushroom.png" +#define ICON "text.png" #ifndef PROTO # ifndef UI diff --git a/src/bin/text_change.c b/src/bin/text_change.c index da5c5b5..d7d79f2 100644 --- a/src/bin/text_change.c +++ b/src/bin/text_change.c @@ -5,7 +5,7 @@ /* metadata */ #define FNAME text_change_start #define NAME "Text Change" -#define ICON "mushroom.png" +#define ICON "text.png" #ifndef PROTO # ifndef UI diff --git a/src/bin/text_styles.c b/src/bin/text_styles.c index 436624e..82e9943 100644 --- a/src/bin/text_styles.c +++ b/src/bin/text_styles.c @@ -5,7 +5,7 @@ /* metadata */ #define FNAME text_styles_start #define NAME "Text Styles" -#define ICON "mushroom.png" +#define ICON "text.png" #ifndef PROTO # ifndef UI diff --git a/src/bin/text_styles_different_strings.c b/src/bin/text_styles_different_strings.c index 73af6ea..8a87333 100644 --- a/src/bin/text_styles_different_strings.c +++ b/src/bin/text_styles_different_strings.c @@ -5,7 +5,7 @@ /* metadata */ #define FNAME text_styles_different_strings_start #define NAME "Text Styles Different Strings" -#define ICON "mushroom.png" +#define ICON "text.png" #ifndef PROTO # ifndef UI diff --git a/src/bin/textblock_auto_align.c b/src/bin/textblock_auto_align.c new file mode 100644 index 0000000..d49d716 --- /dev/null +++ b/src/bin/textblock_auto_align.c @@ -0,0 +1,127 @@ +#undef FNAME +#undef NAME +#undef ICON + +/* metadata */ +#define FNAME textblock_auto_align_start +#define NAME "Textblock auto align" +#define ICON "text.png" + +#ifndef PROTO +# ifndef UI +# include "main.h" + +/* standard var */ +static int done = 0; + +/* private data */ +static Evas_Object *o_text; + +/* setup */ +static void _setup(void) +{ + Evas_Object *o; + Evas_Textblock_Style *st; + + o = evas_object_textblock_add(evas); + o_text = o; + st = evas_textblock_style_new(); + evas_textblock_style_set + (st, + "DEFAULT='font=Sans font_size=10 color=#000000 wrap=word'" + ); + evas_object_textblock_style_set(o, st); + evas_textblock_style_free(st); + evas_object_textblock_clear(o); + + evas_object_textblock_text_markup_set + (o, + "This is a test of auto alignment in Evas" + "
" + "This text should be left aligned" + "\xE2\x80\x8FThis text should be right aligned" + "\xE2\x80\x8FThis text should be right aligned
" + "Same as this text." + "This text should be left aligned
" + "\xE2\x80\x8FSame as this text." + "

" + "The word 'זה' should be the rightmost, 'טקסט' after, and 'בעברית' last
" + "in the following text:" + "זה טקסט בעברית" + "
" + "In the next text, the paragraph should be right aligned and the
" + "words should appear in the following order: 'דוגמה' first, 'of' second,
" + "‎'טקסט' third, 'english' fourth and 'in' fifth, counting from right to left" + "דוגמה of טקסט in english." + ); + + evas_object_show(o); + + done = 0; +} + +/* cleanup */ +static void _cleanup(void) +{ + evas_object_del(o_text); +} + +/* loop - do things */ +static void _loop(double t, int f) +{ + Evas_Coord x, y, w, h, w0, h0; + int i = 0; + + evas_object_textblock_size_native_get(o_text, &w0, &h0); + w = w0; + h = h0; + w += fabs(sin((double)(f + (i * 13)) / (31.1 * SLOW))) * (w0); + x = (win_w / 2) - (w / 2); + y = (win_h / 2) - (h0 / 2); + evas_object_move(o_text, x, y); + evas_object_resize(o_text, w, h); + + FPS_STD(NAME); +} + +/* prepend special key handlers if interactive (before STD) */ +static void _key(char *key) +{ + KEY_STD; +} + + + + + + + + + + + + +/* template stuff - ignore */ +# endif +#endif + +#ifdef UI +_ui_menu_item_add(ICON, NAME, FNAME); +#endif + +#ifdef PROTO +void FNAME(void); +#endif + +#ifndef PROTO +# ifndef UI +void FNAME(void) +{ + ui_func_set(_key, _loop); + _setup(); +} +# endif +#endif +#undef FNAME +#undef NAME +#undef ICON diff --git a/src/bin/textblock_basic.c b/src/bin/textblock_basic.c index f56db01..8e31749 100644 --- a/src/bin/textblock_basic.c +++ b/src/bin/textblock_basic.c @@ -5,7 +5,7 @@ /* metadata */ #define FNAME textblock_basic_start #define NAME "Textblock Basic" -#define ICON "mushroom.png" +#define ICON "text.png" #ifndef PROTO # ifndef UI @@ -38,8 +38,6 @@ static void _setup(void) "red='+ color=#ff0000'" "p='+ font=Vera,Kochi font_size=10 align=left'" "/p='- \n'" - "br='\n'" - "tab='\t'" ); evas_object_textblock_style_set(o, st); evas_textblock_style_free(st); @@ -47,10 +45,10 @@ static void _setup(void) evas_object_textblock_text_markup_set (o, - "

Title


" + "

Title


" "

A pragraph here red text and stuff.

" "

And escaping < and > as well as & as

normal.

" - "

If you want a newline use <br>
woo a new line!

" + "

If you want a newline use <br>
woo a new line!

" "Right " "aligned " "text " @@ -69,6 +67,12 @@ static void _setup(void) "LO" "R Bla Rai" " Stuff.

" + "20 Linesize
" + "40 Linesize
" + "100 percent Linerelsize
" + "150 percent Linerelsize
" + "200 percent Linerelsize
" + "" "
" "(日本語 カタカナ ひらがな) " "Round about the cauldron go; " @@ -83,7 +87,7 @@ static void _setup(void) "In the cauldron boil and bake; " "Eye of newt and toe of frog, " "Wool of bat and tongue of dog, " - "Adder's fork and blind-worm's sting, " + "Adder's fork and blind-worm's sting, " "Lizard's leg and owlet's wing, " "For a charm of powerful trouble, " "Like a hell-broth boil and bubble. " diff --git a/src/bin/textblock_intl.c b/src/bin/textblock_intl.c index 988e09a..a0309cf 100644 --- a/src/bin/textblock_intl.c +++ b/src/bin/textblock_intl.c @@ -5,7 +5,7 @@ /* metadata */ #define FNAME textblock_intl_start #define NAME "Textblock Intl" -#define ICON "mushroom.png" +#define ICON "text.png" #ifndef PROTO # ifndef UI @@ -29,7 +29,6 @@ static void _setup(void) evas_textblock_style_set (st, "DEFAULT='font=Sans font_size=10 align=left color=#000000 wrap=word'" - "br='\n'" ); evas_object_textblock_style_set(o, st); evas_textblock_style_free(st); @@ -37,54 +36,54 @@ static void _setup(void) evas_object_textblock_text_markup_set (o, - "This is a test of International test rendering in Evas
" - "
" - "Danish: 'Quizdeltagerne spiste jordbær med fløde, mens cirkusklovnen'
" - "German: 'Heizölrückstoßabdämpfung'
" - "Spanish: 'El pingüino Wenceslao hizo kilómetros bajo exhaustiva lluvia y'
" - "French: 'Le cœur déçu mais l'âme plutôt naïve, Louÿs rêva de crapaüter en'
" - "Irish Gaelic: 'D'fhuascail Íosa, Úrmhac na hÓighe Beannaithe, pór Éava agus Ádhaimh'
" - "Hungarian: 'Árvíztűrő tükörfúrógép'
" - "Icelandic: 'Kæmi ný öxi hér ykist þjófum nú bæði víl og ádrepa'
" - "Japanese (hiragana): 'いろはにほへとちりぬるを'
" - "Japanese (katakana): 'イロハニホヘト チリヌルヲ ワカヨタレソ ツネナラム'
" - "Hebrew: '? דג סקרן שט בים מאוכזב ולפתע מצא לו חברה איך הקליטה'
" - "Polish: 'Pchnąć w tę łódź jeża lub ośm skrzyń fig'
" - "Russian: 'В чащах юга жил бы цитрус? Да, но фальшивый экземпляр!'
" - "IPA: 'ˈjunɪˌkoːd'
" - "American Dictionary: 'Ūnĭcōde̽'
" - "Anglo-saxon: 'ᛡᚢᚾᛁᚳᚩᛞ'
" - "Arabic: 'يونِكود'
" - "Armenian: 'Յունիկօդ'
" - "Bengali: 'য়ূনিকোড'
" - "Bopomofo: 'ㄊㄨㄥ˅ ㄧˋ ㄇㄚ˅'
" - "Canadian Syllabics: 'ᔫᗂᑰᑦ'
" - "Cherokee: 'ᏳᏂᎪᏛ'
" - "Chinese: '萬國碼'
" - "Ethiopic: 'ዩኒኮድ'
" - "Georgian: 'უნიკოდი'
" - "Greek: 'Γιούνικοντ'
" + "This is a test of International test rendering in Evas
" + "
" + "Danish: 'Quizdeltagerne spiste jordbær med fløde, mens cirkusklovnen'
" + "German: 'Heizölrückstoßabdämpfung'
" + "Spanish: 'El pingüino Wenceslao hizo kilómetros bajo exhaustiva lluvia y'
" + "French: 'Le cœur déçu mais l'âme plutôt naïve, Louÿs rêva de crapaüter en'
" + "Irish Gaelic: 'D'fhuascail Íosa, Úrmhac na hÓighe Beannaithe, pór Éava agus Ádhaimh'
" + "Hungarian: 'Árvíztűrő tükörfúrógép'
" + "Icelandic: 'Kæmi ný öxi hér ykist þjófum nú bæði víl og ádrepa'
" + "Japanese (hiragana): 'いろはにほへとちりぬるを'
" + "Japanese (katakana): 'イロハニホヘト チリヌルヲ ワカヨタレソ ツネナラム'
" + "Hebrew: 'דג סקרן שט בים מאוכזב ולפתע מצא לו חברה איך הקליטה?‏'
" + "Polish: 'Pchnąć w tę łódź jeża lub ośm skrzyń fig'
" + "Russian: 'В чащах юга жил бы цитрус? Да, но фальшивый экземпляр!'
" + "IPA: 'ˈjunɪˌkoːd'
" + "American Dictionary: 'Ūnĭcōde̽'
" + "Anglo-saxon: 'ᛡᚢᚾᛁᚳᚩᛞ'
" + "Arabic: 'يونِكود'
" + "Armenian: 'Յունիկօդ'
" + "Bengali: 'য়ূনিকোড'
" + "Bopomofo: 'ㄊㄨㄥ˅ ㄧˋ ㄇㄚ˅'
" + "Canadian Syllabics: 'ᔫᗂᑰᑦ'
" + "Cherokee: 'ᏳᏂᎪᏛ'
" + "Chinese: '萬國碼'
" + "Ethiopic: 'ዩኒኮድ'
" + "Georgian: 'უნიკოდი'
" + "Greek: 'Γιούνικοντ'
" /* also test the html entity stuff a bit */ - "Greek continued: 'τυλθ'
" - - "Gujarati: 'યૂનિકોડ'
" - "Gurmukhi: 'ਯੂਨਿਕੋਡ'
" - "Hindi: 'यूनिकोड'
" - "Kannada: 'ಯೂನಿಕೋಡ್'
" - "Khmer: 'យូនីគោដ'
" - "Korean: '유니코드'
" - "Malayalam: 'യൂനികോഡ്'
" - "Ogham: 'ᚔᚒᚅᚔᚉᚑᚇ'
" - "Oriya: 'ୟୂନିକୋଡ'
" - "Persian: 'یونی‌کُد'
" - "Sinhala: 'යණනිකෞද්'
" - "Syriac: 'ܝܘܢܝܩܘܕ'
" - "Tamil:'யூனிகோட்'
" - "Telugu: 'యూనికోడ్'
" - "Thai: 'ยูนืโคด'
" - "Tibetan: 'ཨུ་ནི་ཀོཌྲ།'
" - "Yiddish: 'יוניקאָד'
" + "Greek continued: 'τυλθ'
" + + "Gujarati: 'યૂનિકોડ'
" + "Gurmukhi: 'ਯੂਨਿਕੋਡ'
" + "Hindi: 'यूनिकोड'
" + "Kannada: 'ಯೂನಿಕೋಡ್'
" + "Khmer: 'យូនីគោដ'
" + "Korean: '유니코드'
" + "Malayalam: 'യൂനികോഡ്'
" + "Ogham: 'ᚔᚒᚅᚔᚉᚑᚇ'
" + "Oriya: 'ୟୂନିକୋଡ'
" + "Persian: 'یونی‌کُد'
" + "Sinhala: 'යණනිකෞද්'
" + "Syriac: 'ܝܘܢܝܩܘܕ'
" + "Tamil:'யூனிகோட்'
" + "Telugu: 'యూనికోడ్'
" + "Thai: 'ยูนืโคด'
" + "Tibetan: 'ཨུ་ནི་ཀོཌྲ།'
" + "Yiddish: 'יוניקאָד'
" ); evas_object_show(o); diff --git a/src/bin/textblock_text_append.c b/src/bin/textblock_text_append.c new file mode 100644 index 0000000..10ca9fa --- /dev/null +++ b/src/bin/textblock_text_append.c @@ -0,0 +1,176 @@ +#undef FNAME +#undef NAME +#undef ICON + +/* metadata */ +#define FNAME textblock_text_append_start +#define NAME "Textblock text_append" +#define ICON "text.png" + +#ifndef PROTO +# ifndef UI +# include "main.h" + +/* standard var */ +static int done = 0; + +/* private data */ +static Evas_Object *o_text; + +/* setup */ +static void _setup(void) +{ + Evas_Object *o; + Evas_Textblock_Style *st; + + o = evas_object_textblock_add(evas); + o_text = o; + st = evas_textblock_style_new(); + evas_textblock_style_set + (st, + "DEFAULT='font=Sans font_size=10 color=#000000 wrap=word'" + ); + evas_object_textblock_style_set(o, st); + evas_textblock_style_free(st); + evas_object_textblock_clear(o); + + evas_object_textblock_text_markup_set + (o, + "This test just appends and removes text from different paragraphs, it's " + "not a very visual test, it's included for benchmarking purposes." +"" +"Enlightenment is the flagship and original name bearer for this project. Once it was just a humble window manager for X11 that wanted to do things differently. To do them better, but it has expanded. This can be confusing so when we refer to Enlightenment, we may mean the project as a whole or just the window manager proper. The libraries behind Enlightenment are referred to as EFL collectively, each with a specific name and purpose." +"" +"The window manager is a lean, fast, modular and very extensible window manager for X11 and Linux. It is classed as a \"desktop shell\" providing the things you need to operate your desktop (or laptop), but is not a whole application suite. This covered launching applications, managing their windows and doing other system tasks like suspending, reboots, managing files etc.
" +"Platform Support
" +"Linux BSD Windows Apple" +"" +"Enlightenment and EFL support several platforms, though Linux is the primary platform of choice for our developers, some make efforts to make things work on FreeBSD and other BSD's, Solaris, MacOS X, Windows (XP, Vista, 7 etc.), Windows CE and more. Compatibility will vary, but most of core EFL support all Linuxes, BSD's, Solaris and other UNIX-like OS's. Mac support should work mostly thanks to the X11 support in OS X, and Windows support exists for most of the core libraries (XP, Vista, 7, CE)." +"" +"Please contact us for more information if you have problems with support in your platform. Just remember we have limited resources and most of them focus on the core open-source targets.
" +"Proven effectiveness" +"" +"Enlightenment libraries already power millions of systems, from mobile phones to set top boxes, desktops, laptops, game systems and more. It is only now being recognized for its forward-thinking approaches, as products and designers want to do more than the boring functional user experiences of the past. This is where EFL excels." +"" +"Free.fr is shipping millions of set top boxes in France, powered by EFL. The Openmoko Freerunner sold thousands of devices with EFL on them. Yellow Dog Linux for the Sony PS3 ships with Enlightenment as the default. EFL has been used on printers, netbooks and more." +"" +"Building Blocks" +"" +"Enlightenment, the window manager is built on top of building blocks known as EFL (the Enlightenment Foundation Libraries). There are more than can be sensibly put into the simple block diagram above, but this covers the essentials.
" +"Simple E stack" +"" +"Pretty much any application written using Core EFL libraries will use one or more of these depending on its needs. It may only need the lower level ones or use all of them to the top of the stack. Each library fulfills a purpose, so it may be skipped if not needed.
" +"CoreCore EFL components are: * Evas
" +" * Eina
" +" * Edje
" +" * Eet
" +" * Ecore
" +" * Efreet
" +" * E_Dbus
" +" * Embryo
" +" * Eeze
" +" * Elementary (window manager will use this in 0.18)Binding support exists for several languages such as: * Python
" +" * Javascript
" +" * Perl
" +" * C++
" +" * RubyThere are other libraries and applications which build on core EFL and function on other systems too, providing more functionality, examples, and utility: * Emotion
" +" * Ethumb
" +" * Exquisite
" +" * Eve
" +" * Edje Editor
" +" * E UPnP
" +" * Enesim
" +" * Expedite
" +" * Epdf
" +" * Exchange
" +" * Eweather
" +" * Rage
" +" * Evil
" +" * Exalt
" +"Devices
" +"LaptopEnlightenment and EFL use desktop Linux systems as a primary method of development because it is fast and simple to do so, but all of it is written with the express goal in mind of also working on devices from Mobile Phones, to Televisions, Netbooks and more.
" +"PhoneWe have run and tested on x86-32, x86-64, Atom, Power-PC, ARM (ARM9, ARM11, Cortex-A8 and more), MIPS, Sparc, and many other architectures. The suggested minimum RAM required for a full Linux system + EFL application is 16MB, but you may be able to get by on 8MB. For full functionality 64MB or more is suggested. As little as a 200Mhz ARM core will provide sufficient processing power (depending on needs).
" +"Various ProcessorsScreens from even less than QVGA (320x240 or 240x320) screens all the way up to and beyond full-HD (1920x1080) are covered by EFL. It has the ability to scale user interfaces to almost any sane resolution, as well as adapt to differing input device resolutions, from mouse and stylus to fat fingers. It can draw displays from e-paper through 8-bit paletted displays, 16bit beautifully dithered ones all the way to full 24/32bit OLED beauties.
" +"Graphics" +"" +"Enlightenment is built by designers and programmers who want others to be able to do more with less. Some of Enlightenment's libraries do not do anything with graphics at all, but it is the ones that do that are the shining stars of the Enlightenment world.Evas is the canvas layer. It is not a drawing library. It is not like OpenGL, Cairo, XRender, GDI, DirectFB etc. It is a scene graph library that retains state of all objects in it. They are created then manipulated until they are no longer needed, at which point they are deleted. This allows the programmer to work in terms that a designer thinks of. It is direct mapping, as opposed to having to convert the concepts into drawing commands in the right order, calculate minimum drawing calls needed to get the job done etc.Evas also handles abstracting the rendering mechanism. With zero changes the same application can move from software to OpenGL rendering, as they all use an abstracted scene graph to describe the world (canvas) to Evas. Evas supports multiple targets, but the most useful are the high-speed software rendering engines and OpenGL (as well as OpenGL-ES 2.0).Evas not only does quality rendering and compositing, but also can scale, rotate and fully 3D transform objects, allowing for sought-after 3D effects in your interfaces. It supplies these abilities in both software and OpenGL rendering, so you are never caught with unexpected loss of features. The software rendering is even fast enough to provide the 3D without any acceleration on devices for simple uses.Edje is a meta-object design library that is somewhere between Flash, PSD, SVG and HTML+CSS. It separates design out from code and into a dynamically loaded data file. This file is compressed and loaded very quickly, along with being cached and shared betweeen instances.This allows design to be provided at runtime by different design (EDJ) files, leaving the programmer to worry about overall application implementation and coarse grained UI as opposed to needing to worry about all the little details that the artists may vary even until the day before shipping the product.
" + ); + evas_object_move(o_text, 0, 0); + evas_object_resize(o_text, win_w, win_h); + + evas_object_show(o); + + done = 0; +} + +/* cleanup */ +static void _cleanup(void) +{ + evas_object_del(o_text); +} + +/* loop - do things */ +static void _loop(double t, int f) +{ + Evas_Textblock_Cursor *cur; + static Evas_Textblock_Cursor *cur2; + cur = (Evas_Textblock_Cursor *) evas_object_textblock_cursor_get(o_text); + evas_textblock_cursor_text_append(cur, "*"); + evas_textblock_cursor_char_delete(cur); + + evas_textblock_cursor_paragraph_char_first(cur); + if (!cur2) + { + cur2 = evas_object_textblock_cursor_new(o_text); + evas_textblock_cursor_paragraph_last(cur2); + evas_textblock_cursor_paragraph_char_first(cur2); + } + if (!evas_textblock_cursor_compare(cur, cur2)) + evas_textblock_cursor_paragraph_first(cur); + else + evas_textblock_cursor_paragraph_next(cur); + + FPS_STD(NAME); +} + +/* prepend special key handlers if interactive (before STD) */ +static void _key(char *key) +{ + KEY_STD; +} + + + + + + + + + + + + +/* template stuff - ignore */ +# endif +#endif + +#ifdef UI +_ui_menu_item_add(ICON, NAME, FNAME); +#endif + +#ifdef PROTO +void FNAME(void); +#endif + +#ifndef PROTO +# ifndef UI +void FNAME(void) +{ + ui_func_set(_key, _loop); + _setup(); +} +# endif +#endif +#undef FNAME +#undef NAME +#undef ICON diff --git a/src/bin/ui.c b/src/bin/ui.c index 81b72dd..5156934 100644 --- a/src/bin/ui.c +++ b/src/bin/ui.c @@ -32,8 +32,7 @@ static Evas_Object *o_menu_icon_sel = NULL; static Evas_Object *o_menu_icon_sel2 = NULL; static Evas_Object *o_menu_text_sel = NULL; static Evas_Object *o_menu_title = NULL; -static Evas_Object *o_menu_title2 = NULL; -static Evas_List *menu = NULL; +static Eina_List *menu = NULL; static int menu_sel = 0; static int menu_active = 0; static double menu_anim = 0.0; @@ -45,108 +44,389 @@ static void (*key_func) (char *key) = NULL; static void (*loop_func) (double t, int f) = NULL; static int run_all = 0; +static int run_test = 0; +static int list_test = 0; +static int exit_after_test = 0; + +static double weights[] = +{ + 0.0, // no test 0 + + 50.4851, // test 1 + 97.3703, // test 2 + 10.0000, // test 3 + 87.3703, // ... + 10.0000, + + 150.0000, // test 6 + 10.0000, + 150.0000, + 10.0000, + 150.0000, + + 10.0000, // test 11 + 150.0000, + 10.0000, + 10.6493, + 38.4818, + + 40.7314, // test 16 + 32.0866, + 21.3337, + 21.2167, + 71.6141, + + 64.8893, // test 21 + 95.0880, + 121.0438, + 41.2646, + 162.7149, + + 89.1650, // test 26 + 105.3571, + 40.9657, + 98.4671, + 28.4322, + + 60.000, // test 31 + 75.5507, + 51.6601, + 135.4753, + 38.2705, + + 35.9915, // test 36 + 31.9500, + 22.6752, + 38.2702, + 37.4459, + + 37.2009, // test 41 + 34.5459, + 38.5043, + 50.0000, + 37.0282, + + 55.8886, // test 46 + 17.2535, + 23.1457, + 36.9874, + 37.9336, + + 17.1830, // test 51 + 20.7521, + 29.0141, + 131.6784, + 13.6851, + + 23.4462, // test 56 + 14.7573, + 36.5261, + 5.0000, + 5.0000, + + 24.3482, // test 61 + 10.4611, + 86.0290, + 82.0735, + 18.6459, + + 37.4608, // test 66 + 32.4417, + 11.5449, + 5.0000, + 11.4172, + + 13.3682, // test 71 + 10.0324, + 10.0584, + 10.0170, + 5.4029, + + 10.6349, // test 76 + 21.7728, + 12.7933, + 19.4177, + 34.4192, + + 23.9110, // test 81 + 22.8287, + 41.2399, + 30.1383, + 22.0342, + + 38.2952, // test 86 + 5.5560, + 0.5000, + 1.000, + 10.000, + + 5.000, // test 91 + 20.000, // MASK + 20.000, // MASK 2 + 20.000, // MASK 3 + 20.000, // MASK 4 + + 20.000, // test 96 + 20.000, // MASK 6 + 20.000, // MASK 7 + 20.000, // MASK 8 + 20.000, // MASK 9 + + 20.000, // test 101 + 20.000, // MASK 11 + 20.000, // MASK 12 + 20.000, // MASK 13 + 20.000, // MASK 14 + + 20.000, // test 106 MASK 15 + 1.000, + 2.000, + 1.000, + 2.000, + + 1.000, // test 111 + 2.000, + 1.000, + 2.000, + 1.000, + + 2.000, // test 116 + 10.000, + 10.000, + + 0.0, // Exit + + 0.0, // no final test - add a 0 at the end anyway to pad + 0.0, + 0.0, + 0.0, + 0.0 +}; static void _ui_exit(void) { + Menu_Item *mi; + + EINA_LIST_FREE(menu, mi) + { + free(mi->icon); + free(mi->text); + free(mi); + } engine_abort(); } +extern const char *profile; +extern int win_w, win_h; +extern const char *engine; +extern int loops; +extern int fullscreen; + static void _ui_all(void) { - Evas_List *l; + Eina_List *l; double fps = 0.0; - int t_count = 0; + double wfps = 0.0; + unsigned int t_count = 0; + unsigned int i; + double avgw = 0.0; + evas_object_hide(o_menu_logo); + evas_object_hide(o_menu_title); + evas_object_hide(o_menu_icon); + evas_object_hide(o_menu_icon_sel); + evas_object_hide(o_menu_icon_sel2); + evas_object_hide(o_menu_text_sel); + evas_object_hide(o_title); + evas_object_hide(o_byline); for (l = menu; l; l = l->next) { - Menu_Item *mi; - - mi = l->data; - if ((mi->func == about_start) || - (mi->func == _ui_exit) || - (mi->func == _ui_all)) - continue; - if (mi->func) mi->func(); - while (p_fps == 0.0) - { - ui_loop(); - engine_loop(); - evas_render(evas); - } - /* This give time to delete the objects of the previous test and make - the result of next test more accurate. Draw back, some time is not - counted at all. */ - evas_render(evas); - t_count++; - fps += p_fps; - key_func("Escape"); + Menu_Item *mi; + + mi = l->data; + if ((mi->func == about_start) || + (mi->func == _ui_exit) || + (mi->func == _ui_all)) + continue; + if (mi->func) mi->func(); + evas_object_hide(o_title); + evas_object_hide(o_byline); + while (p_fps == 0.0) + { + engine_loop(); + ui_loop(); + evas_render(evas); + } + /* This give time to delete the objects of the previous test and make + the result of next test more accurate. Draw back, some time is not + counted at all. */ + evas_render(evas); + t_count++; + fps += p_fps; + wfps += (p_fps * weights[t_count]); + key_func("Escape"); + } + for (i = 1; + (i < (1 + t_count)) && + (weights[i] > 0.0); + i++) + avgw += weights[i]; + avgw /= (i - 1); + if (t_count > 0) + { + char datestr[1024]; + struct tm *tim; + time_t now; + + now = time(NULL); + tim = localtime(&now); + if (tim) strftime(datestr, sizeof(datestr), "%Y-%m-%d %H:%M:%S", tim); + else snprintf(datestr, sizeof(datestr), "unknown"); + printf("\n#####Test Result#####\n" + "evas speed: %5.2f\n" + "evas speed(weighted): %5.2f\n" + "testcase count: %i\n" + "date: %s\n" + "evas version: %i.%i.%i.%i\n" + "profile: %s\n" + "window size: %i, %i\n" + "loop count: %i\n" + "engine: %s\n" + "full screen: %i\n", + (fps / t_count), + (wfps / (t_count * avgw)), + t_count, + datestr, + evas_version->major, evas_version->minor, evas_version->micro, + evas_version->revision, + profile, + win_w, win_h, + loops, + engine, + fullscreen); + } +} + + +static void +_ui_num(int n) +{ + double fps = 0.0; + double wfps = 0.0; + int t_count = 0; + Menu_Item *mi; + unsigned int i; + double avgw = 0.0; + + evas_object_hide(o_menu_logo); + evas_object_hide(o_menu_title); + evas_object_hide(o_menu_icon); + evas_object_hide(o_menu_icon_sel); + evas_object_hide(o_menu_icon_sel2); + evas_object_hide(o_menu_text_sel); + evas_object_hide(o_title); + evas_object_hide(o_byline); + mi = eina_list_nth(menu, n); + if (mi) + { + if ((mi->func == about_start) || + (mi->func == _ui_exit) || + (mi->func == _ui_all)) + goto done; + if (mi->func) mi->func(); + evas_object_hide(o_title); + evas_object_hide(o_byline); + while (p_fps == 0.0) + { + ui_loop(); + engine_loop(); + evas_render(evas); + } + /* This give time to delete the objects of the previous test and make + the result of next test more accurate. Draw back, some time is not + counted at all. */ + evas_render(evas); + t_count++; + fps += p_fps; + wfps += (p_fps * weights[n]); + key_func("Escape"); + } +done: + for (i = 1; i < ((sizeof(weights) / sizeof(double)) - 1); i++) + avgw += weights[i]; + avgw /= (i - 1); + if (t_count > 0) + { + // printf("%5.2f , EVAS SPEED\n", fps / t_count); + printf("%5.2f , EVAS SPEED (WEIGHTED)\n", wfps / (t_count * avgw)); } - if (t_count > 0) printf("%4.2f , EVAS SPEED\n", fps / t_count); } static void _ui_select(void) { - Evas_List *l; + Eina_List *l; int i; void (*func) (void) = NULL; evas_object_hide(o_menu_logo); evas_object_hide(o_menu_title); - evas_object_hide(o_menu_title2); evas_object_hide(o_menu_icon); evas_object_hide(o_menu_icon_sel); evas_object_hide(o_menu_icon_sel2); evas_object_hide(o_menu_text_sel); + evas_object_hide(o_title); + evas_object_hide(o_byline); for (i = 0, l = menu; l; l = l->next, i++) { - Menu_Item *mi; + Menu_Item *mi; - mi = l->data; - evas_object_hide(mi->o_icon); - if (i == menu_sel) - func = mi->func; + mi = l->data; + evas_object_hide(mi->o_icon); + if (i == menu_sel) + func = mi->func; } menu_active = 0; if (func) func(); + evas_object_hide(o_title); + evas_object_hide(o_byline); } static void -_ui_key(void *data, Evas *e, Evas_Object *obj, void *event_info) +_ui_key(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info) { Evas_Event_Key_Down *ev; ev = event_info; if (key_func) { - key_func(ev->keyname); - return; + key_func(ev->keyname); + return; } if ((!strcmp(ev->keyname, "Escape")) || (!strcmp(ev->keyname, "q")) || (!strcmp(ev->keyname, "Q"))) { - engine_abort(); + _ui_exit(); } if (menu_active) { - if (!strcmp(ev->keyname, "Left")) menu_sel++; - if (!strcmp(ev->keyname, "Right")) menu_sel--; - if (menu_sel < 0) menu_sel = 0; - else if (menu_sel >= evas_list_count(menu)) menu_sel = evas_list_count(menu) - 1; - menu_anim_sel = menu_sel; - if (!strcmp(ev->keyname, "Return")) _ui_select(); + if (!strcmp(ev->keyname, "Left")) menu_sel++; + if (!strcmp(ev->keyname, "Right")) menu_sel--; + if (menu_sel < 0) menu_sel = 0; + else if ((unsigned int)menu_sel >= eina_list_count(menu)) menu_sel = eina_list_count(menu) - 1; + menu_anim_sel = menu_sel; + if (!strcmp(ev->keyname, "Return")) _ui_select(); } } static Evas_Coord down_x, down_y; -static int down = 0; static int down_menu_sel = 0; static void -_ui_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_info) +_ui_mouse_down(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info) { Evas_Event_Mouse_Down *ev; @@ -154,18 +434,14 @@ _ui_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_info) if (ev->button != 1) return; if (menu_active) { - down_x = ev->canvas.x; - down_y = ev->canvas.y; - down++; - down_menu_sel = menu_sel; - } - else - { + down_x = ev->canvas.x; + down_y = ev->canvas.y; + down_menu_sel = menu_sel; } } static void -_ui_mouse_up(void *data, Evas *e, Evas_Object *obj, void *event_info) +_ui_mouse_up(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info) { Evas_Event_Mouse_Up *ev; @@ -173,39 +449,36 @@ _ui_mouse_up(void *data, Evas *e, Evas_Object *obj, void *event_info) if (ev->button != 1) return; if (menu_active) { - Evas_Coord dx, dy; - - dx = ev->canvas.x - down_x; - dy = ev->canvas.y - down_y; - if ((((dx * dx) + (dy * dy)) < (20 * 20)) && - (menu_sel == down_menu_sel)) - _ui_select(); - down--; + Evas_Coord dx, dy; + + dx = ev->canvas.x - down_x; + dy = ev->canvas.y - down_y; + if ((((dx * dx) + (dy * dy)) < (20 * 20)) && + (menu_sel == down_menu_sel)) + _ui_select(); } else { - evas_event_feed_key_down(evas, "Escape", "Escape", NULL, NULL, 0, NULL); - evas_event_feed_key_up(evas, "Escape", "Escape", NULL, NULL, 0, NULL); + evas_event_feed_key_down(evas, "Escape", "Escape", NULL, NULL, 0, NULL); + evas_event_feed_key_up(evas, "Escape", "Escape", NULL, NULL, 0, NULL); } } static void -_ui_mouse_move(void *data, Evas *e, Evas_Object *obj, void *event_info) +_ui_mouse_move(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info) { Evas_Event_Mouse_Move *ev; ev = event_info; - if (!down) return; + if (ev->buttons != 1) return; if (menu_active) { - menu_sel = down_menu_sel + ((ev->cur.canvas.x - down_x) / 25); - /* scroll */ - if (menu_sel < 0) menu_sel = 0; - else if (menu_sel >= evas_list_count(menu)) menu_sel = evas_list_count(menu) - 1; - menu_anim_sel = menu_sel; - } - else - { + menu_sel = down_menu_sel + ((ev->cur.canvas.x - down_x) / 25); + /* scroll */ + if (menu_sel < 0) menu_sel = 0; + else if ((unsigned int)menu_sel >= eina_list_count(menu)) + menu_sel = eina_list_count(menu) - 1; + menu_anim_sel = menu_sel; } } @@ -222,7 +495,7 @@ _ui_menu_item_add(char *icon, char *text, void (*func) (void)) mi->icon = strdup(icon); mi->text = strdup(text); mi->func = func; - menu = evas_list_append(menu, mi); + menu = eina_list_append(menu, mi); evas_object_raise(o_menu_icon_sel2); } @@ -231,6 +504,7 @@ _ui_setup(void) { Evas_Object *o; Evas_Coord x, y, w, h; + time_t t0, t; o = evas_object_rectangle_add(evas); evas_object_move(o, 0, 0); @@ -253,18 +527,6 @@ _ui_setup(void) evas_object_show(o); o_wallpaper = o; -/* - o = evas_object_image_add(evas); - evas_object_move(o, 0, 0); - evas_object_image_file_set(o, PACKAGE_DATA_DIR"/data/bg.png", NULL); - evas_object_image_fill_set(o, 0, 0, win_w, win_h); - evas_object_image_smooth_scale_set(o, 0); - evas_object_resize(o, win_w, win_h); - evas_object_layer_set(o, -99); - evas_object_show(o); - o_wallpaper = o; - */ - o = evas_object_text_add(evas); evas_object_text_font_set(o, "Vera-Bold", 10); evas_object_text_text_set(o, "EXPEDITE"); @@ -293,7 +555,7 @@ _ui_setup(void) o = evas_object_image_add(evas); evas_object_move(o, (win_w - 120) / 2, ((win_h - 160) / 2)); - evas_object_image_file_set(o, build_path("logo.png"), NULL); + evas_object_image_file_set(o, build_path("e-logo.png"), NULL); evas_object_image_fill_set(o, 0, 0, 120, 160); evas_object_resize(o, 120, 160); evas_object_layer_set(o, -98); @@ -311,8 +573,8 @@ _ui_setup(void) o = evas_object_image_add(evas); evas_object_move(o, 0, 0); evas_object_image_file_set(o, build_path("icon_sel.png"), NULL); - evas_object_resize(o, 56, 56); - evas_object_image_fill_set(o, 0, 0, 56, 56); + evas_object_resize(o, 48, 48); + evas_object_image_fill_set(o, 0, 0, 48, 48); o_menu_icon_sel = o; o = evas_object_image_add(evas); @@ -320,29 +582,11 @@ _ui_setup(void) evas_object_image_file_set(o, build_path("text_sel.png"), NULL); evas_object_resize(o, 96, 32); evas_object_image_fill_set(o, 0, 0, 96, 32); - evas_object_image_border_set(o, 8, 8, 8, 8); + evas_object_image_border_set(o, 7, 7, 7, 7); o_menu_text_sel = o; - o = evas_object_image_add(evas); - evas_object_move(o, 0, 0); - evas_object_image_file_set(o, build_path("icon_sel2.png"), NULL); - evas_object_resize(o, 56, 41); - evas_object_image_fill_set(o, 0, 0, 56, 41); - o_menu_icon_sel2 = o; - - o = evas_object_text_add(evas); - evas_object_text_font_set(o, "Vera-Bold", 10); - evas_object_text_text_set(o, ""); - evas_object_color_set(o, 100, 100, 100, 100); - evas_object_pass_events_set(o, 1); - evas_object_geometry_get(o, NULL, NULL, &w, &h); - x = ((win_w - w) / 2) + 1; - y = ((win_h - h) / 2) + 1; - evas_object_move(o, x, y); - o_menu_title2 = o; - o = evas_object_text_add(evas); - evas_object_text_font_set(o, "Vera-Bold", 10); + evas_object_text_font_set(o, "Vera", 10); evas_object_text_text_set(o, ""); evas_object_color_set(o, 0, 0, 0, 100); evas_object_pass_events_set(o, 1); @@ -352,22 +596,60 @@ _ui_setup(void) evas_object_move(o, x, y); o_menu_title = o; - _ui_menu_item_add("e.png", "About Enlightenment", about_start); + _ui_menu_item_add("e.png", "About", about_start); _ui_menu_item_add("e.png", "All Tests", _ui_all); #define UI #include "tests.h" #undef UI _ui_menu_item_add("exit.png", "Exit", _ui_exit); +#ifdef HAVE_SYNC + /* make sure disk io isn't going to turn up unexpectedly */ + sync(); + sync(); + sync(); +#endif + /* warm up the cpu with some spinning */ + if (run_all) + { + t0 = time(NULL); + for (;;) + { + t = time(NULL); + if (t - t0 > 2) break; + } + } + if (run_all) { - _ui_all(); - _ui_exit(); + _ui_all(); + } + else if (run_test > 0) + { + _ui_num(run_test); + } + else if (list_test > 0) + { + Eina_List *l; + int i; + + for (l = menu, i = -1; l; l = l->next, i++) + { + Menu_Item *mi; + + mi = l->data; + if (i > 0) + printf("%3i - %s (Weight %0.2lf)\n", i, mi->text, weights[i]); + } } else { - menu_active = 1; + menu_active = 1; } + + if (exit_after_test) + _ui_exit(); + } void @@ -377,10 +659,21 @@ ui_args(int argc, char **argv) for (i = 1; i < argc; i++) { - if (!strcmp(argv[i], "-a")) - { - run_all = 1; - } + if (!strcmp(argv[i], "-a")) + { + run_all = 1; + exit_after_test = 1; + } + else if ((!strcmp(argv[i], "-t")) && (i < (argc - 1))) + { + run_test = atoi(argv[i + 1]) + 1; + exit_after_test = 1; + if (run_test < 2) run_test = 2; + } + else if (!strcmp(argv[i], "-l")) + { + list_test = 1; + } } _ui_setup(); start = get_time(); @@ -393,126 +686,120 @@ ui_loop(void) static double pt = 0.0; double t, t2; + evas_object_resize(o_bg, win_w, win_h); + evas_object_resize(o_wallpaper, win_w, win_h); if (loop_func) { - t = get_time(); - f_loop++; - f_start++; - if ((t - t_loop) >= 1.0) - { -// ui_fps((double)f_loop / (t - t_loop)); - t_loop = t; - f_loop = 0; - } - loop_func(t - t_start, f_start); - return; + t = get_time(); + f_loop++; + f_start++; + if ((t - t_loop) >= 1.0) + { + // ui_fps((double)f_loop / (t - t_loop)); + t_loop = t; + f_loop = 0; + } + loop_func(t - t_start, f_start); + return; } t2 = get_time(); if (first) { - t = 0.1; - pt = t2; + t = 0.1; + pt = t2; } else { - t = t2 - pt; - pt = t2; + t = t2 - pt; + pt = t2; } first = 0; /* menu layout */ if (menu_active) { - Evas_List *l; - int i; - static double tr = 0.0; - double tt; - - tt = t; - tt += tr; - while (tt > 0.001) - { - menu_anim = (menu_anim * 0.995) + (menu_anim_sel * 0.005); - tt -= 0.001; - } - tr = tt; - for (i = 0, l = menu; l; l = l->next, i++) - { - char buf[4096]; - Menu_Item *mi; - Evas_Coord x, y, w, h, tw, th; - Evas_Coord len; - double a; - Evas_Object *o; - - mi = l->data; - o = mi->o_icon; - evas_object_geometry_get(o_menu_logo, NULL, NULL, &w, &h); - len = ((w * 3) + 10) / 4; - evas_object_geometry_get(o, NULL, NULL, &w, &h); - x = (win_w / 2) - + (sin((menu_anim - (double)i) * 0.33) * len) - - (w / 2); - y = (win_h / 2) - + (cos((menu_anim - (double)i) * 0.33) * len) - - (h / 2); - evas_object_move(o, x, y); - a = menu_anim - (double)i; - if (a < 0) a = -a; - a = 255 - (30 * a); - evas_object_color_set(o, a, a, a, a); - evas_object_show(o); - - - if (i == menu_sel) - { - a = menu_anim - (double)i; - if (a < 0) a = -a; - a = 255 - (255 * a); - - o = o_menu_icon_sel; - evas_object_move(o, x - ((56 - w) / 2), y - ((56 - h) / 2)); - evas_object_color_set(o, a, a, a, a); - - o = o_menu_icon_sel2; - evas_object_move(o, (win_w - 56) / 2, (win_h / 2) + len - 4); - - o = o_menu_title; - evas_object_color_set(o, 0, 0, 0, a); - evas_object_text_text_set(o, mi->text); - evas_object_geometry_get(o, NULL, NULL, &tw, &th); - x = (win_w - tw) / 2; - y = (win_h / 2) + len + 40; - evas_object_move(o, x, y); - - o = o_menu_title2; - evas_object_color_set(o, a / 2, a / 2, a / 2, a / 2); - evas_object_text_text_set(o, mi->text); - evas_object_move(o, x + 1, y + 1); - - o = o_menu_text_sel; - w = tw + 24; - h = 28; - x = x - 12; - y = y + ((th - h) / 2); - evas_object_move(o, x, y); - evas_object_resize(o, w, h); - evas_object_image_fill_set(o, 0, 0, w, h); - evas_object_color_set(o, a, a, a, a); - - o = o_menu_icon; - snprintf(buf, 4096, "%s%s", data_dir, mi->icon); - evas_object_image_file_set(o, buf, NULL); - evas_object_color_set(o, a / 2, a / 2, a / 2, a / 2); - } - } - evas_object_show(o_menu_logo); - evas_object_show(o_menu_title); - evas_object_show(o_menu_title2); - evas_object_show(o_menu_icon); - evas_object_show(o_menu_icon_sel); - evas_object_show(o_menu_icon_sel2); - evas_object_show(o_menu_text_sel); + Eina_List *l; + int i; + static double tr = 0.0; + double tt; + + tt = t; + tt += tr; + while (tt > 0.001) + { + menu_anim = (menu_anim * 0.995) + (menu_anim_sel * 0.005); + tt -= 0.001; + } + tr = tt; + for (i = 0, l = menu; l; l = l->next, i++) + { + char buf[4096]; + Menu_Item *mi; + Evas_Coord x, y, w, h, tw, th; + Evas_Coord len; + double a; + Evas_Object *o; + + mi = l->data; + o = mi->o_icon; + evas_object_geometry_get(o_menu_logo, NULL, NULL, &w, &h); + len = ((w * 3) + 10) / 4; + evas_object_geometry_get(o, NULL, NULL, &w, &h); + x = (win_w / 2) + + (sin((menu_anim - (double)i) * 0.33) * len) + - (w / 2); + y = (win_h / 2) + + (cos((menu_anim - (double)i) * 0.33) * len) + - (h / 2); + evas_object_move(o, x, y); + a = menu_anim - (double)i; + if (a < 0) a = -a; + a = 255 - (30 * a); + evas_object_color_set(o, a, a, a, a); + evas_object_show(o); + + if (i == menu_sel) + { + a = menu_anim - (double)i; + if (a < 0) a = -a; + a = 255 - (255 * a); + + o = o_menu_icon_sel; + evas_object_move(o, x - ((48 - w) / 2), y - ((48 - h) / 2)); + evas_object_color_set(o, a, a, a, a); + + o = o_menu_title; + evas_object_color_set(o, a, a, a, a); + evas_object_text_text_set(o, mi->text); + evas_object_geometry_get(o, NULL, NULL, &tw, &th); + x = (win_w - tw) / 2; + y = (win_h / 2) + len + 48; + evas_object_move(o, x, y); + + + o = o_menu_text_sel; + w = tw + 24; + h = 28; + x = x - 12; + y = y + ((th - h) / 2); + evas_object_move(o, x, y); + evas_object_resize(o, w, h); + evas_object_image_fill_set(o, 0, 0, w, h); + evas_object_color_set(o, a, a, a, a); + + o = o_menu_icon; + snprintf(buf, 4096, "%s%s", data_dir, mi->icon); + evas_object_image_file_set(o, buf, NULL); + evas_object_color_set(o, a / 2, a / 2, a / 2, a / 2); + } + } + evas_object_move(o_menu_logo, (win_w - 120) / 2, ((win_h - 160) / 2)); + evas_object_show(o_menu_logo); + evas_object_show(o_menu_title); + evas_object_show(o_menu_icon); + evas_object_show(o_menu_icon_sel); + evas_object_show(o_menu_icon_sel2); + evas_object_show(o_menu_text_sel); } else { @@ -522,7 +809,10 @@ ui_loop(void) void ui_menu(void) { - evas_object_text_text_set(o_byline, "LEFT/RIGHT - select, ENTER - select, ESCAPE - exit."); + evas_object_show(o_title); + evas_object_show(o_byline); + evas_object_text_text_set + (o_byline, "LEFT/RIGHT - select, ENTER - select, ESCAPE - exit."); menu_active = 1; key_func = NULL; loop_func = NULL; @@ -542,9 +832,11 @@ ui_func_set(void (*kfunc) (char *key), void (*lfunc) (double t, int f)) void ui_fps(double fps) { - char buf[256]; + /* + char buf[256]; - snprintf(buf, sizeof(buf), "ESCAPE - exit, FPS: %4.3f", fps); - evas_object_text_text_set(o_byline, buf); + snprintf(buf, sizeof(buf), "ESCAPE - exit, FPS: %4.3f", fps); + evas_object_text_text_set(o_byline, buf); + */ p_fps = fps; } diff --git a/src/bin/widgets_file_icons.c b/src/bin/widgets_file_icons.c new file mode 100644 index 0000000..f603c57 --- /dev/null +++ b/src/bin/widgets_file_icons.c @@ -0,0 +1,139 @@ +#undef FNAME +#undef NAME +#undef ICON + +/* metadata */ +#define FNAME widgets_file_icons_start +#define NAME "Widgets File Icons" +#define ICON "widgets.png" + +#ifndef PROTO +# ifndef UI +# include "main.h" + +/* standard var */ +static int done = 0; +/* private data */ +#define NUM 512 +#define ICON_SIZE 64 +static Evas_Object *o_images[NUM]; +static Evas_Object *o_texts[NUM]; + +static const char *icons[] = +{ + "bug.png", + "bulb.png", + "camera.png", + "colorbox.png", + + "e.png", + "error.png", + "flower.png", + "house.png", + + "mushroom.png", + "pulse.png", + "typewriter.png", + "warning.png", + + "watch.png" +}; + +/* setup */ +static void _setup(void) +{ + int i; + Evas_Object *o; + for (i = 0; i < NUM; i++) + { + o = evas_object_image_add(evas); + o_images[i] = o; + evas_object_image_file_set(o, build_path(icons[i % 13]), NULL); + evas_object_image_fill_set(o, 0, 0, ICON_SIZE, ICON_SIZE); + evas_object_resize(o, ICON_SIZE, ICON_SIZE); + evas_object_show(o); + + o = evas_object_text_add(evas); + o_texts[i] = o; + evas_object_text_font_set(o, "Vera-Bold", 10); + evas_object_text_text_set(o, icons[i % 13]); + evas_object_text_style_set(o, EVAS_TEXT_STYLE_FAR_SOFT_SHADOW); + evas_object_color_set(o, 255, 255, 255, 255); + evas_object_text_shadow_color_set(o, 0, 0, 0, 24); + evas_object_show(o); + } + done = 0; +} + +/* cleanup */ +static void _cleanup(void) +{ + int i; + for (i = 0; i < NUM; i++) evas_object_del(o_images[i]); + for (i = 0; i < NUM; i++) evas_object_del(o_texts[i]); +} + +/* loop - do things */ +static void _loop(double t, int f) +{ + int i; + Evas_Coord x, y, tw, th, cent; + x = 0; + y = 0 - f; + for (i = 0; i < NUM; i++) + { + evas_object_move(o_images[i], x + 8, y); + evas_object_geometry_get(o_texts[i], NULL, NULL, &tw, &th); + cent = (ICON_SIZE + 16 - tw) / 2; + evas_object_move(o_texts[i], x + cent, y + ICON_SIZE + 4); + x += ICON_SIZE + 16; + if (x > win_w) + { + x = 0; + y += ICON_SIZE + 16; + } + } + FPS_STD(NAME); +} + +/* prepend special key handlers if interactive (before STD) */ +static void _key(char *key) +{ + KEY_STD; +} + + + + + + + + + + + + +/* template stuff - ignore */ +# endif +#endif + +#ifdef UI +_ui_menu_item_add(ICON, NAME, FNAME); +#endif + +#ifdef PROTO +void FNAME(void); +#endif + +#ifndef PROTO +# ifndef UI +void FNAME(void) +{ + ui_func_set(_key, _loop); + _setup(); +} +# endif +#endif +#undef FNAME +#undef NAME +#undef ICON diff --git a/src/bin/widgets_file_icons_2.c b/src/bin/widgets_file_icons_2.c new file mode 100644 index 0000000..8536d3b --- /dev/null +++ b/src/bin/widgets_file_icons_2.c @@ -0,0 +1,137 @@ +#undef FNAME +#undef NAME +#undef ICON + +/* metadata */ +#define FNAME widgets_file_icons_2_start +#define NAME "Widgets File Icons 2" +#define ICON "widgets.png" + +#ifndef PROTO +# ifndef UI +# include "main.h" + +/* standard var */ +static int done = 0; +/* private data */ +#define NUM 512 +#define ICON_SIZE 64 +static Evas_Object *o_images[NUM]; +static Evas_Object *o_texts[NUM]; + +static const char *icons[] = +{ + "bug.png", + "bulb.png", + "camera.png", + "colorbox.png", + + "e.png", + "error.png", + "flower.png", + "house.png", + + "mushroom.png", + "pulse.png", + "typewriter.png", + "warning.png", + + "watch.png" +}; + +/* setup */ +static void _setup(void) +{ + int i; + Evas_Object *o; + for (i = 0; i < NUM; i++) + { + o = evas_object_image_add(evas); + o_images[i] = o; + evas_object_image_file_set(o, build_path(icons[i % 13]), NULL); + evas_object_image_fill_set(o, 0, 0, ICON_SIZE, ICON_SIZE); + evas_object_resize(o, ICON_SIZE, ICON_SIZE); + evas_object_show(o); + + o = evas_object_text_add(evas); + o_texts[i] = o; + evas_object_text_font_set(o, "Vera-Bold", 10); + evas_object_text_text_set(o, icons[i % 13]); + evas_object_color_set(o, 0, 0, 0, 255); + evas_object_show(o); + } + done = 0; +} + +/* cleanup */ +static void _cleanup(void) +{ + int i; + for (i = 0; i < NUM; i++) evas_object_del(o_images[i]); + for (i = 0; i < NUM; i++) evas_object_del(o_texts[i]); +} + +/* loop - do things */ +static void _loop(double t, int f) +{ + int i; + Evas_Coord x, y, tw, th, cent; + x = 0; + y = 0 - f; + for (i = 0; i < NUM; i++) + { + evas_object_move(o_images[i], x + 8, y); + evas_object_geometry_get(o_texts[i], NULL, NULL, &tw, &th); + cent = (ICON_SIZE + 16 - tw) / 2; + evas_object_move(o_texts[i], x + cent, y + ICON_SIZE + 4); + x += ICON_SIZE + 16; + if (x > win_w) + { + x = 0; + y += ICON_SIZE + 16; + } + } + FPS_STD(NAME); +} + +/* prepend special key handlers if interactive (before STD) */ +static void _key(char *key) +{ + KEY_STD; +} + + + + + + + + + + + + +/* template stuff - ignore */ +# endif +#endif + +#ifdef UI +_ui_menu_item_add(ICON, NAME, FNAME); +#endif + +#ifdef PROTO +void FNAME(void); +#endif + +#ifndef PROTO +# ifndef UI +void FNAME(void) +{ + ui_func_set(_key, _loop); + _setup(); +} +# endif +#endif +#undef FNAME +#undef NAME +#undef ICON diff --git a/src/bin/widgets_file_icons_2_grouped.c b/src/bin/widgets_file_icons_2_grouped.c new file mode 100644 index 0000000..31b6c1b --- /dev/null +++ b/src/bin/widgets_file_icons_2_grouped.c @@ -0,0 +1,145 @@ +#undef FNAME +#undef NAME +#undef ICON + +/* metadata */ +#define FNAME widgets_file_icons_2_grouped_start +#define NAME "Widgets File Icons 2 Grouped" +#define ICON "widgets.png" + +#ifndef PROTO +# ifndef UI +# include "main.h" + +/* standard var */ +static int done = 0; +/* private data */ +#define NUM 512 +#define ICON_SIZE 64 +static Evas_Object *o_images[NUM]; +static Evas_Object *o_texts[NUM]; + +static const char *icons[] = +{ + "bug.png", + "bulb.png", + "camera.png", + "colorbox.png", + + "e.png", + "error.png", + "flower.png", + "house.png", + + "mushroom.png", + "pulse.png", + "typewriter.png", + "warning.png", + + "watch.png" +}; + +/* setup */ +static void _setup(void) +{ + int i; + Evas_Object *o; + for (i = 0; i < NUM; i++) + { + o = evas_object_image_add(evas); + o_images[i] = o; + evas_object_image_file_set(o, build_path(icons[i % 13]), NULL); + evas_object_image_fill_set(o, 0, 0, ICON_SIZE, ICON_SIZE); + evas_object_resize(o, ICON_SIZE, ICON_SIZE); + evas_object_show(o); + + o = evas_object_text_add(evas); + o_texts[i] = o; + evas_object_text_font_set(o, "Vera-Bold", 10); + evas_object_text_text_set(o, icons[i % 13]); + evas_object_color_set(o, 0, 0, 0, 255); + evas_object_show(o); + } + for (i = 0; i < NUM; i++) + { + evas_object_raise(o_images[i]); + } + for (i = 0; i < NUM; i++) + { + if (i > 13) evas_object_stack_above(o_images[i], o_images[i - 13]); + } + done = 0; +} + +/* cleanup */ +static void _cleanup(void) +{ + int i; + for (i = 0; i < NUM; i++) evas_object_del(o_images[i]); + for (i = 0; i < NUM; i++) evas_object_del(o_texts[i]); +} + +/* loop - do things */ +static void _loop(double t, int f) +{ + int i; + Evas_Coord x, y, tw, th, cent; + x = 0; + y = 0 - f; + for (i = 0; i < NUM; i++) + { + evas_object_move(o_images[i], x + 8, y); + evas_object_geometry_get(o_texts[i], NULL, NULL, &tw, &th); + cent = (ICON_SIZE + 16 - tw) / 2; + evas_object_move(o_texts[i], x + cent, y + ICON_SIZE + 4); + x += ICON_SIZE + 16; + if (x > win_w) + { + x = 0; + y += ICON_SIZE + 16; + } + } + FPS_STD(NAME); +} + +/* prepend special key handlers if interactive (before STD) */ +static void _key(char *key) +{ + KEY_STD; +} + + + + + + + + + + + + +/* template stuff - ignore */ +# endif +#endif + +#ifdef UI +_ui_menu_item_add(ICON, NAME, FNAME); +#endif + +#ifdef PROTO +void FNAME(void); +#endif + +#ifndef PROTO +# ifndef UI +void FNAME(void) +{ + ui_func_set(_key, _loop); + _setup(); +} +# endif +#endif +#undef FNAME +#undef NAME +#undef ICON diff --git a/src/bin/widgets_file_icons_2_same.c b/src/bin/widgets_file_icons_2_same.c new file mode 100644 index 0000000..7dbf9ff --- /dev/null +++ b/src/bin/widgets_file_icons_2_same.c @@ -0,0 +1,122 @@ +#undef FNAME +#undef NAME +#undef ICON + +/* metadata */ +#define FNAME widgets_file_icons_2_same_start +#define NAME "Widgets File Icons 2 Same" +#define ICON "widgets.png" + +#ifndef PROTO +# ifndef UI +# include "main.h" + +/* standard var */ +static int done = 0; +/* private data */ +#define NUM 512 +#define ICON_SIZE 64 +static Evas_Object *o_images[NUM]; +static Evas_Object *o_texts[NUM]; + +static const char *icons[] = +{ + "e.png", +}; + +/* setup */ +static void _setup(void) +{ + int i; + Evas_Object *o; + for (i = 0; i < NUM; i++) + { + o = evas_object_image_add(evas); + o_images[i] = o; + evas_object_image_file_set(o, build_path(icons[i % 1]), NULL); + evas_object_image_fill_set(o, 0, 0, ICON_SIZE, ICON_SIZE); + evas_object_resize(o, ICON_SIZE, ICON_SIZE); + evas_object_show(o); + + o = evas_object_text_add(evas); + o_texts[i] = o; + evas_object_text_font_set(o, "Vera-Bold", 10); + evas_object_text_text_set(o, icons[i % 1]); + evas_object_color_set(o, 0, 0, 0, 255); + evas_object_show(o); + } + done = 0; +} + +/* cleanup */ +static void _cleanup(void) +{ + int i; + for (i = 0; i < NUM; i++) evas_object_del(o_images[i]); + for (i = 0; i < NUM; i++) evas_object_del(o_texts[i]); +} + +/* loop - do things */ +static void _loop(double t, int f) +{ + int i; + Evas_Coord x, y, tw, th, cent; + x = 0; + y = 0 - f; + for (i = 0; i < NUM; i++) + { + evas_object_move(o_images[i], x + 8, y); + evas_object_geometry_get(o_texts[i], NULL, NULL, &tw, &th); + cent = (ICON_SIZE + 16 - tw) / 2; + evas_object_move(o_texts[i], x + cent, y + ICON_SIZE + 4); + x += ICON_SIZE + 16; + if (x > win_w) + { + x = 0; + y += ICON_SIZE + 16; + } + } + FPS_STD(NAME); +} + +/* prepend special key handlers if interactive (before STD) */ +static void _key(char *key) +{ + KEY_STD; +} + + + + + + + + + + + + +/* template stuff - ignore */ +# endif +#endif + +#ifdef UI +_ui_menu_item_add(ICON, NAME, FNAME); +#endif + +#ifdef PROTO +void FNAME(void); +#endif + +#ifndef PROTO +# ifndef UI +void FNAME(void) +{ + ui_func_set(_key, _loop); + _setup(); +} +# endif +#endif +#undef FNAME +#undef NAME +#undef ICON diff --git a/src/bin/widgets_file_icons_2_same_grouped.c b/src/bin/widgets_file_icons_2_same_grouped.c new file mode 100644 index 0000000..f5e8324 --- /dev/null +++ b/src/bin/widgets_file_icons_2_same_grouped.c @@ -0,0 +1,126 @@ +#undef FNAME +#undef NAME +#undef ICON + +/* metadata */ +#define FNAME widgets_file_icons_2_same_grouped_start +#define NAME "Widgets File Icons 2 Same Grouped" +#define ICON "widgets.png" + +#ifndef PROTO +# ifndef UI +# include "main.h" + +/* standard var */ +static int done = 0; +/* private data */ +#define NUM 512 +#define ICON_SIZE 64 +static Evas_Object *o_images[NUM]; +static Evas_Object *o_texts[NUM]; + +static const char *icons[] = +{ + "e.png", +}; + +/* setup */ +static void _setup(void) +{ + int i; + Evas_Object *o; + for (i = 0; i < NUM; i++) + { + o = evas_object_image_add(evas); + o_images[i] = o; + evas_object_image_file_set(o, build_path(icons[i % 1]), NULL); + evas_object_image_fill_set(o, 0, 0, ICON_SIZE, ICON_SIZE); + evas_object_resize(o, ICON_SIZE, ICON_SIZE); + evas_object_show(o); + + o = evas_object_text_add(evas); + o_texts[i] = o; + evas_object_text_font_set(o, "Vera-Bold", 10); + evas_object_text_text_set(o, icons[i % 1]); + evas_object_color_set(o, 0, 0, 0, 255); + evas_object_show(o); + } + for (i = 0; i < NUM; i++) + { + evas_object_raise(o_images[i]); + } + done = 0; +} + +/* cleanup */ +static void _cleanup(void) +{ + int i; + for (i = 0; i < NUM; i++) evas_object_del(o_images[i]); + for (i = 0; i < NUM; i++) evas_object_del(o_texts[i]); +} + +/* loop - do things */ +static void _loop(double t, int f) +{ + int i; + Evas_Coord x, y, tw, th, cent; + x = 0; + y = 0 - f; + for (i = 0; i < NUM; i++) + { + evas_object_move(o_images[i], x + 8, y); + evas_object_geometry_get(o_texts[i], NULL, NULL, &tw, &th); + cent = (ICON_SIZE + 16 - tw) / 2; + evas_object_move(o_texts[i], x + cent, y + ICON_SIZE + 4); + x += ICON_SIZE + 16; + if (x > win_w) + { + x = 0; + y += ICON_SIZE + 16; + } + } + FPS_STD(NAME); +} + +/* prepend special key handlers if interactive (before STD) */ +static void _key(char *key) +{ + KEY_STD; +} + + + + + + + + + + + + +/* template stuff - ignore */ +# endif +#endif + +#ifdef UI +_ui_menu_item_add(ICON, NAME, FNAME); +#endif + +#ifdef PROTO +void FNAME(void); +#endif + +#ifndef PROTO +# ifndef UI +void FNAME(void) +{ + ui_func_set(_key, _loop); + _setup(); +} +# endif +#endif +#undef FNAME +#undef NAME +#undef ICON diff --git a/src/bin/widgets_file_icons_3.c b/src/bin/widgets_file_icons_3.c new file mode 100644 index 0000000..72e26ab --- /dev/null +++ b/src/bin/widgets_file_icons_3.c @@ -0,0 +1,137 @@ +#undef FNAME +#undef NAME +#undef ICON + +/* metadata */ +#define FNAME widgets_file_icons_3_start +#define NAME "Widgets File Icons 3" +#define ICON "widgets.png" + +#ifndef PROTO +# ifndef UI +# include "main.h" + +/* standard var */ +static int done = 0; +/* private data */ +#define NUM 512 +#define ICON_SIZE 16 +static Evas_Object *o_images[NUM]; +static Evas_Object *o_texts[NUM]; + +static const char *icons[] = +{ + "bug.png", + "bulb.png", + "camera.png", + "colorbox.png", + + "e.png", + "error.png", + "flower.png", + "house.png", + + "mushroom.png", + "pulse.png", + "typewriter.png", + "warning.png", + + "watch.png" +}; + +/* setup */ +static void _setup(void) +{ + int i; + Evas_Object *o; + for (i = 0; i < NUM; i++) + { + o = evas_object_image_add(evas); + o_images[i] = o; + evas_object_image_file_set(o, build_path(icons[i % 13]), NULL); + evas_object_image_fill_set(o, 0, 0, ICON_SIZE, ICON_SIZE); + evas_object_resize(o, ICON_SIZE, ICON_SIZE); + evas_object_show(o); + + o = evas_object_text_add(evas); + o_texts[i] = o; + evas_object_text_font_set(o, "Vera-Bold", 10); + evas_object_text_text_set(o, icons[i % 13]); + evas_object_color_set(o, 0, 0, 0, 255); + evas_object_show(o); + } + done = 0; +} + +/* cleanup */ +static void _cleanup(void) +{ + int i; + for (i = 0; i < NUM; i++) evas_object_del(o_images[i]); + for (i = 0; i < NUM; i++) evas_object_del(o_texts[i]); +} + +/* loop - do things */ +static void _loop(double t, int f) +{ + int i; + Evas_Coord x, y, tw, th, cent; + x = 0; + y = 0 - f; + for (i = 0; i < NUM; i++) + { + evas_object_move(o_images[i], x + 8, y); + evas_object_geometry_get(o_texts[i], NULL, NULL, &tw, &th); + cent = (ICON_SIZE + 16 - tw) / 2; + evas_object_move(o_texts[i], x + cent, y + ICON_SIZE + 4); + x += ICON_SIZE + 16; + if (x > win_w) + { + x = 0; + y += ICON_SIZE + 16; + } + } + FPS_STD(NAME); +} + +/* prepend special key handlers if interactive (before STD) */ +static void _key(char *key) +{ + KEY_STD; +} + + + + + + + + + + + + +/* template stuff - ignore */ +# endif +#endif + +#ifdef UI +_ui_menu_item_add(ICON, NAME, FNAME); +#endif + +#ifdef PROTO +void FNAME(void); +#endif + +#ifndef PROTO +# ifndef UI +void FNAME(void) +{ + ui_func_set(_key, _loop); + _setup(); +} +# endif +#endif +#undef FNAME +#undef NAME +#undef ICON diff --git a/src/bin/widgets_file_icons_4.c b/src/bin/widgets_file_icons_4.c new file mode 100644 index 0000000..9955dca --- /dev/null +++ b/src/bin/widgets_file_icons_4.c @@ -0,0 +1,137 @@ +#undef FNAME +#undef NAME +#undef ICON + +/* metadata */ +#define FNAME widgets_file_icons_4_start +#define NAME "Widgets File Icons 4" +#define ICON "widgets.png" + +#ifndef PROTO +# ifndef UI +# include "main.h" + +/* standard var */ +static int done = 0; +/* private data */ +#define NUM 512 +#define ICON_SIZE 96 +static Evas_Object *o_images[NUM]; +static Evas_Object *o_texts[NUM]; + +static const char *icons[] = +{ + "bug.png", + "bulb.png", + "camera.png", + "colorbox.png", + + "e.png", + "error.png", + "flower.png", + "house.png", + + "mushroom.png", + "pulse.png", + "typewriter.png", + "warning.png", + + "watch.png" +}; + +/* setup */ +static void _setup(void) +{ + int i; + Evas_Object *o; + for (i = 0; i < NUM; i++) + { + o = evas_object_image_add(evas); + o_images[i] = o; + evas_object_image_file_set(o, build_path(icons[i % 13]), NULL); + evas_object_image_fill_set(o, 0, 0, ICON_SIZE, ICON_SIZE); + evas_object_resize(o, ICON_SIZE, ICON_SIZE); + evas_object_show(o); + + o = evas_object_text_add(evas); + o_texts[i] = o; + evas_object_text_font_set(o, "Vera-Bold", 10); + evas_object_text_text_set(o, icons[i % 13]); + evas_object_color_set(o, 0, 0, 0, 255); + evas_object_show(o); + } + done = 0; +} + +/* cleanup */ +static void _cleanup(void) +{ + int i; + for (i = 0; i < NUM; i++) evas_object_del(o_images[i]); + for (i = 0; i < NUM; i++) evas_object_del(o_texts[i]); +} + +/* loop - do things */ +static void _loop(double t, int f) +{ + int i; + Evas_Coord x, y, tw, th, cent; + x = 0; + y = 0 - f; + for (i = 0; i < NUM; i++) + { + evas_object_move(o_images[i], x + 8, y); + evas_object_geometry_get(o_texts[i], NULL, NULL, &tw, &th); + cent = (ICON_SIZE + 16 - tw) / 2; + evas_object_move(o_texts[i], x + cent, y + ICON_SIZE + 4); + x += ICON_SIZE + 16; + if (x > win_w) + { + x = 0; + y += ICON_SIZE + 16; + } + } + FPS_STD(NAME); +} + +/* prepend special key handlers if interactive (before STD) */ +static void _key(char *key) +{ + KEY_STD; +} + + + + + + + + + + + + +/* template stuff - ignore */ +# endif +#endif + +#ifdef UI +_ui_menu_item_add(ICON, NAME, FNAME); +#endif + +#ifdef PROTO +void FNAME(void); +#endif + +#ifndef PROTO +# ifndef UI +void FNAME(void) +{ + ui_func_set(_key, _loop); + _setup(); +} +# endif +#endif +#undef FNAME +#undef NAME +#undef ICON diff --git a/src/bin/widgets_list_1.c b/src/bin/widgets_list_1.c new file mode 100644 index 0000000..98a6296 --- /dev/null +++ b/src/bin/widgets_list_1.c @@ -0,0 +1,148 @@ +#undef FNAME +#undef NAME +#undef ICON + +/* metadata */ +#define FNAME widgets_list_1_start +#define NAME "Widgets List" +#define ICON "widgets.png" + +#ifndef PROTO +# ifndef UI +# include "main.h" + +/* standard var */ +static int done = 0; +/* private data */ +#define NUM 512 +#define ICON_SIZE 64 +static Evas_Object *o_images[NUM]; +static Evas_Object *o_texts[NUM]; + +static const char *labels[] = +{ + "Andrew", + "Alex", + "Amanda", + "Arthur", + "Astrid", + "Avery", + + "Beethoven", + "Billy", + "Bob", + "Bundy", + + "Candy", + "Carsten", + + "Danny", + "Dennis", + "Dirk", + "Doug", + + "Edmond", + "Erik", + + "Fernando", + "Frank", + "Frederick", + + "Gabby", + "George", + "Gilroy", + "Goodrich", + "Gumby", +}; + +/* setup */ +static void _setup(void) +{ + int i; + Evas_Object *o; + for (i = 0; i < NUM; i++) + { + o = evas_object_image_filled_add(evas); + o_images[i] = o; + evas_object_image_border_set(o, 2, 2, 2, 2); + evas_object_image_file_set(o, build_path("pan.png"), NULL); + evas_object_resize(o, win_w, ICON_SIZE); + evas_object_show(o); + + o = evas_object_text_add(evas); + o_texts[i] = o; + evas_object_text_font_set(o, "Vera-Bold", 10); + evas_object_text_text_set(o, labels[i % 26]); + evas_object_color_set(o, 0, 0, 0, 255); + evas_object_show(o); + } + done = 0; +} + +/* cleanup */ +static void _cleanup(void) +{ + int i; + for (i = 0; i < NUM; i++) evas_object_del(o_images[i]); + for (i = 0; i < NUM; i++) evas_object_del(o_texts[i]); +} + +/* loop - do things */ +static void _loop(double t, int f) +{ + int i; + Evas_Coord x, y, tw, th, cent; + x = 0; + y = 0 - f; + for (i = 0; i < NUM; i++) + { + evas_object_move(o_images[i], x, y); + evas_object_geometry_get(o_texts[i], NULL, NULL, &tw, &th); + cent = (ICON_SIZE - th) / 2; + evas_object_move(o_texts[i], x + 8, y + cent); + y += ICON_SIZE; + } + FPS_STD(NAME); +} + +/* prepend special key handlers if interactive (before STD) */ +static void _key(char *key) +{ + KEY_STD; +} + + + + + + + + + + + + +/* template stuff - ignore */ +# endif +#endif + +#ifdef UI +_ui_menu_item_add(ICON, NAME, FNAME); +#endif + +#ifdef PROTO +void FNAME(void); +#endif + +#ifndef PROTO +# ifndef UI +void FNAME(void) +{ + ui_func_set(_key, _loop); + _setup(); +} +# endif +#endif +#undef FNAME +#undef NAME +#undef ICON diff --git a/src/bin/widgets_list_1_grouped.c b/src/bin/widgets_list_1_grouped.c new file mode 100644 index 0000000..8117dbd --- /dev/null +++ b/src/bin/widgets_list_1_grouped.c @@ -0,0 +1,156 @@ +#undef FNAME +#undef NAME +#undef ICON + +/* metadata */ +#define FNAME widgets_list_1_grouped_start +#define NAME "Widgets List Grouped" +#define ICON "widgets.png" + +#ifndef PROTO +# ifndef UI +# include "main.h" + +/* standard var */ +static int done = 0; +/* private data */ +#define NUM 512 +#define ICON_SIZE 64 +static Evas_Object *o_images[NUM]; +static Evas_Object *o_texts[NUM]; + +static const char *labels[] = +{ + "Andrew", + "Alex", + "Amanda", + "Arthur", + "Astrid", + "Avery", + + "Beethoven", + "Billy", + "Bob", + "Bundy", + + "Candy", + "Carsten", + + "Danny", + "Dennis", + "Dirk", + "Doug", + + "Edmond", + "Erik", + + "Fernando", + "Frank", + "Frederick", + + "Gabby", + "George", + "Gilroy", + "Goodrich", + "Gumby", +}; + +/* setup */ +static void _setup(void) +{ + int i; + Evas_Object *o; + for (i = 0; i < NUM; i++) + { + o = evas_object_image_filled_add(evas); + o_images[i] = o; + evas_object_image_border_set(o, 2, 2, 2, 2); + evas_object_image_file_set(o, build_path("pan.png"), NULL); + evas_object_resize(o, win_w, ICON_SIZE); + evas_object_show(o); + + o = evas_object_text_add(evas); + o_texts[i] = o; + evas_object_text_font_set(o, "Vera-Bold", 10); + evas_object_text_text_set(o, labels[i % 26]); + evas_object_color_set(o, 0, 0, 0, 255); + evas_object_show(o); + } + for (i = 0; i < NUM; i++) + { + evas_object_raise(o_images[i]); + } + for (i = 0; i < NUM; i++) + { + evas_object_raise(o_texts[i]); + } + done = 0; +} + +/* cleanup */ +static void _cleanup(void) +{ + int i; + for (i = 0; i < NUM; i++) evas_object_del(o_images[i]); + for (i = 0; i < NUM; i++) evas_object_del(o_texts[i]); +} + +/* loop - do things */ +static void _loop(double t, int f) +{ + int i; + Evas_Coord x, y, tw, th, cent; + x = 0; + y = 0 - f; + for (i = 0; i < NUM; i++) + { + evas_object_move(o_images[i], x, y); + evas_object_geometry_get(o_texts[i], NULL, NULL, &tw, &th); + cent = (ICON_SIZE - th) / 2; + evas_object_move(o_texts[i], x + 8, y + cent); + y += ICON_SIZE; + } + FPS_STD(NAME); +} + +/* prepend special key handlers if interactive (before STD) */ +static void _key(char *key) +{ + KEY_STD; +} + + + + + + + + + + + + +/* template stuff - ignore */ +# endif +#endif + +#ifdef UI +_ui_menu_item_add(ICON, NAME, FNAME); +#endif + +#ifdef PROTO +void FNAME(void); +#endif + +#ifndef PROTO +# ifndef UI +void FNAME(void) +{ + ui_func_set(_key, _loop); + _setup(); +} +# endif +#endif +#undef FNAME +#undef NAME +#undef ICON diff --git a/src/bin/widgets_list_2.c b/src/bin/widgets_list_2.c new file mode 100644 index 0000000..4cd84e5 --- /dev/null +++ b/src/bin/widgets_list_2.c @@ -0,0 +1,148 @@ +#undef FNAME +#undef NAME +#undef ICON + +/* metadata */ +#define FNAME widgets_list_2_start +#define NAME "Widgets List 2" +#define ICON "widgets.png" + +#ifndef PROTO +# ifndef UI +# include "main.h" + +/* standard var */ +static int done = 0; +/* private data */ +#define NUM 512 +#define ICON_SIZE 32 +static Evas_Object *o_images[NUM]; +static Evas_Object *o_texts[NUM]; + +static const char *labels[] = +{ + "Andrew", + "Alex", + "Amanda", + "Arthur", + "Astrid", + "Avery", + + "Beethoven", + "Billy", + "Bob", + "Bundy", + + "Candy", + "Carsten", + + "Danny", + "Dennis", + "Dirk", + "Doug", + + "Edmond", + "Erik", + + "Fernando", + "Frank", + "Frederick", + + "Gabby", + "George", + "Gilroy", + "Goodrich", + "Gumby", +}; + +/* setup */ +static void _setup(void) +{ + int i; + Evas_Object *o; + for (i = 0; i < NUM; i++) + { + o = evas_object_image_filled_add(evas); + o_images[i] = o; + evas_object_image_border_set(o, 2, 2, 2, 2); + evas_object_image_file_set(o, build_path("pan.png"), NULL); + evas_object_resize(o, win_w, ICON_SIZE); + evas_object_show(o); + + o = evas_object_text_add(evas); + o_texts[i] = o; + evas_object_text_font_set(o, "Vera-Bold", 10); + evas_object_text_text_set(o, labels[i % 26]); + evas_object_color_set(o, 0, 0, 0, 255); + evas_object_show(o); + } + done = 0; +} + +/* cleanup */ +static void _cleanup(void) +{ + int i; + for (i = 0; i < NUM; i++) evas_object_del(o_images[i]); + for (i = 0; i < NUM; i++) evas_object_del(o_texts[i]); +} + +/* loop - do things */ +static void _loop(double t, int f) +{ + int i; + Evas_Coord x, y, tw, th, cent; + x = 0; + y = 0 - f; + for (i = 0; i < NUM; i++) + { + evas_object_move(o_images[i], x, y); + evas_object_geometry_get(o_texts[i], NULL, NULL, &tw, &th); + cent = (ICON_SIZE - th) / 2; + evas_object_move(o_texts[i], x + 8, y + cent); + y += ICON_SIZE; + } + FPS_STD(NAME); +} + +/* prepend special key handlers if interactive (before STD) */ +static void _key(char *key) +{ + KEY_STD; +} + + + + + + + + + + + + +/* template stuff - ignore */ +# endif +#endif + +#ifdef UI +_ui_menu_item_add(ICON, NAME, FNAME); +#endif + +#ifdef PROTO +void FNAME(void); +#endif + +#ifndef PROTO +# ifndef UI +void FNAME(void) +{ + ui_func_set(_key, _loop); + _setup(); +} +# endif +#endif +#undef FNAME +#undef NAME +#undef ICON diff --git a/src/bin/widgets_list_2_grouped.c b/src/bin/widgets_list_2_grouped.c new file mode 100644 index 0000000..ed3f0a0 --- /dev/null +++ b/src/bin/widgets_list_2_grouped.c @@ -0,0 +1,156 @@ +#undef FNAME +#undef NAME +#undef ICON + +/* metadata */ +#define FNAME widgets_list_2_grouped_start +#define NAME "Widgets List 2 Grouped" +#define ICON "widgets.png" + +#ifndef PROTO +# ifndef UI +# include "main.h" + +/* standard var */ +static int done = 0; +/* private data */ +#define NUM 512 +#define ICON_SIZE 64 +static Evas_Object *o_images[NUM]; +static Evas_Object *o_texts[NUM]; + +static const char *labels[] = +{ + "Andrew", + "Alex", + "Amanda", + "Arthur", + "Astrid", + "Avery", + + "Beethoven", + "Billy", + "Bob", + "Bundy", + + "Candy", + "Carsten", + + "Danny", + "Dennis", + "Dirk", + "Doug", + + "Edmond", + "Erik", + + "Fernando", + "Frank", + "Frederick", + + "Gabby", + "George", + "Gilroy", + "Goodrich", + "Gumby", +}; + +/* setup */ +static void _setup(void) +{ + int i; + Evas_Object *o; + for (i = 0; i < NUM; i++) + { + o = evas_object_image_filled_add(evas); + o_images[i] = o; + evas_object_image_border_set(o, 2, 2, 2, 2); + evas_object_image_file_set(o, build_path("pan.png"), NULL); + evas_object_resize(o, win_w, ICON_SIZE); + evas_object_show(o); + + o = evas_object_text_add(evas); + o_texts[i] = o; + evas_object_text_font_set(o, "Vera-Bold", 10); + evas_object_text_text_set(o, labels[i % 26]); + evas_object_color_set(o, 0, 0, 0, 255); + evas_object_show(o); + } + for (i = 0; i < NUM; i++) + { + evas_object_raise(o_images[i]); + } + for (i = 0; i < NUM; i++) + { + evas_object_raise(o_texts[i]); + } + done = 0; +} + +/* cleanup */ +static void _cleanup(void) +{ + int i; + for (i = 0; i < NUM; i++) evas_object_del(o_images[i]); + for (i = 0; i < NUM; i++) evas_object_del(o_texts[i]); +} + +/* loop - do things */ +static void _loop(double t, int f) +{ + int i; + Evas_Coord x, y, tw, th, cent; + x = 0; + y = 0 - f; + for (i = 0; i < NUM; i++) + { + evas_object_move(o_images[i], x, y); + evas_object_geometry_get(o_texts[i], NULL, NULL, &tw, &th); + cent = (ICON_SIZE - th) / 2; + evas_object_move(o_texts[i], x + 8, y + cent); + y += ICON_SIZE; + } + FPS_STD(NAME); +} + +/* prepend special key handlers if interactive (before STD) */ +static void _key(char *key) +{ + KEY_STD; +} + + + + + + + + + + + + +/* template stuff - ignore */ +# endif +#endif + +#ifdef UI +_ui_menu_item_add(ICON, NAME, FNAME); +#endif + +#ifdef PROTO +void FNAME(void); +#endif + +#ifndef PROTO +# ifndef UI +void FNAME(void) +{ + ui_func_set(_key, _loop); + _setup(); +} +# endif +#endif +#undef FNAME +#undef NAME +#undef ICON diff --git a/src/bin/widgets_list_3.c b/src/bin/widgets_list_3.c new file mode 100644 index 0000000..bc75d8f --- /dev/null +++ b/src/bin/widgets_list_3.c @@ -0,0 +1,178 @@ +#undef FNAME +#undef NAME +#undef ICON + +/* metadata */ +#define FNAME widgets_list_3_start +#define NAME "Widgets List 3" +#define ICON "widgets.png" + +#ifndef PROTO +# ifndef UI +# include "main.h" + +/* standard var */ +static int done = 0; +/* private data */ +#define NUM 512 +#define ICON_SIZE 64 +static Evas_Object *o_images[NUM]; +static Evas_Object *o_icons[NUM]; +static Evas_Object *o_texts[NUM]; + +static const char *icons[] = +{ + "bug.png", + "bulb.png", + "camera.png", + "colorbox.png", + + "e.png", + "error.png", + "flower.png", + "house.png", + + "mushroom.png", + "pulse.png", + "typewriter.png", + "warning.png", + + "watch.png" +}; + +static const char *labels[] = +{ + "Andrew", + "Alex", + "Amanda", + "Arthur", + "Astrid", + "Avery", + + "Beethoven", + "Billy", + "Bob", + "Bundy", + + "Candy", + "Carsten", + + "Danny", + "Dennis", + "Dirk", + "Doug", + + "Edmond", + "Erik", + + "Fernando", + "Frank", + "Frederick", + + "Gabby", + "George", + "Gilroy", + "Goodrich", + "Gumby", +}; + +/* setup */ +static void _setup(void) +{ + int i; + Evas_Object *o; + for (i = 0; i < NUM; i++) + { + o = evas_object_image_filled_add(evas); + o_images[i] = o; + evas_object_image_border_set(o, 2, 2, 2, 2); + evas_object_image_file_set(o, build_path("pan.png"), NULL); + evas_object_resize(o, win_w, ICON_SIZE); + evas_object_show(o); + + o = evas_object_image_filled_add(evas); + o_icons[i] = o; + evas_object_image_border_set(o, 2, 2, 2, 2); + evas_object_image_file_set(o, build_path(icons[i % 13]), NULL); + evas_object_resize(o, ICON_SIZE - 8, ICON_SIZE - 8); + evas_object_show(o); + + o = evas_object_text_add(evas); + o_texts[i] = o; + evas_object_text_font_set(o, "Vera-Bold", 10); + evas_object_text_text_set(o, labels[i % 26]); + evas_object_color_set(o, 0, 0, 0, 255); + evas_object_show(o); + } + done = 0; +} + +/* cleanup */ +static void _cleanup(void) +{ + int i; + for (i = 0; i < NUM; i++) evas_object_del(o_images[i]); + for (i = 0; i < NUM; i++) evas_object_del(o_icons[i]); + for (i = 0; i < NUM; i++) evas_object_del(o_texts[i]); +} + +/* loop - do things */ +static void _loop(double t, int f) +{ + int i; + Evas_Coord x, y, tw, th, cent; + x = 0; + y = 0 - f; + for (i = 0; i < NUM; i++) + { + evas_object_move(o_images[i], x, y); + evas_object_move(o_icons[i], x + 4, y + 4); + evas_object_geometry_get(o_texts[i], NULL, NULL, &tw, &th); + cent = (ICON_SIZE - th) / 2; + evas_object_move(o_texts[i], x + 8 + ICON_SIZE + 8, y + cent); + y += ICON_SIZE; + } + FPS_STD(NAME); +} + +/* prepend special key handlers if interactive (before STD) */ +static void _key(char *key) +{ + KEY_STD; +} + + + + + + + + + + + + +/* template stuff - ignore */ +# endif +#endif + +#ifdef UI +_ui_menu_item_add(ICON, NAME, FNAME); +#endif + +#ifdef PROTO +void FNAME(void); +#endif + +#ifndef PROTO +# ifndef UI +void FNAME(void) +{ + ui_func_set(_key, _loop); + _setup(); +} +# endif +#endif +#undef FNAME +#undef NAME +#undef ICON diff --git a/src/bin/widgets_list_3_grouped.c b/src/bin/widgets_list_3_grouped.c new file mode 100644 index 0000000..82ad974 --- /dev/null +++ b/src/bin/widgets_list_3_grouped.c @@ -0,0 +1,194 @@ +#undef FNAME +#undef NAME +#undef ICON + +/* metadata */ +#define FNAME widgets_list_3_grouped_start +#define NAME "Widgets List 3 Grouped" +#define ICON "widgets.png" + +#ifndef PROTO +# ifndef UI +# include "main.h" + +/* standard var */ +static int done = 0; +/* private data */ +#define NUM 512 +#define ICON_SIZE 64 +static Evas_Object *o_images[NUM]; +static Evas_Object *o_icons[NUM]; +static Evas_Object *o_texts[NUM]; + +static const char *icons[] = +{ + "bug.png", + "bulb.png", + "camera.png", + "colorbox.png", + + "e.png", + "error.png", + "flower.png", + "house.png", + + "mushroom.png", + "pulse.png", + "typewriter.png", + "warning.png", + + "watch.png" +}; + +static const char *labels[] = +{ + "Andrew", + "Alex", + "Amanda", + "Arthur", + "Astrid", + "Avery", + + "Beethoven", + "Billy", + "Bob", + "Bundy", + + "Candy", + "Carsten", + + "Danny", + "Dennis", + "Dirk", + "Doug", + + "Edmond", + "Erik", + + "Fernando", + "Frank", + "Frederick", + + "Gabby", + "George", + "Gilroy", + "Goodrich", + "Gumby", +}; + +/* setup */ +static void _setup(void) +{ + int i; + Evas_Object *o; + for (i = 0; i < NUM; i++) + { + o = evas_object_image_filled_add(evas); + o_images[i] = o; + evas_object_image_border_set(o, 2, 2, 2, 2); + evas_object_image_file_set(o, build_path("pan.png"), NULL); + evas_object_resize(o, win_w, ICON_SIZE); + evas_object_show(o); + + o = evas_object_image_filled_add(evas); + o_icons[i] = o; + evas_object_image_border_set(o, 2, 2, 2, 2); + evas_object_image_file_set(o, build_path(icons[i % 13]), NULL); + evas_object_resize(o, ICON_SIZE - 8, ICON_SIZE - 8); + evas_object_show(o); + + o = evas_object_text_add(evas); + o_texts[i] = o; + evas_object_text_font_set(o, "Vera-Bold", 10); + evas_object_text_text_set(o, labels[i % 26]); + evas_object_color_set(o, 0, 0, 0, 255); + evas_object_show(o); + } + for (i = 0; i < NUM; i++) + { + evas_object_raise(o_images[i]); + } + for (i = 0; i < NUM; i++) + { + evas_object_raise(o_icons[i]); + } + for (i = 0; i < NUM; i++) + { + if (i > 13) evas_object_stack_above(o_icons[i], o_icons[i - 13]); + } + for (i = 0; i < NUM; i++) + { + evas_object_raise(o_texts[i]); + } + done = 0; +} + +/* cleanup */ +static void _cleanup(void) +{ + int i; + for (i = 0; i < NUM; i++) evas_object_del(o_images[i]); + for (i = 0; i < NUM; i++) evas_object_del(o_icons[i]); + for (i = 0; i < NUM; i++) evas_object_del(o_texts[i]); +} + +/* loop - do things */ +static void _loop(double t, int f) +{ + int i; + Evas_Coord x, y, tw, th, cent; + x = 0; + y = 0 - f; + for (i = 0; i < NUM; i++) + { + evas_object_move(o_images[i], x, y); + evas_object_move(o_icons[i], x + 4, y + 4); + evas_object_geometry_get(o_texts[i], NULL, NULL, &tw, &th); + cent = (ICON_SIZE - th) / 2; + evas_object_move(o_texts[i], x + 8 + ICON_SIZE + 8, y + cent); + y += ICON_SIZE; + } + FPS_STD(NAME); +} + +/* prepend special key handlers if interactive (before STD) */ +static void _key(char *key) +{ + KEY_STD; +} + + + + + + + + + + + + +/* template stuff - ignore */ +# endif +#endif + +#ifdef UI +_ui_menu_item_add(ICON, NAME, FNAME); +#endif + +#ifdef PROTO +void FNAME(void); +#endif + +#ifndef PROTO +# ifndef UI +void FNAME(void) +{ + ui_func_set(_key, _loop); + _setup(); +} +# endif +#endif +#undef FNAME +#undef NAME +#undef ICON diff --git a/src/bin/widgets_list_4.c b/src/bin/widgets_list_4.c new file mode 100644 index 0000000..ca30a93 --- /dev/null +++ b/src/bin/widgets_list_4.c @@ -0,0 +1,178 @@ +#undef FNAME +#undef NAME +#undef ICON + +/* metadata */ +#define FNAME widgets_list_4_start +#define NAME "Widgets List 4" +#define ICON "widgets.png" + +#ifndef PROTO +# ifndef UI +# include "main.h" + +/* standard var */ +static int done = 0; +/* private data */ +#define NUM 512 +#define ICON_SIZE 32 +static Evas_Object *o_images[NUM]; +static Evas_Object *o_icons[NUM]; +static Evas_Object *o_texts[NUM]; + +static const char *icons[] = +{ + "bug.png", + "bulb.png", + "camera.png", + "colorbox.png", + + "e.png", + "error.png", + "flower.png", + "house.png", + + "mushroom.png", + "pulse.png", + "typewriter.png", + "warning.png", + + "watch.png" +}; + +static const char *labels[] = +{ + "Andrew", + "Alex", + "Amanda", + "Arthur", + "Astrid", + "Avery", + + "Beethoven", + "Billy", + "Bob", + "Bundy", + + "Candy", + "Carsten", + + "Danny", + "Dennis", + "Dirk", + "Doug", + + "Edmond", + "Erik", + + "Fernando", + "Frank", + "Frederick", + + "Gabby", + "George", + "Gilroy", + "Goodrich", + "Gumby", +}; + +/* setup */ +static void _setup(void) +{ + int i; + Evas_Object *o; + for (i = 0; i < NUM; i++) + { + o = evas_object_image_filled_add(evas); + o_images[i] = o; + evas_object_image_border_set(o, 2, 2, 2, 2); + evas_object_image_file_set(o, build_path("pan.png"), NULL); + evas_object_resize(o, win_w, ICON_SIZE); + evas_object_show(o); + + o = evas_object_image_filled_add(evas); + o_icons[i] = o; + evas_object_image_border_set(o, 2, 2, 2, 2); + evas_object_image_file_set(o, build_path(icons[i % 13]), NULL); + evas_object_resize(o, ICON_SIZE - 8, ICON_SIZE - 8); + evas_object_show(o); + + o = evas_object_text_add(evas); + o_texts[i] = o; + evas_object_text_font_set(o, "Vera-Bold", 10); + evas_object_text_text_set(o, labels[i % 26]); + evas_object_color_set(o, 0, 0, 0, 255); + evas_object_show(o); + } + done = 0; +} + +/* cleanup */ +static void _cleanup(void) +{ + int i; + for (i = 0; i < NUM; i++) evas_object_del(o_images[i]); + for (i = 0; i < NUM; i++) evas_object_del(o_icons[i]); + for (i = 0; i < NUM; i++) evas_object_del(o_texts[i]); +} + +/* loop - do things */ +static void _loop(double t, int f) +{ + int i; + Evas_Coord x, y, tw, th, cent; + x = 0; + y = 0 - f; + for (i = 0; i < NUM; i++) + { + evas_object_move(o_images[i], x, y); + evas_object_move(o_icons[i], x + 4, y + 4); + evas_object_geometry_get(o_texts[i], NULL, NULL, &tw, &th); + cent = (ICON_SIZE - th) / 2; + evas_object_move(o_texts[i], x + 8 + ICON_SIZE + 8, y + cent); + y += ICON_SIZE; + } + FPS_STD(NAME); +} + +/* prepend special key handlers if interactive (before STD) */ +static void _key(char *key) +{ + KEY_STD; +} + + + + + + + + + + + + +/* template stuff - ignore */ +# endif +#endif + +#ifdef UI +_ui_menu_item_add(ICON, NAME, FNAME); +#endif + +#ifdef PROTO +void FNAME(void); +#endif + +#ifndef PROTO +# ifndef UI +void FNAME(void) +{ + ui_func_set(_key, _loop); + _setup(); +} +# endif +#endif +#undef FNAME +#undef NAME +#undef ICON diff --git a/src/bin/widgets_list_4_grouped.c b/src/bin/widgets_list_4_grouped.c new file mode 100644 index 0000000..42108a4 --- /dev/null +++ b/src/bin/widgets_list_4_grouped.c @@ -0,0 +1,194 @@ +#undef FNAME +#undef NAME +#undef ICON + +/* metadata */ +#define FNAME widgets_list_4_grouped_start +#define NAME "Widgets List 4 Grouped" +#define ICON "widgets.png" + +#ifndef PROTO +# ifndef UI +# include "main.h" + +/* standard var */ +static int done = 0; +/* private data */ +#define NUM 512 +#define ICON_SIZE 32 +static Evas_Object *o_images[NUM]; +static Evas_Object *o_icons[NUM]; +static Evas_Object *o_texts[NUM]; + +static const char *icons[] = +{ + "bug.png", + "bulb.png", + "camera.png", + "colorbox.png", + + "e.png", + "error.png", + "flower.png", + "house.png", + + "mushroom.png", + "pulse.png", + "typewriter.png", + "warning.png", + + "watch.png" +}; + +static const char *labels[] = +{ + "Andrew", + "Alex", + "Amanda", + "Arthur", + "Astrid", + "Avery", + + "Beethoven", + "Billy", + "Bob", + "Bundy", + + "Candy", + "Carsten", + + "Danny", + "Dennis", + "Dirk", + "Doug", + + "Edmond", + "Erik", + + "Fernando", + "Frank", + "Frederick", + + "Gabby", + "George", + "Gilroy", + "Goodrich", + "Gumby", +}; + +/* setup */ +static void _setup(void) +{ + int i; + Evas_Object *o; + for (i = 0; i < NUM; i++) + { + o = evas_object_image_filled_add(evas); + o_images[i] = o; + evas_object_image_border_set(o, 2, 2, 2, 2); + evas_object_image_file_set(o, build_path("pan.png"), NULL); + evas_object_resize(o, win_w, ICON_SIZE); + evas_object_show(o); + + o = evas_object_image_filled_add(evas); + o_icons[i] = o; + evas_object_image_border_set(o, 2, 2, 2, 2); + evas_object_image_file_set(o, build_path(icons[i % 13]), NULL); + evas_object_resize(o, ICON_SIZE - 8, ICON_SIZE - 8); + evas_object_show(o); + + o = evas_object_text_add(evas); + o_texts[i] = o; + evas_object_text_font_set(o, "Vera-Bold", 10); + evas_object_text_text_set(o, labels[i % 26]); + evas_object_color_set(o, 0, 0, 0, 255); + evas_object_show(o); + } + for (i = 0; i < NUM; i++) + { + evas_object_raise(o_images[i]); + } + for (i = 0; i < NUM; i++) + { + evas_object_raise(o_icons[i]); + } + for (i = 0; i < NUM; i++) + { + if (i > 13) evas_object_stack_above(o_icons[i], o_icons[i - 13]); + } + for (i = 0; i < NUM; i++) + { + evas_object_raise(o_texts[i]); + } + done = 0; +} + +/* cleanup */ +static void _cleanup(void) +{ + int i; + for (i = 0; i < NUM; i++) evas_object_del(o_images[i]); + for (i = 0; i < NUM; i++) evas_object_del(o_icons[i]); + for (i = 0; i < NUM; i++) evas_object_del(o_texts[i]); +} + +/* loop - do things */ +static void _loop(double t, int f) +{ + int i; + Evas_Coord x, y, tw, th, cent; + x = 0; + y = 0 - f; + for (i = 0; i < NUM; i++) + { + evas_object_move(o_images[i], x, y); + evas_object_move(o_icons[i], x + 4, y + 4); + evas_object_geometry_get(o_texts[i], NULL, NULL, &tw, &th); + cent = (ICON_SIZE - th) / 2; + evas_object_move(o_texts[i], x + 8 + ICON_SIZE + 8, y + cent); + y += ICON_SIZE; + } + FPS_STD(NAME); +} + +/* prepend special key handlers if interactive (before STD) */ +static void _key(char *key) +{ + KEY_STD; +} + + + + + + + + + + + + +/* template stuff - ignore */ +# endif +#endif + +#ifdef UI +_ui_menu_item_add(ICON, NAME, FNAME); +#endif + +#ifdef PROTO +void FNAME(void); +#endif + +#ifndef PROTO +# ifndef UI +void FNAME(void) +{ + ui_func_set(_key, _loop); + _setup(); +} +# endif +#endif +#undef FNAME +#undef NAME +#undef ICON diff --git a/win32/set_env.bat b/win32/set_env.bat new file mode 100644 index 0000000..cd053ee --- /dev/null +++ b/win32/set_env.bat @@ -0,0 +1,51 @@ +@echo off + +rem Set external libraries directory. +set EXT_DIR=%cd%\..\..\..\extern + +if not exist %EXT_DIR% ( + set EXT_DIR= + echo ERROR: External libs dir is not set. + pause + goto END +) + +rem Add installation directory pathes. +set INCLUDE=%EXT_DIR%\include;%INCLUDE% +set LIB=%EXT_DIR%\lib;%LIB% + +rem Add Evil lib path +set EvilInclude=%cd%\..\..\evil\src\lib +set EvilCommon=%cd%\..\..\evil\win32\common +set EvilOut=%cd%\..\..\evil\win32\%PROJECT_TYPE%\out + +rem Add Evas lib path +set EvasOut=%cd%\..\..\evas\win32\%PROJECT_TYPE%\out +set EvasDirect3DInclude=%cd%\..\..\evas\src\modules\engines\direct3d +set EvasGLGlewInclude=%cd%\..\..\evas\src\modules\engines\gl_glew +set EvasDDrawInclude=%cd%\..\..\evas\src\modules\engines\software_ddraw +set EvasGDIInclude=%cd%\..\..\evas\src\modules\engines\software_gdi +set EvasInclude=%EvasGDIInclude%;%EvasDDrawInclude%;%EvasGLGlewInclude%;%EvasDirect3DInclude%;%cd%\..\..\evas\src\lib + +rem Add Eina lib path +set EinaInclude=%cd%\..\..\eina\src\include +set EinaCommon=%cd%\..\..\eina\win32\common +set EinaOut=%cd%\..\..\eina\win32\%PROJECT_TYPE%\out + + +set INCLUDE=%EvasInclude%;%EvilCommon%;%EvilInclude%;%EvilInclude%\dlfcn;%EvilInclude%\mman;%INCLUDE% +set INCLUDE=%EinaCommon%;%EinaInclude%;%INCLUDE% +set LIB=%EinaOut%;%EvasOut%;%EvilOut%;%LIB% + +if "%DXSDK_DIR%" == "" ( + echo WARNING: Microsoft DirectX SDK is not installed. + pause + goto END +) + +rem Add DirectX includes and libraries dirs. +set INCLUDE="%DXSDK_DIR%Include";%INCLUDE% +set LIB="%DXSDK_DIR%Lib\x86";%LIB% + + +:END diff --git a/win32/vs8/expedite.sln b/win32/vs8/expedite.sln new file mode 100644 index 0000000..87210b6 --- /dev/null +++ b/win32/vs8/expedite.sln @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "expedite", "expedite.vcproj", "{5C640EA7-6E65-46FF-A1FE-EB0955B0CC5A}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {5C640EA7-6E65-46FF-A1FE-EB0955B0CC5A}.Debug|Win32.ActiveCfg = Debug|Win32 + {5C640EA7-6E65-46FF-A1FE-EB0955B0CC5A}.Debug|Win32.Build.0 = Debug|Win32 + {5C640EA7-6E65-46FF-A1FE-EB0955B0CC5A}.Release|Win32.ActiveCfg = Release|Win32 + {5C640EA7-6E65-46FF-A1FE-EB0955B0CC5A}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/win32/vs8/expedite.vcproj b/win32/vs8/expedite.vcproj new file mode 100644 index 0000000..d98798b --- /dev/null +++ b/win32/vs8/expedite.vcproj @@ -0,0 +1,821 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/win32/vs8/out/run.bat b/win32/vs8/out/run.bat new file mode 100644 index 0000000..3681b06 --- /dev/null +++ b/win32/vs8/out/run.bat @@ -0,0 +1,2 @@ +set EVAS_MODULES_DIR=%cd% +start expedite.exe -datadir ..\..\..\data -e direct3d \ No newline at end of file diff --git a/win32/vs8/out/update_deps.bat b/win32/vs8/out/update_deps.bat new file mode 100644 index 0000000..978dece --- /dev/null +++ b/win32/vs8/out/update_deps.bat @@ -0,0 +1,42 @@ +@echo off + +set Target=%cd% +set e17=%cd%\..\..\..\.. +set Libs=%e17% +set Proto=%e17%\proto +set Extern=%e17%\..\..\extern + +rem Copy externals +cd %Extern%\bin +xcopy freetype6.dll %Target%\ /Q /Y +xcopy jpeg62.dll %Target%\ /Q /Y +xcopy zlib1.dll %Target%\ /Q /Y +xcopy glew32.dll %Target%\ /Q /Y + +rem Copy proto +cd %Proto%\evil\win32\vs8\out +xcopy libdl.dll %Target%\ /Q /Y +xcopy libevil.dll %Target%\ /Q /Y +xcopy libmman.dll %Target%\ /Q /Y + +rem Copy libs +cd %Libs%\eina\win32\vs8\out +xcopy eina.dll %Target%\ /Q /Y + +cd %Libs%\eet\win32\vs8\out +xcopy libeet.dll %Target%\ /Q /Y + +cd %Libs%\evas\win32\vs8\out +xcopy libevas.dll %Target%\ /Q /Y + +set Modules=%Libs%\evas\win32\vs8\out\modules +cd %Modules%\engines\direct3d +xcopy module.dll %Target%\evas\modules\engines\direct3d\mingw32-i686\ /Q /Y +cd %Modules%\engines\software_ddraw +xcopy module.dll %Target%\evas\modules\engines\software_ddraw\mingw32-i686\ /Q /Y +cd %Modules%\engines\software_generic +xcopy module.dll %Target%\evas\modules\engines\software_generic\mingw32-i686\ /Q /Y +cd %Modules%\engines\gl_glew +xcopy module.dll %Target%\evas\modules\engines\gl_glew\mingw32-i686\ /Q /Y +cd %Modules%\loaders\png +xcopy module.dll %Target%\evas\modules\loaders\png\mingw32-i686\ /Q /Y diff --git a/win32/vs8/start.bat b/win32/vs8/start.bat new file mode 100644 index 0000000..2d442c4 --- /dev/null +++ b/win32/vs8/start.bat @@ -0,0 +1,35 @@ +@echo off +rem Warning: environment is set for Win32 platform. + +set PROJECT_TYPE=vs8 + +pushd .. +call set_env.bat +popd + +if "%EXT_DIR%" == "" goto END + +rem Setup common Win32 environment variables + +set SolutionDirectory=%cd% +set DebugOutputDirectory=%SolutionDirectory%\out +set ReleaseOutputDirectory=%SolutionDirectory%\out +set DebugLibraryDirectory=%SolutionDirectory%\out +set ReleaseLibraryDirectory=%SolutionDirectory%\out +set TemporaryDirectory=%SolutionDirectory%\temp + +rem Check for basic requirements +if "%VS80COMNTOOLS%" == "" ( + echo ERROR: Microsoft Visual Studio 2005 is not installed. + pause + goto END +) + +rem Setting environment for using Microsoft Visual Studio 2005 x86 tools. +call "%VS80COMNTOOLS%vsvars32.bat" + +set EVAS_MODULES_DIR=%cd%\out + +expedite.sln + +:END \ No newline at end of file