Commit Graph

29 Commits

Author SHA1 Message Date
Lucas De Marchi 5a8a8c9014 Convert (hopefully) all comparisons to NULL
Apply badzero.cocci, badnull.coci and badnull2.cocci

This should convert all cases where there's a comparison to NULL to simpler
forms. This patch applies the following transformations:

code before patch               ||code after patch
===============================================================

return a == NULL;                 return !a;

return a != NULL;                 return !!a;

func(a == NULL);                  func(!a);

func(a != NULL);                  func(!!a);

b = a == NULL;                    b = !a;

b = a != NULL;                    b = !!a;

b = a == NULL ? c : d;            b = !a ? c : d;

b = a != NULL ? c : d;            b = a ? c : d;


other cases:

a == NULL                         !a
a != NULL                         a




SVN revision: 51487
2010-08-21 13:52:25 +00:00
Iván Briano 8b2e29dc75 Use right key to find stuff in the eet file. By Fidencio
Store filename for the fonts when adding eith Edje_Edit. By Fidencio
Use the hash in edje_file to dump fonts with edje_decc, avoiding the
need for the fontmap, which should probably be taken out entirely later.


SVN revision: 51095
2010-08-13 20:07:12 +00:00
Lucas De Marchi 0a4617ae38 FORMATTING
* Remove vim modelines:
 find . -name '*.[chx]' -exec sed -i '/\/\*$/ {N;N;/ \* vim:ts/d}' \{\} \;
 find . -name '*.[chx]' -exec sed -i '/\/[\*\/] *vim:/d' \{\} \;

* Remove leading blank lines:
 find . -name '*.[cxh]' -exec sed -i '/./,$!d'

