Compare commits
15 Commits
master
...
expedite-1
Author | SHA1 | Date |
---|---|---|
Eduardo Lima (Etrunko) | b5558f8b29 | |
Eduardo Lima (Etrunko) | 16aadf578f | |
Eduardo Lima (Etrunko) | 98b23b664a | |
Rafael Antognolli | a5c3c82e53 | |
Rafael Antognolli | bd65e4b415 | |
Rafael Antognolli | 9793db1375 | |
Rafael Antognolli | a4cef966e1 | |
Luis Felipe Strano Moraes | 1fc2bc49c3 | |
Luis Felipe Strano Moraes | 545dc7f200 | |
Luis Felipe Strano Moraes | 4e2a85eeb1 | |
Luis Felipe Strano Moraes | 04e0658749 | |
Luis Felipe Strano Moraes | 59c825def7 | |
Luis Felipe Strano Moraes | 1e96d87971 | |
Cedric BAIL | f616302b6a | |
Vincent Torri | 32e63261ba |
|
@ -1,6 +0,0 @@
|
|||
{
|
||||
"project_id" : "expedite",
|
||||
"projects" : "expedite",
|
||||
"conduit_uri" : "https://phab.enlightenment.org/",
|
||||
"phabricator.uri" : "https://phab.enlightenment.org/"
|
||||
}
|
|
@ -17,7 +17,6 @@ configure
|
|||
data/Makefile
|
||||
data/Makefile.in
|
||||
depcomp
|
||||
expedite.spec
|
||||
install-sh
|
||||
ltmain.sh
|
||||
m4/libtool.m4
|
||||
|
|
4
AUTHORS
4
AUTHORS
|
@ -3,6 +3,4 @@ Tim Horton <hortont424@gmail.com>
|
|||
Saumsung Electronics <tbd>
|
||||
Samsung SAIT <tbd>
|
||||
Bruno Tarquini <btarquini@gmail.com>
|
||||
Hermet Park <hermetpark@gmail.com>
|
||||
Eduardo Lima (Etrunko) <eblima@gmail.com>
|
||||
JaEun Choi <jaeun12.choi@samsung.com>
|
||||
ChunEon Park (Hermet) <hermet@hermet.pe.kr>
|
||||
|
|
48
ChangeLog
48
ChangeLog
|
@ -1,10 +1,10 @@
|
|||
2011-12-02 Carsten Haitzler (The Rasterman)
|
||||
2011-12-02 Carsten Haitzler (The Rasterman)
|
||||
|
||||
* 1.1.0 release
|
||||
1.1.0 release
|
||||
|
||||
2012-04-26 Carsten Haitzler (The Rasterman)
|
||||
|
||||
* 1.2.0 release
|
||||
1.2.0 release
|
||||
|
||||
2012-05-02 Cedric Bail
|
||||
|
||||
|
@ -12,28 +12,44 @@
|
|||
|
||||
2012-08-30 Carsten Haitzler (The Rasterman)
|
||||
|
||||
* 1.7.0 release
|
||||
1.7.0 release
|
||||
|
||||
2012-10-24 Eduardo Lima (Etrunko)
|
||||
2012-10-20 Cedric Bail
|
||||
|
||||
* Remove support fox software_16_x11
|
||||
1.7.1 release
|
||||
|
||||
2012-11-01 Eduardo Lima (Etrunko)
|
||||
2012-11-23 Luis Felipe Strano Moraes
|
||||
|
||||
* Added basic support for wayland engines
|
||||
1.7.2 release
|
||||
|
||||
2012-11-16 Eduardo Lima (Etrunko)
|
||||
2012-12-07 Luis Felipe Strano Moraes
|
||||
|
||||
* Keyboard Support for Wayland EGL
|
||||
* 1.7.3 release
|
||||
|
||||
2012-11-21 Eduardo Lima (Etrunko)
|
||||
2012-12-21 Luis Felipe Strano Moraes
|
||||
|
||||
* Keyboard Support for Wayland SHM
|
||||
* 1.7.4 release
|
||||
|
||||
2013-01-23 Yakov Goldberg
|
||||
2013-01-04 Luis Felipe Strano Moraes
|
||||
|
||||
* Porting to Eo
|
||||
* 1.7.5 release
|
||||
|
||||
2013-02-18 Cedric Bail
|
||||
2013-04-04 Rafael Antognolli
|
||||
|
||||
* Test and benchmark lines.
|
||||
* 1.7.6 release
|
||||
|
||||
2013-05-11 Rafael Antognolli
|
||||
|
||||
* 1.7.7 release
|
||||
|
||||
2013-08-02 Eduardo Lima (Etrunko)
|
||||
|
||||
* 1.7.8 release
|
||||
|
||||
2013-09-10 Eduardo Lima (Etrunko)
|
||||
|
||||
* 1.7.9 release
|
||||
|
||||
2013-12-05 Eduardo Lima (Etrunko)
|
||||
|
||||
* 1.7.10 release
|
||||
|
|
372
INSTALL
372
INSTALL
|
@ -1,368 +1,14 @@
|
|||
Installation Instructions
|
||||
*************************
|
||||
COMPILING and INSTALLING:
|
||||
|
||||
Copyright (C) 1994-1996, 1999-2002, 2004-2016 Free Software
|
||||
Foundation, Inc.
|
||||
If you got a official release tar archive do:
|
||||
./configure
|
||||
|
||||
Copying and distribution of this file, with or without modification,
|
||||
are permitted in any medium without royalty provided the copyright
|
||||
notice and this notice are preserved. This file is offered as-is,
|
||||
without warranty of any kind.
|
||||
( otherwise if you got this from enlightenment cvs do: ./autogen.sh )
|
||||
|
||||
Basic Installation
|
||||
==================
|
||||
Then to compile:
|
||||
make
|
||||
|
||||
Briefly, the shell command './configure && make && make install'
|
||||
should configure, build, and install this package. The following
|
||||
more-detailed instructions are generic; see the 'README' file for
|
||||
instructions specific to this package. Some packages provide this
|
||||
'INSTALL' file but do not implement all of the features documented
|
||||
below. The lack of an optional feature in a given package is not
|
||||
necessarily a bug. More recommendations for GNU packages can be found
|
||||
in *note Makefile Conventions: (standards)Makefile Conventions.
|
||||
To install (run this as root, or the user who handles installs):
|
||||
make install
|
||||
|
||||
The 'configure' shell script attempts to guess correct values for
|
||||
various system-dependent variables used during compilation. It uses
|
||||
those values to create a 'Makefile' in each directory of the package.
|
||||
It may also create one or more '.h' files containing system-dependent
|
||||
definitions. Finally, it creates a shell script 'config.status' that
|
||||
you can run in the future to recreate the current configuration, and a
|
||||
file 'config.log' containing compiler output (useful mainly for
|
||||
debugging 'configure').
|
||||
|
||||
It can also use an optional file (typically called 'config.cache' and
|
||||
enabled with '--cache-file=config.cache' or simply '-C') that saves the
|
||||
results of its tests to speed up reconfiguring. Caching is disabled by
|
||||
default to prevent problems with accidental use of stale cache files.
|
||||
|
||||
If you need to do unusual things to compile the package, please try
|
||||
to figure out how 'configure' could check whether to do them, and mail
|
||||
diffs or instructions to the address given in the 'README' so they can
|
||||
be considered for the next release. If you are using the cache, and at
|
||||
some point 'config.cache' contains results you don't want to keep, you
|
||||
may remove or edit it.
|
||||
|
||||
The file 'configure.ac' (or 'configure.in') is used to create
|
||||
'configure' by a program called 'autoconf'. You need 'configure.ac' if
|
||||
you want to change it or regenerate 'configure' using a newer version of
|
||||
'autoconf'.
|
||||
|
||||
The simplest way to compile this package is:
|
||||
|
||||
1. 'cd' to the directory containing the package's source code and type
|
||||
'./configure' to configure the package for your system.
|
||||
|
||||
Running 'configure' might take a while. While running, it prints
|
||||
some messages telling which features it is checking for.
|
||||
|
||||
2. Type 'make' to compile the package.
|
||||
|
||||
3. Optionally, type 'make check' to run any self-tests that come with
|
||||
the package, generally using the just-built uninstalled binaries.
|
||||
|
||||
4. Type 'make install' to install the programs and any data files and
|
||||
documentation. When installing into a prefix owned by root, it is
|
||||
recommended that the package be configured and built as a regular
|
||||
user, and only the 'make install' phase executed with root
|
||||
privileges.
|
||||
|
||||
5. Optionally, type 'make installcheck' to repeat any self-tests, but
|
||||
this time using the binaries in their final installed location.
|
||||
This target does not install anything. Running this target as a
|
||||
regular user, particularly if the prior 'make install' required
|
||||
root privileges, verifies that the installation completed
|
||||
correctly.
|
||||
|
||||
6. You can remove the program binaries and object files from the
|
||||
source code directory by typing 'make clean'. To also remove the
|
||||
files that 'configure' created (so you can compile the package for
|
||||
a different kind of computer), type 'make distclean'. There is
|
||||
also a 'make maintainer-clean' target, but that is intended mainly
|
||||
for the package's developers. If you use it, you may have to get
|
||||
all sorts of other programs in order to regenerate files that came
|
||||
with the distribution.
|
||||
|
||||
7. Often, you can also type 'make uninstall' to remove the installed
|
||||
files again. In practice, not all packages have tested that
|
||||
uninstallation works correctly, even though it is required by the
|
||||
GNU Coding Standards.
|
||||
|
||||
8. Some packages, particularly those that use Automake, provide 'make
|
||||
distcheck', which can by used by developers to test that all other
|
||||
targets like 'make install' and 'make uninstall' work correctly.
|
||||
This target is generally not run by end users.
|
||||
|
||||
Compilers and Options
|
||||
=====================
|
||||
|
||||
Some systems require unusual options for compilation or linking that
|
||||
the 'configure' script does not know about. Run './configure --help'
|
||||
for details on some of the pertinent environment variables.
|
||||
|
||||
You can give 'configure' initial values for configuration parameters
|
||||
by setting variables in the command line or in the environment. Here is
|
||||
an example:
|
||||
|
||||
./configure CC=c99 CFLAGS=-g LIBS=-lposix
|
||||
|
||||
*Note Defining Variables::, for more details.
|
||||
|
||||
Compiling For Multiple Architectures
|
||||
====================================
|
||||
|
||||
You can compile the package for more than one kind of computer at the
|
||||
same time, by placing the object files for each architecture in their
|
||||
own directory. To do this, you can use GNU 'make'. 'cd' to the
|
||||
directory where you want the object files and executables to go and run
|
||||
the 'configure' script. 'configure' automatically checks for the source
|
||||
code in the directory that 'configure' is in and in '..'. This is known
|
||||
as a "VPATH" build.
|
||||
|
||||
With a non-GNU 'make', it is safer to compile the package for one
|
||||
architecture at a time in the source code directory. After you have
|
||||
installed the package for one architecture, use 'make distclean' before
|
||||
reconfiguring for another architecture.
|
||||
|
||||
On MacOS X 10.5 and later systems, you can create libraries and
|
||||
executables that work on multiple system types--known as "fat" or
|
||||
"universal" binaries--by specifying multiple '-arch' options to the
|
||||
compiler but only a single '-arch' option to the preprocessor. Like
|
||||
this:
|
||||
|
||||
./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
|
||||
CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
|
||||
CPP="gcc -E" CXXCPP="g++ -E"
|
||||
|
||||
This is not guaranteed to produce working output in all cases, you
|
||||
may have to build one architecture at a time and combine the results
|
||||
using the 'lipo' tool if you have problems.
|
||||
|
||||
Installation Names
|
||||
==================
|
||||
|
||||
By default, 'make install' installs the package's commands under
|
||||
'/usr/local/bin', include files under '/usr/local/include', etc. You
|
||||
can specify an installation prefix other than '/usr/local' by giving
|
||||
'configure' the option '--prefix=PREFIX', where PREFIX must be an
|
||||
absolute file name.
|
||||
|
||||
You can specify separate installation prefixes for
|
||||
architecture-specific files and architecture-independent files. If you
|
||||
pass the option '--exec-prefix=PREFIX' to 'configure', the package uses
|
||||
PREFIX as the prefix for installing programs and libraries.
|
||||
Documentation and other data files still use the regular prefix.
|
||||
|
||||
In addition, if you use an unusual directory layout you can give
|
||||
options like '--bindir=DIR' to specify different values for particular
|
||||
kinds of files. Run 'configure --help' for a list of the directories
|
||||
you can set and what kinds of files go in them. In general, the default
|
||||
for these options is expressed in terms of '${prefix}', so that
|
||||
specifying just '--prefix' will affect all of the other directory
|
||||
specifications that were not explicitly provided.
|
||||
|
||||
The most portable way to affect installation locations is to pass the
|
||||
correct locations to 'configure'; however, many packages provide one or
|
||||
both of the following shortcuts of passing variable assignments to the
|
||||
'make install' command line to change installation locations without
|
||||
having to reconfigure or recompile.
|
||||
|
||||
The first method involves providing an override variable for each
|
||||
affected directory. For example, 'make install
|
||||
prefix=/alternate/directory' will choose an alternate location for all
|
||||
directory configuration variables that were expressed in terms of
|
||||
'${prefix}'. Any directories that were specified during 'configure',
|
||||
but not in terms of '${prefix}', must each be overridden at install time
|
||||
for the entire installation to be relocated. The approach of makefile
|
||||
variable overrides for each directory variable is required by the GNU
|
||||
Coding Standards, and ideally causes no recompilation. However, some
|
||||
platforms have known limitations with the semantics of shared libraries
|
||||
that end up requiring recompilation when using this method, particularly
|
||||
noticeable in packages that use GNU Libtool.
|
||||
|
||||
The second method involves providing the 'DESTDIR' variable. For
|
||||
example, 'make install DESTDIR=/alternate/directory' will prepend
|
||||
'/alternate/directory' before all installation names. The approach of
|
||||
'DESTDIR' overrides is not required by the GNU Coding Standards, and
|
||||
does not work on platforms that have drive letters. On the other hand,
|
||||
it does better at avoiding recompilation issues, and works well even
|
||||
when some directory options were not specified in terms of '${prefix}'
|
||||
at 'configure' time.
|
||||
|
||||
Optional Features
|
||||
=================
|
||||
|
||||
If the package supports it, you can cause programs to be installed
|
||||
with an extra prefix or suffix on their names by giving 'configure' the
|
||||
option '--program-prefix=PREFIX' or '--program-suffix=SUFFIX'.
|
||||
|
||||
Some packages pay attention to '--enable-FEATURE' options to
|
||||
'configure', where FEATURE indicates an optional part of the package.
|
||||
They may also pay attention to '--with-PACKAGE' options, where PACKAGE
|
||||
is something like 'gnu-as' or 'x' (for the X Window System). The
|
||||
'README' should mention any '--enable-' and '--with-' options that the
|
||||
package recognizes.
|
||||
|
||||
For packages that use the X Window System, 'configure' can usually
|
||||
find the X include and library files automatically, but if it doesn't,
|
||||
you can use the 'configure' options '--x-includes=DIR' and
|
||||
'--x-libraries=DIR' to specify their locations.
|
||||
|
||||
Some packages offer the ability to configure how verbose the
|
||||
execution of 'make' will be. For these packages, running './configure
|
||||
--enable-silent-rules' sets the default to minimal output, which can be
|
||||
overridden with 'make V=1'; while running './configure
|
||||
--disable-silent-rules' sets the default to verbose, which can be
|
||||
overridden with 'make V=0'.
|
||||
|
||||
Particular systems
|
||||
==================
|
||||
|
||||
On HP-UX, the default C compiler is not ANSI C compatible. If GNU CC
|
||||
is not installed, it is recommended to use the following options in
|
||||
order to use an ANSI C compiler:
|
||||
|
||||
./configure CC="cc -Ae -D_XOPEN_SOURCE=500"
|
||||
|
||||
and if that doesn't work, install pre-built binaries of GCC for HP-UX.
|
||||
|
||||
HP-UX 'make' updates targets which have the same time stamps as their
|
||||
prerequisites, which makes it generally unusable when shipped generated
|
||||
files such as 'configure' are involved. Use GNU 'make' instead.
|
||||
|
||||
On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
|
||||
parse its '<wchar.h>' header file. The option '-nodtk' can be used as a
|
||||
workaround. If GNU CC is not installed, it is therefore recommended to
|
||||
try
|
||||
|
||||
./configure CC="cc"
|
||||
|
||||
and if that doesn't work, try
|
||||
|
||||
./configure CC="cc -nodtk"
|
||||
|
||||
On Solaris, don't put '/usr/ucb' early in your 'PATH'. This
|
||||
directory contains several dysfunctional programs; working variants of
|
||||
these programs are available in '/usr/bin'. So, if you need '/usr/ucb'
|
||||
in your 'PATH', put it _after_ '/usr/bin'.
|
||||
|
||||
On Haiku, software installed for all users goes in '/boot/common',
|
||||
not '/usr/local'. It is recommended to use the following options:
|
||||
|
||||
./configure --prefix=/boot/common
|
||||
|
||||
Specifying the System Type
|
||||
==========================
|
||||
|
||||
There may be some features 'configure' cannot figure out
|
||||
automatically, but needs to determine by the type of machine the package
|
||||
will run on. Usually, assuming the package is built to be run on the
|
||||
_same_ architectures, 'configure' can figure that out, but if it prints
|
||||
a message saying it cannot guess the machine type, give it the
|
||||
'--build=TYPE' option. TYPE can either be a short name for the system
|
||||
type, such as 'sun4', or a canonical name which has the form:
|
||||
|
||||
CPU-COMPANY-SYSTEM
|
||||
|
||||
where SYSTEM can have one of these forms:
|
||||
|
||||
OS
|
||||
KERNEL-OS
|
||||
|
||||
See the file 'config.sub' for the possible values of each field. If
|
||||
'config.sub' isn't included in this package, then this package doesn't
|
||||
need to know the machine type.
|
||||
|
||||
If you are _building_ compiler tools for cross-compiling, you should
|
||||
use the option '--target=TYPE' to select the type of system they will
|
||||
produce code for.
|
||||
|
||||
If you want to _use_ a cross compiler, that generates code for a
|
||||
platform different from the build platform, you should specify the
|
||||
"host" platform (i.e., that on which the generated programs will
|
||||
eventually be run) with '--host=TYPE'.
|
||||
|
||||
Sharing Defaults
|
||||
================
|
||||
|
||||
If you want to set default values for 'configure' scripts to share,
|
||||
you can create a site shell script called 'config.site' that gives
|
||||
default values for variables like 'CC', 'cache_file', and 'prefix'.
|
||||
'configure' looks for 'PREFIX/share/config.site' if it exists, then
|
||||
'PREFIX/etc/config.site' if it exists. Or, you can set the
|
||||
'CONFIG_SITE' environment variable to the location of the site script.
|
||||
A warning: not all 'configure' scripts look for a site script.
|
||||
|
||||
Defining Variables
|
||||
==================
|
||||
|
||||
Variables not defined in a site shell script can be set in the
|
||||
environment passed to 'configure'. However, some packages may run
|
||||
configure again during the build, and the customized values of these
|
||||
variables may be lost. In order to avoid this problem, you should set
|
||||
them in the 'configure' command line, using 'VAR=value'. For example:
|
||||
|
||||
./configure CC=/usr/local2/bin/gcc
|
||||
|
||||
causes the specified 'gcc' to be used as the C compiler (unless it is
|
||||
overridden in the site shell script).
|
||||
|
||||
Unfortunately, this technique does not work for 'CONFIG_SHELL' due to an
|
||||
Autoconf limitation. Until the limitation is lifted, you can use this
|
||||
workaround:
|
||||
|
||||
CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash
|
||||
|
||||
'configure' Invocation
|
||||
======================
|
||||
|
||||
'configure' recognizes the following options to control how it
|
||||
operates.
|
||||
|
||||
'--help'
|
||||
'-h'
|
||||
Print a summary of all of the options to 'configure', and exit.
|
||||
|
||||
'--help=short'
|
||||
'--help=recursive'
|
||||
Print a summary of the options unique to this package's
|
||||
'configure', and exit. The 'short' variant lists options used only
|
||||
in the top level, while the 'recursive' variant lists options also
|
||||
present in any nested packages.
|
||||
|
||||
'--version'
|
||||
'-V'
|
||||
Print the version of Autoconf used to generate the 'configure'
|
||||
script, and exit.
|
||||
|
||||
'--cache-file=FILE'
|
||||
Enable the cache: use and save the results of the tests in FILE,
|
||||
traditionally 'config.cache'. FILE defaults to '/dev/null' to
|
||||
disable caching.
|
||||
|
||||
'--config-cache'
|
||||
'-C'
|
||||
Alias for '--cache-file=config.cache'.
|
||||
|
||||
'--quiet'
|
||||
'--silent'
|
||||
'-q'
|
||||
Do not print messages saying which checks are being made. To
|
||||
suppress all normal output, redirect it to '/dev/null' (any error
|
||||
messages will still be shown).
|
||||
|
||||
'--srcdir=DIR'
|
||||
Look for the package's source code in directory DIR. Usually
|
||||
'configure' can determine that directory automatically.
|
||||
|
||||
'--prefix=DIR'
|
||||
Use DIR as the installation prefix. *note Installation Names:: for
|
||||
more details, including other options available for fine-tuning the
|
||||
installation locations.
|
||||
|
||||
'--no-create'
|
||||
'-n'
|
||||
Run the configure checks, but stop before creating any output
|
||||
files.
|
||||
|
||||
'configure' also accepts some other, not widely useful, options. Run
|
||||
'configure --help' for more details.
|
||||
NOTE: You MUST make install Expedite for it to run properly.
|
||||
|
|
66
NEWS
66
NEWS
|
@ -1,22 +1,68 @@
|
|||
Expedite 1.8.0
|
||||
Expedite 1.7.9
|
||||
|
||||
Changes since Expedite 1.7.0:
|
||||
Changes since Expedite 1.7.8:
|
||||
-----------------------------
|
||||
|
||||
Additions:
|
||||
No changes, just updating to keep in sync with last release.
|
||||
|
||||
* Support for Wayland engines
|
||||
* Test and benchmark lines
|
||||
|
||||
Removals:
|
||||
Expedite 1.7.8
|
||||
|
||||
* Evas software X11 16bpp engine suport
|
||||
Changes since Expedite 1.7.7:
|
||||
-----------------------------
|
||||
|
||||
Improvements:
|
||||
No changes, just updating to keep in sync with last release.
|
||||
|
||||
* Porting to Eo
|
||||
|
||||
Expedite 1.7.0
|
||||
Expedite 1.7.7
|
||||
|
||||
Changes since Expedite 1.7.6:
|
||||
-----------------------------
|
||||
|
||||
No changes, just updating to keep in sync with last release.
|
||||
|
||||
|
||||
Expedite 1.7.6
|
||||
|
||||
Changes since Expedite 1.7.5:
|
||||
-----------------------------
|
||||
|
||||
No changes, just updating to keep in sync with last release.
|
||||
|
||||
|
||||
Expedite 1.7.5
|
||||
|
||||
Changes since Expedite 1.7.4:
|
||||
-----------------------------
|
||||
|
||||
No changes, just updating to keep in sync with last release.
|
||||
|
||||
|
||||
Expedite 1.7.4
|
||||
|
||||
Changes since Expedite 1.7.3:
|
||||
-----------------------------
|
||||
|
||||
No changes, just updating to keep in sync with last release.
|
||||
|
||||
|
||||
Expedite 1.7.3
|
||||
|
||||
Changes since Expedite 1.7.2:
|
||||
-----------------------------
|
||||
|
||||
No changes, just updating to keep in sync with last release.
|
||||
|
||||
|
||||
Expedite 1.7.2
|
||||
|
||||
Changes since Expedite 1.7.1:
|
||||
-----------------------------
|
||||
|
||||
No changes, just updating to keep in sync with last release.
|
||||
|
||||
|
||||
Expedite 1.7.1
|
||||
|
||||
Changes since Expedite 1.2.0:
|
||||
-----------------------------
|
||||
|
|
2
README
2
README
|
@ -1,4 +1,4 @@
|
|||
Expedite 1.7.99
|
||||
Expedite 1.7.4
|
||||
|
||||
******************************************************************************
|
||||
|
||||
|
|
236
configure.ac
236
configure.ac
|
@ -3,61 +3,242 @@ 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.23.0], [enlightenment-devel@lists.sourceforge.net])
|
||||
AC_INIT([expedite], [1.7.10], [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-xz])
|
||||
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
|
||||
|
||||
# EFL dependencies
|
||||
efl_version="1.23.0"
|
||||
requirement_expedite=" \
|
||||
eo >= ${efl_version} \
|
||||
efl >= ${efl_version} \
|
||||
eina >= ${efl_version} \
|
||||
evas >= ${efl_version} \
|
||||
eet >= ${efl_version} \
|
||||
ecore-evas >= ${efl_version} \
|
||||
ecore >= ${efl_version}"
|
||||
# Evil library for compilation on Windows
|
||||
|
||||
AC_SUBST(requirement_expedite)
|
||||
case "$host_os" in
|
||||
mingw32*)
|
||||
PKG_CHECK_MODULES([EVIL], [evil >= 1.7.10])
|
||||
AC_DEFINE(HAVE_EVIL, 1, [Set to 1 if Evil library is installed])
|
||||
;;
|
||||
esac
|
||||
|
||||
PKG_CHECK_MODULES([EFL], [${requirement_expedite}])
|
||||
# Eina
|
||||
|
||||
PKG_CHECK_MODULES([EINA], eina >= 1.7.10)
|
||||
|
||||
# Evas
|
||||
|
||||
PKG_CHECK_MODULES([EVAS], evas >= 1.7.10 eet >= 1.7.10)
|
||||
|
||||
# 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")
|
||||
|
||||
EFL_ENABLE_EO_API_SUPPORT
|
||||
EFL_ENABLE_BETA_API_SUPPORT
|
||||
|
||||
### Checks for header files
|
||||
|
||||
|
||||
### Checks for types
|
||||
|
||||
|
||||
### Checks for structures
|
||||
|
||||
|
||||
### Checks for compiler characteristics
|
||||
|
||||
AC_PROG_CC_C99
|
||||
AM_PROG_CC_STDC
|
||||
AC_HEADER_STDC
|
||||
AC_C_CONST
|
||||
AM_PROG_CC_C_O
|
||||
AC_C___ATTRIBUTE__
|
||||
|
||||
if test "x${ac_cv_prog_cc_c99}" = "xno" ; then
|
||||
AC_MSG_ERROR([expedite requires a c99-capable compiler])
|
||||
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])
|
||||
|
@ -74,6 +255,23 @@ 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
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 9.6 KiB |
|
@ -55,7 +55,6 @@ data.png \
|
|||
widgets.png \
|
||||
e-logo-2.png \
|
||||
e-logo-mask.png \
|
||||
texture.png \
|
||||
vector.png
|
||||
texture.png
|
||||
|
||||
EXTRA_DIST = $(files_DATA)
|
||||
|
|
|
@ -1,61 +0,0 @@
|
|||
files = [ 'Kochi.ttf',
|
||||
'Vera.ttf',
|
||||
'VeraBI.ttf',
|
||||
'VeraBd.ttf',
|
||||
'VeraIt.ttf',
|
||||
'VeraMoBI.ttf',
|
||||
'VeraMoBd.ttf',
|
||||
'VeraMoIt.ttf',
|
||||
'VeraMono.ttf',
|
||||
'VeraSe.ttf',
|
||||
'VeraSeBd.ttf',
|
||||
'fonts.alias',
|
||||
'fonts.dir',
|
||||
'logo.png',
|
||||
'e-logo.png',
|
||||
'e.png',
|
||||
'image.png',
|
||||
'bar.png',
|
||||
'frame.png',
|
||||
'stretch.png',
|
||||
'9patch_test.9.png',
|
||||
'pan.png',
|
||||
'tp.png',
|
||||
'tp.yuv',
|
||||
'icon_sel.png',
|
||||
'text_sel.png',
|
||||
'exit.png',
|
||||
'watch.png',
|
||||
'bug.png',
|
||||
'bulb.png',
|
||||
'camera.png',
|
||||
'colorbox.png',
|
||||
'error.png',
|
||||
'flower.png',
|
||||
'house.png',
|
||||
'mushroom.png',
|
||||
'pulse.png',
|
||||
'typewriter.png',
|
||||
'warning.png',
|
||||
'im1.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',
|
||||
'vector.png' ]
|
||||
|
||||
install_data(files, install_dir: join_paths(get_option('datadir'),
|
||||
meson.project_name(), 'data'))
|
BIN
data/stretch.png
BIN
data/stretch.png
Binary file not shown.
Before Width: | Height: | Size: 3.9 KiB |
BIN
data/vector.png
BIN
data/vector.png
Binary file not shown.
Before Width: | Height: | Size: 1.6 KiB |
|
@ -16,8 +16,8 @@ Source: ftp://ftp.enlightenment.org/pub/enlightenment/expedite-%{ver}.tar.gz
|
|||
BuildRoot: /var/tmp/expedite-root
|
||||
Packager: The Rasterman <raster@rasterman.com>
|
||||
URL: http://www.enlightenment.org/
|
||||
BuildRequires: efl-devel
|
||||
Requires: efl
|
||||
BuildRequires: evas-devel
|
||||
Requires: evas
|
||||
|
||||
%description
|
||||
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
dnl use: EFL_ENABLE_BETA_API_SUPPORT
|
||||
AC_DEFUN([EFL_ENABLE_BETA_API_SUPPORT],
|
||||
[
|
||||
AC_DEFINE([EFL_BETA_API_SUPPORT], [1], [Enable access to unstable EFL API that are still in beta])
|
||||
])
|
|
@ -1,6 +0,0 @@
|
|||
dnl use: EFL_ENABLE_EO_API_SUPPORT
|
||||
AC_DEFUN([EFL_ENABLE_EO_API_SUPPORT],
|
||||
[
|
||||
AC_DEFINE([EFL_EO_API_SUPPORT], [1], [Enable access to unstable EFL Eo API])
|
||||
])
|
||||
|
63
meson.build
63
meson.build
|
@ -1,63 +0,0 @@
|
|||
project('expedite', 'c',
|
||||
version: '1.23.0',
|
||||
default_options: ['c_std=gnu99'],
|
||||
license: 'BSD')
|
||||
|
||||
|
||||
cc = meson.get_compiler('c')
|
||||
|
||||
prefix = get_option('prefix')
|
||||
add_global_arguments('-DHAVE_CONFIG_H=1', language: 'c')
|
||||
config_data = configuration_data()
|
||||
config_data.set('EFL_BETA_API_SUPPORT', 1)
|
||||
config_data.set_quoted('PACKAGE_VERSION', meson.project_version())
|
||||
config_data.set_quoted('PACKAGE', meson.project_name())
|
||||
config_data.set_quoted('PACKAGE_BUGREPORT',
|
||||
'enlightenment-devel@lists.sourceforge.net')
|
||||
config_data.set_quoted('PACKAGE_NAME', meson.project_name())
|
||||
config_data.set_quoted('PACKAGE_TARNAME', meson.project_name())
|
||||
config_data.set_quoted('PACKAGE_URL',
|
||||
'https://www.enlightenment.org/')
|
||||
config_data.set_quoted('PACKAGE_BIN_DIR',
|
||||
join_paths(prefix, get_option('bindir')))
|
||||
config_data.set_quoted('PACKAGE_DATA_DIR',
|
||||
join_paths(prefix, get_option('datadir'),
|
||||
meson.project_name()))
|
||||
config_data.set_quoted('PACKAGE_LIB_DIR',
|
||||
join_paths(prefix, get_option('libdir')))
|
||||
config_data.set_quoted('LOCALEDIR', join_paths(prefix, get_option('localedir')))
|
||||
|
||||
host_os = host_machine.system()
|
||||
|
||||
if host_os == 'linux'
|
||||
config_data.set('_GNU_SOURCE', 1)
|
||||
config_data.set('__EXTENSIONS__', 1)
|
||||
config_data.set('_POSIX_PTHREAD_SEMANTICS', 1)
|
||||
config_data.set('_TANDEM_SOURCE', 1)
|
||||
config_data.set('_ALL_SOURCE', 1)
|
||||
config_data.set('_POSIX_SOURCE', 1)
|
||||
config_data.set('_POSIX_1_SOURCE', 1)
|
||||
endif
|
||||
|
||||
efl_version = '1.23.0'
|
||||
efl_deps = ['eina',
|
||||
'eet',
|
||||
'eo',
|
||||
'efl',
|
||||
'evas',
|
||||
'ecore',
|
||||
'ecore-evas',
|
||||
'elementary']
|
||||
expedite_dependencies = []
|
||||
|
||||
foreach efl_dep: efl_deps
|
||||
dep = dependency(efl_dep, version: '>=' + efl_version)
|
||||
expedite_dependencies += [dep]
|
||||
endforeach
|
||||
|
||||
configure_file(output: 'config.h',
|
||||
configuration: config_data)
|
||||
|
||||
config_dir = include_directories('.')
|
||||
subdir('src/bin')
|
||||
subdir('data')
|
|
@ -6,7 +6,13 @@ AM_CPPFLAGS = \
|
|||
-DPACKAGE_BIN_DIR=\"$(bindir)\" \
|
||||
-DPACKAGE_LIB_DIR=\"$(libdir)\" \
|
||||
-DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \
|
||||
@EFL_CFLAGS@
|
||||
@EINA_CFLAGS@ \
|
||||
@EVAS_CFLAGS@ \
|
||||
@x_cflags@ \
|
||||
@SDL_CFLAGS@ \
|
||||
@DIRECTFB_CFLAGS@ \
|
||||
@XCB_CFLAGS@ \
|
||||
@EVIL_CFLAGS@
|
||||
|
||||
bin_PROGRAMS = expedite
|
||||
bin_SCRIPTS = expedite-cmp
|
||||
|
@ -49,8 +55,6 @@ image_blend_smooth_solid_same_scaled.c \
|
|||
image_blend_border.c \
|
||||
image_blend_solid_middle_border.c \
|
||||
image_blend_solid_border.c \
|
||||
image_blend_solid_stretch.c \
|
||||
image_blend_solid_9patch.c \
|
||||
image_blend_border_recolor.c \
|
||||
image_map_rotate.c \
|
||||
image_map_solid_rotate.c \
|
||||
|
@ -87,7 +91,6 @@ textblock_basic.c \
|
|||
textblock_intl.c \
|
||||
textblock_auto_align.c \
|
||||
textblock_text_append.c \
|
||||
textblock_text_fill_format.c \
|
||||
rect_blend.c \
|
||||
rect_blend_pow2.c \
|
||||
rect_solid.c \
|
||||
|
@ -109,36 +112,122 @@ image_blend_occlude3_very_many.c \
|
|||
poly_blend.c \
|
||||
proxy_image.c \
|
||||
proxy_text_fixed.c \
|
||||
proxy_text_random.c \
|
||||
proxy_textblock.c \
|
||||
proxy_image_clipped.c \
|
||||
line_blend.c \
|
||||
image_blend_many_smooth_same_scaled.c \
|
||||
font_effect_blur_alpha.c \
|
||||
font_effect_blur_color.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_clipped.c \
|
||||
vg_basic_rect.c \
|
||||
vg_basic_circle.c \
|
||||
vg_basic_gradient.c \
|
||||
vg_scaled.c \
|
||||
snapshot_widgets_file_icons.c
|
||||
# \
|
||||
# image_mask_14.c \
|
||||
# image_mask_15.c
|
||||
proxy_text_random.c
|
||||
|
||||
expedite_LDADD = @EFL_LIBS@ -lm
|
||||
#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_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_XLIB
|
||||
expedite_SOURCES += \
|
||||
engine_software_xlib.c engine_software_xlib.h
|
||||
endif
|
||||
|
||||
if BUILD_XRENDER_X11
|
||||
expedite_SOURCES += \
|
||||
engine_xrender_x11.c engine_xrender_x11.h
|
||||
endif
|
||||
|
||||
if BUILD_OPENGL_X11
|
||||
expedite_SOURCES += \
|
||||
engine_gl_x11.c engine_gl_x11.h
|
||||
endif
|
||||
|
||||
if BUILD_SOFTWARE_XCB
|
||||
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
|
||||
endif
|
||||
|
||||
if BUILD_DIRECT3D
|
||||
expedite_SOURCES += \
|
||||
engine_direct3d.cpp engine_direct3d.h
|
||||
endif
|
||||
|
||||
if BUILD_SDL
|
||||
expedite_SOURCES += \
|
||||
engine_software_sdl.c engine_software_sdl.h
|
||||
endif
|
||||
|
||||
if BUILD_OPENGL_SDL
|
||||
expedite_SOURCES += \
|
||||
engine_gl_sdl.c engine_gl_sdl.h
|
||||
endif
|
||||
|
||||
if BUILD_PSL1GHT
|
||||
expedite_SOURCES += \
|
||||
engine_psl1ght.c
|
||||
endif
|
||||
|
||||
if BUILD_FB
|
||||
expedite_SOURCES += \
|
||||
engine_fb.c engine_fb.h
|
||||
endif
|
||||
|
||||
if BUILD_DIRECTFB
|
||||
expedite_SOURCES += \
|
||||
engine_directfb.c engine_directfb.h
|
||||
endif
|
||||
|
||||
if BUILD_OPENGL_COCOA
|
||||
expedite_SOURCES += \
|
||||
engine_gl_cocoa.m engine_gl_cocoa.h
|
||||
endif
|
||||
|
||||
if BUILD_SOFTWARE_16_X11
|
||||
expedite_SOURCES += \
|
||||
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.rc
|
||||
endif
|
||||
|
||||
.rc.lo:
|
||||
$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --tag=RC --mode=compile $(RC) $(RCFLAGS) $< -o $@
|
||||
|
||||
EXTRA_DIST = $(bin_SCRIPTS)
|
||||
|
|
|
@ -6,28 +6,34 @@ static void
|
|||
_setup(void)
|
||||
{
|
||||
Evas_Object *o;
|
||||
Evas_Textblock_Style *st;
|
||||
|
||||
o = efl_add(EFL_CANVAS_TEXTBLOCK_CLASS, evas);
|
||||
efl_gfx_entity_position_set(o, EINA_POSITION2D(10, 40));
|
||||
efl_gfx_entity_size_set(o, EINA_SIZE2D(win_w - 20, win_h - 50));
|
||||
efl_gfx_entity_visible_set(o, EINA_TRUE);
|
||||
|
||||
efl_text_font_family_set(o, "Vera");
|
||||
efl_text_font_size_set(o, 10);
|
||||
efl_text_color_set(o, 0, 0, 0, 255);
|
||||
efl_text_multiline_set(o, EINA_TRUE);
|
||||
efl_text_horizontal_align_set(o, 0.5);
|
||||
efl_text_wrap_set(o, EFL_TEXT_FORMAT_WRAP_WORD);
|
||||
|
||||
efl_text_markup_set
|
||||
o = evas_object_textblock_add(evas);
|
||||
evas_object_move(o, 10, 40);
|
||||
evas_object_resize(o, win_w - 20, win_h - 50);
|
||||
evas_object_show(o);
|
||||
st = evas_textblock_style_new();
|
||||
evas_textblock_style_set
|
||||
(st,
|
||||
"DEFAULT='font=Vera font_size=8 align=left color=#000 wrap=word'"
|
||||
"center='+ font=Vera font_size=10 align=center'"
|
||||
"/center='- \n \n'"
|
||||
"p='+ font=Vera font_size=10 align=left'"
|
||||
"/p='- \n \n'"
|
||||
);
|
||||
evas_object_textblock_style_set(o, st);
|
||||
evas_textblock_style_free(st);
|
||||
evas_object_textblock_clear(o);
|
||||
evas_object_textblock_text_markup_set
|
||||
(o,
|
||||
"<center>"
|
||||
"Enlightenment used to be a window manager project, but "
|
||||
"since has changed a lot to become a miniature desktop and mobile "
|
||||
"device environment all of its own. It is now made up of many "
|
||||
"components (libraries and applications) that have specific uses. "
|
||||
"It is very large, and so requires more testing and demonstration."
|
||||
"</center>"
|
||||
"</br>"
|
||||
|
||||
"<center>"
|
||||
"Expedite is a full test suite for Evas, which is one of the "
|
||||
"core components of the Enlightenment Foundation Libraries. Evas "
|
||||
|
@ -35,8 +41,9 @@ _setup(void)
|
|||
"render to many targets, including framebuffer, X11, OpenGL, memory, "
|
||||
"DirectFB and other targets to boot. It handles high level graphic "
|
||||
"layout descriptions that applications set up, dealing with the hard "
|
||||
"work of doing the drawing for them.");
|
||||
|
||||
"work of doing the drawing for them."
|
||||
"</center>"
|
||||
);
|
||||
o_text = o;
|
||||
ui_fps(0.0);
|
||||
}
|
||||
|
@ -44,18 +51,17 @@ _setup(void)
|
|||
static void
|
||||
_cleanup(void)
|
||||
{
|
||||
efl_del(o_text);
|
||||
evas_object_del(o_text);
|
||||
o_text = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
_loop(double t EINA_UNUSED,
|
||||
int f EINA_UNUSED)
|
||||
_loop(double t __UNUSED__, int f __UNUSED__)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
_key(const char *key)
|
||||
_key(char *key)
|
||||
{
|
||||
if ((!strcmp(key, "Escape")) || (!strcmp(key, "q")) || (!strcmp(key, "Q")))
|
||||
{
|
||||
|
@ -67,5 +73,6 @@ _key(const char *key)
|
|||
void
|
||||
about_start(void)
|
||||
{
|
||||
ui_func_set(_key, _loop, _setup);
|
||||
ui_func_set(_key, _loop);
|
||||
_setup();
|
||||
}
|
||||
|
|
|
@ -0,0 +1,288 @@
|
|||
#include "main.h"
|
||||
|
||||
#include <windowsx.h>
|
||||
#include <Evas_Engine_Direct3D.h>
|
||||
|
||||
|
||||
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_PAINT: {
|
||||
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_direct3d_args(const char *engine, int width, int height)
|
||||
{
|
||||
WNDCLASS wc;
|
||||
RECT rect;
|
||||
HDC dc;
|
||||
MSG msg;
|
||||
Evas_Engine_Info_Direct3D *einfo;
|
||||
DWORD style;
|
||||
int depth;
|
||||
int i;
|
||||
|
||||
instance = GetModuleHandle(NULL);
|
||||
if (!instance) return EINA_FALSE;
|
||||
|
||||
wc.style = 0;
|
||||
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_Direct3D_Test";
|
||||
|
||||
if(!RegisterClass(&wc))
|
||||
goto free_library;
|
||||
|
||||
rect.left = 0;
|
||||
rect.top = 0;
|
||||
rect.right = width;
|
||||
rect.bottom = height;
|
||||
AdjustWindowRect (&rect, WS_OVERLAPPEDWINDOW | WS_SIZEBOX, FALSE);
|
||||
|
||||
window = CreateWindowEx(0,
|
||||
"Evas_Direct3D_Test",
|
||||
"Evas_Direct3D_Test",
|
||||
WS_OVERLAPPEDWINDOW | WS_SIZEBOX,
|
||||
CW_USEDEFAULT, CW_USEDEFAULT,
|
||||
rect.right - rect.left, rect.bottom - rect.top,
|
||||
NULL, NULL, instance, NULL);
|
||||
if (!window)
|
||||
goto unregister_class;
|
||||
|
||||
/* 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("direct3d"));
|
||||
einfo = (Evas_Engine_Info_Direct3D *)evas_engine_info_get(evas);
|
||||
if (!einfo)
|
||||
{
|
||||
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;
|
||||
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 EINA_TRUE;
|
||||
|
||||
destroy_window:
|
||||
DestroyWindow(window);
|
||||
unregister_class:
|
||||
UnregisterClass("Evas_Direct3D_Test", instance);
|
||||
free_library:
|
||||
FreeLibrary(instance);
|
||||
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
void
|
||||
engine_direct3d_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_direct3d_shutdown(void)
|
||||
{
|
||||
DestroyWindow(window);
|
||||
UnregisterClass("Evas_Direct3D_Test", instance);
|
||||
FreeLibrary(instance);
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
#ifndef __ENGINE_DIRECT3D_H__
|
||||
#define __ENGINE_DIRECT3D_H__
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
Eina_Bool engine_direct3d_args(const char *engine, int width, int height);
|
||||
void engine_direct3d_loop(void);
|
||||
void engine_direct3d_shutdown(void);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* __ENGINE_DIRECT3D_H__ */
|
|
@ -0,0 +1,277 @@
|
|||
#include "main.h"
|
||||
|
||||
#include <Evas_Engine_DirectFB.h>
|
||||
|
||||
static IDirectFB *_dfb;
|
||||
static IDirectFBEventBuffer *_window_event;
|
||||
static IDirectFBEventBuffer *_input_event;
|
||||
static IDirectFBDisplayLayer *_layer;
|
||||
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; \
|
||||
if (_err != DFB_OK) { \
|
||||
fprintf( stderr, "%s <%d>:\n\t", __FILE__, __LINE__ ); \
|
||||
DirectFBErrorFatal( #x, _err ); \
|
||||
} \
|
||||
}
|
||||
|
||||
Eina_Bool
|
||||
engine_directfb_args(const char *engine, int width, int height)
|
||||
{
|
||||
Evas_Engine_Info_DirectFB *einfo;
|
||||
DFBWindowDescription desc;
|
||||
int i;
|
||||
|
||||
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 EINA_FALSE;
|
||||
}
|
||||
|
||||
DFBCHECK(DirectFBInit(NULL, NULL));
|
||||
DFBCHECK(DirectFBCreate(&_dfb));
|
||||
DFBCHECK(_dfb->GetDisplayLayer(_dfb, DLID_PRIMARY, &_layer));
|
||||
DFBCHECK(_dfb->CreateEventBuffer(_dfb, &_window_event));
|
||||
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_PIXELFORMAT);
|
||||
desc.posx = 0;
|
||||
desc.posy = 0;
|
||||
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;
|
||||
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 EINA_TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
engine_directfb_quit(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));
|
||||
|
||||
evas_engine_info_set(evas, NULL);
|
||||
|
||||
engine_abort();
|
||||
}
|
||||
|
||||
static const char *
|
||||
key_string(DFBInputDeviceKeySymbol sym)
|
||||
{
|
||||
switch (sym)
|
||||
{
|
||||
case DIKS_ESCAPE:
|
||||
{
|
||||
static const char k[] = "Escape";
|
||||
return k;
|
||||
}
|
||||
case DIKS_RETURN:
|
||||
{
|
||||
static const char k[] = "Return";
|
||||
return k;
|
||||
}
|
||||
case DIKS_CURSOR_LEFT:
|
||||
{
|
||||
static const char k[] = "Left";
|
||||
return k;
|
||||
}
|
||||
case DIKS_CURSOR_RIGHT:
|
||||
{
|
||||
static const char k[] = "Right";
|
||||
return k;
|
||||
}
|
||||
default:
|
||||
{
|
||||
static char k[2];
|
||||
k[0] = (char)sym;
|
||||
k[1] = 0;
|
||||
return k;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
engine_directfb_event_window(const DFBWindowEvent *ev)
|
||||
{
|
||||
DBG("===> Window Event (type=%#10x, window=%d) <===\n",
|
||||
ev->type, ev->window_id);
|
||||
|
||||
if (ev->type & DWET_POSITION)
|
||||
{
|
||||
DBG("\tDWET_POSITION %d, %d\n", ev->x, ev->y);
|
||||
}
|
||||
|
||||
if (ev->type & DWET_SIZE)
|
||||
{
|
||||
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)
|
||||
{
|
||||
DBG("\tDWET_CLOSE\n");
|
||||
engine_directfb_quit();
|
||||
}
|
||||
|
||||
if (ev->type & DWET_DESTROYED)
|
||||
{
|
||||
DBG("\tDWET_DESTROYED\n");
|
||||
engine_directfb_quit();
|
||||
}
|
||||
|
||||
if (ev->type & DWET_GOTFOCUS)
|
||||
{
|
||||
DBG("\tDWET_GOTFOCUS\n");
|
||||
}
|
||||
|
||||
if (ev->type & DWET_LOSTFOCUS)
|
||||
{
|
||||
DBG("\tDWET_LOSTFOCUS\n");
|
||||
}
|
||||
|
||||
if (ev->type & DWET_KEYDOWN)
|
||||
{
|
||||
const char *k;
|
||||
|
||||
k = key_string(ev->key_symbol);
|
||||
DBG("\tDWET_KEYDOWN key_symbol=%s\n", k);
|
||||
|
||||
if (k)
|
||||
evas_event_feed_key_down(evas, k, k, NULL, NULL, 0, NULL);
|
||||
}
|
||||
|
||||
if (ev->type & DWET_KEYUP)
|
||||
{
|
||||
const char *k;
|
||||
|
||||
k = key_string(ev->key_symbol);
|
||||
DBG("\tDWET_KEYUP key_symbol=%s\n", k);
|
||||
|
||||
if (k)
|
||||
evas_event_feed_key_up(evas, k, k, NULL, NULL, 0, NULL);
|
||||
}
|
||||
|
||||
if (ev->type & DWET_BUTTONDOWN)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
DBG("\tDWET_WHEEL step=%d\n", ev->step);
|
||||
}
|
||||
|
||||
|
||||
DBG("\n");
|
||||
}
|
||||
|
||||
void
|
||||
engine_directfb_loop(void)
|
||||
{
|
||||
DFBEvent ev;
|
||||
|
||||
while ((_input_event->GetEvent(_input_event, &ev) == DFB_OK) ||
|
||||
(_window_event->GetEvent(_window_event, &ev) == DFB_OK))
|
||||
{
|
||||
DBG("got dfb input event %d\n", ev.clazz);
|
||||
switch (ev.clazz)
|
||||
{
|
||||
case DFEC_NONE:
|
||||
DBG("No event?\n");
|
||||
break;
|
||||
case DFEC_INPUT:
|
||||
DBG("Input\n");
|
||||
break;
|
||||
case DFEC_WINDOW:
|
||||
engine_directfb_event_window((const DFBWindowEvent *)&ev);
|
||||
break;
|
||||
case DFEC_USER:
|
||||
DBG("User\n");
|
||||
break;
|
||||
case DFEC_UNIVERSAL:
|
||||
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));
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
#ifndef ENGINE_DIRECTFB_H
|
||||
#define ENGINE_DIRECTFB_H
|
||||
|
||||
Eina_Bool engine_directfb_args(const char *engine, int width, int height);
|
||||
void engine_directfb_loop(void);
|
||||
void engine_directfb_shutdown(void);
|
||||
|
||||
#endif
|
|
@ -0,0 +1,42 @@
|
|||
#include "main.h"
|
||||
|
||||
#include <Evas_Engine_FB.h>
|
||||
|
||||
Eina_Bool
|
||||
engine_fb_args(const char *engine __UNUSED__, int width __UNUSED__, int height __UNUSED__)
|
||||
{
|
||||
Evas_Engine_Info_FB *einfo;
|
||||
|
||||
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 EINA_FALSE;
|
||||
}
|
||||
|
||||
einfo->info.virtual_terminal = 0;
|
||||
einfo->info.device_number = 0;
|
||||
einfo->info.device_number = 0;
|
||||
einfo->info.refresh = 0;
|
||||
einfo->info.rotation = 0;
|
||||
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 EINA_TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
engine_fb_loop(void)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
void
|
||||
engine_fb_shutdown(void)
|
||||
{
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
#ifndef ENGINE_FB_H
|
||||
#define ENGINE_FB_H
|
||||
|
||||
Eina_Bool engine_fb_args(const char *engine, int width, int height);
|
||||
void engine_fb_loop(void);
|
||||
void engine_fb_shutdown(void);
|
||||
|
||||
#endif
|
|
@ -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
|
|
@ -0,0 +1,174 @@
|
|||
#include <assert.h>
|
||||
#include "main.h"
|
||||
|
||||
#include <Evas_Engine_GL_SDL.h>
|
||||
|
||||
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)
|
||||
{
|
||||
}
|
|
@ -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
|
|
@ -0,0 +1,223 @@
|
|||
#include "main.h"
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/XKBlib.h>
|
||||
#include <X11/Xutil.h>
|
||||
#include <X11/Xatom.h>
|
||||
#include <Evas_Engine_GL_X11.h>
|
||||
|
||||
static Display *disp = NULL;
|
||||
static Window win = 0;
|
||||
static int first_expose = 0;
|
||||
|
||||
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;
|
||||
|
||||
disp = XOpenDisplay(NULL);
|
||||
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");
|
||||
goto close_display;
|
||||
}
|
||||
|
||||
einfo->info.display = 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;
|
||||
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 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 = width;
|
||||
szhints.min_height = szhints.max_height = height;
|
||||
XSetWMNormalHints(disp, win, &szhints);
|
||||
XMapWindow(disp, win);
|
||||
XSync(disp, False);
|
||||
while (!first_expose)
|
||||
engine_gl_x11_loop();
|
||||
return EINA_TRUE;
|
||||
|
||||
destroy_window:
|
||||
XDestroyWindow(disp, win);
|
||||
close_display:
|
||||
XCloseDisplay(disp);
|
||||
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
void
|
||||
engine_gl_x11_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_gl_x11_shutdown(void)
|
||||
{
|
||||
XDestroyWindow(disp, win);
|
||||
XCloseDisplay(disp);
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
#ifndef ENGINE_GL_X11_H
|
||||
#define ENGINE_GL_X11_H
|
||||
|
||||
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
|
|
@ -0,0 +1,284 @@
|
|||
#include "main.h"
|
||||
|
||||
#include <Evas_Engine_PSL1GHT.h>
|
||||
#include <io/mouse.h>
|
||||
#include <io/kb.h>
|
||||
|
||||
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;
|
||||
}
|
||||
|
|
@ -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
|
|
@ -0,0 +1,324 @@
|
|||
#include "main.h"
|
||||
|
||||
#include <windows.h>
|
||||
#include <aygshell.h>
|
||||
#include <Evas_Engine_Software_16_WinCE.h>
|
||||
|
||||
|
||||
static HINSTANCE instance = NULL;
|
||||
static HWND window = NULL;
|
||||
static int backend = 0;
|
||||
|
||||
typedef int (*suspend) (int backend);
|
||||
typedef int (*resume) (int backend);
|
||||
|
||||
static suspend _suspend = NULL;
|
||||
static resume _resume = NULL;
|
||||
|
||||
|
||||
typedef BOOL (__stdcall *UnregisterFunc1Proc)(UINT, UINT);
|
||||
|
||||
static int
|
||||
_wince_hardware_keys_register(HWND window)
|
||||
{
|
||||
HINSTANCE core_dll;
|
||||
UnregisterFunc1Proc unregister_fct;
|
||||
int i;
|
||||
|
||||
core_dll = LoadLibrary(L"coredll.dll");
|
||||
if (!core_dll)
|
||||
return 0;
|
||||
|
||||
unregister_fct = (UnregisterFunc1Proc)GetProcAddress(core_dll, L"UnregisterFunc1");
|
||||
if (!unregister_fct)
|
||||
{
|
||||
FreeLibrary(core_dll);
|
||||
return 0;
|
||||
}
|
||||
|
||||
for (i = 0xc1; i <= 0xcf; i++)
|
||||
{
|
||||
unregister_fct(MOD_WIN, i);
|
||||
RegisterHotKey(window, i, MOD_WIN, i);
|
||||
}
|
||||
|
||||
FreeLibrary(core_dll);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void
|
||||
_wince_key_down(WPARAM wParam)
|
||||
{
|
||||
int key;
|
||||
|
||||
key = LOWORD(wParam);
|
||||
|
||||
if ((key == VK_SHIFT) ||
|
||||
(key == VK_LSHIFT) ||
|
||||
(key == VK_RSHIFT))
|
||||
evas_key_modifier_on(evas, "Shift");
|
||||
|
||||
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_RETURN) || (key == VK_APP1))
|
||||
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) || (key == VK_APP2))
|
||||
evas_event_feed_key_down(evas, "Q", "Q", NULL, NULL, 0, NULL);
|
||||
if ((key == 113) || (key == VK_APP3))
|
||||
evas_event_feed_key_down(evas, "q", "q", NULL, NULL, 0, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
_wince_key_up(WPARAM wParam)
|
||||
{
|
||||
int key;
|
||||
|
||||
key = LOWORD(wParam);
|
||||
|
||||
if ((key == VK_SHIFT) ||
|
||||
(key == VK_LSHIFT) ||
|
||||
(key == VK_RSHIFT))
|
||||
evas_key_modifier_off(evas, "Shift");
|
||||
if ((key == VK_RETURN) || (key == VK_APP1))
|
||||
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) || (key == VK_APP2))
|
||||
evas_event_feed_key_up(evas, "Q", "Q", NULL, NULL, 0, NULL);
|
||||
if ((key == 113) || (key == VK_APP3))
|
||||
evas_event_feed_key_up(evas, "q", "q", NULL, NULL, 0, NULL);
|
||||
}
|
||||
|
||||
static LRESULT CALLBACK
|
||||
MainWndProc(HWND hwnd,
|
||||
UINT uMsg,
|
||||
WPARAM wParam,
|
||||
LPARAM lParam)
|
||||
{
|
||||
switch (uMsg)
|
||||
{
|
||||
case WM_DESTROY:
|
||||
PostQuitMessage(0);
|
||||
return 0;
|
||||
case WM_CLOSE:
|
||||
PostQuitMessage(0);
|
||||
return 0;
|
||||
case WM_PAINT:
|
||||
ValidateRect(hwnd, NULL);
|
||||
return 0;
|
||||
case WM_HOTKEY:
|
||||
_wince_key_down(wParam);
|
||||
return 0;
|
||||
case WM_KEYDOWN:
|
||||
_wince_key_down(wParam);
|
||||
return 0;
|
||||
case WM_KEYUP:
|
||||
_wince_key_up(wParam);
|
||||
return 0;
|
||||
case WM_KILLFOCUS:
|
||||
if (_suspend)
|
||||
_suspend (backend);
|
||||
return 0;
|
||||
case WM_SETFOCUS:
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
HWND task_bar;
|
||||
HWND sip_window;
|
||||
HWND sip_icon;
|
||||
int stride_x;
|
||||
int stride_y;
|
||||
int bpp;
|
||||
int format;
|
||||
void *buffer;
|
||||
int ok = 0;
|
||||
int i;
|
||||
|
||||
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 EINA_FALSE;
|
||||
|
||||
memset (&wc, 0, sizeof (wc));
|
||||
wc.style = CS_HREDRAW | CS_VREDRAW;
|
||||
wc.lpfnWndProc = MainWndProc;
|
||||
wc.cbClsExtra = 0;
|
||||
wc.cbWndExtra = 0;
|
||||
wc.hInstance = instance;
|
||||
wc.hIcon = NULL;
|
||||
wc.hCursor = LoadCursor (NULL, IDC_ARROW);
|
||||
wc.hbrBackground = GetSysColorBrush(COLOR_BTNFACE);
|
||||
wc.lpszMenuName = NULL;
|
||||
wc.lpszClassName = L"Evas_Software_16_WinCE_Test";
|
||||
|
||||
if(!RegisterClass(&wc))
|
||||
goto free_library;
|
||||
|
||||
SetRect(&rect, 0, 0,
|
||||
GetSystemMetrics(SM_CXSCREEN),
|
||||
GetSystemMetrics(SM_CYSCREEN));
|
||||
|
||||
window = CreateWindowEx(WS_EX_TOPMOST,
|
||||
L"Evas_Software_16_WinCE_Test",
|
||||
L"Evas_Software_16_WinCE_Test",
|
||||
WS_VISIBLE | WS_POPUP,
|
||||
rect.left, rect.top,
|
||||
rect.right - rect.left,
|
||||
rect.bottom - rect.top,
|
||||
NULL, NULL, instance, NULL);
|
||||
if (!window)
|
||||
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))
|
||||
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");
|
||||
goto destroy_window;
|
||||
}
|
||||
|
||||
einfo->info.window = window;
|
||||
einfo->info.width = width;
|
||||
einfo->info.height = height;
|
||||
einfo->info.backend = backend;
|
||||
einfo->info.rotation = 0;
|
||||
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;
|
||||
|
||||
/* 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);
|
||||
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
|
||||
engine_software_16_wince_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_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);
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
#ifndef __ENGINE_SOFTWARE_16_WINCE_H__
|
||||
#define __ENGINE_SOFTWARE_16_WINCE_H__
|
||||
|
||||
|
||||
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__ */
|
|
@ -0,0 +1 @@
|
|||
HI_RES_AWARE CEUX {1}
|
|
@ -0,0 +1,219 @@
|
|||
#include "main.h"
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xutil.h>
|
||||
#include <X11/Xatom.h>
|
||||
#include <Evas_Engine_Software_16_X11.h>
|
||||
|
||||
static Display *disp = NULL;
|
||||
static Window win = 0;
|
||||
static int first_expose = 0;
|
||||
|
||||
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;
|
||||
|
||||
disp = XOpenDisplay(NULL);
|
||||
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");
|
||||
goto close_display;
|
||||
}
|
||||
|
||||
einfo->info.display = disp;
|
||||
attr.backing_store = NotUseful;
|
||||
attr.colormap = DefaultColormap(disp, DefaultScreen(disp));
|
||||
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,
|
||||
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;
|
||||
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 = width;
|
||||
szhints.min_height = szhints.max_height = height;
|
||||
XSetWMNormalHints(disp, win, &szhints);
|
||||
XMapWindow(disp, win);
|
||||
XSync(disp, False);
|
||||
while (!first_expose)
|
||||
engine_software_16_x11_loop();
|
||||
return EINA_TRUE;
|
||||
|
||||
destroy_window:
|
||||
XDestroyWindow(disp, win);
|
||||
close_display:
|
||||
XCloseDisplay(disp);
|
||||
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
void
|
||||
engine_software_16_x11_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 = XKeycodeToKeysym(ev.xkey.display, ev.xkey.keycode, 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 = XKeycodeToKeysym(ev.xkey.display, ev.xkey.keycode, 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_16_x11_shutdown(void)
|
||||
{
|
||||
XDestroyWindow(disp, win);
|
||||
XCloseDisplay(disp);
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
#ifndef ENGINE_SOFTWARE_16_X11_H
|
||||
#define ENGINE_SOFTWARE_16_X11_H
|
||||
|
||||
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
|
|
@ -0,0 +1,291 @@
|
|||
#include "main.h"
|
||||
|
||||
#include <windowsx.h>
|
||||
#include <Evas_Engine_Software_DDraw.h>
|
||||
|
||||
|
||||
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_ddraw_args(const char *engine, int width, int height)
|
||||
{
|
||||
WNDCLASS wc;
|
||||
RECT rect;
|
||||
HDC dc;
|
||||
Evas_Engine_Info_Software_DDraw *einfo;
|
||||
DWORD style;
|
||||
DWORD exstyle;
|
||||
int depth;
|
||||
int i;
|
||||
|
||||
instance = GetModuleHandle(NULL);
|
||||
if (!instance) return 0;
|
||||
|
||||
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_DDraw_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_DDraw_Test",
|
||||
"Evas_Software_DDraw_Test",
|
||||
style,
|
||||
CW_USEDEFAULT, CW_USEDEFAULT,
|
||||
rect.right - rect.left, rect.bottom - rect.top,
|
||||
NULL, NULL, instance, NULL);
|
||||
if (!window)
|
||||
goto unregister_class;
|
||||
|
||||
/* make the window non resizable */
|
||||
style = GetWindowLong(window, GWL_STYLE);
|
||||
style &= ~WS_THICKFRAME;
|
||||
if (!SetWindowLong(window, GWL_STYLE, style))
|
||||
goto destroy_window;
|
||||
|
||||
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_ddraw"));
|
||||
einfo = (Evas_Engine_Info_Software_DDraw *)evas_engine_info_get(evas);
|
||||
if (!einfo)
|
||||
{
|
||||
fprintf(stderr, "Evas does not support the Software DirectDraw Engine\n");
|
||||
goto destroy_window;
|
||||
}
|
||||
|
||||
einfo->info.window = window;
|
||||
einfo->info.depth = depth;
|
||||
einfo->info.rotation = 0;
|
||||
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);
|
||||
UpdateWindow(window);
|
||||
|
||||
return 1;
|
||||
|
||||
destroy_window:
|
||||
DestroyWindow(window);
|
||||
unregister_class:
|
||||
UnregisterClass("Evas_Software_DDraw_Test", instance);
|
||||
free_library:
|
||||
FreeLibrary(instance);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
engine_software_ddraw_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_ddraw_shutdown(void)
|
||||
{
|
||||
DestroyWindow(window);
|
||||
UnregisterClass("Evas_Software_DDraw_Test", instance);
|
||||
FreeLibrary(instance);
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
#ifndef __ENGINE_SOFTWARE_DDRAW_H__
|
||||
#define __ENGINE_SOFTWARE_DDRAW_H__
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
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
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* __ENGINE_SOFTWARE_DDRAW_H__ */
|
|
@ -0,0 +1,293 @@
|
|||
#include "main.h"
|
||||
|
||||
#include <windowsx.h>
|
||||
#include <Evas_Engine_Software_Gdi.h>
|
||||
|
||||
|
||||
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);
|
||||
}
|
|
@ -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__ */
|
|
@ -0,0 +1,242 @@
|
|||
#include <assert.h>
|
||||
#include "main.h"
|
||||
|
||||
#include <SDL/SDL.h>
|
||||
#include <Evas_Engine_Buffer.h>
|
||||
|
||||
static void *
|
||||
_expedite_sdl_switch_buffer(void *data, void *dest __UNUSED__)
|
||||
{
|
||||
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;
|
||||
|
||||
if (ok == 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)
|
||||
{
|
||||
SDL_Init(SDL_INIT_NOPARACHUTE);
|
||||
|
||||
if (SDL_InitSubSystem(SDL_INIT_VIDEO) < 0)
|
||||
{
|
||||
printf("SDL_Init failed with %s", SDL_GetError());
|
||||
SDL_Quit();
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
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 = 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))
|
||||
{
|
||||
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:
|
||||
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:
|
||||
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_software_sdl_shutdown(void)
|
||||
{
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
#ifndef ENGINE_SOFTWARE_SDL_H
|
||||
#define ENGINE_SOFTWARE_SDL_H
|
||||
|
||||
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
|
|
@ -0,0 +1,399 @@
|
|||
#include "main.h"
|
||||
|
||||
#include <xcb/xcb.h>
|
||||
#include <xcb/xcb_keysyms.h>
|
||||
#include <Evas_Engine_Software_X11.h>
|
||||
|
||||
#define XK_MISCELLANY
|
||||
#include <X11/keysymdef.h>
|
||||
|
||||
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;
|
||||
|
||||
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_X11 *einfo;
|
||||
xcb_intern_atom_reply_t *reply;
|
||||
const 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;
|
||||
|
||||
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_tmp, xcb_screen_next (&iter))
|
||||
if (s_tmp == 0)
|
||||
{
|
||||
screen = iter.data;
|
||||
break;
|
||||
}
|
||||
|
||||
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");
|
||||
goto close_connection;
|
||||
}
|
||||
|
||||
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(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;
|
||||
|
||||
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] = 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, 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 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);
|
||||
}
|
||||
|
||||
str = "expedite\0Expedite";
|
||||
|
||||
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);
|
||||
|
||||
xcb_change_property(conn, XCB_PROP_MODE_REPLACE, win,
|
||||
wm_name, string, 8,
|
||||
strlen("Expedite - Evas Test Suite"), "Expedite - Evas Test Suite");
|
||||
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
xcb_map_window(conn, win);
|
||||
|
||||
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
|
||||
engine_software_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_software_xcb_shutdown(void)
|
||||
{
|
||||
xcb_destroy_window(conn, win);
|
||||
xcb_disconnect(conn);
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
#ifndef ENGINE_SOFTWARE_XCB_H
|
||||
#define ENGINE_SOFTWARE_XCB_H
|
||||
|
||||
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
|
|
@ -0,0 +1,236 @@
|
|||
#include "main.h"
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/XKBlib.h>
|
||||
#include <X11/Xutil.h>
|
||||
#include <X11/Xatom.h>
|
||||
#include <Evas_Engine_Software_X11.h>
|
||||
|
||||
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);
|
||||
}
|
|
@ -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
|
|
@ -0,0 +1,221 @@
|
|||
#include "main.h"
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xutil.h>
|
||||
#include <X11/Xatom.h>
|
||||
#include <Evas_Engine_XRender_X11.h>
|
||||
|
||||
static Display *disp = NULL;
|
||||
static Window win = 0;
|
||||
static int first_expose = 0;
|
||||
|
||||
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;
|
||||
|
||||
disp = XOpenDisplay(NULL);
|
||||
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");
|
||||
goto close_display;
|
||||
}
|
||||
|
||||
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;
|
||||
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,
|
||||
0, InputOutput,
|
||||
einfo->info.visual,
|
||||
CWBackingStore |
|
||||
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 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 = width;
|
||||
szhints.min_height = szhints.max_height = height;
|
||||
XSetWMNormalHints(disp, win, &szhints);
|
||||
XMapWindow(disp, win);
|
||||
XSync(disp, False);
|
||||
while (!first_expose)
|
||||
engine_xrender_x11_loop();
|
||||
return EINA_TRUE;
|
||||
|
||||
destroy_window:
|
||||
XDestroyWindow(disp, win);
|
||||
close_display:
|
||||
XCloseDisplay(disp);
|
||||
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
void
|
||||
engine_xrender_x11_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 = XKeycodeToKeysym(ev.xkey.display, ev.xkey.keycode, 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 = XKeycodeToKeysym(ev.xkey.display, ev.xkey.keycode, 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_xrender_x11_shutdown(void)
|
||||
{
|
||||
XDestroyWindow(disp, win);
|
||||
XCloseDisplay(disp);
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
#ifndef ENGINE_XRENDER_X11_H
|
||||
#define ENGINE_XRENDER_X11_H
|
||||
|
||||
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
|
|
@ -0,0 +1,405 @@
|
|||
#include "main.h"
|
||||
|
||||
#include <xcb/xcb.h>
|
||||
#include <xcb/xcb_keysyms.h>
|
||||
#include <Evas_Engine_XRender_X11.h>
|
||||
|
||||
#define XK_MISCELLANY
|
||||
#include <X11/keysymdef.h>
|
||||
|
||||
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);
|
||||
}
|
|
@ -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
|
|
@ -1,7 +1,5 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
from __future__ import print_function
|
||||
|
||||
import sys
|
||||
import os
|
||||
import os.path
|
||||
|
@ -58,16 +56,10 @@ tests = []
|
|||
for f in files:
|
||||
d = data[f] = {}
|
||||
for row in csv.reader(open(f)):
|
||||
if len(row) < 2:
|
||||
continue
|
||||
t = row[1].strip()
|
||||
try:
|
||||
val = float(row[0])
|
||||
except ValueError:
|
||||
continue
|
||||
if f == ref_f:
|
||||
tests.append(t)
|
||||
d[t] = val
|
||||
d[t] = float(row[0])
|
||||
max_test_name = max(len(t), max_test_name)
|
||||
|
||||
def report_text():
|
||||
|
@ -76,12 +68,12 @@ def report_text():
|
|||
fmtsize = len(options.format % {"value": 12345.67, "percentual": 1234.56})
|
||||
hdrfmt = "%%%d.%ds" % (fmtsize, fmtsize)
|
||||
|
||||
print(test_name_fmt % "\\", end=' ')
|
||||
print("%7.7s" % (files[0][-7:],), end=' ')
|
||||
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:], end=' ')
|
||||
print()
|
||||
print hdrfmt % n[-fmtsize:],
|
||||
print
|
||||
|
||||
if options.color and os.environ.get("TERM", "") in (
|
||||
"xterm", "xterm-color", "rxvt", "rxvt-unicode", "screen",
|
||||
|
@ -98,14 +90,14 @@ def report_text():
|
|||
|
||||
|
||||
def print_row(test):
|
||||
print(test_name_fmt % test, end=' ')
|
||||
print test_name_fmt % test,
|
||||
ref_val = data[ref_f][test]
|
||||
print("%7.2f" % ref_val, end=' ')
|
||||
print "%7.2f" % ref_val,
|
||||
for f in others_f:
|
||||
try:
|
||||
val = data[f][test]
|
||||
except KeyError:
|
||||
print("-?????-", end=' ')
|
||||
print "-?????-",
|
||||
continue
|
||||
|
||||
percent = (val - ref_val) / ref_val
|
||||
|
@ -119,9 +111,9 @@ def report_text():
|
|||
fmt = options.format % {"value": val, "percentual": percent * 100}
|
||||
if len(fmt) < fmtsize:
|
||||
fmt = hdrfmt % fmt
|
||||
print("%s%s%s" % (c, fmt, color_reset), end=' ')
|
||||
print "%s%s%s" % (c, fmt, color_reset),
|
||||
|
||||
print()
|
||||
print
|
||||
|
||||
for t in tests:
|
||||
print_row(t)
|
||||
|
@ -131,7 +123,7 @@ def report_html():
|
|||
import time
|
||||
|
||||
fnames = [os.path.basename(f) for f in files]
|
||||
print("""\
|
||||
print """\
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
|
@ -164,9 +156,9 @@ def report_html():
|
|||
border-bottom: 1px dashed #ccc;
|
||||
}
|
||||
td.test-name, thead tr td { text-align: right; }\
|
||||
""")
|
||||
"""
|
||||
if options.color:
|
||||
print("""\
|
||||
print """\
|
||||
td.value-good { background-color: #aaffaa; }
|
||||
td.value-bad { background-color: #ffaaaa; }
|
||||
td.value-missing { background-color: #ffffaa; }
|
||||
|
@ -176,9 +168,9 @@ def report_html():
|
|||
background-color: #d9d9d9;
|
||||
border-bottom: 1px dashed #ccc;
|
||||
}
|
||||
""")
|
||||
"""
|
||||
|
||||
print("""
|
||||
print """
|
||||
</style>
|
||||
<body>
|
||||
<p>Comparison sheet for %(files)s, created at %(date)s.</p>
|
||||
|
@ -188,17 +180,17 @@ def report_html():
|
|||
<td>\\</td>\
|
||||
""" % {"files": ", ".join(fnames),
|
||||
"date": time.asctime(),
|
||||
})
|
||||
}
|
||||
|
||||
for f in fnames:
|
||||
print("""\
|
||||
print """\
|
||||
<td>%s</td>\
|
||||
""" % f)
|
||||
print("""\
|
||||
""" % f
|
||||
print """\
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>\
|
||||
""")
|
||||
"""
|
||||
|
||||
def print_row(test):
|
||||
ref_val = data[ref_f][test]
|
||||
|
@ -207,19 +199,19 @@ def report_html():
|
|||
else:
|
||||
extra_cls = ""
|
||||
|
||||
print("""\
|
||||
print """\
|
||||
<tr%s>
|
||||
<td class="test-name">%s</td>
|
||||
<td class="value-reference">%7.2f</td>\
|
||||
""" % (extra_cls, test, ref_val))
|
||||
""" % (extra_cls, test, ref_val)
|
||||
|
||||
for f in others_f:
|
||||
try:
|
||||
val = data[f][test]
|
||||
except KeyError:
|
||||
print("""\
|
||||
print """\
|
||||
<td class="value-missing">-?????-</td>\
|
||||
""")
|
||||
"""
|
||||
continue
|
||||
|
||||
percent = (val - ref_val) / ref_val
|
||||
|
@ -232,23 +224,23 @@ def report_html():
|
|||
|
||||
v = options.format % {"value": val, "percentual": percent * 100}
|
||||
|
||||
print("""\
|
||||
print """\
|
||||
<td class="value-%s">%s</td>\
|
||||
""" % (c, v))
|
||||
""" % (c, v)
|
||||
|
||||
print("""\
|
||||
print """\
|
||||
</tr>\
|
||||
""")
|
||||
"""
|
||||
|
||||
for t in tests:
|
||||
print_row(t)
|
||||
|
||||
print("""\
|
||||
print """\
|
||||
</tbody>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
""")
|
||||
"""
|
||||
|
||||
if options.report == "text":
|
||||
report_text()
|
||||
|
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -1,101 +0,0 @@
|
|||
#define EFL_GFX_FILTER_BETA
|
||||
|
||||
#undef FNAME
|
||||
#undef NAME
|
||||
#undef ICON
|
||||
|
||||
/* metadata */
|
||||
#define FNAME font_effect_blur_alpha_start
|
||||
#define NAME "Font Effect Blur (Alpha)"
|
||||
#define ICON "text.png"
|
||||
|
||||
#ifndef PROTO
|
||||
# ifndef UI
|
||||
# include "main.h"
|
||||
|
||||
#include "ui.h"
|
||||
|
||||
|
||||
/* standard var */
|
||||
static int done = 0;
|
||||
extern int win_w, win_h;
|
||||
/* private data */
|
||||
static Evas_Object *text;
|
||||
static const int MAX_BLUR = 100;
|
||||
|
||||
/* setup */
|
||||
static void _setup(void)
|
||||
{
|
||||
|
||||
Evas_Object *o;
|
||||
int w,h;
|
||||
|
||||
o = evas_object_text_add(evas);
|
||||
evas_object_color_set(o, 0, 0, 0, 255);
|
||||
evas_object_text_font_set(o, "Vera-Bold", 80);
|
||||
evas_object_text_text_set(o, "Font Effect");
|
||||
evas_object_show(o);
|
||||
evas_object_geometry_get(o, NULL, NULL, &w, &h);
|
||||
evas_object_move(o, (win_w / 2) - (w / 2) - MAX_BLUR, (win_h / 2) - (h / 2) - MAX_BLUR);
|
||||
text = o;
|
||||
|
||||
done = 0;
|
||||
}
|
||||
|
||||
/* cleanup */
|
||||
static void _cleanup(void)
|
||||
{
|
||||
evas_object_del(text);
|
||||
}
|
||||
|
||||
/* loop - do things */
|
||||
static void _loop(double t, int f)
|
||||
{
|
||||
char buf[256];
|
||||
char *str = "padding_set({ %d });blur({%d,color=black });";
|
||||
sprintf(buf, str, MAX_BLUR, ((f % MAX_BLUR) + 1));
|
||||
efl_gfx_filter_program_set(text, buf, "test");
|
||||
|
||||
FPS_STD(NAME);
|
||||
}
|
||||
|
||||
/* prepend special key handlers if interactive (before STD) */
|
||||
static void _key(const 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
|
|
@ -1,103 +0,0 @@
|
|||
#define EFL_GFX_FILTER_BETA
|
||||
|
||||
#undef FNAME
|
||||
#undef NAME
|
||||
#undef ICON
|
||||
|
||||
/* metadata */
|
||||
#define FNAME font_effect_blur_color_start
|
||||
#define NAME "Font Effect Blur (Color)"
|
||||
#define ICON "text.png"
|
||||
|
||||
#ifndef PROTO
|
||||
# ifndef UI
|
||||
# include "main.h"
|
||||
|
||||
#include "ui.h"
|
||||
|
||||
|
||||
/* standard var */
|
||||
static int done = 0;
|
||||
/* private data */
|
||||
static Evas_Object *text;
|
||||
|
||||
extern int win_w, win_h;
|
||||
static const int MAX_BLUR = 100;
|
||||
|
||||
|
||||
/* setup */
|
||||
static void _setup(void)
|
||||
{
|
||||
|
||||
Evas_Object *o;
|
||||
int w, h;
|
||||
|
||||
o = evas_object_text_add(evas);
|
||||
evas_object_color_set(o, 0, 0, 0, 255);
|
||||
evas_object_text_font_set(o, "Vera-Bold", 80);
|
||||
evas_object_text_text_set(o, "Font Effect");
|
||||
evas_object_show(o);
|
||||
evas_object_geometry_get(o, NULL, NULL, &w, &h);
|
||||
evas_object_move(o, (win_w / 2) - (w / 2) - MAX_BLUR, (win_h / 2) - (h / 2) - MAX_BLUR);
|
||||
text = o;
|
||||
|
||||
done = 0;
|
||||
}
|
||||
|
||||
/* cleanup */
|
||||
static void _cleanup(void)
|
||||
{
|
||||
evas_object_del(text);
|
||||
}
|
||||
|
||||
/* loop - do things */
|
||||
static void _loop(double t, int f)
|
||||
{
|
||||
char buf[256];
|
||||
char *str = "a = buffer({ 'rgba' }); padding_set({ %d }); blend({dst=a, color=darkblue});blur({%d,src=a});";
|
||||
sprintf(buf, str, MAX_BLUR, ((f % MAX_BLUR) + 1));
|
||||
efl_gfx_filter_program_set(text, buf, "test");
|
||||
|
||||
FPS_STD(NAME);
|
||||
}
|
||||
|
||||
/* prepend special key handlers if interactive (before STD) */
|
||||
static void _key(const 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
|
|
@ -23,11 +23,11 @@ static void _setup(void)
|
|||
Evas_Object *o;
|
||||
for (i = 0; i < OBNUM; i++)
|
||||
{
|
||||
o = efl_add(EFL_CANVAS_IMAGE_CLASS, evas);
|
||||
o = evas_object_image_add(evas);
|
||||
o_images[i] = o;
|
||||
efl_file_simple_load(o, build_path("bar.png"), NULL);
|
||||
efl_gfx_image_border_insets_set(o, 6, 6, 6, 6);
|
||||
efl_gfx_entity_visible_set(o, EINA_TRUE);
|
||||
evas_object_image_file_set(o, build_path("bar.png"), NULL);
|
||||
evas_object_image_border_set(o, 6, 6, 6, 6);
|
||||
evas_object_show(o);
|
||||
}
|
||||
done = 0;
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ static void _setup(void)
|
|||
static void _cleanup(void)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < OBNUM; i++) efl_del(o_images[i]);
|
||||
for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]);
|
||||
}
|
||||
|
||||
/* loop - do things */
|
||||
|
@ -54,15 +54,15 @@ static void _loop(double t, int f)
|
|||
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);
|
||||
efl_gfx_entity_position_set(o_images[i], EINA_POSITION2D(x, y));
|
||||
efl_gfx_entity_size_set(o_images[i], EINA_SIZE2D(w, h));
|
||||
efl_gfx_fill_set(o_images[i], EINA_RECT(0, 0, w, h));
|
||||
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(const char *key)
|
||||
static void _key(char *key)
|
||||
{
|
||||
KEY_STD;
|
||||
}
|
||||
|
@ -94,7 +94,8 @@ void FNAME(void);
|
|||
# ifndef UI
|
||||
void FNAME(void)
|
||||
{
|
||||
ui_func_set(_key, _loop, _setup);
|
||||
ui_func_set(_key, _loop);
|
||||
_setup();
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
|
|
@ -23,12 +23,12 @@ static void _setup(void)
|
|||
Evas_Object *o;
|
||||
for (i = 0; i < OBNUM; i++)
|
||||
{
|
||||
o = efl_add(EFL_CANVAS_IMAGE_CLASS, evas);
|
||||
o = evas_object_image_add(evas);
|
||||
o_images[i] = o;
|
||||
efl_file_simple_load(o, build_path("pan.png"), NULL);
|
||||
efl_gfx_color_set(o, 64, 64, 64, 255);
|
||||
efl_gfx_image_border_insets_set(o, 3, 3, 3, 3);
|
||||
efl_gfx_entity_visible_set(o, EINA_TRUE);
|
||||
evas_object_image_file_set(o, build_path("pan.png"), NULL);
|
||||
evas_object_color_set(o, 64, 64, 64, 255);
|
||||
evas_object_image_border_set(o, 3, 3, 3, 3);
|
||||
evas_object_show(o);
|
||||
}
|
||||
done = 0;
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ static void _setup(void)
|
|||
static void _cleanup(void)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < OBNUM; i++) efl_del(o_images[i]);
|
||||
for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]);
|
||||
}
|
||||
|
||||
/* loop - do things */
|
||||
|
@ -55,15 +55,15 @@ static void _loop(double t, int f)
|
|||
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);
|
||||
efl_gfx_entity_position_set(o_images[i], EINA_POSITION2D(x, y));
|
||||
efl_gfx_entity_size_set(o_images[i], EINA_SIZE2D(w, h));
|
||||
efl_gfx_fill_set(o_images[i], EINA_RECT(0, 0, w, h));
|
||||
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(const char *key)
|
||||
static void _key(char *key)
|
||||
{
|
||||
KEY_STD;
|
||||
}
|
||||
|
@ -95,7 +95,8 @@ void FNAME(void);
|
|||
# ifndef UI
|
||||
void FNAME(void)
|
||||
{
|
||||
ui_func_set(_key, _loop, _setup);
|
||||
ui_func_set(_key, _loop);
|
||||
_setup();
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
|
|
@ -25,15 +25,15 @@ static void _setup(void)
|
|||
{
|
||||
int a;
|
||||
|
||||
o = efl_add(EFL_CANVAS_IMAGE_CLASS, evas);
|
||||
o = evas_object_image_add(evas);
|
||||
o_images[i] = o;
|
||||
efl_file_simple_load(o, build_path("logo.png"), NULL);
|
||||
efl_gfx_fill_set(o, EINA_RECT(0, 0, 120, 160));
|
||||
efl_gfx_entity_size_set(o, EINA_SIZE2D(120, 160));
|
||||
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;
|
||||
efl_gfx_color_set(o, a, a, a, a);
|
||||
efl_gfx_entity_visible_set(o, EINA_TRUE);
|
||||
evas_object_color_set(o, a, a, a, a);
|
||||
evas_object_show(o);
|
||||
}
|
||||
done = 0;
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ static void _setup(void)
|
|||
static void _cleanup(void)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < OBNUM; i++) efl_del(o_images[i]);
|
||||
for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]);
|
||||
}
|
||||
|
||||
/* loop - do things */
|
||||
|
@ -58,13 +58,13 @@ static void _loop(double t, int f)
|
|||
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);
|
||||
efl_gfx_entity_position_set(o_images[i], EINA_POSITION2D(x, y));
|
||||
evas_object_move(o_images[i], x, y);
|
||||
}
|
||||
FPS_STD(NAME);
|
||||
}
|
||||
|
||||
/* prepend special key handlers if interactive (before STD) */
|
||||
static void _key(const char *key)
|
||||
static void _key(char *key)
|
||||
{
|
||||
KEY_STD;
|
||||
}
|
||||
|
@ -96,7 +96,8 @@ void FNAME(void);
|
|||
# ifndef UI
|
||||
void FNAME(void)
|
||||
{
|
||||
ui_func_set(_key, _loop, _setup);
|
||||
ui_func_set(_key, _loop);
|
||||
_setup();
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
|
|
@ -24,14 +24,15 @@ static void _setup(void)
|
|||
for (i = 0; i < OBNUM; i++)
|
||||
{
|
||||
int a;
|
||||
o = efl_add(EFL_CANVAS_IMAGE_CLASS, evas);
|
||||
|
||||
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;
|
||||
efl_file_simple_load(o, build_path("logo.png"), NULL);
|
||||
efl_gfx_fill_set(o, EINA_RECT(0, 0, 120, 160));
|
||||
efl_gfx_entity_size_set(o, EINA_SIZE2D(120, 160));
|
||||
efl_gfx_color_set(o, a, a, a, a);
|
||||
efl_gfx_entity_visible_set(o, EINA_TRUE);
|
||||
evas_object_color_set(o, a, a, a, a);
|
||||
evas_object_show(o);
|
||||
}
|
||||
done = 0;
|
||||
}
|
||||
|
@ -40,7 +41,7 @@ static void _setup(void)
|
|||
static void _cleanup(void)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < OBNUM; i++) efl_del(o_images[i]);
|
||||
for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]);
|
||||
}
|
||||
|
||||
/* loop - do things */
|
||||
|
@ -56,13 +57,13 @@ static void _loop(double t, int f)
|
|||
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);
|
||||
efl_gfx_entity_position_set(o_images[i], EINA_POSITION2D(x, y));
|
||||
evas_object_move(o_images[i], x, y);
|
||||
}
|
||||
FPS_STD(NAME);
|
||||
}
|
||||
|
||||
/* prepend special key handlers if interactive (before STD) */
|
||||
static void _key(const char *key)
|
||||
static void _key(char *key)
|
||||
{
|
||||
KEY_STD;
|
||||
}
|
||||
|
@ -94,7 +95,8 @@ void FNAME(void);
|
|||
# ifndef UI
|
||||
void FNAME(void)
|
||||
{
|
||||
ui_func_set(_key, _loop, _setup);
|
||||
ui_func_set(_key, _loop);
|
||||
_setup();
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
|
|
@ -1,105 +0,0 @@
|
|||
#undef FNAME
|
||||
#undef NAME
|
||||
#undef ICON
|
||||
|
||||
/* metadata */
|
||||
#define FNAME image_blend_many_smooth_down_scaled_start
|
||||
#define NAME "Image Blend Many Smooth Down Scaled"
|
||||
#define ICON "blend.png"
|
||||
|
||||
#ifndef PROTO
|
||||
# ifndef UI
|
||||
# include "main.h"
|
||||
|
||||
#define MANYNUM 8192
|
||||
|
||||
/* standard var */
|
||||
static int done = 0;
|
||||
/* private data */
|
||||
static Evas_Object *o_images[MANYNUM];
|
||||
|
||||
/* setup */
|
||||
static void _setup(void)
|
||||
{
|
||||
int i, w, h, n;
|
||||
Evas_Object *o;
|
||||
for (i = 0; i < MANYNUM; i++)
|
||||
{
|
||||
o = efl_add(EFL_CANVAS_IMAGE_CLASS, evas);
|
||||
o_images[i] = o;
|
||||
n = rnd() % 100;
|
||||
w = 3 + ((n * (60 - 3)) / 100);
|
||||
h = 4 + ((n * (80 - 4)) / 100);
|
||||
efl_file_simple_load(o, build_path("logo.png"), NULL);
|
||||
efl_gfx_image_smooth_scale_set(o, 1);
|
||||
efl_gfx_entity_size_set(o, EINA_SIZE2D(w, h));
|
||||
efl_gfx_fill_set(o, EINA_RECT(0, 0, w, h));
|
||||
efl_gfx_entity_visible_set(o, EINA_TRUE);
|
||||
}
|
||||
done = 0;
|
||||
}
|
||||
|
||||
/* cleanup */
|
||||
static void _cleanup(void)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < MANYNUM; i++) efl_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 < MANYNUM; i++)
|
||||
{
|
||||
exp_size_get(o_images[i], &w, &h);
|
||||
x = (win_w / 2) - (w / 2);
|
||||
x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (win_w / 2);
|
||||
y = (win_h / 2) - (h / 2);
|
||||
y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (win_h / 2);
|
||||
efl_gfx_entity_position_set(o_images[i], EINA_POSITION2D(x, y));
|
||||
}
|
||||
FPS_STD(NAME);
|
||||
}
|
||||
|
||||
/* prepend special key handlers if interactive (before STD) */
|
||||
static void _key(const 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
|
|
@ -23,11 +23,11 @@ static void _setup(void)
|
|||
Evas_Object *o;
|
||||
for (i = 0; i < OBNUM; i++)
|
||||
{
|
||||
o = efl_add(EFL_CANVAS_IMAGE_CLASS, evas);
|
||||
o = evas_object_image_add(evas);
|
||||
o_images[i] = o;
|
||||
efl_file_simple_load(o, build_path("logo.png"), NULL);
|
||||
efl_gfx_image_smooth_scale_set(o, 0);
|
||||
efl_gfx_entity_visible_set(o, EINA_TRUE);
|
||||
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;
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ static void _setup(void)
|
|||
static void _cleanup(void)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < OBNUM; i++) efl_del(o_images[i]);
|
||||
for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]);
|
||||
}
|
||||
|
||||
/* loop - do things */
|
||||
|
@ -54,15 +54,15 @@ static void _loop(double t, int f)
|
|||
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);
|
||||
efl_gfx_entity_position_set(o_images[i], EINA_POSITION2D(x, y));
|
||||
efl_gfx_entity_size_set(o_images[i], EINA_SIZE2D(w, h));
|
||||
efl_gfx_fill_set(o_images[i], EINA_RECT(0, 0, w, h));
|
||||
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(const char *key)
|
||||
static void _key(char *key)
|
||||
{
|
||||
KEY_STD;
|
||||
}
|
||||
|
@ -94,7 +94,8 @@ void FNAME(void);
|
|||
# ifndef UI
|
||||
void FNAME(void)
|
||||
{
|
||||
ui_func_set(_key, _loop, _setup);
|
||||
ui_func_set(_key, _loop);
|
||||
_setup();
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
|
|
@ -23,11 +23,11 @@ static void _setup(void)
|
|||
Evas_Object *o;
|
||||
for (i = 0; i < OBNUM; i++)
|
||||
{
|
||||
o = efl_add(EFL_CANVAS_IMAGE_CLASS, evas);
|
||||
o = evas_object_image_add(evas);
|
||||
o_images[i] = o;
|
||||
efl_file_simple_load(o, build_path("logo.png"), NULL);
|
||||
efl_gfx_image_smooth_scale_set(o, 0);
|
||||
efl_gfx_entity_visible_set(o, EINA_TRUE);
|
||||
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;
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ static void _setup(void)
|
|||
static void _cleanup(void)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < OBNUM; i++) efl_del(o_images[i]);
|
||||
for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]);
|
||||
}
|
||||
|
||||
/* loop - do things */
|
||||
|
@ -54,15 +54,15 @@ static void _loop(double t, int f)
|
|||
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);
|
||||
efl_gfx_entity_position_set(o_images[i], EINA_POSITION2D(x, y));
|
||||
efl_gfx_entity_size_set(o_images[i], EINA_SIZE2D(w, h));
|
||||
efl_gfx_fill_set(o_images[i], EINA_RECT(0, 0, w, h));
|
||||
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(const char *key)
|
||||
static void _key(char *key)
|
||||
{
|
||||
KEY_STD;
|
||||
}
|
||||
|
@ -94,7 +94,8 @@ void FNAME(void);
|
|||
# ifndef UI
|
||||
void FNAME(void)
|
||||
{
|
||||
ui_func_set(_key, _loop, _setup);
|
||||
ui_func_set(_key, _loop);
|
||||
_setup();
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
|
|
@ -23,11 +23,11 @@ static void _setup(void)
|
|||
Evas_Object *o;
|
||||
for (i = 0; i < OBNUM; i++)
|
||||
{
|
||||
o = efl_add(EFL_CANVAS_IMAGE_CLASS, evas);
|
||||
o = evas_object_image_add(evas);
|
||||
o_images[i] = o;
|
||||
efl_file_simple_load(o, build_path("image.png"), NULL);
|
||||
efl_gfx_image_smooth_scale_set(o, 0);
|
||||
efl_gfx_entity_visible_set(o, EINA_TRUE);
|
||||
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;
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ static void _setup(void)
|
|||
static void _cleanup(void)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < OBNUM; i++) efl_del(o_images[i]);
|
||||
for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]);
|
||||
}
|
||||
|
||||
/* loop - do things */
|
||||
|
@ -54,15 +54,15 @@ static void _loop(double t, int f)
|
|||
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);
|
||||
efl_gfx_entity_position_set(o_images[i], EINA_POSITION2D(x, y));
|
||||
efl_gfx_entity_size_set(o_images[i], EINA_SIZE2D(w, h));
|
||||
efl_gfx_fill_set(o_images[i], EINA_RECT(0, 0, w, h));
|
||||
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(const char *key)
|
||||
static void _key(char *key)
|
||||
{
|
||||
KEY_STD;
|
||||
}
|
||||
|
@ -94,7 +94,8 @@ void FNAME(void);
|
|||
# ifndef UI
|
||||
void FNAME(void)
|
||||
{
|
||||
ui_func_set(_key, _loop, _setup);
|
||||
ui_func_set(_key, _loop);
|
||||
_setup();
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
|
|
@ -23,11 +23,11 @@ static void _setup(void)
|
|||
Evas_Object *o;
|
||||
for (i = 0; i < OBNUM; i++)
|
||||
{
|
||||
o = efl_add(EFL_CANVAS_IMAGE_CLASS, evas);
|
||||
o = evas_object_image_add(evas);
|
||||
o_images[i] = o;
|
||||
efl_file_simple_load(o, build_path("image.png"), NULL);
|
||||
efl_gfx_image_smooth_scale_set(o, 0);
|
||||
efl_gfx_entity_visible_set(o, EINA_TRUE);
|
||||
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;
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ static void _setup(void)
|
|||
static void _cleanup(void)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < OBNUM; i++) efl_del(o_images[i]);
|
||||
for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]);
|
||||
}
|
||||
|
||||
/* loop - do things */
|
||||
|
@ -54,15 +54,15 @@ static void _loop(double t, int f)
|
|||
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);
|
||||
efl_gfx_entity_position_set(o_images[i], EINA_POSITION2D(x, y));
|
||||
efl_gfx_entity_size_set(o_images[i], EINA_SIZE2D(w, h));
|
||||
efl_gfx_fill_set(o_images[i], EINA_RECT(0, 0, w, h));
|
||||
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(const char *key)
|
||||
static void _key(char *key)
|
||||
{
|
||||
KEY_STD;
|
||||
}
|
||||
|
@ -94,7 +94,8 @@ void FNAME(void);
|
|||
# ifndef UI
|
||||
void FNAME(void)
|
||||
{
|
||||
ui_func_set(_key, _loop, _setup);
|
||||
ui_func_set(_key, _loop);
|
||||
_setup();
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
|
|
@ -24,24 +24,22 @@ static void _setup(void)
|
|||
srnd();
|
||||
for (i = 0; i < OBNUM; i++)
|
||||
{
|
||||
o = efl_add(EFL_CANVAS_IMAGE_CLASS, evas);
|
||||
o = evas_object_image_add(evas);
|
||||
o_images[i] = o;
|
||||
if (i < (OBNUM / 2))
|
||||
{
|
||||
efl_file_simple_load(o, build_path("logo.png"), NULL);
|
||||
}
|
||||
evas_object_image_file_set(o, build_path("logo.png"), NULL);
|
||||
else
|
||||
{
|
||||
Evas_Coord x, y;
|
||||
|
||||
evas_object_image_file_set(o, build_path("image.png"), NULL);
|
||||
x = (win_w / 4) + (((rnd() & 0xff) * ((win_w / 2) - 120)) >> 8);
|
||||
y = (win_h / 4) + (((rnd() & 0xff) * ((win_h / 2) - 120)) >> 8);
|
||||
efl_file_simple_load(o, build_path("image.png"), NULL);
|
||||
efl_gfx_entity_position_set(o, EINA_POSITION2D(x, y));
|
||||
evas_object_move(o, x, y);
|
||||
}
|
||||
efl_gfx_fill_set(o, EINA_RECT(0, 0, 120, 160));
|
||||
efl_gfx_entity_size_set(o, EINA_SIZE2D(120, 160));
|
||||
efl_gfx_entity_visible_set(o, EINA_TRUE);
|
||||
evas_object_image_fill_set(o, 0, 0, 120, 160);
|
||||
evas_object_resize(o, 120, 160);
|
||||
evas_object_show(o);
|
||||
}
|
||||
done = 0;
|
||||
}
|
||||
|
@ -50,7 +48,7 @@ static void _setup(void)
|
|||
static void _cleanup(void)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < OBNUM; i++) efl_del(o_images[i]);
|
||||
for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]);
|
||||
}
|
||||
|
||||
/* loop - do things */
|
||||
|
@ -68,14 +66,14 @@ static void _loop(double t, int f)
|
|||
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);
|
||||
efl_gfx_entity_position_set(o_images[i], EINA_POSITION2D(x, y));
|
||||
evas_object_move(o_images[i], x, y);
|
||||
}
|
||||
}
|
||||
FPS_STD(NAME);
|
||||
}
|
||||
|
||||
/* prepend special key handlers if interactive (before STD) */
|
||||
static void _key(const char *key)
|
||||
static void _key(char *key)
|
||||
{
|
||||
KEY_STD;
|
||||
}
|
||||
|
@ -107,7 +105,8 @@ void FNAME(void);
|
|||
# ifndef UI
|
||||
void FNAME(void)
|
||||
{
|
||||
ui_func_set(_key, _loop, _setup);
|
||||
ui_func_set(_key, _loop);
|
||||
_setup();
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
|
|
@ -27,24 +27,22 @@ static void _setup(void)
|
|||
srnd();
|
||||
for (i = 0; i < OBNUM; i++)
|
||||
{
|
||||
o = efl_add(EFL_CANVAS_IMAGE_CLASS, evas);
|
||||
o = evas_object_image_add(evas);
|
||||
o_images[i] = o;
|
||||
if (i < (OBNUM / 2))
|
||||
{
|
||||
efl_file_simple_load(o, PACKAGE_DATA_DIR"/data/logo.png", NULL);
|
||||
}
|
||||
evas_object_image_file_set(o, PACKAGE_DATA_DIR"/data/logo.png", NULL);
|
||||
else
|
||||
{
|
||||
Evas_Coord x, y;
|
||||
|
||||
evas_object_image_file_set(o, PACKAGE_DATA_DIR"/data/image.png", NULL);
|
||||
x = (win_w / 4) + (((rnd() & 0xff) * ((win_w / 2) - 120)) >> 8);
|
||||
y = (win_h / 4) + (((rnd() & 0xff) * ((win_h / 2) - 120)) >> 8);
|
||||
efl_file_simple_load(o, PACKAGE_DATA_DIR"/data/image.png", NULL);
|
||||
efl_gfx_entity_position_set(o, EINA_POSITION2D(x, y));
|
||||
evas_object_move(o, x, y);
|
||||
}
|
||||
efl_gfx_fill_set(o, EINA_RECT(0, 0, 120, 160));
|
||||
efl_gfx_entity_size_set(o, EINA_SIZE2D(120, 160));
|
||||
efl_gfx_entity_visible_set(o, EINA_TRUE);
|
||||
evas_object_image_fill_set(o, 0, 0, 120, 160);
|
||||
evas_object_resize(o, 120, 160);
|
||||
evas_object_show(o);
|
||||
}
|
||||
done = 0;
|
||||
}
|
||||
|
@ -53,13 +51,12 @@ static void _setup(void)
|
|||
static void _cleanup(void)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < OBNUM; i++) efl_del(o_images[i]);
|
||||
for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]);
|
||||
}
|
||||
|
||||
/* loop - do things */
|
||||
static void _loop(double t, int f)
|
||||
{
|
||||
static int k = 0;
|
||||
int i;
|
||||
Evas_Coord x, y, w, h;
|
||||
for (i = 0; i < OBNUM; i++)
|
||||
|
@ -69,18 +66,17 @@ static void _loop(double t, int f)
|
|||
w = 120;
|
||||
h = 160;
|
||||
x = (win_w / 2) - (w / 2);
|
||||
x += sin((double)(f + ((i + k) * 13)) / (36.7 * SLOW)) * (w / 2);
|
||||
x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2);
|
||||
y = (win_h / 2) - (h / 2);
|
||||
y += cos((double)(f + ((i + k) * 28)) / (43.8 * SLOW)) * (h / 2);
|
||||
efl_gfx_entity_position_set(o_images[i], EINA_POSITION2D(x, y));
|
||||
y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h / 2);
|
||||
evas_object_move(o_images[i], x, y);
|
||||
}
|
||||
}
|
||||
++k;
|
||||
FPS_STD(NAME);
|
||||
}
|
||||
|
||||
/* prepend special key handlers if interactive (before STD) */
|
||||
static void _key(const char *key)
|
||||
static void _key(char *key)
|
||||
{
|
||||
KEY_STD;
|
||||
}
|
||||
|
@ -112,7 +108,8 @@ void FNAME(void);
|
|||
# ifndef UI
|
||||
void FNAME(void)
|
||||
{
|
||||
ui_func_set(_key, _loop, _setup);
|
||||
ui_func_set(_key, _loop);
|
||||
_setup();
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
|
|
@ -27,24 +27,22 @@ static void _setup(void)
|
|||
srnd();
|
||||
for (i = 0; i < OBNUM; i++)
|
||||
{
|
||||
o = efl_add(EFL_CANVAS_IMAGE_CLASS, evas);
|
||||
o = evas_object_image_add(evas);
|
||||
o_images[i] = o;
|
||||
if (i < (OBNUM / 2))
|
||||
{
|
||||
efl_file_simple_load(o, build_path("logo.png"), NULL);
|
||||
}
|
||||
evas_object_image_file_set(o, build_path("logo.png"), NULL);
|
||||
else
|
||||
{
|
||||
Evas_Coord x, y;
|
||||
|
||||
evas_object_image_file_set(o, build_path("image.png"), NULL);
|
||||
x = (win_w / 4) + (((rnd() & 0xff) * ((win_w / 2) - 120)) >> 8);
|
||||
y = (win_h / 4) + (((rnd() & 0xff) * ((win_h / 2) - 120)) >> 8);
|
||||
efl_file_simple_load(o, build_path("image.png"), NULL);
|
||||
efl_gfx_entity_position_set(o, EINA_POSITION2D(x, y));
|
||||
evas_object_move(o, x, y);
|
||||
}
|
||||
efl_gfx_fill_set(o, EINA_RECT(0, 0, 120, 160));
|
||||
efl_gfx_entity_size_set(o, EINA_SIZE2D(120, 160));
|
||||
efl_gfx_entity_visible_set(o, EINA_TRUE);
|
||||
evas_object_image_fill_set(o, 0, 0, 120, 160);
|
||||
evas_object_resize(o, 120, 160);
|
||||
evas_object_show(o);
|
||||
}
|
||||
done = 0;
|
||||
}
|
||||
|
@ -53,7 +51,7 @@ static void _setup(void)
|
|||
static void _cleanup(void)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < OBNUM; i++) efl_del(o_images[i]);
|
||||
for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]);
|
||||
}
|
||||
|
||||
/* loop - do things */
|
||||
|
@ -71,14 +69,14 @@ static void _loop(double t, int f)
|
|||
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);
|
||||
efl_gfx_entity_position_set(o_images[i], EINA_POSITION2D(x, y));
|
||||
evas_object_move(o_images[i], x, y);
|
||||
}
|
||||
}
|
||||
FPS_STD(NAME);
|
||||
}
|
||||
|
||||
/* prepend special key handlers if interactive (before STD) */
|
||||
static void _key(const char *key)
|
||||
static void _key(char *key)
|
||||
{
|
||||
KEY_STD;
|
||||
}
|
||||
|
@ -110,7 +108,8 @@ void FNAME(void);
|
|||
# ifndef UI
|
||||
void FNAME(void)
|
||||
{
|
||||
ui_func_set(_key, _loop, _setup);
|
||||
ui_func_set(_key, _loop);
|
||||
_setup();
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
|
|
@ -27,24 +27,22 @@ static void _setup(void)
|
|||
srnd();
|
||||
for (i = 0; i < OBNUM; i++)
|
||||
{
|
||||
o = efl_add(EFL_CANVAS_IMAGE_CLASS, evas);
|
||||
o = evas_object_image_add(evas);
|
||||
o_images[i] = o;
|
||||
if (i < (OBNUM / 2))
|
||||
{
|
||||
efl_file_simple_load(o, build_path("logo.png"), NULL);
|
||||
}
|
||||
evas_object_image_file_set(o, build_path("logo.png"), NULL);
|
||||
else
|
||||
{
|
||||
Evas_Coord x, y;
|
||||
|
||||
evas_object_image_file_set(o, build_path("image.png"), NULL);
|
||||
x = (win_w / 4) + (((rnd() & 0xff) * ((win_w / 2) - 120)) >> 8);
|
||||
y = (win_h / 4) + (((rnd() & 0xff) * ((win_h / 2) - 120)) >> 8);
|
||||
efl_file_simple_load(o, build_path("image.png"), NULL);
|
||||
efl_gfx_entity_position_set(o, EINA_POSITION2D(x, y));
|
||||
evas_object_move(o, x, y);
|
||||
}
|
||||
efl_gfx_fill_set(o, EINA_RECT(0, 0, 120, 160));
|
||||
efl_gfx_entity_size_set(o, EINA_SIZE2D(120, 160));
|
||||
efl_gfx_entity_visible_set(o, EINA_TRUE);
|
||||
evas_object_image_fill_set(o, 0, 0, 120, 160);
|
||||
evas_object_resize(o, 120, 160);
|
||||
evas_object_show(o);
|
||||
}
|
||||
done = 0;
|
||||
}
|
||||
|
@ -53,7 +51,7 @@ static void _setup(void)
|
|||
static void _cleanup(void)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < OBNUM; i++) efl_del(o_images[i]);
|
||||
for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]);
|
||||
}
|
||||
|
||||
/* loop - do things */
|
||||
|
@ -71,14 +69,14 @@ static void _loop(double t, int f)
|
|||
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);
|
||||
efl_gfx_entity_position_set(o_images[i], EINA_POSITION2D(x, y));
|
||||
evas_object_move(o_images[i], x, y);
|
||||
}
|
||||
}
|
||||
FPS_STD(NAME);
|
||||
}
|
||||
|
||||
/* prepend special key handlers if interactive (before STD) */
|
||||
static void _key(const char *key)
|
||||
static void _key(char *key)
|
||||
{
|
||||
KEY_STD;
|
||||
}
|
||||
|
@ -110,7 +108,8 @@ void FNAME(void);
|
|||
# ifndef UI
|
||||
void FNAME(void)
|
||||
{
|
||||
ui_func_set(_key, _loop, _setup);
|
||||
ui_func_set(_key, _loop);
|
||||
_setup();
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
|
|
@ -24,24 +24,22 @@ static void _setup(void)
|
|||
srnd();
|
||||
for (i = 0; i < OBNUM; i++)
|
||||
{
|
||||
o = efl_add(EFL_CANVAS_IMAGE_CLASS, evas);
|
||||
o = evas_object_image_add(evas);
|
||||
o_images[i] = o;
|
||||
if (i & 0x1)
|
||||
{
|
||||
efl_file_simple_load(o, build_path("logo.png"), NULL);
|
||||
}
|
||||
evas_object_image_file_set(o, build_path("logo.png"), NULL);
|
||||
else
|
||||
{
|
||||
Evas_Coord x, y;
|
||||
|
||||
evas_object_image_file_set(o, build_path("image.png"), NULL);
|
||||
x = (win_w / 4) + (((rnd() & 0xff) * ((win_w / 2) - 120)) >> 8);
|
||||
y = (win_h / 4) + (((rnd() & 0xff) * ((win_h / 2) - 120)) >> 8);
|
||||
efl_file_simple_load(o, build_path("image.png"), NULL);
|
||||
efl_gfx_entity_position_set(o, EINA_POSITION2D(x, y));
|
||||
evas_object_move(o, x, y);
|
||||
}
|
||||
efl_gfx_fill_set(o, EINA_RECT(0, 0, 120, 160));
|
||||
efl_gfx_entity_size_set(o, EINA_SIZE2D(120, 160));
|
||||
efl_gfx_entity_visible_set(o, EINA_TRUE);
|
||||
evas_object_image_fill_set(o, 0, 0, 120, 160);
|
||||
evas_object_resize(o, 120, 160);
|
||||
evas_object_show(o);
|
||||
}
|
||||
done = 0;
|
||||
}
|
||||
|
@ -50,7 +48,7 @@ static void _setup(void)
|
|||
static void _cleanup(void)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < OBNUM; i++) efl_del(o_images[i]);
|
||||
for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]);
|
||||
}
|
||||
|
||||
/* loop - do things */
|
||||
|
@ -68,14 +66,14 @@ static void _loop(double t, int f)
|
|||
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);
|
||||
efl_gfx_entity_position_set(o_images[i], EINA_POSITION2D(x, y));
|
||||
evas_object_move(o_images[i], x, y);
|
||||
}
|
||||
}
|
||||
FPS_STD(NAME);
|
||||
}
|
||||
|
||||
/* prepend special key handlers if interactive (before STD) */
|
||||
static void _key(const char *key)
|
||||
static void _key(char *key)
|
||||
{
|
||||
KEY_STD;
|
||||
}
|
||||
|
@ -107,7 +105,8 @@ void FNAME(void);
|
|||
# ifndef UI
|
||||
void FNAME(void)
|
||||
{
|
||||
ui_func_set(_key, _loop, _setup);
|
||||
ui_func_set(_key, _loop);
|
||||
_setup();
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
|
|
@ -27,24 +27,22 @@ static void _setup(void)
|
|||
srnd();
|
||||
for (i = 0; i < OBNUM; i++)
|
||||
{
|
||||
o = efl_add(EFL_CANVAS_IMAGE_CLASS, evas);
|
||||
o = evas_object_image_add(evas);
|
||||
o_images[i] = o;
|
||||
if (i & 0x1)
|
||||
{
|
||||
efl_file_simple_load(o, build_path("logo.png"), NULL);
|
||||
}
|
||||
evas_object_image_file_set(o, build_path("logo.png"), NULL);
|
||||
else
|
||||
{
|
||||
Evas_Coord x, y;
|
||||
|
||||
evas_object_image_file_set(o, build_path("image.png"), NULL);
|
||||
x = (win_w / 4) + (((rnd() & 0xff) * ((win_w / 2) - 120)) >> 8);
|
||||
y = (win_h / 4) + (((rnd() & 0xff) * ((win_h / 2) - 120)) >> 8);
|
||||
efl_file_simple_load(o, build_path("image.png"), NULL);
|
||||
efl_gfx_entity_position_set(o, EINA_POSITION2D(x, y));
|
||||
evas_object_move(o, x, y);
|
||||
}
|
||||
efl_gfx_fill_set(o, EINA_RECT(0, 0, 120, 160));
|
||||
efl_gfx_entity_size_set(o, EINA_SIZE2D(120, 160));
|
||||
efl_gfx_entity_visible_set(o, EINA_TRUE);
|
||||
evas_object_image_fill_set(o, 0, 0, 120, 160);
|
||||
evas_object_resize(o, 120, 160);
|
||||
evas_object_show(o);
|
||||
}
|
||||
done = 0;
|
||||
}
|
||||
|
@ -53,13 +51,12 @@ static void _setup(void)
|
|||
static void _cleanup(void)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < OBNUM; i++) efl_del(o_images[i]);
|
||||
for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]);
|
||||
}
|
||||
|
||||
/* loop - do things */
|
||||
static void _loop(double t, int f)
|
||||
{
|
||||
static int k = 0;
|
||||
int i;
|
||||
Evas_Coord x, y, w, h;
|
||||
for (i = 0; i < OBNUM; i++)
|
||||
|
@ -69,18 +66,17 @@ static void _loop(double t, int f)
|
|||
w = 120;
|
||||
h = 160;
|
||||
x = (win_w / 2) - (w / 2);
|
||||
x += sin((double)(f + ((i + k) * 13)) / (36.7 * SLOW)) * (w / 2);
|
||||
x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2);
|
||||
y = (win_h / 2) - (h / 2);
|
||||
y += cos((double)(f + ((i + k) * 28)) / (43.8 * SLOW)) * (h / 2);
|
||||
efl_gfx_entity_position_set(o_images[i], EINA_POSITION2D(x, y));
|
||||
y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h / 2);
|
||||
evas_object_move(o_images[i], x, y);
|
||||
}
|
||||
}
|
||||
k++;
|
||||
FPS_STD(NAME);
|
||||
}
|
||||
|
||||
/* prepend special key handlers if interactive (before STD) */
|
||||
static void _key(const char *key)
|
||||
static void _key(char *key)
|
||||
{
|
||||
KEY_STD;
|
||||
}
|
||||
|
@ -112,7 +108,8 @@ void FNAME(void);
|
|||
# ifndef UI
|
||||
void FNAME(void)
|
||||
{
|
||||
ui_func_set(_key, _loop, _setup);
|
||||
ui_func_set(_key, _loop);
|
||||
_setup();
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
|
|
@ -27,24 +27,22 @@ static void _setup(void)
|
|||
srnd();
|
||||
for (i = 0; i < OBNUM; i++)
|
||||
{
|
||||
o = efl_add(EFL_CANVAS_IMAGE_CLASS, evas);
|
||||
o = evas_object_image_add(evas);
|
||||
o_images[i] = o;
|
||||
if (i & 0x1)
|
||||
{
|
||||
efl_file_simple_load(o, build_path("logo.png"), NULL);
|
||||
}
|
||||
evas_object_image_file_set(o, build_path("logo.png"), NULL);
|
||||
else
|
||||
{
|
||||
Evas_Coord x, y;
|
||||
|
||||
evas_object_image_file_set(o, build_path("image.png"), NULL);
|
||||
x = (win_w / 4) + (((rnd() & 0xff) * ((win_w / 2) - 120)) >> 8);
|
||||
y = (win_h / 4) + (((rnd() & 0xff) * ((win_h / 2) - 120)) >> 8);
|
||||
efl_file_simple_load(o, build_path("image.png"), NULL);
|
||||
efl_gfx_entity_position_set(o, EINA_POSITION2D(x, y));
|
||||
evas_object_move(o, x, y);
|
||||
}
|
||||
efl_gfx_fill_set(o, EINA_RECT(0, 0, 120, 160));
|
||||
efl_gfx_entity_size_set(o, EINA_SIZE2D(120, 160));
|
||||
efl_gfx_entity_visible_set(o, EINA_TRUE);
|
||||
evas_object_image_fill_set(o, 0, 0, 120, 160);
|
||||
evas_object_resize(o, 120, 160);
|
||||
evas_object_show(o);
|
||||
}
|
||||
done = 0;
|
||||
}
|
||||
|
@ -53,7 +51,7 @@ static void _setup(void)
|
|||
static void _cleanup(void)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < OBNUM; i++) efl_del(o_images[i]);
|
||||
for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]);
|
||||
}
|
||||
|
||||
/* loop - do things */
|
||||
|
@ -71,14 +69,14 @@ static void _loop(double t, int f)
|
|||
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);
|
||||
efl_gfx_entity_position_set(o_images[i], EINA_POSITION2D(x, y));
|
||||
evas_object_move(o_images[i], x, y);
|
||||
}
|
||||
}
|
||||
FPS_STD(NAME);
|
||||
}
|
||||
|
||||
/* prepend special key handlers if interactive (before STD) */
|
||||
static void _key(const char *key)
|
||||
static void _key(char *key)
|
||||
{
|
||||
KEY_STD;
|
||||
}
|
||||
|
@ -110,7 +108,8 @@ void FNAME(void);
|
|||
# ifndef UI
|
||||
void FNAME(void)
|
||||
{
|
||||
ui_func_set(_key, _loop, _setup);
|
||||
ui_func_set(_key, _loop);
|
||||
_setup();
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
|
|
@ -27,24 +27,22 @@ static void _setup(void)
|
|||
srnd();
|
||||
for (i = 0; i < OBNUM; i++)
|
||||
{
|
||||
o = efl_add(EFL_CANVAS_IMAGE_CLASS, evas);
|
||||
o = evas_object_image_add(evas);
|
||||
o_images[i] = o;
|
||||
if (i & 0x1)
|
||||
{
|
||||
efl_file_simple_load(o, build_path("logo.png"), NULL);
|
||||
}
|
||||
evas_object_image_file_set(o, build_path("logo.png"), NULL);
|
||||
else
|
||||
{
|
||||
Evas_Coord x, y;
|
||||
|
||||
evas_object_image_file_set(o, build_path("image.png"), NULL);
|
||||
x = (win_w / 4) + (((rnd() & 0xff) * ((win_w / 2) - 120)) >> 8);
|
||||
y = (win_h / 4) + (((rnd() & 0xff) * ((win_h / 2) - 120)) >> 8);
|
||||
efl_file_simple_load(o, build_path("image.png"), NULL);
|
||||
efl_gfx_entity_position_set(o, EINA_POSITION2D(x, y));
|
||||
evas_object_move(o, x, y);
|
||||
}
|
||||
efl_gfx_fill_set(o, EINA_RECT(0, 0, 120, 160));
|
||||
efl_gfx_entity_size_set(o, EINA_SIZE2D(120, 160));
|
||||
efl_gfx_entity_visible_set(o, EINA_TRUE);
|
||||
evas_object_image_fill_set(o, 0, 0, 120, 160);
|
||||
evas_object_resize(o, 120, 160);
|
||||
evas_object_show(o);
|
||||
}
|
||||
done = 0;
|
||||
}
|
||||
|
@ -53,7 +51,7 @@ static void _setup(void)
|
|||
static void _cleanup(void)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < OBNUM; i++) efl_del(o_images[i]);
|
||||
for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]);
|
||||
}
|
||||
|
||||
/* loop - do things */
|
||||
|
@ -71,14 +69,14 @@ static void _loop(double t, int f)
|
|||
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);
|
||||
efl_gfx_entity_position_set(o_images[i], EINA_POSITION2D(x, y));
|
||||
evas_object_move(o_images[i], x, y);
|
||||
}
|
||||
}
|
||||
FPS_STD(NAME);
|
||||
}
|
||||
|
||||
/* prepend special key handlers if interactive (before STD) */
|
||||
static void _key(const char *key)
|
||||
static void _key(char *key)
|
||||
{
|
||||
KEY_STD;
|
||||
}
|
||||
|
@ -110,7 +108,8 @@ void FNAME(void);
|
|||
# ifndef UI
|
||||
void FNAME(void)
|
||||
{
|
||||
ui_func_set(_key, _loop, _setup);
|
||||
ui_func_set(_key, _loop);
|
||||
_setup();
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
|
|
@ -24,24 +24,22 @@ static void _setup(void)
|
|||
srnd();
|
||||
for (i = 0; i < OBNUM; i++)
|
||||
{
|
||||
o = efl_add(EFL_CANVAS_IMAGE_CLASS, evas);
|
||||
o = evas_object_image_add(evas);
|
||||
o_images[i] = o;
|
||||
if (i > (OBNUM / 2))
|
||||
{
|
||||
efl_file_simple_load(o, build_path("logo.png"), NULL);
|
||||
}
|
||||
evas_object_image_file_set(o, build_path("logo.png"), NULL);
|
||||
else
|
||||
{
|
||||
Evas_Coord x, y;
|
||||
|
||||
evas_object_image_file_set(o, build_path("image.png"), NULL);
|
||||
x = (win_w / 4) + (((rnd() & 0xff) * ((win_w / 2) - 120)) >> 8);
|
||||
y = (win_h / 4) + (((rnd() & 0xff) * ((win_h / 2) - 120)) >> 8);
|
||||
efl_file_simple_load(o, build_path("image.png"), NULL);
|
||||
efl_gfx_entity_position_set(o, EINA_POSITION2D(x, y));
|
||||
evas_object_move(o, x, y);
|
||||
}
|
||||
efl_gfx_fill_set(o, EINA_RECT(0, 0, 120, 160));
|
||||
efl_gfx_entity_size_set(o, EINA_SIZE2D(120, 160));
|
||||
efl_gfx_entity_visible_set(o, EINA_TRUE);
|
||||
evas_object_image_fill_set(o, 0, 0, 120, 160);
|
||||
evas_object_resize(o, 120, 160);
|
||||
evas_object_show(o);
|
||||
}
|
||||
done = 0;
|
||||
}
|
||||
|
@ -50,7 +48,7 @@ static void _setup(void)
|
|||
static void _cleanup(void)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < OBNUM; i++) efl_del(o_images[i]);
|
||||
for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]);
|
||||
}
|
||||
|
||||
/* loop - do things */
|
||||
|
@ -68,14 +66,14 @@ static void _loop(double t, int f)
|
|||
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);
|
||||
efl_gfx_entity_position_set(o_images[i], EINA_POSITION2D(x, y));
|
||||
evas_object_move(o_images[i], x, y);
|
||||
}
|
||||
}
|
||||
FPS_STD(NAME);
|
||||
}
|
||||
|
||||
/* prepend special key handlers if interactive (before STD) */
|
||||
static void _key(const char *key)
|
||||
static void _key(char *key)
|
||||
{
|
||||
KEY_STD;
|
||||
}
|
||||
|
@ -107,7 +105,8 @@ void FNAME(void);
|
|||
# ifndef UI
|
||||
void FNAME(void)
|
||||
{
|
||||
ui_func_set(_key, _loop, _setup);
|
||||
ui_func_set(_key, _loop);
|
||||
_setup();
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
|
|
@ -27,24 +27,22 @@ static void _setup(void)
|
|||
srnd();
|
||||
for (i = 0; i < OBNUM; i++)
|
||||
{
|
||||
o = efl_add(EFL_CANVAS_IMAGE_CLASS, evas);
|
||||
o = evas_object_image_add(evas);
|
||||
o_images[i] = o;
|
||||
if (i > (OBNUM / 2))
|
||||
{
|
||||
efl_file_simple_load(o, build_path("logo.png"), NULL);
|
||||
}
|
||||
evas_object_image_file_set(o, build_path("logo.png"), NULL);
|
||||
else
|
||||
{
|
||||
Evas_Coord x, y;
|
||||
|
||||
evas_object_image_file_set(o, build_path("image.png"), NULL);
|
||||
x = (win_w / 4) + (((rnd() & 0xff) * ((win_w / 2) - 120)) >> 8);
|
||||
y = (win_h / 4) + (((rnd() & 0xff) * ((win_h / 2) - 120)) >> 8);
|
||||
efl_file_simple_load(o, build_path("image.png"), NULL);
|
||||
efl_gfx_entity_position_set(o, EINA_POSITION2D(x, y));
|
||||
evas_object_move(o, x, y);
|
||||
}
|
||||
efl_gfx_fill_set(o, EINA_RECT(0, 0, 120, 160));
|
||||
efl_gfx_entity_size_set(o, EINA_SIZE2D(120, 160));
|
||||
efl_gfx_entity_visible_set(o, EINA_TRUE);
|
||||
evas_object_image_fill_set(o, 0, 0, 120, 160);
|
||||
evas_object_resize(o, 120, 160);
|
||||
evas_object_show(o);
|
||||
}
|
||||
done = 0;
|
||||
}
|
||||
|
@ -53,34 +51,32 @@ static void _setup(void)
|
|||
static void _cleanup(void)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < OBNUM; i++) efl_del(o_images[i]);
|
||||
for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]);
|
||||
}
|
||||
|
||||
/* loop - do things */
|
||||
static void _loop(double t, int f)
|
||||
{
|
||||
static int k = 0;
|
||||
int i;
|
||||
Evas_Coord x, y, w, h;
|
||||
for (i = 0; i < OBNUM; i++)
|
||||
{
|
||||
if (i < (OBNUM / 2))
|
||||
if (i > (OBNUM / 2))
|
||||
{
|
||||
w = 120;
|
||||
h = 160;
|
||||
x = (win_w / 2) - (w / 2);
|
||||
x += sin((double)(f + ((i + k) * 13)) / (36.7 * SLOW)) * (w / 2);
|
||||
x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2);
|
||||
y = (win_h / 2) - (h / 2);
|
||||
y += cos((double)(f + ((i + k) * 28)) / (43.8 * SLOW)) * (h / 2);
|
||||
efl_gfx_entity_position_set(o_images[i], EINA_POSITION2D(x, y));
|
||||
y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h / 2);
|
||||
evas_object_move(o_images[i], x, y);
|
||||
}
|
||||
}
|
||||
++k;
|
||||
FPS_STD(NAME);
|
||||
}
|
||||
|
||||
/* prepend special key handlers if interactive (before STD) */
|
||||
static void _key(const char *key)
|
||||
static void _key(char *key)
|
||||
{
|
||||
KEY_STD;
|
||||
}
|
||||
|
@ -112,7 +108,8 @@ void FNAME(void);
|
|||
# ifndef UI
|
||||
void FNAME(void)
|
||||
{
|
||||
ui_func_set(_key, _loop, _setup);
|
||||
ui_func_set(_key, _loop);
|
||||
_setup();
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
|
|
@ -27,24 +27,22 @@ static void _setup(void)
|
|||
srnd();
|
||||
for (i = 0; i < OBNUM; i++)
|
||||
{
|
||||
o = efl_add(EFL_CANVAS_IMAGE_CLASS, evas);
|
||||
o = evas_object_image_add(evas);
|
||||
o_images[i] = o;
|
||||
if (i > (OBNUM / 2))
|
||||
{
|
||||
efl_file_simple_load(o, build_path("logo.png"), NULL);
|
||||
}
|
||||
evas_object_image_file_set(o, build_path("logo.png"), NULL);
|
||||
else
|
||||
{
|
||||
Evas_Coord x, y;
|
||||
|
||||
evas_object_image_file_set(o, build_path("image.png"), NULL);
|
||||
x = (win_w / 4) + (((rnd() & 0xff) * ((win_w / 2) - 120)) >> 8);
|
||||
y = (win_h / 4) + (((rnd() & 0xff) * ((win_h / 2) - 120)) >> 8);
|
||||
efl_file_simple_load(o, build_path("image.png"), NULL);
|
||||
efl_gfx_entity_position_set(o, EINA_POSITION2D(x, y));
|
||||
evas_object_move(o, x, y);
|
||||
}
|
||||
efl_gfx_fill_set(o, EINA_RECT(0, 0, 120, 160));
|
||||
efl_gfx_entity_size_set(o, EINA_SIZE2D(120, 160));
|
||||
efl_gfx_entity_visible_set(o, EINA_TRUE);
|
||||
evas_object_image_fill_set(o, 0, 0, 120, 160);
|
||||
evas_object_resize(o, 120, 160);
|
||||
evas_object_show(o);
|
||||
}
|
||||
done = 0;
|
||||
}
|
||||
|
@ -53,7 +51,7 @@ static void _setup(void)
|
|||
static void _cleanup(void)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < OBNUM; i++) efl_del(o_images[i]);
|
||||
for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]);
|
||||
}
|
||||
|
||||
/* loop - do things */
|
||||
|
@ -71,14 +69,14 @@ static void _loop(double t, int f)
|
|||
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);
|
||||
efl_gfx_entity_position_set(o_images[i], EINA_POSITION2D(x, y));
|
||||
evas_object_move(o_images[i], x, y);
|
||||
}
|
||||
}
|
||||
FPS_STD(NAME);
|
||||
}
|
||||
|
||||
/* prepend special key handlers if interactive (before STD) */
|
||||
static void _key(const char *key)
|
||||
static void _key(char *key)
|
||||
{
|
||||
KEY_STD;
|
||||
}
|
||||
|
@ -110,7 +108,8 @@ void FNAME(void);
|
|||
# ifndef UI
|
||||
void FNAME(void)
|
||||
{
|
||||
ui_func_set(_key, _loop, _setup);
|
||||
ui_func_set(_key, _loop);
|
||||
_setup();
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
|
|
@ -27,24 +27,22 @@ static void _setup(void)
|
|||
srnd();
|
||||
for (i = 0; i < OBNUM; i++)
|
||||
{
|
||||
o = efl_add(EFL_CANVAS_IMAGE_CLASS, evas);
|
||||
o = evas_object_image_add(evas);
|
||||
o_images[i] = o;
|
||||
if (i > (OBNUM / 2))
|
||||
{
|
||||
efl_file_simple_load(o, build_path("logo.png"), NULL);
|
||||
}
|
||||
evas_object_image_file_set(o, build_path("logo.png"), NULL);
|
||||
else
|
||||
{
|
||||
Evas_Coord x, y;
|
||||
|
||||
evas_object_image_file_set(o, build_path("image.png"), NULL);
|
||||
x = (win_w / 4) + (((rnd() & 0xff) * ((win_w / 2) - 120)) >> 8);
|
||||
y = (win_h / 4) + (((rnd() & 0xff) * ((win_h / 2) - 120)) >> 8);
|
||||
efl_file_simple_load(o, build_path("image.png"), NULL);
|
||||
efl_gfx_entity_position_set(o, EINA_POSITION2D(x, y));
|
||||
evas_object_move(o, x, y);
|
||||
}
|
||||
efl_gfx_fill_set(o, EINA_RECT(0, 0, 120, 160));
|
||||
efl_gfx_entity_size_set(o, EINA_SIZE2D(120, 160));
|
||||
efl_gfx_entity_visible_set(o, EINA_TRUE);
|
||||
evas_object_image_fill_set(o, 0, 0, 120, 160);
|
||||
evas_object_resize(o, 120, 160);
|
||||
evas_object_show(o);
|
||||
}
|
||||
done = 0;
|
||||
}
|
||||
|
@ -53,7 +51,7 @@ static void _setup(void)
|
|||
static void _cleanup(void)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < OBNUM; i++) efl_del(o_images[i]);
|
||||
for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]);
|
||||
}
|
||||
|
||||
/* loop - do things */
|
||||
|
@ -71,14 +69,14 @@ static void _loop(double t, int f)
|
|||
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);
|
||||
efl_gfx_entity_position_set(o_images[i], EINA_POSITION2D(x, y));
|
||||
evas_object_move(o_images[i], x, y);
|
||||
}
|
||||
}
|
||||
FPS_STD(NAME);
|
||||
}
|
||||
|
||||
/* prepend special key handlers if interactive (before STD) */
|
||||
static void _key(const char *key)
|
||||
static void _key(char *key)
|
||||
{
|
||||
KEY_STD;
|
||||
}
|
||||
|
@ -110,7 +108,8 @@ void FNAME(void);
|
|||
# ifndef UI
|
||||
void FNAME(void)
|
||||
{
|
||||
ui_func_set(_key, _loop, _setup);
|
||||
ui_func_set(_key, _loop);
|
||||
_setup();
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
|
|
@ -23,11 +23,11 @@ static void _setup(void)
|
|||
Evas_Object *o;
|
||||
for (i = 0; i < OBNUM; i++)
|
||||
{
|
||||
o = efl_add(EFL_CANVAS_IMAGE_CLASS, evas);
|
||||
o = evas_object_image_add(evas);
|
||||
o_images[i] = o;
|
||||
efl_file_simple_load(o, build_path("logo.png"), NULL);
|
||||
efl_gfx_image_smooth_scale_set(o, 1);
|
||||
efl_gfx_entity_visible_set(o, EINA_TRUE);
|
||||
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;
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ static void _setup(void)
|
|||
static void _cleanup(void)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < OBNUM; i++) efl_del(o_images[i]);
|
||||
for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]);
|
||||
}
|
||||
|
||||
/* loop - do things */
|
||||
|
@ -54,15 +54,15 @@ static void _loop(double t, int f)
|
|||
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);
|
||||
efl_gfx_entity_position_set(o_images[i], EINA_POSITION2D(x, y));
|
||||
efl_gfx_entity_size_set(o_images[i], EINA_SIZE2D(w, h));
|
||||
efl_gfx_fill_set(o_images[i], EINA_RECT(0, 0, w, h));
|
||||
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(const char *key)
|
||||
static void _key(char *key)
|
||||
{
|
||||
KEY_STD;
|
||||
}
|
||||
|
@ -94,7 +94,8 @@ void FNAME(void);
|
|||
# ifndef UI
|
||||
void FNAME(void)
|
||||
{
|
||||
ui_func_set(_key, _loop, _setup);
|
||||
ui_func_set(_key, _loop);
|
||||
_setup();
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
|
|
@ -23,11 +23,11 @@ static void _setup(void)
|
|||
Evas_Object *o;
|
||||
for (i = 0; i < OBNUM; i++)
|
||||
{
|
||||
o = efl_add(EFL_CANVAS_IMAGE_CLASS, evas);
|
||||
o = evas_object_image_add(evas);
|
||||
o_images[i] = o;
|
||||
efl_file_simple_load(o, build_path("logo.png"), NULL);
|
||||
efl_gfx_image_smooth_scale_set(o, 1);
|
||||
efl_gfx_entity_visible_set(o, EINA_TRUE);
|
||||
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;
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ static void _setup(void)
|
|||
static void _cleanup(void)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < OBNUM; i++) efl_del(o_images[i]);
|
||||
for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]);
|
||||
}
|
||||
|
||||
/* loop - do things */
|
||||
|
@ -54,15 +54,15 @@ static void _loop(double t, int f)
|
|||
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);
|
||||
efl_gfx_entity_position_set(o_images[i], EINA_POSITION2D(x, y));
|
||||
efl_gfx_entity_size_set(o_images[i], EINA_SIZE2D(w, h));
|
||||
efl_gfx_fill_set(o_images[i], EINA_RECT(0, 0, w, h));
|
||||
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(const char *key)
|
||||
static void _key(char *key)
|
||||
{
|
||||
KEY_STD;
|
||||
}
|
||||
|
@ -94,7 +94,8 @@ void FNAME(void);
|
|||
# ifndef UI
|
||||
void FNAME(void)
|
||||
{
|
||||
ui_func_set(_key, _loop, _setup);
|
||||
ui_func_set(_key, _loop);
|
||||
_setup();
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
|
|
@ -23,11 +23,11 @@ static void _setup(void)
|
|||
Evas_Object *o;
|
||||
for (i = 0; i < OBNUM; i++)
|
||||
{
|
||||
o = efl_add(EFL_CANVAS_IMAGE_CLASS, evas);
|
||||
o = evas_object_image_add(evas);
|
||||
o_images[i] = o;
|
||||
efl_file_simple_load(o, build_path("image.png"), NULL);
|
||||
efl_gfx_image_smooth_scale_set(o, 1);
|
||||
efl_gfx_entity_visible_set(o, EINA_TRUE);
|
||||
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;
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ static void _setup(void)
|
|||
static void _cleanup(void)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < OBNUM; i++) efl_del(o_images[i]);
|
||||
for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]);
|
||||
}
|
||||
|
||||
/* loop - do things */
|
||||
|
@ -54,15 +54,15 @@ static void _loop(double t, int f)
|
|||
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);
|
||||
efl_gfx_entity_position_set(o_images[i], EINA_POSITION2D(x, y));
|
||||
efl_gfx_entity_size_set(o_images[i], EINA_SIZE2D(w, h));
|
||||
efl_gfx_fill_set(o_images[i], EINA_RECT(0, 0, w, h));
|
||||
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(const char *key)
|
||||
static void _key(char *key)
|
||||
{
|
||||
KEY_STD;
|
||||
}
|
||||
|
@ -94,7 +94,8 @@ void FNAME(void);
|
|||
# ifndef UI
|
||||
void FNAME(void)
|
||||
{
|
||||
ui_func_set(_key, _loop, _setup);
|
||||
ui_func_set(_key, _loop);
|
||||
_setup();
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
|
|
@ -23,11 +23,11 @@ static void _setup(void)
|
|||
Evas_Object *o;
|
||||
for (i = 0; i < OBNUM; i++)
|
||||
{
|
||||
o = efl_add(EFL_CANVAS_IMAGE_CLASS, evas);
|
||||
o = evas_object_image_add(evas);
|
||||
o_images[i] = o;
|
||||
efl_file_simple_load(o, build_path("image.png"), NULL);
|
||||
efl_gfx_image_smooth_scale_set(o, 1);
|
||||
efl_gfx_entity_visible_set(o, EINA_TRUE);
|
||||
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;
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ static void _setup(void)
|
|||
static void _cleanup(void)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < OBNUM; i++) efl_del(o_images[i]);
|
||||
for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]);
|
||||
}
|
||||
|
||||
/* loop - do things */
|
||||
|
@ -54,15 +54,15 @@ static void _loop(double t, int f)
|
|||
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);
|
||||
efl_gfx_entity_position_set(o_images[i], EINA_POSITION2D(x, y));
|
||||
efl_gfx_entity_size_set(o_images[i], EINA_SIZE2D(w, h));
|
||||
efl_gfx_fill_set(o_images[i], EINA_RECT(0, 0, w, h));
|
||||
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(const char *key)
|
||||
static void _key(char *key)
|
||||
{
|
||||
KEY_STD;
|
||||
}
|
||||
|
@ -94,7 +94,8 @@ void FNAME(void);
|
|||
# ifndef UI
|
||||
void FNAME(void)
|
||||
{
|
||||
ui_func_set(_key, _loop, _setup);
|
||||
ui_func_set(_key, _loop);
|
||||
_setup();
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
|
|
@ -23,11 +23,11 @@ static void _setup(void)
|
|||
Evas_Object *o;
|
||||
for (i = 0; i < OBNUM; i++)
|
||||
{
|
||||
o = efl_add(EFL_CANVAS_IMAGE_CLASS, evas);
|
||||
o = evas_object_image_add(evas);
|
||||
o_images[i] = o;
|
||||
efl_file_simple_load(o, build_path("frame.png"), NULL);
|
||||
efl_gfx_image_border_insets_set(o, 8, 8, 8, 8);
|
||||
efl_gfx_entity_visible_set(o, EINA_TRUE);
|
||||
evas_object_image_file_set(o, build_path("frame.png"), NULL);
|
||||
evas_object_image_border_set(o, 8, 8, 8, 8);
|
||||
evas_object_show(o);
|
||||
}
|
||||
done = 0;
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ static void _setup(void)
|
|||
static void _cleanup(void)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < OBNUM; i++) efl_del(o_images[i]);
|
||||
for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]);
|
||||
}
|
||||
|
||||
/* loop - do things */
|
||||
|
@ -54,15 +54,15 @@ static void _loop(double t, int f)
|
|||
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);
|
||||
efl_gfx_entity_position_set(o_images[i], EINA_POSITION2D(x, y));
|
||||
efl_gfx_entity_size_set(o_images[i], EINA_SIZE2D(w, h));
|
||||
efl_gfx_fill_set(o_images[i], EINA_RECT(0, 0, w, h));
|
||||
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(const char *key)
|
||||
static void _key(char *key)
|
||||
{
|
||||
KEY_STD;
|
||||
}
|
||||
|
@ -94,7 +94,8 @@ void FNAME(void);
|
|||
# ifndef UI
|
||||
void FNAME(void)
|
||||
{
|
||||
ui_func_set(_key, _loop, _setup);
|
||||
ui_func_set(_key, _loop);
|
||||
_setup();
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
|
|
@ -25,15 +25,15 @@ static void _setup(void)
|
|||
{
|
||||
int a;
|
||||
|
||||
o = efl_add(EFL_CANVAS_IMAGE_CLASS, evas);
|
||||
o = evas_object_image_add(evas);
|
||||
o_images[i] = o;
|
||||
efl_file_simple_load(o, build_path("image.png"), NULL);
|
||||
efl_gfx_fill_set(o, EINA_RECT(0, 0, 120, 160));
|
||||
efl_gfx_entity_size_set(o, EINA_SIZE2D(120, 160));
|
||||
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;
|
||||
efl_gfx_color_set(o, a, a, a, a);
|
||||
efl_gfx_entity_visible_set(o, EINA_TRUE);
|
||||
evas_object_color_set(o, a, a, a, a);
|
||||
evas_object_show(o);
|
||||
}
|
||||
done = 0;
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ static void _setup(void)
|
|||
static void _cleanup(void)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < OBNUM; i++) efl_del(o_images[i]);
|
||||
for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]);
|
||||
}
|
||||
|
||||
/* loop - do things */
|
||||
|
@ -58,13 +58,13 @@ static void _loop(double t, int f)
|
|||
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);
|
||||
efl_gfx_entity_position_set(o_images[i], EINA_POSITION2D(x, y));
|
||||
evas_object_move(o_images[i], x, y);
|
||||
}
|
||||
FPS_STD(NAME);
|
||||
}
|
||||
|
||||
/* prepend special key handlers if interactive (before STD) */
|
||||
static void _key(const char *key)
|
||||
static void _key(char *key)
|
||||
{
|
||||
KEY_STD;
|
||||
}
|
||||
|
@ -96,7 +96,8 @@ void FNAME(void);
|
|||
# ifndef UI
|
||||
void FNAME(void)
|
||||
{
|
||||
ui_func_set(_key, _loop, _setup);
|
||||
ui_func_set(_key, _loop);
|
||||
_setup();
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
|
|
@ -25,14 +25,14 @@ static void _setup(void)
|
|||
{
|
||||
int a;
|
||||
|
||||
o = efl_add(EFL_CANVAS_IMAGE_CLASS, evas);
|
||||
o = evas_object_image_add(evas);
|
||||
o_images[i] = o;
|
||||
efl_file_simple_load(o, build_path("image.png"), NULL);
|
||||
efl_gfx_fill_set(o, EINA_RECT(0, 0, 120, 160));
|
||||
efl_gfx_entity_size_set(o, EINA_SIZE2D(120, 160));
|
||||
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;
|
||||
efl_gfx_color_set(o, a, a, a, a);
|
||||
efl_gfx_entity_visible_set(o, EINA_TRUE);
|
||||
evas_object_color_set(o, a, a, a, a);
|
||||
evas_object_show(o);
|
||||
}
|
||||
done = 0;
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ static void _setup(void)
|
|||
static void _cleanup(void)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < OBNUM; i++) efl_del(o_images[i]);
|
||||
for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]);
|
||||
}
|
||||
|
||||
/* loop - do things */
|
||||
|
@ -57,13 +57,13 @@ static void _loop(double t, int f)
|
|||
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);
|
||||
efl_gfx_entity_position_set(o_images[i], EINA_POSITION2D(x, y));
|
||||
evas_object_move(o_images[i], x, y);
|
||||
}
|
||||
FPS_STD(NAME);
|
||||
}
|
||||
|
||||
/* prepend special key handlers if interactive (before STD) */
|
||||
static void _key(const char *key)
|
||||
static void _key(char *key)
|
||||
{
|
||||
KEY_STD;
|
||||
}
|
||||
|
@ -95,7 +95,8 @@ void FNAME(void);
|
|||
# ifndef UI
|
||||
void FNAME(void)
|
||||
{
|
||||
ui_func_set(_key, _loop, _setup);
|
||||
ui_func_set(_key, _loop);
|
||||
_setup();
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
|
|
@ -23,12 +23,12 @@ static void _setup(void)
|
|||
Evas_Object *o;
|
||||
for (i = 0; i < OBNUM; i++)
|
||||
{
|
||||
o = efl_add(EFL_CANVAS_IMAGE_CLASS, evas);
|
||||
o = evas_object_image_add(evas);
|
||||
o_images[i] = o;
|
||||
efl_file_simple_load(o, build_path("bar.png"), NULL);
|
||||
efl_gfx_image_border_insets_set(o, 6, 6, 6, 6);
|
||||
efl_gfx_image_center_fill_mode_set(o, EFL_GFX_CENTER_FILL_MODE_SOLID);
|
||||
efl_gfx_entity_visible_set(o, EINA_TRUE);
|
||||
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;
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ static void _setup(void)
|
|||
static void _cleanup(void)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < OBNUM; i++) efl_del(o_images[i]);
|
||||
for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]);
|
||||
}
|
||||
|
||||
/* loop - do things */
|
||||
|
@ -55,15 +55,15 @@ static void _loop(double t, int f)
|
|||
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);
|
||||
efl_gfx_entity_position_set(o_images[i], EINA_POSITION2D(x, y));
|
||||
efl_gfx_entity_size_set(o_images[i], EINA_SIZE2D(w, h));
|
||||
efl_gfx_fill_set(o_images[i], EINA_RECT(0, 0, w, h));
|
||||
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(const char *key)
|
||||
static void _key(char *key)
|
||||
{
|
||||
KEY_STD;
|
||||
}
|
||||
|
@ -95,7 +95,8 @@ void FNAME(void);
|
|||
# ifndef UI
|
||||
void FNAME(void)
|
||||
{
|
||||
ui_func_set(_key, _loop, _setup);
|
||||
ui_func_set(_key, _loop);
|
||||
_setup();
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
|
|
@ -23,14 +23,14 @@ static void _setup(void)
|
|||
Evas_Object *o;
|
||||
for (i = 0; i < OBNUM; i++)
|
||||
{
|
||||
o = efl_add(EFL_CANVAS_IMAGE_CLASS, evas);
|
||||
o = evas_object_image_add(evas);
|
||||
o_images[i] = o;
|
||||
efl_file_simple_load(o, build_path("logo.png"), NULL);
|
||||
efl_gfx_fill_set(o, EINA_RECT(0, 0, 120, 160));
|
||||
efl_gfx_entity_size_set(o, EINA_SIZE2D(120, 160));
|
||||
efl_gfx_image_border_insets_set(o, 43, 48, 48, 83);
|
||||
efl_gfx_image_center_fill_mode_set(o, EFL_GFX_CENTER_FILL_MODE_SOLID);
|
||||
efl_gfx_entity_visible_set(o, EINA_TRUE);
|
||||
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;
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ static void _setup(void)
|
|||
static void _cleanup(void)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < OBNUM; i++) efl_del(o_images[i]);
|
||||
for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]);
|
||||
}
|
||||
|
||||
/* loop - do things */
|
||||
|
@ -55,13 +55,13 @@ static void _loop(double t, int f)
|
|||
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);
|
||||
efl_gfx_entity_position_set(o_images[i], EINA_POSITION2D(x, y));
|
||||
evas_object_move(o_images[i], x, y);
|
||||
}
|
||||
FPS_STD(NAME);
|
||||
}
|
||||
|
||||
/* prepend special key handlers if interactive (before STD) */
|
||||
static void _key(const char *key)
|
||||
static void _key(char *key)
|
||||
{
|
||||
KEY_STD;
|
||||
}
|
||||
|
@ -93,7 +93,8 @@ void FNAME(void);
|
|||
# ifndef UI
|
||||
void FNAME(void)
|
||||
{
|
||||
ui_func_set(_key, _loop, _setup);
|
||||
ui_func_set(_key, _loop);
|
||||
_setup();
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
|
|
@ -23,12 +23,12 @@ static void _setup(void)
|
|||
Evas_Object *o;
|
||||
for (i = 0; i < OBNUM; i++)
|
||||
{
|
||||
o = efl_add(EFL_CANVAS_IMAGE_CLASS, evas);
|
||||
o = evas_object_image_add(evas);
|
||||
o_images[i] = o;
|
||||
efl_file_simple_load(o, build_path("image.png"), NULL);
|
||||
efl_gfx_fill_set(o, EINA_RECT(0, 0, 120, 160));
|
||||
efl_gfx_entity_size_set(o, EINA_SIZE2D(120, 160));
|
||||
efl_gfx_entity_visible_set(o, EINA_TRUE);
|
||||
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;
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ static void _setup(void)
|
|||
static void _cleanup(void)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < OBNUM; i++) efl_del(o_images[i]);
|
||||
for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]);
|
||||
}
|
||||
|
||||
/* loop - do things */
|
||||
|
@ -53,13 +53,13 @@ static void _loop(double t, int f)
|
|||
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);
|
||||
efl_gfx_entity_position_set(o_images[i], EINA_POSITION2D(x, y));
|
||||
evas_object_move(o_images[i], x, y);
|
||||
}
|
||||
FPS_STD(NAME);
|
||||
}
|
||||
|
||||
/* prepend special key handlers if interactive (before STD) */
|
||||
static void _key(const char *key)
|
||||
static void _key(char *key)
|
||||
{
|
||||
KEY_STD;
|
||||
}
|
||||
|
@ -91,7 +91,8 @@ void FNAME(void);
|
|||
# ifndef UI
|
||||
void FNAME(void)
|
||||
{
|
||||
ui_func_set(_key, _loop, _setup);
|
||||
ui_func_set(_key, _loop);
|
||||
_setup();
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
|
|
@ -23,12 +23,12 @@ static void _setup(void)
|
|||
Evas_Object *o;
|
||||
for (i = 0; i < OBNUM; i++)
|
||||
{
|
||||
o = efl_add(EFL_CANVAS_IMAGE_CLASS, evas);
|
||||
o = evas_object_image_add(evas);
|
||||
o_images[i] = o;
|
||||
efl_file_simple_load(o, build_path("logo.png"), NULL);
|
||||
efl_gfx_fill_set(o, EINA_RECT(0, 0, 120, 160));
|
||||
efl_gfx_entity_size_set(o, EINA_SIZE2D(120, 160));
|
||||
efl_gfx_entity_visible_set(o, EINA_TRUE);
|
||||
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;
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ static void _setup(void)
|
|||
static void _cleanup(void)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < OBNUM; i++) efl_del(o_images[i]);
|
||||
for (i = 0; i < OBNUM; i++) evas_object_del(o_images[i]);
|
||||
}
|
||||
|
||||
/* loop - do things */
|
||||
|
@ -53,13 +53,13 @@ static void _loop(double t, int f)
|
|||
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);
|
||||
efl_gfx_entity_position_set(o_images[i], EINA_POSITION2D(x, y));
|
||||
evas_object_move(o_images[i], x, y);
|
||||
}
|
||||
FPS_STD(NAME);
|
||||
}
|
||||
|
||||
/* prepend special key handlers if interactive (before STD) */
|
||||
static void _key(const char *key)
|
||||
static void _key(char *key)
|
||||
{
|
||||
KEY_STD;
|
||||
}
|
||||
|
@ -91,7 +91,8 @@ void FNAME(void);
|
|||
# ifndef UI
|
||||
void FNAME(void)
|
||||
{
|
||||
ui_func_set(_key, _loop, _setup);
|
||||
ui_func_set(_key, _loop);
|
||||
_setup();
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
|
|
@ -22,19 +22,19 @@ static void _setup(void)
|
|||
{
|
||||
Evas_Object *o;
|
||||
|
||||
o = efl_add(EFL_CANVAS_IMAGE_CLASS, evas);
|
||||
o = evas_object_image_add(evas);
|
||||
o_images[0] = o;
|
||||
efl_file_simple_load(o, build_path("im1.png"), NULL);
|
||||
efl_gfx_fill_set(o, EINA_RECT(0, 0, 720, 420));
|
||||
efl_gfx_entity_size_set(o, EINA_SIZE2D(720, 420));
|
||||
efl_gfx_entity_visible_set(o, EINA_TRUE);
|
||||
evas_object_image_file_set(o, build_path("im1.png"), NULL);
|
||||
evas_object_image_fill_set(o, 0, 0, 720, 420);
|
||||
evas_object_resize(o, 720, 420);
|
||||
evas_object_show(o);
|
||||
|
||||
o = efl_add(EFL_CANVAS_IMAGE_CLASS, evas);
|
||||
o = evas_object_image_add(evas);
|
||||
o_images[1] = o;
|
||||
efl_file_simple_load(o, build_path("im2.png"), NULL);
|
||||
efl_gfx_fill_set(o, EINA_RECT(0, 0, 720, 420));
|
||||
efl_gfx_entity_size_set(o, EINA_SIZE2D(720, 420));
|
||||
efl_gfx_entity_visible_set(o, EINA_TRUE);
|
||||
evas_object_image_file_set(o, build_path("im2.png"), NULL);
|
||||
evas_object_image_fill_set(o, 0, 0, 720, 420);
|
||||
evas_object_resize(o, 720, 420);
|
||||
evas_object_show(o);
|
||||
|
||||
done = 0;
|
||||
}
|
||||
|
@ -43,7 +43,7 @@ static void _setup(void)
|
|||
static void _cleanup(void)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < 2; i++) efl_del(o_images[i]);
|
||||
for (i = 0; i < 2; i++) evas_object_del(o_images[i]);
|
||||
}
|
||||
|
||||
/* loop - do things */
|
||||
|
@ -53,12 +53,12 @@ static void _loop(double t, int f)
|
|||
|
||||
a = f & 0x1f;
|
||||
a = ((a << 3) | (a >> 2)) & 0xff;
|
||||
efl_gfx_color_set(o_images[1], a, a, a, a);
|
||||
evas_object_color_set(o_images[1], a, a, a, a);
|
||||
FPS_STD(NAME);
|
||||
}
|
||||
|
||||
/* prepend special key handlers if interactive (before STD) */
|
||||
static void _key(const char *key)
|
||||
static void _key(char *key)
|
||||
{
|
||||
KEY_STD;
|
||||
}
|
||||
|
@ -90,7 +90,8 @@ void FNAME(void);
|
|||
# ifndef UI
|
||||
void FNAME(void)
|
||||
{
|
||||
ui_func_set(_key, _loop, _setup);
|
||||
ui_func_set(_key, _loop);
|
||||
_setup();
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
|
|
@ -20,21 +20,19 @@ static Evas_Object *o_images[1];
|
|||
/* setup */
|
||||
static void _setup(void)
|
||||
{
|
||||
int i;
|
||||
Evas_Object *o;
|
||||
Eina_Slice sl;
|
||||
|
||||
sl.len = 640 * 480 * 4;
|
||||
sl.mem = malloc(sl.len);
|
||||
for (int i = 0; i < 1; i++)
|
||||
for (i = 0; i < 1; i++)
|
||||
{
|
||||
o = efl_add(EFL_CANVAS_IMAGE_CLASS, evas);
|
||||
o = evas_object_image_add(evas);
|
||||
o_images[i] = o;
|
||||
efl_gfx_image_content_hint_set(o, EVAS_IMAGE_CONTENT_HINT_DYNAMIC);
|
||||
efl_gfx_buffer_alpha_set(o, 0);
|
||||
efl_gfx_fill_set(o, EINA_RECT(0, 0, 640, 480));
|
||||
efl_gfx_entity_size_set(o, EINA_SIZE2D(640, 480));
|
||||
efl_gfx_entity_visible_set(o, EINA_TRUE);
|
||||
efl_gfx_buffer_managed_set(o, &sl, EINA_SIZE2D(640, 480), 0, EFL_GFX_COLORSPACE_ARGB8888, 0);
|
||||
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);
|
||||
evas_object_image_fill_set(o, 0, 0, 640, 480);
|
||||
evas_object_resize(o, 640, 480);
|
||||
evas_object_show(o);
|
||||
}
|
||||
done = 0;
|
||||
}
|
||||
|
@ -42,45 +40,29 @@ static void _setup(void)
|
|||
/* cleanup */
|
||||
static void _cleanup(void)
|
||||
{
|
||||
for (int i = 0; i < 1; i++)
|
||||
{
|
||||
Evas_Object *o = o_images[i];
|
||||
Eina_Slice sl = {};
|
||||
|
||||
sl = efl_gfx_buffer_managed_get(o, 0);
|
||||
free((void *) sl.mem);
|
||||
efl_del(o);
|
||||
}
|
||||
int i;
|
||||
for (i = 0; i < 1; i++) evas_object_del(o_images[i]);
|
||||
}
|
||||
|
||||
/* loop - do things */
|
||||
static void _loop(double t, int f)
|
||||
{
|
||||
for (int i = 0; i < 1; i++)
|
||||
{
|
||||
Evas_Object *o = o_images[i];
|
||||
unsigned int *data, *p;
|
||||
int i, st;
|
||||
Evas_Coord x, y, w, h;
|
||||
Eina_Rw_Slice sl = {};
|
||||
int st;
|
||||
for (i = 0; i < 1; i++)
|
||||
{
|
||||
unsigned int *data, *p;
|
||||
|
||||
w = 640;
|
||||
h = 480;
|
||||
x = (win_w / 2) - (w / 2);
|
||||
y = (win_h / 2) - (h / 2);
|
||||
efl_gfx_entity_position_set(o, EINA_POSITION2D(x, y));
|
||||
efl_gfx_entity_size_set(o, EINA_SIZE2D(w, h));
|
||||
efl_gfx_fill_set(o, EINA_RECT(0, 0, w, h));
|
||||
sl = efl_gfx_buffer_map(o, EFL_GFX_BUFFER_ACCESS_MODE_WRITE,
|
||||
&EINA_RECT(0, 0, w, h), EFL_GFX_COLORSPACE_ARGB8888, 0, &st);
|
||||
data = sl.mem;
|
||||
if (!data)
|
||||
{
|
||||
fprintf(stderr, "ERROR: Failed to map image!\n");
|
||||
continue;
|
||||
}
|
||||
st = st >> 2;
|
||||
p = sl.mem;
|
||||
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);
|
||||
data = evas_object_image_data_get(o_images[i], 1);
|
||||
st = evas_object_image_stride_get(o_images[i]) >> 2;
|
||||
p = data;
|
||||
for (y = 0; y < h; y++)
|
||||
{
|
||||
for (x = 0; x < w; x++)
|
||||
|
@ -90,14 +72,14 @@ static void _loop(double t, int f)
|
|||
}
|
||||
p += (st - w);
|
||||
}
|
||||
efl_gfx_buffer_unmap(o, sl);
|
||||
efl_gfx_buffer_update_add(o, &EINA_RECT(0, 0, w, h));
|
||||
evas_object_image_data_set(o_images[i], data);
|
||||
evas_object_image_data_update_add(o_images[i], 0, 0, w, h);
|
||||
}
|
||||
FPS_STD(NAME);
|
||||
}
|
||||
|
||||
/* prepend special key handlers if interactive (before STD) */
|
||||
static void _key(const char *key)
|
||||
static void _key(char *key)
|
||||
{
|
||||
KEY_STD;
|
||||
}
|
||||
|
@ -129,7 +111,8 @@ void FNAME(void);
|
|||
# ifndef UI
|
||||
void FNAME(void)
|
||||
{
|
||||
ui_func_set(_key, _loop, _setup);
|
||||
ui_func_set(_key, _loop);
|
||||
_setup();
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue