diff --git a/legacy/ephysics/.gitignore b/legacy/ephysics/.gitignore new file mode 100644 index 0000000000..37f781411c --- /dev/null +++ b/legacy/ephysics/.gitignore @@ -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/ diff --git a/legacy/ephysics/AUTHORS b/legacy/ephysics/AUTHORS new file mode 100644 index 0000000000..b9ef7b697e --- /dev/null +++ b/legacy/ephysics/AUTHORS @@ -0,0 +1,2 @@ +Bruno Dilly +Leandro Dorileo diff --git a/legacy/ephysics/COPYING b/legacy/ephysics/COPYING new file mode 100644 index 0000000000..1dd67cb921 --- /dev/null +++ b/legacy/ephysics/COPYING @@ -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. diff --git a/legacy/ephysics/COPYING_ARTS b/legacy/ephysics/COPYING_ARTS new file mode 100644 index 0000000000..a72713990b --- /dev/null +++ b/legacy/ephysics/COPYING_ARTS @@ -0,0 +1,94 @@ +The follwing images were drawn by Marina Proni +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. + diff --git a/legacy/ephysics/ChangeLog b/legacy/ephysics/ChangeLog new file mode 100644 index 0000000000..490c3dce32 --- /dev/null +++ b/legacy/ephysics/ChangeLog @@ -0,0 +1,3 @@ +2012-05-15 Bruno Dilly + + Initial version diff --git a/legacy/ephysics/INSTALL b/legacy/ephysics/INSTALL new file mode 100644 index 0000000000..7d1c323bea --- /dev/null +++ b/legacy/ephysics/INSTALL @@ -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 `' 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. + diff --git a/legacy/ephysics/Makefile.am b/legacy/ephysics/Makefile.am new file mode 100644 index 0000000000..5340ca356b --- /dev/null +++ b/legacy/ephysics/Makefile.am @@ -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 diff --git a/legacy/ephysics/NEWS b/legacy/ephysics/NEWS new file mode 100644 index 0000000000..6ea66558ab --- /dev/null +++ b/legacy/ephysics/NEWS @@ -0,0 +1,3 @@ +Ephysics 0.1.0 + + * Very initial implementation diff --git a/legacy/ephysics/README b/legacy/ephysics/README new file mode 100644 index 0000000000..9407244f10 --- /dev/null +++ b/legacy/ephysics/README @@ -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. diff --git a/legacy/ephysics/TODO b/legacy/ephysics/TODO new file mode 100644 index 0000000000..8c930dfd48 --- /dev/null +++ b/legacy/ephysics/TODO @@ -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 diff --git a/legacy/ephysics/autogen.sh b/legacy/ephysics/autogen.sh new file mode 100755 index 0000000000..00116eaf80 --- /dev/null +++ b/legacy/ephysics/autogen.sh @@ -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 diff --git a/legacy/ephysics/configure.ac b/legacy/ephysics/configure.ac new file mode 100644 index 0000000000..30659db09e --- /dev/null +++ b/legacy/ephysics/configure.ac @@ -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 diff --git a/legacy/ephysics/data/Makefile.am b/legacy/ephysics/data/Makefile.am new file mode 100644 index 0000000000..a52a0c023f --- /dev/null +++ b/legacy/ephysics/data/Makefile.am @@ -0,0 +1,3 @@ +MAINTAINERCLEANFILES = Makefile.in + +SUBDIRS = logo_images themes diff --git a/legacy/ephysics/data/logo_images/Makefile.am b/legacy/ephysics/data/logo_images/Makefile.am new file mode 100644 index 0000000000..c8bb4ff506 --- /dev/null +++ b/legacy/ephysics/data/logo_images/Makefile.am @@ -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 diff --git a/legacy/ephysics/data/logo_images/logo_background.png b/legacy/ephysics/data/logo_images/logo_background.png new file mode 100644 index 0000000000..c9c7bfd6e1 Binary files /dev/null and b/legacy/ephysics/data/logo_images/logo_background.png differ diff --git a/legacy/ephysics/data/logo_images/logo_letter-C.png b/legacy/ephysics/data/logo_images/logo_letter-C.png new file mode 100644 index 0000000000..ad11d7ddba Binary files /dev/null and b/legacy/ephysics/data/logo_images/logo_letter-C.png differ diff --git a/legacy/ephysics/data/logo_images/logo_letter-E.png b/legacy/ephysics/data/logo_images/logo_letter-E.png new file mode 100644 index 0000000000..94e0db0d20 Binary files /dev/null and b/legacy/ephysics/data/logo_images/logo_letter-E.png differ diff --git a/legacy/ephysics/data/logo_images/logo_letter-H.png b/legacy/ephysics/data/logo_images/logo_letter-H.png new file mode 100644 index 0000000000..b7955384ef Binary files /dev/null and b/legacy/ephysics/data/logo_images/logo_letter-H.png differ diff --git a/legacy/ephysics/data/logo_images/logo_letter-I.png b/legacy/ephysics/data/logo_images/logo_letter-I.png new file mode 100644 index 0000000000..612348062b Binary files /dev/null and b/legacy/ephysics/data/logo_images/logo_letter-I.png differ diff --git a/legacy/ephysics/data/logo_images/logo_letter-P.png b/legacy/ephysics/data/logo_images/logo_letter-P.png new file mode 100644 index 0000000000..da984c5eb7 Binary files /dev/null and b/legacy/ephysics/data/logo_images/logo_letter-P.png differ diff --git a/legacy/ephysics/data/logo_images/logo_letter-S1.png b/legacy/ephysics/data/logo_images/logo_letter-S1.png new file mode 100644 index 0000000000..e386cc0a59 Binary files /dev/null and b/legacy/ephysics/data/logo_images/logo_letter-S1.png differ diff --git a/legacy/ephysics/data/logo_images/logo_letter-S2.png b/legacy/ephysics/data/logo_images/logo_letter-S2.png new file mode 100644 index 0000000000..59cc4a672a Binary files /dev/null and b/legacy/ephysics/data/logo_images/logo_letter-S2.png differ diff --git a/legacy/ephysics/data/logo_images/logo_letter-Y.png b/legacy/ephysics/data/logo_images/logo_letter-Y.png new file mode 100644 index 0000000000..ce36ffae11 Binary files /dev/null and b/legacy/ephysics/data/logo_images/logo_letter-Y.png differ diff --git a/legacy/ephysics/data/logo_images/logo_light-C.png b/legacy/ephysics/data/logo_images/logo_light-C.png new file mode 100644 index 0000000000..9a40c18f19 Binary files /dev/null and b/legacy/ephysics/data/logo_images/logo_light-C.png differ diff --git a/legacy/ephysics/data/logo_images/logo_light-E.png b/legacy/ephysics/data/logo_images/logo_light-E.png new file mode 100644 index 0000000000..7b8a09e2a4 Binary files /dev/null and b/legacy/ephysics/data/logo_images/logo_light-E.png differ diff --git a/legacy/ephysics/data/logo_images/logo_light-H.png b/legacy/ephysics/data/logo_images/logo_light-H.png new file mode 100644 index 0000000000..2877840d67 Binary files /dev/null and b/legacy/ephysics/data/logo_images/logo_light-H.png differ diff --git a/legacy/ephysics/data/logo_images/logo_light-I.png b/legacy/ephysics/data/logo_images/logo_light-I.png new file mode 100644 index 0000000000..64a3195801 Binary files /dev/null and b/legacy/ephysics/data/logo_images/logo_light-I.png differ diff --git a/legacy/ephysics/data/logo_images/logo_light-P.png b/legacy/ephysics/data/logo_images/logo_light-P.png new file mode 100644 index 0000000000..0b8962f57e Binary files /dev/null and b/legacy/ephysics/data/logo_images/logo_light-P.png differ diff --git a/legacy/ephysics/data/logo_images/logo_light-S1.png b/legacy/ephysics/data/logo_images/logo_light-S1.png new file mode 100644 index 0000000000..701117207b Binary files /dev/null and b/legacy/ephysics/data/logo_images/logo_light-S1.png differ diff --git a/legacy/ephysics/data/logo_images/logo_light-S2.png b/legacy/ephysics/data/logo_images/logo_light-S2.png new file mode 100644 index 0000000000..97b33623bc Binary files /dev/null and b/legacy/ephysics/data/logo_images/logo_light-S2.png differ diff --git a/legacy/ephysics/data/logo_images/logo_light-Y.png b/legacy/ephysics/data/logo_images/logo_light-Y.png new file mode 100644 index 0000000000..e70a956b4c Binary files /dev/null and b/legacy/ephysics/data/logo_images/logo_light-Y.png differ diff --git a/legacy/ephysics/data/logo_images/logo_shadow-C.png b/legacy/ephysics/data/logo_images/logo_shadow-C.png new file mode 100644 index 0000000000..07b9a24acc Binary files /dev/null and b/legacy/ephysics/data/logo_images/logo_shadow-C.png differ diff --git a/legacy/ephysics/data/logo_images/logo_shadow-E.png b/legacy/ephysics/data/logo_images/logo_shadow-E.png new file mode 100644 index 0000000000..261b30b50b Binary files /dev/null and b/legacy/ephysics/data/logo_images/logo_shadow-E.png differ diff --git a/legacy/ephysics/data/logo_images/logo_shadow-H.png b/legacy/ephysics/data/logo_images/logo_shadow-H.png new file mode 100644 index 0000000000..4389823140 Binary files /dev/null and b/legacy/ephysics/data/logo_images/logo_shadow-H.png differ diff --git a/legacy/ephysics/data/logo_images/logo_shadow-I.png b/legacy/ephysics/data/logo_images/logo_shadow-I.png new file mode 100644 index 0000000000..eee74373a0 Binary files /dev/null and b/legacy/ephysics/data/logo_images/logo_shadow-I.png differ diff --git a/legacy/ephysics/data/logo_images/logo_shadow-P.png b/legacy/ephysics/data/logo_images/logo_shadow-P.png new file mode 100644 index 0000000000..c177cf6359 Binary files /dev/null and b/legacy/ephysics/data/logo_images/logo_shadow-P.png differ diff --git a/legacy/ephysics/data/logo_images/logo_shadow-S1.png b/legacy/ephysics/data/logo_images/logo_shadow-S1.png new file mode 100644 index 0000000000..23daa8d57a Binary files /dev/null and b/legacy/ephysics/data/logo_images/logo_shadow-S1.png differ diff --git a/legacy/ephysics/data/logo_images/logo_shadow-S2.png b/legacy/ephysics/data/logo_images/logo_shadow-S2.png new file mode 100644 index 0000000000..24f832cccc Binary files /dev/null and b/legacy/ephysics/data/logo_images/logo_shadow-S2.png differ diff --git a/legacy/ephysics/data/logo_images/logo_shadow-Y.png b/legacy/ephysics/data/logo_images/logo_shadow-Y.png new file mode 100644 index 0000000000..6369dcce70 Binary files /dev/null and b/legacy/ephysics/data/logo_images/logo_shadow-Y.png differ diff --git a/legacy/ephysics/data/themes/Makefile.am b/legacy/ephysics/data/themes/Makefile.am new file mode 100644 index 0000000000..8aac2f36be --- /dev/null +++ b/legacy/ephysics/data/themes/Makefile.am @@ -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 diff --git a/legacy/ephysics/data/themes/balls.edc b/legacy/ephysics/data/themes/balls.edc new file mode 100644 index 0000000000..957c1c4a32 --- /dev/null +++ b/legacy/ephysics/data/themes/balls.edc @@ -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"; + } + } + + } + + } + + diff --git a/legacy/ephysics/data/themes/buttons.edc b/legacy/ephysics/data/themes/buttons.edc new file mode 100644 index 0000000000..0fe801c07d --- /dev/null +++ b/legacy/ephysics/data/themes/buttons.edc @@ -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 diff --git a/legacy/ephysics/data/themes/cubes.edc b/legacy/ephysics/data/themes/cubes.edc new file mode 100644 index 0000000000..6c553435f3 --- /dev/null +++ b/legacy/ephysics/data/themes/cubes.edc @@ -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"; + } + } + + } + + } diff --git a/legacy/ephysics/data/themes/effects.edc b/legacy/ephysics/data/themes/effects.edc new file mode 100644 index 0000000000..1a6b429bae --- /dev/null +++ b/legacy/ephysics/data/themes/effects.edc @@ -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"; + } + + } + + } diff --git a/legacy/ephysics/data/themes/ephysics_test.edc b/legacy/ephysics/data/themes/ephysics_test.edc new file mode 100644 index 0000000000..c8d43120e5 --- /dev/null +++ b/legacy/ephysics/data/themes/ephysics_test.edc @@ -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" +} diff --git a/legacy/ephysics/data/themes/frame.edc b/legacy/ephysics/data/themes/frame.edc new file mode 100644 index 0000000000..f4b072c728 --- /dev/null +++ b/legacy/ephysics/data/themes/frame.edc @@ -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"; + } + + } + + } diff --git a/legacy/ephysics/data/themes/images/arrows.png b/legacy/ephysics/data/themes/images/arrows.png new file mode 100644 index 0000000000..25f5e58c4b Binary files /dev/null and b/legacy/ephysics/data/themes/images/arrows.png differ diff --git a/legacy/ephysics/data/themes/images/background.jpg b/legacy/ephysics/data/themes/images/background.jpg new file mode 100644 index 0000000000..7af3d5838a Binary files /dev/null and b/legacy/ephysics/data/themes/images/background.jpg differ diff --git a/legacy/ephysics/data/themes/images/ball-blue.png b/legacy/ephysics/data/themes/images/ball-blue.png new file mode 100644 index 0000000000..c74c249695 Binary files /dev/null and b/legacy/ephysics/data/themes/images/ball-blue.png differ diff --git a/legacy/ephysics/data/themes/images/ball-blue70.png b/legacy/ephysics/data/themes/images/ball-blue70.png new file mode 100644 index 0000000000..38546e5749 Binary files /dev/null and b/legacy/ephysics/data/themes/images/ball-blue70.png differ diff --git a/legacy/ephysics/data/themes/images/ball-green.png b/legacy/ephysics/data/themes/images/ball-green.png new file mode 100644 index 0000000000..a19945dba8 Binary files /dev/null and b/legacy/ephysics/data/themes/images/ball-green.png differ diff --git a/legacy/ephysics/data/themes/images/ball-green70.png b/legacy/ephysics/data/themes/images/ball-green70.png new file mode 100644 index 0000000000..83ba8b9ce1 Binary files /dev/null and b/legacy/ephysics/data/themes/images/ball-green70.png differ diff --git a/legacy/ephysics/data/themes/images/ball-red.png b/legacy/ephysics/data/themes/images/ball-red.png new file mode 100644 index 0000000000..8fe0e4d187 Binary files /dev/null and b/legacy/ephysics/data/themes/images/ball-red.png differ diff --git a/legacy/ephysics/data/themes/images/ball-red70.png b/legacy/ephysics/data/themes/images/ball-red70.png new file mode 100644 index 0000000000..3a4af0adf6 Binary files /dev/null and b/legacy/ephysics/data/themes/images/ball-red70.png differ diff --git a/legacy/ephysics/data/themes/images/bt_jump.png b/legacy/ephysics/data/themes/images/bt_jump.png new file mode 100644 index 0000000000..3116830a7b Binary files /dev/null and b/legacy/ephysics/data/themes/images/bt_jump.png differ diff --git a/legacy/ephysics/data/themes/images/bt_jump_pressed.png b/legacy/ephysics/data/themes/images/bt_jump_pressed.png new file mode 100644 index 0000000000..b2fe3166eb Binary files /dev/null and b/legacy/ephysics/data/themes/images/bt_jump_pressed.png differ diff --git a/legacy/ephysics/data/themes/images/bt_restart.png b/legacy/ephysics/data/themes/images/bt_restart.png new file mode 100644 index 0000000000..558c596554 Binary files /dev/null and b/legacy/ephysics/data/themes/images/bt_restart.png differ diff --git a/legacy/ephysics/data/themes/images/bt_restart_pressed.png b/legacy/ephysics/data/themes/images/bt_restart_pressed.png new file mode 100644 index 0000000000..62c8210375 Binary files /dev/null and b/legacy/ephysics/data/themes/images/bt_restart_pressed.png differ diff --git a/legacy/ephysics/data/themes/images/collisionL.png b/legacy/ephysics/data/themes/images/collisionL.png new file mode 100644 index 0000000000..160af4fdba Binary files /dev/null and b/legacy/ephysics/data/themes/images/collisionL.png differ diff --git a/legacy/ephysics/data/themes/images/cube-blue.png b/legacy/ephysics/data/themes/images/cube-blue.png new file mode 100644 index 0000000000..e848d2b0b7 Binary files /dev/null and b/legacy/ephysics/data/themes/images/cube-blue.png differ diff --git a/legacy/ephysics/data/themes/images/cube-purple.png b/legacy/ephysics/data/themes/images/cube-purple.png new file mode 100644 index 0000000000..096cdbbcf7 Binary files /dev/null and b/legacy/ephysics/data/themes/images/cube-purple.png differ diff --git a/legacy/ephysics/data/themes/images/impact.png b/legacy/ephysics/data/themes/images/impact.png new file mode 100644 index 0000000000..1dd89dba67 Binary files /dev/null and b/legacy/ephysics/data/themes/images/impact.png differ diff --git a/legacy/ephysics/data/themes/images/list-item-corner-pressed.png b/legacy/ephysics/data/themes/images/list-item-corner-pressed.png new file mode 100644 index 0000000000..37a03d6e94 Binary files /dev/null and b/legacy/ephysics/data/themes/images/list-item-corner-pressed.png differ diff --git a/legacy/ephysics/data/themes/images/list-item-corner.png b/legacy/ephysics/data/themes/images/list-item-corner.png new file mode 100644 index 0000000000..6f55f3c704 Binary files /dev/null and b/legacy/ephysics/data/themes/images/list-item-corner.png differ diff --git a/legacy/ephysics/data/themes/images/list-item-pressed.png b/legacy/ephysics/data/themes/images/list-item-pressed.png new file mode 100644 index 0000000000..21f218de8a Binary files /dev/null and b/legacy/ephysics/data/themes/images/list-item-pressed.png differ diff --git a/legacy/ephysics/data/themes/images/list-item.png b/legacy/ephysics/data/themes/images/list-item.png new file mode 100644 index 0000000000..6194a25a62 Binary files /dev/null and b/legacy/ephysics/data/themes/images/list-item.png differ diff --git a/legacy/ephysics/data/themes/images/list.png b/legacy/ephysics/data/themes/images/list.png new file mode 100644 index 0000000000..8966ec3599 Binary files /dev/null and b/legacy/ephysics/data/themes/images/list.png differ diff --git a/legacy/ephysics/data/themes/images/shadow-ball.png b/legacy/ephysics/data/themes/images/shadow-ball.png new file mode 100644 index 0000000000..0221b58360 Binary files /dev/null and b/legacy/ephysics/data/themes/images/shadow-ball.png differ diff --git a/legacy/ephysics/data/themes/images/shadow-cube.png b/legacy/ephysics/data/themes/images/shadow-cube.png new file mode 100644 index 0000000000..12ac30037e Binary files /dev/null and b/legacy/ephysics/data/themes/images/shadow-cube.png differ diff --git a/legacy/ephysics/data/themes/list.edc b/legacy/ephysics/data/themes/list.edc new file mode 100644 index 0000000000..f0906fda7d --- /dev/null +++ b/legacy/ephysics/data/themes/list.edc @@ -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"; + } + + } + + } diff --git a/legacy/ephysics/data/themes/shadows.edc b/legacy/ephysics/data/themes/shadows.edc new file mode 100644 index 0000000000..e4e1f44856 --- /dev/null +++ b/legacy/ephysics/data/themes/shadows.edc @@ -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 diff --git a/legacy/ephysics/doc/Doxyfile.in b/legacy/ephysics/doc/Doxyfile.in new file mode 100644 index 0000000000..f6983317c4 --- /dev/null +++ b/legacy/ephysics/doc/Doxyfile.in @@ -0,0 +1,1515 @@ +# Doxyfile 1.6.1 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project +# +# All text after a hash (#) is considered a comment and will be ignored +# The format is: +# TAG = value [value, ...] +# For lists items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (" ") + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the config file +# that follow. The default is UTF-8 which is also the encoding used for all +# text before the first occurrence of this tag. Doxygen uses libiconv (or the +# iconv built into libc) for the transcoding. See +# http://www.gnu.org/software/libiconv for the list of possible encodings. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded +# by quotes) that should identify the project. + +PROJECT_NAME = EPhysics + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. +# This could be handy for archiving the generated documentation or +# if some version control system is used. + +PROJECT_NUMBER = + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) +# base path where the generated documentation will be put. +# If a relative path is entered, it will be relative to the location +# where doxygen was started. If left blank the current directory will be used. + +OUTPUT_DIRECTORY = . + +# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create +# 4096 sub-directories (in 2 levels) under the output directory of each output +# format and will distribute the generated files over these directories. +# Enabling this option can be useful when feeding doxygen a huge amount of +# source files, where putting all generated files in the same directory would +# otherwise cause performance problems for the file system. + +CREATE_SUBDIRS = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# The default language is English, other supported languages are: +# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, +# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, +# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English +# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, +# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, +# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will +# include brief member descriptions after the members that are listed in +# the file and class documentation (similar to JavaDoc). +# Set to NO to disable this. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend +# the brief description of a member or function before the detailed description. +# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator +# that is used to form the text in various listings. Each string +# in this list, if found as the leading text of the brief description, will be +# stripped from the text and the result after processing the whole list, is +# used as the annotated text. Otherwise, the brief description is used as-is. +# If left blank, the following values are used ("$name" is automatically +# replaced with the name of the entity): "The $name class" "The $name widget" +# "The $name file" "is" "provides" "specifies" "contains" +# "represents" "a" "an" "the" + +ABBREVIATE_BRIEF = + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# Doxygen will generate a detailed section even if there is only a brief +# description. + +ALWAYS_DETAILED_SEC = YES + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full +# path before files name in the file list and in the header files. If set +# to NO the shortest path that makes the file name unique will be used. + +FULL_PATH_NAMES = YES + +# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag +# can be used to strip a user-defined part of the path. Stripping is +# only done if one of the specified strings matches the left-hand part of +# the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the +# path to strip. + +STRIP_FROM_PATH = @top_srcdir@/ src/ + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of +# the path mentioned in the documentation of a class, which tells +# the reader which header file to include in order to use a class. +# If left blank only the name of the header file containing the class +# definition is used. Otherwise one should specify the include paths that +# are normally passed to the compiler using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter +# (but less readable) file names. This can be useful is your file systems +# doesn't support long names like on DOS, Mac, or CD-ROM. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen +# will interpret the first line (until the first dot) of a JavaDoc-style +# comment as the brief description. If set to NO, the JavaDoc +# comments will behave just like regular Qt-style comments +# (thus requiring an explicit @brief command for a brief description.) + +JAVADOC_AUTOBRIEF = YES + +# If the QT_AUTOBRIEF tag is set to YES then Doxygen will +# interpret the first line (until the first dot) of a Qt-style +# comment as the brief description. If set to NO, the comments +# will behave just like regular Qt-style comments (thus requiring +# an explicit \brief command for a brief description.) + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen +# treat a multi-line C++ special comment block (i.e. a block of //! or /// +# comments) as a brief description. This used to be the default behaviour. +# The new default is to treat a multi-line C++ comment block as a detailed +# description. Set this tag to YES if you prefer the old behaviour instead. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented +# member inherits the documentation from any documented member that it +# re-implements. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce +# a new page for each member. If set to NO, the documentation of a member will +# be part of the file/class/namespace that contains it. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. +# Doxygen uses this value to replace tabs by spaces in code fragments. + +TAB_SIZE = 4 + +# This tag can be used to specify a number of aliases that acts +# as commands in the documentation. An alias has the form "name=value". +# For example adding "sideeffect=\par Side Effects:\n" will allow you to +# put the command \sideeffect (or @sideeffect) in the documentation, which +# will result in a user-defined paragraph with heading "Side Effects:". +# You can put \n's in the value part of an alias to insert newlines. + +# Aliases +ALIASES = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C +# sources only. Doxygen will then generate output that is more tailored for C. +# For instance, some of the names that are used will be different. The list +# of all members will be omitted, etc. + +OPTIMIZE_OUTPUT_FOR_C = YES + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java +# sources only. Doxygen will then generate output that is more tailored for +# Java. For instance, namespaces will be presented as packages, qualified +# scopes will look different, etc. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources only. Doxygen will then generate output that is more tailored for +# Fortran. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for +# VHDL. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Doxygen selects the parser to use depending on the extension of the files it parses. +# With this tag you can assign which parser to use for a given extension. +# Doxygen has a built-in mapping, but you can override or extend it using this tag. +# The format is ext=language, where ext is a file extension, and language is one of +# the parsers supported by doxygen: IDL, Java, Javascript, C#, C, C++, D, PHP, +# Objective-C, Python, Fortran, VHDL, C, C++. For instance to make doxygen treat +# .inc files as Fortran files (default is PHP), and .f files as C (default is Fortran), +# use: inc=Fortran f=C. Note that for custom extensions you also need to set FILE_PATTERNS otherwise the files are not read by doxygen. + +EXTENSION_MAPPING = + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should +# set this tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. +# func(std::string) {}). This also make the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. +# Doxygen will parse them like normal C++ but will assume all classes use public +# instead of private inheritance when no explicit protection keyword is present. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate getter +# and setter methods for a property. Setting this option to YES (the default) +# will make doxygen to replace the get and set methods by a property in the +# documentation. This will only work if the methods are indeed getting or +# setting a simple type. If this is not the case, or you want to show the +# methods anyway, you should set this option to NO. + +IDL_PROPERTY_SUPPORT = NO + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES, then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. + +DISTRIBUTE_GROUP_DOC = NO + +# Set the SUBGROUPING tag to YES (the default) to allow class member groups of +# the same type (for instance a group of public functions) to be put as a +# subgroup of that type (e.g. under the Public Functions section). Set it to +# NO to prevent subgrouping. Alternatively, this can be done per class using +# the \nosubgrouping command. + +SUBGROUPING = YES + +# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum +# is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically +# be useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. + +TYPEDEF_HIDES_STRUCT = NO + +# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to +# determine which symbols to keep in memory and which to flush to disk. +# When the cache is full, less often used symbols will be written to disk. +# For small to medium size projects (<1000 input files) the default value is +# probably good enough. For larger projects a too small cache size can cause +# doxygen to be busy swapping symbols to and from disk most of the time +# causing a significant performance penality. +# If the system has enough physical memory increasing the cache will improve the +# performance by keeping more symbols in memory. Note that the value works on +# a logarithmic scale so increasing the size by one will roughly double the +# memory usage. The cache size is given by this formula: +# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, +# corresponding to a cache size of 2^16 = 65536 symbols + +SYMBOL_CACHE_SIZE = 0 + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# documentation are documented, even if no documentation was available. +# Private class members and static file members will be hidden unless +# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES + +EXTRACT_ALL = YES + +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class +# will be included in the documentation. + +EXTRACT_PRIVATE = NO + +# If the EXTRACT_STATIC tag is set to YES all static members of a file +# will be included in the documentation. + +EXTRACT_STATIC = NO + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) +# defined locally in source files will be included in the documentation. +# If set to NO only classes defined in header files are included. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. When set to YES local +# methods, which are defined in the implementation section but not in +# the interface are included in the documentation. +# If set to NO (the default) only methods in the interface are included. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base +# name of the file that contains the anonymous namespace. By default +# anonymous namespace are hidden. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all +# undocumented members of documented classes, files or namespaces. +# If set to NO (the default) these members will be included in the +# various overviews, but no documentation section is generated. +# This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. +# If set to NO (the default) these classes will be included in the various +# overviews. This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all +# friend (class|struct|union) declarations. +# If set to NO (the default) these declarations will be included in the +# documentation. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any +# documentation blocks found inside the body of a function. +# If set to NO (the default) these blocks will be appended to the +# function's detailed documentation block. + +HIDE_IN_BODY_DOCS = YES + +# The INTERNAL_DOCS tag determines if documentation +# that is typed after a \internal command is included. If the tag is set +# to NO (the default) then the documentation will be excluded. +# Set it to YES to include the internal documentation. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate +# file names in lower-case letters. If set to YES upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. + +CASE_SENSE_NAMES = YES + +# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen +# will show members with their full class and namespace scopes in the +# documentation. If set to YES the scope will be hidden. + +HIDE_SCOPE_NAMES = NO + +# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen +# will put a list of the files that are included by a file in the documentation +# of that file. + +SHOW_INCLUDE_FILES = NO + +# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] +# is inserted in the documentation for inline members. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen +# will sort the (detailed) documentation of file and class members +# alphabetically by member name. If set to NO the members will appear in +# declaration order. + +SORT_MEMBER_DOCS = YES + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the +# brief documentation of file, namespace and class members alphabetically +# by member name. If set to NO (the default) the members will appear in +# declaration order. + +SORT_BRIEF_DOCS = YES + +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the (brief and detailed) documentation of class members so that constructors and destructors are listed first. If set to NO (the default) the constructors will appear in the respective orders defined by SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the +# hierarchy of group names into alphabetical order. If set to NO (the default) +# the group names will appear in their defined order. + +SORT_GROUP_NAMES = YES + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be +# sorted by fully-qualified names, including namespaces. If set to +# NO (the default), the class list will be sorted only by class name, +# not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the +# alphabetical list. + +SORT_BY_SCOPE_NAME = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or +# disable (NO) the todo list. This list is created by putting \todo +# commands in the documentation. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or +# disable (NO) the test list. This list is created by putting \test +# commands in the documentation. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or +# disable (NO) the bug list. This list is created by putting \bug +# commands in the documentation. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or +# disable (NO) the deprecated list. This list is created by putting +# \deprecated commands in the documentation. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional +# documentation sections, marked by \if sectionname ... \endif. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines +# the initial value of a variable or define consists of for it to appear in +# the documentation. If the initializer consists of more lines than specified +# here it will be hidden. Use a value of 0 to hide initializers completely. +# The appearance of the initializer of individual variables and defines in the +# documentation can be controlled using \showinitializer or \hideinitializer +# command in the documentation regardless of this setting. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated +# at the bottom of the documentation of classes and structs. If set to YES the +# list will mention the files that were used to generate the documentation. + +SHOW_USED_FILES = YES + +# If the sources in your project are distributed over multiple directories +# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy +# in the documentation. The default is NO. + +SHOW_DIRECTORIES = NO + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. +# This will remove the Files entry from the Quick Index and from the +# Folder Tree View (if specified). The default is YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the +# Namespaces page. +# This will remove the Namespaces entry from the Quick Index +# and from the Folder Tree View (if specified). The default is YES. + +SHOW_NAMESPACES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command , where is the value of +# the FILE_VERSION_FILTER tag, and is the name of an input file +# provided by doxygen. Whatever the program writes to standard output +# is used as the file version. See the manual for examples. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by +# doxygen. The layout file controls the global structure of the generated output files +# in an output format independent way. The create the layout file that represents +# doxygen's defaults, run doxygen with the -l option. You can optionally specify a +# file name after the option, if omitted DoxygenLayout.xml will be used as the name +# of the layout file. + +LAYOUT_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated +# by doxygen. Possible values are YES and NO. If left blank NO is used. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated by doxygen. Possible values are YES and NO. If left blank +# NO is used. + +WARNINGS = YES + +# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings +# for undocumented members. If EXTRACT_ALL is set to YES then this flag will +# automatically be disabled. + +WARN_IF_UNDOCUMENTED = YES + +# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some +# parameters in a documented function, or documenting parameters that +# don't exist or using markup commands wrongly. + +WARN_IF_DOC_ERROR = YES + +# This WARN_NO_PARAMDOC option can be abled to get warnings for +# functions that are documented, but have no documentation for their parameters +# or return value. If set to NO (the default) doxygen will only warn about +# wrong or incomplete parameter documentation, but not about the absence of +# documentation. + +WARN_NO_PARAMDOC = YES + +# The WARN_FORMAT tag determines the format of the warning messages that +# doxygen can produce. The string should contain the $file, $line, and $text +# tags, which will be replaced by the file and line number from which the +# warning originated and the warning text. Optionally the format may contain +# $version, which will be replaced by the version of the file (if it could +# be obtained via FILE_VERSION_FILTER) + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning +# and error messages should be written. If left blank the output is written +# to stderr. + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag can be used to specify the files and/or directories that contain +# documented source files. You may enter file names like "myfile.cpp" or +# directories like "/usr/src/myproject". Separate the files or directories +# with spaces. + +INPUT = @srcdir@/examples.dox @top_srcdir@/src/lib + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is +# also the default input encoding. Doxygen uses libiconv (or the iconv built +# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for +# the list of possible encodings. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank the following patterns are tested: +# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx +# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90 + +FILE_PATTERNS = + +# The RECURSIVE tag can be used to turn specify whether or not subdirectories +# should be searched for input files as well. Possible values are YES and NO. +# If left blank NO is used. + +RECURSIVE = YES + +# The EXCLUDE tag can be used to specify files and/or directories that should +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. + +EXCLUDE = + +# The EXCLUDE_SYMLINKS tag can be used select whether or not files or +# directories that are symbolic links (a Unix filesystem feature) are excluded +# from the input. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. Note that the wildcards are matched +# against the file with absolute path, so to exclude all test directories +# for example use the pattern */test/* + +EXCLUDE_PATTERNS = + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or +# directories that contain example code fragments that are included (see +# the \include command). + +EXAMPLE_PATH = @top_srcdir@/src/bin/ + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank all files are included. + +EXAMPLE_PATTERNS = + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude +# commands irrespective of the value of the RECURSIVE tag. +# Possible values are YES and NO. If left blank NO is used. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or +# directories that contain image that are included in the documentation (see +# the \image command). + +IMAGE_PATH = img + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command , where +# is the value of the INPUT_FILTER tag, and is the name of an +# input file. Doxygen will then use the output that the filter program writes +# to standard output. +# If FILTER_PATTERNS is specified, this tag will be +# ignored. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. +# Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. +# The filters are a list of the form: +# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further +# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER +# is applied to all files. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will be used to filter the input files when producing source +# files to browse (i.e. when SOURCE_BROWSER is set to YES). + +FILTER_SOURCE_FILES = NO + +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will +# be generated. Documented entities will be cross-referenced with these sources. +# Note: To get rid of all source code in the generated output, make sure also +# VERBATIM_HEADERS is set to NO. + +SOURCE_BROWSER = NO + +# Setting the INLINE_SOURCES tag to YES will include the body +# of functions and classes directly in the documentation. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct +# doxygen to hide any special comment blocks from generated source code +# fragments. Normal C and C++ comments will always remain visible. + +STRIP_CODE_COMMENTS = YES + +# If the REFERENCED_BY_RELATION tag is set to YES +# then for each documented function all documented +# functions referencing it will be listed. + +REFERENCED_BY_RELATION = YES + +# If the REFERENCES_RELATION tag is set to YES +# then for each documented function all documented entities +# called/used by that function will be listed. + +REFERENCES_RELATION = YES + +# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) +# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from +# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will +# link to the source code. +# Otherwise they will link to the documentation. + +REFERENCES_LINK_SOURCE = YES + +# If the USE_HTAGS tag is set to YES then the references to source code +# will point to the HTML generated by the htags(1) tool instead of doxygen +# built-in source browser. The htags tool is part of GNU's global source +# tagging system (see http://www.gnu.org/software/global/global.html). You +# will need version 4.8.6 or higher. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen +# will generate a verbatim copy of the header file for each class for +# which an include is specified. Set to NO to disable this. + +VERBATIM_HEADERS = YES + +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index +# of all compounds will be generated. Enable this if the project +# contains a lot of classes, structs, unions or interfaces. + +ALPHABETICAL_INDEX = YES + +# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then +# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns +# in which this list will be split (can be a number in the range [1..20]) + +COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all +# classes will be put under the same header in the alphabetical index. +# The IGNORE_PREFIX tag can be used to specify one or more prefixes that +# should be ignored while generating the index headers. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES (the default) Doxygen will +# generate HTML output. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `html' will be used as the default path. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for +# each generated HTML page (for example: .htm,.php,.asp). If it is left blank +# doxygen will generate files with .html extension. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a personal HTML header for +# each generated HTML page. If it is left blank doxygen will generate a +# standard header. + +HTML_HEADER = @srcdir@/head.html + +# The HTML_FOOTER tag can be used to specify a personal HTML footer for +# each generated HTML page. If it is left blank doxygen will generate a +# standard footer. + +HTML_FOOTER = @srcdir@/foot.html + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading +# style sheet that is used by each HTML page. It can be used to +# fine-tune the look of the HTML output. If the tag is left blank doxygen +# will generate a default style sheet. Note that doxygen will try to copy +# the style sheet file to the HTML output directory, so don't put your own +# stylesheet in the HTML output directory as well, or it will be erased! + +HTML_STYLESHEET = @srcdir@/e.css + +# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, +# files or namespaces will be aligned in HTML using tables. If set to +# NO a bullet list will be used. + +HTML_ALIGN_MEMBERS = YES + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. For this to work a browser that supports +# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox +# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). + +HTML_DYNAMIC_SECTIONS = NO + +# If the GENERATE_DOCSET tag is set to YES, additional index files +# will be generated that can be used as input for Apple's Xcode 3 +# integrated development environment, introduced with OSX 10.5 (Leopard). +# To create a documentation set, doxygen will generate a Makefile in the +# HTML output directory. Running make will produce the docset in that +# directory and running "make install" will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find +# it at startup. +# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information. + +GENERATE_DOCSET = NO + +# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the +# feed. A documentation feed provides an umbrella under which multiple +# documentation sets from a single provider (such as a company or product suite) +# can be grouped. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that +# should uniquely identify the documentation set bundle. This should be a +# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen +# will append .docset to the name. + +DOCSET_BUNDLE_ID = org.enlightenment.EPhysics + +# If the GENERATE_HTMLHELP tag is set to YES, additional index files +# will be generated that can be used as input for tools like the +# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) +# of the generated HTML documentation. + +GENERATE_HTMLHELP = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can +# be used to specify the file name of the resulting .chm file. You +# can add a path in front of the file if the result should not be +# written to the html output directory. + +CHM_FILE = + +# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can +# be used to specify the location (absolute path including file name) of +# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run +# the HTML help compiler on the generated index.hhp. + +HHC_LOCATION = + +# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag +# controls if a separate .chi index file is generated (YES) or that +# it should be included in the master .chm file (NO). + +GENERATE_CHI = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING +# is used to encode HtmlHelp index (hhk), content (hhc) and project file +# content. + +CHM_INDEX_ENCODING = + +# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag +# controls whether a binary table of contents is generated (YES) or a +# normal table of contents (NO) in the .chm file. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members +# to the contents of the HTML help documentation and to the tree view. + +TOC_EXPAND = NO + +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER +# are set, an additional index file will be generated that can be used as input for +# Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated +# HTML documentation. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can +# be used to specify the file name of the resulting .qch file. +# The path specified is relative to the HTML output folder. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# http://doc.trolltech.com/qthelpproject.html#namespace + +QHP_NAMESPACE = + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# http://doc.trolltech.com/qthelpproject.html#virtual-folders + +QHP_VIRTUAL_FOLDER = doc + +# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to add. +# For more information please see +# http://doc.trolltech.com/qthelpproject.html#custom-filters + +QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the custom filter to add.For more information please see +# Qt Help Project / Custom Filters. + +QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this project's +# filter section matches. +# Qt Help Project / Filter Attributes. + +QHP_SECT_FILTER_ATTRS = + +# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can +# be used to specify the location of Qt's qhelpgenerator. +# If non-empty doxygen will try to run qhelpgenerator on the generated +# .qhp file. + +QHG_LOCATION = + +# The DISABLE_INDEX tag can be used to turn on/off the condensed index at +# top of each HTML page. The value NO (the default) enables the index and +# the value YES disables it. + +DISABLE_INDEX = YES + +# This tag can be used to set the number of enum values (range [1..20]) +# that doxygen will group on one line in the generated HTML documentation. + +ENUM_VALUES_PER_LINE = 4 + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. +# If the tag value is set to YES, a side panel will be generated +# containing a tree-like index structure (just like the one that +# is generated for HTML Help). For this to work a browser that supports +# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). +# Windows users are probably better off using the HTML help feature. + +GENERATE_TREEVIEW = NO + +# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories, +# and Class Hierarchy pages using a tree view instead of an ordered list. + +USE_INLINE_TREES = NO + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be +# used to set the initial width (in pixels) of the frame in which the tree +# is shown. + +TREEVIEW_WIDTH = 250 + +# Use this tag to change the font size of Latex formulas included +# as images in the HTML documentation. The default is 10. Note that +# when you change the font size after a successful doxygen run you need +# to manually remove any form_*.png images from the HTML output directory +# to force them to be regenerated. + +FORMULA_FONTSIZE = 10 + +# When the SEARCHENGINE tag is enable doxygen will generate a search box for the HTML output. The underlying search engine uses javascript +# and DHTML and should work on any modern browser. Note that when using HTML help (GENERATE_HTMLHELP) or Qt help (GENERATE_QHP) +# there is already a search function so this one should typically +# be disabled. + +SEARCHENGINE = NO + +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- + +# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will +# generate Latex output. + +GENERATE_LATEX = YES + +# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `latex' will be used as the default path. + +LATEX_OUTPUT = latex + +# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be +# invoked. If left blank `latex' will be used as the default command name. + +LATEX_CMD_NAME = latex + +# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to +# generate index for LaTeX. If left blank `makeindex' will be used as the +# default command name. + +MAKEINDEX_CMD_NAME = makeindex + +# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact +# LaTeX documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_LATEX = NO + +# The PAPER_TYPE tag can be used to set the paper type that is used +# by the printer. Possible values are: a4, a4wide, letter, legal and +# executive. If left blank a4wide will be used. + +PAPER_TYPE = a4wide + +# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX +# packages that should be included in the LaTeX output. + +EXTRA_PACKAGES = + +# The LATEX_HEADER tag can be used to specify a personal LaTeX header for +# the generated latex document. The header should contain everything until +# the first chapter. If it is left blank doxygen will generate a +# standard header. Notice: only use this tag if you know what you are doing! + +LATEX_HEADER = + +# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated +# is prepared for conversion to pdf (using ps2pdf). The pdf file will +# contain links (just like the HTML output) instead of page references +# This makes the output suitable for online browsing using a pdf viewer. + +PDF_HYPERLINKS = YES + +# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of +# plain latex in the generated Makefile. Set this option to YES to get a +# higher quality PDF documentation. + +USE_PDFLATEX = YES + +# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. +# command to the generated LaTeX files. This will instruct LaTeX to keep +# running if errors occur, instead of asking the user for help. +# This option is also used when generating formulas in HTML. + +LATEX_BATCHMODE = NO + +# If LATEX_HIDE_INDICES is set to YES then doxygen will not +# include the index chapters (such as File Index, Compound Index, etc.) +# in the output. + +LATEX_HIDE_INDICES = NO + +# If LATEX_SOURCE_CODE is set to YES then doxygen will include source code with syntax highlighting in the LaTeX output. Note that which sources are shown also depends on other settings such as SOURCE_BROWSER. + +LATEX_SOURCE_CODE = NO + +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- + +# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output +# The RTF output is optimized for Word 97 and may not look very pretty with +# other RTF readers or editors. + +GENERATE_RTF = NO + +# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `rtf' will be used as the default path. + +RTF_OUTPUT = rtf + +# If the COMPACT_RTF tag is set to YES Doxygen generates more compact +# RTF documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_RTF = NO + +# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated +# will contain hyperlink fields. The RTF file will +# contain links (just like the HTML output) instead of page references. +# This makes the output suitable for online browsing using WORD or other +# programs which support those fields. +# Note: wordpad (write) and others do not support links. + +RTF_HYPERLINKS = NO + +# Load stylesheet definitions from file. Syntax is similar to doxygen's +# config file, i.e. a series of assignments. You only have to provide +# replacements, missing definitions are set to their default value. + +RTF_STYLESHEET_FILE = + +# Set optional variables used in the generation of an rtf document. +# Syntax is similar to doxygen's config file. + +RTF_EXTENSIONS_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- + +# If the GENERATE_MAN tag is set to YES (the default) Doxygen will +# generate man pages + +GENERATE_MAN = YES + +# The MAN_OUTPUT tag is used to specify where the man pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `man' will be used as the default path. + +MAN_OUTPUT = man + +# The MAN_EXTENSION tag determines the extension that is added to +# the generated man pages (default is the subroutine's section .3) + +MAN_EXTENSION = .3 + +# If the MAN_LINKS tag is set to YES and Doxygen generates man output, +# then it will generate one additional man file for each entity +# documented in the real man page(s). These additional files +# only source the real man page, but without them the man command +# would be unable to find the correct page. The default is NO. + +MAN_LINKS = YES + +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- + +# If the GENERATE_XML tag is set to YES Doxygen will +# generate an XML file that captures the structure of +# the code including all documentation. + +GENERATE_XML = NO + +# The XML_OUTPUT tag is used to specify where the XML pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `xml' will be used as the default path. + +XML_OUTPUT = xml + +# The XML_SCHEMA tag can be used to specify an XML schema, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_SCHEMA = + +# The XML_DTD tag can be used to specify an XML DTD, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_DTD = + +# If the XML_PROGRAMLISTING tag is set to YES Doxygen will +# dump the program listings (including syntax highlighting +# and cross-referencing information) to the XML output. Note that +# enabling this will significantly increase the size of the XML output. + +XML_PROGRAMLISTING = YES + +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- + +# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will +# generate an AutoGen Definitions (see autogen.sf.net) file +# that captures the structure of the code including all +# documentation. Note that this feature is still experimental +# and incomplete at the moment. + +GENERATE_AUTOGEN_DEF = NO + +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- + +# If the GENERATE_PERLMOD tag is set to YES Doxygen will +# generate a Perl module file that captures the structure of +# the code including all documentation. Note that this +# feature is still experimental and incomplete at the +# moment. + +GENERATE_PERLMOD = NO + +# If the PERLMOD_LATEX tag is set to YES Doxygen will generate +# the necessary Makefile rules, Perl scripts and LaTeX code to be able +# to generate PDF and DVI output from the Perl module output. + +PERLMOD_LATEX = NO + +# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be +# nicely formatted so it can be parsed by a human reader. +# This is useful +# if you want to understand what is going on. +# On the other hand, if this +# tag is set to NO the size of the Perl module output will be much smaller +# and Perl will parse it just the same. + +PERLMOD_PRETTY = YES + +# The names of the make variables in the generated doxyrules.make file +# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. +# This is useful so different doxyrules.make files included by the same +# Makefile don't overwrite each other's variables. + +PERLMOD_MAKEVAR_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- + +# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will +# evaluate all C-preprocessor directives found in the sources and include +# files. + +ENABLE_PREPROCESSING = YES + +# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro +# names in the source code. If set to NO (the default) only conditional +# compilation will be performed. Macro expansion can be done in a controlled +# way by setting EXPAND_ONLY_PREDEF to YES. + +MACRO_EXPANSION = NO + +# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES +# then the macro expansion is limited to the macros specified with the +# PREDEFINED and EXPAND_AS_DEFINED tags. + +EXPAND_ONLY_PREDEF = NO + +# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files +# in the INCLUDE_PATH (see below) will be search if a #include is found. + +SEARCH_INCLUDES = YES + +# The INCLUDE_PATH tag can be used to specify one or more directories that +# contain include files that are not input files but should be processed by +# the preprocessor. + +INCLUDE_PATH = + +# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard +# patterns (like *.h and *.hpp) to filter out the header-files in the +# directories. If left blank, the patterns specified with FILE_PATTERNS will +# be used. + +INCLUDE_FILE_PATTERNS = + +# The PREDEFINED tag can be used to specify one or more macro names that +# are defined before the preprocessor is started (similar to the -D option of +# gcc). The argument of the tag is a list of macros of the form: name +# or name=definition (no spaces). If the definition and the = are +# omitted =1 is assumed. To prevent a macro definition from being +# undefined via #undef or recursively expanded use the := operator +# instead of the = operator. + +PREDEFINED = __UNUSED__= + +# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then +# this tag can be used to specify a list of macro names that should be expanded. +# The macro definition that is found in the sources will be used. +# Use the PREDEFINED tag if you want to use a different macro definition. + +EXPAND_AS_DEFINED = + +# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then +# doxygen's preprocessor will remove all function-like macros that are alone +# on a line, have an all uppercase name, and do not end with a semicolon. Such +# function macros are typically used for boiler-plate code, and will confuse +# the parser if not removed. + +SKIP_FUNCTION_MACROS = YES + +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- + +# The TAGFILES option can be used to specify one or more tagfiles. +# Optionally an initial location of the external documentation +# can be added for each tagfile. The format of a tag file without +# this location is as follows: +# +# TAGFILES = file1 file2 ... +# Adding location for the tag files is done as follows: +# +# TAGFILES = file1=loc1 "file2 = loc2" ... +# where "loc1" and "loc2" can be relative or absolute paths or +# URLs. If a location is present for each tag, the installdox tool +# does not have to be run to correct the links. +# Note that each tag file must have a unique name +# (where the name does NOT include the path) +# If a tag file is not located in the directory in which doxygen +# is run, you must also specify the path to the tagfile here. + +TAGFILES = + +# When a file name is specified after GENERATE_TAGFILE, doxygen will create +# a tag file that is based on the input files it reads. + +GENERATE_TAGFILE = + +# If the ALLEXTERNALS tag is set to YES all external classes will be listed +# in the class index. If set to NO only the inherited external classes +# will be listed. + +ALLEXTERNALS = NO + +# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed +# in the modules index. If set to NO, only the current project's groups will +# be listed. + +EXTERNAL_GROUPS = YES + +# The PERL_PATH should be the absolute path and name of the perl script +# interpreter (i.e. the result of `which perl'). + +PERL_PATH = /usr/bin/perl + +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- + +# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will +# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base +# or super classes. Setting the tag to NO turns the diagrams off. Note that +# this option is superseded by the HAVE_DOT option below. This is only a +# fallback. It is recommended to install and use dot, since it yields more +# powerful graphs. + +CLASS_DIAGRAMS = YES + +# You can define message sequence charts within doxygen comments using the \msc +# command. Doxygen will then run the mscgen tool (see +# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the +# documentation. The MSCGEN_PATH tag allows you to specify the directory where +# the mscgen tool resides. If left empty the tool is assumed to be found in the +# default search path. + +MSCGEN_PATH = + +# If set to YES, the inheritance and collaboration graphs will hide +# inheritance and usage relations if the target is undocumented +# or is not a class. + +HIDE_UNDOC_RELATIONS = YES + +# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is +# available from the path. This tool is part of Graphviz, a graph visualization +# toolkit from AT&T and Lucent Bell Labs. The other options in this section +# have no effect if this option is set to NO (the default) + +HAVE_DOT = NO + +# By default doxygen will write a font called FreeSans.ttf to the output +# directory and reference it in all dot files that doxygen generates. This +# font does not include all possible unicode characters however, so when you need +# these (or just want a differently looking font) you can specify the font name +# using DOT_FONTNAME. You need need to make sure dot is able to find the font, +# which can be done by putting it in a standard location or by setting the +# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory +# containing the font. + +DOT_FONTNAME = FreeSans + +# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. +# The default size is 10pt. + +DOT_FONTSIZE = 10 + +# By default doxygen will tell dot to use the output directory to look for the +# FreeSans.ttf font (which doxygen will put there itself). If you specify a +# different font using DOT_FONTNAME you can set the path where dot +# can find it using this tag. + +DOT_FONTPATH = + +# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect inheritance relations. Setting this tag to YES will force the +# the CLASS_DIAGRAMS tag to NO. + +CLASS_GRAPH = YES + +# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect implementation dependencies (inheritance, containment, and +# class references variables) of the class with other documented classes. + +COLLABORATION_GRAPH = YES + +# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for groups, showing the direct groups dependencies + +GROUP_GRAPHS = YES + +# If the UML_LOOK tag is set to YES doxygen will generate inheritance and +# collaboration diagrams in a style similar to the OMG's Unified Modeling +# Language. + +UML_LOOK = NO + +# If set to YES, the inheritance and collaboration graphs will show the +# relations between templates and their instances. + +TEMPLATE_RELATIONS = NO + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT +# tags are set to YES then doxygen will generate a graph for each documented +# file showing the direct and indirect include dependencies of the file with +# other documented files. + +INCLUDE_GRAPH = YES + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and +# HAVE_DOT tags are set to YES then doxygen will generate a graph for each +# documented header file showing the documented files that directly or +# indirectly include this file. + +INCLUDED_BY_GRAPH = YES + +# If the CALL_GRAPH and HAVE_DOT options are set to YES then +# doxygen will generate a call dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable call graphs +# for selected functions only using the \callgraph command. + +CALL_GRAPH = NO + +# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then +# doxygen will generate a caller dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable caller +# graphs for selected functions only using the \callergraph command. + +CALLER_GRAPH = NO + +# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen +# will graphical hierarchy of all classes instead of a textual one. + +GRAPHICAL_HIERARCHY = YES + +# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES +# then doxygen will show the dependencies a directory has on other directories +# in a graphical way. The dependency relations are determined by the #include +# relations between the files in the directories. + +DIRECTORY_GRAPH = YES + +# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images +# generated by dot. Possible values are png, jpg, or gif +# If left blank png will be used. + +DOT_IMAGE_FORMAT = png + +# The tag DOT_PATH can be used to specify the path where the dot tool can be +# found. If left blank, it is assumed the dot tool can be found in the path. + +DOT_PATH = + +# The DOTFILE_DIRS tag can be used to specify one or more directories that +# contain dot files that are included in the documentation (see the +# \dotfile command). + +DOTFILE_DIRS = + +# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of +# nodes that will be shown in the graph. If the number of nodes in a graph +# becomes larger than this value, doxygen will truncate the graph, which is +# visualized by representing a node as a red box. Note that doxygen if the +# number of direct children of the root node in a graph is already larger than +# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note +# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. + +DOT_GRAPH_MAX_NODES = 50 + +# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the +# graphs generated by dot. A depth value of 3 means that only nodes reachable +# from the root by following a path via at most 3 edges will be shown. Nodes +# that lay further from the root node will be omitted. Note that setting this +# option to 1 or 2 may greatly reduce the computation time needed for large +# code bases. Also note that the size of a graph can be further restricted by +# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. + +MAX_DOT_GRAPH_DEPTH = 0 + +# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent +# background. This is disabled by default, because dot on Windows does not +# seem to support this out of the box. Warning: Depending on the platform used, +# enabling this option may lead to badly anti-aliased labels on the edges of +# a graph (i.e. they become hard to read). + +DOT_TRANSPARENT = NO + +# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output +# files in one run (i.e. multiple -o and -T options on the command line). This +# makes dot run faster, but since only newer versions of dot (>1.8.10) +# support this, this feature is disabled by default. + +DOT_MULTI_TARGETS = NO + +# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will +# generate a legend page explaining the meaning of the various boxes and +# arrows in the dot generated graphs. + +GENERATE_LEGEND = YES + +# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will +# remove the intermediate dot files that are used to generate +# the various graphs. + +DOT_CLEANUP = YES diff --git a/legacy/ephysics/doc/Makefile.am b/legacy/ephysics/doc/Makefile.am new file mode 100644 index 0000000000..b00aa037c0 --- /dev/null +++ b/legacy/ephysics/doc/Makefile.am @@ -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 diff --git a/legacy/ephysics/doc/e.css b/legacy/ephysics/doc/e.css new file mode 100644 index 0000000000..44a9f254db --- /dev/null +++ b/legacy/ephysics/doc/e.css @@ -0,0 +1,295 @@ +/* + Author: + Andres Blanc + DaveMDS Andreoli + + 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; +} diff --git a/legacy/ephysics/doc/examples.dox b/legacy/ephysics/doc/examples.dox new file mode 100644 index 0000000000..56ceb48221 --- /dev/null +++ b/legacy/ephysics/doc/examples.dox @@ -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 \ key it applies a central impulse of 0 kilos on X axis and + * 10 kilos on Y - so the ball is forced up. + * + * If \ 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 \ 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 \ 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 + */ + diff --git a/legacy/ephysics/doc/foot.html b/legacy/ephysics/doc/foot.html new file mode 100644 index 0000000000..d43cf8fcc0 --- /dev/null +++ b/legacy/ephysics/doc/foot.html @@ -0,0 +1,18 @@ + +
+ + + + + + + + + + + diff --git a/legacy/ephysics/doc/head.html b/legacy/ephysics/doc/head.html new file mode 100644 index 0000000000..35236ace8d --- /dev/null +++ b/legacy/ephysics/doc/head.html @@ -0,0 +1,67 @@ + + + $title + + + + + + + + + + + + + + +
+ + + +
+
diff --git a/legacy/ephysics/doc/img/diagram_ephysics.png b/legacy/ephysics/doc/img/diagram_ephysics.png new file mode 100644 index 0000000000..706c796a7e Binary files /dev/null and b/legacy/ephysics/doc/img/diagram_ephysics.png differ diff --git a/legacy/ephysics/doc/img/e.png b/legacy/ephysics/doc/img/e.png new file mode 100644 index 0000000000..d42aeb4200 Binary files /dev/null and b/legacy/ephysics/doc/img/e.png differ diff --git a/legacy/ephysics/doc/img/edoxy.css b/legacy/ephysics/doc/img/edoxy.css new file mode 100644 index 0000000000..311ca23d46 --- /dev/null +++ b/legacy/ephysics/doc/img/edoxy.css @@ -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%; +} + diff --git a/legacy/ephysics/doc/img/foot_bg.png b/legacy/ephysics/doc/img/foot_bg.png new file mode 100644 index 0000000000..b24f3a48b4 Binary files /dev/null and b/legacy/ephysics/doc/img/foot_bg.png differ diff --git a/legacy/ephysics/doc/img/head_bg.png b/legacy/ephysics/doc/img/head_bg.png new file mode 100644 index 0000000000..081dc131e4 Binary files /dev/null and b/legacy/ephysics/doc/img/head_bg.png differ diff --git a/legacy/ephysics/doc/img/header_menu_background.png b/legacy/ephysics/doc/img/header_menu_background.png new file mode 100644 index 0000000000..e978743651 Binary files /dev/null and b/legacy/ephysics/doc/img/header_menu_background.png differ diff --git a/legacy/ephysics/doc/img/header_menu_background_last.png b/legacy/ephysics/doc/img/header_menu_background_last.png new file mode 100644 index 0000000000..88c116c8c8 Binary files /dev/null and b/legacy/ephysics/doc/img/header_menu_background_last.png differ diff --git a/legacy/ephysics/doc/img/header_menu_current_background.png b/legacy/ephysics/doc/img/header_menu_current_background.png new file mode 100644 index 0000000000..de97c9268e Binary files /dev/null and b/legacy/ephysics/doc/img/header_menu_current_background.png differ diff --git a/legacy/ephysics/doc/img/header_menu_unselected_background.png b/legacy/ephysics/doc/img/header_menu_unselected_background.png new file mode 100644 index 0000000000..50e5fd8d3d Binary files /dev/null and b/legacy/ephysics/doc/img/header_menu_unselected_background.png differ diff --git a/legacy/ephysics/doc/img/logo.png b/legacy/ephysics/doc/img/logo.png new file mode 100644 index 0000000000..b3884a5cbc Binary files /dev/null and b/legacy/ephysics/doc/img/logo.png differ diff --git a/legacy/ephysics/ephysics.pc.in b/legacy/ephysics/ephysics.pc.in new file mode 100644 index 0000000000..4973e0687a --- /dev/null +++ b/legacy/ephysics/ephysics.pc.in @@ -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@ diff --git a/legacy/ephysics/m4/ac_attribute.m4 b/legacy/ephysics/m4/ac_attribute.m4 new file mode 100644 index 0000000000..23479a92ac --- /dev/null +++ b/legacy/ephysics/m4/ac_attribute.m4 @@ -0,0 +1,47 @@ +dnl Copyright (C) 2004-2008 Kim Woelders +dnl Copyright (C) 2008 Vincent Torri +dnl That code is public domain and can be freely used or copied. +dnl Originally snatched from somewhere... + +dnl Macro for checking if the compiler supports __attribute__ + +dnl Usage: AC_C___ATTRIBUTE__ +dnl call AC_DEFINE for HAVE___ATTRIBUTE__ and __UNUSED__ +dnl if the compiler supports __attribute__, HAVE___ATTRIBUTE__ is +dnl defined to 1 and __UNUSED__ is defined to __attribute__((unused)) +dnl otherwise, HAVE___ATTRIBUTE__ is not defined and __UNUSED__ is +dnl defined to nothing. + +AC_DEFUN([AC_C___ATTRIBUTE__], +[ + +AC_MSG_CHECKING([for __attribute__]) + +AC_CACHE_VAL([ac_cv___attribute__], + [AC_TRY_COMPILE( + [ +#include + +int func(int x); +int foo(int x __attribute__ ((unused))) +{ + exit(1); +} + ], + [], + [ac_cv___attribute__="yes"], + [ac_cv___attribute__="no"] + )]) + +AC_MSG_RESULT($ac_cv___attribute__) + +if test "x${ac_cv___attribute__}" = "xyes" ; then + AC_DEFINE([HAVE___ATTRIBUTE__], [1], [Define to 1 if your compiler has __attribute__]) + AC_DEFINE([__UNUSED__], [__attribute__((unused))], [Macro declaring a function argument to be unused]) + else + AC_DEFINE([__UNUSED__], [], [Macro declaring a function argument to be unused]) +fi + +]) + +dnl End of ac_attribute.m4 diff --git a/legacy/ephysics/m4/efl_binary.m4 b/legacy/ephysics/m4/efl_binary.m4 new file mode 100644 index 0000000000..c774688174 --- /dev/null +++ b/legacy/ephysics/m4/efl_binary.m4 @@ -0,0 +1,71 @@ +dnl Copyright (C) 2010 Vincent Torri +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) + +]) diff --git a/legacy/ephysics/m4/efl_compiler_flag.m4 b/legacy/ephysics/m4/efl_compiler_flag.m4 new file mode 100644 index 0000000000..25c285dbf5 --- /dev/null +++ b/legacy/ephysics/m4/efl_compiler_flag.m4 @@ -0,0 +1,57 @@ +dnl Copyright (C) 2010 Vincent Torri +dnl and Albin Tonnerre +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]) + +]) diff --git a/legacy/ephysics/m4/efl_doxygen.m4 b/legacy/ephysics/m4/efl_doxygen.m4 new file mode 100644 index 0000000000..d83ed68b8a --- /dev/null +++ b/legacy/ephysics/m4/efl_doxygen.m4 @@ -0,0 +1,97 @@ +dnl Copyright (C) 2008 Vincent Torri +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 diff --git a/legacy/ephysics/m4/efl_path_max.m4 b/legacy/ephysics/m4/efl_path_max.m4 new file mode 100644 index 0000000000..f57bfd2ab5 --- /dev/null +++ b/legacy/ephysics/m4/efl_path_max.m4 @@ -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 , 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 + ]], + [[ +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 diff --git a/legacy/ephysics/src/Makefile.am b/legacy/ephysics/src/Makefile.am new file mode 100644 index 0000000000..a8590b2f0d --- /dev/null +++ b/legacy/ephysics/src/Makefile.am @@ -0,0 +1,3 @@ +MAINTAINERCLEANFILES = Makefile.in + +SUBDIRS = lib bin diff --git a/legacy/ephysics/src/bin/Makefile.am b/legacy/ephysics/src/bin/Makefile.am new file mode 100644 index 0000000000..59a34b0ae6 --- /dev/null +++ b/legacy/ephysics/src/bin/Makefile.am @@ -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 diff --git a/legacy/ephysics/src/bin/ephysics_logo.c b/legacy/ephysics/src/bin/ephysics_logo.c new file mode 100644 index 0000000000..93503720aa --- /dev/null +++ b/legacy/ephysics/src/bin/ephysics_logo.c @@ -0,0 +1,279 @@ +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include +#include + +/* 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() diff --git a/legacy/ephysics/src/bin/ephysics_test.h b/legacy/ephysics/src/bin/ephysics_test.h new file mode 100644 index 0000000000..d696e413b1 --- /dev/null +++ b/legacy/ephysics/src/bin/ephysics_test.h @@ -0,0 +1,79 @@ +#ifndef _EPHYSICS_PRIVATE_H +#define _EPHYSICS_PRIVATE_H + +#include +#include +#include +#include + +#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 diff --git a/legacy/ephysics/src/bin/test.c b/legacy/ephysics/src/bin/test.c new file mode 100644 index 0000000000..5c05c8787f --- /dev/null +++ b/legacy/ephysics/src/bin/test.c @@ -0,0 +1,198 @@ +#ifdef HAVE_CONFIG_H +# include +#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() diff --git a/legacy/ephysics/src/bin/test_bouncing_ball.c b/legacy/ephysics/src/bin/test_bouncing_ball.c new file mode 100644 index 0000000000..a30acfe04c --- /dev/null +++ b/legacy/ephysics/src/bin/test_bouncing_ball.c @@ -0,0 +1,111 @@ +#ifdef HAVE_CONFIG_H +# include +#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); +} diff --git a/legacy/ephysics/src/bin/test_bouncing_text.c b/legacy/ephysics/src/bin/test_bouncing_text.c new file mode 100644 index 0000000000..5ed7dc425f --- /dev/null +++ b/legacy/ephysics/src/bin/test_bouncing_text.c @@ -0,0 +1,68 @@ +#ifdef HAVE_CONFIG_H +# include +#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); +} diff --git a/legacy/ephysics/src/bin/test_colliding_balls.c b/legacy/ephysics/src/bin/test_colliding_balls.c new file mode 100644 index 0000000000..48a5494d4a --- /dev/null +++ b/legacy/ephysics/src/bin/test_colliding_balls.c @@ -0,0 +1,91 @@ +#ifdef HAVE_CONFIG_H +# include +#endif + +#include "ephysics_test.h" + +static void +_world_populate(Test_Data *test_data) +{ + static const char *colors[] = {"blue-ball", "red-ball", "green-ball"}; + Evas_Object *sphere, *shadow; + EPhysics_Body *fall_body; + int i, column, row; + + for (i = 0; i < 9; i++) + { + column = i % 3; + row = i / 3; + + 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, (1 + column) * WIDTH / 4, FLOOR_Y); + evas_object_resize(shadow, 54, 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", + colors[column]); + evas_object_move(sphere, (1 + column) * WIDTH / 4, + 100 + row * 60 + row / 2 * 20); + evas_object_resize(sphere, 54, 54); + 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_event_callback_add(fall_body, + EPHYSICS_CALLBACK_BODY_UPDATE, + update_object_cb, shadow); + ephysics_body_restitution_set(fall_body, 0.95); + ephysics_body_friction_set(fall_body, 0.1); + test_data->bodies = eina_list_append(test_data->bodies, 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"); + test_clean(test_data); + _world_populate(test_data); +} + +void +test_colliding_balls(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, "Colliding Balls", 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); + + ephysics_body_top_boundary_add(test_data->world); + ephysics_body_left_boundary_add(test_data->world); + ephysics_body_right_boundary_add(test_data->world); + + _world_populate(test_data); +} diff --git a/legacy/ephysics/src/bin/test_collision_detection.c b/legacy/ephysics/src/bin/test_collision_detection.c new file mode 100644 index 0000000000..3281a7a350 --- /dev/null +++ b/legacy/ephysics/src/bin/test_collision_detection.c @@ -0,0 +1,185 @@ +#ifdef HAVE_CONFIG_H +# include +#endif + +#include "ephysics_test.h" + +typedef struct _Collision_Data Collision_Data; + +struct _Collision_Data { + Test_Data base; + Evas_Object *impact; + EPhysics_Body *sphere; + EPhysics_Body *sphere2; +}; + +static void +_collision_cb(void *data, EPhysics_Body *body __UNUSED__, void *event_info __UNUSED__) +{ + Collision_Data *collision_data = data; + Evas_Object *obj; + int x; + + if (event_info != collision_data->sphere2) return; + + INF("Collision Detected"); + + obj = ephysics_body_evas_object_get(collision_data->sphere); + evas_object_geometry_get(obj, &x, NULL, NULL, NULL); + evas_object_move(collision_data->impact, x - 4, FLOOR_Y - 80); + elm_object_signal_emit(collision_data->impact, "impact,show", + "ephysics_test"); +} + +static void +_world_populate(Collision_Data *collision_data) +{ + Evas_Object *sphere1, *sphere2, *sh1, *sh2, *impact; + EPhysics_Body *sphere_body1, *sphere_body2; + + sh1 = elm_layout_add(collision_data->base.win); + elm_layout_file_set( + sh1, PACKAGE_DATA_DIR "/" EPHYSICS_TEST_THEME ".edj", "shadow-ball"); + evas_object_move(sh1, WIDTH / 2, FLOOR_Y); + evas_object_resize(sh1, 70, 3); + evas_object_show(sh1); + collision_data->base.evas_objs = eina_list_append( + collision_data->base.evas_objs, sh1); + + sphere1 = elm_image_add(collision_data->base.win); + elm_image_file_set( + sphere1, PACKAGE_DATA_DIR "/" EPHYSICS_TEST_THEME ".edj", + "big-blue-ball"); + evas_object_move(sphere1, WIDTH / 2, FLOOR_Y - 70 + 1); + evas_object_resize(sphere1, 70, 70); + evas_object_show(sphere1); + collision_data->base.evas_objs = eina_list_append( + collision_data->base.evas_objs, sphere1); + + sphere_body1 = ephysics_body_circle_add(collision_data->base.world); + ephysics_body_evas_object_set(sphere_body1, sphere1, EINA_TRUE); + ephysics_body_event_callback_add(sphere_body1, + EPHYSICS_CALLBACK_BODY_UPDATE, + update_object_cb, sh1); + ephysics_body_restitution_set(sphere_body1, 0.8); + ephysics_body_friction_set(sphere_body1, 0.4); + collision_data->base.bodies = eina_list_append( + collision_data->base.bodies, sphere_body1); + collision_data->sphere = sphere_body1; + + sh2 = elm_layout_add(collision_data->base.win); + elm_layout_file_set( + sh2, PACKAGE_DATA_DIR "/" EPHYSICS_TEST_THEME ".edj", "shadow-ball"); + evas_object_move(sh2, WIDTH / 8, FLOOR_Y); + evas_object_resize(sh2, 70, 3); + evas_object_show(sh2); + collision_data->base.evas_objs = eina_list_append( + collision_data->base.evas_objs, sh2); + + sphere2 = elm_image_add(collision_data->base.win); + elm_image_file_set( + sphere2, PACKAGE_DATA_DIR "/" EPHYSICS_TEST_THEME ".edj", + "big-red-ball"); + evas_object_move(sphere2, WIDTH / 8, FLOOR_Y - 70 + 1); + evas_object_resize(sphere2, 70, 70); + evas_object_show(sphere2); + collision_data->base.evas_objs = eina_list_append( + collision_data->base.evas_objs, sphere2); + + sphere_body2 = ephysics_body_circle_add(collision_data->base.world); + ephysics_body_evas_object_set(sphere_body2, sphere2, EINA_TRUE); + ephysics_body_event_callback_add(sphere_body2, + EPHYSICS_CALLBACK_BODY_UPDATE, + update_object_cb, sh2); + ephysics_body_restitution_set(sphere_body2, 1); + ephysics_body_friction_set(sphere_body2, 0.4); + ephysics_body_central_impulse_apply(sphere_body2, 12, 0); + collision_data->sphere2 = sphere_body2; + collision_data->base.bodies = eina_list_append( + collision_data->base.bodies, sphere_body2); + + impact = elm_layout_add(collision_data->base.win); + elm_layout_file_set( + impact, PACKAGE_DATA_DIR "/" EPHYSICS_TEST_THEME ".edj", "impact"); + evas_object_resize(impact, 20, 20); + evas_object_show(impact); + collision_data->base.evas_objs = eina_list_append( + collision_data->base.evas_objs, impact); + collision_data->impact = impact; +} + +static void +_restart(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__) +{ + Collision_Data *collision_data = data; + + DBG("Restart pressed"); + ephysics_body_event_callback_del(collision_data->sphere, + EPHYSICS_CALLBACK_BODY_COLLISION, + _collision_cb); + test_clean((Test_Data *)collision_data); + _world_populate(collision_data); + ephysics_body_event_callback_add(collision_data->sphere, + EPHYSICS_CALLBACK_BODY_COLLISION, + _collision_cb, collision_data); +} + +static void +_win_del(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +{ + Collision_Data *collision_data = data; + + test_clean((Test_Data *)collision_data); + evas_object_del(collision_data->base.layout); + ephysics_world_del(collision_data->base.world); + free(collision_data); + ephysics_shutdown(); +} + +void +test_collision(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +{ + Collision_Data *collision_data; + EPhysics_Body *boundary; + EPhysics_World *world; + Evas_Object *edje; + + if (!ephysics_init()) + return; + + collision_data = calloc(1, sizeof(Collision_Data)); + if (!collision_data) + { + ERR("Failed to create test data"); + ephysics_shutdown(); + return; + } + + test_win_add((Test_Data *)collision_data, "Collision Detection", EINA_FALSE); + evas_object_smart_callback_add(collision_data->base.win, + "delete,request", _win_del, collision_data); + + edje = elm_layout_edje_get(collision_data->base.layout); + edje_object_signal_callback_add(edje, "restart", "test-theme", _restart, + collision_data); + + world = ephysics_world_new(); + ephysics_world_render_geometry_set(world, 50, 40, WIDTH - 100, FLOOR_Y - 40); + collision_data->base.world = world; + + boundary = ephysics_body_bottom_boundary_add(collision_data->base.world); + ephysics_body_restitution_set(boundary, 0); + ephysics_body_friction_set(boundary, 20); + + boundary = ephysics_body_right_boundary_add(collision_data->base.world); + ephysics_body_restitution_set(boundary, 0.8); + + ephysics_body_left_boundary_add(collision_data->base.world); + ephysics_body_top_boundary_add(collision_data->base.world); + + _world_populate(collision_data); + + ephysics_body_event_callback_add(collision_data->sphere, + EPHYSICS_CALLBACK_BODY_COLLISION, + _collision_cb, collision_data); +} diff --git a/legacy/ephysics/src/bin/test_constraint.c b/legacy/ephysics/src/bin/test_constraint.c new file mode 100644 index 0000000000..259f9dcb4d --- /dev/null +++ b/legacy/ephysics/src/bin/test_constraint.c @@ -0,0 +1,105 @@ +#ifdef HAVE_CONFIG_H +# include +#endif + +#include "ephysics_test.h" + +static void +_world_populate(Test_Data *test_data) +{ + EPhysics_Body *box_body1, *box_body2; + Evas_Object *box1, *box2, *sh1, *sh2; + EPhysics_Constraint *constraint; + + sh1 = elm_layout_add(test_data->win); + elm_layout_file_set( + sh1, PACKAGE_DATA_DIR "/" EPHYSICS_TEST_THEME ".edj", "shadow-cube"); + evas_object_move(sh1, WIDTH / 3, FLOOR_Y); + evas_object_resize(sh1, 70, 3); + evas_object_show(sh1); + test_data->evas_objs = eina_list_append(test_data->evas_objs, sh1); + + box1 = elm_image_add(test_data->win); + elm_image_file_set( + box1, PACKAGE_DATA_DIR "/" EPHYSICS_TEST_THEME ".edj", "blue-cube"); + evas_object_move(box1, WIDTH / 3, HEIGHT / 8); + evas_object_resize(box1, 70, 70); + evas_object_show(box1); + test_data->evas_objs = eina_list_append(test_data->evas_objs, box1); + + box_body1 = ephysics_body_box_add(test_data->world); + ephysics_body_evas_object_set(box_body1, box1, EINA_TRUE); + ephysics_body_event_callback_add(box_body1, EPHYSICS_CALLBACK_BODY_UPDATE, + update_object_cb, sh1); + ephysics_body_restitution_set(box_body1, 0.3); + ephysics_body_friction_set(box_body1, 0.1); + test_data->bodies = eina_list_append(test_data->bodies, box_body1); + + sh2 = elm_layout_add(test_data->win); + elm_layout_file_set( + sh2, PACKAGE_DATA_DIR "/" EPHYSICS_TEST_THEME ".edj", "shadow-cube"); + evas_object_move(sh2, WIDTH / 3 + 110, FLOOR_Y); + evas_object_resize(sh2, 70, 3); + evas_object_show(sh2); + test_data->evas_objs = eina_list_append(test_data->evas_objs, sh2); + + box2 = elm_image_add(test_data->win); + elm_image_file_set( + box2, PACKAGE_DATA_DIR "/" EPHYSICS_TEST_THEME ".edj", "purple-cube"); + evas_object_move(box2, WIDTH / 3 + 110, HEIGHT / 8); + evas_object_resize(box2, 70, 70); + evas_object_show(box2); + test_data->evas_objs = eina_list_append(test_data->evas_objs, box2); + + box_body2 = ephysics_body_box_add(test_data->world); + ephysics_body_mass_set(box_body2, 5); + ephysics_body_evas_object_set(box_body2, box2, EINA_TRUE); + ephysics_body_event_callback_add(box_body2, EPHYSICS_CALLBACK_BODY_UPDATE, + update_object_cb, sh2); + ephysics_body_restitution_set(box_body2, 0.5); + ephysics_body_friction_set(box_body2, 0.1); + test_data->bodies = eina_list_append(test_data->bodies, box_body2); + + constraint = ephysics_constraint_add(box_body1, box_body2, 0, 100, 0, 0); + test_data->constraints = eina_list_append(test_data->constraints, + constraint); +} + +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_constraint(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, "Constraint", 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, 3); + + _world_populate(test_data); +} diff --git a/legacy/ephysics/src/bin/test_falling_letters.c b/legacy/ephysics/src/bin/test_falling_letters.c new file mode 100644 index 0000000000..40970f0938 --- /dev/null +++ b/legacy/ephysics/src/bin/test_falling_letters.c @@ -0,0 +1,76 @@ +#ifdef HAVE_CONFIG_H +# include +#endif + +#include "ephysics_test.h" + +static void +_world_populate(Test_Data *test_data) +{ + static const char name[] = "EPHYSICS"; + EPhysics_Body *text_body; + unsigned int i = 0; + Evas_Object *text; + char buf[3]; + int x, y, w; + + for (i = 0; i < strlen(name); i++) + { + sprintf(buf, "%c", name[i]); + text = evas_object_text_add(evas_object_evas_get(test_data->win)); + evas_object_text_text_set(text, buf); + evas_object_text_font_set(text, "Sans", 48); + evas_object_color_set(text, 95, 56, 19, 255); + evas_object_geometry_get(text, NULL, NULL, &w, NULL); + x = WIDTH / 5 + i * 40; + y = HEIGHT / 8 + i * 28; + evas_object_move(text, x, y); + evas_object_show(text); + 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, 40); + ephysics_body_friction_set(text_body, 0.1); + ephysics_body_restitution_set(text_body, 0.95); + 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_falling_letters(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, "Falling Letters", 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.3); + + _world_populate(test_data); +} diff --git a/legacy/ephysics/src/bin/test_jumping_balls.c b/legacy/ephysics/src/bin/test_jumping_balls.c new file mode 100644 index 0000000000..b2419971b9 --- /dev/null +++ b/legacy/ephysics/src/bin/test_jumping_balls.c @@ -0,0 +1,141 @@ +#ifdef HAVE_CONFIG_H +# include +#endif + +#include "ephysics_test.h" + +struct _Ball_Props { + int color; + int size; + int x; + int y; +}; + +static void +_jump(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +{ + const Eina_List *l, *bodies; + EPhysics_Body *body; + Test_Data *test_data = data; + EPhysics_World *world = test_data->world; + Evas_Object *bt = test_data->data; + + elm_object_disabled_set(bt, EINA_TRUE); + bodies = ephysics_world_bodies_get(world); + EINA_LIST_FOREACH(bodies, l, body) + ephysics_body_central_impulse_apply(body, 0, 10); +} + +static void +_add_sphere(Test_Data *test_data, int i) +{ + Evas_Object *sphere, *shadow; + EPhysics_Body *fall_body; + + static const char *colors[] = {"big-blue-ball", "red-ball", "green-ball"}; + static const struct _Ball_Props props[] = { + {2, 54, 220, 136}, + {0, 70, 180, 178}, {0, 70, 248, 178}, + {1, 54, 166, 244}, {1, 54, 220, 244}, {1, 54, 274, 244}, + {2, 54, 138, 290}, {2, 54, 192, 290}, + {2, 54, 246, 290}, {2, 54, 300, 290}, + }; + + 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, props[i].x, FLOOR_Y); + evas_object_resize(shadow, props[i].size, 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", + colors[props[i].color]); + evas_object_move(sphere, props[i].x, props[i].y); + evas_object_resize(sphere, props[i].size, props[i].size); + 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_event_callback_add(fall_body, EPHYSICS_CALLBACK_BODY_UPDATE, + update_object_cb, shadow); + ephysics_body_restitution_set(fall_body, 0.95); + ephysics_body_friction_set(fall_body, 0.1); + test_data->bodies = eina_list_append(test_data->bodies, fall_body); +} + +static void +_world_populate(Test_Data *test_data) +{ + int i; + + for (i = 0; i < 10; i++) + _add_sphere(test_data, i); + + elm_object_signal_emit(test_data->data, "click", "ephysics_test"); +} + +static void +_restart(void *data, Evas_Object *obj __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__) +{ + Test_Data *test_data = data; + Evas_Object *bt = test_data->data; + + DBG("Restart pressed"); + test_clean(test_data); + _world_populate(test_data); + elm_object_disabled_set(bt, EINA_FALSE); +} + +static void +_world_stopped_cb(void *data, EPhysics_World *world __UNUSED__, void *event_info __UNUSED__) +{ + Evas_Object *bt = data; + elm_object_disabled_set(bt, EINA_FALSE); + INF("World stopped\n"); +} + +void +test_jumping_balls(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +{ + EPhysics_Body *boundary; + Evas_Object *bt, *edje; + EPhysics_World *world; + Test_Data *test_data; + + if (!ephysics_init()) + return; + + test_data = test_data_new(); + test_win_add(test_data, "Jumping Balls", 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; + + bt = elm_button_add(test_data->win); + elm_object_style_set(bt, "ephysics-test-jump"); + elm_layout_content_set(test_data->layout, "extra_button", bt); + evas_object_smart_callback_add(bt, "clicked", _jump, test_data); + + test_data->data = bt; + ephysics_world_event_callback_add(world, EPHYSICS_CALLBACK_WORLD_STOPPED, + _world_stopped_cb, bt); + + boundary = ephysics_body_bottom_boundary_add(test_data->world); + ephysics_body_restitution_set(boundary, 0.65); + ephysics_body_friction_set(boundary, 2); + + ephysics_body_top_boundary_add(test_data->world); + ephysics_body_left_boundary_add(test_data->world); + ephysics_body_right_boundary_add(test_data->world); + + _world_populate(test_data); +} diff --git a/legacy/ephysics/src/bin/test_rotate.c b/legacy/ephysics/src/bin/test_rotate.c new file mode 100644 index 0000000000..48a16446fb --- /dev/null +++ b/legacy/ephysics/src/bin/test_rotate.c @@ -0,0 +1,100 @@ +#ifdef HAVE_CONFIG_H +# include +#endif + +#include "ephysics_test.h" + +static void +_world_populate(Test_Data *test_data) +{ + EPhysics_Body *box_body1, *box_body2; + Evas_Object *box1, *box2, *sh1, *sh2; + + sh1 = elm_layout_add(test_data->win); + elm_layout_file_set( + sh1, PACKAGE_DATA_DIR "/" EPHYSICS_TEST_THEME ".edj", "shadow-cube"); + evas_object_move(sh1, WIDTH / 6, FLOOR_Y); + evas_object_resize(sh1, 70, 3); + evas_object_show(sh1); + test_data->evas_objs = eina_list_append(test_data->evas_objs, sh1); + + box1 = elm_image_add(test_data->win); + elm_image_file_set( + box1, PACKAGE_DATA_DIR "/" EPHYSICS_TEST_THEME ".edj", "blue-cube"); + evas_object_move(box1, WIDTH / 6, FLOOR_Y - 70); + evas_object_resize(box1, 70, 70); + evas_object_show(box1); + test_data->evas_objs = eina_list_append(test_data->evas_objs, box1); + + box_body1 = ephysics_body_box_add(test_data->world); + ephysics_body_mass_set(box_body1, 0); + ephysics_body_evas_object_set(box_body1, box1, EINA_TRUE); + ephysics_body_event_callback_add(box_body1, EPHYSICS_CALLBACK_BODY_UPDATE, + update_object_cb, sh1); + ephysics_body_restitution_set(box_body1, 0.3); + ephysics_body_friction_set(box_body1, 0.1); + test_data->bodies = eina_list_append(test_data->bodies, box_body1); + + sh2 = elm_layout_add(test_data->win); + elm_layout_file_set( + sh2, PACKAGE_DATA_DIR "/" EPHYSICS_TEST_THEME ".edj", "shadow-cube"); + evas_object_move(sh2, WIDTH / 6 + 60, FLOOR_Y); + evas_object_resize(sh2, 70, 3); + evas_object_show(sh2); + test_data->evas_objs = eina_list_append(test_data->evas_objs, sh2); + + box2 = elm_image_add(test_data->win); + elm_image_file_set( + box2, PACKAGE_DATA_DIR "/" EPHYSICS_TEST_THEME ".edj", "purple-cube"); + evas_object_move(box2, WIDTH / 6 + 60, HEIGHT / 8); + evas_object_resize(box2, 70, 70); + evas_object_show(box2); + test_data->evas_objs = eina_list_append(test_data->evas_objs, box2); + + box_body2 = ephysics_body_box_add(test_data->world); + ephysics_body_evas_object_set(box_body2, box2, EINA_TRUE); + ephysics_body_event_callback_add(box_body2, EPHYSICS_CALLBACK_BODY_UPDATE, + update_object_cb, sh2); + ephysics_body_restitution_set(box_body2, 0.5); + ephysics_body_friction_set(box_body2, 0.1); + test_data->bodies = eina_list_append(test_data->bodies, box_body2); +} + +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_rotate(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, "Rotate", 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, 3); + + _world_populate(test_data); +} diff --git a/legacy/ephysics/src/lib/EPhysics.h b/legacy/ephysics/src/lib/EPhysics.h new file mode 100644 index 0000000000..62574544c7 --- /dev/null +++ b/legacy/ephysics/src/lib/EPhysics.h @@ -0,0 +1,1230 @@ +#ifndef EPHYSICS_H +#define EPHYSICS_H + +/** + * @mainpage EPhysics Library Documentation + * + * @version 0.1.0 + * @date 2012 + * + * @section intro What is EPhysics ? + * + * 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). + * + * @image html diagram_ephysics.png + * + * For a better reference, check the following groups: + * @li @ref EPhysics + * @li @ref EPhysics_World + * @li @ref EPhysics_Body + * @li @ref EPhysics_Camera + * @li @ref EPhysics_Constraint + * + * Please see the @ref authors page for contact details. + */ + +/** + * + * @page authors Authors + * + * @author Bruno Dilly + * @author Leandro Dorileo + * + * Please contact to get in + * contact with the developers and maintainers. + * + */ + +#include + +#ifdef EAPI +# undef EAPI +#endif + +#ifdef _WIN32 +# ifdef EFL_EPHYSICS_BUILD +# ifdef DLL_EXPORT +# define EAPI __declspec(dllexport) +# else +# define EAPI +# endif /* ! DLL_EXPORT */ +# else +# define EAPI __declspec(dllimport) +# endif /* ! EFL_EPHYSICS_BUILD */ +#else +# ifdef __GNUC__ +# if __GNUC__ >= 4 +# define EAPI __attribute__ ((visibility("default"))) +# else +# define EAPI +# endif +# else +# define EAPI +# endif +#endif /* ! _WIN32 */ + +#ifdef __cplusplus +extern "C" { +#endif + +#define EPHYSICS_VERSION_MAJOR 0 +#define EPHYSICS_VERSION_MINOR 1 + +/** + * @file + * @brief These routines are used for EPhysics library interaction. + */ + +/** + * @brief How to initialize EPhysics. + * @defgroup EPhysics Top Level API available to add physics effects. + * + * @{ + * + * See @ref EPhysics and @ref EPhysics_World for details about + * these interfaces. + * + */ + +/** + * @enum _EPhysics_Callback_Type + * @typedef EPhysics_Callback_Type + * + * Identifier of callbacks to be set for EPhysics bodies and worlds. + * + * @see ephysics_body_event_callback_add() + * @see ephysics_world_event_callback_add() + * + * @ingroup EPhysics + */ +typedef enum _EPhysics_Callback_Type +{ + /* + * The following events are only for use with EPhysics world objects, with + * ephysics_world_event_callback_add(): + */ + EPHYSICS_CALLBACK_WORLD_FIRST, /**< kept as sentinel, not really an event */ + EPHYSICS_CALLBACK_WORLD_DEL, /**< World being deleted (called before free) */ + EPHYSICS_CALLBACK_WORLD_STOPPED, /**< no objects are moving any more */ + EPHYSICS_CALLBACK_WORLD_LAST, /**< kept as sentinel, not really an event */ + + /* + * The following events are only for use with EPhysics body objects, with + * ephysics_body_event_callback_add(): + */ + EPHYSICS_CALLBACK_BODY_FIRST, /**< kept as sentinel, not really an event */ + EPHYSICS_CALLBACK_BODY_UPDATE, /**< Body being updated */ + EPHYSICS_CALLBACK_BODY_COLLISION, /**< Body collided with other body */ + EPHYSICS_CALLBACK_BODY_DEL, /**< Body being deleted (called before free) */ + EPHYSICS_CALLBACK_BODY_STOPPED, /**< Body is not moving any more */ + EPHYSICS_CALLBACK_BODY_LAST, /**< kept as sentinel, not really an event */ + + EPHYSICS_CALLBACK_LAST /**< kept as sentinel, not really an event */ +} EPhysics_Callback_Type; /**< The types of events triggering a callback */ + +/** + * Initialize EPhysics + * + * Initializes Bullet physics engine. + * + * @return The init counter value. + * + * @see ephysics_shutdown(). + * + * @ingroup EPhysics + */ +EAPI int ephysics_init(void); + +/** + * Shutdown EPhysics + * + * Shutdown Bullet physics engine. If init count reaches 0, all the existing + * worlds will be deleted, and consequently all the bodies. + * + * @return Ephysics' init counter value. + * + * @see ephysics_init(). + * + * @ingroup EPhysics + */ +EAPI int ephysics_shutdown(void); + +/** + * @} + */ + +/** + * @defgroup EPhysics_Camera EPhysics Camera + * @ingroup EPhysics + * + * @{ + * + * A camera defines the region of the physics world that will be rendered + * on the canvas. It sets the point of view. + * + * Every world has a camera, that can be get with ephysics_world_camera_get(). + * Its position can be set with ephysics_camera_position_set() and zoom + * in / zoom out can be done with ephysics_camera_zoom_set(). + * + * @note WIP: IT'S NOT WORKING YET!! + */ + +typedef struct _EPhysics_Camera EPhysics_Camera; /**< Camera handle, used to zoom in / out a scene, or change the frame position to be rendered. Every world have a camera that can be get with ephysics_world_camera_get(). */ + +/** + * @brief + * Set camera's position. + * + * Camera's position referes to the position of the top-left point of the + * camera. + * + * By default a camera is created to map the first quadrant of physics + * world from the point (0, 0) to + * (canvas width / world rate, canvas height / world rate). + * + * It can be modified passing another top-left point position, so another + * region of the physics world will be rendered on the canvas. + * + * @note This change will be noticed on the next physics tick, so evas objects + * will be updated taking the camera's new position in account. + * + * @param camera The camera to be positioned. + * @param x The new position on x axis, in pixels. + * @param y The new position on y axis, in pixels. + * + * @see ephysics_camera_position_get(). + * @see ephysics_world_camera_get(). + * @see ephysics_world_rate_get(). + * + * @ingroup EPhysics_Camera + */ +EAPI void ephysics_camera_position_set(EPhysics_Camera *camera, double x, double y); + +/** + * @brief + * Get camera's position. + * + * @param camera The world's camera. + * @param x Position on x axis, in pixels. + * @param y Position on y axis, in pixels. + * + * @see ephysics_camera_position_set() for more details. + * + * @ingroup EPhysics_Camera + */ +EAPI void ephysics_camera_position_get(const EPhysics_Camera *camera, double *x, double *y); + +/** + * @brief + * Set camera's zoom. + * + * Zoom affects size and position of evas objects automatically updated + * by ephysics. With zoom equal to 1, the original size of evas objects is + * used and their position on canvas depends only on world rate and + * camera's position. + * + * When zoom is smaller than 1, evas objects will be scaled down, and position + * will take world rate, camera's position and zoom in account. More objects + * could fit on the screen with small zoom values. + * + * If zoom is bigger than 1, evas objects will be scaled up, and position + * will take world rate, camera's position and zoom in account. Less objects + * will fit on the screen with big zoom values. It's nice for close-up + * effects. + * + * By default zoom value is 1. + * + * @note This change will be noticed on the next physics tick, so evas objects + * will be updated taking the camera's new zoom in account. + * + * @param camera The camera to be zoomed in / out. + * @param zoom The new zoom value. Must to be bigger than 0. + * + * @see ephysics_camera_zoom_get(). + * + * @ingroup EPhysics_Camera + */ +EAPI void ephysics_camera_zoom_set(EPhysics_Camera *camera, double zoom); + +/** + * @brief + * Get camera's zoom. + * + * @param camera The world's camera. + * @return The zoom value or -1 on error. + * + * @see ephysics_camera_zoom_set() for more details. + * + * @ingroup EPhysics_Camera + */ +EAPI double ephysics_camera_zoom_get(const EPhysics_Camera *camera); + +/** + * @} + */ + + +/** + * @defgroup EPhysics_World EPhysics World + * @ingroup EPhysics + * + * @{ + * + * A world is required to simulate physics between bodies. + * It will setup collision configuration, constraint solver, the + * broadphase interface and a dispatcher to dispatch calculations + * for overlapping pairs. + * + * A new world can be created with ephysics_world_new() and deleted with + * ephysics_world_del(). It can have its gravity changed with + * ephysics_world_gravity_set() and play / paused with + * ephysics_world_running_set(). When running, the simulation will be gradually + * stepped. + */ + +typedef struct _EPhysics_World EPhysics_World; /**< World handle, most basic type of EPhysics. Created with ephysics_world_new() and deleted with ephysics_world_del(). */ + +/** + * @typedef EPhysics_World_Event_Cb + * + * EPhysics world event callback function signature. + * + * Callbacks can be registered for events like world deleting. + * + * @param data User data that will be set when registering the callback. + * @param world Physics world. + * @param event_info Data specific to a kind of event. Some types of events + * don't have @p event_info. + * + * @see ephysics_world_event_callback_add() for more info. + * + * @ingroup EPhysics_World + */ +typedef void (*EPhysics_World_Event_Cb)(void *data, EPhysics_World *world, void *event_info); + +/** + * @brief + * Create a new physics world. + * + * A new world will be created with set collision configuration, + * constraint solver, broadphase interface and dispatcher. + * + * It can be paused / unpaused with ephysics_world_running_set() and its + * gravity can be changed with ephysics_world_gravity_set(). + * + * By default it starts with gravity y = -9.81 and playing. + * + * If default updates between physics bodies and evas objects will be used + * it's mandatory to set the size of the area to be rendered with + * ephysics_world_geometry_size_set(). + * + * @return A new world or @c NULL, on errors. + * + * @see ephysics_world_del(). + * + * @ingroup EPhysics_World + */ +EAPI EPhysics_World *ephysics_world_new(void); + +/** + * @brief + * Set dimensions of rendered area to be take on account by default updates. + * + * By default it starts with null x, y, width and height. + * + * The physics world won't be limited, but boundaries can be added with: + * @li ephysics_world_top_boundary_add(), + * @li ephysics_world_bottom_boundary_add(), + * @li ephysics_world_left_boundary_add(), + * @li ephysics_world_right_boundary_add(). + * + * @param world the world to be configured. + * @param x Coordinate x of the top left point of rendered area, in pixels. + * @param y Coordinate y of the top left point of rendered area, in pixels. + * @param w rendered area width, in pixels. + * @param h rendered area height, in pixels. + * + * @see ephysics_body_event_callback_add() for more info. + * @see ephysics_world_rate_get(). + * @see ephysics_world_render_geometry_get(). + * + * @ingroup EPhysics_World + */ +EAPI void ephysics_world_render_geometry_set(EPhysics_World *world, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h); + +/** + * @brief + * Get dimensions of rendered area to be take on account by default updates. + * + * @param world the world to be configured. + * @param x Coordinate x of the top left point of rendered area, in pixels. + * @param y Coordinate y of the top left point of rendered area, in pixels. + * @param w rendered area width, in pixels. + * @param h rendered area height, in pixels. + * + * @see ephysics_world_render_geometry_set() for more information. + * + * @ingroup EPhysics_World + */ +EAPI void ephysics_world_render_geometry_get(EPhysics_World *world, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h); + +/** + * @brief + * Serializes the @p world to @p path. + * + * Save the dynamics world to a binary dump, a .bullet file. + * + * @note Should be used only for debugging purporses. + * + * @param world the world to be serialized. + * @param path where the serialized world should be written to. + * + * @return EINA_TRUE on success, EINA_FALSE otherwise + * + * @ingroup EPhysics_World + */ +EAPI Eina_Bool ephysics_world_serialize(const EPhysics_World *world, const char *path); + +/** + * @brief + * Deletes a physics world. + * + * It will also delete all bodies associated to it. + * + * @param world The world to be deleted. + * + * @see ephysics_world_new() for more details. + * + * @ingroup EPhysics_World + */ +EAPI void ephysics_world_del(EPhysics_World *world); + +/** + * @brief + * Set running status of world. + * + * A world can be played / paused. When running, it will simulate the + * physics step by step. When paused, it will stop simulation. Consequently + * all the registered callbacks won't be called since no event will ocurr + * (no collisions, no object updates). + * + * When a world is created it starts running. + * + * @see ephysics_world_running_get() + * + * @ingroup EPhysics_World + */ +EAPI void ephysics_world_running_set(EPhysics_World *world, Eina_Bool running); + +/** + * @brief + * Get running status of world. + * + * By default a world starts running. + * + * @see ephysics_world_running_set() for more details. + * + * @ingroup EPhysics_World + */ +EAPI Eina_Bool ephysics_world_running_get(const EPhysics_World *world); + +/** + * @brief + * Set world gravity in 2 axises (x, y). + * + * Gravity will act over bodies with mass over all the time. + * + * By default values are 0, -9.81. + * + * @param world The world object. + * @param gx Gravity on x axis. + * @param gy Gravity on y axis. + * + * @see ephysics_world_gravity_get(). + * + * @ingroup EPhysics_World + */ +EAPI void ephysics_world_gravity_set(EPhysics_World *world, double gx, double gy); + +/** + * @brief + * Get world gravity values for axis x and y. + * + * @param world The world object. + * @param gx Gravity on x axis. + * @param gy Gravity on y axis. + * + * @see ephysics_world_gravity_set(). + * + * @ingroup EPhysics_World + */ +EAPI void ephysics_world_gravity_get(const EPhysics_World *world, double *gx, double *gy); + +/** + * @brief + * Set rate between pixels on evas canvas and meters on ephysics world. + * + * It will be used by automatic updates of evas objects associated to + * physics bodies. + * + * By default its value is 20 pixel per meter. + * + * @param world The world object. + * @param rate Rate between pixels and meters. Value must be > 0. + * + * @see ephysics_body_event_callback_add() for more info. + * @see ephysics_world_rate_get(). + * + * @ingroup EPhysics_World + */ +EAPI void ephysics_world_rate_set(EPhysics_World *world, double rate); + +/** + * @brief + * Get rate between pixels on evas canvas and meters on ephysics world. + * + * @param world The world object. + * @return The rate between pixels and meters. + * + * @see ephysics_world_rate_set() for details. + * + * @ingroup EPhysics_World + */ +EAPI double ephysics_world_rate_get(const EPhysics_World *world); + +/** + * @brief + * Gets the world's bodies list. + * + * @param world The world object. + * @return The list of bodies that belongs to this @p world. + * + * @see ephysics_body_circle_add(). + * @see ephysics_body_box_add(). + * @see ephysics_body_del(). + * + * @ingroup EPhysics_World + */ +EAPI const Eina_List *ephysics_world_bodies_get(const EPhysics_World *world); + +/** + * @brief + * Get the camera used by an ephysics world. + * + * @param world The world object. + * @return The camera. + * + * @see ephysics_camera_position_set(). + * @see ephysics_camera_zoom_set(). + * + * @ingroup EPhysics_World + */ +EAPI EPhysics_Camera *ephysics_world_camera_get(const EPhysics_World *world); + +/** + * @brief + * Register a callback to a type of physics world event. + * + * The registered callback will receives the world and extra user data that + * can be passed. + * + * Regarding EPHYSICS_CALLBACK_WORLD_DEL: + * + * Registered callbacks will be called before world is freed. + * No event_info is passed. + * + * @param world The physics world. + * @param type Type of callback to be listened by @p func. + * @param func Callback function that will be called when event occurs. + * @param data User data that will be passed to callback function. It won't + * be used by ephysics in any way. + * + * @ingroup EPhysics_World + */ +EAPI void ephysics_world_event_callback_add(EPhysics_World *world, EPhysics_Callback_Type type, EPhysics_World_Event_Cb func, const void *data); + +/** + * @brief + * Unregister an ephysics world event callback. + * + * A previously added callback that match @p world, @p type and @p func + * will be deleted. + * + * @param world The physics world. + * @param type The type of callback to be unregistered. + * @param func The callback function to be unregistered. + * @return The user data passed when the callback was registered, or @c NULL + * on error. + * + * @see ephysics_world_event_callback_add() for details. + * + * @ingroup EPhysics_World + */ +EAPI void *ephysics_world_event_callback_del(EPhysics_World *world, EPhysics_Callback_Type type, EPhysics_World_Event_Cb func); + +/** + * @} + */ + +/** + * @defgroup EPhysics_Body EPhysics Body + * @ingroup EPhysics + * + * @{ + * + * A body is a representation of an object inside a physics world. + * + * Bodies can have different shapes that can be created with: + * @li ephysics_body_circle_add(); + * @li or ephysics_body_box_add(). + * + * They can collide and have customizable properties, like: + * @li mass, set with ephysics_body_mass_set(); + * @li coefficient of restitution, set with ephysics_body_restitution_set(); + * @li and friction, set with ephysics_body_friction_set(). + * + * Bodies can have its position and size directly set by + * ephysics_body_geometry_set(). + * + * Also, they can have an associated evas object, done with + * ephysics_body_evas_object_set() function, being responsible for updating + * its position and rotation, or letting a user callback be set + * for this task with ephysics_body_event_callback_add(). + * + * Also, bodies can have impulses applied over them, and will be affected + * by gravity. Impulses can be applied with: + * @li ephysics_body_central_impulse_apply(); + * @li ephysics_body_torque_impulse_apply(). + * + * Bodies can be removed from the world being directly deleted with + * ephysics_body_del() or when the world is deleted, case when all the + * bodies belonging to it will be deleted as well. Evas objects associated + * to these bodies won't be affected in any way, but they will stop being + * moved or rotated. + */ + +typedef struct _EPhysics_Body EPhysics_Body; /**< Body handle, represents an object on EPhysics world. Created with ephysics_body_circle_add() or ephysics_body_box_add() and deleted with ephysics_body_del(). */ + +/** + * @typedef EPhysics_Body_Event_Cb + * + * EPhysics bode event callback function signature. + * + * Callbacks can be registered for events like body updating or deleting. + * + * @param data User data that will be set when registering the callback. + * @param body Physics body. + * @param event_info Data specific to a kind of event. Some types of events + * don't have @p event_info. + * + * @see ephysics_body_event_callback_add() for more info. + * + * @ingroup EPhysics_Body + */ +typedef void (*EPhysics_Body_Event_Cb)(void *data, EPhysics_Body *body, void *event_info); + +/** + * @brief + * Create a new circle physics body. + * + * Its collision shape will be a circle of diameter 1. To change it's size + * ephysics_body_geometry_set() should be used, so it can be deformed + * on x and y axises. + * Any evas object can be associated to it with ephysics_body_evas_object_set(), + * and it will collide as a circle (even if you have an evas rectangle). + * + * Actually, since we're using a 3D backend, it will be a cylinder on + * z axis. + * + * @param world The world this body will belongs to. + * @return a new body or @c NULL, on errors. + * + * @see ephysics_body_del(). + * + * @ingroup EPhysics_Body + */ +EAPI EPhysics_Body *ephysics_body_circle_add(EPhysics_World *world); + +/** + * @brief + * Create a new box physics body. + * + * Its collision shape will be a box of dimensions 1 on all the axises. + * To change it's size ephysics_body_geometry_set() should be used, + * so it can be deformed on x and y axises. + * + * @param world The world this body will belongs to. + * @return a new body or @c NULL, on errors. + * + * @see ephysics_body_del(). + * @see ephysics_body_evas_object_set(). + * + * @ingroup EPhysics_Body + */ +EAPI EPhysics_Body *ephysics_body_box_add(EPhysics_World *world); + +/** + * @brief + * Create a physic top boundary. + * + * A physic top boundary will limit the bodies area and placed on top edge of + * worlds render geometry - defined with ephysics_world_render_geometry_set(). + * + * @param world The world this body will belong to. + * @return a new body or @c NULL, on erros. + * @see ephysics_world_render_geometry_set() + * + * @ingroup EPhysics_Body + */ +EAPI EPhysics_Body *ephysics_body_top_boundary_add(EPhysics_World *world); + +/** + * @brief + * Create a physic bottom boundary. + * + * A physic bottom boundary will limit the bodies area and placed on bottom + * edge of worlds render geometry - defined with + * ephysics_world_render_geometry_set(). + * + * @param world The world this body will belong to. + * @return a new body or @c NULL, on erros. + * @see ephysics_world_render_geometry_set() + * + * @ingroup EPhysics_Body + */ +EAPI EPhysics_Body *ephysics_body_bottom_boundary_add(EPhysics_World *world); + +/** + * @brief + * Create a physic left boundary. + * + * A physic left boundary will limit the bodies area and placed right o the + * left edge of worlds render geometry - defined with + * ephysics_world_render_geometry_set(). + * + * @param world The world this body will belong to. + * @return a new body or @c NULL, on erros. + * @see ephysics_world_render_geometry_set() + * + * @ingroup EPhysics_Body + */ +EAPI EPhysics_Body *ephysics_body_left_boundary_add(EPhysics_World *world); + +/** + * @brief + * Create a physic right boundary. + * + * A physic right boundary will limit the bodies area and placed right o the + * right edge of worlds render geometry - defined with + * ephysics_world_render_geometry_set(). + * + * @param world The world this body will belong to. + * @return a new body or @c NULL, on erros. + * @see ephysics_world_render_geometry_set() + * + * @ingroup EPhysics_Body + */ +EAPI EPhysics_Body *ephysics_body_right_boundary_add(EPhysics_World *world); + +/** + * @brief + * Delete a physics body. + * + * This function will remove this body from its world and will + * free all the memory used. It won't delete or modify an associated evas + * object, what can be done with ephysics_body_evas_object_set(). So after + * it is removed the evas object will stop being updated, but will continue + * to be rendered on canvas. + * + * @param body The body to be deleted. + * + * @see ephysics_body_box_add(). + * @see ephysics_body_circle_add(). + * + * @ingroup EPhysics_Body + */ +EAPI void ephysics_body_del(EPhysics_Body *body); + +/** + * @brief + * Get the world a body belongs to. + * + * It will return the world where the body was added to. + * + * @param body The physics body. + * @return The world, or @c NULL on error. + * + * @ingroup EPhysics_Body + */ +EAPI EPhysics_World *ephysics_body_world_get(const EPhysics_Body *body); + +/** + * @brief + * Set an evas object to a physics body. + * + * It will create a direct association between a physics body and an + * evas object. With that EPhysics will be able to update evas object + * position and rotation automatically. + * + * This association should be 1:1. You can have physics bodies without evas + * objects, but you can't have more than an evas object directly associated + * to this body. If you want more, you can use + * ephysics_body_event_callback_add() to register a callback that + * will update the other evas objects. This function can be used to disable + * updates of associated evas objects, or complement updates, like changing + * evas objects properties under certain conditions of position or rotation. + * + * @note The unit used for positions or sizes on EPhysics is meter. + * + * @param body The body to associate to an evas object. + * @param evas_obj The evas object that will be associated to this @p body. + * @param use_obj_pos If @c EINA_TRUE it will set the physics body position + * to match evas object position taking world rate on consideration. + * + * @see ephysics_body_box_add(). + * @see ephysics_body_circle_add(). + * @see ephysics_body_evas_object_unset(). + * @see ephysics_world_rate_set(). + * + * @ingroup EPhysics_Body + */ +EAPI void ephysics_body_evas_object_set(EPhysics_Body *body, Evas_Object *evas_obj, Eina_Bool use_obj_pos); + +/** + * @brief + * Unset the evas object associated to a physics body. + * + * @param body The body to unset an evas object from. + * @return The associated evas object, or @c NULL if no object is associated + * or on error. + * + * @see ephysics_body_evas_object_set() for more details. + * + * @ingroup EPhysics_Body + */ +EAPI Evas_Object *ephysics_body_evas_object_unset(EPhysics_Body *body); + +/** + * @brief + * Get the evas object associated to a physics body. + * + * @param body The body to get an evas object from. + * @return The associated evas object, or @c NULL if no object is associated + * or on error. + * + * @see ephysics_body_evas_object_set() for more details. + * + * @ingroup EPhysics_Body + */ +EAPI Evas_Object *ephysics_body_evas_object_get(const EPhysics_Body *body); + +/** + * @brief + * Set physics body geometry. + * + * All the physics bodies are created centered on origin (0, 0) and with + * canonical dimensions. Circles have diameter 1, boxes have dimensions 1 + * on all the axises. + * + * There are two direct ways of modifying this geometry: + * @li With ephysics_body_geometry_set(); + * @li When associating an evas object with ephysics_body_evas_object_set(). + * + * When the world is simulated forces will be applied on objects + * with mass and position will be modified too. + * + * @note The unit used for geometry is Evas coordinates. + * + * @param body The body to be positioned. + * @param x The position on axis x, in pixels. + * @param y The position on axis y, in pixels. + * @param w The body width, in pixels. + * @param h The body height, in pixels. + * + * @see ephysics_body_geometry_get(). + * + * @ingroup EPhysics_Body + */ +EAPI void ephysics_body_geometry_set(EPhysics_Body *body, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h); + +/** + * @brief + * Get physics body position. + * + * @param body The physics body. + * @param x The position on axis x, in pixels. + * @param y The position on axis y, in pixels. + * @param w The body width, in pixels. + * @param h The body height, in pixels. + * + * @see ephysics_body_geometry_set() for more details. + * + * @ingroup EPhysics_Body + */ +EAPI void ephysics_body_geometry_get(const EPhysics_Body *body, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h); + +/** + * @brief + * Set body's mass. + * + * It will set inertial mass of the body. It is a quantitative measure of + * an object's resistance to the change of its speed. It's required to apply + * more force on objects with more mass to increase its speed. + * + * @note The unit used for mass is kilograms. + * + * @param body The body to has its mass set. + * @param mass The @p body's mass, in kilograms. + * + * @see ephysics_body_mass_get(). + * + * @ingroup EPhysics_Body + */ +EAPI void ephysics_body_mass_set(EPhysics_Body *body, double mass); + +/** + * @brief + * Get body's mass. + * + * It will get inertial mass of the body. + * + * @param body The physics body. + * @return the @p body mass, in kilograms. + * + * @see ephysics_body_mass_set() for details. + * + * @ingroup EPhysics_Body + */ +EAPI double ephysics_body_mass_get(const EPhysics_Body *body); + +/** + * @brief + * Update the evas object associated to the body. + * + * This function should be called to update position and rotation of + * the evas object associated to the body with ephysics_body_evas_object_set(). + * It will take rate between pixels and meters set with + * ephysics_world_rate_set() in account. + * + * If an update callback wasn't set with + * ephysics_body_event_callback_add(), this function will be executed + * after each physics simulation tick. If a callback was set, it won't be + * called automatically. So inside this callback it could be called, or + * a customized update could be implemented. + * + * @see ephysics_body_event_callback_add() for more details. + * + * @ingroup EPhysics_Body + */ +EAPI void ephysics_body_evas_object_update(EPhysics_Body *body); + +/** + * @brief + * Register a callback to a type of physics body event. + * + * The registered callback will receives the body and extra user data that + * can be passed. From body it's possible to get the world it belongs to + * with ephysics_body_world_get(), the rate between pixels and meters + * with ephysics_world_rate_get() and the associated evas object with + * ephysics_body_evas_object_get(). + * + * So it's enough to do customized updates or fix pointers in your program. + * + * Regarding EPHYSICS_CALLBACK_BODY_DEL: + * + * Registered callbacks will be called before body is freed. + * No event_info is passed. + * + * Regarding EPHYSICS_CALLBACK_BODY_UPDATE: + * + * This update event happens after each physics world tick. Its main use + * could be updating the evas object associated to a physics body. + * + * If no callback is registered, the evas object associated to physics body + * will be automatically moved and rotated, taking rate between meters and + * pixels on account. This rate is set by ephysics_world_rate_set(). + * + * If callbacks are registered, these function will be called and will + * be responsible for updating the evas object. If the default update + * is wanted, function ephysics_body_evas_object_update() can be called + * inside the callback. So you could make changes before and after + * the evas object is updated. + * + * A callback could be something like this: + * @code + * static void + * _update_cb(void *data, EPhysics_Body *body, void *event_info) + * { + * // Something you want to do before updating the evas object + * ephysics_body_evas_object_update(body); + * // Something to be done after the update, like checking the new position + * // of the evas object to change a property. + * } + * + * ephysics_body_event_callback_add(body, EPHYSICS_CALLBACK_BODY_UPDATE, + * _update_cb, NULL); + * @endcode + * + * Update callbacks receives evas object set to body as event_info argument. + * + * Regarding EPHYSICS_CALLBACK_BODY_COLLISION: + * + * Callbacks are called just after the collision has been actually processed + * by the physics engine. + * + * The other body involved in the collision is passed as event_info argument. + * + * @param body The physics body. + * @param type Type of callback to be listened by @p func. + * @param func Callback function that will be called when event occurs. + * @param data User data that will be passed to callback function. It won't + * be used by ephysics in any way. + * + * @ingroup EPhysics_Body + */ +EAPI void ephysics_body_event_callback_add(EPhysics_Body *body, EPhysics_Callback_Type type, EPhysics_Body_Event_Cb func, const void *data); + +/** + * @brief + * Unregister an ephysics body event callback. + * + * A previously added callback that match @p body, @p type and @p func + * will be deleted. + * + * @param body The physics body. + * @param type The type of callback to be unregistered. + * @param func The callback function to be unregistered. + * @return The user data passed when the callback was registered, or @c NULL + * on error. + * + * @see ephysics_body_event_callback_add() for details. + * + * @ingroup EPhysics_Body + */ +EAPI void *ephysics_body_event_callback_del(EPhysics_Body *body, EPhysics_Callback_Type type, EPhysics_Body_Event_Cb func); + +/** + * @brief + * Set body's coefficient of restitution. + * + * The coefficient of restitution is proporcion between speed after and + * before a collision: + * COR = relative speed after collision / relative speed before collision + * + * The body COR is the coefficient of restitution with respect to a perfectly + * rigid and elastic object. Bodies will collide between them with different + * behaviors depending on COR: + * @li they will elastically collide for COR == 1; + * @li they will inelastically collide for 0 < COR < 1; + * @li they will completelly stop (no bouncing at all) for COR == 0. + * + * By default restitution coefficient of each body is 0. + * + * @param body The body to has its restitution coefficient set. + * @param restitution The new @p body's restitution coefficient. + * + * @see ephysics_body_restitution_get(). + * + * @ingroup EPhysics_Body + */ +EAPI void ephysics_body_restitution_set(EPhysics_Body *body, double restitution); + +/** + * @brief + * Get body's restitution. + * + * @param body The physics body. + * @return the @p body's restitution value. + * + * @see ephysics_body_restitution_set() for details. + * + * @ingroup EPhysics_Body + */ +EAPI double ephysics_body_restitution_get(const EPhysics_Body *body); + +/** + * @brief + * Set body's friction. + * + * Friction is used to make objects slide along each other realistically. + * + * The friction parameter is usually set between 0 and 1, but can be any + * non-negative value. A friction value of 0 turns off friction and a value + * of 1 makes the friction strong. + * + * By default friction value is 0.5 and simulation results will be better + * when friction in non-zero. + * + * @param body The body to has its friction set. + * @param friction The new @p body's friction value. + * + * @see ephysics_body_friction_get(). + * + * @ingroup EPhysics_Body + */ +EAPI void ephysics_body_friction_set(EPhysics_Body *body, double friction); + +/** + * @brief + * Get body's friction. + * + * @param body The physics body. + * @return the @p body's friction value. + * + * @see ephysics_body_friction_set() for details. + * + * @ingroup EPhysics_Body + */ +EAPI double ephysics_body_friction_get(const EPhysics_Body *body); + +/** + * @brief + * Apply an impulse on the center of a body. + * + * The impulse is equal to the change of momentum of the body. + * It's the product of the force over the time this force is applied. + * + * When a impulse is applied over a body it will has its velocity changed. + * This impulse will be applied on body's center, so it won't implies in + * rotating the body. For that is possible to apply a torque impulse with + * ephysics_body_torque_impulse_apply(). + * + * @note Impulse is measured in Ns (Newton seconds). + * + * @param body The physics body that will receive the impulse. + * @param x The axis x component of impulse. + * @param y The axis y component of impulse. + * + * @ingroup EPhysics_Body + */ +EAPI void ephysics_body_central_impulse_apply(EPhysics_Body *body, double x, double y); + +/** + * @brief + * Apply a torque impulse over a body. + * + * An impulse will be applied over the body to make it rotate around Z axis. + * + * @param body The physics body that will receive the impulse. + * @param roll Impulse to rotate body around Z axis (rotate on x - y plane). + * Negative values will impulse body on anti clock rotation. + * + * @see ephysics_body_central_impulse_apply(). + * + * @ingroup EPhysics_Body + */ +EAPI void ephysics_body_torque_impulse_apply(EPhysics_Body *body, double roll); + +/** + * @brief + * Enable or disable body's rotation on z axis. + * + * Enabled by default. + * + * If disabled, body won't rotate on x-y plane. + * + * @param body The physics body. + * @param enable If @c EINA_TRUE enable rotation on z axis, if @c EINA_FALSE + * disable it. + * + * @see ephysics_body_rotation_on_z_axis_enable_get(). + * + * @ingroup EPhysics_Body + */ +EAPI void ephysics_body_rotation_on_z_axis_enable_set(EPhysics_Body *body, Eina_Bool enable); + +/** + * @brief + * Return body's rotation on z axis state. + * + * @param body The physics body. + * @return @c EINA_TRUE if rotation on z axis is enabled, or @c EINA_FALSE + * if disabled (or on error). + * + * @see ephysics_body_rotation_on_z_axis_enable_set() for more details. + * + * @ingroup EPhysics_Body + */ +EAPI Eina_Bool ephysics_body_rotation_on_z_axis_enable_get(EPhysics_Body *body); + +/** + * @brief + * Return body's rotation on z axis. + * + * By default rotation is 0 degrees. + * + * @note The unit used for rotation is degrees. + * + * @param body The physics body. + * @return The amount of degrees @p body is rotated, from 0.0 to 360.0. + * + * @ingroup EPhysics_Body + */ +EAPI double ephysics_body_rotation_get(EPhysics_Body *body); + +/** + * @} + */ + +/** + * @defgroup EPhysics_Constraint EPhysics Constraint + * @ingroup EPhysics + * + * @{ + * + * Constraints can be used to limit bodies movements, between bodies or + * between bodies and the world. Constraints can limit movement angle, + * translation, or work like a motor. + * + * Constraints can be created with ephysics_constraint_add() and removed with + * ephysics_constraint_del(). Can be applied between two bodies or between + * a body and the world. + */ + +typedef struct _EPhysics_Constraint EPhysics_Constraint; /**< Constraint handle, used to limit bodies movements. Created with ephysics_constraint_add() and deleted with ephysics_constraint_del(). */ + +/** + * @brief + * Create a new constraint between 2 bodies. + * + * The constraint will join two bodies(@p body1 and @p body2) limiting their + * movements based on specified anchors. + * + * @param body1 The first body to apply the constraint. + * @param body2 The second body to apply the constraint. + * @param anchor_b1_x The first body X anchor. + * @param anchor_b1_y The fist body Y anchor. + * @param anchor_b2_x The second body X anchor. + * @param anchor_b2_y The second body Y anchor. + * @return A new constraint or @c NULL, on errors. + * + * @see ephysics_constraint_del(). + * + * @ingroup EPhysics_Constraint + */ +EAPI EPhysics_Constraint *ephysics_constraint_add(EPhysics_Body *body1, EPhysics_Body *body2, Evas_Coord anchor_b1_x, Evas_Coord anchor_b1_y, Evas_Coord anchor_b2_x, Evas_Coord anchor_b2_y); + +/** + * @brief + * Deletes a physics constraint. + * + * @param constraint The constraint to be deleted. + * + * @see ephysics_constraint_add() for more details. + * + * @ingroup EPhysics_Constraint + */ +EAPI void ephysics_constraint_del(EPhysics_Constraint *constraint); + +/** + * @} + */ + + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/legacy/ephysics/src/lib/Makefile.am b/legacy/ephysics/src/lib/Makefile.am new file mode 100644 index 0000000000..89cf011f6c --- /dev/null +++ b/legacy/ephysics/src/lib/Makefile.am @@ -0,0 +1,28 @@ +MAINTAINERCLEANFILES = Makefile.in + +AM_CPPFLAGS = \ +-I. \ +-I$(top_srcdir) \ +-I$(top_srcdir)/src/lib \ +-DPACKAGE_LIB_DIR=\"$(libdir)\" \ +@EVIL_CFLAGS@ \ +@EPHYSICS_CFLAGS@ + +lib_LTLIBRARIES = libephysics.la + +includes_HEADERS = EPhysics.h +includesdir = $(includedir)/ephysics-@VMAJ@ + +base_sources = \ + ephysics_body.cpp \ + ephysics_camera.cpp \ + ephysics_constraints.cpp \ + ephysics_main.cpp \ + ephysics_world.cpp + +libephysics_la_SOURCES = $(base_sources) + +libephysics_la_LIBADD = @EPHYSICS_LIBS@ @EVIL_LIBS@ -lm +libephysics_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -version-info @version_info@ @release_info@ + +EXTRA_DIST = ephysics_private.h diff --git a/legacy/ephysics/src/lib/ephysics_body.cpp b/legacy/ephysics/src/lib/ephysics_body.cpp new file mode 100644 index 0000000000..1a27b3d0b0 --- /dev/null +++ b/legacy/ephysics/src/lib/ephysics_body.cpp @@ -0,0 +1,760 @@ +#ifdef HAVE_CONFIG_H +# include +#endif + +#include + +#include "ephysics_private.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define RAD_TO_DEG 57.29582 /* 2 * pi radians == 360 degree */ + +typedef struct _EPhysics_Body_Callback EPhysics_Body_Callback; + +struct _EPhysics_Body_Callback { + EINA_INLIST; + void (*func) (void *data, EPhysics_Body *body, void *event_info); + void *data; + EPhysics_Callback_Type type; +}; + +struct _EPhysics_Body { + btCollisionShape *collision_shape; + btRigidBody *rigid_body; + Evas_Object *evas_obj; + EPhysics_World *world; + Eina_Inlist *callbacks; + Eina_Bool active:1; +}; + +void +ephysics_body_active_set(EPhysics_Body *body, Eina_Bool active) +{ + EPhysics_Body_Callback *cb; + + if (body->active == !!active) return; + body->active = !!active; + if (active) return; + + EINA_INLIST_FOREACH(body->callbacks, cb) + if (cb->type == EPHYSICS_CALLBACK_BODY_STOPPED) + cb->func(cb->data, body, (void *) body->evas_obj); +} + +static EPhysics_Body * +_ephysics_body_add(EPhysics_World *world, btCollisionShape *collision_shape) +{ + EPhysics_Body *body; + btScalar mass = 1; + + body = (EPhysics_Body *) calloc(1, sizeof(EPhysics_Body)); + if (!body) + { + ERR("Couldn't create a new body instance."); + return NULL; + } + + btDefaultMotionState *motion_state = + new btDefaultMotionState(); + if (!motion_state) + { + ERR("Couldn't create a motion state."); + free(body); + return NULL; + } + + btVector3 inertia(0, 0, 0); + collision_shape->calculateLocalInertia(mass, inertia); + + btRigidBody::btRigidBodyConstructionInfo rigid_body_ci( + mass, motion_state, collision_shape, inertia); + btRigidBody *rigid_body = new btRigidBody(rigid_body_ci); + if (!rigid_body) + { + ERR("Couldn't create a rigid body."); + delete motion_state; + free(body); + return NULL; + } + + body->collision_shape = collision_shape; + body->rigid_body = rigid_body; + body->world = world; + body->rigid_body->setUserPointer(body); + body->rigid_body->setLinearFactor(btVector3(1, 1, 0)); + body->rigid_body->setAngularFactor(btVector3(0, 0, 1)); + + return body; +} + +static void +_ephysics_body_evas_obj_del_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) +{ + EPhysics_Body *body = (EPhysics_Body *) data; + body->evas_obj = NULL; + DBG("Evas object deleted. Updating body: %p", body); +} + +static void +_ephysics_body_del(EPhysics_Body *body) +{ + EPhysics_Body_Callback *cb; + + if (body->evas_obj) + evas_object_event_callback_del(body->evas_obj, EVAS_CALLBACK_DEL, + _ephysics_body_evas_obj_del_cb); + + while (body->callbacks) + { + cb = EINA_INLIST_CONTAINER_GET(body->callbacks, + EPhysics_Body_Callback); + body->callbacks = eina_inlist_remove(body->callbacks, body->callbacks); + free(cb); + } + + delete body->rigid_body->getMotionState(); + delete body->collision_shape; + delete body->rigid_body; + + free(body); +} + +static void +_ephysics_body_geometry_set(EPhysics_Body *body, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h) +{ + double rate, mx, my, sx, sy; + btTransform trans; + int wy, height; + + rate = ephysics_world_rate_get(body->world); + ephysics_world_render_geometry_get(body->world, NULL, &wy, NULL, &height); + height += wy; + + mx = (x + w / 2) / rate; + my = (height - (y + h / 2)) / rate; + sx = w / rate; + sy = h / rate; + + body->rigid_body->getMotionState()->getWorldTransform(trans); + trans.setOrigin(btVector3(mx, my, 0)); + body->rigid_body->proceedToTransform(trans); + + body->collision_shape->setLocalScaling(btVector3(sx, sy, 1)); + + if(!body->rigid_body->isStaticObject()) + ephysics_body_mass_set(body, ephysics_body_mass_get(body)); + + body->rigid_body->getMotionState()->setWorldTransform(trans); + + DBG("Body position changed to %lf, %lf.", mx, my); + DBG("Body scale changed to %lf, %lf.", sx, sy); +} + +static void +_ephysics_body_evas_object_default_update(EPhysics_Body *body) +{ + btTransform trans; + int wy, height, x, y, w, h; + double rate, rot; + Evas_Map *map; + + if (!body->evas_obj) + return; + + body->rigid_body->getMotionState()->getWorldTransform(trans); + ephysics_world_render_geometry_get(body->world, NULL, &wy, NULL, &height); + height += wy; + + evas_object_geometry_get(body->evas_obj, NULL, NULL, &w, &h); + rate = ephysics_world_rate_get(body->world); + x = (int) (trans.getOrigin().getX() * rate) - w / 2; + y = height - (int) (trans.getOrigin().getY() * rate) - h / 2; + + evas_object_move(body->evas_obj, x, y); + + rot = - trans.getRotation().getAngle() * RAD_TO_DEG * + trans.getRotation().getAxis().getZ(); + + map = evas_map_new(4); + evas_map_util_points_populate_from_object(map, body->evas_obj); + evas_map_util_rotate(map, rot, x + (w / 2), y + (h / 2)); + evas_object_map_set(body->evas_obj, map); + evas_object_map_enable_set(body->evas_obj, EINA_TRUE); + evas_map_free(map); +} + +void +ephysics_body_evas_object_update_select(EPhysics_Body *body) +{ + Eina_Bool callback_called = EINA_FALSE; + EPhysics_Body_Callback *cb; + + if (!body) + return; + + EINA_INLIST_FOREACH(body->callbacks, cb) + { + if (cb->type == EPHYSICS_CALLBACK_BODY_UPDATE) { + cb->func(cb->data, body, (void *) body->evas_obj); + callback_called = EINA_TRUE; + } + } + + if (!callback_called) + _ephysics_body_evas_object_default_update(body); +} + +void +ephysics_body_contact_processed(EPhysics_Body *body, EPhysics_Body *contact_body) +{ + EPhysics_Body_Callback *cb; + + if ((!body) || (!contact_body)) + return; + + EINA_INLIST_FOREACH(body->callbacks, cb) + { + if (cb->type == EPHYSICS_CALLBACK_BODY_COLLISION) + cb->func(cb->data, body, (void *) contact_body); + } +} + +btRigidBody * +ephysics_body_rigid_body_get(EPhysics_Body *body) +{ + return body->rigid_body; +} + +EAPI EPhysics_Body * +ephysics_body_circle_add(EPhysics_World *world) +{ + EPhysics_Body *body; + + btCollisionShape *collision_shape = new btCylinderShapeZ( + btVector3(0.5, 0.5, 0.5)); + if (!collision_shape) + { + ERR("Couldn't create a cylinder shape on z."); + return NULL; + } + + body = _ephysics_body_add(world, collision_shape); + if (!body) + { + ERR("Couldn't create a circle body."); + delete collision_shape; + return NULL; + } + + if (!ephysics_world_body_add(body->world, body, body->rigid_body)) + { + ERR("Couldn't add body to world's bodies list"); + _ephysics_body_del(body); + return NULL; + } + + INF("Circle body added."); + return body; +} + +EAPI EPhysics_Body * +ephysics_body_box_add(EPhysics_World *world) +{ + EPhysics_Body *body; + + btCollisionShape *collision_shape = new btBoxShape( + btVector3(0.5, 0.5, 0.5)); + if (!collision_shape) + { + ERR("Couldn't create a 2d box shape."); + return NULL; + } + + body = _ephysics_body_add(world, collision_shape); + if (!body) + { + ERR("Couldn't create a box body."); + delete collision_shape; + return NULL; + } + + if (!ephysics_world_body_add(body->world, body, body->rigid_body)) + { + ERR("Couldn't add body to world's bodies list"); + _ephysics_body_del(body); + return NULL; + } + + INF("Box body added."); + return body; +} + +void +ephysics_body_world_boundaries_resize(EPhysics_World *world) +{ + Evas_Coord x, y, width, height; + EPhysics_Body *bottom, *top, *left, *right; + + ephysics_world_render_geometry_get(world, &x, &y, &width, &height); + + bottom = ephysics_world_boundary_get(world, EPHYSICS_WORLD_BOUNDARY_BOTTOM); + if (bottom) + ephysics_body_geometry_set(bottom, x, y + height, width, 10); + + right = ephysics_world_boundary_get(world, EPHYSICS_WORLD_BOUNDARY_RIGHT); + if (right) + ephysics_body_geometry_set(right, x + width, 0, 10, y + height); + + left = ephysics_world_boundary_get(world, EPHYSICS_WORLD_BOUNDARY_LEFT); + if (left) + ephysics_body_geometry_set(left, x - 10, 0, 10, y + height); + + top = ephysics_world_boundary_get(world, EPHYSICS_WORLD_BOUNDARY_TOP); + if (top) + ephysics_body_geometry_set(top, 0, y - 10, x + width, 10); +} + +static EPhysics_Body * +_ephysics_body_boundary_add(EPhysics_World *world, EPhysics_World_Boundary boundary, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h) +{ + EPhysics_Body *body; + + if (!world) + { + ERR("Can't add boundary, world is null."); + return NULL; + } + + body = ephysics_world_boundary_get(world, boundary); + if (body) + return body; + + body = ephysics_body_box_add(world); + if (!body) + return NULL; + + ephysics_body_mass_set(body, 0); + ephysics_world_boundary_set(world, boundary, body); + ephysics_body_geometry_set(body, x, y, w, h); + + return body; +} + +EAPI EPhysics_Body * +ephysics_body_top_boundary_add(EPhysics_World *world) +{ + Evas_Coord x, y, w; + ephysics_world_render_geometry_get(world, &x, &y, &w, NULL); + return _ephysics_body_boundary_add(world, EPHYSICS_WORLD_BOUNDARY_TOP, + 0, y - 10, x + w, 10); +} + +EAPI EPhysics_Body * +ephysics_body_bottom_boundary_add(EPhysics_World *world) +{ + Evas_Coord x, y, w, h; + ephysics_world_render_geometry_get(world, &x, &y, &w, &h); + return _ephysics_body_boundary_add(world, EPHYSICS_WORLD_BOUNDARY_BOTTOM, + x, y + h, w, 10); +} + +EAPI EPhysics_Body * +ephysics_body_left_boundary_add(EPhysics_World *world) +{ + Evas_Coord x, y, h; + ephysics_world_render_geometry_get(world, &x, &y, NULL, &h); + return _ephysics_body_boundary_add(world, EPHYSICS_WORLD_BOUNDARY_LEFT, + x - 10, 0, 10, y + h); +} + +EAPI EPhysics_Body * +ephysics_body_right_boundary_add(EPhysics_World *world) +{ + Evas_Coord x, y, w, h; + ephysics_world_render_geometry_get(world, &x, &y, &w, &h); + return _ephysics_body_boundary_add(world, EPHYSICS_WORLD_BOUNDARY_RIGHT, + x + w, 0, 10, y + h); +} + +void +ephysics_orphan_body_del(EPhysics_Body *body) +{ + EPhysics_Body_Callback *cb; + + EINA_INLIST_FOREACH(body->callbacks, cb) + { + if (cb->type == EPHYSICS_CALLBACK_BODY_DEL) + cb->func(cb->data, body, NULL); + } + + _ephysics_body_del(body); +} + +EAPI void +ephysics_body_del(EPhysics_Body *body) +{ + if (!body) + { + ERR("Can't delete body, it wasn't provided."); + return; + } + + ephysics_world_body_del(body->world, body, body->rigid_body); + ephysics_orphan_body_del(body); + + INF("Body deleted."); +} + +EAPI void +ephysics_body_evas_object_set(EPhysics_Body *body, Evas_Object *evas_obj, Eina_Bool use_obj_pos) +{ + int obj_x, obj_y, obj_w, obj_h; + + if (!body) + { + ERR("Can't set evas object to body, the last wasn't provided."); + return; + } + + if (!evas_obj) + { + ERR("Can't set evas object to body, the first wasn't provided."); + return; + } + + if (body->evas_obj) + evas_object_event_callback_del(body->evas_obj, EVAS_CALLBACK_DEL, + _ephysics_body_evas_obj_del_cb); + + body->evas_obj = evas_obj; + evas_object_event_callback_add(evas_obj, EVAS_CALLBACK_DEL, + _ephysics_body_evas_obj_del_cb, body); + + if (!use_obj_pos) + return; + + evas_object_geometry_get(body->evas_obj, &obj_x, &obj_y, &obj_w, &obj_h); + _ephysics_body_geometry_set(body, obj_x, obj_y, obj_w, obj_h); +} + +EAPI Evas_Object * +ephysics_body_evas_object_unset(EPhysics_Body *body) +{ + Evas_Object *obj; + if (!body) + { + ERR("Can't unset evas object from body, it wasn't provided."); + return NULL; + } + + obj = body->evas_obj; + body->evas_obj = NULL; + + if (obj) + evas_object_event_callback_del(obj, EVAS_CALLBACK_DEL, + _ephysics_body_evas_obj_del_cb); + + return obj; +} + +EAPI Evas_Object * +ephysics_body_evas_object_get(const EPhysics_Body *body) +{ + if (!body) + { + ERR("Can't get evas object from body, it wasn't provided."); + return NULL; + } + + return body->evas_obj; +} + +EAPI void +ephysics_body_geometry_set(EPhysics_Body *body, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h) +{ + if (!body) + { + ERR("Can't set body position, body is null."); + return; + } + + if ((w <= 0) || (h <= 0)) + { + ERR("Width and height must to be a non-null, positive value."); + return; + } + + _ephysics_body_geometry_set(body, x, y, w, h); +} + +EAPI void +ephysics_body_geometry_get(const EPhysics_Body *body, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h) +{ + btTransform trans; + btVector3 vector; + double rate; + int wy, height; + + if (!body) + { + ERR("Can't get body position, body is null."); + return; + } + + body->rigid_body->getMotionState()->getWorldTransform(trans); + vector = body->collision_shape->getLocalScaling(); + + rate = ephysics_world_rate_get(body->world); + ephysics_world_render_geometry_get(body->world, NULL, &wy, NULL, &height); + height += wy; + + if (x) *x = round((trans.getOrigin().getX() - vector.x() / 2) * rate); + if (y) *y = height - round((trans.getOrigin().getY() + vector.y() / 2) + * rate); + if (w) *w = round(vector.x() * rate); + if (h) *h = round(vector.y() * rate); +} + +EAPI void +ephysics_body_mass_set(EPhysics_Body *body, double mass) +{ + if (!body) + { + ERR("Can't set body mass, body is null."); + return; + } + + btVector3 inertia(0, 0, 0); + body->collision_shape->calculateLocalInertia(mass, inertia); + body->rigid_body->setMassProps(mass, inertia); + body->rigid_body->updateInertiaTensor(); + + DBG("Body mass changed to %lf.", mass); +} + +EAPI double +ephysics_body_mass_get(const EPhysics_Body *body) +{ + if (!body) + { + ERR("Can't get body mass, body is null."); + return 0; + } + + return 1 / body->rigid_body->getInvMass(); +} + +EAPI void +ephysics_body_evas_object_update(EPhysics_Body *body) +{ + if (!body) + { + ERR("Couldn't update a null body."); + return; + } + + _ephysics_body_evas_object_default_update(body); +} + +EAPI void +ephysics_body_event_callback_add(EPhysics_Body *body, EPhysics_Callback_Type type, EPhysics_Body_Event_Cb func, const void *data) +{ + EPhysics_Body_Callback *cb; + + if (!body) + { + ERR("Can't set body event callback, body is null."); + return; + } + + if (!func) + { + ERR("Can't set body event callback, function is null."); + return; + } + + if ((type <= EPHYSICS_CALLBACK_BODY_FIRST) || + (type >= EPHYSICS_CALLBACK_BODY_LAST)) + { + ERR("Can't set body event callback, callback type is wrong."); + return; + } + + cb = (EPhysics_Body_Callback *) malloc(sizeof(EPhysics_Body_Callback)); + if (!cb) + { + ERR("Can't set body event callback, can't create cb instance."); + return; + } + + cb->func = func; + cb->type = type; + cb->data = (void *)data; + + body->callbacks = eina_inlist_append(body->callbacks, EINA_INLIST_GET(cb)); +} + +EAPI void * +ephysics_body_event_callback_del(EPhysics_Body *body, EPhysics_Callback_Type type, EPhysics_Body_Event_Cb func) +{ + EPhysics_Body_Callback *cb; + void *cb_data; + + if (!body) + { + ERR("Can't delete body event callback, body is null."); + return NULL; + } + + EINA_INLIST_FOREACH(body->callbacks, cb) + { + if ((cb->type == type) && (cb->func == func)) { + cb_data = cb->data; + body->callbacks = eina_inlist_remove(body->callbacks, + EINA_INLIST_GET(cb)); + free(cb); + return cb_data; + } + } + + return NULL; +} + +EAPI void +ephysics_body_restitution_set(EPhysics_Body *body, double restitution) +{ + if (!body) + { + ERR("Can't set body restitution, body is null."); + return; + } + + body->rigid_body->setRestitution(btScalar(restitution)); +} + +EAPI double +ephysics_body_restitution_get(const EPhysics_Body *body) +{ + if (!body) + { + ERR("Can't get body restitution, body is null."); + return 0; + } + + return body->rigid_body->getRestitution(); +} + +EAPI void +ephysics_body_friction_set(EPhysics_Body *body, double friction) +{ + if (!body) + { + ERR("Can't set body friction, body is null."); + return; + } + + body->rigid_body->setFriction(btScalar(friction)); +} + +EAPI double +ephysics_body_friction_get(const EPhysics_Body *body) +{ + if (!body) + { + ERR("Can't get body friction, body is null."); + return 0; + } + + return body->rigid_body->getFriction(); +} + +EAPI EPhysics_World * +ephysics_body_world_get(const EPhysics_Body *body) +{ + if (!body) + { + ERR("Can't get the world a null body belongs to."); + return NULL; + } + + return body->world; +} + +EAPI void +ephysics_body_central_impulse_apply(EPhysics_Body *body, double x, double y) +{ + if (!body) + { + ERR("Can't apply impulse to a null body."); + return; + } + + body->rigid_body->activate(1); + body->rigid_body->applyCentralImpulse(btVector3(x, y, 0)); +} + +EAPI void +ephysics_body_torque_impulse_apply(EPhysics_Body *body, double roll) +{ + if (!body) + { + ERR("Can't apply torque impulse to a null body."); + return; + } + + body->rigid_body->activate(1); + body->rigid_body->applyTorqueImpulse(btVector3(0, 0, roll)); +} + +EAPI void +ephysics_body_rotation_on_z_axis_enable_set(EPhysics_Body *body, Eina_Bool enable) +{ + if (!body) + { + ERR("Can't set rotation on a null body."); + return; + } + + if (!enable) + body->rigid_body->setAngularFactor(btVector3(0, 0, 0)); + else + body->rigid_body->setAngularFactor(btVector3(0, 0, 1)); +} + +EAPI Eina_Bool +ephysics_body_rotation_on_z_axis_enable_get(EPhysics_Body *body) +{ + if (!body) + { + ERR("Can't check if rotation is enabled, body is null."); + return EINA_FALSE; + } + + return !!body->rigid_body->getAngularFactor().z(); +} + +EAPI double +ephysics_body_rotation_get(EPhysics_Body *body) +{ + btTransform trans; + double rot; + + if (!body) + { + ERR("Can't get rotation, body is null."); + return 0; + } + + body->rigid_body->getMotionState()->getWorldTransform(trans); + rot = - trans.getRotation().getAngle() * RAD_TO_DEG * + trans.getRotation().getAxis().getZ(); + + return rot; +} + +#ifdef __cplusplus +} +#endif diff --git a/legacy/ephysics/src/lib/ephysics_camera.cpp b/legacy/ephysics/src/lib/ephysics_camera.cpp new file mode 100644 index 0000000000..c92e70bedd --- /dev/null +++ b/legacy/ephysics/src/lib/ephysics_camera.cpp @@ -0,0 +1,109 @@ +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include + +#include "ephysics_private.h" + +#ifdef __cplusplus +extern "C" { +#endif + +struct _EPhysics_Camera { + EPhysics_World *world; + double x, y, zoom; +}; + +EPhysics_Camera * +ephysics_camera_add(EPhysics_World *world) +{ + EPhysics_Camera *camera; + + camera = (EPhysics_Camera *) calloc(1, sizeof(EPhysics_Camera)); + if (!camera) + { + ERR("Couldn't create a new camera instance."); + return NULL; + } + + camera->world = world; + + INF("Camera created."); + return camera; +} + +void +ephysics_camera_del(EPhysics_Camera *camera) +{ + if (!camera) + { + ERR("Can't delete camera, it wasn't provided."); + return; + } + + free(camera); + INF("Camera deleted."); +} + +EAPI void +ephysics_camera_position_set(EPhysics_Camera *camera, double x, double y) +{ + if (!camera) + { + ERR("Can't set camera position, camerar is null."); + return; + } + + camera->x = x; + camera->y = y; +} + +EAPI void +ephysics_camera_position_get(const EPhysics_Camera *camera, double *x, double *y) +{ + if (!camera) + { + ERR("Can't get camera position, camera is null."); + return; + } + + if (x) *x = camera->x; + if (y) *y = camera->y; +} + +EAPI void +ephysics_camera_zoom_set(EPhysics_Camera *camera, double zoom) +{ + if (!camera) + { + ERR("Can't set camera zoom, camera == NULL."); + return; + } + + if (zoom <= 0) + { + ERR("Zoom should be a positive value. Keeping the old value: %lf.", + camera->zoom); + return; + } + + camera->zoom = zoom; +} + +EAPI double +ephysics_camera_zoom_get(const EPhysics_Camera *camera) +{ + if (!camera) + { + ERR("Can't get camera zoom, camera == NULL."); + return -1; + } + + return camera->zoom; +} + +#ifdef __cplusplus +} +#endif diff --git a/legacy/ephysics/src/lib/ephysics_constraints.cpp b/legacy/ephysics/src/lib/ephysics_constraints.cpp new file mode 100644 index 0000000000..125c698864 --- /dev/null +++ b/legacy/ephysics/src/lib/ephysics_constraints.cpp @@ -0,0 +1,89 @@ +#ifdef HAVE_CONFIG_H +# include +#endif + +#include "ephysics_private.h" + +#ifdef __cplusplus +extern "C" { +#endif + +struct _EPhysics_Constraint { + btTypedConstraint *bt_constraint; + EPhysics_World *world; +}; + +EAPI EPhysics_Constraint * +ephysics_constraint_add(EPhysics_Body *body1, EPhysics_Body *body2, Evas_Coord anchor_b1_x, Evas_Coord anchor_b1_y, Evas_Coord anchor_b2_x, Evas_Coord anchor_b2_y) +{ + EPhysics_Constraint *constraint; + int rate; + + if (!body1) + { + ERR("To create a constraint body1 must to be non null."); + return NULL; + } + + if ((body2) && + (ephysics_body_world_get(body1) != ephysics_body_world_get(body2))) + { + ERR("To create a constraint both bodies must to belong to the same" + "world."); + return NULL; + } + + constraint = (EPhysics_Constraint *) calloc(1, sizeof(EPhysics_Constraint)); + if (!constraint) + { + ERR("Couldn't create a new constraint."); + return NULL; + } + + rate = ephysics_world_rate_get(ephysics_body_world_get(body1)); + + if (!body2) + constraint->bt_constraint = new btPoint2PointConstraint( + *ephysics_body_rigid_body_get(body1), + btVector3(anchor_b1_x / rate, anchor_b1_y / rate, 0)); + else + constraint->bt_constraint = new btPoint2PointConstraint( + *ephysics_body_rigid_body_get(body1), + *ephysics_body_rigid_body_get(body2), + btVector3(anchor_b1_x / rate, anchor_b1_y / rate, 0), + btVector3(anchor_b2_x / rate, anchor_b2_y / rate, 0)); + + if (!constraint->bt_constraint) + { + ERR("Failed to create a btConstraint"); + free(constraint); + return NULL; + } + + constraint->world = ephysics_body_world_get(body1); + ephysics_world_constraint_add(constraint->world, constraint->bt_constraint); + + INF("Constraint added."); + return constraint; +} + +EAPI void +ephysics_constraint_del(EPhysics_Constraint *constraint) +{ + if (!constraint) + { + ERR("Can't delete constraint, it wasn't provided."); + return; + } + + ephysics_world_constraint_del(constraint->world, constraint->bt_constraint); + delete constraint->bt_constraint; + free(constraint); + + INF("Constraint deleted."); +} + + +#ifdef __cplusplus +} +#endif diff --git a/legacy/ephysics/src/lib/ephysics_main.cpp b/legacy/ephysics/src/lib/ephysics_main.cpp new file mode 100644 index 0000000000..35680b378f --- /dev/null +++ b/legacy/ephysics/src/lib/ephysics_main.cpp @@ -0,0 +1,58 @@ +#ifdef HAVE_CONFIG_H +# include +#endif + +#include "ephysics_private.h" + +#ifdef __cplusplus +extern "C" { +#endif + +int _ephysics_log_dom = -1; +static int _ephysics_init_count = 0; + +EAPI int +ephysics_init() +{ + if (++_ephysics_init_count != 1) + return _ephysics_init_count; + + _ephysics_log_dom = eina_log_domain_register("ephysics", EPHYSICS_LOG_COLOR); + if (_ephysics_log_dom < 0) + { + EINA_LOG_ERR("Couldn't create a log domain for ephysics"); + return --_ephysics_init_count; + } + + if (!ephysics_world_init()) + { + ERR("Couldn't initialize worlds"); + eina_log_domain_unregister(_ephysics_log_dom); + _ephysics_log_dom = -1; + return --_ephysics_init_count; + } + + INF("EPhysics initialized"); + + return _ephysics_init_count; +} + +EAPI int +ephysics_shutdown() +{ + if (--_ephysics_init_count != 0) + return _ephysics_init_count; + + ephysics_world_shutdown(); + + INF("EPhysics shutdown"); + + eina_log_domain_unregister(_ephysics_log_dom); + _ephysics_log_dom = -1; + + return _ephysics_init_count; +} + +#ifdef __cplusplus +} +#endif diff --git a/legacy/ephysics/src/lib/ephysics_private.h b/legacy/ephysics/src/lib/ephysics_private.h new file mode 100644 index 0000000000..6eba410ad0 --- /dev/null +++ b/legacy/ephysics/src/lib/ephysics_private.h @@ -0,0 +1,79 @@ +#ifndef _EPHYSICS_PRIVATE_H +#define _EPHYSICS_PRIVATE_H + +#ifdef HAVE_EVIL +# include +#endif + +#include +#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_log_dom, __VA_ARGS__) + +#ifdef DBG +# undef DBG +#endif +#define DBG(...) EINA_LOG_DOM_DBG(_ephysics_log_dom, __VA_ARGS__) + +#ifdef INF +# undef INF +#endif +#define INF(...) EINA_LOG_DOM_INFO(_ephysics_log_dom, __VA_ARGS__) + +#ifdef WRN +# undef WRN +#endif +#define WRN(...) EINA_LOG_DOM_WARN(_ephysics_log_dom, __VA_ARGS__) + +#ifdef CRIT +# undef CRIT +#endif +#define CRIT(...) EINA_LOG_DOM_CRIT(_ephysics_log_dom, __VA_ARGS__) + +#ifdef __cplusplus +extern "C" { +#endif + +typedef enum _EPhysics_World_Boundary +{ + EPHYSICS_WORLD_BOUNDARY_TOP, + EPHYSICS_WORLD_BOUNDARY_BOTTOM, + EPHYSICS_WORLD_BOUNDARY_LEFT, + EPHYSICS_WORLD_BOUNDARY_RIGHT, + EPHYSICS_WORLD_BOUNDARY_LAST +} EPhysics_World_Boundary; + +extern int _ephysics_log_dom; + +int ephysics_world_init(void); +int ephysics_world_shutdown(void); +Eina_Bool ephysics_world_body_add(EPhysics_World *world, const EPhysics_Body *body, btRigidBody *rigid_body); +void ephysics_world_body_del(EPhysics_World *world, const EPhysics_Body *body, btRigidBody *rigid_body); +void ephysics_world_constraint_add(EPhysics_World *world, btTypedConstraint *bt_constraint); +void ephysics_world_constraint_del(EPhysics_World *world, btTypedConstraint *bt_constraint); +void ephysics_body_world_boundaries_resize(EPhysics_World *world); +void ephysics_world_boundary_set(EPhysics_World *world, EPhysics_World_Boundary boundary, EPhysics_Body *body); +EPhysics_Body *ephysics_world_boundary_get(const EPhysics_World *world, EPhysics_World_Boundary boundary); + +void ephysics_body_evas_object_update_select(EPhysics_Body *body); +void ephysics_orphan_body_del(EPhysics_Body *body); +void ephysics_body_contact_processed(EPhysics_Body *body, EPhysics_Body *contact_body); +btRigidBody *ephysics_body_rigid_body_get(EPhysics_Body *body); +void ephysics_body_active_set(EPhysics_Body *body, Eina_Bool active); + +EPhysics_Camera *ephysics_camera_add(EPhysics_World *world); +void ephysics_camera_del(EPhysics_Camera *camera); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/legacy/ephysics/src/lib/ephysics_world.cpp b/legacy/ephysics/src/lib/ephysics_world.cpp new file mode 100644 index 0000000000..b70bfba377 --- /dev/null +++ b/legacy/ephysics/src/lib/ephysics_world.cpp @@ -0,0 +1,650 @@ +#ifdef HAVE_CONFIG_H +# include +#endif + +#include "ephysics_private.h" +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct _EPhysics_World_Callback EPhysics_World_Callback; + +struct _EPhysics_World_Callback { + EINA_INLIST; + void (*func) (void *data, EPhysics_World *world, void *event_info); + void *data; + EPhysics_Callback_Type type; +}; + +struct _EPhysics_World { + btBroadphaseInterface* broadphase; + btDefaultCollisionConfiguration* collision; + btCollisionDispatcher* dispatcher; + btSequentialImpulseConstraintSolver* solver; + btDiscreteDynamicsWorld* dynamics_world; + + EPhysics_Body *boundaries[4]; + EPhysics_Camera *camera; + Evas_Coord x, y, w, h; + Eina_Inlist *callbacks; + Eina_List *bodies; + double last_update; + double rate; + Eina_Bool running:1; + Eina_Bool active:1; +}; + +static int _ephysics_world_init_count = 0; +static int _worlds_running = 0; +static Eina_List *_worlds = NULL; +static Ecore_Animator *_anim_simulate = NULL; + +static void +_ephysics_world_tick_cb(btDynamicsWorld *dynamics_world, btScalar timeStep) +{ + EPhysics_World *world; + btCollisionObjectArray objects = dynamics_world->getCollisionObjectArray(); + EPhysics_World_Callback *cb; + Eina_Bool world_active = EINA_FALSE; + + world = (EPhysics_World *) dynamics_world->getWorldUserInfo(); + + DBG("Tick"); + + for (int i = 0; i < objects.size(); i++) + { + EPhysics_Body *body; + btRigidBody *rigid_body = btRigidBody::upcast(objects[i]); + if (!rigid_body) + continue; + + body = (EPhysics_Body *) rigid_body->getUserPointer(); + if (rigid_body->isActive()) + { + ephysics_body_active_set(body, EINA_TRUE); + ephysics_body_evas_object_update_select(body); + world_active = EINA_TRUE; + } + else + ephysics_body_active_set(body, EINA_FALSE); + } + + if (world->active == world_active) return; + world->active = world_active; + if (world_active) return; + + EINA_INLIST_FOREACH(world->callbacks, cb) + if (cb->type == EPHYSICS_CALLBACK_WORLD_STOPPED) + cb->func(cb->data, world, NULL); +} + +static Eina_Bool +_simulate_worlds(void *data) +{ + Eina_List *l, *lworlds = (Eina_List *) data; + double time_now; + void *ldata; + + DBG("Step"); + + EINA_LIST_FOREACH(lworlds, l, ldata) + { + double time_now, delta; + EPhysics_World *world = (EPhysics_World *) ldata; + + if (!world->running) + continue; + + time_now = ecore_time_get(); + delta = time_now - world->last_update; + world->last_update = time_now; + + world->dynamics_world->stepSimulation(delta, 1, 1/40.f); + } + + return EINA_TRUE; +} + +static bool +_ephysics_world_contact_processed_cb(btManifoldPoint &cp, void *b0, void *b1) +{ + btRigidBody *rigid_body_0, *rigid_body_1; + EPhysics_Body *body_0, *body_1; + + rigid_body_0 = (btRigidBody *) b0; + rigid_body_1 = (btRigidBody *) b1; + + body_0 = (EPhysics_Body *) rigid_body_0->getUserPointer(); + body_1 = (EPhysics_Body *) rigid_body_1->getUserPointer(); + + ephysics_body_contact_processed(body_0, body_1); + ephysics_body_contact_processed(body_1, body_0); +} + +static void +_ephysics_world_boundary_del_cb(void *data, EPhysics_Body *body, void *event_info) +{ + EPhysics_World *world = (EPhysics_World *) data; + int i; + + for (i = 0; i < EPHYSICS_WORLD_BOUNDARY_LAST; i++) + { + if (world->boundaries[i] == body) + { + world->boundaries[i] = NULL; + return; + } + } +} + +Eina_Bool +ephysics_world_body_add(EPhysics_World *world, const EPhysics_Body *body, btRigidBody *rigid_body) +{ + world->bodies = eina_list_append(world->bodies, body); + if (eina_error_get()) + { + ERR("Couldn't add body to bodies list."); + return EINA_FALSE; + } + world->dynamics_world->addRigidBody(rigid_body); + return EINA_TRUE; +} + +void +ephysics_world_body_del(EPhysics_World *world, const EPhysics_Body *body, btRigidBody *rigid_body) +{ + world->dynamics_world->removeRigidBody(rigid_body); + world->bodies = eina_list_remove(world->bodies, body); +} + +void +ephysics_world_constraint_add(EPhysics_World *world, btTypedConstraint *bt_constraint) +{ + world->dynamics_world->addConstraint(bt_constraint); +} + +void +ephysics_world_constraint_del(EPhysics_World *world, btTypedConstraint *bt_constraint) +{ + world->dynamics_world->removeConstraint(bt_constraint); +} + +int +ephysics_world_init(void) +{ + if (++_ephysics_world_init_count != 1) + return _ephysics_world_init_count; + + gContactProcessedCallback = _ephysics_world_contact_processed_cb; + + INF("EPhysics World initialized."); + + return _ephysics_world_init_count; +} + +int +ephysics_world_shutdown(void) +{ + void *ldata; + + if (--_ephysics_world_init_count != 0) + return _ephysics_world_init_count; + + if (_anim_simulate) + { + ecore_animator_del(_anim_simulate); + _anim_simulate = NULL; + } + + EINA_LIST_FREE(_worlds, ldata) + { + EPhysics_World *world = (EPhysics_World *) ldata; + ephysics_world_del(world); + } + + _worlds_running = 0; + + INF("EPhysics World shutdown."); + + return _ephysics_world_init_count; +} + +void +ephysics_world_boundary_set(EPhysics_World *world, EPhysics_World_Boundary boundary, EPhysics_Body *body) +{ + world->boundaries[boundary] = body; + ephysics_body_event_callback_add(body, EPHYSICS_CALLBACK_BODY_DEL, + _ephysics_world_boundary_del_cb, world); +} + +EPhysics_Body * +ephysics_world_boundary_get(const EPhysics_World *world, EPhysics_World_Boundary boundary) +{ + return world->boundaries[boundary]; +} + +EAPI EPhysics_World * +ephysics_world_new(void) +{ + EPhysics_World *world; + + world = (EPhysics_World *) calloc(1, sizeof(EPhysics_World)); + if (!world) + { + ERR("Couldn't create a new world instance."); + return NULL; + } + + world->camera = ephysics_camera_add(world); + if (!world->camera) + { + ERR("Couldn't create a camera for this world."); + goto no_camera; + } + + world->broadphase = new btDbvtBroadphase(); + if (!world->broadphase) + { + ERR("Couldn't set broadphase."); + goto no_broadphase; + } + + world->collision = new btDefaultCollisionConfiguration(); + if (!world->collision) + { + ERR("Couldn't configure collision."); + goto no_collision; + } + + world->dispatcher = new btCollisionDispatcher(world->collision); + if (!world->dispatcher) + { + ERR("Couldn't create dispatcher."); + goto no_dispatcher; + } + + world->solver = new btSequentialImpulseConstraintSolver; + if (!world->solver) + { + ERR("Couldn't create solver."); + goto no_solver; + } + + world->dynamics_world = new btDiscreteDynamicsWorld( + world->dispatcher, world->broadphase, world->solver, + world->collision); + if (!world->dynamics_world) + { + ERR("Couldn't create dynamic world."); + goto no_world; + } + + _worlds = eina_list_append(_worlds, world); + if (eina_error_get()) + { + ERR("Couldn't add world to worlds list."); + goto no_list; + } + + world->dynamics_world->setGravity(btVector3(0, -9.81, 0)); + world->rate = 30; + world->dynamics_world->setInternalTickCallback(_ephysics_world_tick_cb, + (void *) world); + + world->running = EINA_TRUE; + world->last_update = ecore_time_get(); + _worlds_running++; + if (!_anim_simulate) + _anim_simulate = ecore_animator_add(_simulate_worlds, _worlds); + + INF("World added."); + return world; + +no_list: + delete world->dynamics_world; +no_world: + delete world->solver; +no_solver: + delete world->dispatcher; +no_dispatcher: + delete world->collision; +no_collision: + delete world->broadphase; +no_broadphase: + ephysics_camera_del(world->camera); +no_camera: + free(world); + return NULL; +} + +EAPI Eina_Bool +ephysics_world_serialize(const EPhysics_World *world, const char *path) +{ + btDefaultSerializer *serializer; + FILE *file; + + if (!world) + { + WRN("Could not serialize, world not provided."); + return EINA_FALSE; + } + + file = fopen(path, "wb"); + if (!file) + { + WRN("Could not serialize, could not open file: %s", path); + return EINA_FALSE; + } + + serializer = new btDefaultSerializer(); + world->dynamics_world->serialize(serializer); + + if (!fwrite(serializer->getBufferPointer(), + serializer->getCurrentBufferSize(), 1, file)) + { + WRN("Problems on writing to: %s.", path); + fclose(file); + delete serializer; + return EINA_FALSE; + } + + fclose(file); + delete serializer; + + INF("Serialization written to file: %s.", path); + + return EINA_TRUE; +} + +EAPI void +ephysics_world_del(EPhysics_World *world) +{ + EPhysics_World_Callback *cb; + void *data; + + if (!world) + { + ERR("Can't delete world, it wasn't provided."); + return; + } + + EINA_INLIST_FOREACH(world->callbacks, cb) + { + if (cb->type == EPHYSICS_CALLBACK_WORLD_DEL) + cb->func(cb->data, world, NULL); + } + + ephysics_world_running_set(world, EINA_FALSE); + _worlds = eina_list_remove(_worlds, world); + + while (world->callbacks) + { + cb = EINA_INLIST_CONTAINER_GET(world->callbacks, + EPhysics_World_Callback); + world->callbacks = eina_inlist_remove(world->callbacks, + world->callbacks); + free(cb); + } + + EINA_LIST_FREE(world->bodies, data) + ephysics_orphan_body_del((EPhysics_Body *) data); + + ephysics_camera_del(world->camera); + delete world->dynamics_world; + delete world->solver; + delete world->dispatcher; + delete world->collision; + delete world->broadphase; + + free(world); + INF("World deleted."); +} + +EAPI void +ephysics_world_running_set(EPhysics_World *world, Eina_Bool running) +{ + if (!world) + { + ERR("Can't (un)pause world, it wasn't provided."); + return; + } + + if ((!!running) == world->running) return; + + world->running = !!running; + + if (world->running) + { + world->last_update = ecore_time_get(); + _worlds_running++; + INF("World unpaused."); + } + else + { + _worlds_running--; + INF("World paused."); + } + + if (!_worlds_running) + { + if (_anim_simulate) + { + ecore_animator_del(_anim_simulate); + _anim_simulate = NULL; + } + return; + } + + if (_anim_simulate) + return; + + _anim_simulate = ecore_animator_add(_simulate_worlds, _worlds); +} + +EAPI Eina_Bool +ephysics_world_running_get(const EPhysics_World *world) +{ + if (!world) + { + ERR("No world, no running status for you."); + return EINA_FALSE; + } + + return world->running; +} + +EAPI void +ephysics_world_gravity_set(EPhysics_World *world, double gx, double gy) +{ + if (!world) + { + ERR("Can't set gravity, no world provided."); + return; + } + + world->dynamics_world->setGravity(btVector3(gx, gy, 0)); + DBG("World gravity set to X:%lf, Y:%lf.", gx, gy); +} + +EAPI void +ephysics_world_gravity_get(const EPhysics_World *world, double *gx, double *gy) +{ + btVector3 vector; + + if (!world) + { + ERR("No world, can't get gravity."); + return; + } + + vector = world->dynamics_world->getGravity(); + + if (gx) *gx = vector.x(); + if (gy) *gy = vector.y(); +} + +EAPI void +ephysics_world_rate_set(EPhysics_World *world, double rate) +{ + if (!world) + { + ERR("No world, can't set rate."); + return; + } + + if (rate <= 0) + { + ERR("Rate should be a positive value. Keeping the old value: %lf.", + world->rate); + return; + } + + /* FIXME update objects considering new rate */ + world->rate = rate; +} + +EAPI double +ephysics_world_rate_get(const EPhysics_World *world) +{ + if (!world) + { + ERR("No world, can't get rate."); + return 0; + } + + return world->rate; +} + +EAPI EPhysics_Camera * +ephysics_world_camera_get(const EPhysics_World *world) +{ + if (!world) + { + ERR("No world, no camera for you."); + return NULL; + } + + return world->camera; +} + +EAPI void +ephysics_world_event_callback_add(EPhysics_World *world, EPhysics_Callback_Type type, EPhysics_World_Event_Cb func, const void *data) +{ + EPhysics_World_Callback *cb; + + if (!world) + { + ERR("Can't set world event callback, world is null."); + return; + } + + if (!func) + { + ERR("Can't set world event callback, function is null."); + return; + } + + if ((type <= EPHYSICS_CALLBACK_WORLD_FIRST) || + (type >= EPHYSICS_CALLBACK_WORLD_LAST)) + { + ERR("Can't set world event callback, callback type is wrong."); + return; + } + + cb = (EPhysics_World_Callback *) malloc(sizeof(EPhysics_World_Callback)); + if (!cb) + { + ERR("Can't set world event callback, can't create cb instance."); + return; + } + + cb->func = func; + cb->type = type; + cb->data = (void *) data; + + world->callbacks = eina_inlist_append(world->callbacks, EINA_INLIST_GET(cb)); +} + +EAPI void * +ephysics_world_event_callback_del(EPhysics_World *world, EPhysics_Callback_Type type, EPhysics_World_Event_Cb func) +{ + EPhysics_World_Callback *cb; + void *cb_data; + + if (!world) + { + ERR("Can't delete world event callback, world is null."); + return NULL; + } + + EINA_INLIST_FOREACH(world->callbacks, cb) + { + if ((cb->type == type) && (cb->func == func)) { + cb_data = cb->data; + world->callbacks = eina_inlist_remove(world->callbacks, + EINA_INLIST_GET(cb)); + free(cb); + return cb_data; + } + } + + return NULL; +} + +EAPI const Eina_List * +ephysics_world_bodies_get(const EPhysics_World *world) +{ + if (!world) + { + ERR("Couldn't get the bodies list, no world provided."); + return NULL; + } + + return world->bodies; +} + +EAPI void +ephysics_world_render_geometry_set(EPhysics_World *world, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h) +{ + if (!world) + { + ERR("Can't set geometry, world wasn't provided."); + return; + } + + if ((w <= 0) || (h <= 0)) + { + ERR("Invalid width or height sizes. They must to be positive values."); + return; + } + + world->x = x; + world->y = y; + world->w = w; + world->h = h; + + ephysics_body_world_boundaries_resize(world); +} + +EAPI void +ephysics_world_render_geometry_get(EPhysics_World *world, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h) +{ + if (!world) + { + ERR("Can't get geometry, world is null."); + return; + } + + if (x) *x = world->x; + if (y) *y = world->y; + if (w) *w = world->w; + if (h) *h = world->h; +} + +#ifdef __cplusplus +} +#endif