Commit Graph

27 Commits

Author SHA1 Message Date
Hanspeter Portner da75132793 From: "Hanspeter Portner" <ventosus@airpost.net>
This concerns Ticket #109: Add Lua support for Edje

It adds Lua as scripting facility to Edje, letting Embryo untouched.
It should be easier to use and be more flexible than Embryo, imho ;-)

---
The patch
---

Lua 5.1 is used in sandboxed mode. Lua byte code is not
platform/architecture independent, Lua code is saved as text in the Edje
container and parsed at load time, therefore.

The patch goes in two directions

1) Analogous to Embryo for scripting logic, messaging and custom states.
The same things are implemented as in Embryo:

    - messaging from and to C
        - manual creation of timers, animators, pollers for custom events /
            animations
                - manual manipulation of Edje parts by means of the public
                    edje_object_part_* and internal functions and custom states
                    
                        -> those routines are actually implemented as Lua
bindings to
    functions in Edje.h and Ecore.h
        -> the implementation is done in an object oriented way, so that the
            interface gives the feel of an object description language, pretty
                similar to EDC itself
                    -> combining custom states and custom animators allows
for fancy
    animations and transitions, e.g circular/spline translations or
        complex/conditional transitions, etc.
            -> this is just the same as Embryo does, but implemented in Lua, so
                nothing new here, actually
                
                2) Dynamic object creation and manipulation
                
                    - this interface stems from the 'script_only' objects in
Edje. Those
    objects are a kind of scriptable Edje counterparts to Evas_Smart
        objects. The infrastructure for Embryo is already there, but has
            never been used
                - I added this in Lua and added some first bindings to
experiment
    with
        - I thought it would be useful to allow for a limited dynamic
            creation of ui parts
                - We can create instances of groups from within the same Edje
                    container and use them just like the main Edje object as
stated in
    1)
        - And there are some stand-alone bindings to dynamically create
            Evas_Image, Evas_Table, Evas_Line, Evas_Polygon as examples
            
                -> this may be useful to decouple the program from the ui
even more,
    to be able to do things that have to be done in the program itself
        atm, but actually belong to the user interface, but need dynamic
            creation of objects or complex interactions
                -> those objects are manipulated manually with Lua bindings
to the
    corresponding edje_object_* and evas_object_* functions
    
    ---
    Discussion points
    ---
    
    Both stuff in 1) & 2) is functioning, but needs testing, feedback,
    improvements, ...
    
    Stuff in 1) can already fully replace Embryo scripting with Lua
    scripting. There still is space for improvements/additions, though.
    
    Of the stuff in 2), I think it may only make sense to add the dynamic
    creation of groups defined in the same Edje container.  Dynamic creation
    of other Evas_Objects makes not much sense, as most of them can already
    be used as Edje parts and be manipulated with custom states (apart from
    polygons and lines) and it would make the whole theming potentially more
    programing-like and much more susceptible for errors, etc.
    
    Would this be useful, or drop it all?
    
    The scripting should be there just for logic, conditionals, custom
    states and animations, not for a whole dynamic canvas, imho.
    
    There is a patch around with EXTERNAL Edje parts. Seems to be a better,
    faster, more secure way to extend Edje with custom objects.
    
    There would be the possibility of precompiling Lua code at compile time
    (edje_cc) for faster loading, but we would have to patch and run our own
    Lua version.
    The Lua parser is pretty fast, though, and using
    byte-converted/endianness-swapped byte-code does only pay off for Lua
    chunks of some kilo lines.
    Byte code also occupies much more space than text in the final Edje
    container, as it includes debug symbols.
    
    ---
    
    Cedric and Vincent told me, that the plan was to replace Embryo totally
    by Lua before the official release of Edje at the end of the year? So it
    would make sense to bring Lua to svn soon and look how it fits in, test,
    debug, adapt it further to the themers needs, decide on its final shape,
    GATHER SOME PEOPLE TO HELP ;-)
    
    ---
    
    The Lua enhanced Edje is in sync with svn and can be get directly here
       git clone git://repo.or.cz/edje_lua.git
          cd edje_lua
             git checkout -b lua_patch origin/lua_patch
             
             or apply the attached patch
             
             There are also some examples to show the usage of the things
mentioned
above
    - showcase.edj: shows usage of custom animators, custom states,
        messaging and the script_only object
            - test.edj: test cases of script usage and bindings (custom states,
                custom transitions, tween_states, animators, timers,
object_parts),
    but most of it are experimental script_only objects
    
    http://didgmo.sourceforge.net/showcase.edj
    http://didgmo.sourceforge.net/test.edj
    
    The source of showcase.edc is attached, too, to just have a glimpse at
    Lua inside of EDC
    
    ---
    
    So, what do you guys think?
    
    Thanks and sry for the looong mail, hehe ;-)