If you use vim, use this in your .vimrc:
set ts=8 sw=3 sts=8 expandtab cino=>5n-3f0^-2{2(0W1st0



SVN revision: 50816
2010-08-04 16:57:32 +00:00
Carsten Haitzler 0cdb510001 fix up docs. edje player - 60fps
SVN revision: 50505
2010-07-26 06:52:36 +00:00
Gustavo Sverzut Barbieri dcced661a2 fix amalgamation after lua2 changes.
BTW, if lua2 is the default, maybe we could remove the mess that is
the first version? SVN serves as history as well.



SVN revision: 50157
2010-07-09 14:24:14 +00:00
Carsten Haitzler ec1bf49da9 lua2 stuff.
SVN revision: 50061
2010-07-06 09:35:34 +00:00
Cedric BAIL 73ac5cdc95 * edje: remove warning due to API change in Ecore.
SVN revision: 49830
2010-06-24 16:16:50 +00:00
Eduardo Felipe 023da4d5ba From: Eduardo Felipe <eduardofelipe87@gmail.com>
Upon creating a timer, it's callback must return an int, otherwise it
would panic. The python bindings do the nicety of, if the callback
function returns nothing, automatically canceling the reschedule of
the timer.

This patch does the same for lua. It's a oneliner.



SVN revision: 49051
2010-05-20 04:48:17 +00:00
Iván Briano 843fb898ef be friendly with the commonlispers who like to call init and shutdown more than once
SVN revision: 48409
2010-04-28 23:10:31 +00:00
Tiago Rezende Campos Falcao c1be10e587 Removing some warnings of edje
Remaining:
edje_lua.c:328: ‘_edje_lua_reg_count’ defined but not used
edje_lua.c:409: ‘_edje_lua_rawgetfield’ defined but not used
edje_lua.c:445: ‘_edje_lua_free_metatable’ defined but not used
edje_lua.c:2182: ‘_edje_lua_object_set_pointer_mode’ defined but not used
edje_lua.c:2190: ‘_edje_lua_object_set_precise_is_inside’ defined but not used

SVN revision: 48142
2010-04-19 20:37:28 +00:00
Carsten Haitzler 8babebf48e an ongoing lua cleanup. existing lua is there and works for the most part.
but it could be much much much cleaner/better so i started a minimalist redo.
it's temporarily enabled right now. will disable soon to do in the background.



SVN revision: 47782
2010-04-06 11:26:32 +00:00
Carsten Haitzler 77a55c3fd8 aaah well... 1. fix segv with edje_match stuff is deep child cleans up
pattersn - ref them.
2. edje lua... beating it into shape. slowly bit by bit.



SVN revision: 47685
2010-04-02 11:05:53 +00:00
Carsten Haitzler 6b60d6d1ee avoid errors - calling more lua calls afre the pcall failed... bad!
SVN revision: 47619
2010-03-31 10:02:51 +00:00
Davide Andreoli aad74ff4ca * Document mouse event callback system in LUA
SVN revision: 47063
2010-03-09 00:55:36 +00:00
Davide Andreoli 976ea97214 * Add a new basic lua example: Set part state from LUA. (and a small fix in the doxy)
SVN revision: 47054
2010-03-08 22:25:40 +00:00
Davide Andreoli 707cabbaf9 * More LUA doxy, now all the Classes,Methods and Attributes are documented (...at least listed). Still have some examples and some more info to write.
* fix the use of lua table in the example

SVN revision: 47048
2010-03-08 19:09:15 +00:00
Davide Andreoli 6185b64a11 Put examples in dist package
SVN revision: 46970
2010-03-07 23:10:21 +00:00
Davide Andreoli dbd7badb2f * Add a doxy page for LUA scripting in edje documentation, not complete yet, but a good structure
SVN revision: 46954
2010-03-07 18:05:12 +00:00
Cedric BAIL fc20b4541e * edje: Use fixed point for tween too.
SVN revision: 46429
2010-02-24 15:37:16 +00:00
Gustavo Sverzut Barbieri 97ebfc5f2b proper error logging for _edje_lua_error()
ERR() should not be used there, because _edje_lua_error() is already
an error logging function. Instead we should call eina_log_print()
directly, handling the source of the error.



SVN revision: 46058
2010-02-10 20:23:27 +00:00
Vincent Torri 6304974ff4 * fix a warning in an error message
* make some private functions as static
patch by Albin Tonnerre


SVN revision: 45429
2010-01-22 06:42:25 +00:00
Sebastian Dransfeld 3a0af1226e make clang happy
SVN revision: 45194
2010-01-15 19:57:17 +00:00
Cedric BAIL 42753d6141 * edje: Fix lua script with fixed point.
SVN revision: 44795
2009-12-30 16:02:17 +00:00
Cedric BAIL 018a9dad66 * edje: Use Eina_Log.
Patch from Mathieu Taillefumier.


SVN revision: 44655
2009-12-22 13:46:00 +00:00
Cedric BAIL b3c373b571 * edje: Some more warning cleanup.
SVN revision: 44632
2009-12-21 16:24:39 +00:00
Cedric BAIL b32c9a3eae * edje: Add Fixed Point Math support to Edje.
You can try it by passing --enable-fixed-point to the configure. It
	will produce an ABI/API compatible Edje library that use internally
	Eina_F32p32 instead of double. It will load Eina_F32p32 instead of
	double from eet file (thanks to eet ability to convert them on the
	fly), so edje file are compatible between fixed point and floating
	point version.

	This patch touch almost all internal calc of Edje, I did test it with
	elementary_test, enlightenment and all my test apps, but it could
	certainly break some of your preferred Edje file. If you see any
	unexpected behaviour please report them to me as soon as possible.

	Note: For devs, I put few macros in edje_private.h that should now
	be used when doing calc in Edje, please use them so that Fixed Point
	doesn't break in the futur.


SVN revision: 44323
2009-12-09 15:44:54 +00:00
Cedric BAIL 6c7f8ce84c * edje: Remove warning, mainly due to lua merge.
SVN revision: 41838
2009-08-17 11:32:56 +00:00
Carsten Haitzler 2a06a861d5 do not exit on lua errors! this would be righteously bad for apps using
themes that happened to use lua...



SVN revision: 41804
2009-08-16 03:00:14 +00:00
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