EPhysics: a new library comes to E world

It’s a wrapper between Bullet Physics and EFL to add physics effects
in a simple way.

More details on README, TODO, and edevelop mail list =)



SVN revision: 72896
This commit is contained in:
Bruno Dilly 2012-06-26 22:36:12 +00:00
parent 3eaa894b69
commit 28d9f92ef2
114 changed files with 9103 additions and 0 deletions

41
legacy/ephysics/.gitignore vendored Normal file
View File

@ -0,0 +1,41 @@
*~
*.o
*.lo
*.la
.libs
.deps
*.pc
Makefile
Makefile.in
*.so
/aclocal.m4
/autom4te.cache/
/compile
/config.cache
/config.guess
/config.h
/config.h.in
/config.log
/config.status
/config.sub
/configure
/depcomp
/install-sh
/libtool
/ltmain.sh
/missing
/stamp-h1
/ABOUT-NLS
/config.cache-env
doc/Doxyfile
m4/libtool.m4
m4/ltoptions.m4
m4/ltsugar.m4
m4/ltversion.m4
m4/lt~obsolete.m4
data/themes/ephysics_test.edj
src/bin/ephysics_test
src/bin/ephysics_logo
doc/html/
doc/latex/
doc/man/

2
legacy/ephysics/AUTHORS Normal file
View File

@ -0,0 +1,2 @@
Bruno Dilly <bdilly@profusion.mobi>
Leandro Dorileo <dorileo@profusion.mobi>

26
legacy/ephysics/COPYING Normal file
View File

@ -0,0 +1,26 @@
Copyright notice for EPhysics:
Copyright (C) 2012 ProFUSION Embedded Systems and various contributors
(see AUTHORS).
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@ -0,0 +1,94 @@
The follwing images were drawn by Marina Proni <marina.proni@profusion.mobi>
and are licensed under Creative Commons Attribution-ShareAlike 3.0
Unported License:
arrows.png
background.jpg
ball-blue70.png
ball-blue.png
ball-green70.png
ball-green.png
ball-red70.png
ball-red.png
bt_jump.png
bt_jump_pressed.png
bt_restart.png
bt_restart_pressed.png
collisionL.png
cube-blue.png
cube-purple.png
impact.png
list-item-corner.png
list-item-corner-pressed.png
list-item.png
list-item-pressed.png
list.png
shadow-ball.png
shadow-cube.png
===
Creative Commons Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE MAY BE CONSIDERED TO BE A CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
1. Definitions
a. "Adaptation" means a work based upon the Work, or upon the Work and other pre-existing works, such as a translation, adaptation, derivative work, arrangement of music or other alterations of a literary or artistic work, or phonogram or performance and includes cinematographic adaptations or any other form in which the Work may be recast, transformed, or adapted including in any form recognizably derived from the original, except that a work that constitutes a Collection will not be considered an Adaptation for the purpose of this License. For the avoidance of doubt, where the Work is a musical work, performance or phonogram, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered an Adaptation for the purpose of this License.
b. "Collection" means a collection of literary or artistic works, such as encyclopedias and anthologies, or performances, phonograms or broadcasts, or other works or subject matter other than works listed in Section 1(f) below, which, by reason of the selection and arrangement of their contents, constitute intellectual creations, in which the Work is included in its entirety in unmodified form along with one or more other contributions, each constituting separate and independent works in themselves, which together are assembled into a collective whole. A work that constitutes a Collection will not be considered an Adaptation (as defined below) for the purposes of this License.
c. "Creative Commons Compatible License" means a license that is listed at http://creativecommons.org/compatiblelicenses that has been approved by Creative Commons as being essentially equivalent to this License, including, at a minimum, because that license: (i) contains terms that have the same purpose, meaning and effect as the License Elements of this License; and, (ii) explicitly permits the relicensing of adaptations of works made available under that license under this License or a Creative Commons jurisdiction license with the same License Elements as this License.
d. "Distribute" means to make available to the public the original and copies of the Work or Adaptation, as appropriate, through sale or other transfer of ownership.
e. "License Elements" means the following high-level license attributes as selected by Licensor and indicated in the title of this License: Attribution, ShareAlike.
f. "Licensor" means the individual, individuals, entity or entities that offer(s) the Work under the terms of this License.
g. "Original Author" means, in the case of a literary or artistic work, the individual, individuals, entity or entities who created the Work or if no individual or entity can be identified, the publisher; and in addition (i) in the case of a performance the actors, singers, musicians, dancers, and other persons who act, sing, deliver, declaim, play in, interpret or otherwise perform literary or artistic works or expressions of folklore; (ii) in the case of a phonogram the producer being the person or legal entity who first fixes the sounds of a performance or other sounds; and, (iii) in the case of broadcasts, the organization that transmits the broadcast.
h. "Work" means the literary and/or artistic work offered under the terms of this License including without limitation any production in the literary, scientific and artistic domain, whatever may be the mode or form of its expression including digital form, such as a book, pamphlet and other writing; a lecture, address, sermon or other work of the same nature; a dramatic or dramatico-musical work; a choreographic work or entertainment in dumb show; a musical composition with or without words; a cinematographic work to which are assimilated works expressed by a process analogous to cinematography; a work of drawing, painting, architecture, sculpture, engraving or lithography; a photographic work to which are assimilated works expressed by a process analogous to photography; a work of applied art; an illustration, map, plan, sketch or three-dimensional work relative to geography, topography, architecture or science; a performance; a broadcast; a phonogram; a compilation of data to the extent it is protected as a copyrightable work; or a work performed by a variety or circus performer to the extent it is not otherwise considered a literary or artistic work.
i. "You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation.
j. "Publicly Perform" means to perform public recitations of the Work and to communicate to the public those public recitations, by any means or process, including by wire or wireless means or public digital performances; to make available to the public Works in such a way that members of the public may access these Works from a place and at a place individually chosen by them; to perform the Work to the public by any means or process and the communication to the public of the performances of the Work, including by public digital performance; to broadcast and rebroadcast the Work by any means including signs, sounds or images.
k. "Reproduce" means to make copies of the Work by any means including without limitation by sound or visual recordings and the right of fixation and reproducing fixations of the Work, including storage of a protected performance or phonogram in digital form or other electronic medium.
2. Fair Dealing Rights. Nothing in this License is intended to reduce, limit, or restrict any uses free from copyright or rights arising from limitations or exceptions that are provided for in connection with the copyright protection under copyright law or other applicable laws.
3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below:
a. to Reproduce the Work, to incorporate the Work into one or more Collections, and to Reproduce the Work as incorporated in the Collections;
b. to create and Reproduce Adaptations provided that any such Adaptation, including any translation in any medium, takes reasonable steps to clearly label, demarcate or otherwise identify that changes were made to the original Work. For example, a translation could be marked "The original work was translated from English to Spanish," or a modification could indicate "The original work has been modified.";
c. to Distribute and Publicly Perform the Work including as incorporated in Collections; and,
d. to Distribute and Publicly Perform Adaptations.
e. For the avoidance of doubt:
i. Non-waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme cannot be waived, the Licensor reserves the exclusive right to collect such royalties for any exercise by You of the rights granted under this License;
ii. Waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme can be waived, the Licensor waives the exclusive right to collect such royalties for any exercise by You of the rights granted under this License; and,
iii. Voluntary License Schemes. The Licensor waives the right to collect royalties, whether individually or, in the event that the Licensor is a member of a collecting society that administers voluntary licensing schemes, via that society, from any exercise by You of the rights granted under this License.
The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats. Subject to Section 8(f), all rights not expressly granted by Licensor are hereby reserved.
4. Restrictions. The license granted in Section 3 above is expressly made subject to and limited by the following restrictions:
a. You may Distribute or Publicly Perform the Work only under the terms of this License. You must include a copy of, or the Uniform Resource Identifier (URI) for, this License with every copy of the Work You Distribute or Publicly Perform. You may not offer or impose any terms on the Work that restrict the terms of this License or the ability of the recipient of the Work to exercise the rights granted to that recipient under the terms of the License. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties with every copy of the Work You Distribute or Publicly Perform. When You Distribute or Publicly Perform the Work, You may not impose any effective technological measures on the Work that restrict the ability of a recipient of the Work from You to exercise the rights granted to that recipient under the terms of the License. This Section 4(a) applies to the Work as incorporated in a Collection, but this does not require the Collection apart from the Work itself to be made subject to the terms of this License. If You create a Collection, upon notice from any Licensor You must, to the extent practicable, remove from the Collection any credit as required by Section 4(c), as requested. If You create an Adaptation, upon notice from any Licensor You must, to the extent practicable, remove from the Adaptation any credit as required by Section 4(c), as requested.
b. You may Distribute or Publicly Perform an Adaptation only under the terms of: (i) this License; (ii) a later version of this License with the same License Elements as this License; (iii) a Creative Commons jurisdiction license (either this or a later license version) that contains the same License Elements as this License (e.g., Attribution-ShareAlike 3.0 US)); (iv) a Creative Commons Compatible License. If you license the Adaptation under one of the licenses mentioned in (iv), you must comply with the terms of that license. If you license the Adaptation under the terms of any of the licenses mentioned in (i), (ii) or (iii) (the "Applicable License"), you must comply with the terms of the Applicable License generally and the following provisions: (I) You must include a copy of, or the URI for, the Applicable License with every copy of each Adaptation You Distribute or Publicly Perform; (II) You may not offer or impose any terms on the Adaptation that restrict the terms of the Applicable License or the ability of the recipient of the Adaptation to exercise the rights granted to that recipient under the terms of the Applicable License; (III) You must keep intact all notices that refer to the Applicable License and to the disclaimer of warranties with every copy of the Work as included in the Adaptation You Distribute or Publicly Perform; (IV) when You Distribute or Publicly Perform the Adaptation, You may not impose any effective technological measures on the Adaptation that restrict the ability of a recipient of the Adaptation from You to exercise the rights granted to that recipient under the terms of the Applicable License. This Section 4(b) applies to the Adaptation as incorporated in a Collection, but this does not require the Collection apart from the Adaptation itself to be made subject to the terms of the Applicable License.
c. If You Distribute, or Publicly Perform the Work or any Adaptations or Collections, You must, unless a request has been made pursuant to Section 4(a), keep intact all copyright notices for the Work and provide, reasonable to the medium or means You are utilizing: (i) the name of the Original Author (or pseudonym, if applicable) if supplied, and/or if the Original Author and/or Licensor designate another party or parties (e.g., a sponsor institute, publishing entity, journal) for attribution ("Attribution Parties") in Licensor's copyright notice, terms of service or by other reasonable means, the name of such party or parties; (ii) the title of the Work if supplied; (iii) to the extent reasonably practicable, the URI, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work; and (iv) , consistent with Ssection 3(b), in the case of an Adaptation, a credit identifying the use of the Work in the Adaptation (e.g., "French translation of the Work by Original Author," or "Screenplay based on original Work by Original Author"). The credit required by this Section 4(c) may be implemented in any reasonable manner; provided, however, that in the case of a Adaptation or Collection, at a minimum such credit will appear, if a credit for all contributing authors of the Adaptation or Collection appears, then as part of these credits and in a manner at least as prominent as the credits for the other contributing authors. For the avoidance of doubt, You may only use the credit required by this Section for the purpose of attribution in the manner set out above and, by exercising Your rights under this License, You may not implicitly or explicitly assert or imply any connection with, sponsorship or endorsement by the Original Author, Licensor and/or Attribution Parties, as appropriate, of You or Your use of the Work, without the separate, express prior written permission of the Original Author, Licensor and/or Attribution Parties.
d. Except as otherwise agreed in writing by the Licensor or as may be otherwise permitted by applicable law, if You Reproduce, Distribute or Publicly Perform the Work either by itself or as part of any Adaptations or Collections, You must not distort, mutilate, modify or take other derogatory action in relation to the Work which would be prejudicial to the Original Author's honor or reputation. Licensor agrees that in those jurisdictions (e.g. Japan), in which any exercise of the right granted in Section 3(b) of this License (the right to make Adaptations) would be deemed to be a distortion, mutilation, modification or other derogatory action prejudicial to the Original Author's honor and reputation, the Licensor will waive or not assert, as appropriate, this Section, to the fullest extent permitted by the applicable national law, to enable You to reasonably exercise Your right under Section 3(b) of this License (right to make Adaptations) but not otherwise.
5. Representations, Warranties and Disclaimer
UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.
6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
7. Termination
a. This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Adaptations or Collections from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License.
b. Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above.
8. Miscellaneous
a. Each time You Distribute or Publicly Perform the Work or a Collection, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License.
b. Each time You Distribute or Publicly Perform an Adaptation, Licensor offers to the recipient a license to the original Work on the same terms and conditions as the license granted to You under this License.
c. If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
d. No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent.
e. This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You.
f. The rights granted under, and the subject matter referenced, in this License were drafted utilizing the terminology of the Berne Convention for the Protection of Literary and Artistic Works (as amended on September 28, 1979), the Rome Convention of 1961, the WIPO Copyright Treaty of 1996, the WIPO Performances and Phonograms Treaty of 1996 and the Universal Copyright Convention (as revised on July 24, 1971). These rights and subject matter take effect in the relevant jurisdiction in which the License terms are sought to be enforced according to the corresponding provisions of the implementation of those treaty provisions in the applicable national law. If the standard suite of rights granted under applicable copyright law includes additional rights not granted under this License, such additional rights are deemed to be included in the License; this License is not intended to restrict the license of any rights under applicable law.