SVN revision: 41802
2009-08-16 02:34:02 +00:00
Cedric BAIL 56674aeb99 * edje: Make EDJE_CALC_CACHE on by default.
SVN revision: 41772
2009-08-14 17:20:27 +00:00
Cedric BAIL 7f9a41a824 * edje: Add a cache for _edje_part_recalc_single.
WARNING: THIS CAN CAUSE RENDERING GLITCH AND OTHER WEIRD BEHAVIOUR WITH
	YOUR EDJE FILE. PLEASE REPORT ANY ALIEN STUFF.

	Note: This patch cache the result of _edje_part_recalc_single, until
	any relative part are moved, the object is resized or some property
	are changed (like during text set or color class set).

	Note: Be carefull when you call edje_object_size_min_restricted_calc,
	it's really an inderect heavy user of _edje_part_recalc_single and
	I wasn't able to bring it down.

	Note: This patch use more RAM, around 480 bytes per Edje state, so I
	don't recommand using it on a Desktop with a lot of CPU power.


SVN revision: 41663
2009-08-10 15:16:51 +00:00
Cedric BAIL 0f752e491c * edje: Group configure block together.
SVN revision: 41653
2009-08-10 11:15:38 +00:00
Carsten Haitzler 1ea1c629cb back to pre ver's
SVN revision: 41535
2009-07-29 08:19:34 +00:00
Carsten Haitzler 6db38393cd SNAPSHOT: svn-03
SVN revision: 41532
2009-07-29 08:03:25 +00:00
Carsten Haitzler 9394f73104 back to svn soname
SVN revision: 41042
2009-06-15 06:29:43 +00:00
Carsten Haitzler e81db0f5a3 make distcheck and... SNAP!
SVN revision: 41039
2009-06-15 05:32:49 +00:00
Vincent Torri 4d4477a8a3 underquoted parameters
SVN revision: 40661
2009-05-15 08:35:18 +00:00
Vincent Torri 807770cb00 Put the closing parenthesis just after the last closing bracket.
Putting it the next line adds a line feed to the value of the
variable. Yes, m4 is an horror



SVN revision: 40648
2009-05-15 06:39:05 +00:00
Carsten Haitzler a68c953591 fix input method composition plus fuxes to match textblock
SVN revision: 40641
2009-05-14 12:53:56 +00:00
Vincent Torri 0d295c7299 too many 'yes'.
SVN revision: 40636
2009-05-14 06:58:00 +00:00
Vincent Torri b56951c385 * fix build when ecore_imf is not available. Patch by Lars Munch
* formatting


SVN revision: 40632
2009-05-13 22:11:06 +00:00
Vincent Torri bf1282a758 don't use the release stuff for Windows CE
SVN revision: 40630
2009-05-13 18:58:15 +00:00
Carsten Haitzler 8758acd64d ecore_imf input method support for edjeentry - on-screen kbds only at the
moment. will fix for kbd input. no ecore_imf module tho... yet



SVN revision: 40619
2009-05-13 13:29:30 +00:00
Carsten Haitzler 8e52d827ec move to uses no []'s as it works for me, but for belem... inconsistent []'s
doesnt work.



SVN revision: 40300
2009-04-23 00:32:53 +00:00
Carsten Haitzler 9d18df3109 and incriment to next rev.
SVN revision: 40285
2009-04-22 14:08:21 +00:00
Carsten Haitzler 99ccf484f8 snapworth quality - distchecked. sonames bumped. rev's bumped. tarballs
uploaded.



SVN revision: 40284
2009-04-22 14:07:05 +00:00
Carsten Haitzler e39dc41493 1. embryo shoudl have soname
2. yes local.conf slipped in - ignore
3. added soname version release to module arch dirs
4. adapted extra-modules to use the revision in arch
5. made e17 also have a release rev
6. dummy release stuff in eet - wont use it as its already released.



SVN revision: 40267
2009-04-21 14:17:42 +00:00
Carsten Haitzler ce5a59b7e5 lutin... release soname patch. verbose svn soname used right now
SVN revision: 40131
2009-04-17 10:01:45 +00:00
Carsten Haitzler 386395ee9a up version to 0.9.91
SVN revision: 39701
2009-03-24 23:51:28 +00:00
Vincent Torri 16a444cb28 formatting
SVN revision: 39091
2009-02-19 08:15:23 +00:00
Gustavo Sverzut Barbieri 2d05e12a0a Oops! no change of version number.
SVN revision: 37621
2008-11-14 11:08:22 +00:00
Gustavo Sverzut Barbieri f53febde32 Edje postponed calculations.
This makes use of new Evas_Smart_Class calculate() callback to
postpone calculations until render time, possible saving lots of
calculations to happen.

It is another try, with Cedric's changes to force recalculations when
requried (ie: just before doing some edje_object_*_get()), let's see
if this one solve found issues.



SVN revision: 37620
2008-11-14 11:06:15 +00:00
Vincent Torri 9d71cc15c7 autotools cleanups
* configure.ac re-organisation
 * don't compile edje binaries on windows ce
 * add doc rule to build documentation (hence gendo is removed,
   Doxyfile is moved to doc/ and edje.c.in is renamed doc/edje.dox.in)
   Next commit will fix completely the documentation
 * fix edje.pc.in


SVN revision: 37137
2008-10-26 11:55:57 +00:00
Cedric BAIL ab60bdaf87 Make edje depend on eina. No change in the code yet, so just fix your build system and no bug must show up.
SVN revision: 36623
2008-10-13 15:59:37 +00:00
Peter Wehrfritz beaa909d45 configure.in -> configure.ac
SVN revision: 36364
2008-09-30 18:07:29 +00:00