View File

@ -0,0 +1,3 @@
2012-05-15 Bruno Dilly
Initial version

365
legacy/ephysics/INSTALL Normal file
View File

@ -0,0 +1,365 @@
Installation Instructions
*************************
Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
2006, 2007, 2008, 2009 Free Software Foundation, Inc.
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.
Basic Installation
==================
Briefly, the shell commands `./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.
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.
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 bug. Until the bug is fixed you can use this workaround:
CONFIG_SHELL=/bin/bash /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.

View File

@ -0,0 +1,48 @@
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = src doc data
MAINTAINERCLEANFILES = \
Makefile.in \
aclocal.m4 \
compile \
config.guess \
config.h.in \
config.h.in~ \
config.sub \
configure \
depcomp \
install-sh \
ltmain.sh \
missing \
$(PACKAGE_TARNAME)-$(PACKAGE_VERSION).tar.gz \
$(PACKAGE_TARNAME)-$(PACKAGE_VERSION).tar.bz2 \
$(PACKAGE_TARNAME)-$(PACKAGE_VERSION)-doc.tar.bz2 \
m4/libtool.m4 \
m4/lt~obsolete.m4 \
m4/ltoptions.m4 \
m4/ltsugar.m4 \
m4/ltversion.m4
bin_SCRIPTS =
EXTRA_DIST = \
AUTHORS \
COPYING \
COPYING_ARTS \
autogen.sh \
ephysics.pc.in \
ephysics.spec \
ephysics.spec.in \
README
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = ephysics.pc
.PHONY: doc
# Documentation
doc:
@echo "entering doc/"
make -C doc doc

3
legacy/ephysics/NEWS Normal file
View File

@ -0,0 +1,3 @@
Ephysics 0.1.0
* Very initial implementation

50
legacy/ephysics/README Normal file
View File

@ -0,0 +1,50 @@
EPhysics 0.1.0
******************************************************************************
FOR ANY ISSUES PLEASE EMAIL:
enlightenment-devel@lists.sourceforge.net
******************************************************************************
Requirements:
-------------
Must:
libc
ecore (at least 1.1.0)
ecore-evas (at least 1.1.0)
evas (at least 1.1.0)
bullet (at least 2.80)
Optional:
elementary (at least 1.0.0, required to build ephysics_test)
EPhysics is a library that manages Ecore, Evas and Bullet Physics into
an easy to use way. It's a kind of wrapper, a glue, between these libraries.
It's not intended to be a physics library (we already have many out there).
------------------------------------------------------------------------------
COMPILING AND INSTALLING:
$ ./configure
$ make
(as root unless you are installing in your users directories):
$ make install
If elementary is installed, it will build and install a test application as
well, that showcases EPhysics capabilites. Run
$ ephysics_test
to see these examples.
----
DOCS
To generate documentation, doxygen is required.
$ make doc
will create a ephysics/doc/html directory. You could start looking at
index.html.

17
legacy/ephysics/TODO Normal file
View File

@ -0,0 +1,17 @@
* collision filters
* receive collision point on collision cb
* valgrind supp
* EPhysics_Constants
* Sandbox tools to try different materials / properties
* camera
* create shape from image
* simple game using ephysics
* set best shape based on evas object
* optimize collision shapes usage
* deform objects
* improve docs
* run simulation on other thread
FAR FAR FUTURE:
* support Box2d backend
* support Chipmunk backend

39
legacy/ephysics/autogen.sh Executable file
View File

@ -0,0 +1,39 @@
#!/bin/sh
rm -rf autom4te.cache
rm -f aclocal.m4 ltmain.sh
touch README
touch ABOUT-NLS
echo "Running aclocal..." ; aclocal $ACLOCAL_FLAGS -I m4 || exit 1
echo "Running autoheader..." ; autoheader || exit 1
echo "Running autoconf..." ; autoconf || exit 1
echo "Running libtoolize..." ; (libtoolize --copy --automake || glibtoolize --automake) || exit 1
echo "Running automake..." ; automake --add-missing --copy --gnu || exit 1
W=0
rm -f config.cache-env.tmp
echo "OLD_PARM=\"$@\"" >> config.cache-env.tmp
echo "OLD_CFLAGS=\"$CFLAGS\"" >> config.cache-env.tmp
echo "OLD_PATH=\"$PATH\"" >> config.cache-env.tmp
echo "OLD_PKG_CONFIG_PATH=\"$PKG_CONFIG_PATH\"" >> config.cache-env.tmp
echo "OLD_LDFLAGS=\"$LDFLAGS\"" >> config.cache-env.tmp
cmp config.cache-env.tmp config.cache-env >> /dev/null
if [ $? -ne 0 ]; then
W=1;
fi
if [ $W -ne 0 ]; then
echo "Cleaning configure cache...";
rm -f config.cache config.cache-env
mv config.cache-env.tmp config.cache-env
else
rm -f config.cache-env.tmp
fi
if [ -z "$NOCONFIGURE" ]; then
./configure -C "$@"
fi

View File

@ -0,0 +1,244 @@
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
m4_define([v_maj], [0])
m4_define([v_min], [1])
m4_define([v_mic], [0])
m4_define([v_rev], m4_esyscmd([(svnversion "${SVN_REPO_PATH:-.}" | grep -v '\(export\|Unversioned directory\)' || echo 0) | awk -F : '{printf("%s\n", $1);}' | tr -d ' :MSP\n']))
m4_if(v_rev, [0], [m4_define([v_rev], m4_esyscmd([git log 2> /dev/null | (grep -m1 git-svn-id || echo 0) | sed -e 's/.*@\([0-9]*\).*/\1/' | tr -d '\n']))])
##-- When released, remove the dnl on the below line
dnl m4_undefine([v_rev])
##-- When doing snapshots - change soname. remove dnl on below line
dnl m4_define([relname], [ver-pre-svn-07])
dnl m4_define([v_rel], [-release relname])
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
m4_ifdef([v_rev], [m4_define([v_ver], [v_maj.v_min.v_mic.v_rev])], [m4_define([v_ver], [v_maj.v_min.v_mic])])
m4_define([lt_cur], m4_eval(v_maj + v_min))
m4_define([lt_rev], v_mic)
m4_define([lt_age], v_min)
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
AC_INIT([ephysics], [v_ver], [enlightenment-devel@lists.sourceforge.net])
AC_PREREQ([2.52])
AC_CONFIG_SRCDIR([configure.ac])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADERS([config.h])
AH_TOP([
#ifndef EFL_CONFIG_H__
#define EFL_CONFIG_H__
])
AH_BOTTOM([
#endif /* EFL_CONFIG_H__ */
])
AM_INIT_AUTOMAKE([1.6 dist-bzip2])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
AC_LIBTOOL_WIN32_DLL
define([AC_LIBTOOL_LANG_F77_CONFIG], [:])dnl
AC_PROG_LIBTOOL
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
m4_ifdef([v_rev], , [m4_define([v_rev], [0])])
m4_ifdef([v_rel], , [m4_define([v_rel], [])])
AC_DEFINE_UNQUOTED(VMAJ, [v_maj], [Major version])
AC_DEFINE_UNQUOTED(VMIN, [v_min], [Minor version])
AC_DEFINE_UNQUOTED(VMIC, [v_mic], [Micro version])
AC_DEFINE_UNQUOTED(VREV, [v_rev], [Revison])
version_info="lt_cur:lt_rev:lt_age"
release_info="v_rel"
AC_SUBST(version_info)
AC_SUBST(release_info)
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
VMAJ=v_maj
AC_SUBST(VMAJ)
AC_DEFINE_UNQUOTED([SHARED_LIB_SUFFIX], ["$shrext_cmds"], [Suffix for shared objects])
### Default options with respect to host
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
case "$host_os" in
mingw32ce*)
MODULE_ARCH="$host_os-$host_cpu"
install_vim="no"
have_ephysics_cc="no"
;;
*)
MODULE_ARCH="$host_os-$host_cpu-v_maj.0.0"
install_vim="yes"
have_ephysics_cc="yes"
;;
esac
requirement_ephysics=""
AC_SUBST(MODULE_ARCH)
AC_DEFINE_UNQUOTED(MODULE_ARCH, "${MODULE_ARCH}", "Module architecture")
m4_ifdef([v_mic],
[
EFL_COMPILER_FLAG([-Wshadow])
EFL_COMPILER_FLAG([-Wall])
EFL_COMPILER_FLAG([-Wextra])
EFL_COMPILER_FLAG([-W])
])
### Checks for programs
AC_PROG_CC
AC_PROG_CXX
# doxygen program for documentation building
EFL_CHECK_DOXYGEN([build_doc="yes"], [build_doc="no"])
# python
AM_PATH_PYTHON([2.5], , [:])
AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" != : ])
# pkg-config
PKG_PROG_PKG_CONFIG
# Check whether pkg-config supports Requires.private
if $PKG_CONFIG --atleast-pkgconfig-version 0.22; then
pkgconfig_requires_private="Requires.private"
else
pkgconfig_requires_private="Requires"
fi
AC_SUBST(pkgconfig_requires_private)
### Checks for libraries
# Evil library for compilation on Windows
EFL_EPHYSICS_BUILD=""
case "$host_os" in
mingw*)
PKG_CHECK_MODULES([EVIL], [evil >= 1.0.0])
AC_DEFINE([HAVE_EVIL], [1], [Set to 1 if Evil library is installed])
requirement_ephysics="evil ${requirement_ephysics}"
EFL_EPHYSICS_BUILD="-DEFL_EPHYSICS_BUILD"
;;
esac
AC_SUBST(EFL_EPHYSICS_BUILD)
# Dependencies for the library
PKG_CHECK_MODULES([EPHYSICS],
[
eina >= 1.2.0
evas >= 1.2.0
ecore >= 1.2.0
ecore-evas >= 1.2.0
bullet >= 2.80
])
requirement_ephysics="bullet >= 2.80 ecore-evas >= 1.2.0 ecore >= 1.2.0 evas >= 1.2.0 eina >= 1.2.0 ${requirement_ephysics}"
### Checks for header files
AC_CHECK_HEADERS([locale.h sys/resource.h])
EFL_WITH_BIN([edje], [edje-cc], [edje_cc])
EFL_CHECK_PATH_MAX
### Checks for compiler characteristics
AM_PROG_CC_C_O
AC_C_CONST
AC_PROG_CC_STDC
AC_HEADER_STDC
AC_C___ATTRIBUTE__
case "$host_os" in
mingw32ce*)
EPHYSICS_CFLAGS="${EPHYSICS_CFLAGS} -D_WIN32_WCE=0x0420"
;;
esac
### Checks for linker characteristics
lt_enable_auto_import=""
case "$host_os" in
mingw*)
lt_enable_auto_import="-Wl,--enable-auto-import"
;;
esac
AC_SUBST(lt_enable_auto_import)
## Tests
PKG_CHECK_MODULES([ELEMENTARY], [elementary >= 1.0.0], [build_tests="yes"], [build_tests="no"])
AC_ARG_ENABLE([build-tests],
AC_HELP_STRING([--disable-build-tests],
[Disable building tests. It is enabled by default unless
required dependencies are not present. @<:@default==enabled@:>@]),
[
if test "x${enableval}" = "xno" ; then
build_tests="no"
else
requirement_ephysics="elementary >= 1.0.0 ${requirement_ephysics}"
fi
],
[])
AM_CONDITIONAL([BUILD_TESTS], [test "x${build_tests}" = "xyes"])
if test "${build_tests}" = "yes" ; then
PKG_CHECK_MODULES([EPHYSICS_TEST],
[
eina >= 1.2.0
evas >= 1.2.0
ecore >= 1.2.0
ecore-evas >= 1.2.0
elementary >= 1.0.0
bullet >= 2.80
])
fi
AC_SUBST(requirement_ephysics)
AC_OUTPUT([
ephysics.pc
Makefile
data/Makefile
data/logo_images/Makefile
data/themes/Makefile
doc/Makefile
doc/Doxyfile
src/Makefile
src/lib/Makefile
src/bin/Makefile
])
#####################################################################
## Info
echo
echo
echo
echo "------------------------------------------------------------------------"
echo "$PACKAGE $VERSION"
echo "------------------------------------------------------------------------"
echo
echo "Configuration Options Summary:"
echo
echo " Documentation........: ${build_doc}"
echo " Tests................: ${build_tests}"
echo
echo "Compilation............: make (or gmake)"
echo " CPPFLAGS.............: $CPPFLAGS"
echo " CFLAGS...............: $CFLAGS"
echo " LDFLAGS..............: $LDFLAGS"
echo
echo "Installation...........: make install (as root if needed, with 'su' or 'sudo')"
echo " prefix...............: $prefix"
echo

View File

@ -0,0 +1,3 @@
MAINTAINERCLEANFILES = Makefile.in
SUBDIRS = logo_images themes

View File

@ -0,0 +1,30 @@
MAINTAINERCLEANFILES = Makefile.in
filesdir = $(datadir)/ephysics/
files_DATA = \
logo_background.png \
logo_letter-C.png \
logo_letter-E.png \
logo_letter-H.png \
logo_letter-I.png \
logo_letter-P.png \
logo_letter-S1.png \
logo_letter-S2.png \
logo_letter-Y.png \
logo_light-C.png \
logo_light-E.png \
logo_light-H.png \
logo_light-I.png \
logo_light-P.png \
logo_light-S1.png \
logo_light-S2.png \
logo_light-Y.png \
logo_shadow-C.png \
logo_shadow-E.png \
logo_shadow-H.png \
logo_shadow-I.png \
logo_shadow-P.png \
logo_shadow-S1.png \
logo_shadow-S2.png \
logo_shadow-Y.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1022 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@ -0,0 +1,51 @@
MAINTAINERCLEANFILES = Makefile.in
EDJE_CC = @edje_cc@
EDJE_FLAGS_VERBOSE_ =
EDJE_FLAGS_VERBOSE_0 =
EDJE_FLAGS_VERBOSE_1 = -v
EDJE_FLAGS = $(EDJE_FLAGS_$(V)) -id $(top_srcdir)/data/themes/images -fd $(top_srcdir)/data/themes/fonts
filesdir = $(datadir)/ephysics/
files_DATA = ephysics_test.edj
EXTRA_DIST = \
ephysics_test.edc \
balls.edc \
buttons.edc \
cubes.edc \
effects.edc \
ephysics_test.edc \
frame.edc \
list.edc \
shadows.edc \
images/arrows.png \
images/background.jpg \
images/ball-blue.png \
images/ball-blue70.png \
images/ball-green.png \
images/ball-green70.png \
images/ball-red.png \
images/ball-red70.png \
images/bt_jump.png \
images/bt_jump_pressed.png \
images/bt_restart.png \
images/bt_restart_pressed.png \
images/collisionL.png \
images/cube-blue.png \
images/cube-purple.png \
images/list-item.png \
images/list-item-corner.png \
images/list-item-corner-pressed.png \
images/list-item-pressed.png \
images/shadow-ball.png \
images/shadow-cube.png
ephysics_test.edj: Makefile $(EXTRA_DIST)
$(EDJE_CC) $(EDJE_FLAGS) \
$(top_srcdir)/data/themes/ephysics_test.edc \
$(top_builddir)/data/themes/ephysics_test.edj
clean-local:
rm -f *.edj

View File

@ -0,0 +1,124 @@
images {
image: "ball-blue.png" COMP;
image: "ball-blue70.png" COMP;
image: "ball-green.png" COMP;
image: "ball-green70.png" COMP;
image: "ball-red.png" COMP;
image: "ball-red70.png" COMP;
}
group {
name: "blue-ball";
parts {
part {
name: "ball";
mouse_events: 0;
type: IMAGE;
description {
state: "default" 0.0;
image.normal: "ball-blue.png";
}
}
}
}
group {
name: "big-blue-ball";
parts {
part {
name: "ball";
mouse_events: 0;
type: IMAGE;
description {
state: "default" 0.0;
image.normal: "ball-blue70.png";
}
}
}
}
group {
name: "red-ball";
parts {
part {
name: "ball";
mouse_events: 0;
type: IMAGE;
description {
state: "default" 0.0;
image.normal: "ball-red.png";
}
}
}
}
group {
name: "big-red-ball";
parts {
part {
name: "ball";
mouse_events: 0;
type: IMAGE;
description {
state: "default" 0.0;
image.normal: "ball-red70.png";
}
}
}
}
group {
name: "green-ball";
parts {
part {
name: "ball";
mouse_events: 0;
type: IMAGE;
description {
state: "default" 0.0;
image.normal: "ball-green.png";
}
}
}
}
group {
name: "big-green-ball";
parts {
part {
name: "ball";
mouse_events: 0;
type: IMAGE;
description {
state: "default" 0.0;
image.normal: "ball-green70.png";
}
}
}
}

View File

@ -0,0 +1,133 @@
images {
image: "bt_jump.png" COMP;
image: "bt_jump_pressed.png" COMP;
image: "bt_restart.png" COMP;
image: "bt_restart_pressed.png" COMP;
}
#define BUTTON_GROUP(_name) \
group { \
name: "elm/button/base/ephysics-test-"#_name; \
\
parts { \
\
part { \
name: "blocker"; \
type: RECT; \
mouse_events: 1; \
description { \
state: "default" 0.0; \
color: 255 255 255 0; \
} \
} \
\
part { \
name: "base"; \
type: IMAGE; \
mouse_events: 0; \
description { \
state: "default" 0.0; \
min: 80 28; \
max: 80 28; \
aspect: 1 1; \
image.normal: "bt_"##_name##".png"; \
} \
description { \
state: "pressed" 0.0; \
inherit: "default" 0.0; \
image.normal: "bt_"##_name##"_pressed.png"; \
} \
description { \
state: "disabled" 0.0; \
inherit: "default" 0.0; \
color: 255 255 255 80; \
} \
} \
\
part { \
name: "over"; \
type: RECT; \
mouse_events: 1; \
ignore_flags: ON_HOLD; \
description { \
state: "default" 0.0; \
color: 255 255 255 0; \
} \
description { \
state: "disabled" 0.0; \
inherit: "default" 0.0; \
visible: 0; \
} \
} \
\
} \
\
programs { \
\
program { \
name: "bt_click"; \
source: "ephysics_test"; \
signal: "click"; \
in: 0.2 0; \
action: STATE_SET "pressed" 0.0; \
target: "base"; \
after: "bt_click2"; \
} \
\
program { \
name: "bt_click2"; \
in: 0.4 0; \
action: STATE_SET "default" 0.0; \
target: "base"; \
after: "bt_clicked"; \
} \
\
program { \
name: "bt_clicked"; \
source: "over"; \
signal: "mouse,clicked,1"; \
action: SIGNAL_EMIT "elm,action,click" ""; \
} \
\
program { \
name: "bt_pressed"; \
source: "over"; \
signal: "mouse,down,1"; \
action: STATE_SET "pressed" 0.0; \
target: "base"; \
} \
\
program { \
name: "bt_unpressed"; \
source: "over"; \
signal: "mouse,up,1"; \
action: STATE_SET "default" 0.0; \
target: "base"; \
} \
\
program { \
name: "disable"; \
source: "elm"; \
signal: "elm,state,disabled"; \
action: STATE_SET "disabled" 0.0; \
target: "base"; \
target: "over"; \
} \
\
program { \
name: "enable"; \
source: "elm"; \
signal: "elm,state,enabled"; \
action: STATE_SET "default" 0.0; \
target: "base"; \
target: "over"; \
} \
\
} \
\
}
BUTTON_GROUP(restart)
BUTTON_GROUP(jump)
#undef BUTTON_GROUP

View File

@ -0,0 +1,42 @@
images {
image: "cube-blue.png" COMP;
image: "cube-purple.png" COMP;
}
group {
name: "blue-cube";
parts {
part {
name: "cube";
mouse_events: 0;
type: IMAGE;
description {
state: "default" 0.0;
image.normal: "cube-blue.png";
}
}
}
}
group {
name: "purple-cube";
parts {
part {
name: "cube";
mouse_events: 0;
type: IMAGE;
description {
state: "default" 0.0;
image.normal: "cube-purple.png";
}
}
}
}

View File

@ -0,0 +1,49 @@
images {
image: "collisionL.png" COMP;
}
group {
name: "impact";
parts {
part {
name: "impact";
mouse_events: 0;
type: IMAGE;
description {
state: "default" 0.0;
image.normal: "collisionL.png";
color: 255 255 255 0;
}
description {
state: "visible" 0.0;
inherit: "default" 0.0;
color: 255 255 255 255;
}
}
}
programs {
program {
name: "impact,show";
source: "ephysics_test";
signal: "impact,show";
action: STATE_SET "visible" 0.0;
transition: LINEAR 0.2;
target: "impact";
after: "impact,show2";
}
program {
name: "impact,show2";
action: STATE_SET "default" 0.0;
transition: LINEAR 0.2;
target: "impact";
}
}
}

View File

@ -0,0 +1,13 @@
externals {
external: "elm";
}
collections {
#include "balls.edc"
#include "buttons.edc"
#include "cubes.edc"
#include "effects.edc"
#include "frame.edc"
#include "list.edc"
#include "shadows.edc"
}

View File

@ -0,0 +1,116 @@
images {
image: "arrows.png" COMP;
image: "background.jpg" COMP;
}
group {
name: "frame";
parts {
part {
name: "bg";
type: IMAGE;
mouse_events: 0;
description {
state: "default" 0.0;
min: 512 384;
max: 512 384;
image.normal: "background.jpg";
}
}
part {
name: "arrows";
type: IMAGE;
mouse_events: 0;
description {
state: "default" 0.0;
min: 326 241;
max: 326 241;
rel1.offset: -18 10;
color: 255 255 255 0;
image.normal: "arrows.png";
}
description {
state: "visible" 0.0;
inherit: "default" 0.0;
color: 255 255 255 255;
}
}
part {
name: "arrows_msg";
type: TEXT;
mouse_events: 0;
description {
state: "default" 0.0;
color: 232 224 215 0;
rel1.relative: 0.08 0.96;
rel2.relative: 0.92 1.0;
text {
font: "Sans";
size: 12;
text: "Press the arrows on the keyboard to give impulse to the object.";
}
}
description {
state: "visible" 0.0;
inherit: "default" 0.0;
color: 95 56 19 255;
}
}
part {
name: "restart_button";
type: EXTERNAL;
source: "elm/button";
mouse_events: 1;
description {
state: "default" 0.0;
rel1.relative: 1 0.08;
rel2.relative: 1 0.08;
fixed: 1 1;
align: 1 0.5;
params {
string: "style" "ephysics-test-restart";
}
}
}
part {
name: "extra_button";
type: SWALLOW;
mouse_events: 1;
description {
state: "default" 0.0;
rel1.relative: 0 0.08;
rel2.relative: 0 0.08;
fixed: 1 1;
align: 0 0.5;
}
}
}
programs {
program {
name: "restart_clicked";
source: "restart_button";
signal: "clicked";
action: SIGNAL_EMIT "restart" "test-theme";
}
program {
name: "arrows,show";
source: "ephysics_test";
signal: "arrows,show";
action: STATE_SET "visible" 0.0;
target: "arrows";
target: "arrows_msg";
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 514 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 989 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 969 B

View File

@ -0,0 +1,134 @@
images {
image: "list-item-corner-pressed.png" COMP;
image: "list-item-corner.png" COMP;
image: "list-item-pressed.png" COMP;
image: "list-item.png" COMP;
}
group {
name: "elm/list/base/ephysics-test";
parts {
part {
name: "bg";
type: RECT;
mouse_events: 1;
description {
state: "default" 0.0;
color: 179 149 117 255;
}
}
part {
name: "elm.swallow.content";
type: SWALLOW;
description {
state: "default" 0.0;
rel1.offset: 0 40;
rel2.offset: -1 -41;
}
}
}
}
group {
name: "elm/list/item/ephysics-test";
name: "elm/list/item_odd/ephysics-test";
parts {
part {
name: "event";
type: RECT;
repeat_events: 1;
description {
state: "default" 0.0;
color: 0 0 0 0;
}
}
part {
name: "base";
mouse_events: 0;
description {
state: "default" 0.0;
min: 8 60;
rel2.relative: 0.8 1;
image.normal: "list-item.png";
}
description {
state: "selected" 0.0;
inherit: "default" 0.0;
image.normal: "list-item-pressed.png";
}
}
part {
name: "base-corner";
mouse_events: 0;
description {
state: "default" 0.0;
min: 42 60;
max: 42 60;
rel1 {
to: "base";
relative: 1 0;
}
align: 0 0.5;
image.normal: "list-item-corner.png";
}
description {
state: "selected" 0.0;
inherit: "default" 0.0;
image.normal: "list-item-corner-pressed.png";
}
}
part {
name: "elm.text";
type: TEXT;
mouse_events: 0;
scale: 1;
description {
state: "default" 0.0;
color: 232 224 215 255;
text {
font: "Sans";
style: "Bold";
size: 18;
min: 1 1;
align: 0 0.5;
}
align: 0 0.5;
rel1.offset: 36 0;
}
}
}
programs {
program {
name: "go_active";
source: "elm";
signal: "elm,state,selected";
action: STATE_SET "selected" 0.0;
target: "base";
target: "base-corner";
}
program {
name: "go_passive";
source: "elm";
signal: "elm,state,unselected";
action: STATE_SET "default" 0.0;
target: "base";
target: "base-corner";
}
}
}

View File

@ -0,0 +1,49 @@
#define SHADOW_ALPHA_ID 1
images {
image: "shadow-ball.png" COMP;
image: "shadow-cube.png" COMP;
}
#define SHADOW_GROUP(_name) \
group { \
name: #_name; \
\
script { \
public message(Msg_Type:type, id, ...) \
{ \
if ((type == MSG_FLOAT) && (id == SHADOW_ALPHA_ID)) \
{ \
new Float:shadow_alpha = getfarg(2); \
set_tween_state(PART:"shadow", shadow_alpha, "default", 0.0, \
"visible", 0.0); \
} \
} \
} \
\
parts { \
\
part { \
name: "shadow"; \
mouse_events: 0; \
type: IMAGE; \
description { \
state: "default" 0.0; \
image.normal: _name##".png"; \
color: 255 255 255 0; \
} \
description { \
state: "visible" 0.0; \
inherit: "default" 0.0; \
color: 255 255 255 255; \
} \
} \
} \
\
}
SHADOW_GROUP(shadow-ball)
SHADOW_GROUP(shadow-cube)
#undef SHADOW_GROUP
#undef SHADOW_ALPHA_ID

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,35 @@
MAINTAINERCLEANFILES = Makefile.in
.PHONY: doc
PACKAGE_DOCNAME = $(PACKAGE_TARNAME)-$(PACKAGE_VERSION)-doc
if EFL_BUILD_DOC
doc-clean:
rm -rf html/ latex/ man/ xml/ $(top_builddir)/$(PACKAGE_DOCNAME).tar*
doc: all doc-clean
$(efl_doxygen)
cp $(srcdir)/img/* html/
cp $(srcdir)/img/* latex/
rm -rf $(PACKAGE_DOCNAME).tar*
mkdir -p $(PACKAGE_DOCNAME)/doc
cp -R html/ latex/ man/ $(PACKAGE_DOCNAME)/doc
tar cf $(PACKAGE_DOCNAME).tar $(PACKAGE_DOCNAME)/
bzip2 -9 $(PACKAGE_DOCNAME).tar
rm -rf $(PACKAGE_DOCNAME)/
mv $(PACKAGE_DOCNAME).tar.bz2 $(top_builddir)
clean-local: doc-clean
else
doc:
@echo "Documentation not built. Run ./configure --help"
endif
EXTRA_DIST = Doxyfile e.css foot.html head.html $(wildcard img/*.*) \
$(wildcard examples/*.*) examples.dox

295
legacy/ephysics/doc/e.css Normal file
View File

@ -0,0 +1,295 @@
/*
Author:
Andres Blanc <andresblanc@gmail.com>
DaveMDS Andreoli <dave@gurumeditation.it>
Supported Browsers:
ie7, opera9, konqueror4 and firefox3
Please use a different file for ie6, ie5, etc. hacks.
*/
/* Necessary to place the footer at the bottom of the page */
html, body {
height: 100%;
margin: 0px;
padding: 0px;
}
#container {
min-height: 100%;
height: auto !important;
height: 100%;
margin: 0 auto -53px;
}
#footer, #push {
height: 53px;
}
* html #container {
height: 100%;
}
/* Prevent floating elements overflowing containers */
.clear {
clear: both;
width: 0px;
height: 0px;
}
/* Flexible & centered layout from 750 to 960 pixels */
.layout {
max-width: 960px;
min-width: 760px;
margin-left: auto;
margin-right: auto;
}
body {
/*font-family: Lucida Grande, Helvetica, sans-serif;*/
font-family: "Bitstream Vera","Vera","Trebuchet MS",Trebuchet,Tahoma,sans-serif
}
/* Prevent design overflowing the viewport in small resolutions */
#container {
padding-right: 17px;
padding-left: 17px;
background-image: url(head_bg.png);
background-repeat: repeat-x;
}
/****************************/
/* Top main menu */
/****************************/
#header_logo {
background-image : url(logo.png);
width : 61px;
}
#header_logo a {
position : absolute;
border : 0px;
background-color : transparent;
top : 0px;
width : 60px;
height : 60px;
}
#header_menu {
background-image : url(header_menu_background.png);
font : normal 10pt verdana,'Bitstream Vera Sans',helvetica,arial,sans-serif;
text-align : right;
}
#header_last {
background-image : url(header_menu_background_last.png);
width : 15px;
}
td.nav_passive {
background : url(header_menu_unselected_background.png) 0 0 no-repeat;
height : 63px;
font-family : "Bitstream Vera","Vera","Trebuchet MS",Trebuchet,Tahoma,sans-serif;
font-size : 11px;
padding : 20px 10px 20px 10px;
vertical-align : middle;
}
td.nav_active {
background : url(header_menu_current_background.png) 0 0 no-repeat;
height : 63px;
color : #646464;
font-family : "Bitstream Vera","Vera","Trebuchet MS",Trebuchet,Tahoma,sans-serif;
font-size : 11px;
font-weight : bold;
padding : 20px 10px 20px 10px;
vertical-align : middle;
}
#header_menu a {
display : block;
text-decoration : none;
cursor : pointer;
color : #cdcdcd;
}
#header {
width: 100%;
height: 102px;
}
#header h1 {
width: 63px;
height: 63px;
position: absolute;
margin: 0px;
}
#header h1 span {
display: none;
}
#header h2 {
display: none;
}
/* .menu-container is used to set properties common to .menu and .submenu */
#header .menu-container {
}
#header .menu-container ul {
list-style-type: none;
list-style-position: inside;
margin: 0;
}
#header .menu-container li {
display: block;
float: right;
}
#header .menu {
height: 63px;
display: block;
background-image: url(menu_bg.png);
background-repeat: repeat-x;
}
#header .menu ul {
height: 100%;
display: block;
background-image: url(menu_bg_last.png);
background-repeat: no-repeat;
background-position: top right;
padding-right: 17px;
}
#header .menu li {
height: 100%;
text-align: center;
background-image: url(menu_bg_unsel.png);
background-repeat: no-repeat;
}
#header .menu a {
height: 100%;
display: block;
color: #cdcdcd;
text-decoration: none;
font-size: 10pt;
line-height: 59px;
text-align: center;
padding: 0px 15px 0px 15px;
}
#header .menu li:hover {
background-image: url(menu_bg_hover.png);
background-repeat: no-repeat;
}
#header .menu li:hover a {
color: #FFFFFF;
}
#header .menu li.current {
background-image: url(menu_bg_current.png);
background-repeat: no-repeat;
}
#header .menu li.current a {
color: #646464;
}
/* Hide all the submenus but the current */
#header .submenu ul {
display: none;
}
#header .submenu .current {
display: block;
}
#header .submenu {
font: bold 10px verdana,'Bitstream Vera Sans',helvetica,arial,sans-serif;
margin-top: 10px;
}
#header .submenu a {
color: #888888;
text-decoration: none;
font-size: 0.9em;
line-height: 15px;
padding:0px 5px 0px 5px;
}
#header .submenu a:hover {
color: #444444;
}
#header .submenu li {
border-left: 1px solid #DDDDDD;
}
#header .submenu li:last-child {
border-left: 0;
}
#header .doxytitle {
position: absolute;
font-size: 1.8em;
font-weight: bold;
color: #444444;
line-height: 35px;
}
#header small {
font-size: 0.4em;
}
#footer {
background-image: url(foot_bg.png);
width: 100%;
}
#footer table {
width: 100%;
text-align: center;
white-space: nowrap;
padding: 5px 30px 5px 30px;
font-size: 0.8em;
font-family: "Bitstream Vera","Vera","Trebuchet MS",Trebuchet,Tahoma,sans-serif;
color: #888888;
}
#footer td.copyright {
width: 100%;
}
table.edcref tr td.block {
vertical-align: top;
padding-top: 10px;
}
table.edcref tr.section td.section, div.luaclass {
color: #888;
font-size: 16pt;
padding: 15px;
border-top: 1px solid #ccc;
text-align: center;
}
table.edcref tr.section td.section a {
color: #888;
text-decoration: none;
}
div.luaattrib {
color: #888;
border: 1px solid #ccc;
}

View File

@ -0,0 +1,208 @@
/**
* @page Examples Examples
*
* Here is a page with examples.
*
* @li @ref tutorial_ephysics_bouncing_ball
* @li @ref ephysics_logo_c
*/
/**
* @page tutorial_ephysics_bouncing_ball EPhysics - Bouncing Ball
*
* The purpose of this example is to show how to write an simple application -
* as the name suggests - with a small ball bouncing on the ground and
* responding to users events by making it jump - applying a central impulse on
* it.
*
* We'll guide you on defining a EPhysics world, defining its render geometry
* and the physics limiting boundaries, you'll learn how to add EPhysics bodies
* and how to associate it to evas objects. We also explain how to change
* restitution and friction properties. We see how to apply central impulse on
* a EPhysics_Body by implementing an elementary input event callback and
* calling the proper function.
*
* @section test-structure A test struct
* @dontinclude ephysics_test.h
*
* While in this example we'll be working with a struct to hold some objects in
* our code. For clarity sake we present you the struct declaration in the
* following block.
*
*
* @skip struct _Test_Data
* @until };
*
* @section world-new World Initialization
* @dontinclude test_bouncing_ball.c
*
* Calling ephysics_world_new()
* will create a new physics world with its collision configuration, constraint
* solver, broadphase interface and dispatcher.
*
* The default gravity is set to -9.81. It's possible to stop a running world
* but its default status is running. Take a look at
* ephysics_world_running_set() for further informations about world running
* status.
*
* @skipline ephysics_world_new
*
* @section render-geometry Render geometry
*
* By setting the render geometry you tell ephysics the dimensions of rendered
* area to be take on account by default updates.
*
* By default it starts with null x, y, width and height. Initially there's no
* physics limits but - as we'll see later in this example - boundaries can be
* added by issuing either ephysics_body_top_boundary_add(),
* ephysics_body_bottom_boundary_add(), ephysics_body_left_boundary_add() and
* ephysics_body_right_boundary_add().
*
* While setting the worlds render geometry the first parameter is our just
* created world, the following parameters indicate the x, y, width and height
* of our area of interest.
*
* @skipline ephysics_world_render_geometry_set
*
* @section boundaries Adding boundaries
*
* Boundaries are physics limits added by EPhysics which you can use to limit
* the area where your objects can move around. Bear in mind that those
* boundaries are created by EPhysics taking in account the render geometry you
* have previously defined by calling ephysics_world_render_geometry_set().
*
* In our example we start by adding a bottom boundary. This EPhysics_Body
* represents a physics limit under the world render geometry.
*
* The second line states the restitution factor for that bottom boundary, and
* the third line its friction. These changes will make our ball to bounce
* whenever it hits the ground.
*
* @skip ephysics_body_bottom_boundary_add
* @until ephysics_body_friction_set
*
* Then we add a right boundary limiting the physics world on the left side, we
* also change its restitution and friction factors but with a smaller value,
* we don't want to make it bounce as much as it is when hits the ground.
*
* @skip ephysics_body_right_boundary_add
* @until ephysics_body_friction_set
*
* We also add a left boundary taking the same considerations for right
* boundary.
*
* @skip ephysics_body_left_boundary_add
* @until ephysics_body_friction_set
*
* One of this examples requirements is to make the ball jump after a specific
* user event, so the ball can suffer an impulse for any direction.
*
* With an upper impulse we don't want our ball to fly all over there, we want
* to limit its upper movements, it's intended to limit the ball movement
* within a box, it should not leave the render geometry area, for that purpose
* we must define a top boundary.
*
* @skipline ephysics_body_top_boundary_add
* @dontinclude test_bouncing_ball.c
*
* @section world-populate Adding a ball
*
* Since we have defined the physics limits with our boundaries it's time to
* add some fun. Here we add a ball as an elementary image widget and tell
* ephysics about it.
*
* After setting the file that will be used as the image's source of our elm
* image we move it to the center of render geometry and resize it to 70x70
* pixels and show it.
*
* @skip elm_image_add
* @until evas_object_show
*
* The evas object is just set and we must tell EPhysics about it, creating the
* EPhysics_Body representing our ball and associating it to the just created
* evas object.
*
* Once the ball has been moved to the center of render geometry it should
* start falling after associating it to the EPhysics_Body. By default its mass
* is initially set to 1 kilo, but it can be changed by calling
* ephysics_body_mass_set(). Bear in mind that if you change its mass to 0
* kilos it becomes a static body and will not move at all, the body will
* remain fixed in the initial position.
*
* In the following code the first line adds a circle body, then we associate
* the evas object to EPhysics_Body, EPhysics will map every changes on physics
* object simulation to its evas object. Some restitution and friction factors
* are added as well.
*
* @skip ephysics_body_circle_add
* @until ephysics_body_friction_set
*
* @section jumping-ball Making it jump
*
* The next step is to give us the ability to make our ball to jump - actually
* apply some impulse whenever a key has been pressed. Then we add a elementary
* input callback to the window widget.
*
* @skipline elm_object_event_callback_add
*
* @dontinclude test_bouncing_ball.c
*
* The jumping callback implementation consists on handling only key up events
* and discarding any other input event we get. We're interested on keyboard
* events only. All the operations done in the following lines are done on
* sphere EPhysics_Body previously created.
*
* We mainly use the ephysics_body_central_impulse_apply() function. This
* function applies an inpulse on the center of a body.
*
* Once pressed \<Up> key it applies a central impulse of 0 kilos on X axis and
* 10 kilos on Y - so the ball is forced up.
*
* If \<Down> key has been pressed we apply an impulse of 0 kilos on X axis and
* -10 on Y - here the ball is forced down.
*
* In the case of \<Right> key pressing it's applied an impulse of 10 kilos on X
* axis and 0 kilos on Y - which applies a force to the right side. But if the
* key being pressed is \<Left> the opposite is done, and an impulse of -10
* kilos is applied on X and 0 kilos on Y - and the ball is forced to the left.
*
* @skip _on_keydown
* @until }
*
* Here we finish the very simple bouncing ball example. The full source code
* can be found at @ref test_bouncing_ball_c.
*
*/
/**
* @page test_bouncing_ball_c test_bouncing_ball.c
*
* @section ephysics-test-h ephysics_test.h
* @include ephysics_test.h
*
* @section test-bouncing-ball-c test_bouncing_ball.c
* @dontinclude test.c
* @skip test_clean
* @until }
*
* @skip test_data_new
* @until }
*
* @skip test_win_add
* @until }
*
* @include test_bouncing_ball.c
*
*
* @example test_bouncing_ball.c
*/
/**
* @page ephysics_logo_c ephysics_logo.c
*
* @section ephysics-logo-c ephysics_logo.c
* @include ephysics_logo.c
*
* @example ephysics_logo.c
*/

View File

@ -0,0 +1,18 @@
<div id="push"></div>
</div> <!-- #content -->
</div> <!-- .layout -->
</div> <!-- #container -->
<div id="footer">
<table><tr>
<td class="copyright">Copyright &copy;$year Enlightenment</td>
<td class="generated">Docs generated $datetime</td>
</tr></table>
</div>
</body>
</html>

View File

@ -0,0 +1,67 @@
<html>
<head>
<title>$title</title>
<meta http-equiv="content-type" content="text/html;charset=UTF-8">
<meta name="author" content="Andres Blanc" >
<link rel="icon" href="img/favicon.png" type="image/x-icon">
<link rel="shortcut icon" href="img/favicon.png" type="image/x-icon">
<link rel="icon" href="img/favicon.png" type="image/ico">
<link rel="shortcut icon" href="img/favicon.png" type="image/ico">
<link rel="stylesheet" type="text/css" href="e.css">
<link rel="stylesheet" type="text/css" href="edoxy.css">
</head>
<body>
<div id="container">
<div id="header">
<div class="layout">
<h1><span>Enlightenment</span></h1>
<h2><span>Beauty at your fingertips</span></h2>
<table cellspacing="0" cellpadding="0" width="100%"><tr>
<td id="header_logo">
<a href="http://www.enlightenment.org"></a>
</td>
<td id="header_menu">
<table cellspacing="0" cellpadding="0" align="right"><tr>
<td class="nav_passive"><a class="nav_passive" href="http://www.enlightenment.org/p.php?p=home">Home</a></td>
<td class="nav_passive"><a class="nav_passive" href="http://www.enlightenment.org/p.php?p=news">News</a></td>
<td class="nav_passive"><a class="nav_passive" href="http://www.enlightenment.org/p.php?p=about">About</a></td>
<td class="nav_passive"><a class="nav_passive" href="http://www.enlightenment.org/p.php?p=download">Download</a></td>
<td class="nav_passive"><a class="nav_passive" href="http://www.enlightenment.org/p.php?p=support">Support</a></td>
<td class="nav_passive"><a class="nav_passive" href="http://www.enlightenment.org/p.php?p=contribute">Contribute</a></td>
<td class="nav_passive"><a class="nav_passive" href="http://www.enlightenment.org/p.php?p=contact">Contact</a></td>
<td class="nav_passive"><a class="nav_passive" href="http://trac.enlightenment.org/e">Tracker</a></td>
<td class="nav_passive"><a class="nav_passive" href="http://www.enlightenment.org/p.php?p=docs">Docs</a></td>
</tr></table>
</td>
<td id="header_last"></td>
</tr></table>
<div class="doxytitle">
$projectname Documentation <small>at $date</small>
</div>
<div class="menu-container">
<div class="submenu">
<ul class="current">
<li><a href="files.html">Files</a></li>
<li><a href="Examples.html">Examples</a></li>
<li><a href="EPhysics_8h.html">EPhysics API</a></li>
<li class="current"><a href="index.html">Main Page</a></li>
</ul>
</div>
</div>
<div class="clear"></div>
</div>
</div>
<div id="content">
<div class="layout">

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

View File

@ -0,0 +1,486 @@
/*
* This file contain a custom doxygen style to match e.org graphics
*/
/* BODY,H1,H2,H3,H4,H5,H6,P,CENTER,TD,TH,UL,DL,DIV {
font-family: Geneva, Arial, Helvetica, sans-serif;
}*/
BODY, TD {
font-size: 12px;
}
H1 {
text-align: center;
font-size: 160%;
}
H2 {
font-size: 120%;
}
H3 {
font-size: 100%;
}
CAPTION {
font-weight: bold
}
DIV.qindex {
width: 100%;
background-color: #e8eef2;
border: 1px solid #84b0c7;
text-align: center;
margin: 2px;
padding: 2px;
line-height: 140%;
}
DIV.navpath {
width: 100%;
background-color: #e8eef2;
border: 1px solid #84b0c7;
text-align: center;
margin: 2px;
padding: 2px;
line-height: 140%;
}
DIV.navtab {
background-color: #e8eef2;
border: 1px solid #84b0c7;
text-align: center;
margin: 2px;
margin-right: 15px;
padding: 2px;
}
TD.navtab {
font-size: 70%;
}
A.qindex {
text-decoration: none;
font-weight: bold;
color: #1A419D;
}
A.qindex:visited {
text-decoration: none;
font-weight: bold;
color: #1A419D
}
A.qindex:hover {
text-decoration: none;
background-color: #ddddff;
}
A.qindexHL {
text-decoration: none;
font-weight: bold;
background-color: #6666cc;
color: #ffffff;
border: 1px double #9295C2;
}
A.qindexHL:hover {
text-decoration: none;
background-color: #6666cc;
color: #ffffff;
}
A.qindexHL:visited {
text-decoration: none;
background-color: #6666cc;
color: #ffffff
}
A.el {
text-decoration: none;
font-weight: bold
}
A.elRef {
font-weight: bold
}
A.code:link {
text-decoration: none;
font-weight: normal;
color: #0000FF
}
A.code:visited {
text-decoration: none;
font-weight: normal;
color: #0000FF
}
A.codeRef:link {
font-weight: normal;
color: #0000FF
}
A.codeRef:visited {
font-weight: normal;
color: #0000FF
}
A:hover, A:visited:hover {
text-decoration: none;
/* background-color: #f2f2ff; */
color: #000055;
}
A.anchor {
color: #000;
}
DL.el {
margin-left: -1cm
}
.fragment {
font-family: monospace, fixed;
font-size: 95%;
}
PRE.fragment {
border: 1px solid #CCCCCC;
background-color: #f5f5f5;
margin-top: 4px;
margin-bottom: 4px;
margin-left: 2px;
margin-right: 8px;
padding-left: 6px;
padding-right: 6px;
padding-top: 4px;
padding-bottom: 4px;
}
DIV.ah {
background-color: black;
font-weight: bold;
color: #ffffff;
margin-bottom: 3px;
margin-top: 3px
}
DIV.groupHeader {
margin-left: 16px;
margin-top: 12px;
margin-bottom: 6px;
font-weight: bold;
}
DIV.groupText {
margin-left: 16px;
font-style: italic;
font-size: 90%
}
/*BODY {
background: white;
color: black;
margin-right: 20px;
margin-left: 20px;
}*/
TD.indexkey {
background-color: #e8eef2;
font-weight: bold;
padding-right : 10px;
padding-top : 2px;
padding-left : 10px;
padding-bottom : 2px;
margin-left : 0px;
margin-right : 0px;
margin-top : 2px;
margin-bottom : 2px;
border: 1px solid #CCCCCC;
}
TD.indexvalue {
background-color: #e8eef2;
font-style: italic;
padding-right : 10px;
padding-top : 2px;
padding-left : 10px;
padding-bottom : 2px;
margin-left : 0px;
margin-right : 0px;
margin-top : 2px;
margin-bottom : 2px;
border: 1px solid #CCCCCC;
}
TR.memlist {
background-color: #f0f0f0;
}
P.formulaDsp {
text-align: center;
}
IMG.formulaDsp {
}
IMG.formulaInl {
vertical-align: middle;
}
SPAN.keyword { color: #008000 }
SPAN.keywordtype { color: #604020 }
SPAN.keywordflow { color: #e08000 }
SPAN.comment { color: #800000 }
SPAN.preprocessor { color: #806020 }
SPAN.stringliteral { color: #002080 }
SPAN.charliteral { color: #008080 }
SPAN.vhdldigit { color: #ff00ff }
SPAN.vhdlchar { color: #000000 }
SPAN.vhdlkeyword { color: #700070 }
SPAN.vhdllogic { color: #ff0000 }
.mdescLeft {
padding: 0px 8px 4px 8px;
font-size: 80%;
font-style: italic;
background-color: #FAFAFA;
border-top: 1px none #E0E0E0;
border-right: 1px none #E0E0E0;
border-bottom: 1px none #E0E0E0;
border-left: 1px none #E0E0E0;
margin: 0px;
}
.mdescRight {
padding: 0px 8px 4px 8px;
font-size: 80%;
font-style: italic;
background-color: #FAFAFA;
border-top: 1px none #E0E0E0;
border-right: 1px none #E0E0E0;
border-bottom: 1px none #E0E0E0;
border-left: 1px none #E0E0E0;
margin: 0px;
}
.memItemLeft {
padding: 1px 0px 0px 8px;
margin: 4px;
border-top-width: 1px;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
border-top-color: #E0E0E0;
border-right-color: #E0E0E0;
border-bottom-color: #E0E0E0;
border-left-color: #E0E0E0;
border-top-style: solid;
border-right-style: none;
border-bottom-style: none;
border-left-style: none;
background-color: #FAFAFA;
font-size: 80%;
}
.memItemRight {
padding: 1px 8px 0px 8px;
margin: 4px;
border-top-width: 1px;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
border-top-color: #E0E0E0;
border-right-color: #E0E0E0;
border-bottom-color: #E0E0E0;
border-left-color: #E0E0E0;
border-top-style: solid;
border-right-style: none;
border-bottom-style: none;
border-left-style: none;
background-color: #FAFAFA;
font-size: 80%;
}
.memTemplItemLeft {
padding: 1px 0px 0px 8px;
margin: 4px;
border-top-width: 1px;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
border-top-color: #E0E0E0;
border-right-color: #E0E0E0;
border-bottom-color: #E0E0E0;
border-left-color: #E0E0E0;
border-top-style: none;
border-right-style: none;
border-bottom-style: none;
border-left-style: none;
background-color: #FAFAFA;
font-size: 80%;
}
.memTemplItemRight {
padding: 1px 8px 0px 8px;
margin: 4px;
border-top-width: 1px;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
border-top-color: #E0E0E0;
border-right-color: #E0E0E0;
border-bottom-color: #E0E0E0;
border-left-color: #E0E0E0;
border-top-style: none;
border-right-style: none;
border-bottom-style: none;
border-left-style: none;
background-color: #FAFAFA;
font-size: 80%;
}
.memTemplParams {
padding: 1px 0px 0px 8px;
margin: 4px;
border-top-width: 1px;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
border-top-color: #E0E0E0;
border-right-color: #E0E0E0;
border-bottom-color: #E0E0E0;
border-left-color: #E0E0E0;
border-top-style: solid;
border-right-style: none;
border-bottom-style: none;
border-left-style: none;
color: #606060;
background-color: #FAFAFA;
font-size: 80%;
}
.search {
color: #003399;
font-weight: bold;
}
FORM.search {
margin-bottom: 0px;
margin-top: 0px;
}
INPUT.search {
font-size: 75%;
color: #000080;
font-weight: normal;
background-color: #e8eef2;
}
TD.tiny {
font-size: 75%;
}
a {
color: #1A41A8;
}
a:visited {
color: #2A3798;
}
.dirtab {
padding: 4px;
border-collapse: collapse;
border: 1px solid #84b0c7;
}
TH.dirtab {
background: #e8eef2;
font-weight: bold;
}
HR {
height: 1px;
border: none;
border-top: 1px solid black;
}
/* Style for detailed member documentation */
.memtemplate {
font-size: 80%;
color: #606060;
font-weight: normal;
margin-left: 3px;
}
.memnav {
background-color: #eeeeee;
border: 1px solid #dddddd;
text-align: center;
margin: 2px;
margin-right: 15px;
padding: 2px;
}
.memitem {
padding: 4px;
background-color: #eeeeee;
border-width: 1px;
border-style: solid;
border-color: #dddddd;
-moz-border-radius: 4px 4px 4px 4px;
}
.memname {
white-space: nowrap;
font-weight: bold;
color: #ffffff;
}
.memdoc{
padding-left: 10px;
}
.memproto {
background-color: #111111;
width: 100%;
border-width: 1px;
border-style: solid;
border-color: #000000;
font-weight: bold;
-moz-border-radius: 4px 4px 4px 4px;
}
.paramkey {
text-align: right;
color: #ffffff;
}
.paramtype {
white-space: nowrap;
color: #aaaaaa;
}
.paramname {
color: #ff0000;
font-style: italic;
white-space: nowrap;
}
/* End Styling for detailed member documentation */
/* for the tree view */
.ftvtree {
font-family: sans-serif;
margin:0.5em;
}
/* these are for tree view when used as main index */
.directory {
font-size: 9pt;
font-weight: bold;
}
.directory h3 {
margin: 0px;
margin-top: 1em;
font-size: 11pt;
}
/* The following two styles can be used to replace the root node title */
/* with an image of your choice. Simply uncomment the next two styles, */
/* specify the name of your image and be sure to set 'height' to the */
/* proper pixel height of your image. */
/* .directory h3.swap { */
/* height: 61px; */
/* background-repeat: no-repeat; */
/* background-image: url("yourimage.gif"); */
/* } */
/* .directory h3.swap span { */
/* display: none; */
/* } */
.directory > h3 {
margin-top: 0;
}
.directory p {
margin: 0px;
white-space: nowrap;
}
.directory div {
display: none;
margin: 0px;
}
.directory img {
vertical-align: -30%;
}
/* these are for tree view when not used as main index */
.directory-alt {
font-size: 100%;
font-weight: bold;
}
.directory-alt h3 {
margin: 0px;
margin-top: 1em;
font-size: 11pt;
}
.directory-alt > h3 {
margin-top: 0;
}
.directory-alt p {
margin: 0px;
white-space: nowrap;
}
.directory-alt div {
display: none;
margin: 0px;
}
.directory-alt img {
vertical-align: -30%;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 173 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 214 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 192 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 637 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

View File

@ -0,0 +1,12 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
vmaj=@VMAJ@
Name: ephysics
Description: EPhysics is a wrapper for physics engine.
@pkgconfig_requires_private@: @requirement_ephysics@
Version: @VERSION@
Libs: -L${libdir} -lephysics
Cflags: -I${includedir}/ephysics-@VMAJ@

View File

@ -0,0 +1,47 @@
dnl Copyright (C) 2004-2008 Kim Woelders
dnl Copyright (C) 2008 Vincent Torri <vtorri at univ-evry dot fr>
dnl That code is public domain and can be freely used or copied.
dnl Originally snatched from somewhere...
dnl Macro for checking if the compiler supports __attribute__
dnl Usage: AC_C___ATTRIBUTE__
dnl call AC_DEFINE for HAVE___ATTRIBUTE__ and __UNUSED__
dnl if the compiler supports __attribute__, HAVE___ATTRIBUTE__ is
dnl defined to 1 and __UNUSED__ is defined to __attribute__((unused))
dnl otherwise, HAVE___ATTRIBUTE__ is not defined and __UNUSED__ is
dnl defined to nothing.
AC_DEFUN([AC_C___ATTRIBUTE__],
[
AC_MSG_CHECKING([for __attribute__])
AC_CACHE_VAL([ac_cv___attribute__],
[AC_TRY_COMPILE(
[
#include <stdlib.h>
int func(int x);
int foo(int x __attribute__ ((unused)))
{
exit(1);
}
],
[],
[ac_cv___attribute__="yes"],
[ac_cv___attribute__="no"]
)])
AC_MSG_RESULT($ac_cv___attribute__)
if test "x${ac_cv___attribute__}" = "xyes" ; then
AC_DEFINE([HAVE___ATTRIBUTE__], [1], [Define to 1 if your compiler has __attribute__])
AC_DEFINE([__UNUSED__], [__attribute__((unused))], [Macro declaring a function argument to be unused])
else
AC_DEFINE([__UNUSED__], [], [Macro declaring a function argument to be unused])
fi
])
dnl End of ac_attribute.m4

View File

@ -0,0 +1,71 @@
dnl Copyright (C) 2010 Vincent Torri <vtorri at univ-evry dot fr>
dnl That code is public domain and can be freely used or copied.
dnl Macro that check if a binary is built or not
dnl Usage: EFL_ENABLE_BIN(binary)
dnl Call AC_SUBST(BINARY_PRG) (BINARY is the uppercase of binary, - being transformed into _)
dnl Define have_binary (- is transformed into _)
dnl Define conditional BUILD_BINARY (BINARY is the uppercase of binary, - being transformed into _)
AC_DEFUN([EFL_ENABLE_BIN],
[
m4_pushdef([UP], m4_translit([[$1]], [-a-z], [_A-Z]))dnl
m4_pushdef([DOWN], m4_translit([[$1]], [-A-Z], [_a-z]))dnl
have_[]m4_defn([DOWN])="yes"
dnl configure option
AC_ARG_ENABLE([$1],
[AC_HELP_STRING([--disable-$1], [disable building of ]DOWN)],
[
if test "x${enableval}" = "xyes" ; then
have_[]m4_defn([DOWN])="yes"
else
have_[]m4_defn([DOWN])="no"
fi
])
AC_MSG_CHECKING([whether to build ]DOWN[ binary])
AC_MSG_RESULT([$have_[]m4_defn([DOWN])])
if test "x$have_[]m4_defn([DOWN])" = "xyes"; then
UP[]_PRG=DOWN[${EXEEXT}]
fi
AC_SUBST(UP[]_PRG)
AM_CONDITIONAL(BUILD_[]UP, test "x$have_[]m4_defn([DOWN])" = "xyes")
AS_IF([test "x$have_[]m4_defn([DOWN])" = "xyes"], [$2], [$3])
])
dnl Macro that check if a binary is built or not
dnl Usage: EFL_WITH_BIN(package, binary, default_value)
dnl Call AC_SUBST(_binary) (_binary is the lowercase of binary, - being transformed into _ by default, or the value set by the user)
AC_DEFUN([EFL_WITH_BIN],
[
m4_pushdef([DOWN], m4_translit([[$2]], [-A-Z], [_a-z]))dnl
dnl configure option
AC_ARG_WITH([$2],
[AC_HELP_STRING([--with-$2=PATH], [specify a specific path to ]DOWN[ @<:@default=$3@:>@])],
[_efl_with_binary=${withval}],
[_efl_with_binary=$(pkg-config --variable=prefix $1)/bin/$3])
DOWN=${_efl_with_binary}
AC_MSG_NOTICE(DOWN[ set to ${_efl_with_binary}])
with_binary_[]m4_defn([DOWN])=${_efl_with_binary}
AC_SUBST(DOWN)
])

View File

@ -0,0 +1,57 @@
dnl Copyright (C) 2010 Vincent Torri <vtorri at univ-evry dot fr>
dnl and Albin Tonnerre <albin dot tonnerre at gmail dot com>
dnl That code is public domain and can be freely used or copied.
dnl Macro that checks if a compiler flag is supported by the compiler.
dnl Usage: EFL_COMPILER_FLAG(flag)
dnl flag is added to CFLAGS if supported.
AC_DEFUN([EFL_COMPILER_FLAG],
[
CFLAGS_save="${CFLAGS}"
CFLAGS="${CFLAGS} $1"
AC_LANG_PUSH([C])
AC_MSG_CHECKING([whether the compiler supports $1])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[]])],
[have_flag="yes"],
[have_flag="no"])
AC_MSG_RESULT([${have_flag}])
if test "x${have_flag}" = "xno" ; then
CFLAGS="${CFLAGS_save}"
fi
AC_LANG_POP([C])
])
dnl Macro that checks if a linker flag is supported by the compiler.
dnl Usage: EFL_LINKER_FLAG(flag)
dnl flag is added to LDFLAGS if supported (will be passed to ld anyway).
AC_DEFUN([EFL_LINKER_FLAG],
[
LDFLAGS_save="${LDFLAGS}"
LDFLAGS="${LDFLAGS} $1"
AC_LANG_PUSH([C])
AC_MSG_CHECKING([whether the compiler supports $1])
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([[]])],
[have_flag="yes"],
[have_flag="no"])
AC_MSG_RESULT([${have_flag}])
if test "x${have_flag}" = "xno" ; then
LDFLAGS="${LDFLAGS_save}"
fi
AC_LANG_POP([C])
])

View File

@ -0,0 +1,97 @@
dnl Copyright (C) 2008 Vincent Torri <vtorri at univ-evry dot fr>
dnl That code is public domain and can be freely used or copied.
dnl Macro that check if doxygen is available or not.
dnl EFL_CHECK_DOXYGEN([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
dnl Test for the doxygen program
dnl Defines efl_doxygen
dnl Defines the automake conditionnal EFL_BUILD_DOC
dnl
AC_DEFUN([EFL_CHECK_DOXYGEN],
[
dnl
dnl Disable the build of the documentation
dnl
AC_ARG_ENABLE([doc],
[AC_HELP_STRING(
[--disable-doc],
[Disable documentation build @<:@default=enabled@:>@])],
[
if test "x${enableval}" = "xyes" ; then
efl_enable_doc="yes"
else
efl_enable_doc="no"
fi
],
[efl_enable_doc="yes"])
AC_MSG_CHECKING([whether to build documentation])
AC_MSG_RESULT([${efl_enable_doc}])
if test "x${efl_enable_doc}" = "xyes" ; then
dnl Specify the file name, without path
efl_doxygen="doxygen"
AC_ARG_WITH([doxygen],
[AC_HELP_STRING(
[--with-doxygen=FILE],
[doxygen program to use @<:@default=doxygen@:>@])],
dnl Check the given doxygen program.
[efl_doxygen=${withval}
AC_CHECK_PROG([efl_have_doxygen],
[${efl_doxygen}],
[yes],
[no])
if test "x${efl_have_doxygen}" = "xno" ; then
echo "WARNING:"
echo "The doxygen program you specified:"
echo "${efl_doxygen}"
echo "was not found. Please check the path and make sure "
echo "the program exists and is executable."
AC_MSG_WARN([no doxygen detected. Documentation will not be built])
fi
],
[AC_CHECK_PROG([efl_have_doxygen],
[${efl_doxygen}],
[yes],
[no])
if test "x${efl_have_doxygen}" = "xno" ; then
echo "WARNING:"
echo "The doxygen program was not found in your execute path."
echo "You may have doxygen installed somewhere not covered by your path."
echo ""
echo "If this is the case make sure you have the packages installed, AND"
echo "that the doxygen program is in your execute path (see your"
echo "shell manual page on setting the \$PATH environment variable), OR"
echo "alternatively, specify the program to use with --with-doxygen."
AC_MSG_WARN([no doxygen detected. Documentation will not be built])
fi
])
fi
dnl
dnl Substitution
dnl
AC_SUBST([efl_doxygen])
if ! test "x${efl_have_doxygen}" = "xyes" ; then
efl_enable_doc="no"
fi
AM_CONDITIONAL(EFL_BUILD_DOC, test "x${efl_enable_doc}" = "xyes")
if test "x${efl_enable_doc}" = "xyes" ; then
m4_default([$1], [:])
else
m4_default([$2], [:])
fi
])
dnl End of efl_doxygen.m4

View File

@ -0,0 +1,36 @@
dnl Check for PATH_MAX in limits.h, and define a default value if not found
dnl This is a workaround for systems not providing PATH_MAX, like GNU/Hurd
dnl EFL_CHECK_PATH_MAX([DEFAULT_VALUE_IF_NOT_FOUND])
dnl
dnl If PATH_MAX is not defined in <limits.h>, defines it
dnl to DEFAULT_VALUE_IF_NOT_FOUND if it exists, or fallback
dnl to using 4096
AC_DEFUN([EFL_CHECK_PATH_MAX],
[
default_max=m4_default([$1], "4096")
AC_LANG_PUSH([C])
AC_MSG_CHECKING([for PATH_MAX in limits.h])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[[
#include <limits.h>
]],
[[
int i = PATH_MAX;
]])],
[AC_MSG_RESULT([yes])],
[
AC_DEFINE_UNQUOTED([PATH_MAX],
[${default_max}],
[default value since PATH_MAX is not defined])
AC_MSG_RESULT([no: using ${default_max}])
])
AC_LANG_POP([C])
])
dnl end of efl_path_max.m4

View File

@ -0,0 +1,3 @@
MAINTAINERCLEANFILES = Makefile.in
SUBDIRS = lib bin

View File

@ -0,0 +1,44 @@
MAINTAINERCLEANFILES = Makefile.in
if BUILD_TESTS
AM_CPPFLAGS = \
-I$(top_srcdir) \
-I$(top_srcdir)/src/lib \
-I$(top_builddir)/src/lib \
-I$(top_srcdir)/src/bin \
-DPACKAGE_BIN_DIR=\"$(bindir)\" \
-DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \
@EPHYSICS_TEST_CFLAGS@
bin_PROGRAMS = ephysics_test ephysics_logo
EXTRA_PROGRAMS = ephysics_test ephysics_logo
ephysics_test_SOURCES = \
test.c \
test_bouncing_ball.c \
test_bouncing_text.c \
test_colliding_balls.c \
test_collision_detection.c \
test_constraint.c \
test_falling_letters.c \
test_jumping_balls.c \
test_rotate.c
ephysics_logo_SOURCES = \
ephysics_logo.c
ephysics_test_LDADD = \
$(top_builddir)/src/lib/libephysics.la \
@EPHYSICS_TEST_LIBS@
ephysics_logo_LDADD = \
$(top_builddir)/src/lib/libephysics.la \
@EPHYSICS_TEST_LIBS@
ephysics_logo_LDFLAGS =
ephysics_test_LDFLAGS =
EXTRA_DIST = ephysics_test.h
endif

View File

@ -0,0 +1,279 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <Elementary.h>
#include <EPhysics.h>
#include <Evas.h>
/* TODO: move to EPhysics.h */
#define EPHYSICS_BODY_MASS_IMMUTABLE (0.0)
#define WIDTH (512)
#define HEIGHT (384)
#define FLOOR_Y (HEIGHT - 80)
#define SH_THRESHOLD (250)
#define SH_OFFSET_X (- 16)
#define OFFSET_X (90)
#define PADDING_X_1 (16)
#define PADDING_X_2 (12)
#define PADDING_X_3 (22)
#define E_THRESHOLD (WIDTH + 560)
#define LAYER_SHADOW (10)
#define LAYER_LETTER (20)
#define CENTER(total, item) (((total) - (item)) / 2)
#define LIMIT(val, op, ref) (((val) op (ref)) ? (val) : (ref));
#define PROP_GET(pos, min, max) (((min) + ((max) - (min)) * (pos)) / (max))
static void
_update_box_cb(void *data __UNUSED__, EPhysics_Body *body, void *event_info)
{
Evas_Object *image = event_info;
Evas_Object *shadow = evas_object_data_get(image, "shadow");
Evas_Object *light = evas_object_data_get(image, "light");
int x, y, w, h, floor_distance, alpha = 0;
/* modify the evas object according to the body */
ephysics_body_evas_object_update(body);
evas_object_geometry_get(image, &x, &y, &w, &h);
floor_distance = FLOOR_Y - h;
/* Bodies penetrates the ground slightly before bouncing. */
/* This is to be expected in realtime physics engines. */
// TODO BUG: should we move the object up by the difference????
//y = LIMIT(y, <=, floor_distance);
/* We should show the shadow when we're close enough to ground */
if (y > SH_THRESHOLD)
{
int sh_w, sh_h;
double pos_x;
evas_object_image_size_get(shadow, &sh_w, &sh_h);
/* shadow is darker with bigger y */
alpha = 255 * (y - SH_THRESHOLD) / (floor_distance - SH_THRESHOLD);
/* and with bigger x -- it's proportional to x / WIDTH, but varies
* from 100 to 255.
*/
pos_x = (double) x / (WIDTH - w);
alpha = alpha * PROP_GET(pos_x, 100, 255);
/* box shadow is not resized, just moved */
evas_object_move(shadow, x + CENTER(w, sh_w) + SH_OFFSET_X,
FLOOR_Y - sh_h + 2);
}
evas_object_color_set(shadow, alpha, alpha, alpha, alpha);
evas_object_move(light, x, y);
/* it's lighter with bigger y */
alpha = (y <= 0) ? 0 : y * 255 / floor_distance;
/* and with bigger x */
alpha = alpha * (x - OFFSET_X + 80) / (WIDTH - OFFSET_X);
evas_object_color_set(light, alpha, alpha, alpha, alpha);
}
static void
_update_circle_cb(void *data __UNUSED__, EPhysics_Body *body, void *event_info)
{
Evas_Object *image = event_info;
Evas_Object *shadow = evas_object_data_get(image, "shadow");
Evas_Object *light = evas_object_data_get(image, "light");
int x, y, w, h, sh_w, sh_h, alpha = 0;
const Evas_Map *map;
/* modify the evas object according to the body */
ephysics_body_evas_object_update(body);
evas_object_geometry_get(image, &x, &y, &w, &h);
evas_object_move(light, x, y);
alpha = x * 255 / (WIDTH - w);
evas_object_color_set(light, alpha, alpha, alpha, alpha);
/* use the same map from image to the light (rotate it) */
map = evas_object_map_get(image);
evas_object_map_set(light, map);
evas_object_map_enable_set(light, EINA_TRUE);
evas_object_image_size_get(shadow, &sh_w, &sh_h);
evas_object_move(shadow, x + CENTER(w, sh_w) + SH_OFFSET_X,
FLOOR_Y - sh_h + 2);
alpha = 127 + alpha / 2;
evas_object_color_set(shadow, alpha, alpha, alpha, alpha);
if (x > E_THRESHOLD)
ephysics_body_geometry_set(body, -w - 1, y, w, h);
}
static void
_letter_add(Evas *evas, const char *letter, Evas_Object **image, Evas_Object **light, Evas_Object **shadow)
{
int w, h, sh_w, sh_h;
char buf[1024];
snprintf(buf, sizeof(buf), PACKAGE_DATA_DIR "/logo_shadow-%s.png", letter);
*shadow = evas_object_image_filled_add(evas);
evas_object_image_file_set(*shadow, buf, NULL);
evas_object_image_size_get(*shadow, &sh_w, &sh_h);
evas_object_resize(*shadow, sh_w, sh_h);
evas_object_color_set(*shadow, 0, 0, 0, 0);
evas_object_layer_set(*shadow, LAYER_SHADOW);
evas_object_show(*shadow);
snprintf(buf, sizeof(buf), PACKAGE_DATA_DIR "/logo_letter-%s.png", letter);
*image = evas_object_image_filled_add(evas);
evas_object_image_file_set(*image, buf, NULL);
evas_object_image_size_get(*image, &w, &h);
evas_object_resize(*image, w, h);
evas_object_layer_set(*image, LAYER_LETTER);
evas_object_show(*image);
snprintf(buf, sizeof(buf), PACKAGE_DATA_DIR "/logo_light-%s.png", letter);
*light = evas_object_image_filled_add(evas);
evas_object_image_file_set(*light, buf, NULL);
evas_object_resize(*light, w, h);
evas_object_layer_set(*light, LAYER_LETTER);
evas_object_show(*light);
/* allow easy access to shadow and light from the letter image */
evas_object_data_set(*image, "shadow", *shadow);
evas_object_data_set(*image, "light", *light);
}
static void
_letter_body_setup_common(EPhysics_Body *body, Evas_Object *view)
{
ephysics_body_evas_object_set(body, view, EINA_TRUE);
ephysics_body_mass_set(body, 1.2);
ephysics_body_restitution_set(body, 0.6);
ephysics_body_rotation_on_z_axis_enable_set(body, EINA_FALSE);
}
static EPhysics_Body *
_letter_body_box_add(EPhysics_World *world, Evas_Object *image)
{
EPhysics_Body *body = ephysics_body_box_add(world);
_letter_body_setup_common(body, image);
ephysics_body_event_callback_add
(body, EPHYSICS_CALLBACK_BODY_UPDATE, _update_box_cb, NULL);
return body;
}
static EPhysics_Body *
_letter_body_circle_add(EPhysics_World *world, Evas_Object *image)
{
EPhysics_Body *body = ephysics_body_circle_add(world);
_letter_body_setup_common(body, image);
ephysics_body_event_callback_add
(body, EPHYSICS_CALLBACK_BODY_UPDATE, _update_circle_cb, NULL);
return body;
}
EAPI_MAIN int
elm_main(int argc __UNUSED__, char **argv __UNUSED__)
{
Evas_Object *win, *bg, *image, *light, *shadow;
EPhysics_Body *ground_body, *letter_body;
EPhysics_World *world;
unsigned int i = 0;
int x, w, h, sh_w;
Evas *evas;
struct letter_desc {
const char *letter;
int padding;
} falling_letters[] = {
{"P", PADDING_X_1},
{"H", PADDING_X_1},
{"Y", PADDING_X_3},
{"S1", PADDING_X_2},
{"I", PADDING_X_2},
{"C", PADDING_X_3},
{"S2", 0}
};
if (!ephysics_init())
return - 1;
elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
win = elm_win_add(NULL, "main", ELM_WIN_SPLASH);
elm_win_title_set(win, "EPhysics Logo");
elm_win_autodel_set(win, EINA_TRUE);
evas_object_show(win);
bg = elm_bg_add(win);
elm_bg_file_set(bg, PACKAGE_DATA_DIR "/logo_background.png", NULL);
elm_win_resize_object_add(win, bg);
evas_object_size_hint_min_set(bg, WIDTH, HEIGHT);
evas_object_size_hint_max_set(bg, WIDTH, HEIGHT);
evas_object_show(bg);
world = ephysics_world_new();
ephysics_world_render_geometry_set(world, 0, 0, WIDTH, HEIGHT);
ground_body = ephysics_body_box_add(world);
ephysics_body_mass_set(ground_body, EPHYSICS_BODY_MASS_IMMUTABLE);
ephysics_body_geometry_set(ground_body, -100, FLOOR_Y, WIDTH + 800, 10);
ephysics_body_restitution_set(ground_body, 0.65);
ephysics_body_friction_set(ground_body, 0.8);
evas = evas_object_evas_get(win);
x = OFFSET_X;
for (i = 0; i < EINA_C_ARRAY_LENGTH(falling_letters); i++)
{
_letter_add(evas, falling_letters[i].letter, &image, &light, &shadow);
evas_object_image_size_get(shadow, &sh_w, NULL);
evas_object_image_size_get(image, &w, &h);
/* place image and light on top, above what the viewport can show */
evas_object_move(image, x, -h * (i + 1) - 50);
evas_object_move(light, x, -h * (i + 1) - 50);
/* place shadow below the hit-line: FLOOR_Y, centered at image */
evas_object_move(shadow, x + CENTER(w, sh_w), FLOOR_Y);
x += falling_letters[i].padding + w;
letter_body = _letter_body_box_add(world, image);
ephysics_body_friction_set(letter_body, 0.4);
}
/* E is a circle that comes rolling on the floor */
_letter_add(evas, "E", &image, &light, &shadow);
evas_object_color_set(shadow, 255, 255, 255, 255);
evas_object_image_size_get(shadow, &sh_w, NULL);
evas_object_image_size_get(image, &w, &h);
/* place image and light so they are above the floor,
* and to the left of viewport
*/
evas_object_move(image, -w - 1, FLOOR_Y - h + 1);
evas_object_move(light, -w - 1, FLOOR_Y - h + 1);
/* place the shadow below the hit-line: FLOOR_Y, centered at image */
evas_object_move(shadow, -w - 1 + CENTER(w, sh_w), FLOOR_Y);
letter_body = _letter_body_circle_add(world, image);
ephysics_body_friction_set(letter_body, 1);
ephysics_body_mass_set(letter_body, 1);
ephysics_body_rotation_on_z_axis_enable_set(letter_body, EINA_TRUE);
/* make the "E" logo get into the viewport by applying an horizontal force */
ephysics_body_central_impulse_apply(letter_body, 13, 0);
elm_run();
ephysics_world_del(world);
ephysics_shutdown();
elm_shutdown();
return 0;
}
ELM_MAIN()

View File

@ -0,0 +1,79 @@
#ifndef _EPHYSICS_PRIVATE_H
#define _EPHYSICS_PRIVATE_H
#include <Edje.h>
#include <Elementary.h>
#include <Eina.h>
#include <Evas.h>
#include "EPhysics.h"
#ifdef EPHYSICS_LOG_COLOR
#undef EPHYSICS_LOG_COLOR
#endif
#define EPHYSICS_LOG_COLOR EINA_COLOR_BLUE
#ifdef ERR
# undef ERR
#endif
#define ERR(...) EINA_LOG_DOM_ERR(_ephysics_test_log_dom, __VA_ARGS__)
#ifdef DBG
# undef DBG
#endif
#define DBG(...) EINA_LOG_DOM_DBG(_ephysics_test_log_dom, __VA_ARGS__)
#ifdef INF
# undef INF
#endif
#define INF(...) EINA_LOG_DOM_INFO(_ephysics_test_log_dom, __VA_ARGS__)
#ifdef WRN
# undef WRN
#endif
#define WRN(...) EINA_LOG_DOM_WARN(_ephysics_test_log_dom, __VA_ARGS__)
#ifdef CRIT
# undef CRIT
#endif
#define CRIT(...) EINA_LOG_DOM_CRIT(_ephysics_test_log_dom, __VA_ARGS__)
#define EPHYSICS_TEST_THEME "ephysics_test"
#define WIDTH (512)
#define HEIGHT (384)
#define SHADOW_ALPHA_ID (1)
#define FLOOR_Y (344)
#define SH_THRESHOLD (200)
#ifdef __cplusplus
extern "C" {
#endif
extern int _ephysics_test_log_dom;
typedef struct _Test_Data Test_Data;
struct _Test_Data {
EPhysics_World *world;
Evas_Object *layout;
Evas_Object *win;
Eina_List *constraints;
Eina_List *evas_objs;
Eina_List *bodies;
void *data;
};
Test_Data *test_data_new(void);
void test_data_del(Test_Data *test_data);
void test_clean(Test_Data *test_data);
void test_win_add(Test_Data *test_data, const char *title, Eina_Bool autodel);
void update_object_cb(void *data, EPhysics_Body *body, void *event_info);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,198 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "ephysics_test.h"
#define EPHYSICS_TEST_LOG_COLOR EINA_COLOR_GREEN
int _ephysics_test_log_dom = -1;
/* examples prototypes */
void test_bouncing_ball(void *data, Evas_Object *obj, void *event_info);
void test_bouncing_text(void *data, Evas_Object *obj, void *event_info);
void test_colliding_balls(void *data, Evas_Object *obj, void *event_info);
void test_collision(void *data, Evas_Object *obj, void *event_info);
void test_constraint(void *data, Evas_Object *obj, void *event_info);
void test_falling_letters(void *data, Evas_Object *obj, void *event_info);
void test_jumping_balls(void *data, Evas_Object *obj, void *event_info);
void test_rotate(void *data, Evas_Object *obj, void *event_info);
static void
_win_del(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
elm_exit();
}
static void
_subwin_del(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
test_data_del(data);
ephysics_shutdown();
}
void
update_object_cb(void *data, EPhysics_Body *body, void *event_info)
{
Evas_Object *sphere = event_info;
Evas_Object *shadow = data;
Edje_Message_Float msg;
Evas_Object *edje;
int x, y, w, h;
ephysics_body_evas_object_update(body);
evas_object_geometry_get(sphere, &x, &y, &w, &h);
if (y > SH_THRESHOLD)
{
int sh_w;
msg.val = (double) (y - SH_THRESHOLD) / (FLOOR_Y - SH_THRESHOLD - h);
sh_w = (1 + 2 * msg.val) * w / 3;
evas_object_resize(shadow, sh_w, 3);
evas_object_move(shadow, x + (w - sh_w) / 2, FLOOR_Y);
}
else
msg.val = 0;
edje = elm_layout_edje_get(shadow);
edje_object_message_send(edje, EDJE_MESSAGE_FLOAT, SHADOW_ALPHA_ID, &msg);
}
void
test_clean(Test_Data *test_data)
{
EPhysics_Constraint *constraint;
Evas_Object *evas_obj;
EPhysics_Body *body;
EINA_LIST_FREE(test_data->constraints, constraint)
ephysics_constraint_del(constraint);
EINA_LIST_FREE(test_data->bodies, body)
ephysics_body_del(body);
EINA_LIST_FREE(test_data->evas_objs, evas_obj)
evas_object_del(evas_obj);
}
void
test_data_del(Test_Data *test_data)
{
test_clean(test_data);
evas_object_del(test_data->layout);
ephysics_world_del(test_data->world);
free(test_data);
}
Test_Data *
test_data_new(void)
{
Test_Data *test_data;
test_data = calloc(1, sizeof(Test_Data));
if (!test_data)
ERR("Failed to create test data");
return test_data;
}
void
test_win_add(Test_Data *test_data, const char *title, Eina_Bool autodel)
{
Evas_Object *win, *ly;
win = elm_win_add(NULL, title, ELM_WIN_BASIC);
elm_win_title_set(win, title);
elm_win_autodel_set(win, EINA_TRUE);
elm_win_screen_constrain_set(win, EINA_TRUE);
evas_object_show(win);
test_data->win = win;
if (autodel)
evas_object_smart_callback_add(win, "delete,request", _subwin_del,
test_data);
ly = elm_layout_add(win);
elm_win_resize_object_add(win, ly);
evas_object_size_hint_min_set(ly, WIDTH, HEIGHT);
evas_object_size_hint_max_set(ly, WIDTH, HEIGHT);
elm_layout_file_set(ly, PACKAGE_DATA_DIR "/" EPHYSICS_TEST_THEME ".edj",
"frame");
evas_object_show(ly);
test_data->layout = ly;
}
#define ADD_TEST(_name, _func) \
elm_list_item_append(list, _name, NULL, NULL, _func, NULL);
/* FIXME add autorun and test_win_only features */
static void
_main_win_add(char *autorun __UNUSED__, Eina_Bool test_win_only __UNUSED__)
{
Evas_Object *win, *list;
win = elm_win_add(NULL, "main", ELM_WIN_BASIC);
elm_win_title_set(win, "EPhysics Tests");
evas_object_smart_callback_add(win, "delete,request", _win_del, NULL);
evas_object_resize(win, 460, 560);
evas_object_show(win);
list = elm_list_add(win);
elm_object_style_set(list, "ephysics-test");
elm_list_select_mode_set(list, ELM_OBJECT_SELECT_MODE_ALWAYS);
evas_object_size_hint_weight_set(list, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_win_resize_object_add(win, list);
evas_object_show(list);
ADD_TEST("BOUNCING BALL", test_bouncing_ball);
ADD_TEST("BOUNCING TEXT", test_bouncing_text);
ADD_TEST("COLLIDING BALLS", test_colliding_balls);
ADD_TEST("COLLISION DETECTION", test_collision);
ADD_TEST("CONSTRAINT", test_constraint);
ADD_TEST("FALLING LETTERS", test_falling_letters);
ADD_TEST("JUMPING BALLS", test_jumping_balls);
ADD_TEST("ROTATE", test_rotate);
elm_list_go(list);
}
#undef ADD_TEST
EAPI_MAIN int
elm_main(int argc, char **argv)
{
Eina_Bool test_win_only = EINA_FALSE;
char *autorun = NULL;
elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
elm_app_compile_bin_dir_set(PACKAGE_BIN_DIR);
elm_app_compile_data_dir_set(PACKAGE_DATA_DIR);
/* if called with a single argument try to autorun a test with
* the same name as the given param
* ex: elementary_test "Box Vert 2" */
if (argc == 2)
autorun = argv[1];
else if (argc == 3)
{
if ((!strcmp(argv[1], "--test-win-only")) ||
(!strcmp(argv[1], "-to")))
{
test_win_only = EINA_TRUE;
autorun = argv[2];
}
}
_ephysics_test_log_dom = eina_log_domain_register(
"ephysics-test", EPHYSICS_TEST_LOG_COLOR);
elm_theme_extension_add(NULL,
PACKAGE_DATA_DIR "/" EPHYSICS_TEST_THEME ".edj");
_main_win_add(autorun, test_win_only);
elm_run();
elm_shutdown();
return 0;
}
ELM_MAIN()

View File

@ -0,0 +1,111 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "ephysics_test.h"
static Eina_Bool
_on_keydown(void *data, Evas_Object *obj __UNUSED__, Evas_Object *src __UNUSED__, Evas_Callback_Type type, void *event_info)
{
Evas_Event_Key_Down *ev = event_info;
EPhysics_Body *body = data;
if (type != EVAS_CALLBACK_KEY_UP)
return EINA_FALSE;
if (strcmp(ev->keyname, "Up") == 0)
ephysics_body_central_impulse_apply(body, 0, 10);
else if (strcmp(ev->keyname, "Down") == 0)
ephysics_body_central_impulse_apply(body, 0, -10);
else if (strcmp(ev->keyname, "Right") == 0)
ephysics_body_central_impulse_apply(body, 10, 0);
else if (strcmp(ev->keyname, "Left") == 0)
ephysics_body_central_impulse_apply(body, -10, 0);
return EINA_TRUE;
}
static void
_world_populate(Test_Data *test_data)
{
Evas_Object *sphere, *shadow;
EPhysics_Body *fall_body;
shadow = elm_layout_add(test_data->win);
elm_layout_file_set(
shadow, PACKAGE_DATA_DIR "/" EPHYSICS_TEST_THEME ".edj", "shadow-ball");
evas_object_move(shadow, WIDTH / 3, FLOOR_Y);
evas_object_resize(shadow, 70, 3);
evas_object_show(shadow);
test_data->evas_objs = eina_list_append(test_data->evas_objs, shadow);
sphere = elm_image_add(test_data->win);
elm_image_file_set(
sphere, PACKAGE_DATA_DIR "/" EPHYSICS_TEST_THEME ".edj", "big-blue-ball");
evas_object_move(sphere, WIDTH / 3, HEIGHT / 8);
evas_object_resize(sphere, 70, 70);
evas_object_show(sphere);
test_data->evas_objs = eina_list_append(test_data->evas_objs, sphere);
fall_body = ephysics_body_circle_add(test_data->world);
ephysics_body_evas_object_set(fall_body, sphere, EINA_TRUE);
ephysics_body_restitution_set(fall_body, 0.95);
ephysics_body_friction_set(fall_body, 0.1);
ephysics_body_event_callback_add(fall_body, EPHYSICS_CALLBACK_BODY_UPDATE,
update_object_cb, shadow);
test_data->bodies = eina_list_append(test_data->bodies, fall_body);
test_data->data = fall_body;
}
static void
_restart(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__)
{
Test_Data *test_data = data;
DBG("Restart pressed");
elm_object_event_callback_del(test_data->win, _on_keydown, test_data->data);
test_clean(test_data);
_world_populate(test_data);
elm_object_event_callback_add(test_data->win, _on_keydown, test_data->data);
}
void
test_bouncing_ball(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
EPhysics_Body *boundary;
EPhysics_World *world;
Test_Data *test_data;
Evas_Object *edje;
if (!ephysics_init())
return;
test_data = test_data_new();
test_win_add(test_data, "Bouncing Ball", EINA_TRUE);
edje = elm_layout_edje_get(test_data->layout);
edje_object_signal_callback_add(edje, "restart", "test-theme", _restart,
test_data);
elm_object_signal_emit(test_data->layout, "arrows,show", "ephysics_test");
world = ephysics_world_new();
ephysics_world_render_geometry_set(world, 50, 40, WIDTH - 100, FLOOR_Y - 40);
test_data->world = world;
boundary = ephysics_body_bottom_boundary_add(test_data->world);
ephysics_body_restitution_set(boundary, 0.65);
ephysics_body_friction_set(boundary, 4);
boundary = ephysics_body_right_boundary_add(test_data->world);
ephysics_body_restitution_set(boundary, 0.4);
ephysics_body_friction_set(boundary, 3);
boundary = ephysics_body_left_boundary_add(test_data->world);
ephysics_body_restitution_set(boundary, 0.4);
ephysics_body_friction_set(boundary, 3);
ephysics_body_top_boundary_add(test_data->world);
_world_populate(test_data);
elm_object_event_callback_add(test_data->win, _on_keydown, test_data->data);
}

View File

@ -0,0 +1,68 @@
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "ephysics_test.h"
static void
_world_populate(Test_Data *test_data)
{
EPhysics_Body *text_body;
Evas_Object *text;
int x, y, w;
text = evas_object_text_add(evas_object_evas_get(test_data->win));
evas_object_text_text_set(text, "EPHYSICS");
evas_object_text_font_set(text, "Sans", 54);
evas_object_color_set(text, 95, 56, 19, 255);
evas_object_move(text, WIDTH / 4, HEIGHT / 8);
evas_object_show(text);
evas_object_geometry_get(text, &x, &y, &w, NULL);
test_data->evas_objs = eina_list_append(test_data->evas_objs, text);
text_body = ephysics_body_box_add(test_data->world);
ephysics_body_evas_object_set(text_body, text, EINA_FALSE);
ephysics_body_geometry_set(text_body, x, y, w * 5 / 6, 46);
ephysics_body_restitution_set(text_body, 0.95);
ephysics_body_friction_set(text_body, 0.1);
test_data->bodies = eina_list_append(test_data->bodies, text_body);
}
static void
_restart(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__)
{
Test_Data *test_data = data;
DBG("Restart pressed");
test_clean(test_data);
_world_populate(test_data);
}
void
test_bouncing_text(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
EPhysics_Body *boundary;
EPhysics_World *world;
Test_Data *test_data;
Evas_Object *edje;
if (!ephysics_init())
return;
test_data = test_data_new();
test_win_add(test_data, "Bouncing Text", EINA_TRUE);
edje = elm_layout_edje_get(test_data->layout);
edje_object_signal_callback_add(edje, "restart", "test-theme", _restart,
test_data);
world = ephysics_world_new();
ephysics_world_render_geometry_set(world, 50, 40, WIDTH - 100, FLOOR_Y - 40);
test_data->world = world;
boundary = ephysics_body_bottom_boundary_add(test_data->world);
ephysics_body_restitution_set(boundary, 0.65);
ephysics_body_friction_set(boundary, 2);
_world_populate(test_data);
}

Some files were not shown because too many files have changed in this diff Show More