2004-10-10 08:18:07 -07:00
|
|
|
/*
|
2004-10-19 09:50:27 -07:00
|
|
|
* vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
|
2004-10-10 08:18:07 -07:00
|
|
|
*/
|
|
|
|
|
2007-11-23 08:43:03 -08:00
|
|
|
/*
|
|
|
|
Concerning the EDC reference:
|
|
|
|
|
|
|
|
The formatting for blocks and properties has been implemented as a table
|
|
|
|
which is filled using ALIASES.
|
|
|
|
For maximum flexibility I implemented them in the \@code/\@encode style,
|
|
|
|
this means that missing one or changing the order most certainly cause
|
|
|
|
formatting errors.
|
|
|
|
|
|
|
|
\@block
|
|
|
|
block name
|
|
|
|
\@context
|
|
|
|
code sample of the block
|
|
|
|
\@description
|
|
|
|
the block's description
|
|
|
|
\@endblock
|
|
|
|
|
|
|
|
\@property
|
|
|
|
property name
|
|
|
|
\@parameters
|
|
|
|
property's parameter list
|
|
|
|
\@effect
|
|
|
|
the property description (lol)
|
|
|
|
\@endproperty
|
|
|
|
*/
|
|
|
|
|
2009-10-25 04:19:12 -07:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include "config.h"
|
|
|
|
#endif
|
|
|
|
|
2009-09-28 23:13:33 -07:00
|
|
|
#include <string.h>
|
|
|
|
#include <errno.h>
|
|
|
|
#include <sys/stat.h>
|
|
|
|
#include <fcntl.h>
|
|
|
|
#include <sys/mman.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
|
|
|
|
#include "edje_cc.h"
|
|
|
|
|
2007-11-23 08:43:03 -08:00
|
|
|
/**
|
|
|
|
* @page edcref Edje Data Collection reference
|
|
|
|
* An Edje Data Collection, it's a plain text file (normally identified with the
|
|
|
|
* .edc extension),consisting of instructions for the Edje Compiler.
|
|
|
|
*
|
|
|
|
* The syntax for the edje data collection files follows a simple structure of
|
|
|
|
* "blocks { .. }" that can contain "properties: ..", more blocks, or both.
|
|
|
|
*
|
|
|
|
* @author Andres Blanc (dresb) andresblanc@gmail.com
|
|
|
|
*
|
|
|
|
* <table class="edcref" border="0">
|
|
|
|
*/
|
|
|
|
|
2009-11-23 07:03:19 -08:00
|
|
|
static void st_externals_external(void);
|
|
|
|
|
2003-06-11 06:20:48 -07:00
|
|
|
static void st_images_image(void);
|
|
|
|
|
2004-01-22 18:13:42 -08:00
|
|
|
static void st_fonts_font(void);
|
|
|
|
|
2003-08-05 07:33:35 -07:00
|
|
|
static void st_data_item(void);
|
2008-01-20 17:03:04 -08:00
|
|
|
static void st_data_file(void);
|
2003-08-05 07:33:35 -07:00
|
|
|
|
2005-09-12 02:43:49 -07:00
|
|
|
static void ob_styles_style(void);
|
|
|
|
static void st_styles_style_name(void);
|
|
|
|
static void st_styles_style_base(void);
|
|
|
|
static void st_styles_style_tag(void);
|
|
|
|
|
2006-01-10 19:19:45 -08:00
|
|
|
static void ob_color_class(void);
|
|
|
|
static void st_color_class_name(void);
|
|
|
|
static void st_color_class_color(void);
|
|
|
|
static void st_color_class_color2(void);
|
|
|
|
static void st_color_class_color3(void);
|
|
|
|
|
2006-08-02 03:52:44 -07:00
|
|
|
static void ob_spectrum(void);
|
|
|
|
/*static void st_spectrum(void);*/
|
|
|
|
static void st_spectrum_name(void);
|
|
|
|
static void st_spectrum_color(void);
|
|
|
|
|
2003-06-11 07:14:23 -07:00
|
|
|
static void ob_collections(void);
|
2003-06-12 16:02:45 -07:00
|
|
|
|
2003-06-12 15:34:51 -07:00
|
|
|
static void ob_collections_group(void);
|
2003-06-12 16:02:45 -07:00
|
|
|
static void st_collections_group_name(void);
|
2008-05-28 19:00:04 -07:00
|
|
|
static void st_collections_group_script_only(void);
|
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-15 19:34:02 -07:00
|
|
|
static void st_collections_group_lua_script_only(void);
|
2006-10-11 22:35:14 -07:00
|
|
|
static void st_collections_group_alias(void);
|
2003-07-20 05:37:49 -07:00
|
|
|
static void st_collections_group_min(void);
|
|
|
|
static void st_collections_group_max(void);
|
2003-08-05 07:33:35 -07:00
|
|
|
static void st_collections_group_data_item(void);
|
2003-06-12 16:02:45 -07:00
|
|
|
|
2004-03-27 21:26:17 -08:00
|
|
|
static void ob_collections_group_script(void);
|
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-15 19:34:02 -07:00
|
|
|
static void ob_collections_group_lua_script(void);
|
2004-03-27 21:26:17 -08:00
|
|
|
|
2003-06-12 15:34:51 -07:00
|
|
|
static void ob_collections_group_parts_part(void);
|
2003-06-12 16:02:45 -07:00
|
|
|
static void st_collections_group_parts_part_name(void);
|
|
|
|
static void st_collections_group_parts_part_type(void);
|
2003-07-07 00:55:18 -07:00
|
|
|
static void st_collections_group_parts_part_effect(void);
|
2003-06-12 16:02:45 -07:00
|
|
|
static void st_collections_group_parts_part_mouse_events(void);
|
2003-07-27 06:16:51 -07:00
|
|
|
static void st_collections_group_parts_part_repeat_events(void);
|
2008-04-01 14:33:17 -07:00
|
|
|
static void st_collections_group_parts_part_ignore_flags(void);
|
2008-09-09 07:13:34 -07:00
|
|
|
static void st_collections_group_parts_part_scale(void);
|
2007-07-24 07:20:07 -07:00
|
|
|
static void st_collections_group_parts_part_pointer_mode(void);
|
2007-07-23 07:22:57 -07:00
|
|
|
static void st_collections_group_parts_part_precise_is_inside(void);
|
2007-03-31 03:53:22 -07:00
|
|
|
static void st_collections_group_parts_part_use_alternate_font_metrics(void);
|
2003-06-24 19:29:25 -07:00
|
|
|
static void st_collections_group_parts_part_clip_to_id(void);
|
2007-05-26 22:28:07 -07:00
|
|
|
static void st_collections_group_parts_part_source(void);
|
2008-10-13 02:19:04 -07:00
|
|
|
static void st_collections_group_parts_part_source2(void);
|
|
|
|
static void st_collections_group_parts_part_source3(void);
|
|
|
|
static void st_collections_group_parts_part_source4(void);
|
2008-10-16 23:40:46 -07:00
|
|
|
static void st_collections_group_parts_part_source5(void);
|
|
|
|
static void st_collections_group_parts_part_source6(void);
|
2008-10-31 08:13:50 -07:00
|
|
|
static void st_collections_group_parts_part_entry_mode(void);
|
2009-03-19 06:36:10 -07:00
|
|
|
static void st_collections_group_parts_part_select_mode(void);
|
2008-10-31 08:13:50 -07:00
|
|
|
static void st_collections_group_parts_part_multiline(void);
|
2003-07-27 06:16:51 -07:00
|
|
|
static void st_collections_group_parts_part_dragable_x(void);
|
|
|
|
static void st_collections_group_parts_part_dragable_y(void);
|
|
|
|
static void st_collections_group_parts_part_dragable_confine(void);
|
2005-07-26 06:59:03 -07:00
|
|
|
static void st_collections_group_parts_part_dragable_events(void);
|
2003-06-12 16:02:45 -07:00
|
|
|
|
2008-12-17 18:43:20 -08:00
|
|
|
/* box and table items share these */
|
2008-11-23 21:15:15 -08:00
|
|
|
static void ob_collections_group_parts_part_box_items_item(void);
|
|
|
|
static void st_collections_group_parts_part_box_items_item_type(void);
|
|
|
|
static void st_collections_group_parts_part_box_items_item_name(void);
|
|
|
|
static void st_collections_group_parts_part_box_items_item_source(void);
|
|
|
|
static void st_collections_group_parts_part_box_items_item_min(void);
|
|
|
|
static void st_collections_group_parts_part_box_items_item_prefer(void);
|
|
|
|
static void st_collections_group_parts_part_box_items_item_max(void);
|
|
|
|
static void st_collections_group_parts_part_box_items_item_padding(void);
|
|
|
|
static void st_collections_group_parts_part_box_items_item_align(void);
|
|
|
|
static void st_collections_group_parts_part_box_items_item_weight(void);
|
|
|
|
static void st_collections_group_parts_part_box_items_item_aspect(void);
|
|
|
|
static void st_collections_group_parts_part_box_items_item_aspect_mode(void);
|
|
|
|
static void st_collections_group_parts_part_box_items_item_options(void);
|
2008-12-17 18:43:20 -08:00
|
|
|
/* but these are only for table */
|
|
|
|
static void st_collections_group_parts_part_table_items_item_position(void);
|
|
|
|
static void st_collections_group_parts_part_table_items_item_span(void);
|
2008-11-23 21:15:15 -08:00
|
|
|
|
2003-06-12 15:34:51 -07:00
|
|
|
static void ob_collections_group_parts_part_description(void);
|
2004-10-19 09:37:20 -07:00
|
|
|
static void st_collections_group_parts_part_description_inherit(void);
|
2003-06-12 16:02:45 -07:00
|
|
|
static void st_collections_group_parts_part_description_state(void);
|
2003-06-13 20:06:36 -07:00
|
|
|
static void st_collections_group_parts_part_description_visible(void);
|
|
|
|
static void st_collections_group_parts_part_description_align(void);
|
2005-09-18 23:51:49 -07:00
|
|
|
static void st_collections_group_parts_part_description_fixed(void);
|
2003-06-13 20:06:36 -07:00
|
|
|
static void st_collections_group_parts_part_description_min(void);
|
|
|
|
static void st_collections_group_parts_part_description_max(void);
|
|
|
|
static void st_collections_group_parts_part_description_step(void);
|
|
|
|
static void st_collections_group_parts_part_description_aspect(void);
|
2004-05-24 00:58:37 -07:00
|
|
|
static void st_collections_group_parts_part_description_aspect_preference(void);
|
2003-06-13 20:06:36 -07:00
|
|
|
static void st_collections_group_parts_part_description_rel1_relative(void);
|
|
|
|
static void st_collections_group_parts_part_description_rel1_offset(void);
|
|
|
|
static void st_collections_group_parts_part_description_rel1_to(void);
|
2003-08-13 20:22:38 -07:00
|
|
|
static void st_collections_group_parts_part_description_rel1_to_x(void);
|
|
|
|
static void st_collections_group_parts_part_description_rel1_to_y(void);
|
2003-06-13 20:06:36 -07:00
|
|
|
static void st_collections_group_parts_part_description_rel2_relative(void);
|
|
|
|
static void st_collections_group_parts_part_description_rel2_offset(void);
|
|
|
|
static void st_collections_group_parts_part_description_rel2_to(void);
|
2003-08-13 20:22:38 -07:00
|
|
|
static void st_collections_group_parts_part_description_rel2_to_x(void);
|
|
|
|
static void st_collections_group_parts_part_description_rel2_to_y(void);
|
2003-06-13 20:06:36 -07:00
|
|
|
static void st_collections_group_parts_part_description_image_normal(void);
|
|
|
|
static void st_collections_group_parts_part_description_image_tween(void);
|
2004-10-19 10:01:05 -07:00
|
|
|
static void st_collections_group_parts_part_description_image_border(void);
|
2005-03-31 03:40:05 -08:00
|
|
|
static void st_collections_group_parts_part_description_image_middle(void);
|
2009-05-07 06:30:18 -07:00
|
|
|
static void st_collections_group_parts_part_description_image_scale_hint(void);
|
2003-06-27 20:08:25 -07:00
|
|
|
static void st_collections_group_parts_part_description_fill_smooth(void);
|
2003-06-13 20:06:36 -07:00
|
|
|
static void st_collections_group_parts_part_description_fill_origin_relative(void);
|
|
|
|
static void st_collections_group_parts_part_description_fill_origin_offset(void);
|
|
|
|
static void st_collections_group_parts_part_description_fill_size_relative(void);
|
|
|
|
static void st_collections_group_parts_part_description_fill_size_offset(void);
|
2006-08-02 03:52:44 -07:00
|
|
|
static void st_collections_group_parts_part_description_fill_angle(void);
|
|
|
|
static void st_collections_group_parts_part_description_fill_spread(void);
|
2007-07-06 15:36:40 -07:00
|
|
|
static void st_collections_group_parts_part_description_fill_type(void);
|
2003-10-28 22:42:03 -08:00
|
|
|
static void st_collections_group_parts_part_description_color_class(void);
|
2003-06-13 20:06:36 -07:00
|
|
|
static void st_collections_group_parts_part_description_color(void);
|
|
|
|
static void st_collections_group_parts_part_description_color2(void);
|
|
|
|
static void st_collections_group_parts_part_description_color3(void);
|
|
|
|
static void st_collections_group_parts_part_description_text_text(void);
|
2003-10-30 21:07:39 -08:00
|
|
|
static void st_collections_group_parts_part_description_text_text_class(void);
|
2003-06-13 20:06:36 -07:00
|
|
|
static void st_collections_group_parts_part_description_text_font(void);
|
2005-09-12 02:43:49 -07:00
|
|
|
static void st_collections_group_parts_part_description_text_style(void);
|
2008-10-22 22:38:06 -07:00
|
|
|
static void st_collections_group_parts_part_description_text_repch(void);
|
2003-06-13 20:06:36 -07:00
|
|
|
static void st_collections_group_parts_part_description_text_size(void);
|
|
|
|
static void st_collections_group_parts_part_description_text_fit(void);
|
|
|
|
static void st_collections_group_parts_part_description_text_min(void);
|
2006-10-08 23:01:13 -07:00
|
|
|
static void st_collections_group_parts_part_description_text_max(void);
|
2003-06-13 20:06:36 -07:00
|
|
|
static void st_collections_group_parts_part_description_text_align(void);
|
2004-10-12 20:43:42 -07:00
|
|
|
static void st_collections_group_parts_part_description_text_source(void);
|
|
|
|
static void st_collections_group_parts_part_description_text_text_source(void);
|
2005-11-05 19:32:01 -08:00
|
|
|
static void st_collections_group_parts_part_description_text_elipsis(void);
|
2006-08-02 03:52:44 -07:00
|
|
|
static void st_collections_group_parts_part_description_gradient_type(void);
|
|
|
|
static void st_collections_group_parts_part_description_gradient_spectrum(void);
|
2006-08-20 20:00:01 -07:00
|
|
|
static void st_collections_group_parts_part_description_gradient_rel1_relative(void);
|
|
|
|
static void st_collections_group_parts_part_description_gradient_rel1_offset(void);
|
|
|
|
static void st_collections_group_parts_part_description_gradient_rel2_relative(void);
|
|
|
|
static void st_collections_group_parts_part_description_gradient_rel2_offset(void);
|
2008-11-23 21:15:15 -08:00
|
|
|
static void st_collections_group_parts_part_description_box_layout(void);
|
|
|
|
static void st_collections_group_parts_part_description_box_align(void);
|
|
|
|
static void st_collections_group_parts_part_description_box_padding(void);
|
2009-02-28 11:38:35 -08:00
|
|
|
static void st_collections_group_parts_part_description_box_min(void);
|
2008-12-17 18:43:20 -08:00
|
|
|
static void st_collections_group_parts_part_description_table_homogeneous(void);
|
|
|
|
static void st_collections_group_parts_part_description_table_align(void);
|
|
|
|
static void st_collections_group_parts_part_description_table_padding(void);
|
2010-01-05 11:26:18 -08:00
|
|
|
static void st_collections_group_parts_part_api(void);
|
2003-06-13 20:06:36 -07:00
|
|
|
|
2009-10-26 18:08:19 -07:00
|
|
|
/* external part parameters */
|
|
|
|
static void st_collections_group_parts_part_description_params_int(void);
|
2003-06-12 15:34:51 -07:00
|
|
|
static void ob_collections_group_programs_program(void);
|
2009-10-26 18:08:19 -07:00
|
|
|
static void st_collections_group_parts_part_description_params_double(void);
|
|
|
|
|
2003-06-16 06:55:13 -07:00
|
|
|
static void st_collections_group_programs_program_name(void);
|
2009-10-26 18:08:19 -07:00
|
|
|
static void st_collections_group_parts_part_description_params_string(void);
|
2003-06-16 06:55:13 -07:00
|
|
|
static void st_collections_group_programs_program_signal(void);
|
2009-10-26 18:08:19 -07:00
|
|
|
static void st_collections_group_programs_program_source(void);
|
2003-06-27 21:20:41 -07:00
|
|
|
static void st_collections_group_programs_program_in(void);
|
2003-06-16 06:55:13 -07:00
|
|
|
static void st_collections_group_programs_program_action(void);
|
|
|
|
static void st_collections_group_programs_program_transition(void);
|
|
|
|
static void st_collections_group_programs_program_target(void);
|
|
|
|
static void st_collections_group_programs_program_after(void);
|
2010-01-05 11:26:18 -08:00
|
|
|
static void st_collections_group_programs_program_api(void);
|
2003-06-11 07:14:23 -07:00
|
|
|
|
2004-03-27 21:26:17 -08:00
|
|
|
static void ob_collections_group_programs_program_script(void);
|
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-15 19:34:02 -07:00
|
|
|
static void ob_collections_group_programs_program_lua_script(void);
|
2004-03-27 21:26:17 -08:00
|
|
|
|
2003-06-11 06:20:48 -07:00
|
|
|
/*****/
|
|
|
|
|
2003-06-13 20:06:36 -07:00
|
|
|
New_Statement_Handler statement_handlers[] =
|
|
|
|
{
|
2009-11-23 07:03:19 -08:00
|
|
|
{"externals.external", st_externals_external},
|
2003-06-13 20:06:36 -07:00
|
|
|
{"images.image", st_images_image},
|
2004-01-22 18:13:42 -08:00
|
|
|
{"fonts.font", st_fonts_font},
|
2003-08-05 07:33:35 -07:00
|
|
|
{"data.item", st_data_item},
|
2008-01-20 17:03:04 -08:00
|
|
|
{"data.file", st_data_file},
|
2005-09-12 02:43:49 -07:00
|
|
|
{"styles.style.name", st_styles_style_name},
|
|
|
|
{"styles.style.base", st_styles_style_base},
|
|
|
|
{"styles.style.tag", st_styles_style_tag},
|
2006-01-10 19:19:45 -08:00
|
|
|
{"color_classes.color_class.name", st_color_class_name},
|
|
|
|
{"color_classes.color_class.color", st_color_class_color},
|
|
|
|
{"color_classes.color_class.color2", st_color_class_color2},
|
|
|
|
{"color_classes.color_class.color3", st_color_class_color3},
|
2006-08-02 03:52:44 -07:00
|
|
|
/*{"spectra.spectrum", st_spectrum},*/
|
|
|
|
{"spectra.spectrum.name", st_spectrum_name},
|
|
|
|
{"spectra.spectrum.color", st_spectrum_color},
|
2009-11-23 07:03:19 -08:00
|
|
|
{"collections.externals.external", st_externals_external}, /* dup */
|
2004-10-05 22:25:03 -07:00
|
|
|
{"collections.image", st_images_image}, /* dup */
|
|
|
|
{"collections.images.image", st_images_image}, /* dup */
|
|
|
|
{"collections.font", st_fonts_font}, /* dup */
|
|
|
|
{"collections.fonts.font", st_fonts_font}, /* dup */
|
2005-09-12 02:43:49 -07:00
|
|
|
{"collections.styles.style.name", st_styles_style_name}, /* dup */
|
|
|
|
{"collections.styles.style.base", st_styles_style_base}, /* dup */
|
|
|
|
{"collections.styles.style.tag", st_styles_style_tag}, /* dup */
|
2008-03-24 01:22:01 -07:00
|
|
|
{"collections.color_classes.color_class.name", st_color_class_name}, /* dup */
|
|
|
|
{"collections.color_classes.color_class.color", st_color_class_color}, /* dup */
|
|
|
|
{"collections.color_classes.color_class.color2", st_color_class_color2}, /* dup */
|
|
|
|
{"collections.color_classes.color_class.color3", st_color_class_color3}, /* dup */
|
2003-06-13 20:06:36 -07:00
|
|
|
{"collections.group.name", st_collections_group_name},
|
2008-05-28 19:00:04 -07:00
|
|
|
{"collections.group.script_only", st_collections_group_script_only},
|
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-15 19:34:02 -07:00
|
|
|
{"collections.group.lua_script_only", st_collections_group_lua_script_only},
|
2006-10-11 22:35:14 -07:00
|
|
|
{"collections.group.alias", st_collections_group_alias},
|
2003-07-20 05:37:49 -07:00
|
|
|
{"collections.group.min", st_collections_group_min},
|
|
|
|
{"collections.group.max", st_collections_group_max},
|
2003-08-05 07:33:35 -07:00
|
|
|
{"collections.group.data.item", st_collections_group_data_item},
|
2009-11-23 07:03:19 -08:00
|
|
|
{"collections.group.externals.external", st_externals_external}, /* dup */
|
2004-10-05 22:25:03 -07:00
|
|
|
{"collections.group.image", st_images_image}, /* dup */
|
|
|
|
{"collections.group.images.image", st_images_image}, /* dup */
|
|
|
|
{"collections.group.font", st_fonts_font}, /* dup */
|
|
|
|
{"collections.group.fonts.font", st_fonts_font}, /* dup */
|
2005-09-12 02:43:49 -07:00
|
|
|
{"collections.group.styles.style.name", st_styles_style_name}, /* dup */
|
|
|
|
{"collections.group.styles.style.base", st_styles_style_base}, /* dup */
|
|
|
|
{"collections.group.styles.style.tag", st_styles_style_tag}, /* dup */
|
2008-03-24 01:22:01 -07:00
|
|
|
{"collections.group.color_classes.color_class.name", st_color_class_name}, /* dup */
|
|
|
|
{"collections.group.color_classes.color_class.color", st_color_class_color}, /* dup */
|
|
|
|
{"collections.group.color_classes.color_class.color2", st_color_class_color2}, /* dup */
|
|
|
|
{"collections.group.color_classes.color_class.color3", st_color_class_color3}, /* dup */
|
2004-10-05 22:25:03 -07:00
|
|
|
{"collections.group.parts.image", st_images_image}, /* dup */
|
|
|
|
{"collections.group.parts.images.image", st_images_image}, /* dup */
|
|
|
|
{"collections.group.parts.font", st_fonts_font}, /* dup */
|
|
|
|
{"collections.group.parts.fonts.font", st_fonts_font}, /* dup */
|
2005-09-12 02:43:49 -07:00
|
|
|
{"collections.group.parts.styles.style.name", st_styles_style_name}, /* dup */
|
|
|
|
{"collections.group.parts.styles.style.base", st_styles_style_base}, /* dup */
|
|
|
|
{"collections.group.parts.styles.style.tag", st_styles_style_tag}, /* dup */
|
2008-03-24 01:22:01 -07:00
|
|
|
{"collections.group.parts.color_classes.color_class.name", st_color_class_name}, /* dup */
|
|
|
|
{"collections.group.parts.color_classes.color_class.color", st_color_class_color}, /* dup */
|
|
|
|
{"collections.group.parts.color_classes.color_class.color2", st_color_class_color2}, /* dup */
|
|
|
|
{"collections.group.parts.color_classes.color_class.color3", st_color_class_color3}, /* dup */
|
2003-06-13 20:06:36 -07:00
|
|
|
{"collections.group.parts.part.name", st_collections_group_parts_part_name},
|
2010-01-05 11:26:18 -08:00
|
|
|
{"collections.group.parts.part.api", st_collections_group_parts_part_api},
|
2003-06-13 20:06:36 -07:00
|
|
|
{"collections.group.parts.part.type", st_collections_group_parts_part_type},
|
2003-07-07 00:55:18 -07:00
|
|
|
{"collections.group.parts.part.effect", st_collections_group_parts_part_effect},
|
2003-06-13 20:06:36 -07:00
|
|
|
{"collections.group.parts.part.mouse_events", st_collections_group_parts_part_mouse_events},
|
2003-07-27 06:16:51 -07:00
|
|
|
{"collections.group.parts.part.repeat_events", st_collections_group_parts_part_repeat_events},
|
2008-04-01 14:33:17 -07:00
|
|
|
{"collections.group.parts.part.ignore_flags", st_collections_group_parts_part_ignore_flags},
|
2008-09-09 07:13:34 -07:00
|
|
|
{"collections.group.parts.part.scale", st_collections_group_parts_part_scale},
|
2007-07-24 07:20:07 -07:00
|
|
|
{"collections.group.parts.part.pointer_mode", st_collections_group_parts_part_pointer_mode},
|
2007-07-23 07:22:57 -07:00
|
|
|
{"collections.group.parts.part.precise_is_inside", st_collections_group_parts_part_precise_is_inside},
|
2007-03-31 03:53:22 -07:00
|
|
|
{"collections.group.parts.part.use_alternate_font_metrics", st_collections_group_parts_part_use_alternate_font_metrics},
|
2003-06-24 19:29:25 -07:00
|
|
|
{"collections.group.parts.part.clip_to", st_collections_group_parts_part_clip_to_id},
|
2007-05-26 22:28:07 -07:00
|
|
|
{"collections.group.parts.part.source", st_collections_group_parts_part_source},
|
2008-10-13 02:19:04 -07:00
|
|
|
{"collections.group.parts.part.source2", st_collections_group_parts_part_source2},
|
|
|
|
{"collections.group.parts.part.source3", st_collections_group_parts_part_source3},
|
|
|
|
{"collections.group.parts.part.source4", st_collections_group_parts_part_source4},
|
2008-10-16 23:40:46 -07:00
|
|
|
{"collections.group.parts.part.source5", st_collections_group_parts_part_source5},
|
|
|
|
{"collections.group.parts.part.source6", st_collections_group_parts_part_source6},
|
2003-07-27 06:16:51 -07:00
|
|
|
{"collections.group.parts.part.dragable.x", st_collections_group_parts_part_dragable_x},
|
|
|
|
{"collections.group.parts.part.dragable.y", st_collections_group_parts_part_dragable_y},
|
|
|
|
{"collections.group.parts.part.dragable.confine", st_collections_group_parts_part_dragable_confine},
|
2005-07-26 06:59:03 -07:00
|
|
|
{"collections.group.parts.part.dragable.events", st_collections_group_parts_part_dragable_events},
|
2008-10-13 02:19:04 -07:00
|
|
|
{"collections.group.parts.part.entry_mode", st_collections_group_parts_part_entry_mode},
|
2009-03-19 06:36:10 -07:00
|
|
|
{"collections.group.parts.part.select_mode", st_collections_group_parts_part_select_mode},
|
2008-10-13 02:19:04 -07:00
|
|
|
{"collections.group.parts.part.multiline", st_collections_group_parts_part_multiline},
|
2004-10-05 22:25:03 -07:00
|
|
|
{"collections.group.parts.part.image", st_images_image}, /* dup */
|
|
|
|
{"collections.group.parts.part.images.image", st_images_image}, /* dup */
|
|
|
|
{"collections.group.parts.part.font", st_fonts_font}, /* dup */
|
|
|
|
{"collections.group.parts.part.fonts.font", st_fonts_font}, /* dup */
|
2005-09-12 02:43:49 -07:00
|
|
|
{"collections.group.parts.part.styles.style.name", st_styles_style_name}, /* dup */
|
|
|
|
{"collections.group.parts.part.styles.style.base", st_styles_style_base}, /* dup */
|
|
|
|
{"collections.group.parts.part.styles.style.tag", st_styles_style_tag}, /* dup */
|
2008-03-24 01:22:01 -07:00
|
|
|
{"collections.group.parts.part.color_classes.color_class.name", st_color_class_name}, /* dup */
|
|
|
|
{"collections.group.parts.part.color_classes.color_class.color", st_color_class_color}, /* dup */
|
|
|
|
{"collections.group.parts.part.color_classes.color_class.color2", st_color_class_color2}, /* dup */
|
|
|
|
{"collections.group.parts.part.color_classes.color_class.color3", st_color_class_color3}, /* dup */
|
2008-11-23 21:15:15 -08:00
|
|
|
{"collections.group.parts.part.box.items.item.type", st_collections_group_parts_part_box_items_item_type},
|
|
|
|
{"collections.group.parts.part.box.items.item.name", st_collections_group_parts_part_box_items_item_name},
|
|
|
|
{"collections.group.parts.part.box.items.item.source", st_collections_group_parts_part_box_items_item_source},
|
|
|
|
{"collections.group.parts.part.box.items.item.min", st_collections_group_parts_part_box_items_item_min},
|
|
|
|
{"collections.group.parts.part.box.items.item.prefer", st_collections_group_parts_part_box_items_item_prefer},
|
|
|
|
{"collections.group.parts.part.box.items.item.max", st_collections_group_parts_part_box_items_item_max},
|
|
|
|
{"collections.group.parts.part.box.items.item.padding", st_collections_group_parts_part_box_items_item_padding},
|
|
|
|
{"collections.group.parts.part.box.items.item.align", st_collections_group_parts_part_box_items_item_align},
|
|
|
|
{"collections.group.parts.part.box.items.item.weight", st_collections_group_parts_part_box_items_item_weight},
|
|
|
|
{"collections.group.parts.part.box.items.item.aspect", st_collections_group_parts_part_box_items_item_aspect},
|
|
|
|
{"collections.group.parts.part.box.items.item.aspect_mode", st_collections_group_parts_part_box_items_item_aspect_mode},
|
|
|
|
{"collections.group.parts.part.box.items.item.options", st_collections_group_parts_part_box_items_item_options},
|
2008-12-17 18:43:20 -08:00
|
|
|
{"collections.group.parts.part.table.items.item.type", st_collections_group_parts_part_box_items_item_type}, /* dup */
|
|
|
|
{"collections.group.parts.part.table.items.item.name", st_collections_group_parts_part_box_items_item_name}, /* dup */
|
|
|
|
{"collections.group.parts.part.table.items.item.source", st_collections_group_parts_part_box_items_item_source}, /* dup */
|
|
|
|
{"collections.group.parts.part.table.items.item.min", st_collections_group_parts_part_box_items_item_min}, /* dup */
|
|
|
|
{"collections.group.parts.part.table.items.item.prefer", st_collections_group_parts_part_box_items_item_prefer}, /* dup */
|
|
|
|
{"collections.group.parts.part.table.items.item.max", st_collections_group_parts_part_box_items_item_max}, /* dup */
|
|
|
|
{"collections.group.parts.part.table.items.item.padding", st_collections_group_parts_part_box_items_item_padding}, /* dup */
|
|
|
|
{"collections.group.parts.part.table.items.item.align", st_collections_group_parts_part_box_items_item_align}, /* dup */
|
|
|
|
{"collections.group.parts.part.table.items.item.weight", st_collections_group_parts_part_box_items_item_weight}, /* dup */
|
|
|
|
{"collections.group.parts.part.table.items.item.aspect", st_collections_group_parts_part_box_items_item_aspect}, /* dup */
|
|
|
|
{"collections.group.parts.part.table.items.item.aspect_mode", st_collections_group_parts_part_box_items_item_aspect_mode}, /* dup */
|
|
|
|
{"collections.group.parts.part.table.items.item.options", st_collections_group_parts_part_box_items_item_options}, /* dup */
|
|
|
|
{"collections.group.parts.part.table.items.item.position", st_collections_group_parts_part_table_items_item_position},
|
|
|
|
{"collections.group.parts.part.table.items.item.span", st_collections_group_parts_part_table_items_item_span},
|
2004-10-19 09:37:20 -07:00
|
|
|
{"collections.group.parts.part.description.inherit", st_collections_group_parts_part_description_inherit},
|
2003-06-13 20:06:36 -07:00
|
|
|
{"collections.group.parts.part.description.state", st_collections_group_parts_part_description_state},
|
|
|
|
{"collections.group.parts.part.description.visible", st_collections_group_parts_part_description_visible},
|
|
|
|
{"collections.group.parts.part.description.align", st_collections_group_parts_part_description_align},
|
2005-09-18 23:51:49 -07:00
|
|
|
{"collections.group.parts.part.description.fixed", st_collections_group_parts_part_description_fixed},
|
2003-06-13 20:06:36 -07:00
|
|
|
{"collections.group.parts.part.description.min", st_collections_group_parts_part_description_min},
|
|
|
|
{"collections.group.parts.part.description.max", st_collections_group_parts_part_description_max},
|
|
|
|
{"collections.group.parts.part.description.step", st_collections_group_parts_part_description_step},
|
|
|
|
{"collections.group.parts.part.description.aspect", st_collections_group_parts_part_description_aspect},
|
2004-05-24 00:58:37 -07:00
|
|
|
{"collections.group.parts.part.description.aspect_preference", st_collections_group_parts_part_description_aspect_preference},
|
2003-06-13 20:06:36 -07:00
|
|
|
{"collections.group.parts.part.description.rel1.relative", st_collections_group_parts_part_description_rel1_relative},
|
|
|
|
{"collections.group.parts.part.description.rel1.offset", st_collections_group_parts_part_description_rel1_offset},
|
|
|
|
{"collections.group.parts.part.description.rel1.to", st_collections_group_parts_part_description_rel1_to},
|
2003-08-13 20:22:38 -07:00
|
|
|
{"collections.group.parts.part.description.rel1.to_x", st_collections_group_parts_part_description_rel1_to_x},
|
|
|
|
{"collections.group.parts.part.description.rel1.to_y", st_collections_group_parts_part_description_rel1_to_y},
|
2003-06-13 20:06:36 -07:00
|
|
|
{"collections.group.parts.part.description.rel2.relative", st_collections_group_parts_part_description_rel2_relative},
|
|
|
|
{"collections.group.parts.part.description.rel2.offset", st_collections_group_parts_part_description_rel2_offset},
|
|
|
|
{"collections.group.parts.part.description.rel2.to", st_collections_group_parts_part_description_rel2_to},
|
2003-08-13 20:22:38 -07:00
|
|
|
{"collections.group.parts.part.description.rel2.to_x", st_collections_group_parts_part_description_rel2_to_x},
|
|
|
|
{"collections.group.parts.part.description.rel2.to_y", st_collections_group_parts_part_description_rel2_to_y},
|
2003-06-13 20:06:36 -07:00
|
|
|
{"collections.group.parts.part.description.image.normal", st_collections_group_parts_part_description_image_normal},
|
|
|
|
{"collections.group.parts.part.description.image.tween", st_collections_group_parts_part_description_image_tween},
|
2004-10-05 22:25:03 -07:00
|
|
|
{"collections.group.parts.part.description.image.image", st_images_image}, /* dup */
|
|
|
|
{"collections.group.parts.part.description.image.images.image", st_images_image}, /* dup */
|
2004-10-19 10:01:05 -07:00
|
|
|
{"collections.group.parts.part.description.image.border", st_collections_group_parts_part_description_image_border},
|
2005-03-31 03:40:05 -08:00
|
|
|
{"collections.group.parts.part.description.image.middle", st_collections_group_parts_part_description_image_middle},
|
2009-05-07 06:30:18 -07:00
|
|
|
{"collections.group.parts.part.description.image.scale_hint", st_collections_group_parts_part_description_image_scale_hint},
|
2003-06-27 20:08:25 -07:00
|
|
|
{"collections.group.parts.part.description.fill.smooth", st_collections_group_parts_part_description_fill_smooth},
|
2003-06-13 20:06:36 -07:00
|
|
|
{"collections.group.parts.part.description.fill.origin.relative", st_collections_group_parts_part_description_fill_origin_relative},
|
|
|
|
{"collections.group.parts.part.description.fill.origin.offset", st_collections_group_parts_part_description_fill_origin_offset},
|
|
|
|
{"collections.group.parts.part.description.fill.size.relative", st_collections_group_parts_part_description_fill_size_relative},
|
|
|
|
{"collections.group.parts.part.description.fill.size.offset", st_collections_group_parts_part_description_fill_size_offset},
|
2006-08-02 03:52:44 -07:00
|
|
|
{"collections.group.parts.part.description.fill.angle", st_collections_group_parts_part_description_fill_angle},
|
|
|
|
{"collections.group.parts.part.description.fill.spread", st_collections_group_parts_part_description_fill_spread},
|
2007-07-06 15:36:40 -07:00
|
|
|
{"collections.group.parts.part.description.fill.type", st_collections_group_parts_part_description_fill_type},
|
2003-10-28 22:42:03 -08:00
|
|
|
{"collections.group.parts.part.description.color_class", st_collections_group_parts_part_description_color_class},
|
2003-06-13 20:06:36 -07:00
|
|
|
{"collections.group.parts.part.description.color", st_collections_group_parts_part_description_color},
|
|
|
|
{"collections.group.parts.part.description.color2", st_collections_group_parts_part_description_color2},
|
|
|
|
{"collections.group.parts.part.description.color3", st_collections_group_parts_part_description_color3},
|
|
|
|
{"collections.group.parts.part.description.text.text", st_collections_group_parts_part_description_text_text},
|
2003-10-30 21:07:39 -08:00
|
|
|
{"collections.group.parts.part.description.text.text_class", st_collections_group_parts_part_description_text_text_class},
|
2003-06-13 20:06:36 -07:00
|
|
|
{"collections.group.parts.part.description.text.font", st_collections_group_parts_part_description_text_font},
|
2005-09-12 02:43:49 -07:00
|
|
|
{"collections.group.parts.part.description.text.style", st_collections_group_parts_part_description_text_style},
|
2008-10-22 22:38:06 -07:00
|
|
|
{"collections.group.parts.part.description.text.repch", st_collections_group_parts_part_description_text_repch},
|
2003-06-13 20:06:36 -07:00
|
|
|
{"collections.group.parts.part.description.text.size", st_collections_group_parts_part_description_text_size},
|
|
|
|
{"collections.group.parts.part.description.text.fit", st_collections_group_parts_part_description_text_fit},
|
|
|
|
{"collections.group.parts.part.description.text.min", st_collections_group_parts_part_description_text_min},
|
2006-10-08 23:01:13 -07:00
|
|
|
{"collections.group.parts.part.description.text.max", st_collections_group_parts_part_description_text_max},
|
2003-06-16 06:55:13 -07:00
|
|
|
{"collections.group.parts.part.description.text.align", st_collections_group_parts_part_description_text_align},
|
2004-10-12 20:43:42 -07:00
|
|
|
{"collections.group.parts.part.description.text.source", st_collections_group_parts_part_description_text_source},
|
|
|
|
{"collections.group.parts.part.description.text.text_source", st_collections_group_parts_part_description_text_text_source},
|
2004-10-05 22:25:03 -07:00
|
|
|
{"collections.group.parts.part.description.text.font", st_fonts_font}, /* dup */
|
|
|
|
{"collections.group.parts.part.description.text.fonts.font", st_fonts_font}, /* dup */
|
2005-11-05 19:32:01 -08:00
|
|
|
{"collections.group.parts.part.description.text.elipsis", st_collections_group_parts_part_description_text_elipsis},
|
2006-08-02 03:52:44 -07:00
|
|
|
{"collections.group.parts.part.description.gradient.type", st_collections_group_parts_part_description_gradient_type},
|
2006-08-20 20:00:01 -07:00
|
|
|
{"collections.group.parts.part.description.gradient.rel1.relative", st_collections_group_parts_part_description_gradient_rel1_relative},
|
|
|
|
{"collections.group.parts.part.description.gradient.rel1.offset", st_collections_group_parts_part_description_gradient_rel1_offset},
|
|
|
|
{"collections.group.parts.part.description.gradient.rel2.relative", st_collections_group_parts_part_description_gradient_rel2_relative},
|
|
|
|
{"collections.group.parts.part.description.gradient.rel2.offset", st_collections_group_parts_part_description_gradient_rel2_offset},
|
2006-08-02 03:52:44 -07:00
|
|
|
{"collections.group.parts.part.description.gradient.spectrum", st_collections_group_parts_part_description_gradient_spectrum},
|
2008-11-23 21:15:15 -08:00
|
|
|
{"collections.group.parts.part.description.box.layout", st_collections_group_parts_part_description_box_layout},
|
|
|
|
{"collections.group.parts.part.description.box.align", st_collections_group_parts_part_description_box_align},
|
|
|
|
{"collections.group.parts.part.description.box.padding", st_collections_group_parts_part_description_box_padding},
|
2009-02-28 11:38:35 -08:00
|
|
|
{"collections.group.parts.part.description.box.min", st_collections_group_parts_part_description_box_min},
|
2008-12-17 18:43:20 -08:00
|
|
|
{"collections.group.parts.part.description.table.homogeneous", st_collections_group_parts_part_description_table_homogeneous},
|
|
|
|
{"collections.group.parts.part.description.table.align", st_collections_group_parts_part_description_table_align},
|
|
|
|
{"collections.group.parts.part.description.table.padding", st_collections_group_parts_part_description_table_padding},
|
2009-10-26 18:08:19 -07:00
|
|
|
{"collections.group.parts.part.description.params.int", st_collections_group_parts_part_description_params_int},
|
|
|
|
{"collections.group.parts.part.description.params.double", st_collections_group_parts_part_description_params_double},
|
|
|
|
{"collections.group.parts.part.description.params.string", st_collections_group_parts_part_description_params_string},
|
2004-10-05 22:25:03 -07:00
|
|
|
{"collections.group.parts.part.description.images.image", st_images_image}, /* dup */
|
|
|
|
{"collections.group.parts.part.description.font", st_fonts_font}, /* dup */
|
|
|
|
{"collections.group.parts.part.description.fonts.font", st_fonts_font}, /* dup */
|
2005-09-12 02:43:49 -07:00
|
|
|
{"collections.group.parts.part.description.styles.style.name", st_styles_style_name}, /* dup */
|
|
|
|
{"collections.group.parts.part.description.styles.style.base", st_styles_style_base}, /* dup */
|
|
|
|
{"collections.group.parts.part.description.styles.style.tag", st_styles_style_tag}, /* dup */
|
2008-03-24 01:22:01 -07:00
|
|
|
{"collections.group.parts.part.description.color_classes.color_class.name", st_color_class_name}, /* dup */
|
|
|
|
{"collections.group.parts.part.description.color_classes.color_class.color", st_color_class_color}, /* dup */
|
|
|
|
{"collections.group.parts.part.description.color_classes.color_class.color2", st_color_class_color2}, /* dup */
|
|
|
|
{"collections.group.parts.part.description.color_classes.color_class.color3", st_color_class_color3}, /* dup */
|
2004-10-05 22:25:03 -07:00
|
|
|
{"collections.group.parts.part.description.programs.image", st_images_image}, /* dup */
|
|
|
|
{"collections.group.parts.part.description.programs.images.image", st_images_image}, /* dup */
|
|
|
|
{"collections.group.parts.part.description.programs.font", st_fonts_font}, /* dup */
|
|
|
|
{"collections.group.parts.part.description.programs.fonts.font", st_fonts_font}, /* dup */
|
|
|
|
{"collections.group.parts.part.description.programs.program.name", st_collections_group_programs_program_name}, /* dup */
|
|
|
|
{"collections.group.parts.part.description.programs.program.signal", st_collections_group_programs_program_signal}, /* dup */
|
|
|
|
{"collections.group.parts.part.description.programs.program.source", st_collections_group_programs_program_source}, /* dup */
|
|
|
|
{"collections.group.parts.part.description.programs.program.in", st_collections_group_programs_program_in}, /* dup */
|
|
|
|
{"collections.group.parts.part.description.programs.program.action", st_collections_group_programs_program_action}, /* dup */
|
|
|
|
{"collections.group.parts.part.description.programs.program.transition", st_collections_group_programs_program_transition}, /* dup */
|
|
|
|
{"collections.group.parts.part.description.programs.program.target", st_collections_group_programs_program_target}, /* dup */
|
|
|
|
{"collections.group.parts.part.description.programs.program.after", st_collections_group_programs_program_after}, /* dup */
|
2010-01-05 11:26:18 -08:00
|
|
|
{"collections.group.parts.part.description.programs.program.api", st_collections_group_programs_program_api}, /* dup */
|
2004-10-05 22:25:03 -07:00
|
|
|
{"collections.group.parts.part.description.program.name", st_collections_group_programs_program_name}, /* dup */
|
|
|
|
{"collections.group.parts.part.description.program.signal", st_collections_group_programs_program_signal}, /* dup */
|
|
|
|
{"collections.group.parts.part.description.program.source", st_collections_group_programs_program_source}, /* dup */
|
|
|
|
{"collections.group.parts.part.description.program.in", st_collections_group_programs_program_in}, /* dup */
|
|
|
|
{"collections.group.parts.part.description.program.action", st_collections_group_programs_program_action}, /* dup */
|
|
|
|
{"collections.group.parts.part.description.program.transition", st_collections_group_programs_program_transition}, /* dup */
|
|
|
|
{"collections.group.parts.part.description.program.target", st_collections_group_programs_program_target}, /* dup */
|
|
|
|
{"collections.group.parts.part.description.program.after", st_collections_group_programs_program_after}, /* dup */
|
2010-01-05 11:26:18 -08:00
|
|
|
{"collections.group.parts.part.description.program.api", st_collections_group_programs_program_api}, /* dup */
|
2004-10-05 22:25:03 -07:00
|
|
|
{"collections.group.parts.part.programs.image", st_images_image}, /* dup */
|
|
|
|
{"collections.group.parts.part.programs.images.image", st_images_image}, /* dup */
|
|
|
|
{"collections.group.parts.part.programs.font", st_fonts_font}, /* dup */
|
|
|
|
{"collections.group.parts.part.programs.fonts.font", st_fonts_font}, /* dup */
|
|
|
|
{"collections.group.parts.part.programs.program.name", st_collections_group_programs_program_name}, /* dup */
|
|
|
|
{"collections.group.parts.part.programs.program.signal", st_collections_group_programs_program_signal}, /* dup */
|
|
|
|
{"collections.group.parts.part.programs.program.source", st_collections_group_programs_program_source}, /* dup */
|
|
|
|
{"collections.group.parts.part.programs.program.in", st_collections_group_programs_program_in}, /* dup */
|
|
|
|
{"collections.group.parts.part.programs.program.action", st_collections_group_programs_program_action}, /* dup */
|
|
|
|
{"collections.group.parts.part.programs.program.transition", st_collections_group_programs_program_transition}, /* dup */
|
|
|
|
{"collections.group.parts.part.programs.program.target", st_collections_group_programs_program_target}, /* dup */
|
|
|
|
{"collections.group.parts.part.programs.program.after", st_collections_group_programs_program_after}, /* dup */
|
2010-01-05 11:26:18 -08:00
|
|
|
{"collections.group.parts.part.programs.program.api", st_collections_group_programs_program_api}, /* dup */
|
2004-10-05 22:25:03 -07:00
|
|
|
{"collections.group.parts.part.program.name", st_collections_group_programs_program_name}, /* dup */
|
|
|
|
{"collections.group.parts.part.program.signal", st_collections_group_programs_program_signal}, /* dup */
|
|
|
|
{"collections.group.parts.part.program.source", st_collections_group_programs_program_source}, /* dup */
|
|
|
|
{"collections.group.parts.part.program.in", st_collections_group_programs_program_in}, /* dup */
|
|
|
|
{"collections.group.parts.part.program.action", st_collections_group_programs_program_action}, /* dup */
|
|
|
|
{"collections.group.parts.part.program.transition", st_collections_group_programs_program_transition}, /* dup */
|
|
|
|
{"collections.group.parts.part.program.target", st_collections_group_programs_program_target}, /* dup */
|
|
|
|
{"collections.group.parts.part.program.after", st_collections_group_programs_program_after}, /* dup */
|
2010-01-05 11:26:18 -08:00
|
|
|
{"collections.group.parts.part.program.api", st_collections_group_programs_program_api}, /* dup */
|
2004-10-05 22:25:03 -07:00
|
|
|
{"collections.group.parts.programs.image", st_images_image}, /* dup */
|
|
|
|
{"collections.group.parts.programs.images.image", st_images_image}, /* dup */
|
|
|
|
{"collections.group.parts.programs.font", st_fonts_font}, /* dup */
|
|
|
|
{"collections.group.parts.programs.fonts.font", st_fonts_font}, /* dup */
|
|
|
|
{"collections.group.parts.programs.program.name", st_collections_group_programs_program_name}, /* dup */
|
|
|
|
{"collections.group.parts.programs.program.signal", st_collections_group_programs_program_signal}, /* dup */
|
|
|
|
{"collections.group.parts.programs.program.source", st_collections_group_programs_program_source}, /* dup */
|
|
|
|
{"collections.group.parts.programs.program.in", st_collections_group_programs_program_in}, /* dup */
|
|
|
|
{"collections.group.parts.programs.program.action", st_collections_group_programs_program_action}, /* dup */
|
|
|
|
{"collections.group.parts.programs.program.transition", st_collections_group_programs_program_transition}, /* dup */
|
|
|
|
{"collections.group.parts.programs.program.target", st_collections_group_programs_program_target}, /* dup */
|
|
|
|
{"collections.group.parts.programs.program.after", st_collections_group_programs_program_after},
|
2010-01-05 11:26:18 -08:00
|
|
|
{"collections.group.parts.programs.program.api", st_collections_group_programs_program_api},
|
2004-10-05 22:25:03 -07:00
|
|
|
{"collections.group.parts.program.name", st_collections_group_programs_program_name}, /* dup */
|
|
|
|
{"collections.group.parts.program.signal", st_collections_group_programs_program_signal}, /* dup */
|
|
|
|
{"collections.group.parts.program.source", st_collections_group_programs_program_source}, /* dup */
|
|
|
|
{"collections.group.parts.program.in", st_collections_group_programs_program_in}, /* dup */
|
|
|
|
{"collections.group.parts.program.action", st_collections_group_programs_program_action}, /* dup */
|
|
|
|
{"collections.group.parts.program.transition", st_collections_group_programs_program_transition}, /* dup */
|
|
|
|
{"collections.group.parts.program.target", st_collections_group_programs_program_target}, /* dup */
|
|
|
|
{"collections.group.parts.program.after", st_collections_group_programs_program_after}, /* dup */
|
2010-01-05 11:26:18 -08:00
|
|
|
{"collections.group.parts.program.api", st_collections_group_programs_program_api}, /* dup */
|
2004-10-05 22:25:03 -07:00
|
|
|
{"collections.group.program.name", st_collections_group_programs_program_name}, /* dup */
|
|
|
|
{"collections.group.program.signal", st_collections_group_programs_program_signal}, /* dup */
|
|
|
|
{"collections.group.program.source", st_collections_group_programs_program_source}, /* dup */
|
|
|
|
{"collections.group.program.in", st_collections_group_programs_program_in}, /* dup */
|
|
|
|
{"collections.group.program.action", st_collections_group_programs_program_action}, /* dup */
|
|
|
|
{"collections.group.program.transition", st_collections_group_programs_program_transition}, /* dup */
|
|
|
|
{"collections.group.program.target", st_collections_group_programs_program_target}, /* dup */
|
|
|
|
{"collections.group.program.after", st_collections_group_programs_program_after}, /* dup */
|
2010-01-05 11:26:18 -08:00
|
|
|
{"collections.group.program.api", st_collections_group_programs_program_api}, /* dup */
|
2003-06-16 06:55:13 -07:00
|
|
|
{"collections.group.programs.program.name", st_collections_group_programs_program_name},
|
|
|
|
{"collections.group.programs.program.signal", st_collections_group_programs_program_signal},
|
|
|
|
{"collections.group.programs.program.source", st_collections_group_programs_program_source},
|
2003-06-27 21:20:41 -07:00
|
|
|
{"collections.group.programs.program.in", st_collections_group_programs_program_in},
|
2003-06-16 06:55:13 -07:00
|
|
|
{"collections.group.programs.program.action", st_collections_group_programs_program_action},
|
|
|
|
{"collections.group.programs.program.transition", st_collections_group_programs_program_transition},
|
|
|
|
{"collections.group.programs.program.target", st_collections_group_programs_program_target},
|
2004-10-05 22:25:03 -07:00
|
|
|
{"collections.group.programs.program.after", st_collections_group_programs_program_after},
|
2010-01-05 11:26:18 -08:00
|
|
|
{"collections.group.programs.program.api", st_collections_group_programs_program_api},
|
2004-10-05 22:25:03 -07:00
|
|
|
{"collections.group.programs.image", st_images_image}, /* dup */
|
|
|
|
{"collections.group.programs.images.image", st_images_image}, /* dup */
|
|
|
|
{"collections.group.programs.font", st_fonts_font}, /* dup */
|
|
|
|
{"collections.group.programs.fonts.font", st_fonts_font} /* dup */
|
2003-06-13 20:06:36 -07:00
|
|
|
};
|
|
|
|
|
2003-06-11 06:20:48 -07:00
|
|
|
New_Object_Handler object_handlers[] =
|
|
|
|
{
|
2009-11-23 07:03:19 -08:00
|
|
|
{"externals", NULL},
|
2004-10-05 22:25:03 -07:00
|
|
|
{"images", NULL},
|
|
|
|
{"fonts", NULL},
|
2003-08-05 07:33:35 -07:00
|
|
|
{"data", NULL},
|
2005-09-12 02:43:49 -07:00
|
|
|
{"styles", NULL},
|
|
|
|
{"styles.style", ob_styles_style},
|
2006-01-10 19:19:45 -08:00
|
|
|
{"color_classes", NULL},
|
|
|
|
{"color_classes.color_class", ob_color_class},
|
2006-08-02 03:52:44 -07:00
|
|
|
{"spectra", NULL},
|
|
|
|
{"spectra.spectrum", ob_spectrum},
|
2003-06-11 07:14:23 -07:00
|
|
|
{"collections", ob_collections},
|
2009-11-24 09:55:11 -08:00
|
|
|
{"collections.externals", NULL}, /* dup */
|
2004-10-05 22:25:03 -07:00
|
|
|
{"collections.images", NULL}, /* dup */
|
|
|
|
{"collections.fonts", NULL}, /* dup */
|
2005-09-12 02:43:49 -07:00
|
|
|
{"collections.styles", NULL}, /* dup */
|
|
|
|
{"collections.styles.style", ob_styles_style}, /* dup */
|
2006-01-10 19:19:45 -08:00
|
|
|
{"collections.color_classes", NULL}, /* dup */
|
|
|
|
{"collections.color_classes.color_class", ob_color_class}, /* dup */
|
2003-06-12 15:34:51 -07:00
|
|
|
{"collections.group", ob_collections_group},
|
2003-08-05 07:33:35 -07:00
|
|
|
{"collections.group.data", NULL},
|
2004-03-27 21:26:17 -08:00
|
|
|
{"collections.group.script", ob_collections_group_script},
|
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-15 19:34:02 -07:00
|
|
|
{"collections.group.lua_script", ob_collections_group_lua_script},
|
2009-11-24 09:55:11 -08:00
|
|
|
{"collections.group.externals", NULL}, /* dup */
|
2004-10-05 22:25:03 -07:00
|
|
|
{"collections.group.images", NULL}, /* dup */
|
|
|
|
{"collections.group.fonts", NULL}, /* dup */
|
2005-09-12 02:43:49 -07:00
|
|
|
{"collections.group.styles", NULL}, /* dup */
|
|
|
|
{"collections.group.styles.style", ob_styles_style}, /* dup */
|
2006-01-10 19:19:45 -08:00
|
|
|
{"collections.group.color_classes", NULL}, /* dup */
|
|
|
|
{"collections.group.color_classes.color_class", ob_color_class}, /* dup */
|
2003-08-05 07:33:35 -07:00
|
|
|
{"collections.group.parts", NULL},
|
2004-10-05 22:25:03 -07:00
|
|
|
{"collections.group.parts.images", NULL}, /* dup */
|
|
|
|
{"collections.group.parts.fonts", NULL}, /* dup */
|
2005-09-12 02:43:49 -07:00
|
|
|
{"collections.group.parts.styles", NULL}, /* dup */
|
|
|
|
{"collections.group.parts.styles.style", ob_styles_style}, /* dup */
|
2006-01-10 19:19:45 -08:00
|
|
|
{"collections.group.parts.color_classes", NULL}, /* dup */
|
|
|
|
{"collections.group.parts.color_classes.color_class", ob_color_class}, /* dup */
|
2003-06-12 15:34:51 -07:00
|
|
|
{"collections.group.parts.part", ob_collections_group_parts_part},
|
2003-07-27 06:16:51 -07:00
|
|
|
{"collections.group.parts.part.dragable", NULL},
|
2004-10-05 22:25:03 -07:00
|
|
|
{"collections.group.parts.part.images", NULL}, /* dup */
|
|
|
|
{"collections.group.parts.part.fonts", NULL}, /* dup */
|
2005-09-12 02:43:49 -07:00
|
|
|
{"collections.group.parts.part.styles", NULL}, /* dup */
|
|
|
|
{"collections.group.parts.part.styles.style", ob_styles_style}, /* dup */
|
2006-01-10 19:19:45 -08:00
|
|
|
{"collections.group.parts.part.color_classes", NULL}, /* dup */
|
|
|
|
{"collections.group.parts.part.color_classes.color_class", ob_color_class}, /* dup */
|
2008-11-23 21:15:15 -08:00
|
|
|
{"collections.group.parts.part.box", NULL},
|
|
|
|
{"collections.group.parts.part.box.items", NULL},
|
|
|
|
{"collections.group.parts.part.box.items.item", ob_collections_group_parts_part_box_items_item},
|
2008-12-17 18:43:20 -08:00
|
|
|
{"collections.group.parts.part.table", NULL},
|
|
|
|
{"collections.group.parts.part.table.items", NULL},
|
|
|
|
{"collections.group.parts.part.table.items.item", ob_collections_group_parts_part_box_items_item}, /* dup */
|
2003-06-12 15:34:51 -07:00
|
|
|
{"collections.group.parts.part.description", ob_collections_group_parts_part_description},
|
2003-06-13 20:06:36 -07:00
|
|
|
{"collections.group.parts.part.description.rel1", NULL},
|
|
|
|
{"collections.group.parts.part.description.rel2", NULL},
|
2004-10-05 22:25:03 -07:00
|
|
|
{"collections.group.parts.part.description.image", NULL}, /* dup */
|
|
|
|
{"collections.group.parts.part.description.image.images", NULL}, /* dup */
|
2003-06-13 20:06:36 -07:00
|
|
|
{"collections.group.parts.part.description.fill", NULL},
|
|
|
|
{"collections.group.parts.part.description.fill.origin", NULL},
|
|
|
|
{"collections.group.parts.part.description.fill.size", NULL},
|
|
|
|
{"collections.group.parts.part.description.text", NULL},
|
2004-10-05 22:25:03 -07:00
|
|
|
{"collections.group.parts.part.description.text.fonts", NULL}, /* dup */
|
|
|
|
{"collections.group.parts.part.description.images", NULL}, /* dup */
|
|
|
|
{"collections.group.parts.part.description.fonts", NULL}, /* dup */
|
2005-09-12 02:43:49 -07:00
|
|
|
{"collections.group.parts.part.description.styles", NULL}, /* dup */
|
|
|
|
{"collections.group.parts.part.description.styles.style", ob_styles_style}, /* dup */
|
2006-08-02 03:52:44 -07:00
|
|
|
{"collections.group.parts.part.description.gradient", NULL},
|
2006-08-20 20:14:09 -07:00
|
|
|
{"collections.group.parts.part.description.gradient.rel1", NULL},
|
|
|
|
{"collections.group.parts.part.description.gradient.rel2", NULL},
|
2008-11-23 21:15:15 -08:00
|
|
|
{"collections.group.parts.part.description.box", NULL},
|
2008-12-17 18:43:20 -08:00
|
|
|
{"collections.group.parts.part.description.table", NULL},
|
2009-10-26 18:08:19 -07:00
|
|
|
{"collections.group.parts.part.description.params", NULL},
|
2006-01-10 19:19:45 -08:00
|
|
|
{"collections.group.parts.part.description.color_classes", NULL}, /* dup */
|
|
|
|
{"collections.group.parts.part.description.color_classes.color_class", ob_color_class}, /* dup */
|
2004-10-05 22:25:03 -07:00
|
|
|
{"collections.group.parts.part.description.program", ob_collections_group_programs_program}, /* dup */
|
|
|
|
{"collections.group.parts.part.description.program.script", ob_collections_group_programs_program_script}, /* dup */
|
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-15 19:34:02 -07:00
|
|
|
{"collections.group.parts.part.description.program.lua_script", ob_collections_group_programs_program_lua_script}, /* dup */
|
2004-10-05 22:25:03 -07:00
|
|
|
{"collections.group.parts.part.description.programs", NULL}, /* dup */
|
|
|
|
{"collections.group.parts.part.description.programs.images", NULL}, /* dup */
|
|
|
|
{"collections.group.parts.part.description.programs.fonts", NULL}, /* dup */
|
|
|
|
{"collections.group.parts.part.description.programs.program", ob_collections_group_programs_program}, /* dup */
|
|
|
|
{"collections.group.parts.part.description.programs.program.script", ob_collections_group_programs_program_script}, /* dup */
|
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-15 19:34:02 -07:00
|
|
|
{"collections.group.parts.part.description.programs.program.lua_script", ob_collections_group_programs_program_lua_script}, /* dup */
|
2004-10-05 22:25:03 -07:00
|
|
|
{"collections.group.parts.part.description.script", ob_collections_group_script}, /* dup */
|
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-15 19:34:02 -07:00
|
|
|
{"collections.group.parts.part.description.lua_script", ob_collections_group_lua_script}, /* dup */
|
2004-10-05 22:25:03 -07:00
|
|
|
{"collections.group.parts.part.program", ob_collections_group_programs_program}, /* dup */
|
|
|
|
{"collections.group.parts.part.program.script", ob_collections_group_programs_program_script}, /* dup */
|
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-15 19:34:02 -07:00
|
|
|
{"collections.group.parts.part.program.lua_script", ob_collections_group_programs_program_lua_script}, /* dup */
|
2004-10-05 22:25:03 -07:00
|
|
|
{"collections.group.parts.part.programs", NULL}, /* dup */
|
|
|
|
{"collections.group.parts.part.programs.images", NULL}, /* dup */
|
|
|
|
{"collections.group.parts.part.programs.fonts", NULL}, /* dup */
|
|
|
|
{"collections.group.parts.part.programs.program", ob_collections_group_programs_program}, /* dup */
|
|
|
|
{"collections.group.parts.part.programs.program.script", ob_collections_group_programs_program_script}, /* dup */
|
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-15 19:34:02 -07:00
|
|
|
{"collections.group.parts.part.programs.program.lua_script", ob_collections_group_programs_program_lua_script}, /* dup */
|
2004-10-05 22:25:03 -07:00
|
|
|
{"collections.group.parts.part.script", ob_collections_group_script}, /* dup */
|
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-15 19:34:02 -07:00
|
|
|
{"collections.group.parts.part.lua_script", ob_collections_group_lua_script}, /* dup */
|
2004-10-05 22:25:03 -07:00
|
|
|
{"collections.group.parts.program", ob_collections_group_programs_program}, /* dup */
|
|
|
|
{"collections.group.parts.program.script", ob_collections_group_programs_program_script}, /* dup */
|
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-15 19:34:02 -07:00
|
|
|
{"collections.group.parts.program.lua_script", ob_collections_group_programs_program_lua_script}, /* dup */
|
2004-10-05 22:25:03 -07:00
|
|
|
{"collections.group.parts.programs", NULL}, /* dup */
|
|
|
|
{"collections.group.parts.programs.images", NULL}, /* dup */
|
|
|
|
{"collections.group.parts.programs.fonts", NULL}, /* dup */
|
|
|
|
{"collections.group.parts.programs.program", ob_collections_group_programs_program}, /* dup */
|
|
|
|
{"collections.group.parts.programs.program.script", ob_collections_group_programs_program_script}, /* dup */
|
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-15 19:34:02 -07:00
|
|
|
{"collections.group.parts.programs.program.lua_script", ob_collections_group_programs_program_lua_script}, /* dup */
|
2004-10-05 22:25:03 -07:00
|
|
|
{"collections.group.parts.script", ob_collections_group_script}, /* dup */
|
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-15 19:34:02 -07:00
|
|
|
{"collections.group.parts.lua_script", ob_collections_group_lua_script}, /* dup */
|
2004-10-05 22:25:03 -07:00
|
|
|
{"collections.group.program", ob_collections_group_programs_program}, /* dup */
|
|
|
|
{"collections.group.program.script", ob_collections_group_programs_program_script}, /* dup */
|
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-15 19:34:02 -07:00
|
|
|
{"collections.group.program.lua_script", ob_collections_group_programs_program_lua_script}, /* dup */
|
2004-10-05 22:25:03 -07:00
|
|
|
{"collections.group.programs", NULL},
|
|
|
|
{"collections.group.programs.images", NULL}, /* dup */
|
|
|
|
{"collections.group.programs.fonts", NULL}, /* dup */
|
2003-06-16 06:55:13 -07:00
|
|
|
{"collections.group.programs.program", ob_collections_group_programs_program},
|
2004-10-05 22:25:03 -07:00
|
|
|
{"collections.group.programs.program.script", ob_collections_group_programs_program_script},
|
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-15 19:34:02 -07:00
|
|
|
{"collections.group.programs.program.lua_script", ob_collections_group_programs_program_lua_script},
|
|
|
|
{"collections.group.programs.script", ob_collections_group_script}, /* dup */
|
|
|
|
{"collections.group.programs.lua_script", ob_collections_group_lua_script} /* dup */
|
2003-06-11 06:20:48 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
/*****/
|
|
|
|
|
|
|
|
int
|
|
|
|
object_handler_num(void)
|
|
|
|
{
|
|
|
|
return sizeof(object_handlers) / sizeof (New_Object_Handler);
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
statement_handler_num(void)
|
|
|
|
{
|
|
|
|
return sizeof(statement_handlers) / sizeof (New_Object_Handler);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*****/
|
|
|
|
|
2009-11-23 07:03:19 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
|
|
|
|
@block
|
|
|
|
externals
|
|
|
|
@context
|
|
|
|
externals {
|
|
|
|
external: "name";
|
|
|
|
}
|
|
|
|
@description
|
|
|
|
The "externals" block is used to list each external module file that will be used in others
|
|
|
|
programs.
|
|
|
|
@endblock
|
|
|
|
|
|
|
|
@property
|
|
|
|
external
|
|
|
|
@parameters
|
|
|
|
[external filename]
|
|
|
|
@endproperty
|
|
|
|
*/
|
|
|
|
static void
|
|
|
|
st_externals_external(void)
|
|
|
|
{
|
|
|
|
External *ex;
|
|
|
|
Edje_External_Directory_Entry *ext;
|
|
|
|
|
|
|
|
check_arg_count(1);
|
|
|
|
|
|
|
|
if (!edje_file->external_dir)
|
|
|
|
edje_file->external_dir = mem_alloc(SZ(Edje_External_Directory));
|
|
|
|
|
|
|
|
ex = mem_alloc(SZ(External));
|
|
|
|
ex->name = parse_str(0);
|
|
|
|
{
|
|
|
|
Eina_List *l;
|
|
|
|
External *lex;
|
|
|
|
|
|
|
|
EINA_LIST_FOREACH(externals, l, lex)
|
|
|
|
{
|
|
|
|
if (!strcmp(lex->name, ex->name))
|
|
|
|
{
|
|
|
|
free(ex->name);
|
|
|
|
free(ex);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
externals = eina_list_append(externals, ex);
|
|
|
|
|
|
|
|
if (edje_file->external_dir)
|
|
|
|
{
|
|
|
|
ext = mem_alloc(SZ(Edje_External_Directory_Entry));
|
|
|
|
ext->entry = mem_strdup(ex->name);
|
|
|
|
edje_file->external_dir->entries = eina_list_append(edje_file->external_dir->entries, ext);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-11-23 08:43:03 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
|
|
|
|
@block
|
|
|
|
images
|
|
|
|
@context
|
|
|
|
images {
|
|
|
|
image: "filename1.ext" COMP;
|
|
|
|
image: "filename2.ext" LOSSY 99;
|
|
|
|
..
|
|
|
|
}
|
|
|
|
@description
|
|
|
|
The "images" block is used to list each image file that will be used in
|
|
|
|
the theme along with its compression method (if any).
|
|
|
|
Besides the domcument's root, additional "images" blocks can be
|
|
|
|
included inside other blocks, normally "collections", "group" and
|
|
|
|
"part", easing mantienance of the file list when the theme is split
|
|
|
|
among multiple files.
|
|
|
|
@endblock
|
|
|
|
|
|
|
|
@property
|
|
|
|
image
|
|
|
|
@parameters
|
|
|
|
[image file] [compression method] (compression level)
|
|
|
|
@effect
|
|
|
|
Used to include each image file. The full path to the directory holding
|
|
|
|
the images can be defined later with edje_cc's "-id" option.
|
|
|
|
Compression methods:
|
|
|
|
@li RAW: Uncompressed.
|
|
|
|
@li COMP: Lossless compression.
|
|
|
|
@li LOSSY [0-100]: Lossy comression with quality from 0 to 100.
|
2009-12-18 04:34:07 -08:00
|
|
|
@li USER: Do not embed the file, refer to the external file instead.
|
2007-11-23 08:43:03 -08:00
|
|
|
@endproperty
|
|
|
|
*/
|
2003-06-11 06:20:48 -07:00
|
|
|
static void
|
|
|
|
st_images_image(void)
|
|
|
|
{
|
|
|
|
Edje_Image_Directory_Entry *img;
|
2003-06-12 06:02:28 -07:00
|
|
|
int v;
|
2008-03-24 01:22:01 -07:00
|
|
|
|
2004-10-05 22:25:03 -07:00
|
|
|
if (!edje_file->image_dir)
|
|
|
|
edje_file->image_dir = mem_alloc(SZ(Edje_Image_Directory));
|
|
|
|
img = mem_alloc(SZ(Edje_Image_Directory_Entry));
|
2003-06-12 06:02:28 -07:00
|
|
|
img->entry = parse_str(0);
|
2004-10-05 22:25:03 -07:00
|
|
|
{
|
2008-10-22 04:34:42 -07:00
|
|
|
Eina_List *l;
|
|
|
|
Edje_Image_Directory_Entry *limg;
|
2008-03-24 01:22:01 -07:00
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
EINA_LIST_FOREACH(edje_file->image_dir->entries, l, limg)
|
2004-10-05 22:25:03 -07:00
|
|
|
{
|
|
|
|
if (!strcmp(limg->entry, img->entry))
|
|
|
|
{
|
|
|
|
free(img->entry);
|
|
|
|
free(img);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2008-10-22 04:34:42 -07:00
|
|
|
edje_file->image_dir->entries = eina_list_append(edje_file->image_dir->entries, img);
|
|
|
|
img->id = eina_list_count(edje_file->image_dir->entries) - 1;
|
2003-06-12 06:02:28 -07:00
|
|
|
v = parse_enum(1,
|
|
|
|
"RAW", 0,
|
|
|
|
"COMP", 1,
|
|
|
|
"LOSSY", 2,
|
|
|
|
"USER", 3,
|
|
|
|
NULL);
|
|
|
|
if (v == 0)
|
2003-06-11 06:20:48 -07:00
|
|
|
{
|
2003-06-12 06:02:28 -07:00
|
|
|
img->source_type = EDJE_IMAGE_SOURCE_TYPE_INLINE_PERFECT;
|
|
|
|
img->source_param = 0;
|
2003-06-11 06:20:48 -07:00
|
|
|
}
|
2003-06-12 06:02:28 -07:00
|
|
|
else if (v == 1)
|
2003-06-11 06:20:48 -07:00
|
|
|
{
|
2003-06-12 06:02:28 -07:00
|
|
|
img->source_type = EDJE_IMAGE_SOURCE_TYPE_INLINE_PERFECT;
|
|
|
|
img->source_param = 1;
|
2003-06-11 06:20:48 -07:00
|
|
|
}
|
2003-06-12 06:02:28 -07:00
|
|
|
else if (v == 2)
|
2003-06-11 06:20:48 -07:00
|
|
|
{
|
2003-06-12 06:02:28 -07:00
|
|
|
img->source_type = EDJE_IMAGE_SOURCE_TYPE_INLINE_LOSSY;
|
|
|
|
img->source_param = 0;
|
2003-06-11 06:20:48 -07:00
|
|
|
}
|
2003-06-12 06:02:28 -07:00
|
|
|
else if (v == 3)
|
2003-06-11 06:20:48 -07:00
|
|
|
{
|
2003-06-12 06:02:28 -07:00
|
|
|
img->source_type = EDJE_IMAGE_SOURCE_TYPE_EXTERNAL;
|
|
|
|
img->source_param = 0;
|
2003-06-11 06:20:48 -07:00
|
|
|
}
|
2004-10-23 13:12:21 -07:00
|
|
|
if (img->source_type != EDJE_IMAGE_SOURCE_TYPE_INLINE_LOSSY)
|
|
|
|
check_arg_count(2);
|
|
|
|
else
|
|
|
|
{
|
|
|
|
img->source_param = parse_int_range(2, 0, 100);
|
|
|
|
check_arg_count(3);
|
|
|
|
}
|
2003-06-11 06:20:48 -07:00
|
|
|
}
|
2003-06-11 07:14:23 -07:00
|
|
|
|
2007-11-23 08:43:03 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
|
|
|
|
@block
|
|
|
|
fonts
|
|
|
|
@context
|
|
|
|
fonts {
|
|
|
|
font: "filename1.ext" "fontname";
|
|
|
|
font: "filename2.ext" "otherfontname";
|
|
|
|
..
|
|
|
|
}
|
|
|
|
@description
|
|
|
|
The "fonts" block is used to list each font file with an alias used later
|
|
|
|
in the theme. As with the "images" block, additional "fonts" blocks can
|
|
|
|
be included inside other blocks.
|
|
|
|
@endblock
|
|
|
|
|
|
|
|
@property
|
|
|
|
font
|
|
|
|
@parameters
|
|
|
|
[font filename] [font alias]
|
|
|
|
@effect
|
|
|
|
Defines each font "file" and "alias", the full path to the directory
|
|
|
|
holding the font files can be defined with edje_cc's "-fd" option.
|
|
|
|
@endproperty
|
|
|
|
*/
|
2004-01-22 18:13:42 -08:00
|
|
|
static void
|
|
|
|
st_fonts_font(void)
|
|
|
|
{
|
|
|
|
Font *fn;
|
2004-08-30 01:07:00 -07:00
|
|
|
Edje_Font_Directory_Entry *fnt;
|
2004-10-23 13:12:21 -07:00
|
|
|
|
|
|
|
check_arg_count(2);
|
2008-03-24 01:22:01 -07:00
|
|
|
|
2004-10-05 22:25:03 -07:00
|
|
|
if (!edje_file->font_dir)
|
|
|
|
edje_file->font_dir = mem_alloc(SZ(Edje_Font_Directory));
|
2008-03-24 01:22:01 -07:00
|
|
|
|
2004-08-30 21:00:14 -07:00
|
|
|
fn = mem_alloc(SZ(Font));
|
2004-01-22 18:13:42 -08:00
|
|
|
fn->file = parse_str(0);
|
|
|
|
fn->name = parse_str(1);
|
2004-10-05 22:25:03 -07:00
|
|
|
{
|
2008-10-22 04:34:42 -07:00
|
|
|
Eina_List *l;
|
|
|
|
Font *lfn;
|
2008-03-24 01:22:01 -07:00
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
EINA_LIST_FOREACH(fonts, l, lfn)
|
2004-10-05 22:25:03 -07:00
|
|
|
{
|
|
|
|
if (!strcmp(lfn->name, fn->name))
|
|
|
|
{
|
|
|
|
free(fn->file);
|
|
|
|
free(fn->name);
|
|
|
|
free(fn);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2008-10-22 04:34:42 -07:00
|
|
|
fonts = eina_list_append(fonts, fn);
|
2008-03-24 01:22:01 -07:00
|
|
|
|
2004-08-30 21:00:14 -07:00
|
|
|
if (edje_file->font_dir)
|
2004-09-12 20:23:29 -07:00
|
|
|
{
|
|
|
|
fnt = mem_alloc(SZ(Edje_Font_Directory_Entry));
|
|
|
|
fnt->entry = mem_strdup(fn->name);
|
2008-10-22 04:34:42 -07:00
|
|
|
edje_file->font_dir->entries = eina_list_append(edje_file->font_dir->entries, fnt);
|
2004-09-12 20:23:29 -07:00
|
|
|
}
|
2004-01-22 18:13:42 -08:00
|
|
|
}
|
|
|
|
|
2007-11-23 08:43:03 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@block
|
|
|
|
data
|
|
|
|
@context
|
|
|
|
data {
|
2008-10-16 17:41:14 -07:00
|
|
|
item: "key" "value";
|
|
|
|
file: "otherkey" "filename.ext";
|
2007-11-23 08:43:03 -08:00
|
|
|
..
|
|
|
|
}
|
|
|
|
@description
|
|
|
|
The "data" block is used to pass arbitrary parameters from the theme to
|
|
|
|
the application. Unlike the "images" and "fonts" blocks, additional
|
|
|
|
"data" blocks can only be included inside the "group" block.
|
|
|
|
@endblock
|
|
|
|
|
|
|
|
@property
|
|
|
|
item
|
|
|
|
@parameters
|
|
|
|
[parameter name] [parameter value]
|
|
|
|
@effect
|
2008-10-16 17:41:14 -07:00
|
|
|
Defines a new parameter, the value will be the string specified next to
|
|
|
|
it.
|
2007-11-23 08:43:03 -08:00
|
|
|
@endproperty
|
|
|
|
*/
|
2003-08-05 07:33:35 -07:00
|
|
|
static void
|
|
|
|
st_data_item(void)
|
|
|
|
{
|
|
|
|
Edje_Data *di;
|
2004-10-23 13:12:21 -07:00
|
|
|
|
|
|
|
check_arg_count(2);
|
2008-03-24 01:22:01 -07:00
|
|
|
|
2004-08-30 21:00:14 -07:00
|
|
|
di = mem_alloc(SZ(Edje_Data));
|
2003-08-05 07:33:35 -07:00
|
|
|
di->key = parse_str(0);
|
|
|
|
di->value = parse_str(1);
|
2008-10-22 04:34:42 -07:00
|
|
|
edje_file->data = eina_list_append(edje_file->data, di);
|
2003-08-05 07:33:35 -07:00
|
|
|
}
|
|
|
|
|
2008-01-20 17:03:04 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@property
|
|
|
|
file
|
|
|
|
@parameters
|
|
|
|
[parameter name] [parameter filename]
|
|
|
|
@effect
|
2008-10-16 17:41:14 -07:00
|
|
|
Defines a new parameter , the value will be the contents of the
|
|
|
|
specified file formated as a single string of text. This property only
|
|
|
|
works with plain text files.
|
2008-01-20 17:03:04 -08:00
|
|
|
@endproperty
|
|
|
|
*/
|
|
|
|
static void
|
|
|
|
st_data_file(void)
|
|
|
|
{
|
|
|
|
const char *data;
|
|
|
|
const char *over;
|
|
|
|
Edje_Data *di;
|
|
|
|
char *filename;
|
|
|
|
char *value;
|
|
|
|
int fd;
|
|
|
|
int i;
|
|
|
|
struct stat buf;
|
|
|
|
|
|
|
|
check_arg_count(2);
|
|
|
|
|
|
|
|
di = mem_alloc(SZ(Edje_Data));
|
|
|
|
di->key = parse_str(0);
|
|
|
|
filename = parse_str(1);
|
|
|
|
|
2009-02-19 02:13:28 -08:00
|
|
|
fd = open(filename, O_RDONLY | O_BINARY, S_IRUSR | S_IWUSR);
|
2008-01-20 17:03:04 -08:00
|
|
|
if (fd < 0)
|
|
|
|
{
|
2009-12-22 05:46:00 -08:00
|
|
|
ERR("%s: Error. %s:%i when opening file \"%s\": \"%s\"",
|
|
|
|
progname, file_in, line, filename, strerror(errno));
|
2008-01-20 17:03:04 -08:00
|
|
|
exit(-1);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (fstat(fd, &buf))
|
|
|
|
{
|
2009-12-22 05:46:00 -08:00
|
|
|
ERR("%s: Error. %s:%i when stating file \"%s\": \"%s\"",
|
|
|
|
progname, file_in, line, filename, strerror(errno));
|
2008-01-20 17:03:04 -08:00
|
|
|
exit(-1);
|
|
|
|
}
|
|
|
|
|
|
|
|
data = mmap(NULL, buf.st_size, PROT_READ, MAP_SHARED, fd, 0);
|
2008-05-28 19:00:04 -07:00
|
|
|
if (data == MAP_FAILED)
|
2008-01-20 17:03:04 -08:00
|
|
|
{
|
2009-12-22 05:46:00 -08:00
|
|
|
ERR("%s: Error. %s:%i when mapping file \"%s\": \"%s\"",
|
|
|
|
progname, file_in, line, filename, strerror(errno));
|
2008-01-20 17:03:04 -08:00
|
|
|
exit(-1);
|
|
|
|
}
|
|
|
|
|
|
|
|
over = data;
|
|
|
|
for (i = 0; i < buf.st_size; ++i, ++over)
|
|
|
|
if (*over == '\0')
|
|
|
|
{
|
2009-12-22 05:46:00 -08:00
|
|
|
ERR("%s: Error. %s:%i file \"%s\" is a binary file.",
|
2008-01-20 17:03:04 -08:00
|
|
|
progname, file_in, line, filename);
|
|
|
|
exit(-1);
|
|
|
|
}
|
|
|
|
|
|
|
|
value = malloc(sizeof (char) * buf.st_size + 1);
|
|
|
|
snprintf(value, buf.st_size + 1, "%s", data);
|
|
|
|
|
|
|
|
munmap((void*)data, buf.st_size);
|
|
|
|
close(fd);
|
|
|
|
|
|
|
|
di->value = value;
|
2008-10-22 04:34:42 -07:00
|
|
|
edje_file->data = eina_list_append(edje_file->data, di);
|
2008-01-20 17:03:04 -08:00
|
|
|
|
|
|
|
free(filename);
|
|
|
|
}
|
|
|
|
|
2007-11-23 08:43:03 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@block
|
|
|
|
color_classes
|
|
|
|
@context
|
|
|
|
color_classes {
|
|
|
|
color_class {
|
|
|
|
name: "colorclassname";
|
|
|
|
color: [0-255] [0-255] [0-255] [0-255];
|
|
|
|
color2: [0-255] [0-255] [0-255] [0-255];
|
|
|
|
color3: [0-255] [0-255] [0-255] [0-255]
|
|
|
|
}
|
|
|
|
..
|
|
|
|
}
|
|
|
|
@description
|
|
|
|
The "color_classes" block contains a list of one or more "color_class"
|
|
|
|
blocks. Each "color_class" allows the designer to name an arbitrary
|
|
|
|
group of colors to be used in the theme, the application can use that
|
|
|
|
name to alter the color values at runtime.
|
|
|
|
@endblock
|
|
|
|
*/
|
2006-01-10 19:19:45 -08:00
|
|
|
static void
|
|
|
|
ob_color_class(void)
|
|
|
|
{
|
|
|
|
Edje_Color_Class *cc;
|
|
|
|
|
|
|
|
cc = mem_alloc(SZ(Edje_Color_Class));
|
2008-10-22 04:34:42 -07:00
|
|
|
edje_file->color_classes = eina_list_append(edje_file->color_classes, cc);
|
2006-01-10 19:19:45 -08:00
|
|
|
|
|
|
|
cc->r = 0;
|
|
|
|
cc->g = 0;
|
|
|
|
cc->b = 0;
|
|
|
|
cc->a = 0;
|
|
|
|
cc->r2 = 0;
|
|
|
|
cc->g2 = 0;
|
|
|
|
cc->b2 = 0;
|
|
|
|
cc->a2 = 0;
|
|
|
|
cc->r3 = 0;
|
|
|
|
cc->g3 = 0;
|
|
|
|
cc->b3 = 0;
|
|
|
|
cc->a3 = 0;
|
|
|
|
}
|
|
|
|
|
2007-11-23 08:43:03 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
|
|
|
|
@property
|
|
|
|
name
|
|
|
|
@parameters
|
|
|
|
[color class name]
|
|
|
|
@effect
|
|
|
|
Sets the name for the color class, used as reference by both the theme
|
|
|
|
and the application.
|
|
|
|
@endproperty
|
|
|
|
*/
|
2006-01-10 19:19:45 -08:00
|
|
|
static void
|
|
|
|
st_color_class_name(void)
|
|
|
|
{
|
|
|
|
Edje_Color_Class *cc, *tcc;
|
2008-10-22 04:34:42 -07:00
|
|
|
Eina_List *l;
|
2008-03-24 01:22:01 -07:00
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
cc = eina_list_data_get(eina_list_last(edje_file->color_classes));
|
2006-01-10 19:19:45 -08:00
|
|
|
cc->name = parse_str(0);
|
2008-10-22 04:34:42 -07:00
|
|
|
EINA_LIST_FOREACH(edje_file->color_classes, l, tcc)
|
2006-01-10 19:19:45 -08:00
|
|
|
{
|
|
|
|
if ((cc != tcc) && (!strcmp(cc->name, tcc->name)))
|
|
|
|
{
|
|
|
|
fprintf(stderr, "%s: Error. parse error %s:%i. There is already a color class named \"%s\"\n",
|
|
|
|
progname, file_in, line - 1, cc->name);
|
|
|
|
exit(-1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-11-23 08:43:03 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@property
|
|
|
|
color
|
|
|
|
@parameters
|
|
|
|
[red] [green] [blue] [alpha]
|
|
|
|
@effect
|
|
|
|
The main color.
|
|
|
|
@endproperty
|
|
|
|
*/
|
2006-01-10 19:19:45 -08:00
|
|
|
static void
|
|
|
|
st_color_class_color(void)
|
|
|
|
{
|
|
|
|
Edje_Color_Class *cc;
|
2008-03-24 01:22:01 -07:00
|
|
|
|
2006-01-10 19:19:45 -08:00
|
|
|
check_arg_count(4);
|
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
cc = eina_list_data_get(eina_list_last(edje_file->color_classes));
|
2006-01-10 19:19:45 -08:00
|
|
|
cc->r = parse_int_range(0, 0, 255);
|
|
|
|
cc->g = parse_int_range(1, 0, 255);
|
|
|
|
cc->b = parse_int_range(2, 0, 255);
|
|
|
|
cc->a = parse_int_range(3, 0, 255);
|
|
|
|
}
|
|
|
|
|
2007-11-23 08:43:03 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@property
|
|
|
|
color2
|
|
|
|
@parameters
|
|
|
|
[red] [green] [blue] [alpha]
|
|
|
|
@effect
|
|
|
|
Used as shadow in text and textblock parts.
|
|
|
|
@endproperty
|
|
|
|
*/
|
2006-01-10 19:19:45 -08:00
|
|
|
static void
|
|
|
|
st_color_class_color2(void)
|
|
|
|
{
|
|
|
|
Edje_Color_Class *cc;
|
2008-03-24 01:22:01 -07:00
|
|
|
|
2006-01-10 19:19:45 -08:00
|
|
|
check_arg_count(4);
|
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
cc = eina_list_data_get(eina_list_last(edje_file->color_classes));
|
2006-01-10 19:19:45 -08:00
|
|
|
cc->r2 = parse_int_range(0, 0, 255);
|
|
|
|
cc->g2 = parse_int_range(1, 0, 255);
|
|
|
|
cc->b2 = parse_int_range(2, 0, 255);
|
|
|
|
cc->a2 = parse_int_range(3, 0, 255);
|
|
|
|
}
|
|
|
|
|
2007-11-23 08:43:03 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@property
|
|
|
|
color3
|
|
|
|
@parameters
|
|
|
|
[red] [green] [blue] [alpha]
|
|
|
|
@effect
|
|
|
|
Used as outline in text and textblock parts.
|
|
|
|
@endproperty
|
|
|
|
*/
|
2006-01-10 19:19:45 -08:00
|
|
|
static void
|
|
|
|
st_color_class_color3(void)
|
|
|
|
{
|
|
|
|
Edje_Color_Class *cc;
|
2008-03-24 01:22:01 -07:00
|
|
|
|
2006-01-10 19:19:45 -08:00
|
|
|
check_arg_count(4);
|
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
cc = eina_list_data_get(eina_list_last(edje_file->color_classes));
|
2006-01-10 19:19:45 -08:00
|
|
|
cc->r3 = parse_int_range(0, 0, 255);
|
|
|
|
cc->g3 = parse_int_range(1, 0, 255);
|
|
|
|
cc->b3 = parse_int_range(2, 0, 255);
|
|
|
|
cc->a3 = parse_int_range(3, 0, 255);
|
|
|
|
}
|
|
|
|
|
2007-11-23 08:43:03 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@block
|
|
|
|
spectra
|
|
|
|
@context
|
|
|
|
spectra {
|
|
|
|
spectrum {
|
|
|
|
name: "colorspectrumname";
|
|
|
|
color: [0-255] [0-255] [0-255] [0-255] [0-?]
|
|
|
|
color: [0-255] [0-255] [0-255] [0-255] [0-?]
|
|
|
|
..
|
|
|
|
}
|
|
|
|
..
|
|
|
|
}
|
|
|
|
@description
|
|
|
|
The "spectra" block contains a list of one or more "spectrum" blocks.
|
|
|
|
Each "spectrum" block defines a color range used to fill GRADIENT
|
|
|
|
parts. The colors are defined with the red, green, blue, alpha, delta
|
|
|
|
format.
|
|
|
|
@endblock
|
|
|
|
*/
|
2006-08-02 03:52:44 -07:00
|
|
|
static void
|
|
|
|
ob_spectrum(void)
|
|
|
|
{
|
|
|
|
Edje_Spectrum_Directory_Entry *se;
|
|
|
|
|
|
|
|
if (!edje_file->spectrum_dir)
|
|
|
|
edje_file->spectrum_dir = mem_alloc(SZ(Edje_Spectrum_Directory));
|
|
|
|
se = mem_alloc(SZ(Edje_Spectrum_Directory_Entry));
|
2008-10-22 04:34:42 -07:00
|
|
|
edje_file->spectrum_dir->entries = eina_list_append(edje_file->spectrum_dir->entries, se);
|
|
|
|
se->id = eina_list_count(edje_file->spectrum_dir->entries) - 1;
|
2006-08-02 03:52:44 -07:00
|
|
|
se->entry = NULL;
|
|
|
|
se->filename = NULL;
|
|
|
|
se->color_list = NULL;
|
|
|
|
}
|
|
|
|
|
2007-11-23 08:43:03 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@property
|
|
|
|
name
|
|
|
|
@parameters
|
|
|
|
[spectrum name]
|
|
|
|
@effect
|
|
|
|
The name of the spectrum used as reference later in the theme.
|
|
|
|
@endproperty
|
|
|
|
*/
|
2006-08-02 03:52:44 -07:00
|
|
|
static void
|
|
|
|
st_spectrum_name(void)
|
|
|
|
{
|
|
|
|
Edje_Spectrum_Directory_Entry *se;
|
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
se = eina_list_data_get(eina_list_last(edje_file->spectrum_dir->entries));
|
2006-08-02 03:52:44 -07:00
|
|
|
se->entry = parse_str(0);
|
|
|
|
}
|
|
|
|
|
2007-11-23 08:43:03 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@property
|
|
|
|
color
|
|
|
|
@parameters
|
|
|
|
[red] [green] [blue] [alpha] [delta]
|
|
|
|
@effect
|
|
|
|
Each color declaration represents a stop point in the color range. The
|
|
|
|
last parameter (delta) is used to set the proportion of a given stop
|
|
|
|
point higher or lower in contrast with the other color's delta value.
|
|
|
|
@endproperty
|
|
|
|
*/
|
2006-08-02 03:52:44 -07:00
|
|
|
static void
|
|
|
|
st_spectrum_color(void)
|
|
|
|
{
|
|
|
|
Edje_Spectrum_Directory_Entry *se;
|
|
|
|
Edje_Spectrum_Color *sc;
|
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
se = eina_list_data_get(eina_list_last(edje_file->spectrum_dir->entries));
|
2006-08-02 03:52:44 -07:00
|
|
|
|
|
|
|
sc = mem_alloc(SZ(Edje_Spectrum_Color));
|
2008-10-22 04:34:42 -07:00
|
|
|
se->color_list = eina_list_append(se->color_list, sc);
|
2006-08-02 03:52:44 -07:00
|
|
|
sc->r = parse_int_range(0, 0, 255);
|
|
|
|
sc->g = parse_int_range(1, 0, 255);
|
|
|
|
sc->b = parse_int_range(2, 0, 255);
|
|
|
|
sc->a = parse_int_range(3, 0, 255);
|
|
|
|
sc->d = parse_int(4);
|
|
|
|
}
|
|
|
|
|
2007-11-23 08:43:03 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@block
|
|
|
|
styles
|
|
|
|
@context
|
|
|
|
styles {
|
|
|
|
style {
|
|
|
|
name: "stylename";
|
|
|
|
base: "..default style properties..";
|
|
|
|
|
|
|
|
tag: "tagname" "..style properties..";
|
|
|
|
..
|
|
|
|
}
|
|
|
|
..
|
|
|
|
}
|
|
|
|
@description
|
|
|
|
The "styles" block contains a list of one or more "style" blocks. A
|
|
|
|
"style" block is used to create style \<tags\> for advanced TEXTBLOCK
|
|
|
|
formatting.
|
|
|
|
@endblock
|
|
|
|
*/
|
2005-09-12 02:43:49 -07:00
|
|
|
static void
|
|
|
|
ob_styles_style(void)
|
|
|
|
{
|
|
|
|
Edje_Style *stl;
|
2008-03-24 01:22:01 -07:00
|
|
|
|
2005-09-12 02:43:49 -07:00
|
|
|
stl = mem_alloc(SZ(Edje_Style));
|
2008-10-22 04:34:42 -07:00
|
|
|
edje_file->styles = eina_list_append(edje_file->styles, stl);
|
2005-09-12 02:43:49 -07:00
|
|
|
}
|
|
|
|
|
2007-11-23 08:43:03 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@property
|
|
|
|
name
|
|
|
|
@parameters
|
|
|
|
[style name]
|
|
|
|
@effect
|
|
|
|
The name of the style to be used as reference later in the theme.
|
|
|
|
@endproperty
|
|
|
|
*/
|
2005-09-12 02:43:49 -07:00
|
|
|
static void
|
|
|
|
st_styles_style_name(void)
|
|
|
|
{
|
|
|
|
Edje_Style *stl, *tstl;
|
2008-10-22 04:34:42 -07:00
|
|
|
Eina_List *l;
|
2008-03-24 01:22:01 -07:00
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
stl = eina_list_data_get(eina_list_last(edje_file->styles));
|
2005-09-12 02:43:49 -07:00
|
|
|
stl->name = parse_str(0);
|
2008-10-22 04:34:42 -07:00
|
|
|
EINA_LIST_FOREACH(edje_file->styles, l, tstl)
|
2005-09-12 02:43:49 -07:00
|
|
|
{
|
|
|
|
if ((stl != tstl) && (!strcmp(stl->name, tstl->name)))
|
|
|
|
{
|
2009-12-22 05:46:00 -08:00
|
|
|
ERR("%s: Error. parse error %s:%i. There is already a style named \"%s\"",
|
|
|
|
progname, file_in, line - 1, stl->name);
|
2005-09-12 02:43:49 -07:00
|
|
|
exit(-1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-11-23 08:43:03 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@property
|
|
|
|
base
|
|
|
|
@parameters
|
|
|
|
[style properties string]
|
|
|
|
@effect
|
|
|
|
The default style properties that will be applied to the complete
|
|
|
|
text.
|
|
|
|
@endproperty
|
|
|
|
*/
|
2005-09-12 02:43:49 -07:00
|
|
|
static void
|
|
|
|
st_styles_style_base(void)
|
|
|
|
{
|
|
|
|
Edje_Style *stl;
|
|
|
|
Edje_Style_Tag *tag;
|
2008-03-24 01:22:01 -07:00
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
stl = eina_list_data_get(eina_list_last(edje_file->styles));
|
2005-09-12 02:43:49 -07:00
|
|
|
if (stl->tags)
|
|
|
|
{
|
2009-12-22 05:46:00 -08:00
|
|
|
ERR("%s: Error. parse error %s:%i. There is already a basic format for the style",
|
|
|
|
progname, file_in, line - 1);
|
2005-09-12 02:43:49 -07:00
|
|
|
exit(-1);
|
|
|
|
}
|
|
|
|
tag = mem_alloc(SZ(Edje_Style_Tag));
|
|
|
|
tag->key = mem_strdup("DEFAULT");
|
|
|
|
tag->value = parse_str(0);
|
2008-10-22 04:34:42 -07:00
|
|
|
stl->tags = eina_list_append(stl->tags, tag);
|
2005-09-12 02:43:49 -07:00
|
|
|
}
|
|
|
|
|
2007-11-23 08:43:03 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@property
|
|
|
|
tag
|
|
|
|
@parameters
|
|
|
|
[tag name] [style properties string]
|
|
|
|
@effect
|
|
|
|
Style to be applied only to text between style \<tags\>..\</tags\>.
|
2008-03-24 01:22:01 -07:00
|
|
|
@endproperty
|
2007-11-23 08:43:03 -08:00
|
|
|
*/
|
2005-09-12 02:43:49 -07:00
|
|
|
static void
|
|
|
|
st_styles_style_tag(void)
|
|
|
|
{
|
|
|
|
Edje_Style *stl;
|
|
|
|
Edje_Style_Tag *tag;
|
2008-03-24 01:22:01 -07:00
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
stl = eina_list_data_get(eina_list_last(edje_file->styles));
|
2005-09-12 02:43:49 -07:00
|
|
|
tag = mem_alloc(SZ(Edje_Style_Tag));
|
|
|
|
tag->key = parse_str(0);
|
|
|
|
tag->value = parse_str(1);
|
2008-10-22 04:34:42 -07:00
|
|
|
stl->tags = eina_list_append(stl->tags, tag);
|
2005-09-12 02:43:49 -07:00
|
|
|
}
|
|
|
|
|
2007-11-23 08:43:03 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@block
|
|
|
|
collections
|
|
|
|
@context
|
|
|
|
collections {
|
|
|
|
..
|
|
|
|
group { }
|
|
|
|
group { }
|
|
|
|
..
|
|
|
|
}
|
|
|
|
@description
|
|
|
|
The "collections" block is used to list the groups that compose the
|
|
|
|
theme. Additional "collections" blocks do not prevent overriding group
|
|
|
|
names.
|
|
|
|
@endblock
|
|
|
|
*/
|
2003-06-11 07:14:23 -07:00
|
|
|
static void
|
|
|
|
ob_collections(void)
|
2003-06-12 15:34:51 -07:00
|
|
|
{
|
2003-08-31 19:53:08 -07:00
|
|
|
if (!edje_file->collection_dir)
|
|
|
|
edje_file->collection_dir = mem_alloc(SZ(Edje_Part_Collection_Directory));
|
2003-06-12 15:34:51 -07:00
|
|
|
}
|
|
|
|
|
2007-11-23 08:43:03 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@block
|
|
|
|
group
|
|
|
|
@context
|
|
|
|
collections {
|
|
|
|
..
|
|
|
|
group {
|
|
|
|
name: "nameusedbytheapplication";
|
|
|
|
alias: "anothername";
|
|
|
|
min: width height;
|
|
|
|
max: width height;
|
|
|
|
|
|
|
|
data { }
|
|
|
|
script { }
|
|
|
|
parts { }
|
|
|
|
programs { }
|
|
|
|
}
|
|
|
|
..
|
|
|
|
}
|
|
|
|
@description
|
|
|
|
A "group" block contains the list of parts and programs that compose a
|
|
|
|
given Edje Object.
|
|
|
|
@endblock
|
|
|
|
*/
|
2003-06-12 15:34:51 -07:00
|
|
|
static void
|
|
|
|
ob_collections_group(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection_Directory_Entry *de;
|
2003-06-12 16:02:45 -07:00
|
|
|
Edje_Part_Collection *pc;
|
2004-03-27 21:26:17 -08:00
|
|
|
Code *cd;
|
2008-09-24 01:16:42 -07:00
|
|
|
|
2003-06-12 15:34:51 -07:00
|
|
|
de = mem_alloc(SZ(Edje_Part_Collection_Directory_Entry));
|
2008-10-22 04:34:42 -07:00
|
|
|
edje_file->collection_dir->entries = eina_list_append(edje_file->collection_dir->entries, de);
|
|
|
|
de->id = eina_list_count(edje_file->collection_dir->entries) - 1;
|
2008-03-24 01:22:01 -07:00
|
|
|
|
2003-06-12 16:02:45 -07:00
|
|
|
pc = mem_alloc(SZ(Edje_Part_Collection));
|
2008-10-22 04:34:42 -07:00
|
|
|
edje_collections = eina_list_append(edje_collections, pc);
|
|
|
|
pc->id = eina_list_count(edje_collections) - 1;
|
2008-03-24 01:22:01 -07:00
|
|
|
|
2004-03-27 21:26:17 -08:00
|
|
|
cd = mem_alloc(SZ(Code));
|
2008-10-22 04:34:42 -07:00
|
|
|
codes = eina_list_append(codes, cd);
|
2003-06-12 16:02:45 -07:00
|
|
|
}
|
|
|
|
|
2007-11-23 08:43:03 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@property
|
|
|
|
name
|
|
|
|
@parameters
|
|
|
|
[group name]
|
|
|
|
@effect
|
|
|
|
The name that will be used by the application to load the resulting
|
2008-11-05 13:36:23 -08:00
|
|
|
Edje object and to identify the group to swallow in a GROUP part. If a
|
2008-10-16 18:05:02 -07:00
|
|
|
group with the same name exists already it will be completely overriden
|
|
|
|
by the new group.
|
2007-11-23 08:43:03 -08:00
|
|
|
@endproperty
|
|
|
|
*/
|
2003-06-12 16:02:45 -07:00
|
|
|
static void
|
|
|
|
st_collections_group_name(void)
|
|
|
|
{
|
2008-11-25 15:18:04 -08:00
|
|
|
Edje_Part_Collection_Directory_Entry *de, *de_other, *alias;
|
|
|
|
Eina_List *l, *l2;
|
2008-10-22 04:34:42 -07:00
|
|
|
|
2004-10-23 13:12:21 -07:00
|
|
|
check_arg_count(1);
|
2008-03-24 01:22:01 -07:00
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
de = eina_list_data_get(eina_list_last(edje_file->collection_dir->entries));
|
2003-06-12 16:02:45 -07:00
|
|
|
de->entry = parse_str(0);
|
2008-10-22 04:34:42 -07:00
|
|
|
EINA_LIST_FOREACH(edje_file->collection_dir->entries, l, de_other)
|
2008-09-24 01:16:42 -07:00
|
|
|
{
|
|
|
|
if ((de_other != de) && (de_other->entry) &&
|
|
|
|
(!strcmp(de->entry, de_other->entry)))
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Code *cd;
|
|
|
|
int i;
|
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_nth(edje_collections, de_other->id);
|
|
|
|
cd = eina_list_nth(codes, de_other->id);
|
2008-09-24 01:16:42 -07:00
|
|
|
|
|
|
|
edje_file->collection_dir->entries =
|
2008-10-22 04:34:42 -07:00
|
|
|
eina_list_remove(edje_file->collection_dir->entries, de_other);
|
2008-09-24 01:16:42 -07:00
|
|
|
edje_collections =
|
2008-10-22 04:34:42 -07:00
|
|
|
eina_list_remove(edje_collections, pc);
|
2008-09-24 01:16:42 -07:00
|
|
|
codes =
|
2008-10-22 04:34:42 -07:00
|
|
|
eina_list_remove(codes, cd);
|
|
|
|
|
|
|
|
for (i = 0, l = edje_file->collection_dir->entries; l; l = eina_list_next(l), i++)
|
2008-09-24 01:16:42 -07:00
|
|
|
{
|
2008-10-22 04:34:42 -07:00
|
|
|
de_other = eina_list_data_get(l);
|
2008-11-25 15:18:04 -08:00
|
|
|
for (l2 = aliases; l2; l2 = l2->next)
|
|
|
|
{
|
|
|
|
alias = l2->data;
|
|
|
|
if (alias->id == de_other->id)
|
|
|
|
alias->id = i;
|
|
|
|
}
|
2008-09-24 01:16:42 -07:00
|
|
|
de_other->id = i;
|
|
|
|
}
|
2008-10-22 04:34:42 -07:00
|
|
|
for (i = 0, l = edje_collections; l; l = eina_list_next(l), i++)
|
2008-09-24 01:16:42 -07:00
|
|
|
{
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(l);
|
2008-09-24 01:16:42 -07:00
|
|
|
pc->id = i;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2003-06-12 15:34:51 -07:00
|
|
|
}
|
|
|
|
|
2008-05-28 19:00:04 -07:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@property
|
|
|
|
script_only
|
|
|
|
@parameters
|
|
|
|
[on/off]
|
|
|
|
@effect
|
|
|
|
The flag (on/off) as to if this group is defined ONLY by script
|
|
|
|
callbacks such as init(), resize() and shutdown()
|
|
|
|
@endproperty
|
|
|
|
*/
|
|
|
|
static void
|
|
|
|
st_collections_group_script_only(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
|
|
|
|
check_arg_count(1);
|
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
2008-05-28 19:00:04 -07:00
|
|
|
pc->script_only = parse_bool(0);
|
|
|
|
}
|
|
|
|
|
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-15 19:34:02 -07:00
|
|
|
static void
|
|
|
|
st_collections_group_lua_script_only(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
|
|
|
|
check_arg_count(1);
|
|
|
|
|
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
pc->lua_script_only = parse_bool(0);
|
|
|
|
}
|
|
|
|
|
2007-11-23 08:43:03 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@property
|
|
|
|
alias
|
|
|
|
@parameters
|
|
|
|
[aditional group name]
|
|
|
|
@effect
|
|
|
|
Additional name to serve as identifier. Defining multiple aliases is
|
|
|
|
supported.
|
|
|
|
@endproperty
|
|
|
|
*/
|
2006-10-11 22:35:14 -07:00
|
|
|
static void
|
|
|
|
st_collections_group_alias(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection_Directory_Entry *de, *alias;
|
|
|
|
|
|
|
|
check_arg_count(1);
|
2008-10-22 04:34:42 -07:00
|
|
|
de = eina_list_data_get(eina_list_last(edje_file->collection_dir->entries));
|
2008-03-24 01:22:01 -07:00
|
|
|
|
2006-10-11 22:35:14 -07:00
|
|
|
alias = mem_alloc(SZ(Edje_Part_Collection_Directory_Entry));
|
|
|
|
alias->id = de->id;
|
|
|
|
alias->entry = parse_str(0);
|
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
aliases = eina_list_append(aliases, alias);
|
2006-10-11 22:35:14 -07:00
|
|
|
}
|
|
|
|
|
2007-11-23 08:43:03 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@property
|
|
|
|
min
|
|
|
|
@parameters
|
|
|
|
[width] [height]
|
|
|
|
@effect
|
|
|
|
The minimum size for the container defined by the composition of the
|
|
|
|
parts.
|
|
|
|
@endproperty
|
|
|
|
*/
|
2003-07-20 05:37:49 -07:00
|
|
|
static void
|
|
|
|
st_collections_group_min(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
2004-10-23 13:12:21 -07:00
|
|
|
|
|
|
|
check_arg_count(2);
|
2008-03-24 01:22:01 -07:00
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
2003-07-20 05:37:49 -07:00
|
|
|
pc->prop.min.w = parse_int_range(0, 0, 0x7fffffff);
|
|
|
|
pc->prop.min.h = parse_int_range(1, 0, 0x7fffffff);
|
|
|
|
}
|
|
|
|
|
2007-11-23 08:43:03 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@property
|
|
|
|
max
|
|
|
|
@parameters
|
|
|
|
[width] [height]
|
|
|
|
@effect
|
|
|
|
The maximum size for the container defined by the totality of the
|
|
|
|
parts.
|
|
|
|
@endproperty
|
|
|
|
*/
|
2003-07-20 05:37:49 -07:00
|
|
|
static void
|
|
|
|
st_collections_group_max(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
2004-10-23 13:12:21 -07:00
|
|
|
|
|
|
|
check_arg_count(2);
|
2008-03-24 01:22:01 -07:00
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
2003-07-20 05:37:49 -07:00
|
|
|
pc->prop.max.w = parse_int_range(0, 0, 0x7fffffff);
|
|
|
|
pc->prop.max.h = parse_int_range(1, 0, 0x7fffffff);
|
|
|
|
}
|
|
|
|
|
2007-11-23 08:43:03 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@block
|
|
|
|
script
|
|
|
|
@context
|
|
|
|
..
|
|
|
|
group {
|
|
|
|
script {
|
|
|
|
//embryo script
|
|
|
|
}
|
|
|
|
..
|
|
|
|
program {
|
|
|
|
script {
|
|
|
|
//embryo script
|
|
|
|
}
|
|
|
|
}
|
|
|
|
..
|
|
|
|
}
|
|
|
|
..
|
|
|
|
@description
|
|
|
|
This block is used to "inject" embryo scripts to a given Edje theme and
|
|
|
|
it functions in two modalities. When it's included inside a "program"
|
|
|
|
block, the script will be executed every time the program is run, on
|
|
|
|
the other hand, when included directly into a "group", "part" or
|
|
|
|
"description" block, it will be executed once at load time, in the
|
|
|
|
load order.
|
|
|
|
@endblock
|
|
|
|
*/
|
2004-03-27 21:26:17 -08:00
|
|
|
static void
|
|
|
|
ob_collections_group_script(void)
|
|
|
|
{
|
|
|
|
Code *cd;
|
2008-03-24 01:22:01 -07:00
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
cd = eina_list_data_get(eina_list_last(codes));
|
2008-03-24 01:22:01 -07:00
|
|
|
|
2004-03-27 21:26:17 -08:00
|
|
|
if (!is_verbatim()) track_verbatim(1);
|
|
|
|
else
|
|
|
|
{
|
|
|
|
char *s;
|
2008-03-24 01:22:01 -07:00
|
|
|
|
2004-03-27 21:26:17 -08:00
|
|
|
s = get_verbatim();
|
|
|
|
if (s)
|
|
|
|
{
|
2004-04-24 21:20:58 -07:00
|
|
|
cd->l1 = get_verbatim_line1();
|
|
|
|
cd->l2 = get_verbatim_line2();
|
2004-03-27 21:26:17 -08:00
|
|
|
if (cd->shared)
|
|
|
|
{
|
2009-12-22 05:46:00 -08:00
|
|
|
ERR("%s: Error. parse error %s:%i. There is already an existing script section for the group",
|
|
|
|
progname, file_in, line - 1);
|
2004-03-27 21:26:17 -08:00
|
|
|
exit(-1);
|
|
|
|
}
|
|
|
|
cd->shared = s;
|
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-15 19:34:02 -07:00
|
|
|
cd->is_lua = 0;
|
|
|
|
set_verbatim(NULL, 0, 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
ob_collections_group_lua_script(void)
|
|
|
|
{
|
|
|
|
Code *cd;
|
|
|
|
|
|
|
|
cd = eina_list_data_get(eina_list_last(codes));
|
|
|
|
|
|
|
|
if (!is_verbatim()) track_verbatim(1);
|
|
|
|
else
|
|
|
|
{
|
|
|
|
char *s;
|
|
|
|
|
|
|
|
s = get_verbatim();
|
|
|
|
if (s)
|
|
|
|
{
|
|
|
|
cd->l1 = get_verbatim_line1();
|
|
|
|
cd->l2 = get_verbatim_line2();
|
|
|
|
if (cd->shared)
|
|
|
|
{
|
2009-12-22 05:46:00 -08:00
|
|
|
ERR("%s: Error. parse error %s:%i. There is already an existing script section for the group",
|
|
|
|
progname, file_in, line - 1);
|
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-15 19:34:02 -07:00
|
|
|
exit(-1);
|
|
|
|
}
|
|
|
|
cd->shared = s;
|
|
|
|
cd->is_lua = 1;
|
2004-04-24 21:20:58 -07:00
|
|
|
set_verbatim(NULL, 0, 0);
|
2004-03-27 21:26:17 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2003-06-12 15:34:51 -07:00
|
|
|
static void
|
2003-08-05 07:33:35 -07:00
|
|
|
st_collections_group_data_item(void)
|
2003-06-12 15:34:51 -07:00
|
|
|
{
|
2003-08-05 07:33:35 -07:00
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Data *di;
|
2004-10-23 13:12:21 -07:00
|
|
|
|
|
|
|
check_arg_count(2);
|
2008-03-24 01:22:01 -07:00
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
2004-08-30 21:00:14 -07:00
|
|
|
di = mem_alloc(SZ(Edje_Data));
|
2003-08-05 07:33:35 -07:00
|
|
|
di->key = parse_str(0);
|
|
|
|
di->value = parse_str(1);
|
2008-10-22 04:34:42 -07:00
|
|
|
pc->data = eina_list_append(pc->data, di);
|
2003-06-12 15:34:51 -07:00
|
|
|
}
|
|
|
|
|
2007-11-23 08:43:03 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@block
|
|
|
|
part
|
|
|
|
@context
|
|
|
|
group {
|
|
|
|
parts {
|
|
|
|
..
|
|
|
|
part {
|
|
|
|
name: "partname";
|
|
|
|
type: IMAGE;
|
|
|
|
mouse_events: 1;
|
|
|
|
repeat_events: 0;
|
2008-04-01 14:33:17 -07:00
|
|
|
ignore_flags: NONE;
|
2007-11-23 08:43:03 -08:00
|
|
|
clip_to: "anotherpart";
|
|
|
|
source: "groupname";
|
|
|
|
pointer_mode: AUTOGRAB;
|
|
|
|
use_alternate_font_metrics: 0;
|
|
|
|
|
|
|
|
description { }
|
|
|
|
dragable { }
|
2008-11-23 21:15:15 -08:00
|
|
|
items { }
|
2007-11-23 08:43:03 -08:00
|
|
|
}
|
|
|
|
..
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@description
|
|
|
|
Parts are used to represent the most basic design elements of the
|
|
|
|
theme, for example, a part can represent a line in a border or a label
|
|
|
|
on a button.
|
|
|
|
@endblock
|
|
|
|
*/
|
2003-06-12 15:34:51 -07:00
|
|
|
static void
|
|
|
|
ob_collections_group_parts_part(void)
|
2008-03-24 01:22:01 -07:00
|
|
|
{
|
2003-06-12 16:02:45 -07:00
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
2008-03-24 01:22:01 -07:00
|
|
|
|
2003-06-12 16:02:45 -07:00
|
|
|
ep = mem_alloc(SZ(Edje_Part));
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
pc->parts = eina_list_append(pc->parts, ep);
|
|
|
|
ep->id = eina_list_count(pc->parts) - 1;
|
2003-06-16 16:44:13 -07:00
|
|
|
ep->type = EDJE_PART_TYPE_IMAGE;
|
|
|
|
ep->mouse_events = 1;
|
2003-07-27 06:16:51 -07:00
|
|
|
ep->repeat_events = 0;
|
2008-04-01 14:33:17 -07:00
|
|
|
ep->ignore_flags = EVAS_EVENT_FLAG_NONE;
|
2008-09-09 07:13:34 -07:00
|
|
|
ep->scale = 0;
|
2007-07-24 07:20:07 -07:00
|
|
|
ep->pointer_mode = EVAS_OBJECT_POINTER_MODE_AUTOGRAB;
|
2007-07-23 07:22:57 -07:00
|
|
|
ep->precise_is_inside = 0;
|
2007-03-31 03:53:22 -07:00
|
|
|
ep->use_alternate_font_metrics = 0;
|
2003-06-24 19:29:25 -07:00
|
|
|
ep->clip_to_id = -1;
|
2003-07-27 06:16:51 -07:00
|
|
|
ep->dragable.confine_id = -1;
|
2005-07-26 06:59:03 -07:00
|
|
|
ep->dragable.events_id = -1;
|
2008-11-23 21:15:15 -08:00
|
|
|
ep->items = NULL;
|
2003-06-12 16:02:45 -07:00
|
|
|
}
|
|
|
|
|
2007-11-23 08:43:03 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@property
|
|
|
|
name
|
|
|
|
@parameters
|
|
|
|
[part name]
|
|
|
|
@effect
|
|
|
|
The part's name will be used as reference in the theme's relative
|
|
|
|
positioning system, by programs and in some cases by the application.
|
|
|
|
It must be unique within the group.
|
|
|
|
@endproperty
|
|
|
|
*/
|
2003-06-12 16:02:45 -07:00
|
|
|
static void
|
|
|
|
st_collections_group_parts_part_name(void)
|
2003-06-12 15:34:51 -07:00
|
|
|
{
|
2003-06-12 16:02:45 -07:00
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
2004-10-23 13:12:21 -07:00
|
|
|
|
|
|
|
check_arg_count(1);
|
2008-03-24 01:22:01 -07:00
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
2003-06-12 16:02:45 -07:00
|
|
|
ep->name = parse_str(0);
|
2004-10-10 08:18:07 -07:00
|
|
|
|
|
|
|
{
|
2008-10-22 04:34:42 -07:00
|
|
|
Eina_List *l;
|
|
|
|
Edje_Part *lep;
|
2008-03-24 01:22:01 -07:00
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
EINA_LIST_FOREACH(pc->parts, l, lep)
|
2004-10-10 08:18:07 -07:00
|
|
|
{
|
2005-12-13 07:11:21 -08:00
|
|
|
if ((lep != ep) && (lep->name) && (!strcmp(lep->name, ep->name)))
|
2004-10-10 08:18:07 -07:00
|
|
|
{
|
2009-12-22 05:46:00 -08:00
|
|
|
ERR("%s: Error. parse error %s:%i. There is already a part of the name %s",
|
|
|
|
progname, file_in, line - 1, ep->name);
|
2004-10-10 08:18:07 -07:00
|
|
|
exit(-1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2003-06-12 16:02:45 -07:00
|
|
|
}
|
|
|
|
|
2007-11-23 08:43:03 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@property
|
|
|
|
type
|
|
|
|
@parameters
|
|
|
|
[TYPE]
|
|
|
|
@effect
|
|
|
|
Set the type (all caps) from among the available types, it's set to
|
|
|
|
IMAGE by default. Valid types:
|
|
|
|
@li RECT
|
|
|
|
@li TEXT
|
|
|
|
@li IMAGE
|
|
|
|
@li SWALLOW
|
|
|
|
@li TEXTBLOCK
|
|
|
|
@li GRADIENT
|
|
|
|
@li GROUP
|
2008-11-23 21:15:15 -08:00
|
|
|
@li BOX
|
2008-12-17 18:43:20 -08:00
|
|
|
@li TABLE
|
2009-10-26 18:08:19 -07:00
|
|
|
@li EXTERNAL
|
2007-11-23 08:43:03 -08:00
|
|
|
@endproperty
|
|
|
|
*/
|
2003-06-12 16:02:45 -07:00
|
|
|
static void
|
|
|
|
st_collections_group_parts_part_type(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
2004-10-23 13:12:21 -07:00
|
|
|
|
|
|
|
check_arg_count(1);
|
2008-03-24 01:22:01 -07:00
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
2008-03-24 01:22:01 -07:00
|
|
|
ep->type = parse_enum(0,
|
2003-06-13 20:06:36 -07:00
|
|
|
"NONE", EDJE_PART_TYPE_NONE,
|
2003-06-12 16:02:45 -07:00
|
|
|
"RECT", EDJE_PART_TYPE_RECTANGLE,
|
|
|
|
"TEXT", EDJE_PART_TYPE_TEXT,
|
|
|
|
"IMAGE", EDJE_PART_TYPE_IMAGE,
|
2004-07-14 00:57:35 -07:00
|
|
|
"SWALLOW", EDJE_PART_TYPE_SWALLOW,
|
2005-09-12 02:43:49 -07:00
|
|
|
"TEXTBLOCK", EDJE_PART_TYPE_TEXTBLOCK,
|
2006-08-02 03:52:44 -07:00
|
|
|
"GRADIENT", EDJE_PART_TYPE_GRADIENT,
|
2007-05-26 22:28:07 -07:00
|
|
|
"GROUP", EDJE_PART_TYPE_GROUP,
|
2008-11-23 21:15:15 -08:00
|
|
|
"BOX", EDJE_PART_TYPE_BOX,
|
2008-12-17 18:43:20 -08:00
|
|
|
"TABLE", EDJE_PART_TYPE_TABLE,
|
2009-10-26 18:08:19 -07:00
|
|
|
"EXTERNAL", EDJE_PART_TYPE_EXTERNAL,
|
2003-06-12 16:02:45 -07:00
|
|
|
NULL);
|
|
|
|
}
|
|
|
|
|
2007-11-23 08:43:03 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@property
|
|
|
|
mouse_events
|
|
|
|
@parameters
|
|
|
|
[1 or 0]
|
|
|
|
@effect
|
|
|
|
Specifies whether the part will emit signals, altought is named
|
|
|
|
"mouse_events", disabling it (0) will prevent the part from emitting
|
|
|
|
any type of signal at all. Its set to 1 by default.
|
|
|
|
@endproperty
|
|
|
|
*/
|
2003-06-12 16:02:45 -07:00
|
|
|
static void
|
|
|
|
st_collections_group_parts_part_mouse_events(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
2004-10-23 13:12:21 -07:00
|
|
|
|
|
|
|
check_arg_count(1);
|
2008-03-24 01:22:01 -07:00
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
2004-10-13 11:07:56 -07:00
|
|
|
ep->mouse_events = parse_bool(0);
|
2003-06-12 16:02:45 -07:00
|
|
|
}
|
|
|
|
|
2007-11-23 08:43:03 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@property
|
|
|
|
repeat_events
|
|
|
|
@parameters
|
|
|
|
[1 or 0]
|
|
|
|
@effect
|
|
|
|
Specifies whether a part echoes a mouse event to other parts below the
|
|
|
|
pointer (1), or not (0). Its set to 0 by default.
|
|
|
|
@endproperty
|
|
|
|
*/
|
2003-07-27 06:16:51 -07:00
|
|
|
static void
|
|
|
|
st_collections_group_parts_part_repeat_events(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
2004-10-23 13:12:21 -07:00
|
|
|
|
|
|
|
check_arg_count(1);
|
2008-03-24 01:22:01 -07:00
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
2004-10-13 11:07:56 -07:00
|
|
|
ep->repeat_events = parse_bool(0);
|
2003-07-27 06:16:51 -07:00
|
|
|
}
|
|
|
|
|
2008-04-01 14:33:17 -07:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@property
|
|
|
|
ignore_flags
|
|
|
|
@parameters
|
|
|
|
[FLAG] ...
|
|
|
|
@effect
|
|
|
|
Specifies whether events with the given flags should be ignored,
|
|
|
|
i.e., will not have the signals emitted to the parts. Multiple flags
|
|
|
|
must be separated by spaces, the effect will be ignoring all events
|
|
|
|
with one of the flags specified. Possible flags:
|
|
|
|
@li NONE (default value, no event will be ignored)
|
|
|
|
@li ON_HOLD
|
|
|
|
@endproperty
|
|
|
|
*/
|
|
|
|
static void
|
|
|
|
st_collections_group_parts_part_ignore_flags(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
|
|
|
|
check_min_arg_count(1);
|
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
2008-04-01 14:33:17 -07:00
|
|
|
ep->ignore_flags = parse_flags(0,
|
|
|
|
"NONE", EVAS_EVENT_FLAG_NONE,
|
|
|
|
"ON_HOLD", EVAS_EVENT_FLAG_ON_HOLD,
|
|
|
|
NULL);
|
|
|
|
}
|
|
|
|
|
2008-09-09 07:13:34 -07:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@property
|
|
|
|
scale
|
|
|
|
@parameters
|
|
|
|
[1 or 0]
|
|
|
|
@effect
|
|
|
|
Specifies whether the part will scale its size with an edje scaling
|
|
|
|
factor. By default scale is off (0) and the default scale factor is
|
|
|
|
1.0 - that means no scaling. This would be used to scale properties
|
|
|
|
such as font size, min/max size of the part, and possibly can be used
|
|
|
|
to scale based on DPI of the target device. The reason to be selective
|
|
|
|
is that some things work well being scaled, others do not, so the
|
|
|
|
designer gets to choose what works best.
|
|
|
|
@endproperty
|
|
|
|
*/
|
|
|
|
static void
|
|
|
|
st_collections_group_parts_part_scale(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
|
|
|
|
check_arg_count(1);
|
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
2008-09-09 07:13:34 -07:00
|
|
|
ep->scale = parse_bool(0);
|
|
|
|
}
|
|
|
|
|
2007-11-23 08:43:03 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@property
|
|
|
|
pointer_mode
|
|
|
|
@parameters
|
|
|
|
[MODE]
|
|
|
|
@effect
|
|
|
|
Sets the mouse pointer behavior for a given part. The default value is
|
|
|
|
AUTOGRAB. Aviable modes:
|
|
|
|
@li AUTOGRAB, when the part is clicked and the button remains
|
|
|
|
pressed, the part will be the source of all future mouse
|
|
|
|
signals emitted, even outside the object, until the button is
|
|
|
|
released.
|
|
|
|
@li NOGRAB, the effect will be limited to the part's container.
|
2008-03-24 01:22:01 -07:00
|
|
|
container.
|
2007-11-23 08:43:03 -08:00
|
|
|
@endproperty
|
|
|
|
*/
|
2007-07-24 07:20:07 -07:00
|
|
|
static void
|
|
|
|
st_collections_group_parts_part_pointer_mode(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
|
|
|
|
check_arg_count(1);
|
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
2007-07-24 07:20:07 -07:00
|
|
|
ep->pointer_mode = parse_enum(0,
|
|
|
|
"AUTOGRAB", EVAS_OBJECT_POINTER_MODE_AUTOGRAB,
|
|
|
|
"NOGRAB", EVAS_OBJECT_POINTER_MODE_NOGRAB,
|
|
|
|
NULL);
|
|
|
|
}
|
|
|
|
|
2007-11-23 08:43:03 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@property
|
|
|
|
precise_is_inside
|
|
|
|
@parameters
|
|
|
|
[1 or 0]
|
|
|
|
@effect
|
|
|
|
Enables precise point collision detection for the part, which is more
|
|
|
|
resource intensive. Disabled by default.
|
|
|
|
@endproperty
|
|
|
|
*/
|
2007-07-23 07:22:57 -07:00
|
|
|
static void
|
|
|
|
st_collections_group_parts_part_precise_is_inside(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
|
|
|
|
check_arg_count(1);
|
2008-03-24 01:22:01 -07:00
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
2007-07-23 07:22:57 -07:00
|
|
|
ep->precise_is_inside = parse_bool(0);
|
|
|
|
}
|
|
|
|
|
2007-11-23 08:43:03 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@property
|
|
|
|
use_alternate_font_metrics
|
|
|
|
@parameters
|
|
|
|
[1 or 0]
|
|
|
|
@effect
|
|
|
|
Only affects text and textblock parts, when enabled Edje will use
|
|
|
|
different size measurement functions. Disabled by default. (note from
|
|
|
|
the author: I don't know what this is exactlu useful for?)
|
|
|
|
@endproperty
|
|
|
|
*/
|
2007-03-31 03:53:22 -07:00
|
|
|
static void
|
|
|
|
st_collections_group_parts_part_use_alternate_font_metrics(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
|
|
|
|
check_arg_count(1);
|
2008-03-24 01:22:01 -07:00
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
2007-03-31 03:53:22 -07:00
|
|
|
ep->use_alternate_font_metrics = parse_bool(0);
|
|
|
|
}
|
|
|
|
|
2007-11-23 08:43:03 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@property
|
|
|
|
clip_to
|
|
|
|
@parameters
|
|
|
|
[another part's name]
|
|
|
|
@effect
|
|
|
|
Only renders the area of part that coincides with another part's
|
|
|
|
container. Overflowing content will not be displayed.
|
|
|
|
@endproperty
|
|
|
|
*/
|
2003-06-24 19:29:25 -07:00
|
|
|
static void
|
|
|
|
st_collections_group_parts_part_clip_to_id(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
2004-10-23 13:12:21 -07:00
|
|
|
|
|
|
|
check_arg_count(1);
|
2008-03-24 01:22:01 -07:00
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
2003-06-24 19:29:25 -07:00
|
|
|
{
|
|
|
|
char *name;
|
2008-03-24 01:22:01 -07:00
|
|
|
|
2003-06-24 19:29:25 -07:00
|
|
|
name = parse_str(0);
|
|
|
|
data_queue_part_lookup(pc, name, &(ep->clip_to_id));
|
|
|
|
free(name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-11-23 08:43:03 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@property
|
|
|
|
source
|
|
|
|
@parameters
|
|
|
|
[another group's name]
|
|
|
|
@effect
|
2008-10-13 02:19:04 -07:00
|
|
|
Only available to GROUP or TEXTBLOCK parts. Swallows the specified
|
|
|
|
group into the part's container if a GROUP. If TEXTBLOCK it is used
|
|
|
|
for the group to be loaded and used for selection display UNDER the
|
|
|
|
selected text. source2 is used for on top of the selected text, if
|
|
|
|
source2 is specified.
|
2007-11-23 08:43:03 -08:00
|
|
|
@endproperty
|
|
|
|
*/
|
2007-05-26 22:28:07 -07:00
|
|
|
static void
|
|
|
|
st_collections_group_parts_part_source(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
|
|
|
|
check_arg_count(1);
|
2008-03-24 01:22:01 -07:00
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
2007-05-26 22:28:07 -07:00
|
|
|
|
2008-10-13 02:19:04 -07:00
|
|
|
//FIXME: validate this somehow (need to decide on the format also)
|
2007-05-26 22:28:07 -07:00
|
|
|
ep->source = parse_str(0);
|
|
|
|
}
|
|
|
|
|
2008-10-13 02:19:04 -07:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@property
|
|
|
|
source2
|
|
|
|
@parameters
|
|
|
|
[another group's name]
|
|
|
|
@effect
|
|
|
|
Only available to TEXTBLOCK parts. It is used for the group to be
|
|
|
|
loaded and used for selection display OVER the selected text. source
|
|
|
|
is used for under of the selected text, if source is specified.
|
|
|
|
@endproperty
|
|
|
|
*/
|
|
|
|
static void
|
|
|
|
st_collections_group_parts_part_source2(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
|
|
|
|
check_arg_count(1);
|
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
2008-10-13 02:19:04 -07:00
|
|
|
|
|
|
|
//FIXME: validate this somehow (need to decide on the format also)
|
|
|
|
ep->source2 = parse_str(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@property
|
|
|
|
source3
|
|
|
|
@parameters
|
|
|
|
[another group's name]
|
|
|
|
@effect
|
|
|
|
Only available to TEXTBLOCK parts. It is used for the group to be
|
|
|
|
loaded and used for cursor display UNDER the cursor position. source4
|
|
|
|
is used for over the cursor text, if source4 is specified.
|
|
|
|
@endproperty
|
|
|
|
*/
|
|
|
|
static void
|
|
|
|
st_collections_group_parts_part_source3(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
|
|
|
|
check_arg_count(1);
|
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
2008-10-13 02:19:04 -07:00
|
|
|
|
|
|
|
//FIXME: validate this somehow (need to decide on the format also)
|
|
|
|
ep->source3 = parse_str(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@property
|
|
|
|
source4
|
|
|
|
@parameters
|
|
|
|
[another group's name]
|
|
|
|
@effect
|
|
|
|
Only available to TEXTBLOCK parts. It is used for the group to be
|
|
|
|
loaded and used for cursor display OVER the cursor position. source3
|
|
|
|
is used for under the cursor text, if source4 is specified.
|
|
|
|
@endproperty
|
|
|
|
*/
|
|
|
|
static void
|
|
|
|
st_collections_group_parts_part_source4(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
|
|
|
|
check_arg_count(1);
|
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
2008-10-13 02:19:04 -07:00
|
|
|
|
|
|
|
//FIXME: validate this somehow (need to decide on the format also)
|
|
|
|
ep->source4 = parse_str(0);
|
|
|
|
}
|
|
|
|
|
2008-10-16 23:40:46 -07:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@property
|
|
|
|
source5
|
|
|
|
@parameters
|
|
|
|
[another group's name]
|
|
|
|
@effect
|
|
|
|
Only available to TEXTBLOCK parts. It is used for the group to be
|
|
|
|
loaded and used for anchors display UNDER the anchor position. source6
|
|
|
|
is used for over the anchors text, if source6 is specified.
|
|
|
|
@endproperty
|
|
|
|
*/
|
|
|
|
static void
|
|
|
|
st_collections_group_parts_part_source5(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
|
|
|
|
check_arg_count(1);
|
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
2008-10-16 23:40:46 -07:00
|
|
|
|
|
|
|
//FIXME: validate this somehow (need to decide on the format also)
|
|
|
|
ep->source5 = parse_str(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@property
|
|
|
|
source6
|
|
|
|
@parameters
|
|
|
|
[another group's name]
|
|
|
|
@effect
|
|
|
|
Only available to TEXTBLOCK parts. It is used for the group to be
|
|
|
|
loaded and used for anchor display OVER the anchor position. source5
|
|
|
|
is used for under the anchor text, if source6 is specified.
|
|
|
|
@endproperty
|
|
|
|
*/
|
|
|
|
static void
|
|
|
|
st_collections_group_parts_part_source6(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
|
|
|
|
check_arg_count(1);
|
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
2008-10-16 23:40:46 -07:00
|
|
|
|
|
|
|
//FIXME: validate this somehow (need to decide on the format also)
|
|
|
|
ep->source6 = parse_str(0);
|
|
|
|
}
|
|
|
|
|
2007-11-23 08:43:03 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
|
|
|
|
@property
|
|
|
|
effect
|
|
|
|
@parameters
|
|
|
|
[EFFECT]
|
|
|
|
@effect
|
|
|
|
Causes Edje to draw the selected effect among:
|
|
|
|
@li PLAIN
|
|
|
|
@li OUTLINE
|
|
|
|
@li SOFT_OUTLINE
|
|
|
|
@li SHADOW
|
|
|
|
@li SOFT_SHADOW
|
|
|
|
@li OUTLINE_SHADOW
|
|
|
|
@li OUTLINE_SOFT_SHADOW
|
|
|
|
@li FAR_SHADOW
|
|
|
|
@li FAR_SOFT_SHADOW
|
|
|
|
@li GLOW
|
|
|
|
@endproperty
|
|
|
|
*/
|
2007-11-23 08:40:38 -08:00
|
|
|
static void
|
|
|
|
st_collections_group_parts_part_effect(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
|
|
|
|
check_arg_count(1);
|
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
2008-03-24 01:22:01 -07:00
|
|
|
ep->effect = parse_enum(0,
|
2007-11-23 08:40:38 -08:00
|
|
|
"NONE", EDJE_TEXT_EFFECT_NONE,
|
|
|
|
"PLAIN", EDJE_TEXT_EFFECT_PLAIN,
|
|
|
|
"OUTLINE", EDJE_TEXT_EFFECT_OUTLINE,
|
|
|
|
"SOFT_OUTLINE", EDJE_TEXT_EFFECT_SOFT_OUTLINE,
|
|
|
|
"SHADOW", EDJE_TEXT_EFFECT_SHADOW,
|
|
|
|
"SOFT_SHADOW", EDJE_TEXT_EFFECT_SOFT_SHADOW,
|
|
|
|
"OUTLINE_SHADOW", EDJE_TEXT_EFFECT_OUTLINE_SHADOW,
|
|
|
|
"OUTLINE_SOFT_SHADOW", EDJE_TEXT_EFFECT_OUTLINE_SOFT_SHADOW,
|
|
|
|
"FAR_SHADOW", EDJE_TEXT_EFFECT_FAR_SHADOW,
|
|
|
|
"FAR_SOFT_SHADOW", EDJE_TEXT_EFFECT_FAR_SOFT_SHADOW,
|
|
|
|
"GLOW", EDJE_TEXT_EFFECT_GLOW,
|
|
|
|
NULL);
|
|
|
|
}
|
|
|
|
|
2008-10-31 08:13:50 -07:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@property
|
|
|
|
entry_mode
|
|
|
|
@parameters
|
|
|
|
Sets the edit mode for a textblock part to one of:
|
|
|
|
@li NONE
|
|
|
|
@li PLAIN
|
|
|
|
@li EDITABLE
|
|
|
|
@li PASSWORD
|
|
|
|
@effect
|
|
|
|
It causes the part be editable if the edje object has the keyboard
|
|
|
|
focus AND the part has the edje focus (or selectable always
|
|
|
|
regardless of focus) and in the event of password mode, not
|
|
|
|
selectable and all text chars replaced with *'s but editable and
|
|
|
|
pastable.
|
|
|
|
@endproperty
|
|
|
|
*/
|
|
|
|
static void
|
|
|
|
st_collections_group_parts_part_entry_mode(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
|
|
|
|
check_arg_count(1);
|
|
|
|
|
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
|
|
|
ep->entry_mode = parse_enum(0,
|
|
|
|
"NONE", EDJE_ENTRY_EDIT_MODE_NONE,
|
|
|
|
"PLAIN", EDJE_ENTRY_EDIT_MODE_SELECTABLE,
|
|
|
|
"EDITABLE", EDJE_ENTRY_EDIT_MODE_EDITABLE,
|
2008-12-08 15:47:04 -08:00
|
|
|
"PASSWORD", EDJE_ENTRY_EDIT_MODE_PASSWORD,
|
2008-10-31 08:13:50 -07:00
|
|
|
NULL);
|
|
|
|
}
|
|
|
|
|
2009-03-19 06:36:10 -07:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@property
|
|
|
|
select_mode
|
|
|
|
@parameters
|
|
|
|
Sets the selection mode for a textblock part to one of:
|
|
|
|
@li DEFAULT
|
|
|
|
@li EXPLICIT
|
|
|
|
@effect
|
|
|
|
DEFAULT selection mode is what you would expect on any desktop. Press
|
|
|
|
mouse, drag and release to end. EXPLICIT mode requires the application
|
|
|
|
controlling the edje object has to explicitly begin and end selection
|
|
|
|
modes, and the selection itself is dragable at both ends.
|
|
|
|
@endproperty
|
|
|
|
*/
|
|
|
|
static void
|
|
|
|
st_collections_group_parts_part_select_mode(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
|
|
|
|
check_arg_count(1);
|
|
|
|
|
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
|
|
|
ep->select_mode = parse_enum(0,
|
|
|
|
"DEFAULT", EDJE_ENTRY_SELECTION_MODE_DEFAULT,
|
|
|
|
"EXPLICIT", EDJE_ENTRY_SELECTION_MODE_EXPLICIT,
|
|
|
|
NULL);
|
|
|
|
}
|
|
|
|
|
2008-10-31 08:13:50 -07:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@property
|
|
|
|
multiline
|
|
|
|
@parameters
|
|
|
|
0 or 1 (boolean) off/on
|
|
|
|
@effect
|
|
|
|
It causes a textblock that is editable to allow multiple lines for
|
|
|
|
editing.
|
|
|
|
@endproperty
|
|
|
|
*/
|
|
|
|
static void
|
|
|
|
st_collections_group_parts_part_multiline(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
|
|
|
|
check_arg_count(1);
|
|
|
|
|
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
|
|
|
ep->multiline = parse_bool(0);
|
|
|
|
}
|
|
|
|
|
2007-11-23 08:43:03 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@block
|
|
|
|
dragable
|
|
|
|
@context
|
|
|
|
part {
|
|
|
|
..
|
|
|
|
dragable {
|
2008-03-14 17:51:45 -07:00
|
|
|
confine: "another part";
|
|
|
|
events: "another dragable part";
|
2007-11-23 08:43:03 -08:00
|
|
|
x: 0 0 0;
|
|
|
|
y: 0 0 0;
|
|
|
|
}
|
|
|
|
..
|
|
|
|
}
|
|
|
|
@description
|
2008-03-14 17:51:45 -07:00
|
|
|
When this block is used the resulting part can be dragged around the
|
2008-03-24 01:22:01 -07:00
|
|
|
interface, do not confuse with external drag & drop. By default Edje
|
|
|
|
(and most applications) will attempt to use the minimal size possible
|
2008-03-14 17:51:45 -07:00
|
|
|
for a dragable part. If the min property is not set in the description
|
|
|
|
the part will be (most likely) set to 0px width and 0px height, thus
|
|
|
|
invisible.
|
2007-11-23 08:43:03 -08:00
|
|
|
@endblock
|
|
|
|
|
|
|
|
@property
|
|
|
|
x
|
|
|
|
@parameters
|
|
|
|
[enable/disable] [step] [count]
|
|
|
|
@effect
|
|
|
|
Used to setup dragging events for the X axis. The first parameter is
|
2008-03-14 17:51:45 -07:00
|
|
|
used to enable (1 or -1) and disable (0) dragging along the axis. When
|
|
|
|
enabled, 1 will set the starting point at 0.0 and -1 at 1.0. The second
|
|
|
|
parameter takes any integer and will limit movement to values
|
2007-11-23 08:43:03 -08:00
|
|
|
divisibles by it, causing the part to jump from position to position.
|
|
|
|
The third parameter, (question from the author: What is count for?).
|
|
|
|
@endproperty
|
|
|
|
*/
|
2003-07-27 06:16:51 -07:00
|
|
|
static void
|
|
|
|
st_collections_group_parts_part_dragable_x(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
|
2004-10-23 13:12:21 -07:00
|
|
|
check_arg_count(3);
|
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
2003-08-31 19:53:08 -07:00
|
|
|
ep->dragable.x = parse_int_range(0, -1, 1);
|
2003-07-27 06:16:51 -07:00
|
|
|
ep->dragable.step_x = parse_int_range(1, 0, 0x7fffffff);
|
|
|
|
ep->dragable.count_x = parse_int_range(2, 0, 0x7fffffff);
|
|
|
|
}
|
|
|
|
|
2007-11-23 08:43:03 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@property
|
|
|
|
y
|
|
|
|
@parameters
|
|
|
|
[enable/disable] [step] [count]
|
|
|
|
@effect
|
|
|
|
Used to setup dragging events for the Y axis. The first parameter is
|
2008-03-14 17:51:45 -07:00
|
|
|
used to enable (1 or -1) and disable (0) dragging along the axis. When
|
|
|
|
enabled, 1 will set the starting point at 0.0 and -1 at 1.0. The second
|
|
|
|
parameter takes any integer and will limit movement to values
|
2007-11-23 08:43:03 -08:00
|
|
|
divisibles by it, causing the part to jump from position to position.
|
2008-03-14 17:51:45 -07:00
|
|
|
The third parameter, (question from the author: What is count for?).
|
2007-11-23 08:43:03 -08:00
|
|
|
@endproperty
|
|
|
|
*/
|
2003-07-27 06:16:51 -07:00
|
|
|
static void
|
|
|
|
st_collections_group_parts_part_dragable_y(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
|
2004-10-23 13:12:21 -07:00
|
|
|
check_arg_count(3);
|
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
2003-08-31 19:53:08 -07:00
|
|
|
ep->dragable.y = parse_int_range(0, -1, 1);
|
2003-07-27 06:16:51 -07:00
|
|
|
ep->dragable.step_y = parse_int_range(1, 0, 0x7fffffff);
|
|
|
|
ep->dragable.count_y = parse_int_range(2, 0, 0x7fffffff);
|
|
|
|
}
|
|
|
|
|
2007-11-23 08:43:03 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@property
|
|
|
|
confine
|
|
|
|
@parameters
|
|
|
|
[another part's name]
|
|
|
|
@effect
|
|
|
|
When set, limits the movement of the dragged part to another part's
|
2008-10-01 15:23:36 -07:00
|
|
|
container. When you use confine don't forget to set a min size for the
|
|
|
|
part, or the draggie will not show up.
|
2007-11-23 08:43:03 -08:00
|
|
|
@endproperty
|
|
|
|
*/
|
2003-07-27 06:16:51 -07:00
|
|
|
static void
|
|
|
|
st_collections_group_parts_part_dragable_confine(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
|
2004-10-23 13:12:21 -07:00
|
|
|
check_arg_count(1);
|
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
2003-07-27 06:16:51 -07:00
|
|
|
{
|
|
|
|
char *name;
|
2008-03-24 01:22:01 -07:00
|
|
|
|
2003-07-27 06:16:51 -07:00
|
|
|
name = parse_str(0);
|
|
|
|
data_queue_part_lookup(pc, name, &(ep->dragable.confine_id));
|
|
|
|
free(name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-11-23 08:43:03 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@property
|
|
|
|
events
|
|
|
|
@parameters
|
|
|
|
[another dragable part's name]
|
|
|
|
@effect
|
|
|
|
It causes the part to forward the drag events to another part, thus
|
|
|
|
ignoring them for itself.
|
|
|
|
@endproperty
|
|
|
|
*/
|
2005-07-26 06:59:03 -07:00
|
|
|
static void
|
|
|
|
st_collections_group_parts_part_dragable_events(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
|
|
|
|
check_arg_count(1);
|
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
2005-07-26 06:59:03 -07:00
|
|
|
{
|
|
|
|
char *name;
|
2008-03-24 01:22:01 -07:00
|
|
|
|
2005-07-26 06:59:03 -07:00
|
|
|
name = parse_str(0);
|
|
|
|
data_queue_part_lookup(pc, name, &(ep->dragable.events_id));
|
|
|
|
free(name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-11-23 21:15:15 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@block
|
|
|
|
items
|
|
|
|
@context
|
|
|
|
part {
|
|
|
|
..
|
|
|
|
box {
|
|
|
|
items {
|
|
|
|
item {
|
|
|
|
type: TYPE;
|
|
|
|
source: "some source";
|
|
|
|
min: 1 1;
|
|
|
|
max: 100 100;
|
|
|
|
padding: 1 1 2 2;
|
|
|
|
}
|
|
|
|
item {
|
|
|
|
type: TYPE;
|
|
|
|
source: "some other source";
|
|
|
|
name: "some name";
|
|
|
|
align: 1.0 0.5;
|
|
|
|
}
|
|
|
|
..
|
|
|
|
}
|
|
|
|
}
|
|
|
|
..
|
|
|
|
}
|
|
|
|
@description
|
|
|
|
On a part of type BOX, this block can be used to set other groups
|
|
|
|
as elements of the box. These can be mixed with external objects set
|
|
|
|
by the application through the edje_object_part_box_* API.
|
|
|
|
@endblock
|
|
|
|
*/
|
|
|
|
static void ob_collections_group_parts_part_box_items_item(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
Edje_Pack_Element *item;
|
|
|
|
|
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
|
|
|
|
2008-12-17 18:43:20 -08:00
|
|
|
if ((ep->type != EDJE_PART_TYPE_BOX) && (ep->type != EDJE_PART_TYPE_TABLE))
|
2008-11-23 21:15:15 -08:00
|
|
|
{
|
2009-12-22 05:46:00 -08:00
|
|
|
ERR("%s: Error. parse error %s:%i. "
|
|
|
|
"box attributes in non-BOX or TABLE part.",
|
|
|
|
progname, file_in, line - 1);
|
2008-11-23 21:15:15 -08:00
|
|
|
exit(-1);
|
|
|
|
}
|
|
|
|
|
|
|
|
item = mem_alloc(SZ(Edje_Pack_Element));
|
|
|
|
ep->items = eina_list_append(ep->items, item);
|
|
|
|
item->type = EDJE_PART_TYPE_GROUP;
|
|
|
|
item->name = NULL;
|
|
|
|
item->source = NULL;
|
|
|
|
item->min.w = 0;
|
|
|
|
item->min.h = 0;
|
|
|
|
item->prefer.w = 0;
|
|
|
|
item->prefer.h = 0;
|
|
|
|
item->max.w = -1;
|
|
|
|
item->max.h = -1;
|
|
|
|
item->padding.l = 0;
|
|
|
|
item->padding.r = 0;
|
|
|
|
item->padding.t = 0;
|
|
|
|
item->padding.b = 0;
|
2009-12-10 05:19:54 -08:00
|
|
|
item->align.x = FROM_DOUBLE(0.5);
|
|
|
|
item->align.y = FROM_DOUBLE(0.5);
|
|
|
|
item->weight.x = FROM_DOUBLE(0.0);
|
|
|
|
item->weight.y = FROM_DOUBLE(0.0);
|
2008-11-23 21:15:15 -08:00
|
|
|
item->aspect.w = 0;
|
|
|
|
item->aspect.h = 0;
|
|
|
|
item->aspect.mode = EDJE_ASPECT_PREFER_NONE;
|
|
|
|
item->options = NULL;
|
2008-12-17 18:43:20 -08:00
|
|
|
item->col = -1;
|
|
|
|
item->row = -1;
|
|
|
|
item->colspan = 1;
|
|
|
|
item->rowspan = 1;
|
2008-11-23 21:15:15 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@property
|
|
|
|
type
|
|
|
|
@parameters
|
|
|
|
Only GROUP for now (defaults to it)
|
|
|
|
@effect
|
|
|
|
Sets the type of the object this item will hold.
|
|
|
|
@endproperty
|
|
|
|
*/
|
|
|
|
static void st_collections_group_parts_part_box_items_item_type(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
Edje_Pack_Element *item;
|
|
|
|
|
|
|
|
check_arg_count(1);
|
|
|
|
|
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
|
|
|
|
|
|
|
item = eina_list_data_get(eina_list_last(ep->items));
|
|
|
|
|
|
|
|
{
|
|
|
|
char *s;
|
|
|
|
|
|
|
|
s = parse_str(0);
|
|
|
|
if (strcmp(s, "GROUP"))
|
|
|
|
{
|
2009-12-22 05:46:00 -08:00
|
|
|
ERR("%s: Error. parse error %s:%i. "
|
|
|
|
"token %s not one of: GROUP.",
|
|
|
|
progname, file_in, line - 1, s);
|
2008-11-23 21:15:15 -08:00
|
|
|
exit(-1);
|
|
|
|
}
|
|
|
|
/* FIXME: handle the enum, once everything else is supported */
|
|
|
|
item->type = EDJE_PART_TYPE_GROUP;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@property
|
|
|
|
name
|
|
|
|
@parameters
|
|
|
|
[name for the object]
|
|
|
|
@effect
|
|
|
|
Sets the name of the object via evas_object_name_set().
|
|
|
|
@endproperty
|
|
|
|
*/
|
|
|
|
static void st_collections_group_parts_part_box_items_item_name(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
Edje_Pack_Element *item;
|
|
|
|
|
|
|
|
check_arg_count(1);
|
|
|
|
|
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
|
|
|
|
|
|
|
item = eina_list_data_get(eina_list_last(ep->items));
|
|
|
|
item->name = parse_str(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@property
|
|
|
|
source
|
|
|
|
@parameters
|
|
|
|
[another groups name]
|
|
|
|
@effect
|
|
|
|
Sets the group this object will be made from.
|
|
|
|
@endproperty
|
|
|
|
*/
|
|
|
|
static void st_collections_group_parts_part_box_items_item_source(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
Edje_Pack_Element *item;
|
|
|
|
|
|
|
|
check_arg_count(1);
|
|
|
|
|
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
|
|
|
|
|
|
|
item = eina_list_data_get(eina_list_last(ep->items));
|
|
|
|
item->source = parse_str(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@property
|
|
|
|
min
|
|
|
|
@parameters
|
|
|
|
[width] [height]
|
|
|
|
@effect
|
|
|
|
Sets the minimum size hints for this object.
|
|
|
|
@endproperty
|
|
|
|
*/
|
|
|
|
static void st_collections_group_parts_part_box_items_item_min(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
Edje_Pack_Element *item;
|
|
|
|
|
|
|
|
check_arg_count(2);
|
|
|
|
|
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
|
|
|
|
|
|
|
item = eina_list_data_get(eina_list_last(ep->items));
|
|
|
|
item->min.w = parse_int_range(0, 0, 0x7ffffff);
|
|
|
|
item->min.h = parse_int_range(1, 0, 0x7ffffff);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@property
|
|
|
|
prefer
|
|
|
|
@parameters
|
|
|
|
[width] [height]
|
|
|
|
@effect
|
|
|
|
Sets the preferred size hints for this object.
|
|
|
|
@endproperty
|
|
|
|
*/
|
|
|
|
static void st_collections_group_parts_part_box_items_item_prefer(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
Edje_Pack_Element *item;
|
|
|
|
|
|
|
|
check_arg_count(2);
|
|
|
|
|
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
|
|
|
|
|
|
|
item = eina_list_data_get(eina_list_last(ep->items));
|
|
|
|
item->prefer.w = parse_int_range(0, 0, 0x7ffffff);
|
|
|
|
item->prefer.h = parse_int_range(1, 0, 0x7ffffff);
|
|
|
|
}
|
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@property
|
|
|
|
max
|
|
|
|
@parameters
|
|
|
|
[width] [height]
|
|
|
|
@effect
|
|
|
|
Sets the maximum size hints for this object.
|
|
|
|
@endproperty
|
|
|
|
*/
|
|
|
|
static void st_collections_group_parts_part_box_items_item_max(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
Edje_Pack_Element *item;
|
|
|
|
|
|
|
|
check_arg_count(2);
|
|
|
|
|
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
|
|
|
|
|
|
|
item = eina_list_data_get(eina_list_last(ep->items));
|
|
|
|
item->max.w = parse_int_range(0, 0, 0x7ffffff);
|
|
|
|
item->max.h = parse_int_range(1, 0, 0x7ffffff);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@property
|
|
|
|
padding
|
|
|
|
@parameters
|
|
|
|
[left] [right] [top] [bottom]
|
|
|
|
@effect
|
|
|
|
Sets the padding hints for this object.
|
|
|
|
@endproperty
|
|
|
|
*/
|
|
|
|
static void st_collections_group_parts_part_box_items_item_padding(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
Edje_Pack_Element *item;
|
|
|
|
|
|
|
|
check_arg_count(4);
|
|
|
|
|
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
|
|
|
|
|
|
|
item = eina_list_data_get(eina_list_last(ep->items));
|
|
|
|
item->padding.l = parse_int_range(0, 0, 0x7ffffff);
|
|
|
|
item->padding.r = parse_int_range(1, 0, 0x7ffffff);
|
|
|
|
item->padding.t = parse_int_range(2, 0, 0x7ffffff);
|
|
|
|
item->padding.b = parse_int_range(3, 0, 0x7ffffff);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@property
|
|
|
|
align
|
|
|
|
@parameters
|
|
|
|
[x] [y]
|
|
|
|
@effect
|
|
|
|
Sets the alignment hints for this object.
|
|
|
|
@endproperty
|
|
|
|
*/
|
|
|
|
static void st_collections_group_parts_part_box_items_item_align(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
Edje_Pack_Element *item;
|
|
|
|
|
|
|
|
check_arg_count(2);
|
|
|
|
|
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
|
|
|
|
|
|
|
item = eina_list_data_get(eina_list_last(ep->items));
|
2009-12-10 05:19:54 -08:00
|
|
|
item->align.x = FROM_DOUBLE(parse_float_range(0, -1.0, 1.0));
|
|
|
|
item->align.y = FROM_DOUBLE(parse_float_range(1, -1.0, 1.0));
|
2008-11-23 21:15:15 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@property
|
|
|
|
weight
|
|
|
|
@parameters
|
|
|
|
[x] [y]
|
|
|
|
@effect
|
|
|
|
Sets the weight hints for this object.
|
|
|
|
@endproperty
|
|
|
|
*/
|
|
|
|
static void st_collections_group_parts_part_box_items_item_weight(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
Edje_Pack_Element *item;
|
|
|
|
|
|
|
|
check_arg_count(2);
|
|
|
|
|
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
|
|
|
|
|
|
|
item = eina_list_data_get(eina_list_last(ep->items));
|
2009-12-10 05:19:54 -08:00
|
|
|
item->weight.x = FROM_DOUBLE(parse_float_range(0, 0.0, 99999.99));
|
|
|
|
item->weight.y = FROM_DOUBLE(parse_float_range(1, 0.0, 99999.99));
|
2008-11-23 21:15:15 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@property
|
|
|
|
aspect
|
|
|
|
@parameters
|
|
|
|
[w] [h]
|
|
|
|
@effect
|
|
|
|
Sets the aspect width and height hints for this object.
|
|
|
|
@endproperty
|
|
|
|
*/
|
|
|
|
static void st_collections_group_parts_part_box_items_item_aspect(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
Edje_Pack_Element *item;
|
|
|
|
|
|
|
|
check_arg_count(2);
|
|
|
|
|
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
|
|
|
|
|
|
|
item = eina_list_data_get(eina_list_last(ep->items));
|
|
|
|
item->aspect.w = parse_int_range(0, 0, 0x7fffffff);
|
|
|
|
item->aspect.h = parse_int_range(1, 0, 0x7fffffff);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@property
|
|
|
|
aspect_mode
|
|
|
|
@parameters
|
|
|
|
NONE, NEITHER, HORIZONTAL, VERTICAL, BOTH
|
|
|
|
@effect
|
|
|
|
Sets the aspect control hints for this object.
|
|
|
|
@endproperty
|
|
|
|
*/
|
|
|
|
static void st_collections_group_parts_part_box_items_item_aspect_mode(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
Edje_Pack_Element *item;
|
|
|
|
|
|
|
|
check_arg_count(1);
|
|
|
|
|
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
|
|
|
|
|
|
|
item = eina_list_data_get(eina_list_last(ep->items));
|
|
|
|
item->aspect.mode = parse_enum(0,
|
|
|
|
"NONE", EDJE_ASPECT_CONTROL_NONE,
|
|
|
|
"NEITHER", EDJE_ASPECT_CONTROL_NEITHER,
|
|
|
|
"HORIZONTAL", EDJE_ASPECT_CONTROL_HORIZONTAL,
|
|
|
|
"VERTICAL", EDJE_ASPECT_CONTROL_VERTICAL,
|
|
|
|
"BOTH", EDJE_ASPECT_CONTROL_BOTH,
|
|
|
|
NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@property
|
|
|
|
options
|
|
|
|
@parameters
|
|
|
|
[extra options]
|
|
|
|
@effect
|
|
|
|
Sets extra options for the object. Unused for now.
|
|
|
|
@endproperty
|
|
|
|
*/
|
|
|
|
static void st_collections_group_parts_part_box_items_item_options(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
Edje_Pack_Element *item;
|
|
|
|
|
|
|
|
check_arg_count(1);
|
|
|
|
|
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
|
|
|
|
|
|
|
item = eina_list_data_get(eina_list_last(ep->items));
|
|
|
|
item->options = parse_str(0);
|
|
|
|
}
|
|
|
|
|
2008-12-17 18:43:20 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@property
|
|
|
|
position
|
|
|
|
@parameters
|
|
|
|
[col] [row]
|
|
|
|
@effect
|
|
|
|
Sets the position this item will have in the table.
|
|
|
|
This is required for parts of type TABLE.
|
|
|
|
@endproperty
|
|
|
|
*/
|
|
|
|
static void st_collections_group_parts_part_table_items_item_position(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
Edje_Pack_Element *item;
|
|
|
|
|
|
|
|
check_arg_count(2);
|
|
|
|
|
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
|
|
|
|
|
|
|
if (ep->type != EDJE_PART_TYPE_TABLE)
|
|
|
|
{
|
2009-12-22 05:46:00 -08:00
|
|
|
ERR("%s: Error. parse error %s:%i. "
|
|
|
|
"table attributes in non-TABLE part.",
|
|
|
|
progname, file_in, line - 1);
|
2008-12-17 18:43:20 -08:00
|
|
|
exit(-1);
|
|
|
|
}
|
2009-12-22 05:46:00 -08:00
|
|
|
|
2008-12-17 18:43:20 -08:00
|
|
|
item = eina_list_data_get(eina_list_last(ep->items));
|
|
|
|
item->col = parse_int_range(0, 0, 0xffff);
|
|
|
|
item->row = parse_int_range(1, 0, 0xffff);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@property
|
|
|
|
span
|
|
|
|
@parameters
|
|
|
|
[col] [row]
|
|
|
|
@effect
|
|
|
|
Sets how many columns/rows this item will use.
|
|
|
|
Defaults to 1 1.
|
|
|
|
@endproperty
|
|
|
|
*/
|
|
|
|
static void st_collections_group_parts_part_table_items_item_span(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
Edje_Pack_Element *item;
|
|
|
|
|
|
|
|
check_arg_count(2);
|
|
|
|
|
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
|
|
|
|
|
|
|
if (ep->type != EDJE_PART_TYPE_TABLE)
|
|
|
|
{
|
2009-12-22 05:46:00 -08:00
|
|
|
ERR("%s: Error. parse error %s:%i. "
|
|
|
|
"table attributes in non-TABLE part.",
|
|
|
|
progname, file_in, line - 1);
|
2008-12-17 18:43:20 -08:00
|
|
|
exit(-1);
|
|
|
|
}
|
|
|
|
|
|
|
|
item = eina_list_data_get(eina_list_last(ep->items));
|
|
|
|
item->colspan = parse_int_range(0, 1, 0xffff);
|
|
|
|
item->rowspan = parse_int_range(1, 1, 0xffff);
|
|
|
|
}
|
|
|
|
|
2007-11-23 08:43:03 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@block
|
|
|
|
description
|
|
|
|
@context
|
|
|
|
description {
|
|
|
|
inherit: "another_description" INDEX;
|
|
|
|
state: "description_name" INDEX;
|
|
|
|
visible: 1;
|
|
|
|
min: 0 0;
|
|
|
|
max: -1 -1;
|
|
|
|
align: 0.5 0.5;
|
|
|
|
fixed: 0 0;
|
|
|
|
step: 0 0;
|
|
|
|
aspect: 1 1;
|
|
|
|
|
|
|
|
rel1 {
|
|
|
|
..
|
|
|
|
}
|
|
|
|
|
|
|
|
rel2 {
|
|
|
|
..
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@description
|
|
|
|
Every part can have one or more description blocks. Each description is
|
|
|
|
used to define style and layout properties of a part in a given
|
|
|
|
"state".
|
|
|
|
@endblock
|
|
|
|
*/
|
2003-06-12 15:34:51 -07:00
|
|
|
static void
|
|
|
|
ob_collections_group_parts_part_description(void)
|
|
|
|
{
|
2003-06-12 16:02:45 -07:00
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
Edje_Part_Description *ed;
|
2008-03-24 01:22:01 -07:00
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
2003-06-12 16:02:45 -07:00
|
|
|
ed = mem_alloc(SZ(Edje_Part_Description));
|
|
|
|
if (!ep->default_desc)
|
|
|
|
ep->default_desc = ed;
|
|
|
|
else
|
2008-10-22 04:34:42 -07:00
|
|
|
ep->other_desc = eina_list_append(ep->other_desc, ed);
|
2003-06-16 16:44:13 -07:00
|
|
|
ed->visible = 1;
|
2009-12-10 05:19:54 -08:00
|
|
|
ed->align.x = FROM_DOUBLE(0.5);
|
|
|
|
ed->align.y = FROM_DOUBLE(0.5);
|
2003-06-17 01:15:06 -07:00
|
|
|
ed->min.w = 0;
|
|
|
|
ed->min.h = 0;
|
2005-09-18 23:51:49 -07:00
|
|
|
ed->fixed.w = 0;
|
|
|
|
ed->fixed.h = 0;
|
2003-06-17 01:15:06 -07:00
|
|
|
ed->max.w = -1;
|
|
|
|
ed->max.h = -1;
|
2009-12-10 05:19:54 -08:00
|
|
|
ed->rel1.relative_x = FROM_DOUBLE(0.0);
|
|
|
|
ed->rel1.relative_y = FROM_DOUBLE(0.0);
|
2003-06-16 18:28:01 -07:00
|
|
|
ed->rel1.offset_x = 0;
|
2003-11-04 16:08:57 -08:00
|
|
|
ed->rel1.offset_y = 0;
|
2003-08-13 20:22:38 -07:00
|
|
|
ed->rel1.id_x = -1;
|
|
|
|
ed->rel1.id_y = -1;
|
2009-12-10 05:19:54 -08:00
|
|
|
ed->rel2.relative_x = FROM_DOUBLE(1.0);
|
|
|
|
ed->rel2.relative_y = FROM_DOUBLE(1.0);
|
2003-06-16 18:28:01 -07:00
|
|
|
ed->rel2.offset_x = -1;
|
2003-11-04 16:08:57 -08:00
|
|
|
ed->rel2.offset_y = -1;
|
2003-08-13 20:22:38 -07:00
|
|
|
ed->rel2.id_x = -1;
|
|
|
|
ed->rel2.id_y = -1;
|
2003-06-16 18:28:01 -07:00
|
|
|
ed->image.id = -1;
|
2003-06-27 20:08:25 -07:00
|
|
|
ed->fill.smooth = 1;
|
2009-12-10 05:19:54 -08:00
|
|
|
ed->fill.pos_rel_x = FROM_DOUBLE(0.0);
|
2003-06-16 16:44:13 -07:00
|
|
|
ed->fill.pos_abs_x = 0;
|
2009-12-10 05:19:54 -08:00
|
|
|
ed->fill.rel_x = FROM_DOUBLE(1.0);
|
2003-06-16 16:44:13 -07:00
|
|
|
ed->fill.abs_x = 0;
|
2009-12-10 05:19:54 -08:00
|
|
|
ed->fill.pos_rel_y = FROM_DOUBLE(0.0);
|
2003-06-16 16:44:13 -07:00
|
|
|
ed->fill.pos_abs_y = 0;
|
2009-12-10 05:19:54 -08:00
|
|
|
ed->fill.rel_y = FROM_DOUBLE(1.0);
|
2003-06-16 16:44:13 -07:00
|
|
|
ed->fill.abs_y = 0;
|
2006-08-02 03:52:44 -07:00
|
|
|
ed->fill.angle = 0;
|
|
|
|
ed->fill.spread = 0;
|
2007-07-06 15:36:40 -07:00
|
|
|
ed->fill.type = EDJE_FILL_TYPE_SCALE;
|
2003-10-28 22:42:03 -08:00
|
|
|
ed->color_class = NULL;
|
2003-06-16 16:44:13 -07:00
|
|
|
ed->color.r = 255;
|
|
|
|
ed->color.g = 255;
|
|
|
|
ed->color.b = 255;
|
|
|
|
ed->color.a = 255;
|
|
|
|
ed->color2.r = 0;
|
|
|
|
ed->color2.g = 0;
|
|
|
|
ed->color2.b = 0;
|
|
|
|
ed->color2.a = 255;
|
|
|
|
ed->color3.r = 0;
|
|
|
|
ed->color3.g = 0;
|
|
|
|
ed->color3.b = 0;
|
|
|
|
ed->color3.a = 128;
|
2009-12-10 05:19:54 -08:00
|
|
|
ed->text.align.x = FROM_DOUBLE(0.5);
|
|
|
|
ed->text.align.y = FROM_DOUBLE(0.5);
|
2004-10-12 20:43:42 -07:00
|
|
|
ed->text.id_source = -1;
|
|
|
|
ed->text.id_text_source = -1;
|
2009-12-10 05:19:54 -08:00
|
|
|
ed->gradient.rel1.relative_x = FROM_INT(0);
|
|
|
|
ed->gradient.rel1.relative_y = FROM_INT(0);
|
2006-08-20 20:14:09 -07:00
|
|
|
ed->gradient.rel1.offset_x = 0;
|
|
|
|
ed->gradient.rel1.offset_y = 0;
|
2009-12-10 05:19:54 -08:00
|
|
|
ed->gradient.rel2.relative_x = FROM_INT(1);
|
|
|
|
ed->gradient.rel2.relative_y = FROM_INT(1);
|
2006-08-20 20:14:09 -07:00
|
|
|
ed->gradient.rel2.offset_x = -1;
|
|
|
|
ed->gradient.rel2.offset_y = -1;
|
2008-11-23 21:15:15 -08:00
|
|
|
ed->box.layout = NULL;
|
|
|
|
ed->box.alt_layout = NULL;
|
2009-12-10 05:19:54 -08:00
|
|
|
ed->box.align.x = FROM_DOUBLE(0.5);
|
|
|
|
ed->box.align.y = FROM_DOUBLE(0.5);
|
2008-11-23 21:15:15 -08:00
|
|
|
ed->box.padding.x = 0;
|
|
|
|
ed->box.padding.y = 0;
|
2008-12-17 18:43:20 -08:00
|
|
|
ed->table.homogeneous = EDJE_OBJECT_TABLE_HOMOGENEOUS_NONE;
|
2009-12-10 05:19:54 -08:00
|
|
|
ed->table.align.x = FROM_DOUBLE(0.5);
|
|
|
|
ed->table.align.y = FROM_DOUBLE(0.5);
|
2008-12-17 18:43:20 -08:00
|
|
|
ed->table.padding.x = 0;
|
|
|
|
ed->table.padding.y = 0;
|
2009-10-26 18:08:19 -07:00
|
|
|
ed->external_params = NULL;
|
2003-06-12 16:02:45 -07:00
|
|
|
}
|
|
|
|
|
2007-11-23 08:43:03 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@property
|
|
|
|
inherit
|
|
|
|
@parameters
|
|
|
|
[another description's name] [another description's index]
|
|
|
|
@effect
|
|
|
|
When set, the description will inherit all the properties from the
|
|
|
|
named description. The properties defined in this part will override
|
|
|
|
the inherited properties, reducing the amount of necessary code for
|
|
|
|
simple state changes. Note: inheritance in Edje is single level only.
|
|
|
|
@endproperty
|
|
|
|
*/
|
2004-10-19 09:37:20 -07:00
|
|
|
static void
|
|
|
|
st_collections_group_parts_part_description_inherit(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
Edje_Part_Description *ed, *parent = NULL;
|
2008-10-22 04:34:42 -07:00
|
|
|
Eina_List *l;
|
|
|
|
Edje_Part_Image_Id *iid;
|
2008-12-05 19:08:17 -08:00
|
|
|
char *parent_name;
|
|
|
|
const char *state_name;
|
2004-10-19 09:37:20 -07:00
|
|
|
double parent_val, state_val;
|
|
|
|
|
2004-10-23 13:12:21 -07:00
|
|
|
check_arg_count(2);
|
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
2004-10-19 09:37:20 -07:00
|
|
|
|
|
|
|
/* inherit may not be used in the default description */
|
|
|
|
if (!ep->other_desc)
|
|
|
|
{
|
2009-12-22 05:46:00 -08:00
|
|
|
ERR("%s: Error. parse error %s:%i. "
|
|
|
|
"inherit may not be used in the default description",
|
|
|
|
progname, file_in, line - 1);
|
2004-10-19 09:37:20 -07:00
|
|
|
exit(-1);
|
|
|
|
}
|
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
ed = eina_list_data_get(eina_list_last(ep->other_desc));
|
2004-10-19 09:37:20 -07:00
|
|
|
|
|
|
|
if (!ed->state.name)
|
|
|
|
{
|
2009-12-22 05:46:00 -08:00
|
|
|
ERR("%s: Error. parse error %s:%i. "
|
|
|
|
"inherit may only be used after state",
|
|
|
|
progname, file_in, line - 1);
|
2004-10-19 09:37:20 -07:00
|
|
|
exit(-1);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* find the description that we inherit from */
|
|
|
|
parent_name = parse_str(0);
|
|
|
|
parent_val = parse_float_range(1, 0.0, 1.0);
|
|
|
|
|
|
|
|
if (!strcmp (parent_name, "default") && parent_val == 0.0)
|
|
|
|
parent = ep->default_desc;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
double min_dst = 999.0;
|
2008-10-22 04:34:42 -07:00
|
|
|
Edje_Part_Description *d;
|
2004-10-19 09:37:20 -07:00
|
|
|
|
|
|
|
if (!strcmp(parent_name, "default"))
|
|
|
|
{
|
|
|
|
parent = ep->default_desc;
|
|
|
|
min_dst = ABS(ep->default_desc->state.value - parent_val);
|
|
|
|
}
|
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
EINA_LIST_FOREACH(ep->other_desc, l, d)
|
2004-10-19 09:37:20 -07:00
|
|
|
{
|
|
|
|
if (!strcmp (d->state.name, parent_name))
|
|
|
|
{
|
|
|
|
double dst;
|
|
|
|
|
|
|
|
dst = ABS(d->state.value - parent_val);
|
|
|
|
if (dst < min_dst)
|
|
|
|
{
|
|
|
|
parent = d;
|
|
|
|
min_dst = dst;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!parent)
|
|
|
|
{
|
2009-12-22 05:46:00 -08:00
|
|
|
ERR("%s: Error. parse error %s:%i. "
|
|
|
|
"cannot find referenced part state %s %lf",
|
|
|
|
ep->name, file_in, line - 1, parent_name, parent_val);
|
2004-10-19 09:37:20 -07:00
|
|
|
exit(-1);
|
|
|
|
}
|
|
|
|
|
|
|
|
free (parent_name);
|
|
|
|
|
|
|
|
/* now do a full copy, only state info will be kept */
|
|
|
|
state_name = ed->state.name;
|
|
|
|
state_val = ed->state.value;
|
|
|
|
|
|
|
|
*ed = *parent;
|
|
|
|
|
|
|
|
ed->state.name = state_name;
|
|
|
|
ed->state.value = state_val;
|
|
|
|
|
|
|
|
data_queue_part_slave_lookup(&parent->rel1.id_x, &ed->rel1.id_x);
|
|
|
|
data_queue_part_slave_lookup(&parent->rel1.id_y, &ed->rel1.id_y);
|
|
|
|
data_queue_part_slave_lookup(&parent->rel2.id_x, &ed->rel2.id_x);
|
|
|
|
data_queue_part_slave_lookup(&parent->rel2.id_y, &ed->rel2.id_y);
|
|
|
|
data_queue_image_slave_lookup(&parent->image.id, &ed->image.id);
|
2006-08-02 03:52:44 -07:00
|
|
|
data_queue_spectrum_slave_lookup(&parent->gradient.id, &ed->gradient.id);
|
2004-10-19 09:37:20 -07:00
|
|
|
|
|
|
|
/* make sure all the allocated memory is getting copied, not just
|
|
|
|
* referenced
|
|
|
|
*/
|
|
|
|
ed->image.tween_list = NULL;
|
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
EINA_LIST_FOREACH(parent->image.tween_list, l, iid)
|
2004-10-20 07:26:06 -07:00
|
|
|
{
|
2008-10-22 04:34:42 -07:00
|
|
|
Edje_Part_Image_Id *iid_new;
|
2008-03-24 01:22:01 -07:00
|
|
|
|
2004-10-20 07:26:06 -07:00
|
|
|
iid_new = mem_alloc(SZ(Edje_Part_Image_Id));
|
|
|
|
data_queue_image_slave_lookup(&(iid->id), &(iid_new->id));
|
2008-10-22 04:34:42 -07:00
|
|
|
ed->image.tween_list = eina_list_append(ed->image.tween_list, iid_new);
|
2004-10-20 07:26:06 -07:00
|
|
|
}
|
2004-10-19 09:37:20 -07:00
|
|
|
|
|
|
|
#define STRDUP(x) x ? strdup(x) : NULL
|
|
|
|
|
|
|
|
ed->color_class = STRDUP(ed->color_class);
|
|
|
|
ed->text.text = STRDUP(ed->text.text);
|
|
|
|
ed->text.text_class = STRDUP(ed->text.text_class);
|
|
|
|
ed->text.font = STRDUP(ed->text.font);
|
|
|
|
#undef STRDUP
|
2004-10-20 07:26:06 -07:00
|
|
|
|
|
|
|
data_queue_part_slave_lookup(&(parent->text.id_source), &(ed->text.id_source));
|
|
|
|
data_queue_part_slave_lookup(&(parent->text.id_text_source), &(ed->text.id_text_source));
|
2009-10-26 18:08:19 -07:00
|
|
|
|
|
|
|
if (parent->external_params)
|
|
|
|
{
|
|
|
|
Eina_List *l;
|
|
|
|
Edje_External_Param *param, *new_param;
|
|
|
|
|
|
|
|
ed->external_params = NULL;
|
|
|
|
EINA_LIST_FOREACH(parent->external_params, l, param)
|
|
|
|
{
|
|
|
|
new_param = mem_alloc(SZ(Edje_External_Param));
|
|
|
|
*new_param = *param;
|
|
|
|
ed->external_params = eina_list_append(ed->external_params, new_param);
|
|
|
|
}
|
|
|
|
}
|
2004-10-19 09:37:20 -07:00
|
|
|
}
|
|
|
|
|
2007-11-23 08:43:03 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@property
|
|
|
|
state
|
|
|
|
@parameters
|
|
|
|
[a name for the description] [an index]
|
|
|
|
@effect
|
|
|
|
Sets a name used to identify a description inside a given part.
|
|
|
|
Multiple descriptions are used to declare different states of the same
|
|
|
|
part, like "clicked" or "invisible". All states declarations are also
|
|
|
|
coupled with an index number between 0.0 and 1.0. All parts must have
|
|
|
|
at least one description named "default 0.0".
|
|
|
|
@endproperty
|
|
|
|
*/
|
2003-06-12 16:02:45 -07:00
|
|
|
static void
|
|
|
|
st_collections_group_parts_part_description_state(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
Edje_Part_Description *ed;
|
2004-10-29 07:11:54 -07:00
|
|
|
char *s;
|
2004-10-23 13:12:21 -07:00
|
|
|
|
|
|
|
check_arg_count(2);
|
2008-03-24 01:22:01 -07:00
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
2003-06-12 16:02:45 -07:00
|
|
|
ed = ep->default_desc;
|
2008-10-22 04:34:42 -07:00
|
|
|
if (ep->other_desc) ed = eina_list_data_get(eina_list_last(ep->other_desc));
|
2004-10-29 07:11:54 -07:00
|
|
|
|
|
|
|
s = parse_str(0);
|
|
|
|
if (!strcmp (s, "custom"))
|
|
|
|
{
|
2009-12-22 05:46:00 -08:00
|
|
|
ERR("%s: Error. parse error %s:%i. "
|
|
|
|
"invalid state name: '%s'.",
|
|
|
|
progname, file_in, line - 1, s);
|
2004-10-29 07:11:54 -07:00
|
|
|
exit(-1);
|
|
|
|
}
|
|
|
|
|
|
|
|
ed->state.name = s;
|
2003-06-12 16:02:45 -07:00
|
|
|
ed->state.value = parse_float_range(1, 0.0, 1.0);
|
2003-06-12 15:34:51 -07:00
|
|
|
}
|
|
|
|
|
2007-11-23 08:43:03 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@property
|
|
|
|
visible
|
|
|
|
@parameters
|
|
|
|
[0 or 1]
|
|
|
|
@effect
|
|
|
|
Takes a boolean value specifying whether part is visible (1) or not
|
|
|
|
(0). Non-visible parts do not emit signals. The default value is 1.
|
|
|
|
@endproperty
|
|
|
|
*/
|
2003-06-13 20:06:36 -07:00
|
|
|
static void
|
|
|
|
st_collections_group_parts_part_description_visible(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
Edje_Part_Description *ed;
|
2004-10-23 13:12:21 -07:00
|
|
|
|
|
|
|
check_arg_count(1);
|
2008-03-24 01:22:01 -07:00
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
2003-06-13 20:06:36 -07:00
|
|
|
ed = ep->default_desc;
|
2008-10-22 04:34:42 -07:00
|
|
|
if (ep->other_desc) ed = eina_list_data_get(eina_list_last(ep->other_desc));
|
2004-10-13 11:07:56 -07:00
|
|
|
ed->visible = parse_bool(0);
|
2003-06-13 20:06:36 -07:00
|
|
|
}
|
|
|
|
|
2007-11-23 08:43:03 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@property
|
|
|
|
align
|
|
|
|
@parameters
|
|
|
|
[X axis] [Y axis]
|
|
|
|
@effect
|
|
|
|
When the displayed object's size is smaller than its container, this
|
|
|
|
property moves it relatively along both axis inside its container. The
|
|
|
|
default value is "0.5 0.5".
|
|
|
|
@endproperty
|
|
|
|
*/
|
2003-06-13 20:06:36 -07:00
|
|
|
static void
|
|
|
|
st_collections_group_parts_part_description_align(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
Edje_Part_Description *ed;
|
|
|
|
|
2004-10-23 13:12:21 -07:00
|
|
|
check_arg_count(2);
|
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
2003-06-13 20:06:36 -07:00
|
|
|
ed = ep->default_desc;
|
2008-10-22 04:34:42 -07:00
|
|
|
if (ep->other_desc) ed = eina_list_data_get(eina_list_last(ep->other_desc));
|
2009-12-10 05:19:54 -08:00
|
|
|
ed->align.x = FROM_DOUBLE(parse_float_range(0, 0.0, 1.0));
|
|
|
|
ed->align.y = FROM_DOUBLE(parse_float_range(1, 0.0, 1.0));
|
2003-06-13 20:06:36 -07:00
|
|
|
}
|
|
|
|
|
2007-11-23 08:43:03 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@property
|
|
|
|
fixed
|
|
|
|
@parameters
|
|
|
|
[width, 0 or 1] [height, 0 or 1]
|
|
|
|
@effect
|
2010-01-11 23:05:30 -08:00
|
|
|
This affects the minimum size calculation. See
|
|
|
|
edje_object_size_min_calc() and edje_object_size_min_restricted_calc().
|
|
|
|
This tells the min size calculation routine that this part does not
|
|
|
|
change size in width or height (1 for it doesn't, 0 for it does), so
|
|
|
|
the routine should not try and expand or contract the part.
|
2007-11-23 08:43:03 -08:00
|
|
|
@endproperty
|
|
|
|
*/
|
2005-09-18 23:51:49 -07:00
|
|
|
static void
|
|
|
|
st_collections_group_parts_part_description_fixed(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
Edje_Part_Description *ed;
|
|
|
|
|
|
|
|
check_arg_count(2);
|
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
2005-09-18 23:51:49 -07:00
|
|
|
ed = ep->default_desc;
|
2008-10-22 04:34:42 -07:00
|
|
|
if (ep->other_desc) ed = eina_list_data_get(eina_list_last(ep->other_desc));
|
2005-09-18 23:51:49 -07:00
|
|
|
ed->fixed.w = parse_float_range(0, 0, 1);
|
|
|
|
ed->fixed.h = parse_float_range(1, 0, 1);
|
|
|
|
}
|
|
|
|
|
2007-11-23 08:43:03 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@property
|
|
|
|
min
|
|
|
|
@parameters
|
|
|
|
[width] [height]
|
|
|
|
@effect
|
|
|
|
The minimum size of the state.
|
|
|
|
@endproperty
|
|
|
|
*/
|
2003-06-13 20:06:36 -07:00
|
|
|
static void
|
|
|
|
st_collections_group_parts_part_description_min(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
Edje_Part_Description *ed;
|
|
|
|
|
2004-10-23 13:12:21 -07:00
|
|
|
check_arg_count(2);
|
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
2003-06-13 20:06:36 -07:00
|
|
|
ed = ep->default_desc;
|
2008-10-22 04:34:42 -07:00
|
|
|
if (ep->other_desc) ed = eina_list_data_get(eina_list_last(ep->other_desc));
|
2003-06-13 20:06:36 -07:00
|
|
|
ed->min.w = parse_float_range(0, 0, 0x7fffffff);
|
|
|
|
ed->min.h = parse_float_range(1, 0, 0x7fffffff);
|
|
|
|
}
|
|
|
|
|
2007-11-23 08:43:03 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@property
|
|
|
|
max
|
|
|
|
@parameters
|
|
|
|
[width] [height]
|
|
|
|
@effect
|
|
|
|
The maximum size of the state.
|
|
|
|
@endproperty
|
|
|
|
*/
|
2003-06-13 20:06:36 -07:00
|
|
|
static void
|
|
|
|
st_collections_group_parts_part_description_max(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
Edje_Part_Description *ed;
|
|
|
|
|
2004-10-23 13:12:21 -07:00
|
|
|
check_arg_count(2);
|
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
2003-06-13 20:06:36 -07:00
|
|
|
ed = ep->default_desc;
|
2008-10-22 04:34:42 -07:00
|
|
|
if (ep->other_desc) ed = eina_list_data_get(eina_list_last(ep->other_desc));
|
2003-06-13 20:06:36 -07:00
|
|
|
ed->max.w = parse_float_range(0, 0, 0x7fffffff);
|
|
|
|
ed->max.h = parse_float_range(1, 0, 0x7fffffff);
|
|
|
|
}
|
|
|
|
|
2007-11-23 08:43:03 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@property
|
|
|
|
step
|
|
|
|
@parameters
|
|
|
|
[width] [height]
|
|
|
|
@effect
|
|
|
|
Restricts resizing of each dimension to values divisibles by its value.
|
|
|
|
This causes the part to jump from value to value while resizing. The
|
|
|
|
default value is "0 0" disabling stepping.
|
|
|
|
@endproperty
|
|
|
|
*/
|
2003-06-13 20:06:36 -07:00
|
|
|
static void
|
|
|
|
st_collections_group_parts_part_description_step(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
Edje_Part_Description *ed;
|
|
|
|
|
2004-10-23 13:12:21 -07:00
|
|
|
check_arg_count(2);
|
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
2003-06-13 20:06:36 -07:00
|
|
|
ed = ep->default_desc;
|
2008-10-22 04:34:42 -07:00
|
|
|
if (ep->other_desc) ed = eina_list_data_get(eina_list_last(ep->other_desc));
|
2003-06-13 20:06:36 -07:00
|
|
|
ed->step.x = parse_float_range(0, 0, 0x7fffffff);
|
|
|
|
ed->step.y = parse_float_range(1, 0, 0x7fffffff);
|
|
|
|
}
|
|
|
|
|
2007-11-23 08:43:03 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@property
|
|
|
|
aspect
|
|
|
|
@parameters
|
|
|
|
[min] [max]
|
|
|
|
@effect
|
|
|
|
Normally width and height can be resized to any values independently.
|
|
|
|
The aspect property forces the width to height ratio to be kept between
|
|
|
|
the minimum and maximum set. For example, "1.0 1.0" will increase the
|
|
|
|
width a pixel for every pixel added to heigh. The default value is
|
|
|
|
"0.0 0.0" disabling aspect.
|
|
|
|
@endproperty
|
|
|
|
*/
|
2003-06-13 20:06:36 -07:00
|
|
|
static void
|
|
|
|
st_collections_group_parts_part_description_aspect(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
Edje_Part_Description *ed;
|
|
|
|
|
2004-10-23 13:12:21 -07:00
|
|
|
check_arg_count(2);
|
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
2003-06-13 20:06:36 -07:00
|
|
|
ed = ep->default_desc;
|
2008-10-22 04:34:42 -07:00
|
|
|
if (ep->other_desc) ed = eina_list_data_get(eina_list_last(ep->other_desc));
|
2009-12-10 05:19:54 -08:00
|
|
|
ed->aspect.min = FROM_DOUBLE(parse_float_range(0, 0.0, 999999999.0));
|
|
|
|
ed->aspect.max = FROM_DOUBLE(parse_float_range(1, 0.0, 999999999.0));
|
2003-06-13 20:06:36 -07:00
|
|
|
}
|
|
|
|
|
2007-11-23 08:43:03 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@property
|
|
|
|
aspect_preference
|
|
|
|
@parameters
|
|
|
|
[DIMENSION]
|
|
|
|
@effect
|
|
|
|
Sets the scope of the "aspect" property to a given dimension. Available
|
|
|
|
options are BOTH, VERTICAL, HORIZONTAL and NONE
|
|
|
|
@endproperty
|
|
|
|
*/
|
2004-05-24 00:58:37 -07:00
|
|
|
static void
|
|
|
|
st_collections_group_parts_part_description_aspect_preference(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
Edje_Part_Description *ed;
|
|
|
|
|
2004-10-23 13:12:21 -07:00
|
|
|
check_arg_count(1);
|
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
2004-05-24 00:58:37 -07:00
|
|
|
ed = ep->default_desc;
|
2008-10-22 04:34:42 -07:00
|
|
|
if (ep->other_desc) ed = eina_list_data_get(eina_list_last(ep->other_desc));
|
2008-03-24 01:22:01 -07:00
|
|
|
ed->aspect.prefer = parse_enum(0,
|
2004-05-24 00:58:37 -07:00
|
|
|
"NONE", EDJE_ASPECT_PREFER_NONE,
|
|
|
|
"VERTICAL", EDJE_ASPECT_PREFER_VERTICAL,
|
|
|
|
"HORIZONTAL", EDJE_ASPECT_PREFER_HORIZONTAL,
|
2004-07-11 23:14:59 -07:00
|
|
|
"BOTH", EDJE_ASPECT_PREFER_BOTH,
|
2004-05-24 00:58:37 -07:00
|
|
|
NULL);
|
|
|
|
}
|
|
|
|
|
2007-11-23 08:43:03 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@property
|
|
|
|
color_class
|
|
|
|
@parameters
|
|
|
|
[color class name]
|
|
|
|
@effect
|
|
|
|
The part will use the color values of the named color_class, these
|
|
|
|
values can be overrided by the "color", "color2" and "color3"
|
|
|
|
properties set below.
|
|
|
|
@endproperty
|
|
|
|
*/
|
2007-11-23 08:40:38 -08:00
|
|
|
static void
|
|
|
|
st_collections_group_parts_part_description_color_class(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
Edje_Part_Description *ed;
|
|
|
|
|
|
|
|
check_arg_count(1);
|
2008-03-24 01:22:01 -07:00
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
2007-11-23 08:40:38 -08:00
|
|
|
ed = ep->default_desc;
|
2008-10-22 04:34:42 -07:00
|
|
|
if (ep->other_desc) ed = eina_list_data_get(eina_list_last(ep->other_desc));
|
2007-11-23 08:40:38 -08:00
|
|
|
ed->color_class = parse_str(0);
|
|
|
|
}
|
|
|
|
|
2007-11-23 08:43:03 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@property
|
|
|
|
color
|
|
|
|
@parameters
|
|
|
|
[red] [green] [blue] [alpha]
|
|
|
|
@effect
|
|
|
|
Sets the main color to the specified values (between 0 and 255).
|
|
|
|
@endproperty
|
|
|
|
*/
|
2007-11-23 08:40:38 -08:00
|
|
|
static void
|
|
|
|
st_collections_group_parts_part_description_color(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
Edje_Part_Description *ed;
|
|
|
|
|
|
|
|
check_arg_count(4);
|
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
2007-11-23 08:40:38 -08:00
|
|
|
ed = ep->default_desc;
|
2008-10-22 04:34:42 -07:00
|
|
|
if (ep->other_desc) ed = eina_list_data_get(eina_list_last(ep->other_desc));
|
2007-11-23 08:40:38 -08:00
|
|
|
ed->color.r = parse_int_range(0, 0, 255);
|
|
|
|
ed->color.g = parse_int_range(1, 0, 255);
|
|
|
|
ed->color.b = parse_int_range(2, 0, 255);
|
|
|
|
ed->color.a = parse_int_range(3, 0, 255);
|
|
|
|
}
|
|
|
|
|
2007-11-23 08:43:03 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@property
|
|
|
|
color2
|
|
|
|
@parameters
|
|
|
|
[red] [green] [blue] [alpha]
|
|
|
|
@effect
|
|
|
|
Sets the text shadow color to the specified values (0 to 255).
|
|
|
|
@endproperty
|
|
|
|
*/
|
2007-11-23 08:40:38 -08:00
|
|
|
static void
|
|
|
|
st_collections_group_parts_part_description_color2(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
Edje_Part_Description *ed;
|
|
|
|
|
|
|
|
check_arg_count(4);
|
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
2007-11-23 08:40:38 -08:00
|
|
|
ed = ep->default_desc;
|
2008-10-22 04:34:42 -07:00
|
|
|
if (ep->other_desc) ed = eina_list_data_get(eina_list_last(ep->other_desc));
|
2007-11-23 08:40:38 -08:00
|
|
|
ed->color2.r = parse_int_range(0, 0, 255);
|
|
|
|
ed->color2.g = parse_int_range(1, 0, 255);
|
|
|
|
ed->color2.b = parse_int_range(2, 0, 255);
|
|
|
|
ed->color2.a = parse_int_range(3, 0, 255);
|
|
|
|
}
|
|
|
|
|
2007-11-23 08:43:03 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@property
|
|
|
|
color3
|
|
|
|
@parameters
|
|
|
|
[red] [green] [blue] [alpha]
|
|
|
|
@effect
|
|
|
|
Sets the text outline color to the specified values (0 to 255).
|
|
|
|
@endproperty
|
|
|
|
*/
|
2007-11-23 08:40:38 -08:00
|
|
|
static void
|
|
|
|
st_collections_group_parts_part_description_color3(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
Edje_Part_Description *ed;
|
|
|
|
|
|
|
|
check_arg_count(4);
|
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
2007-11-23 08:40:38 -08:00
|
|
|
ed = ep->default_desc;
|
2008-10-22 04:34:42 -07:00
|
|
|
if (ep->other_desc) ed = eina_list_data_get(eina_list_last(ep->other_desc));
|
2007-11-23 08:40:38 -08:00
|
|
|
ed->color3.r = parse_int_range(0, 0, 255);
|
|
|
|
ed->color3.g = parse_int_range(1, 0, 255);
|
|
|
|
ed->color3.b = parse_int_range(2, 0, 255);
|
|
|
|
ed->color3.a = parse_int_range(3, 0, 255);
|
|
|
|
}
|
|
|
|
|
2007-11-23 08:43:03 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@block
|
|
|
|
rel1/rel2
|
|
|
|
@context
|
|
|
|
description {
|
|
|
|
..
|
|
|
|
rel1 {
|
|
|
|
relative: 0.0 0.0;
|
|
|
|
offset: 0 0;
|
|
|
|
}
|
|
|
|
..
|
|
|
|
rel2 {
|
|
|
|
relative: 1.0 1.0;
|
|
|
|
offset: -1 -1;
|
|
|
|
}
|
|
|
|
..
|
|
|
|
}
|
|
|
|
@description
|
|
|
|
The rel1 and rel2 blocks are used to define the position of each corner
|
|
|
|
of the part's container. With rel1 being the left-up corner and rel2
|
|
|
|
being the right-down corner.
|
|
|
|
@endblock
|
|
|
|
|
|
|
|
@property
|
|
|
|
relative
|
|
|
|
@parameters
|
|
|
|
[X axis] [Y axis]
|
|
|
|
@effect
|
|
|
|
Moves a corner to a relative position inside the container of the
|
|
|
|
relative "to" part. Values from 0.0 (0%, begining) to 1.0 (100%, end)
|
|
|
|
of each axis.
|
|
|
|
@endproperty
|
|
|
|
*/
|
2003-06-13 20:06:36 -07:00
|
|
|
static void
|
|
|
|
st_collections_group_parts_part_description_rel1_relative(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
Edje_Part_Description *ed;
|
|
|
|
|
2004-10-23 13:12:21 -07:00
|
|
|
check_arg_count(2);
|
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
2003-06-13 20:06:36 -07:00
|
|
|
ed = ep->default_desc;
|
2008-10-22 04:34:42 -07:00
|
|
|
if (ep->other_desc) ed = eina_list_data_get(eina_list_last(ep->other_desc));
|
2009-12-10 05:19:54 -08:00
|
|
|
ed->rel1.relative_x = FROM_DOUBLE(parse_float(0));
|
|
|
|
ed->rel1.relative_y = FROM_DOUBLE(parse_float(1));
|
2003-06-13 20:06:36 -07:00
|
|
|
}
|
|
|
|
|
2007-11-23 08:43:03 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@property
|
|
|
|
offset
|
|
|
|
@parameters
|
|
|
|
[X axis] [Y axis]
|
|
|
|
@effect
|
|
|
|
Affects the corner postion a fixed number of pixels along each axis.
|
|
|
|
@endproperty
|
|
|
|
*/
|
2003-06-13 20:06:36 -07:00
|
|
|
static void
|
|
|
|
st_collections_group_parts_part_description_rel1_offset(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
Edje_Part_Description *ed;
|
|
|
|
|
2004-10-23 13:12:21 -07:00
|
|
|
check_arg_count(2);
|
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
2003-06-13 20:06:36 -07:00
|
|
|
ed = ep->default_desc;
|
2008-10-22 04:34:42 -07:00
|
|
|
if (ep->other_desc) ed = eina_list_data_get(eina_list_last(ep->other_desc));
|
2003-06-13 20:06:36 -07:00
|
|
|
ed->rel1.offset_x = parse_int(0);
|
|
|
|
ed->rel1.offset_y = parse_int(1);
|
|
|
|
}
|
|
|
|
|
2007-11-23 08:43:03 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@property
|
|
|
|
to
|
|
|
|
@parameters
|
|
|
|
[another part's name]
|
|
|
|
@effect
|
|
|
|
Causes a corner to be positioned relatively to another part's
|
|
|
|
container.
|
|
|
|
@endproperty
|
|
|
|
*/
|
2003-06-13 20:06:36 -07:00
|
|
|
static void
|
|
|
|
st_collections_group_parts_part_description_rel1_to(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
Edje_Part_Description *ed;
|
|
|
|
|
2004-10-23 13:12:21 -07:00
|
|
|
check_arg_count(1);
|
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
2003-06-13 20:06:36 -07:00
|
|
|
ed = ep->default_desc;
|
2008-10-22 04:34:42 -07:00
|
|
|
if (ep->other_desc) ed = eina_list_data_get(eina_list_last(ep->other_desc));
|
2003-06-13 20:06:36 -07:00
|
|
|
{
|
|
|
|
char *name;
|
2008-03-24 01:22:01 -07:00
|
|
|
|
2003-06-13 20:06:36 -07:00
|
|
|
name = parse_str(0);
|
2003-08-13 20:22:38 -07:00
|
|
|
data_queue_part_lookup(pc, name, &(ed->rel1.id_x));
|
|
|
|
data_queue_part_lookup(pc, name, &(ed->rel1.id_y));
|
|
|
|
free(name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-11-23 08:43:03 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@property
|
|
|
|
to_x
|
|
|
|
@parameters
|
|
|
|
[another part's name]
|
|
|
|
@effect
|
|
|
|
Causes a corner to be positioned relatively to the X axis of another
|
|
|
|
part's container. Simply put affects the first parameter of "relative".
|
|
|
|
@endproperty
|
|
|
|
*/
|
2003-08-13 20:22:38 -07:00
|
|
|
static void
|
|
|
|
st_collections_group_parts_part_description_rel1_to_x(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
Edje_Part_Description *ed;
|
|
|
|
|
2004-10-23 13:12:21 -07:00
|
|
|
check_arg_count(1);
|
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
2003-08-13 20:22:38 -07:00
|
|
|
ed = ep->default_desc;
|
2008-10-22 04:34:42 -07:00
|
|
|
if (ep->other_desc) ed = eina_list_data_get(eina_list_last(ep->other_desc));
|
2003-08-13 20:22:38 -07:00
|
|
|
{
|
|
|
|
char *name;
|
2008-03-24 01:22:01 -07:00
|
|
|
|
2003-08-13 20:22:38 -07:00
|
|
|
name = parse_str(0);
|
|
|
|
data_queue_part_lookup(pc, name, &(ed->rel1.id_x));
|
|
|
|
free(name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-11-23 08:43:03 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@property
|
|
|
|
to_y
|
|
|
|
@parameters
|
|
|
|
[another part's name]
|
|
|
|
@effect
|
|
|
|
Causes a corner to be positioned relatively to the Y axis of another
|
|
|
|
part's container. Simply put, affects the second parameter of
|
|
|
|
"relative".
|
|
|
|
@endproperty
|
|
|
|
*/
|
2003-08-13 20:22:38 -07:00
|
|
|
static void
|
|
|
|
st_collections_group_parts_part_description_rel1_to_y(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
Edje_Part_Description *ed;
|
|
|
|
|
2004-10-23 13:12:21 -07:00
|
|
|
check_arg_count(1);
|
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
2003-08-13 20:22:38 -07:00
|
|
|
ed = ep->default_desc;
|
2008-10-22 04:34:42 -07:00
|
|
|
if (ep->other_desc) ed = eina_list_data_get(eina_list_last(ep->other_desc));
|
2003-08-13 20:22:38 -07:00
|
|
|
{
|
|
|
|
char *name;
|
2008-03-24 01:22:01 -07:00
|
|
|
|
2003-08-13 20:22:38 -07:00
|
|
|
name = parse_str(0);
|
|
|
|
data_queue_part_lookup(pc, name, &(ed->rel1.id_y));
|
2003-06-13 20:06:36 -07:00
|
|
|
free(name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
st_collections_group_parts_part_description_rel2_relative(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
Edje_Part_Description *ed;
|
|
|
|
|
2004-10-23 13:12:21 -07:00
|
|
|
check_arg_count(2);
|
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
2003-06-13 20:06:36 -07:00
|
|
|
ed = ep->default_desc;
|
2008-10-22 04:34:42 -07:00
|
|
|
if (ep->other_desc) ed = eina_list_data_get(eina_list_last(ep->other_desc));
|
2009-12-10 05:19:54 -08:00
|
|
|
ed->rel2.relative_x = FROM_DOUBLE(parse_float(0));
|
|
|
|
ed->rel2.relative_y = FROM_DOUBLE(parse_float(1));
|
2003-06-13 20:06:36 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
st_collections_group_parts_part_description_rel2_offset(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
Edje_Part_Description *ed;
|
|
|
|
|
2004-10-23 13:12:21 -07:00
|
|
|
check_arg_count(2);
|
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
2003-06-13 20:06:36 -07:00
|
|
|
ed = ep->default_desc;
|
2008-10-22 04:34:42 -07:00
|
|
|
if (ep->other_desc) ed = eina_list_data_get(eina_list_last(ep->other_desc));
|
2003-06-13 20:06:36 -07:00
|
|
|
ed->rel2.offset_x = parse_int(0);
|
|
|
|
ed->rel2.offset_y = parse_int(1);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
st_collections_group_parts_part_description_rel2_to(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
Edje_Part_Description *ed;
|
|
|
|
|
2004-10-23 13:12:21 -07:00
|
|
|
check_arg_count(1);
|
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
2003-06-13 20:06:36 -07:00
|
|
|
ed = ep->default_desc;
|
2008-10-22 04:34:42 -07:00
|
|
|
if (ep->other_desc) ed = eina_list_data_get(eina_list_last(ep->other_desc));
|
2003-06-13 20:06:36 -07:00
|
|
|
{
|
|
|
|
char *name;
|
2008-03-24 01:22:01 -07:00
|
|
|
|
2003-06-13 20:06:36 -07:00
|
|
|
name = parse_str(0);
|
2003-08-13 20:22:38 -07:00
|
|
|
data_queue_part_lookup(pc, name, &(ed->rel2.id_x));
|
|
|
|
data_queue_part_lookup(pc, name, &(ed->rel2.id_y));
|
|
|
|
free(name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
st_collections_group_parts_part_description_rel2_to_x(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
Edje_Part_Description *ed;
|
|
|
|
|
2004-10-23 13:12:21 -07:00
|
|
|
check_arg_count(1);
|
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
2003-08-13 20:22:38 -07:00
|
|
|
ed = ep->default_desc;
|
2008-10-22 04:34:42 -07:00
|
|
|
if (ep->other_desc) ed = eina_list_data_get(eina_list_last(ep->other_desc));
|
2003-08-13 20:22:38 -07:00
|
|
|
{
|
|
|
|
char *name;
|
2008-03-24 01:22:01 -07:00
|
|
|
|
2003-08-13 20:22:38 -07:00
|
|
|
name = parse_str(0);
|
|
|
|
data_queue_part_lookup(pc, name, &(ed->rel2.id_x));
|
|
|
|
free(name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
st_collections_group_parts_part_description_rel2_to_y(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
Edje_Part_Description *ed;
|
|
|
|
|
2004-10-23 13:12:21 -07:00
|
|
|
check_arg_count(1);
|
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
2003-08-13 20:22:38 -07:00
|
|
|
ed = ep->default_desc;
|
2008-10-22 04:34:42 -07:00
|
|
|
if (ep->other_desc) ed = eina_list_data_get(eina_list_last(ep->other_desc));
|
2003-08-13 20:22:38 -07:00
|
|
|
{
|
|
|
|
char *name;
|
2008-03-24 01:22:01 -07:00
|
|
|
|
2003-08-13 20:22:38 -07:00
|
|
|
name = parse_str(0);
|
|
|
|
data_queue_part_lookup(pc, name, &(ed->rel2.id_y));
|
2003-06-13 20:06:36 -07:00
|
|
|
free(name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-11-23 08:43:03 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@block
|
|
|
|
image
|
|
|
|
@context
|
|
|
|
description {
|
|
|
|
..
|
|
|
|
image {
|
|
|
|
normal: "filename.ext";
|
|
|
|
tween: "filename2.ext";
|
|
|
|
..
|
|
|
|
tween: "filenameN.ext";
|
|
|
|
border: left right top bottom;
|
2009-02-12 05:39:15 -08:00
|
|
|
middle: 0/1/NONE/DEFAULT/SOLID;
|
2007-11-23 08:43:03 -08:00
|
|
|
}
|
|
|
|
..
|
|
|
|
}
|
|
|
|
@description
|
|
|
|
@endblock
|
|
|
|
|
|
|
|
@property
|
|
|
|
normal
|
|
|
|
@parameters
|
|
|
|
[image's filename]
|
|
|
|
@effect
|
|
|
|
Name of image to be used as previously declared in the images block.
|
|
|
|
In an animation, this is the first and last image displayed. It's
|
|
|
|
required in any image part
|
|
|
|
@endproperty
|
|
|
|
*/
|
2003-06-13 20:06:36 -07:00
|
|
|
static void
|
|
|
|
st_collections_group_parts_part_description_image_normal(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
Edje_Part_Description *ed;
|
|
|
|
|
2004-10-23 13:12:21 -07:00
|
|
|
check_arg_count(1);
|
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
2004-10-19 10:21:13 -07:00
|
|
|
|
|
|
|
if (ep->type != EDJE_PART_TYPE_IMAGE)
|
|
|
|
{
|
2009-12-22 05:46:00 -08:00
|
|
|
ERR("%s: Error. parse error %s:%i. "
|
|
|
|
"image attributes in non-IMAGE part.",
|
|
|
|
progname, file_in, line - 1);
|
2004-10-19 10:21:13 -07:00
|
|
|
exit(-1);
|
|
|
|
}
|
|
|
|
|
2003-06-13 20:06:36 -07:00
|
|
|
ed = ep->default_desc;
|
2008-10-22 04:34:42 -07:00
|
|
|
if (ep->other_desc) ed = eina_list_data_get(eina_list_last(ep->other_desc));
|
2003-06-13 20:06:36 -07:00
|
|
|
{
|
|
|
|
char *name;
|
2008-03-24 01:22:01 -07:00
|
|
|
|
2003-06-13 20:06:36 -07:00
|
|
|
name = parse_str(0);
|
|
|
|
data_queue_image_lookup(name, &(ed->image.id));
|
|
|
|
free(name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-11-23 08:43:03 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@property
|
|
|
|
tween
|
|
|
|
@parameters
|
|
|
|
[image's filename]
|
|
|
|
@effect
|
|
|
|
Name of an image to be used in an animation loop, an image block can
|
|
|
|
have none, one or multiple tween declarations. Images are displayed in
|
|
|
|
the order they are listed.
|
|
|
|
@endproperty
|
|
|
|
*/
|
2003-06-13 20:06:36 -07:00
|
|
|
static void
|
|
|
|
st_collections_group_parts_part_description_image_tween(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
Edje_Part_Description *ed;
|
|
|
|
|
2004-10-23 13:12:21 -07:00
|
|
|
check_arg_count(1);
|
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
2004-10-19 10:21:13 -07:00
|
|
|
|
|
|
|
if (ep->type != EDJE_PART_TYPE_IMAGE)
|
|
|
|
{
|
2009-12-22 05:46:00 -08:00
|
|
|
ERR("%s: Error. parse error %s:%i. "
|
|
|
|
"image attributes in non-IMAGE part.",
|
|
|
|
progname, file_in, line - 1);
|
2004-10-19 10:21:13 -07:00
|
|
|
exit(-1);
|
|
|
|
}
|
|
|
|
|
2003-06-13 20:06:36 -07:00
|
|
|
ed = ep->default_desc;
|
2008-10-22 04:34:42 -07:00
|
|
|
if (ep->other_desc) ed = eina_list_data_get(eina_list_last(ep->other_desc));
|
2003-06-13 20:06:36 -07:00
|
|
|
{
|
|
|
|
char *name;
|
|
|
|
Edje_Part_Image_Id *iid;
|
2008-03-24 01:22:01 -07:00
|
|
|
|
2003-06-13 20:06:36 -07:00
|
|
|
iid = mem_alloc(SZ(Edje_Part_Image_Id));
|
2008-10-22 04:34:42 -07:00
|
|
|
ed->image.tween_list = eina_list_append(ed->image.tween_list, iid);
|
2003-06-13 20:06:36 -07:00
|
|
|
name = parse_str(0);
|
|
|
|
data_queue_image_lookup(name, &(iid->id));
|
|
|
|
free(name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-11-23 08:43:03 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@property
|
|
|
|
border
|
|
|
|
@parameters
|
|
|
|
[left] [right] [top] [bottom]
|
|
|
|
@effect
|
|
|
|
If set, the area (in pixels) of each side of the image will be
|
|
|
|
displayed as a fixed size border, from the side -> inwards, preventing
|
|
|
|
the corners from being changed on a resize.
|
|
|
|
@endproperty
|
|
|
|
*/
|
2003-06-13 20:06:36 -07:00
|
|
|
static void
|
2004-10-19 10:01:05 -07:00
|
|
|
st_collections_group_parts_part_description_image_border(void)
|
2003-06-13 20:06:36 -07:00
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
Edje_Part_Description *ed;
|
|
|
|
|
2004-10-23 13:12:21 -07:00
|
|
|
check_arg_count(4);
|
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
2004-10-19 10:21:13 -07:00
|
|
|
|
|
|
|
if (ep->type != EDJE_PART_TYPE_IMAGE)
|
|
|
|
{
|
2009-12-22 05:46:00 -08:00
|
|
|
ERR("%s: Error. parse error %s:%i. "
|
|
|
|
"image attributes in non-IMAGE part.",
|
|
|
|
progname, file_in, line - 1);
|
2004-10-19 10:21:13 -07:00
|
|
|
exit(-1);
|
|
|
|
}
|
|
|
|
|
2003-06-13 20:06:36 -07:00
|
|
|
ed = ep->default_desc;
|
2008-10-22 04:34:42 -07:00
|
|
|
if (ep->other_desc) ed = eina_list_data_get(eina_list_last(ep->other_desc));
|
2003-06-13 20:06:36 -07:00
|
|
|
ed->border.l = parse_int_range(0, 0, 0x7fffffff);
|
|
|
|
ed->border.r = parse_int_range(1, 0, 0x7fffffff);
|
|
|
|
ed->border.t = parse_int_range(2, 0, 0x7fffffff);
|
2008-03-24 01:22:01 -07:00
|
|
|
ed->border.b = parse_int_range(3, 0, 0x7fffffff);
|
2003-06-13 20:06:36 -07:00
|
|
|
}
|
|
|
|
|
2007-11-23 08:43:03 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@property
|
|
|
|
middle
|
|
|
|
@parameters
|
2009-02-12 05:39:15 -08:00
|
|
|
0, 1, NONE, DEFAULT, SOLID
|
2007-11-23 08:43:03 -08:00
|
|
|
@effect
|
2009-02-12 05:39:15 -08:00
|
|
|
If border is set, this value tells Edje if the rest of the
|
|
|
|
image (not covered by the defined border) will be displayed or not
|
|
|
|
or be assumed to be solid (without alpha). The default is 1/DEFAULT.
|
2007-11-23 08:43:03 -08:00
|
|
|
@endproperty
|
|
|
|
*/
|
2005-03-31 03:40:05 -08:00
|
|
|
static void
|
|
|
|
st_collections_group_parts_part_description_image_middle(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
Edje_Part_Description *ed;
|
|
|
|
|
|
|
|
check_arg_count(1);
|
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
2005-03-31 03:40:05 -08:00
|
|
|
|
|
|
|
if (ep->type != EDJE_PART_TYPE_IMAGE)
|
|
|
|
{
|
2009-12-22 05:46:00 -08:00
|
|
|
ERR("%s: Error. parse error %s:%i. "
|
|
|
|
"image attributes in non-IMAGE part.",
|
|
|
|
progname, file_in, line - 1);
|
2005-03-31 03:40:05 -08:00
|
|
|
exit(-1);
|
|
|
|
}
|
|
|
|
|
|
|
|
ed = ep->default_desc;
|
2008-10-22 04:34:42 -07:00
|
|
|
if (ep->other_desc) ed = eina_list_data_get(eina_list_last(ep->other_desc));
|
2009-02-12 05:39:15 -08:00
|
|
|
ed->border.no_fill = parse_enum(0,
|
|
|
|
"1", 0,
|
|
|
|
"DEFAULT", 0,
|
|
|
|
"0", 1,
|
|
|
|
"NONE", 1,
|
|
|
|
"SOLID", 2,
|
|
|
|
NULL);
|
2005-03-31 03:40:05 -08:00
|
|
|
}
|
|
|
|
|
2009-05-07 06:30:18 -07:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@property
|
|
|
|
scale_hint
|
|
|
|
@parameters
|
2009-06-10 10:54:40 -07:00
|
|
|
0, NONE, DYNAMIC, STATIC
|
2009-05-07 06:30:18 -07:00
|
|
|
@effect
|
|
|
|
Sets the evas image scale hint letting the engine more efectively save
|
|
|
|
cached copies of the scaled image if it maks sense
|
|
|
|
@endproperty
|
|
|
|
*/
|
|
|
|
static void
|
|
|
|
st_collections_group_parts_part_description_image_scale_hint(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
Edje_Part_Description *ed;
|
|
|
|
|
|
|
|
check_arg_count(1);
|
|
|
|
|
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
|
|
|
|
|
|
|
if (ep->type != EDJE_PART_TYPE_IMAGE)
|
|
|
|
{
|
2009-12-22 05:46:00 -08:00
|
|
|
ERR("%s: Error. parse error %s:%i. "
|
|
|
|
"image attributes in non-IMAGE part.",
|
|
|
|
progname, file_in, line - 1);
|
2009-05-07 06:30:18 -07:00
|
|
|
exit(-1);
|
|
|
|
}
|
|
|
|
|
|
|
|
ed = ep->default_desc;
|
|
|
|
if (ep->other_desc) ed = eina_list_data_get(eina_list_last(ep->other_desc));
|
|
|
|
ed->image.scale_hint = parse_enum(0,
|
|
|
|
"NONE", EVAS_IMAGE_SCALE_HINT_NONE,
|
|
|
|
"DYNAMIC", EVAS_IMAGE_SCALE_HINT_DYNAMIC,
|
|
|
|
"STATIC", EVAS_IMAGE_SCALE_HINT_STATIC,
|
|
|
|
"0", EVAS_IMAGE_SCALE_HINT_NONE,
|
|
|
|
NULL);
|
|
|
|
}
|
|
|
|
|
2007-11-23 08:43:03 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@block
|
|
|
|
fill
|
|
|
|
@context
|
|
|
|
description {
|
|
|
|
..
|
|
|
|
fill {
|
|
|
|
smooth: 0-1;
|
|
|
|
origin {
|
|
|
|
relative: X-axis Y-axis;
|
|
|
|
offset: X-axis Y-axis;
|
|
|
|
}
|
|
|
|
size {
|
|
|
|
relative: width height;
|
|
|
|
offset: width height;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
..
|
|
|
|
}
|
|
|
|
@description
|
|
|
|
The fill method is an optional block that defines the way an IMAGE or
|
|
|
|
GRADIENT part is going to be displayed inside its container.
|
|
|
|
@endblock
|
|
|
|
|
|
|
|
@property
|
|
|
|
smooth
|
|
|
|
@parameters
|
|
|
|
[0 or 1]
|
|
|
|
@effect
|
|
|
|
The smooth property takes a boolean value to decide if the image will
|
|
|
|
be smoothed on scaling (1) or not (0). The default value is 1.
|
|
|
|
@endproperty
|
|
|
|
*/
|
2003-06-27 20:08:25 -07:00
|
|
|
static void
|
|
|
|
st_collections_group_parts_part_description_fill_smooth(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
Edje_Part_Description *ed;
|
|
|
|
|
2004-10-23 13:12:21 -07:00
|
|
|
check_arg_count(1);
|
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
2004-10-19 10:21:13 -07:00
|
|
|
|
|
|
|
if (ep->type != EDJE_PART_TYPE_IMAGE)
|
|
|
|
{
|
2009-12-22 05:46:00 -08:00
|
|
|
ERR("%s: Error. parse error %s:%i. "
|
|
|
|
"fill.type attribute in non-IMAGE part.",
|
|
|
|
progname, file_in, line - 1);
|
2004-10-19 10:21:13 -07:00
|
|
|
exit(-1);
|
|
|
|
}
|
|
|
|
|
2003-06-27 20:08:25 -07:00
|
|
|
ed = ep->default_desc;
|
2008-10-22 04:34:42 -07:00
|
|
|
if (ep->other_desc) ed = eina_list_data_get(eina_list_last(ep->other_desc));
|
2004-10-13 11:07:56 -07:00
|
|
|
ed->fill.smooth = parse_bool(0);
|
2003-06-27 20:08:25 -07:00
|
|
|
}
|
|
|
|
|
2007-11-23 08:43:03 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
|
|
|
|
@property
|
|
|
|
spread
|
|
|
|
@parameters
|
|
|
|
TODO
|
|
|
|
@effect
|
|
|
|
TODO
|
|
|
|
@endproperty
|
|
|
|
*/
|
2003-06-13 20:06:36 -07:00
|
|
|
static void
|
2007-11-23 08:40:38 -08:00
|
|
|
st_collections_group_parts_part_description_fill_spread(void)
|
2003-06-13 20:06:36 -07:00
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
Edje_Part_Description *ed;
|
|
|
|
|
2007-11-23 08:40:38 -08:00
|
|
|
check_arg_count(1);
|
2004-10-23 13:12:21 -07:00
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
2004-10-19 10:21:13 -07:00
|
|
|
|
2007-11-23 08:40:38 -08:00
|
|
|
/* XXX this will need to include IMAGES when spread support is added to evas images */
|
|
|
|
if (ep->type != EDJE_PART_TYPE_GRADIENT)
|
2004-10-19 10:21:13 -07:00
|
|
|
{
|
|
|
|
fprintf(stderr, "%s: Error. parse error %s:%i. "
|
2007-11-23 08:40:38 -08:00
|
|
|
"gradient attributes in non-GRADIENT part.\n",
|
2004-10-24 02:48:29 -07:00
|
|
|
progname, file_in, line - 1);
|
2004-10-19 10:21:13 -07:00
|
|
|
exit(-1);
|
|
|
|
}
|
|
|
|
|
2003-06-13 20:06:36 -07:00
|
|
|
ed = ep->default_desc;
|
2008-10-22 04:34:42 -07:00
|
|
|
if (ep->other_desc) ed = eina_list_data_get(eina_list_last(ep->other_desc));
|
2007-11-23 08:40:38 -08:00
|
|
|
ed->fill.spread = parse_int_range(0, 0, 1);
|
2003-06-13 20:06:36 -07:00
|
|
|
}
|
|
|
|
|
2007-11-23 08:43:03 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
|
|
|
|
@property
|
|
|
|
angle
|
|
|
|
@parameters
|
2008-10-07 07:11:11 -07:00
|
|
|
[angle]
|
2007-11-23 08:43:03 -08:00
|
|
|
@effect
|
2008-10-07 07:11:11 -07:00
|
|
|
The angle of rotation of a GRADIENT part. It is invalid in any other
|
|
|
|
part type. The angle is espressed as an int, in the range 0 - 360.
|
2007-11-23 08:43:03 -08:00
|
|
|
@endproperty
|
|
|
|
*/
|
2003-06-13 20:06:36 -07:00
|
|
|
static void
|
2007-11-23 08:40:38 -08:00
|
|
|
st_collections_group_parts_part_description_fill_angle(void)
|
2003-06-13 20:06:36 -07:00
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
Edje_Part_Description *ed;
|
|
|
|
|
2007-11-23 08:40:38 -08:00
|
|
|
check_arg_count(1);
|
2004-10-23 13:12:21 -07:00
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
2004-10-19 10:21:13 -07:00
|
|
|
|
2007-11-23 08:40:38 -08:00
|
|
|
/* XXX this will need to include IMAGES when angle support is added to evas images */
|
|
|
|
if (ep->type != EDJE_PART_TYPE_GRADIENT)
|
2004-10-19 10:21:13 -07:00
|
|
|
{
|
2009-12-22 05:46:00 -08:00
|
|
|
ERR("%s: Error. parse error %s:%i. "
|
|
|
|
"gradient attributes in non-GRADIENT part.",
|
|
|
|
progname, file_in, line - 1);
|
2004-10-19 10:21:13 -07:00
|
|
|
exit(-1);
|
|
|
|
}
|
|
|
|
|
2003-06-13 20:06:36 -07:00
|
|
|
ed = ep->default_desc;
|
2008-10-22 04:34:42 -07:00
|
|
|
if (ep->other_desc) ed = eina_list_data_get(eina_list_last(ep->other_desc));
|
2007-11-23 08:40:38 -08:00
|
|
|
ed->fill.angle = parse_int_range(0, 0, 360);
|
2003-06-13 20:06:36 -07:00
|
|
|
}
|
|
|
|
|
2007-11-23 08:43:03 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
|
|
|
|
@property
|
|
|
|
type
|
|
|
|
@parameters
|
|
|
|
TODO
|
|
|
|
@effect
|
|
|
|
TODO
|
|
|
|
@endproperty
|
|
|
|
*/
|
2003-06-13 20:06:36 -07:00
|
|
|
static void
|
2007-11-23 08:40:38 -08:00
|
|
|
st_collections_group_parts_part_description_fill_type(void)
|
2003-06-13 20:06:36 -07:00
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
Edje_Part_Description *ed;
|
|
|
|
|
2007-11-23 08:40:38 -08:00
|
|
|
check_arg_count(1);
|
2004-10-23 13:12:21 -07:00
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
2003-06-13 20:06:36 -07:00
|
|
|
ed = ep->default_desc;
|
2008-10-22 04:34:42 -07:00
|
|
|
if (ep->other_desc) ed = eina_list_data_get(eina_list_last(ep->other_desc));
|
2004-10-19 10:21:13 -07:00
|
|
|
|
2007-11-23 08:40:38 -08:00
|
|
|
if (ep->type != EDJE_PART_TYPE_IMAGE)
|
2004-10-19 10:21:13 -07:00
|
|
|
{
|
2009-12-22 05:46:00 -08:00
|
|
|
ERR("%s: Error. parse error %s:%i. "
|
|
|
|
"fill attributes in non-IMAGE part.",
|
|
|
|
progname, file_in, line - 1);
|
2004-10-19 10:21:13 -07:00
|
|
|
exit(-1);
|
|
|
|
}
|
|
|
|
|
2007-11-23 08:40:38 -08:00
|
|
|
ed->fill.type = parse_enum(0,
|
|
|
|
"SCALE", EDJE_FILL_TYPE_SCALE,
|
|
|
|
"TILE", EDJE_FILL_TYPE_TILE,
|
|
|
|
NULL);
|
2003-06-13 20:06:36 -07:00
|
|
|
}
|
|
|
|
|
2007-11-23 08:43:03 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@block
|
|
|
|
origin
|
|
|
|
@context
|
|
|
|
description {
|
|
|
|
..
|
|
|
|
fill {
|
|
|
|
..
|
|
|
|
origin {
|
|
|
|
relative: 0.0 0.0;
|
|
|
|
offset: 0 0;
|
|
|
|
}
|
|
|
|
..
|
|
|
|
}
|
|
|
|
..
|
|
|
|
}
|
|
|
|
@description
|
|
|
|
The origin block is used to place the starting point, inside the
|
|
|
|
displayed element, that will be used to render the tile. By default,
|
|
|
|
the origin is set at the element's left-up corner.
|
|
|
|
@endblock
|
|
|
|
|
|
|
|
@property
|
|
|
|
relative
|
|
|
|
@parameters
|
|
|
|
[X axis] [Y axis]
|
|
|
|
@effect
|
|
|
|
Sets the starting point relatively to displayed element's content.
|
|
|
|
@endproperty
|
|
|
|
*/
|
2003-06-13 20:06:36 -07:00
|
|
|
static void
|
2007-11-23 08:40:38 -08:00
|
|
|
st_collections_group_parts_part_description_fill_origin_relative(void)
|
2003-06-13 20:06:36 -07:00
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
Edje_Part_Description *ed;
|
|
|
|
|
2004-10-23 13:12:21 -07:00
|
|
|
check_arg_count(2);
|
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
2004-10-19 10:21:13 -07:00
|
|
|
|
2006-08-02 03:52:44 -07:00
|
|
|
if (ep->type != EDJE_PART_TYPE_IMAGE && ep->type != EDJE_PART_TYPE_GRADIENT)
|
2004-10-19 10:21:13 -07:00
|
|
|
{
|
2009-12-22 05:46:00 -08:00
|
|
|
ERR("%s: Error. parse error %s:%i. "
|
|
|
|
"fill attributes in non-IMAGE part.",
|
|
|
|
progname, file_in, line - 1);
|
2004-10-19 10:21:13 -07:00
|
|
|
exit(-1);
|
|
|
|
}
|
|
|
|
|
2003-10-28 22:42:03 -08:00
|
|
|
ed = ep->default_desc;
|
2008-10-22 04:34:42 -07:00
|
|
|
if (ep->other_desc) ed = eina_list_data_get(eina_list_last(ep->other_desc));
|
2009-12-10 05:19:54 -08:00
|
|
|
ed->fill.pos_rel_x = FROM_DOUBLE(parse_float_range(0, -999999999.0, 999999999.0));
|
|
|
|
ed->fill.pos_rel_y = FROM_DOUBLE(parse_float_range(1, -999999999.0, 999999999.0));
|
2003-10-28 22:42:03 -08:00
|
|
|
}
|
|
|
|
|
2007-11-23 08:43:03 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@property
|
|
|
|
offset
|
|
|
|
@parameters
|
|
|
|
[X axis] [Y axis]
|
|
|
|
@effect
|
|
|
|
Affects the starting point a fixed number of pixels along each axis.
|
|
|
|
@endproperty
|
|
|
|
*/
|
2003-06-13 20:06:36 -07:00
|
|
|
static void
|
2007-11-23 08:40:38 -08:00
|
|
|
st_collections_group_parts_part_description_fill_origin_offset(void)
|
2003-06-13 20:06:36 -07:00
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
Edje_Part_Description *ed;
|
|
|
|
|
2007-11-23 08:40:38 -08:00
|
|
|
check_arg_count(2);
|
2004-10-23 13:12:21 -07:00
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
2007-11-23 08:40:38 -08:00
|
|
|
|
|
|
|
if (ep->type != EDJE_PART_TYPE_IMAGE && ep->type != EDJE_PART_TYPE_GRADIENT)
|
|
|
|
{
|
2009-12-22 05:46:00 -08:00
|
|
|
ERR("%s: Error. parse error %s:%i. "
|
|
|
|
"fill attributes in non-IMAGE part.",
|
|
|
|
progname, file_in, line - 1);
|
2007-11-23 08:40:38 -08:00
|
|
|
exit(-1);
|
|
|
|
}
|
|
|
|
|
2003-06-13 20:06:36 -07:00
|
|
|
ed = ep->default_desc;
|
2008-10-22 04:34:42 -07:00
|
|
|
if (ep->other_desc) ed = eina_list_data_get(eina_list_last(ep->other_desc));
|
2007-11-23 08:40:38 -08:00
|
|
|
ed->fill.pos_abs_x = parse_int(0);
|
|
|
|
ed->fill.pos_abs_y = parse_int(1);
|
2003-06-13 20:06:36 -07:00
|
|
|
}
|
|
|
|
|
2007-11-23 08:43:03 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@block
|
|
|
|
size
|
|
|
|
@context
|
|
|
|
description {
|
|
|
|
..
|
|
|
|
fill {
|
|
|
|
..
|
|
|
|
size {
|
|
|
|
relative: 1.0 1.0;
|
|
|
|
offset: -1 -1;
|
|
|
|
}
|
|
|
|
..
|
|
|
|
}
|
|
|
|
..
|
|
|
|
}
|
|
|
|
@description
|
|
|
|
The size block defines the tile size of the content that will be
|
|
|
|
displayed.
|
|
|
|
@endblock
|
|
|
|
|
|
|
|
@property
|
|
|
|
relative
|
|
|
|
@parameters
|
|
|
|
[width] [height]
|
|
|
|
@effect
|
|
|
|
Takes a pair of decimal values that represent the a percentual value
|
|
|
|
of the original size of the element. For example, "0.5 0.5" represents
|
|
|
|
half the size, while "2.0 2.0" represents the double. The default
|
|
|
|
value is "1.0 1.0".
|
|
|
|
@endproperty
|
|
|
|
*/
|
2003-06-13 20:06:36 -07:00
|
|
|
static void
|
2007-11-23 08:40:38 -08:00
|
|
|
st_collections_group_parts_part_description_fill_size_relative(void)
|
2003-06-13 20:06:36 -07:00
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
Edje_Part_Description *ed;
|
|
|
|
|
2007-11-23 08:40:38 -08:00
|
|
|
check_arg_count(2);
|
2004-10-23 13:12:21 -07:00
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
2003-06-13 20:06:36 -07:00
|
|
|
ed = ep->default_desc;
|
2008-10-22 04:34:42 -07:00
|
|
|
if (ep->other_desc) ed = eina_list_data_get(eina_list_last(ep->other_desc));
|
2007-11-23 08:40:38 -08:00
|
|
|
|
|
|
|
if (ep->type != EDJE_PART_TYPE_IMAGE && ep->type != EDJE_PART_TYPE_GRADIENT)
|
|
|
|
{
|
2009-12-22 05:46:00 -08:00
|
|
|
ERR("%s: Error. parse error %s:%i. "
|
|
|
|
"fill attributes in non-IMAGE part.",
|
|
|
|
progname, file_in, line - 1);
|
2007-11-23 08:40:38 -08:00
|
|
|
exit(-1);
|
|
|
|
}
|
|
|
|
|
2009-12-10 05:19:54 -08:00
|
|
|
ed->fill.rel_x = FROM_DOUBLE(parse_float_range(0, 0.0, 999999999.0));
|
|
|
|
ed->fill.rel_y = FROM_DOUBLE(parse_float_range(1, 0.0, 999999999.0));
|
2003-06-13 20:06:36 -07:00
|
|
|
}
|
|
|
|
|
2007-11-23 08:43:03 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@property
|
|
|
|
offset
|
|
|
|
@parameters
|
|
|
|
[X axis] [Y axis]
|
|
|
|
@effect
|
|
|
|
Affects the size of the tile a fixed number of pixels along each axis.
|
|
|
|
@endproperty
|
|
|
|
*/
|
2003-06-13 20:06:36 -07:00
|
|
|
static void
|
2007-11-23 08:40:38 -08:00
|
|
|
st_collections_group_parts_part_description_fill_size_offset(void)
|
2003-06-13 20:06:36 -07:00
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
Edje_Part_Description *ed;
|
|
|
|
|
2007-11-23 08:40:38 -08:00
|
|
|
check_arg_count(2);
|
2004-10-23 13:12:21 -07:00
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
2003-06-13 20:06:36 -07:00
|
|
|
ed = ep->default_desc;
|
2008-10-22 04:34:42 -07:00
|
|
|
if (ep->other_desc) ed = eina_list_data_get(eina_list_last(ep->other_desc));
|
2007-11-23 08:40:38 -08:00
|
|
|
|
|
|
|
if (ep->type != EDJE_PART_TYPE_IMAGE && ep->type != EDJE_PART_TYPE_GRADIENT)
|
|
|
|
{
|
2009-12-22 05:46:00 -08:00
|
|
|
ERR("%s: Error. parse error %s:%i. "
|
|
|
|
"fill attributes in non-IMAGE part.",
|
|
|
|
progname, file_in, line - 1);
|
2007-11-23 08:40:38 -08:00
|
|
|
exit(-1);
|
|
|
|
}
|
|
|
|
|
|
|
|
ed->fill.abs_x = parse_int(0);
|
|
|
|
ed->fill.abs_y = parse_int(1);
|
2003-06-13 20:06:36 -07:00
|
|
|
}
|
|
|
|
|
2007-11-23 08:43:03 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
|
|
|
|
@block
|
|
|
|
text
|
|
|
|
@context
|
|
|
|
part {
|
|
|
|
description {
|
|
|
|
..
|
|
|
|
text {
|
|
|
|
text: "some string of text to display";
|
|
|
|
font: "font_name";
|
|
|
|
size: SIZE;
|
|
|
|
text_class: "class_name";
|
|
|
|
fit: horizontal vertical;
|
|
|
|
min: horizontal vertical;
|
|
|
|
max: horizontal vertical;
|
|
|
|
align: X-axis Y-axis;
|
|
|
|
source: "part_name";
|
|
|
|
text_source: "text_part_name";
|
|
|
|
elipsis: 0.0-1.0;
|
|
|
|
style: "stylename";
|
|
|
|
}
|
|
|
|
..
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@description
|
|
|
|
@endblock
|
|
|
|
|
|
|
|
@property
|
|
|
|
text
|
|
|
|
@parameters
|
|
|
|
[a string of text, or nothing]
|
|
|
|
@effect
|
|
|
|
Sets the default content of a text part, normally the application is
|
|
|
|
the one changing its value.
|
|
|
|
@endproperty
|
|
|
|
*/
|
2003-06-13 20:06:36 -07:00
|
|
|
static void
|
|
|
|
st_collections_group_parts_part_description_text_text(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
Edje_Part_Description *ed;
|
2005-09-12 02:43:49 -07:00
|
|
|
char *str = NULL;
|
|
|
|
int i;
|
2008-03-24 01:22:01 -07:00
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
2004-10-19 10:21:13 -07:00
|
|
|
|
2005-09-12 02:43:49 -07:00
|
|
|
if ((ep->type != EDJE_PART_TYPE_TEXT) &&
|
|
|
|
(ep->type != EDJE_PART_TYPE_TEXTBLOCK))
|
2004-10-19 10:21:13 -07:00
|
|
|
{
|
2009-12-22 05:46:00 -08:00
|
|
|
ERR("%s: Error. parse error %s:%i. "
|
|
|
|
"text attributes in non-TEXT part.",
|
|
|
|
progname, file_in, line - 1);
|
2004-10-19 10:21:13 -07:00
|
|
|
exit(-1);
|
|
|
|
}
|
|
|
|
|
2003-06-13 20:06:36 -07:00
|
|
|
ed = ep->default_desc;
|
2008-10-22 04:34:42 -07:00
|
|
|
if (ep->other_desc) ed = eina_list_data_get(eina_list_last(ep->other_desc));
|
2005-09-12 02:43:49 -07:00
|
|
|
for (i = 0; ;i++)
|
|
|
|
{
|
|
|
|
char *s;
|
2008-03-24 01:22:01 -07:00
|
|
|
|
2005-09-12 02:43:49 -07:00
|
|
|
if (!is_param(i)) break;
|
|
|
|
s = parse_str(i);
|
|
|
|
if (!str) str = s;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
str = realloc(str, strlen(str) + strlen(s) + 1);
|
|
|
|
strcat(str, s);
|
|
|
|
free(s);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ed->text.text = str;
|
2003-06-13 20:06:36 -07:00
|
|
|
}
|
|
|
|
|
2007-11-23 08:43:03 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
|
|
|
|
@property
|
|
|
|
text_class
|
|
|
|
@parameters
|
|
|
|
[text class name]
|
|
|
|
@effect
|
|
|
|
Similar to color_class, this is the name used by the application
|
|
|
|
to alter the font family and size at runtime.
|
|
|
|
@endproperty
|
|
|
|
*/
|
2003-10-30 21:07:39 -08:00
|
|
|
static void
|
|
|
|
st_collections_group_parts_part_description_text_text_class(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
Edje_Part_Description *ed;
|
2004-10-23 13:12:21 -07:00
|
|
|
|
|
|
|
check_arg_count(1);
|
2008-03-24 01:22:01 -07:00
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
2004-10-19 10:21:13 -07:00
|
|
|
|
2005-09-17 22:37:06 -07:00
|
|
|
if ((ep->type != EDJE_PART_TYPE_TEXT) &&
|
|
|
|
(ep->type != EDJE_PART_TYPE_TEXTBLOCK))
|
2004-10-19 10:21:13 -07:00
|
|
|
{
|
2009-12-22 05:46:00 -08:00
|
|
|
ERR("%s: Error. parse error %s:%i. "
|
|
|
|
"text attributes in non-TEXT part.",
|
|
|
|
progname, file_in, line - 1);
|
2004-10-19 10:21:13 -07:00
|
|
|
exit(-1);
|
|
|
|
}
|
|
|
|
|
2003-10-30 21:07:39 -08:00
|
|
|
ed = ep->default_desc;
|
2008-10-22 04:34:42 -07:00
|
|
|
if (ep->other_desc) ed = eina_list_data_get(eina_list_last(ep->other_desc));
|
2003-10-30 21:07:39 -08:00
|
|
|
ed->text.text_class = parse_str(0);
|
|
|
|
}
|
|
|
|
|
2007-11-23 08:43:03 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
|
|
|
|
@property
|
|
|
|
font
|
|
|
|
@parameters
|
|
|
|
[font alias]
|
|
|
|
@effect
|
|
|
|
This sets the font family to one of the aliases set up in the "fonts"
|
|
|
|
block. Can be overrided by the application.
|
|
|
|
@endproperty
|
|
|
|
*/
|
2003-06-13 20:06:36 -07:00
|
|
|
static void
|
|
|
|
st_collections_group_parts_part_description_text_font(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
Edje_Part_Description *ed;
|
|
|
|
|
2004-10-23 13:12:21 -07:00
|
|
|
check_arg_count(1);
|
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
2004-10-19 10:21:13 -07:00
|
|
|
|
|
|
|
if (ep->type != EDJE_PART_TYPE_TEXT)
|
|
|
|
{
|
2009-12-22 05:46:00 -08:00
|
|
|
ERR("%s: Error. parse error %s:%i. "
|
|
|
|
"text attributes in non-TEXT part.",
|
|
|
|
progname, file_in, line - 1);
|
2004-10-19 10:21:13 -07:00
|
|
|
exit(-1);
|
|
|
|
}
|
|
|
|
|
2003-06-13 20:06:36 -07:00
|
|
|
ed = ep->default_desc;
|
2008-10-22 04:34:42 -07:00
|
|
|
if (ep->other_desc) ed = eina_list_data_get(eina_list_last(ep->other_desc));
|
2003-06-13 20:06:36 -07:00
|
|
|
ed->text.font = parse_str(0);
|
|
|
|
}
|
|
|
|
|
2007-11-23 08:43:03 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
|
|
|
|
@property
|
|
|
|
style
|
|
|
|
@parameters
|
|
|
|
[the style name]
|
|
|
|
@effect
|
|
|
|
Causes the part to use the default style and tags defined in the
|
|
|
|
"style" block with the specified name.
|
|
|
|
@endproperty
|
|
|
|
*/
|
2005-09-12 02:43:49 -07:00
|
|
|
static void
|
|
|
|
st_collections_group_parts_part_description_text_style(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
Edje_Part_Description *ed;
|
|
|
|
|
|
|
|
check_arg_count(1);
|
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
2005-09-12 02:43:49 -07:00
|
|
|
|
|
|
|
if (ep->type != EDJE_PART_TYPE_TEXTBLOCK)
|
|
|
|
{
|
2009-12-22 05:46:00 -08:00
|
|
|
ERR("%s: Error. parse error %s:%i. "
|
|
|
|
"text attributes in non-TEXTBLOCK part.",
|
|
|
|
progname, file_in, line - 1);
|
2005-09-12 02:43:49 -07:00
|
|
|
exit(-1);
|
|
|
|
}
|
|
|
|
|
|
|
|
ed = ep->default_desc;
|
2008-10-22 04:34:42 -07:00
|
|
|
if (ep->other_desc) ed = eina_list_data_get(eina_list_last(ep->other_desc));
|
2005-09-12 02:43:49 -07:00
|
|
|
ed->text.style = parse_str(0);
|
|
|
|
}
|
|
|
|
|
2008-10-22 22:38:06 -07:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
|
|
|
|
@property
|
|
|
|
repch
|
|
|
|
@parameters
|
|
|
|
[the replacement character string]
|
|
|
|
@effect
|
|
|
|
If this is a textblock and is in PASSWORD mode this string is used
|
|
|
|
to replace every character to hide the details of the entry. Normally
|
|
|
|
you would use a "*", but you can use anything you like.
|
|
|
|
@endproperty
|
|
|
|
*/
|
|
|
|
static void
|
|
|
|
st_collections_group_parts_part_description_text_repch(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
Edje_Part_Description *ed;
|
|
|
|
|
|
|
|
check_arg_count(1);
|
|
|
|
|
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
|
|
|
|
|
|
|
if (ep->type != EDJE_PART_TYPE_TEXTBLOCK)
|
|
|
|
{
|
2009-12-22 05:46:00 -08:00
|
|
|
ERR("%s: Error. parse error %s:%i. "
|
|
|
|
"text attributes in non-TEXTBLOCK part.",
|
|
|
|
progname, file_in, line - 1);
|
2008-10-22 22:38:06 -07:00
|
|
|
exit(-1);
|
|
|
|
}
|
|
|
|
|
|
|
|
ed = ep->default_desc;
|
|
|
|
if (ep->other_desc) ed = eina_list_data_get(eina_list_last(ep->other_desc));
|
|
|
|
ed->text.repch = parse_str(0);
|
|
|
|
}
|
|
|
|
|
2007-11-23 08:43:03 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
|
|
|
|
@property
|
|
|
|
size
|
|
|
|
@parameters
|
|
|
|
[font size in points (pt)]
|
|
|
|
@effect
|
|
|
|
Sets the default font size for the text part. Can be overrided by the
|
|
|
|
application.
|
|
|
|
@endproperty
|
|
|
|
*/
|
2003-06-13 20:06:36 -07:00
|
|
|
static void
|
|
|
|
st_collections_group_parts_part_description_text_size(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
Edje_Part_Description *ed;
|
|
|
|
|
2004-10-23 13:12:21 -07:00
|
|
|
check_arg_count(1);
|
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
2004-10-19 10:21:13 -07:00
|
|
|
|
|
|
|
if (ep->type != EDJE_PART_TYPE_TEXT)
|
|
|
|
{
|
2009-12-22 05:46:00 -08:00
|
|
|
ERR("%s: Error. parse error %s:%i. "
|
|
|
|
"text attributes in non-TEXT part.",
|
|
|
|
progname, file_in, line - 1);
|
2004-10-19 10:21:13 -07:00
|
|
|
exit(-1);
|
|
|
|
}
|
|
|
|
|
2003-06-13 20:06:36 -07:00
|
|
|
ed = ep->default_desc;
|
2008-10-22 04:34:42 -07:00
|
|
|
if (ep->other_desc) ed = eina_list_data_get(eina_list_last(ep->other_desc));
|
2003-06-13 20:06:36 -07:00
|
|
|
ed->text.size = parse_int_range(0, 0, 255);
|
|
|
|
}
|
|
|
|
|
2007-11-23 08:43:03 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
|
|
|
|
@property
|
|
|
|
fit
|
|
|
|
@parameters
|
|
|
|
[horizontal] [vertical]
|
|
|
|
@effect
|
|
|
|
When any of the parameters is set to 1 edje will resize the text for it
|
|
|
|
to fit in it's container. Both are disabled by default.
|
|
|
|
@endproperty
|
|
|
|
*/
|
2003-06-13 20:06:36 -07:00
|
|
|
static void
|
|
|
|
st_collections_group_parts_part_description_text_fit(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
Edje_Part_Description *ed;
|
|
|
|
|
2004-10-23 13:12:21 -07:00
|
|
|
check_arg_count(2);
|
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
2004-10-19 10:21:13 -07:00
|
|
|
|
|
|
|
if (ep->type != EDJE_PART_TYPE_TEXT)
|
|
|
|
{
|
2009-12-22 05:46:00 -08:00
|
|
|
ERR("%s: Error. parse error %s:%i. "
|
|
|
|
"text attributes in non-TEXT part.",
|
|
|
|
progname, file_in, line - 1);
|
2004-10-19 10:21:13 -07:00
|
|
|
exit(-1);
|
|
|
|
}
|
|
|
|
|
2003-06-13 20:06:36 -07:00
|
|
|
ed = ep->default_desc;
|
2008-10-22 04:34:42 -07:00
|
|
|
if (ep->other_desc) ed = eina_list_data_get(eina_list_last(ep->other_desc));
|
2004-10-13 11:07:56 -07:00
|
|
|
ed->text.fit_x = parse_bool(0);
|
|
|
|
ed->text.fit_y = parse_bool(1);
|
2003-06-13 20:06:36 -07:00
|
|
|
}
|
|
|
|
|
2007-11-23 08:43:03 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
|
|
|
|
@property
|
|
|
|
min
|
|
|
|
@parameters
|
|
|
|
[horizontal] [vertical]
|
|
|
|
@effect
|
|
|
|
When any of the parameters is enabled (1) it forces the minimum size of
|
|
|
|
the container to be equal to the minimum size of the text. The default
|
|
|
|
value is "0 0".
|
|
|
|
@endproperty
|
|
|
|
*/
|
2003-06-13 20:06:36 -07:00
|
|
|
static void
|
|
|
|
st_collections_group_parts_part_description_text_min(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
Edje_Part_Description *ed;
|
|
|
|
|
2004-10-23 13:12:21 -07:00
|
|
|
check_arg_count(2);
|
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
2004-10-19 10:21:13 -07:00
|
|
|
|
2005-09-17 22:37:06 -07:00
|
|
|
if ((ep->type != EDJE_PART_TYPE_TEXT) &&
|
|
|
|
(ep->type != EDJE_PART_TYPE_TEXTBLOCK))
|
2004-10-19 10:21:13 -07:00
|
|
|
{
|
2009-12-22 05:46:00 -08:00
|
|
|
ERR("%s: Error. parse error %s:%i. "
|
|
|
|
"text attributes in non-TEXT part.",
|
|
|
|
progname, file_in, line - 1);
|
2004-10-19 10:21:13 -07:00
|
|
|
exit(-1);
|
|
|
|
}
|
|
|
|
|
2003-06-13 20:06:36 -07:00
|
|
|
ed = ep->default_desc;
|
2008-10-22 04:34:42 -07:00
|
|
|
if (ep->other_desc) ed = eina_list_data_get(eina_list_last(ep->other_desc));
|
2004-10-13 11:07:56 -07:00
|
|
|
ed->text.min_x = parse_bool(0);
|
|
|
|
ed->text.min_y = parse_bool(1);
|
2003-06-13 20:06:36 -07:00
|
|
|
}
|
|
|
|
|
2007-11-23 08:43:03 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
|
|
|
|
@property
|
|
|
|
max
|
|
|
|
@parameters
|
|
|
|
[horizontal] [vertical]
|
|
|
|
@effect
|
|
|
|
When any of the parameters is enabled (1) it forces the maximum size of
|
|
|
|
the container to be equal to the maximum size of the text. The default
|
|
|
|
value is "0 0".
|
|
|
|
@endproperty
|
|
|
|
*/
|
2006-10-08 23:01:13 -07:00
|
|
|
static void
|
|
|
|
st_collections_group_parts_part_description_text_max(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
Edje_Part_Description *ed;
|
|
|
|
|
|
|
|
check_arg_count(2);
|
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
2006-10-08 23:01:13 -07:00
|
|
|
|
|
|
|
if ((ep->type != EDJE_PART_TYPE_TEXT) &&
|
|
|
|
(ep->type != EDJE_PART_TYPE_TEXTBLOCK))
|
|
|
|
{
|
2009-12-22 05:46:00 -08:00
|
|
|
ERR("%s: Error. parse error %s:%i. "
|
|
|
|
"text attributes in non-TEXT part.",
|
|
|
|
progname, file_in, line - 1);
|
2006-10-08 23:01:13 -07:00
|
|
|
exit(-1);
|
|
|
|
}
|
|
|
|
|
|
|
|
ed = ep->default_desc;
|
2008-10-22 04:34:42 -07:00
|
|
|
if (ep->other_desc) ed = eina_list_data_get(eina_list_last(ep->other_desc));
|
2006-10-08 23:01:13 -07:00
|
|
|
ed->text.max_x = parse_bool(0);
|
|
|
|
ed->text.max_y = parse_bool(1);
|
|
|
|
}
|
|
|
|
|
2007-11-23 08:43:03 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
|
|
|
|
@property
|
|
|
|
align
|
|
|
|
@parameters
|
|
|
|
[horizontal] [vertical]
|
|
|
|
@effect
|
|
|
|
Change the position of the point of balance inside the container. The
|
|
|
|
default value is 0.5 0.5.
|
|
|
|
@endproperty
|
|
|
|
*/
|
2003-06-13 20:06:36 -07:00
|
|
|
static void
|
|
|
|
st_collections_group_parts_part_description_text_align(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
Edje_Part_Description *ed;
|
|
|
|
|
2004-10-23 13:12:21 -07:00
|
|
|
check_arg_count(2);
|
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
2004-10-19 10:21:13 -07:00
|
|
|
|
|
|
|
if (ep->type != EDJE_PART_TYPE_TEXT)
|
|
|
|
{
|
2009-12-22 05:46:00 -08:00
|
|
|
ERR("%s: Error. parse error %s:%i. "
|
|
|
|
"text attributes in non-TEXT part.",
|
|
|
|
progname, file_in, line - 1);
|
2004-10-19 10:21:13 -07:00
|
|
|
exit(-1);
|
|
|
|
}
|
|
|
|
|
2003-06-13 20:06:36 -07:00
|
|
|
ed = ep->default_desc;
|
2008-10-22 04:34:42 -07:00
|
|
|
if (ep->other_desc) ed = eina_list_data_get(eina_list_last(ep->other_desc));
|
2009-12-10 05:19:54 -08:00
|
|
|
ed->text.align.x = FROM_DOUBLE(parse_float_range(0, 0.0, 1.0));
|
|
|
|
ed->text.align.y = FROM_DOUBLE(parse_float_range(1, 0.0, 1.0));
|
2003-06-13 20:06:36 -07:00
|
|
|
}
|
|
|
|
|
2007-11-23 08:43:03 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
|
|
|
|
@property
|
|
|
|
source
|
|
|
|
@parameters
|
|
|
|
[another TEXT part's name]
|
|
|
|
@effect
|
|
|
|
Causes the part to use the text properties (like font and size) of
|
|
|
|
another part and update them as they change.
|
|
|
|
@endproperty
|
|
|
|
*/
|
2004-10-12 20:43:42 -07:00
|
|
|
static void
|
|
|
|
st_collections_group_parts_part_description_text_source(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
Edje_Part_Description *ed;
|
|
|
|
|
2004-10-23 13:12:21 -07:00
|
|
|
check_arg_count(1);
|
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
2004-10-19 10:21:13 -07:00
|
|
|
|
2005-09-17 22:37:06 -07:00
|
|
|
if ((ep->type != EDJE_PART_TYPE_TEXT) &&
|
|
|
|
(ep->type != EDJE_PART_TYPE_TEXTBLOCK))
|
2004-10-19 10:21:13 -07:00
|
|
|
{
|
2009-12-22 05:46:00 -08:00
|
|
|
ERR("%s: Error. parse error %s:%i. "
|
|
|
|
"text attributes in non-TEXT part.",
|
|
|
|
progname, file_in, line - 1);
|
2004-10-19 10:21:13 -07:00
|
|
|
exit(-1);
|
|
|
|
}
|
|
|
|
|
2004-10-12 20:43:42 -07:00
|
|
|
ed = ep->default_desc;
|
2008-10-22 04:34:42 -07:00
|
|
|
if (ep->other_desc) ed = eina_list_data_get(eina_list_last(ep->other_desc));
|
2004-10-12 20:43:42 -07:00
|
|
|
{
|
|
|
|
char *name;
|
2008-03-24 01:22:01 -07:00
|
|
|
|
2004-10-12 20:43:42 -07:00
|
|
|
name = parse_str(0);
|
|
|
|
data_queue_part_lookup(pc, name, &(ed->text.id_source));
|
|
|
|
free(name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-11-23 08:43:03 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
|
|
|
|
@property
|
|
|
|
text_source
|
|
|
|
@parameters
|
|
|
|
[another TEXT part's name]
|
|
|
|
@effect
|
|
|
|
Causes the part to display the text content of another part and update
|
|
|
|
them as they change.
|
|
|
|
@endproperty
|
|
|
|
*/
|
2004-10-12 20:43:42 -07:00
|
|
|
static void
|
|
|
|
st_collections_group_parts_part_description_text_text_source(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
Edje_Part_Description *ed;
|
|
|
|
|
2004-10-23 13:12:21 -07:00
|
|
|
check_arg_count(1);
|
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
2004-10-19 10:21:13 -07:00
|
|
|
|
2005-09-17 22:37:06 -07:00
|
|
|
if ((ep->type != EDJE_PART_TYPE_TEXT) &&
|
|
|
|
(ep->type != EDJE_PART_TYPE_TEXTBLOCK))
|
2004-10-19 10:21:13 -07:00
|
|
|
{
|
2009-12-22 05:46:00 -08:00
|
|
|
ERR("%s: Error. parse error %s:%i. "
|
|
|
|
"text attributes in non-TEXT part.",
|
|
|
|
progname, file_in, line - 1);
|
2004-10-19 10:21:13 -07:00
|
|
|
exit(-1);
|
|
|
|
}
|
|
|
|
|
2004-10-12 20:43:42 -07:00
|
|
|
ed = ep->default_desc;
|
2008-10-22 04:34:42 -07:00
|
|
|
if (ep->other_desc) ed = eina_list_data_get(eina_list_last(ep->other_desc));
|
2004-10-12 20:43:42 -07:00
|
|
|
{
|
|
|
|
char *name;
|
2008-03-24 01:22:01 -07:00
|
|
|
|
2004-10-12 20:43:42 -07:00
|
|
|
name = parse_str(0);
|
|
|
|
data_queue_part_lookup(pc, name, &(ed->text.id_text_source));
|
|
|
|
free(name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-11-23 08:43:03 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
|
|
|
|
@property
|
|
|
|
text_elipsis
|
|
|
|
@parameters
|
|
|
|
[point of balance]
|
|
|
|
@effect
|
|
|
|
Used to balance the text in a relative point from 0.0 to 1.0, this
|
|
|
|
point is the last section of the string to be cut out in case of a
|
|
|
|
resize that is smaller than the text itself. The default value is 0.0.
|
|
|
|
@endproperty
|
|
|
|
*/
|
2005-11-05 19:32:01 -08:00
|
|
|
static void
|
|
|
|
st_collections_group_parts_part_description_text_elipsis(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
Edje_Part_Description *ed;
|
|
|
|
|
|
|
|
check_arg_count(1);
|
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
2005-11-05 19:32:01 -08:00
|
|
|
|
|
|
|
if (ep->type != EDJE_PART_TYPE_TEXT)
|
|
|
|
{
|
2009-12-22 05:46:00 -08:00
|
|
|
ERR("%s: Error. parse error %s:%i. "
|
|
|
|
"text attributes in non-TEXT part.",
|
|
|
|
progname, file_in, line - 1);
|
2005-11-05 19:32:01 -08:00
|
|
|
exit(-1);
|
|
|
|
}
|
|
|
|
|
|
|
|
ed = ep->default_desc;
|
2008-10-22 04:34:42 -07:00
|
|
|
if (ep->other_desc) ed = eina_list_data_get(eina_list_last(ep->other_desc));
|
2005-11-05 19:32:01 -08:00
|
|
|
ed->text.elipsis = parse_float_range(0, 0.0, 1.0);
|
|
|
|
}
|
|
|
|
|
2008-03-29 09:13:57 -07:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
|
|
|
|
@block
|
2008-07-02 13:13:31 -07:00
|
|
|
gradient
|
2008-03-29 09:13:57 -07:00
|
|
|
@context
|
|
|
|
part {
|
|
|
|
description {
|
|
|
|
..
|
|
|
|
gradient {
|
|
|
|
type: "linear";
|
|
|
|
spectrum "spectrumName";
|
|
|
|
rel1 {
|
|
|
|
relative: 0.0 0.0;
|
|
|
|
offset: 0 0;
|
|
|
|
}
|
|
|
|
rel2
|
|
|
|
relative: 1.0 1.0;
|
|
|
|
offset: -1 -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
..
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@description
|
|
|
|
A gradient block is used to display a given "spectrum" inside a
|
|
|
|
container. The container's shape is a rect but this not mean the
|
|
|
|
gradient is restricted to a rectangular shape. Gradients can use
|
|
|
|
"rel1" and "rel2" blocks to layout the initial and final point
|
|
|
|
relatively inside the container.
|
|
|
|
@endblock
|
|
|
|
|
|
|
|
@property
|
|
|
|
type
|
|
|
|
@parameters
|
|
|
|
[the name of the type]
|
|
|
|
@effect
|
|
|
|
Alters the gradient's rendering algorithm between:
|
|
|
|
@li linear (default)
|
|
|
|
@li radial
|
2008-10-07 07:11:11 -07:00
|
|
|
@li rectangular
|
|
|
|
@li angular
|
|
|
|
@li sinusoidal
|
2008-03-29 09:13:57 -07:00
|
|
|
@endproperty
|
|
|
|
*/
|
2008-03-24 01:22:01 -07:00
|
|
|
static void
|
2006-08-02 03:52:44 -07:00
|
|
|
st_collections_group_parts_part_description_gradient_type(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
Edje_Part_Description *ed;
|
|
|
|
|
|
|
|
check_arg_count(1);
|
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
2006-08-02 03:52:44 -07:00
|
|
|
|
|
|
|
if (ep->type != EDJE_PART_TYPE_GRADIENT)
|
|
|
|
{
|
2009-12-22 05:46:00 -08:00
|
|
|
ERR("%s: Error. parse error %s:%i. "
|
|
|
|
"gradient attributes in non-GRADIENT part.",
|
|
|
|
progname, file_in, line - 1);
|
2006-08-02 03:52:44 -07:00
|
|
|
exit(-1);
|
|
|
|
}
|
|
|
|
|
|
|
|
ed = ep->default_desc;
|
2008-10-22 04:34:42 -07:00
|
|
|
if (ep->other_desc) ed = eina_list_data_get(eina_list_last(ep->other_desc));
|
2006-08-02 03:52:44 -07:00
|
|
|
ed->gradient.type = parse_str(0);
|
|
|
|
}
|
|
|
|
|
2008-03-29 09:13:57 -07:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
|
|
|
|
@property
|
|
|
|
spectrum
|
|
|
|
@parameters
|
|
|
|
[an existing spectrum name]
|
|
|
|
@effect
|
|
|
|
Causes the gradient to display the colors as defined by a given
|
|
|
|
"spectrum" in the "spectra" block.
|
|
|
|
@endproperty
|
|
|
|
*/
|
2008-03-24 01:22:01 -07:00
|
|
|
static void
|
2006-08-02 03:52:44 -07:00
|
|
|
st_collections_group_parts_part_description_gradient_spectrum(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
Edje_Part_Description *ed;
|
|
|
|
|
|
|
|
check_arg_count(1);
|
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
2006-08-02 03:52:44 -07:00
|
|
|
|
|
|
|
if (ep->type != EDJE_PART_TYPE_GRADIENT)
|
|
|
|
{
|
2009-12-22 05:46:00 -08:00
|
|
|
ERR("%s: Error. parse error %s:%i. "
|
|
|
|
"gradient attributes in non-GRADIENT part.",
|
|
|
|
progname, file_in, line - 1);
|
2006-08-02 03:52:44 -07:00
|
|
|
exit(-1);
|
|
|
|
}
|
|
|
|
|
|
|
|
ed = ep->default_desc;
|
2008-10-22 04:34:42 -07:00
|
|
|
if (ep->other_desc) ed = eina_list_data_get(eina_list_last(ep->other_desc));
|
2006-08-02 03:52:44 -07:00
|
|
|
|
|
|
|
{
|
|
|
|
char *name;
|
2008-03-24 01:22:01 -07:00
|
|
|
|
2006-08-02 03:52:44 -07:00
|
|
|
name = parse_str(0);
|
|
|
|
data_queue_spectrum_lookup(name, &(ed->gradient.id));
|
|
|
|
free(name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-03-29 09:13:57 -07:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
|
|
|
|
@property
|
|
|
|
relative
|
|
|
|
@parameters
|
|
|
|
[a relative X coordinate] [a relative Y coordinate]
|
|
|
|
@effect
|
|
|
|
Inside rel1 places the initial point, or first color, of the gradient
|
|
|
|
relatively to the gradient's container. Inside rel2 places the final
|
|
|
|
point, or last color.
|
|
|
|
@endproperty
|
|
|
|
*/
|
2006-08-20 20:00:01 -07:00
|
|
|
static void
|
|
|
|
st_collections_group_parts_part_description_gradient_rel1_relative(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
Edje_Part_Description *ed;
|
|
|
|
|
|
|
|
check_arg_count(2);
|
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
2006-08-20 20:00:01 -07:00
|
|
|
|
|
|
|
if (ep->type != EDJE_PART_TYPE_GRADIENT)
|
|
|
|
{
|
2009-12-22 05:46:00 -08:00
|
|
|
ERR("%s: Error. parse error %s:%i. "
|
|
|
|
"gradient attributes in non-GRADIENT part.",
|
|
|
|
progname, file_in, line - 1);
|
2006-08-20 20:00:01 -07:00
|
|
|
exit(-1);
|
|
|
|
}
|
|
|
|
|
|
|
|
ed = ep->default_desc;
|
2008-10-22 04:34:42 -07:00
|
|
|
if (ep->other_desc) ed = eina_list_data_get(eina_list_last(ep->other_desc));
|
2006-08-20 20:00:01 -07:00
|
|
|
|
|
|
|
{
|
2006-08-20 20:14:09 -07:00
|
|
|
ed->gradient.use_rel = 1;
|
2006-08-20 20:00:01 -07:00
|
|
|
ed->gradient.rel1.relative_x = parse_float(0);
|
|
|
|
ed->gradient.rel1.relative_y = parse_float(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-03-29 09:13:57 -07:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
|
|
|
|
@property
|
|
|
|
offset
|
|
|
|
@parameters
|
|
|
|
[X axis] [Y axis]
|
|
|
|
@effect
|
|
|
|
Inside rel1 moves the initial point, or first color, of the gradient
|
|
|
|
a fixed number of pixels along either axis. Inside rel2 moves the final
|
|
|
|
point, or last color.
|
|
|
|
@endproperty
|
|
|
|
*/
|
2006-08-20 20:00:01 -07:00
|
|
|
static void
|
|
|
|
st_collections_group_parts_part_description_gradient_rel1_offset(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
Edje_Part_Description *ed;
|
|
|
|
|
|
|
|
check_arg_count(2);
|
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
2006-08-20 20:00:01 -07:00
|
|
|
|
|
|
|
if (ep->type != EDJE_PART_TYPE_GRADIENT)
|
|
|
|
{
|
2009-12-22 05:46:00 -08:00
|
|
|
ERR("%s: Error. parse error %s:%i. "
|
|
|
|
"gradient attributes in non-GRADIENT part.",
|
|
|
|
progname, file_in, line - 1);
|
2006-08-20 20:00:01 -07:00
|
|
|
exit(-1);
|
|
|
|
}
|
|
|
|
|
|
|
|
ed = ep->default_desc;
|
2008-10-22 04:34:42 -07:00
|
|
|
if (ep->other_desc) ed = eina_list_data_get(eina_list_last(ep->other_desc));
|
2006-08-20 20:00:01 -07:00
|
|
|
|
|
|
|
{
|
2006-08-20 20:14:09 -07:00
|
|
|
ed->gradient.use_rel = 1;
|
2006-08-20 20:00:01 -07:00
|
|
|
ed->gradient.rel1.offset_x = parse_int(0);
|
|
|
|
ed->gradient.rel1.offset_y = parse_int(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
st_collections_group_parts_part_description_gradient_rel2_relative(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
Edje_Part_Description *ed;
|
|
|
|
|
|
|
|
check_arg_count(2);
|
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
2006-08-20 20:00:01 -07:00
|
|
|
|
|
|
|
if (ep->type != EDJE_PART_TYPE_GRADIENT)
|
|
|
|
{
|
2009-12-22 05:46:00 -08:00
|
|
|
ERR("%s: Error. parse error %s:%i. "
|
|
|
|
"gradient attributes in non-GRADIENT part.",
|
|
|
|
progname, file_in, line - 1);
|
2006-08-20 20:00:01 -07:00
|
|
|
exit(-1);
|
|
|
|
}
|
2009-12-22 05:46:00 -08:00
|
|
|
|
2006-08-20 20:00:01 -07:00
|
|
|
ed = ep->default_desc;
|
2008-10-22 04:34:42 -07:00
|
|
|
if (ep->other_desc) ed = eina_list_data_get(eina_list_last(ep->other_desc));
|
2006-08-20 20:00:01 -07:00
|
|
|
|
|
|
|
{
|
2006-08-20 20:14:09 -07:00
|
|
|
ed->gradient.use_rel = 1;
|
2006-08-20 20:00:01 -07:00
|
|
|
ed->gradient.rel2.relative_x = parse_float(0);
|
|
|
|
ed->gradient.rel2.relative_y = parse_float(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
st_collections_group_parts_part_description_gradient_rel2_offset(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
Edje_Part_Description *ed;
|
|
|
|
|
|
|
|
check_arg_count(2);
|
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
2006-08-20 20:00:01 -07:00
|
|
|
|
|
|
|
if (ep->type != EDJE_PART_TYPE_GRADIENT)
|
|
|
|
{
|
2009-12-22 05:46:00 -08:00
|
|
|
ERR("%s: Error. parse error %s:%i. "
|
|
|
|
"gradient attributes in non-GRADIENT part.",
|
|
|
|
progname, file_in, line - 1);
|
2006-08-20 20:00:01 -07:00
|
|
|
exit(-1);
|
|
|
|
}
|
|
|
|
|
|
|
|
ed = ep->default_desc;
|
2008-10-22 04:34:42 -07:00
|
|
|
if (ep->other_desc) ed = eina_list_data_get(eina_list_last(ep->other_desc));
|
2006-08-20 20:00:01 -07:00
|
|
|
|
|
|
|
{
|
2006-08-20 20:14:09 -07:00
|
|
|
ed->gradient.use_rel = 1;
|
2006-08-20 20:00:01 -07:00
|
|
|
ed->gradient.rel2.offset_x = parse_int(0);
|
|
|
|
ed->gradient.rel2.offset_y = parse_int(1);
|
|
|
|
}
|
|
|
|
}
|
2006-08-02 03:52:44 -07:00
|
|
|
|
2008-11-23 21:15:15 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
|
|
|
|
@block
|
|
|
|
box
|
|
|
|
@context
|
|
|
|
part {
|
|
|
|
description {
|
|
|
|
..
|
|
|
|
box {
|
|
|
|
layout: "vertical";
|
|
|
|
padding: 0 2;
|
|
|
|
align: 0.5 0.5;
|
2009-02-28 11:38:35 -08:00
|
|
|
min: 0 0;
|
2008-11-23 21:15:15 -08:00
|
|
|
}
|
|
|
|
..
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@description
|
|
|
|
A box block can contain other objects and display them in different
|
|
|
|
layouts, any of the predefined set, or a custom one, set by the
|
|
|
|
application.
|
|
|
|
@endblock
|
|
|
|
|
|
|
|
@property
|
|
|
|
layout
|
|
|
|
@parameters
|
|
|
|
[primary layout] [fallback layout]
|
|
|
|
@effect
|
|
|
|
Sets the layout for the box:
|
|
|
|
@li horizontal (default)
|
|
|
|
@li vertical
|
|
|
|
@li horizontal_homogeneous
|
|
|
|
@li vertical_homogeneous
|
|
|
|
@li horizontal_max (homogeneous to the max sized child)
|
|
|
|
@li vertical_max
|
|
|
|
@li horizontal_flow
|
|
|
|
@li vertical_flow
|
|
|
|
@li stack
|
|
|
|
@li some_other_custom_layout_set_by_the_application
|
|
|
|
You could set a custom layout as fallback, it makes very
|
|
|
|
very little sense though, and if that one fails, it will
|
|
|
|
default to horizontal.
|
|
|
|
@endproperty
|
|
|
|
|
|
|
|
@property
|
|
|
|
align
|
|
|
|
@parameters
|
|
|
|
[horizontal] [vertical]
|
|
|
|
@effect
|
|
|
|
Change the position of the point of balance inside the container. The
|
|
|
|
default value is 0.5 0.5.
|
|
|
|
@endproperty
|
|
|
|
|
|
|
|
@property
|
|
|
|
padding
|
|
|
|
@parameters
|
|
|
|
[horizontal] [vertical]
|
|
|
|
@effect
|
|
|
|
Sets the space between cells in pixels. Defaults to 0 0.
|
|
|
|
@endproperty
|
2009-02-28 11:38:35 -08:00
|
|
|
|
|
|
|
@property
|
|
|
|
min
|
|
|
|
@parameters
|
|
|
|
[horizontal] [vertical]
|
|
|
|
@effect
|
|
|
|
When any of the parameters is enabled (1) it forces the minimum size of
|
|
|
|
the box to be equal to the minimum size of the items. The default
|
|
|
|
value is "0 0".
|
|
|
|
@endproperty
|
2008-11-23 21:15:15 -08:00
|
|
|
*/
|
|
|
|
static void st_collections_group_parts_part_description_box_layout(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
Edje_Part_Description *ed;
|
|
|
|
|
|
|
|
check_min_arg_count(1);
|
|
|
|
|
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
|
|
|
|
|
|
|
if (ep->type != EDJE_PART_TYPE_BOX)
|
|
|
|
{
|
2009-12-22 05:46:00 -08:00
|
|
|
ERR("%s: Error. parse error %s:%i. "
|
|
|
|
"box attributes in non-BOX part.",
|
|
|
|
progname, file_in, line - 1);
|
2008-11-23 21:15:15 -08:00
|
|
|
exit(-1);
|
|
|
|
}
|
|
|
|
|
|
|
|
ed = ep->default_desc;
|
|
|
|
if (ep->other_desc) ed = eina_list_data_get(eina_list_last(ep->other_desc));
|
|
|
|
ed->box.layout = parse_str(0);
|
|
|
|
if (is_param(1))
|
|
|
|
ed->box.alt_layout = parse_str(1);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void st_collections_group_parts_part_description_box_align(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
Edje_Part_Description *ed;
|
|
|
|
|
|
|
|
check_arg_count(2);
|
|
|
|
|
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
|
|
|
|
|
|
|
if (ep->type != EDJE_PART_TYPE_BOX)
|
|
|
|
{
|
2009-12-22 05:46:00 -08:00
|
|
|
ERR("%s: Error. parse error %s:%i. "
|
|
|
|
"box attributes in non-BOX part.",
|
|
|
|
progname, file_in, line - 1);
|
2008-11-23 21:15:15 -08:00
|
|
|
exit(-1);
|
|
|
|
}
|
|
|
|
|
|
|
|
ed = ep->default_desc;
|
|
|
|
if (ep->other_desc) ed = eina_list_data_get(eina_list_last(ep->other_desc));
|
2009-12-10 05:19:54 -08:00
|
|
|
ed->box.align.x = FROM_DOUBLE(parse_float_range(0, -1.0, 1.0));
|
|
|
|
ed->box.align.y = FROM_DOUBLE(parse_float_range(1, -1.0, 1.0));
|
2008-11-23 21:15:15 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void st_collections_group_parts_part_description_box_padding(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
Edje_Part_Description *ed;
|
|
|
|
|
|
|
|
check_arg_count(2);
|
|
|
|
|
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
|
|
|
|
|
|
|
if (ep->type != EDJE_PART_TYPE_BOX)
|
|
|
|
{
|
2009-12-22 05:46:00 -08:00
|
|
|
ERR("%s: Error. parse error %s:%i. "
|
|
|
|
"box attributes in non-BOX part.",
|
|
|
|
progname, file_in, line - 1);
|
2008-11-23 21:15:15 -08:00
|
|
|
exit(-1);
|
|
|
|
}
|
|
|
|
|
|
|
|
ed = ep->default_desc;
|
|
|
|
if (ep->other_desc) ed = eina_list_data_get(eina_list_last(ep->other_desc));
|
|
|
|
ed->box.padding.x = parse_int_range(0, 0, 0x7fffffff);
|
|
|
|
ed->box.padding.y = parse_int_range(1, 0, 0x7fffffff);
|
|
|
|
}
|
|
|
|
|
2009-02-28 11:38:35 -08:00
|
|
|
static void
|
|
|
|
st_collections_group_parts_part_description_box_min(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
Edje_Part_Description *ed;
|
|
|
|
|
|
|
|
check_arg_count(2);
|
|
|
|
|
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
|
|
|
|
|
|
|
if (ep->type != EDJE_PART_TYPE_BOX)
|
|
|
|
{
|
2009-12-22 05:46:00 -08:00
|
|
|
ERR("%s: Error. parse error %s:%i. "
|
|
|
|
"box attributes in non-BOX part.",
|
|
|
|
progname, file_in, line - 1);
|
2009-02-28 11:38:35 -08:00
|
|
|
exit(-1);
|
|
|
|
}
|
|
|
|
|
|
|
|
ed = ep->default_desc;
|
|
|
|
if (ep->other_desc) ed = eina_list_data_get(eina_list_last(ep->other_desc));
|
|
|
|
ed->box.min.h = parse_bool(0);
|
|
|
|
ed->box.min.v = parse_bool(1);
|
|
|
|
}
|
|
|
|
|
2008-12-17 18:43:20 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
|
|
|
|
@block
|
|
|
|
table
|
|
|
|
@context
|
|
|
|
part {
|
|
|
|
description {
|
|
|
|
..
|
|
|
|
table {
|
|
|
|
homogeneous: TABLE;
|
|
|
|
padding: 0 2;
|
|
|
|
align: 0.5 0.5;
|
|
|
|
}
|
|
|
|
..
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@description
|
|
|
|
A table block can contain other objects packed in multiple columns
|
|
|
|
and rows, and each item can span across more than one column and/or
|
|
|
|
row.
|
|
|
|
@endblock
|
|
|
|
|
|
|
|
@property
|
|
|
|
homogeneous
|
|
|
|
@parameters
|
|
|
|
[homogeneous mode]
|
|
|
|
@effect
|
|
|
|
Sets the homogeneous mode for the table:
|
|
|
|
@li NONE (default)
|
|
|
|
@li TABLE
|
|
|
|
@li ITEM
|
|
|
|
@endproperty
|
|
|
|
|
|
|
|
@property
|
|
|
|
align
|
|
|
|
@parameters
|
|
|
|
[horizontal] [vertical]
|
|
|
|
@effect
|
|
|
|
Change the position of the point of balance inside the container. The
|
|
|
|
default value is 0.5 0.5.
|
|
|
|
@endproperty
|
|
|
|
|
|
|
|
@property
|
|
|
|
padding
|
|
|
|
@parameters
|
|
|
|
[horizontal] [vertical]
|
|
|
|
@effect
|
|
|
|
Sets the space between cells in pixels. Defaults to 0 0.
|
|
|
|
@endproperty
|
|
|
|
*/
|
|
|
|
static void st_collections_group_parts_part_description_table_homogeneous(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
Edje_Part_Description *ed;
|
|
|
|
|
|
|
|
check_min_arg_count(1);
|
|
|
|
|
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
|
|
|
|
|
|
|
if (ep->type != EDJE_PART_TYPE_TABLE)
|
|
|
|
{
|
2009-12-22 05:46:00 -08:00
|
|
|
ERR("%s: Error. parse error %s:%i. "
|
|
|
|
"table attributes in non-TABLE part.",
|
|
|
|
progname, file_in, line - 1);
|
2008-12-17 18:43:20 -08:00
|
|
|
exit(-1);
|
|
|
|
}
|
|
|
|
|
|
|
|
ed = ep->default_desc;
|
|
|
|
if (ep->other_desc) ed = eina_list_data_get(eina_list_last(ep->other_desc));
|
|
|
|
ed->table.homogeneous = parse_enum(0,
|
|
|
|
"NONE", EDJE_OBJECT_TABLE_HOMOGENEOUS_NONE,
|
|
|
|
"TABLE", EDJE_OBJECT_TABLE_HOMOGENEOUS_TABLE,
|
|
|
|
"ITEM", EDJE_OBJECT_TABLE_HOMOGENEOUS_ITEM,
|
|
|
|
NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void st_collections_group_parts_part_description_table_align(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
Edje_Part_Description *ed;
|
|
|
|
|
|
|
|
check_arg_count(2);
|
|
|
|
|
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
|
|
|
|
|
|
|
if (ep->type != EDJE_PART_TYPE_TABLE)
|
|
|
|
{
|
2009-12-22 05:46:00 -08:00
|
|
|
ERR("%s: Error. parse error %s:%i. "
|
|
|
|
"table attributes in non-TABLE part.",
|
|
|
|
progname, file_in, line - 1);
|
2008-12-17 18:43:20 -08:00
|
|
|
exit(-1);
|
|
|
|
}
|
|
|
|
|
|
|
|
ed = ep->default_desc;
|
|
|
|
if (ep->other_desc) ed = eina_list_data_get(eina_list_last(ep->other_desc));
|
2009-12-10 05:19:54 -08:00
|
|
|
ed->table.align.x = FROM_DOUBLE(parse_float_range(0, -1.0, 1.0));
|
|
|
|
ed->table.align.y = FROM_DOUBLE(parse_float_range(1, -1.0, 1.0));
|
2008-12-17 18:43:20 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void st_collections_group_parts_part_description_table_padding(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
Edje_Part_Description *ed;
|
|
|
|
|
|
|
|
check_arg_count(2);
|
|
|
|
|
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
|
|
|
|
|
|
|
if (ep->type != EDJE_PART_TYPE_TABLE)
|
|
|
|
{
|
2009-12-22 05:46:00 -08:00
|
|
|
ERR("%s: Error. parse error %s:%i. "
|
|
|
|
"table attributes in non-TABLE part.",
|
|
|
|
progname, file_in, line - 1);
|
2008-12-17 18:43:20 -08:00
|
|
|
exit(-1);
|
|
|
|
}
|
|
|
|
|
|
|
|
ed = ep->default_desc;
|
|
|
|
if (ep->other_desc) ed = eina_list_data_get(eina_list_last(ep->other_desc));
|
|
|
|
ed->table.padding.x = parse_int_range(0, 0, 0x7fffffff);
|
|
|
|
ed->table.padding.y = parse_int_range(1, 0, 0x7fffffff);
|
|
|
|
}
|
|
|
|
|
2009-10-26 18:08:19 -07:00
|
|
|
static void
|
|
|
|
_st_collections_group_parts_part_description_params(Edje_External_Param_Type type)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
Edje_Part_Description *ed;
|
|
|
|
Edje_External_Param *param;
|
|
|
|
Eina_List *l;
|
|
|
|
const char *name;
|
|
|
|
int found = 0;
|
|
|
|
|
|
|
|
check_arg_count(2);
|
|
|
|
|
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
|
|
|
|
|
|
|
if (ep->type != EDJE_PART_TYPE_EXTERNAL)
|
|
|
|
{
|
2009-12-22 05:46:00 -08:00
|
|
|
ERR("%s: Error. parse error %s:%i. "
|
|
|
|
"params in non-EXTERNAL part.",
|
|
|
|
progname, file_in, line - 1);
|
2009-10-26 18:08:19 -07:00
|
|
|
exit(-1);
|
|
|
|
}
|
|
|
|
|
|
|
|
ed = ep->default_desc;
|
|
|
|
if (ep->other_desc) ed = eina_list_data_get(eina_list_last(ep->other_desc));
|
|
|
|
|
|
|
|
name = parse_str(0);
|
|
|
|
|
|
|
|
/* if a param with this name already exists, overwrite it */
|
|
|
|
EINA_LIST_FOREACH(ed->external_params, l, param)
|
|
|
|
{
|
|
|
|
if (!strcmp(param->name, name))
|
|
|
|
{
|
|
|
|
found = 1;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!found)
|
|
|
|
{
|
|
|
|
param = mem_alloc(SZ(Edje_External_Param));
|
|
|
|
param->name = name;
|
|
|
|
}
|
|
|
|
|
|
|
|
param->type = type;
|
|
|
|
param->i = 0;
|
|
|
|
param->d = 0;
|
|
|
|
param->s = NULL;
|
|
|
|
|
|
|
|
switch (type)
|
|
|
|
{
|
|
|
|
case EDJE_EXTERNAL_PARAM_TYPE_INT:
|
|
|
|
param->i = parse_int(1);
|
|
|
|
break;
|
|
|
|
case EDJE_EXTERNAL_PARAM_TYPE_DOUBLE:
|
|
|
|
param->d = parse_float(1);
|
|
|
|
break;
|
|
|
|
case EDJE_EXTERNAL_PARAM_TYPE_STRING:
|
|
|
|
param->s = parse_str(1);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!found)
|
|
|
|
ed->external_params = eina_list_append(ed->external_params, param);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@property
|
|
|
|
inherit
|
|
|
|
@parameters
|
|
|
|
[param_name] [int_value]
|
|
|
|
@effect
|
|
|
|
Adds an integer parameter for an external object
|
|
|
|
@endproperty
|
|
|
|
*/
|
|
|
|
static void
|
|
|
|
st_collections_group_parts_part_description_params_int(void)
|
|
|
|
{
|
|
|
|
_st_collections_group_parts_part_description_params(EDJE_EXTERNAL_PARAM_TYPE_INT);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@property
|
|
|
|
inherit
|
|
|
|
@parameters
|
|
|
|
[param_name] [double_value]
|
|
|
|
@effect
|
|
|
|
Adds a double parameter for an external object
|
|
|
|
@endproperty
|
|
|
|
*/
|
|
|
|
static void
|
|
|
|
st_collections_group_parts_part_description_params_double(void)
|
|
|
|
{
|
|
|
|
_st_collections_group_parts_part_description_params(EDJE_EXTERNAL_PARAM_TYPE_DOUBLE);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@property
|
|
|
|
inherit
|
|
|
|
@parameters
|
|
|
|
[param_name] [string_value]
|
|
|
|
@effect
|
|
|
|
Adds a string parameter for an external object
|
|
|
|
@endproperty
|
|
|
|
*/
|
|
|
|
static void
|
|
|
|
st_collections_group_parts_part_description_params_string(void)
|
|
|
|
{
|
|
|
|
_st_collections_group_parts_part_description_params(EDJE_EXTERNAL_PARAM_TYPE_STRING);
|
|
|
|
}
|
|
|
|
|
2008-09-23 12:25:01 -07:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@block
|
|
|
|
program
|
|
|
|
@context
|
|
|
|
group {
|
|
|
|
programs {
|
|
|
|
..
|
|
|
|
program {
|
|
|
|
name: "programname";
|
|
|
|
signal: "signalname";
|
|
|
|
source: "partname";
|
|
|
|
in: 0.3 0.0;
|
|
|
|
action: STATE_SET "statename" state_value;
|
|
|
|
transition: LINEAR 0.5;
|
|
|
|
target: "partname";
|
|
|
|
target: "anotherpart";
|
|
|
|
after: "programname";
|
|
|
|
after: "anotherprogram";
|
|
|
|
}
|
|
|
|
..
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@description
|
|
|
|
Programs define how your interface reacts to events.
|
|
|
|
Programs can change the state of parts, react to events or trigger
|
|
|
|
other events.
|
|
|
|
@endblock
|
|
|
|
*/
|
2003-06-12 15:34:51 -07:00
|
|
|
static void
|
|
|
|
ob_collections_group_programs_program(void)
|
2003-06-11 07:14:23 -07:00
|
|
|
{
|
2003-06-16 06:55:13 -07:00
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Program *ep;
|
2008-03-24 01:22:01 -07:00
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
2003-06-16 06:55:13 -07:00
|
|
|
ep = mem_alloc(SZ(Edje_Program));
|
2008-10-22 04:34:42 -07:00
|
|
|
pc->programs = eina_list_append(pc->programs, ep);
|
|
|
|
ep->id = eina_list_count(pc->programs) - 1;
|
2003-06-16 16:44:13 -07:00
|
|
|
ep->tween.mode = EDJE_TWEEN_MODE_LINEAR;
|
2004-03-07 18:43:48 -08:00
|
|
|
ep->after = NULL;
|
2003-06-16 06:55:13 -07:00
|
|
|
}
|
|
|
|
|
2008-09-23 12:25:01 -07:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@property
|
|
|
|
name
|
|
|
|
@parameters
|
|
|
|
[program name]
|
|
|
|
@effect
|
|
|
|
Symbolic name of program as a unique identifier.
|
|
|
|
@endproperty
|
|
|
|
*/
|
2003-06-16 06:55:13 -07:00
|
|
|
static void
|
|
|
|
st_collections_group_programs_program_name(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Program *ep;
|
|
|
|
|
2004-10-23 13:12:21 -07:00
|
|
|
check_arg_count(1);
|
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->programs));
|
2003-06-16 06:55:13 -07:00
|
|
|
ep->name = parse_str(0);
|
2004-10-05 22:25:03 -07:00
|
|
|
{
|
2008-10-22 04:34:42 -07:00
|
|
|
Eina_List *l;
|
|
|
|
Edje_Program *lep;
|
2008-03-24 01:22:01 -07:00
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
EINA_LIST_FOREACH(pc->programs, l, lep)
|
2004-10-05 22:25:03 -07:00
|
|
|
{
|
2005-08-09 00:18:10 -07:00
|
|
|
if ((lep != ep) && (lep->name) && (!strcmp(lep->name, ep->name)))
|
2004-10-05 22:25:03 -07:00
|
|
|
{
|
2009-12-22 05:46:00 -08:00
|
|
|
ERR("%s: Error. parse error %s:%i. There is already a program of the name %s\n",
|
|
|
|
progname, file_in, line - 1, ep->name);
|
2004-10-05 22:25:03 -07:00
|
|
|
exit(-1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2003-06-16 06:55:13 -07:00
|
|
|
}
|
|
|
|
|
2008-09-23 12:25:01 -07:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@property
|
|
|
|
signal
|
|
|
|
@parameters
|
|
|
|
[signal name]
|
|
|
|
@effect
|
|
|
|
Specifies signal(s) that should cause the program to run. The signal
|
|
|
|
received must match the specified source to run.
|
|
|
|
Signals may be globbed, but only one signal keyword per program
|
|
|
|
may be used. ex: signal: "mouse,clicked,*"; (clicking any mouse button
|
|
|
|
that matches source starts program).
|
|
|
|
@endproperty
|
|
|
|
*/
|
2003-06-16 06:55:13 -07:00
|
|
|
static void
|
|
|
|
st_collections_group_programs_program_signal(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Program *ep;
|
|
|
|
|
2004-10-23 13:12:21 -07:00
|
|
|
check_arg_count(1);
|
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->programs));
|
2003-06-16 06:55:13 -07:00
|
|
|
ep->signal = parse_str(0);
|
|
|
|
}
|
|
|
|
|
2008-09-23 12:25:01 -07:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@property
|
|
|
|
source
|
|
|
|
@parameters
|
|
|
|
[source name]
|
|
|
|
@effect
|
|
|
|
Source of accepted signal. Sources may be globbed, but only one source
|
|
|
|
keyword per program may be used. ex:source: "button-*"; (Signals from
|
|
|
|
any part or program named "button-*" are accepted)
|
|
|
|
@endproperty
|
|
|
|
*/
|
2003-06-16 06:55:13 -07:00
|
|
|
static void
|
|
|
|
st_collections_group_programs_program_source(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Program *ep;
|
|
|
|
|
2004-10-23 13:12:21 -07:00
|
|
|
check_arg_count(1);
|
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->programs));
|
2003-06-16 06:55:13 -07:00
|
|
|
ep->source = parse_str(0);
|
|
|
|
}
|
|
|
|
|
2008-09-23 12:25:01 -07:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@property
|
|
|
|
in
|
|
|
|
@parameters
|
|
|
|
[from] [range]
|
|
|
|
@effect
|
|
|
|
Wait 'from' seconds before executing the program. And add a random
|
|
|
|
number of seconds (from 0 to 'range') to the total waiting time.
|
|
|
|
@endproperty
|
|
|
|
*/
|
2003-06-27 21:20:41 -07:00
|
|
|
static void
|
|
|
|
st_collections_group_programs_program_in(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Program *ep;
|
|
|
|
|
2004-10-23 13:12:21 -07:00
|
|
|
check_arg_count(2);
|
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->programs));
|
2003-06-27 21:20:41 -07:00
|
|
|
ep->in.from = parse_float_range(0, 0.0, 999999999.0);
|
|
|
|
ep->in.range = parse_float_range(1, 0.0, 999999999.0);
|
|
|
|
}
|
|
|
|
|
2008-09-23 12:25:01 -07:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@property
|
|
|
|
action
|
|
|
|
@parameters
|
|
|
|
[type] [param1] [param2]
|
|
|
|
@effect
|
|
|
|
Action to be performed by the program. Valid actions are: STATE_SET,
|
2008-10-13 02:19:04 -07:00
|
|
|
ACTION_STOP, SIGNAL_EMIT, DRAG_VAL_SET, DRAG_VAL_STEP, DRAG_VAL_PAGE,
|
|
|
|
FOCUS_SET.
|
2008-09-23 12:25:01 -07:00
|
|
|
Only one action can be specified per program. Examples:\n
|
|
|
|
action: STATE_SET "statename" 0.5;\n
|
|
|
|
action: ACTION_STOP "programname";\n
|
|
|
|
action: SIGNAL_EMIT "signalname" "emitter";
|
|
|
|
@endproperty
|
|
|
|
*/
|
2003-06-16 06:55:13 -07:00
|
|
|
static void
|
|
|
|
st_collections_group_programs_program_action(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Program *ep;
|
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->programs));
|
2003-06-16 06:55:13 -07:00
|
|
|
ep->action = parse_enum(0,
|
|
|
|
"STATE_SET", EDJE_ACTION_TYPE_STATE_SET,
|
|
|
|
"ACTION_STOP", EDJE_ACTION_TYPE_ACTION_STOP,
|
2003-06-20 06:41:00 -07:00
|
|
|
"SIGNAL_EMIT", EDJE_ACTION_TYPE_SIGNAL_EMIT,
|
2003-08-31 19:53:08 -07:00
|
|
|
"DRAG_VAL_SET", EDJE_ACTION_TYPE_DRAG_VAL_SET,
|
|
|
|
"DRAG_VAL_STEP", EDJE_ACTION_TYPE_DRAG_VAL_STEP,
|
|
|
|
"DRAG_VAL_PAGE", EDJE_ACTION_TYPE_DRAG_VAL_PAGE,
|
2004-03-27 21:26:17 -08:00
|
|
|
"SCRIPT", EDJE_ACTION_TYPE_SCRIPT,
|
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-15 19:34:02 -07:00
|
|
|
"LUA_SCRIPT", EDJE_ACTION_TYPE_LUA_SCRIPT,
|
2008-10-13 02:19:04 -07:00
|
|
|
"FOCUS_SET", EDJE_ACTION_TYPE_FOCUS_SET,
|
2003-06-16 06:55:13 -07:00
|
|
|
NULL);
|
2003-06-20 03:44:36 -07:00
|
|
|
if (ep->action == EDJE_ACTION_TYPE_STATE_SET)
|
|
|
|
{
|
|
|
|
ep->state = parse_str(1);
|
|
|
|
ep->value = parse_float_range(2, 0.0, 1.0);
|
|
|
|
}
|
2003-06-20 06:41:00 -07:00
|
|
|
else if (ep->action == EDJE_ACTION_TYPE_SIGNAL_EMIT)
|
|
|
|
{
|
|
|
|
ep->state = parse_str(1);
|
|
|
|
ep->state2 = parse_str(2);
|
|
|
|
}
|
2003-08-31 19:53:08 -07:00
|
|
|
else if (ep->action == EDJE_ACTION_TYPE_DRAG_VAL_SET)
|
|
|
|
{
|
|
|
|
ep->value = parse_float(1);
|
|
|
|
ep->value2 = parse_float(2);
|
|
|
|
}
|
|
|
|
else if (ep->action == EDJE_ACTION_TYPE_DRAG_VAL_STEP)
|
|
|
|
{
|
|
|
|
ep->value = parse_float(1);
|
|
|
|
ep->value2 = parse_float(2);
|
|
|
|
}
|
|
|
|
else if (ep->action == EDJE_ACTION_TYPE_DRAG_VAL_PAGE)
|
|
|
|
{
|
|
|
|
ep->value = parse_float(1);
|
|
|
|
ep->value2 = parse_float(2);
|
|
|
|
}
|
2008-10-13 02:19:04 -07:00
|
|
|
|
|
|
|
switch (ep->action)
|
|
|
|
{
|
2004-10-23 13:36:02 -07:00
|
|
|
case EDJE_ACTION_TYPE_ACTION_STOP:
|
2008-10-13 02:19:04 -07:00
|
|
|
check_arg_count(1);
|
|
|
|
break;
|
2004-10-23 13:36:02 -07:00
|
|
|
case EDJE_ACTION_TYPE_SCRIPT:
|
2008-10-13 02:19:04 -07:00
|
|
|
/* this is implicitly set by script {} so this is here just for
|
|
|
|
* completeness */
|
|
|
|
break;
|
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-15 19:34:02 -07:00
|
|
|
case EDJE_ACTION_TYPE_LUA_SCRIPT:
|
|
|
|
/* this is implicitly set by lua_script {} so this is here just for
|
|
|
|
* completeness */
|
|
|
|
break;
|
2008-10-13 02:19:04 -07:00
|
|
|
case EDJE_ACTION_TYPE_FOCUS_SET:
|
|
|
|
check_arg_count(1);
|
|
|
|
break;
|
2004-10-23 13:36:02 -07:00
|
|
|
default:
|
2008-10-13 02:19:04 -07:00
|
|
|
check_arg_count(3);
|
|
|
|
}
|
2003-06-16 06:55:13 -07:00
|
|
|
}
|
|
|
|
|
2008-09-23 12:25:01 -07:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@property
|
|
|
|
transition
|
|
|
|
@parameters
|
|
|
|
[type] [length]
|
|
|
|
@effect
|
|
|
|
Defines how transistions occur using STATE_SET action.\n
|
|
|
|
Where 'type' is the style of the transistion and 'length' is a double
|
|
|
|
specifying the number of seconds in which to preform the transistion.\n
|
|
|
|
Valid types are: LINEAR, SINUSOIDAL, ACCELERATE, and DECELERATE.
|
|
|
|
@endproperty
|
|
|
|
*/
|
2003-06-16 06:55:13 -07:00
|
|
|
static void
|
|
|
|
st_collections_group_programs_program_transition(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Program *ep;
|
|
|
|
|
2004-10-23 13:12:21 -07:00
|
|
|
check_arg_count(2);
|
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->programs));
|
2003-06-16 06:55:13 -07:00
|
|
|
ep->tween.mode = parse_enum(0,
|
|
|
|
"LINEAR", EDJE_TWEEN_MODE_LINEAR,
|
|
|
|
"SINUSOIDAL", EDJE_TWEEN_MODE_SINUSOIDAL,
|
|
|
|
"ACCELERATE", EDJE_TWEEN_MODE_ACCELERATE,
|
|
|
|
"DECELERATE", EDJE_TWEEN_MODE_DECELERATE,
|
|
|
|
NULL);
|
|
|
|
ep->tween.time = parse_float_range(1, 0.0, 999999999.0);
|
|
|
|
}
|
|
|
|
|
2008-09-23 12:25:01 -07:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@property
|
|
|
|
target
|
|
|
|
@parameters
|
|
|
|
[target]
|
|
|
|
@effect
|
|
|
|
Program or part on which the specified action acts. Multiple target
|
|
|
|
keywords may be specified, one per target. SIGNAL_EMITs do not have
|
|
|
|
targets.
|
|
|
|
@endproperty
|
|
|
|
*/
|
2003-06-16 06:55:13 -07:00
|
|
|
static void
|
|
|
|
st_collections_group_programs_program_target(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Program *ep;
|
|
|
|
|
2004-10-23 13:12:21 -07:00
|
|
|
check_arg_count(1);
|
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->programs));
|
2003-06-16 06:55:13 -07:00
|
|
|
{
|
|
|
|
Edje_Program_Target *et;
|
|
|
|
char *name;
|
2008-03-24 01:22:01 -07:00
|
|
|
|
2003-06-16 06:55:13 -07:00
|
|
|
et = mem_alloc(SZ(Edje_Program_Target));
|
2008-10-22 04:34:42 -07:00
|
|
|
ep->targets = eina_list_append(ep->targets, et);
|
2008-03-24 01:22:01 -07:00
|
|
|
|
2003-06-16 06:55:13 -07:00
|
|
|
name = parse_str(0);
|
|
|
|
if (ep->action == EDJE_ACTION_TYPE_STATE_SET)
|
|
|
|
data_queue_part_lookup(pc, name, &(et->id));
|
|
|
|
else if (ep->action == EDJE_ACTION_TYPE_ACTION_STOP)
|
|
|
|
data_queue_program_lookup(pc, name, &(et->id));
|
2003-08-31 19:53:08 -07:00
|
|
|
else if (ep->action == EDJE_ACTION_TYPE_DRAG_VAL_SET)
|
|
|
|
data_queue_part_lookup(pc, name, &(et->id));
|
|
|
|
else if (ep->action == EDJE_ACTION_TYPE_DRAG_VAL_STEP)
|
|
|
|
data_queue_part_lookup(pc, name, &(et->id));
|
|
|
|
else if (ep->action == EDJE_ACTION_TYPE_DRAG_VAL_PAGE)
|
|
|
|
data_queue_part_lookup(pc, name, &(et->id));
|
2008-10-13 02:19:04 -07:00
|
|
|
else if (ep->action == EDJE_ACTION_TYPE_FOCUS_SET)
|
|
|
|
data_queue_part_lookup(pc, name, &(et->id));
|
2003-06-16 06:55:13 -07:00
|
|
|
else
|
|
|
|
{
|
2009-12-22 05:46:00 -08:00
|
|
|
ERR("%s: Error. parse error %s:%i. "
|
|
|
|
"target may only be used after action",
|
|
|
|
progname, file_in, line - 1);
|
2004-10-27 09:17:12 -07:00
|
|
|
exit(-1);
|
2003-06-16 06:55:13 -07:00
|
|
|
}
|
|
|
|
free(name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-09-23 12:25:01 -07:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@property
|
|
|
|
after
|
|
|
|
@parameters
|
|
|
|
[after]
|
|
|
|
@effect
|
|
|
|
Specifies a program to run after the current program completes. The
|
|
|
|
source and signal parameters of a program run as an "after" are ignored.
|
|
|
|
Multiple "after" statements can be specified per program.
|
|
|
|
@endproperty
|
|
|
|
*/
|
2003-06-16 06:55:13 -07:00
|
|
|
static void
|
|
|
|
st_collections_group_programs_program_after(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Program *ep;
|
|
|
|
|
2004-10-23 13:12:21 -07:00
|
|
|
check_arg_count(1);
|
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->programs));
|
2003-06-16 06:55:13 -07:00
|
|
|
{
|
2004-03-07 18:43:48 -08:00
|
|
|
Edje_Program_After *pa;
|
2003-06-16 06:55:13 -07:00
|
|
|
char *name;
|
2008-03-24 01:22:01 -07:00
|
|
|
|
2003-06-16 06:55:13 -07:00
|
|
|
name = parse_str(0);
|
2008-03-24 01:22:01 -07:00
|
|
|
|
2004-03-07 18:43:48 -08:00
|
|
|
pa = mem_alloc(SZ(Edje_Program_After));
|
|
|
|
pa->id = -1;
|
2008-10-22 04:34:42 -07:00
|
|
|
ep->after = eina_list_append(ep->after, pa);
|
2008-03-24 01:22:01 -07:00
|
|
|
|
2004-03-07 18:43:48 -08:00
|
|
|
data_queue_program_lookup(pc, name, &(pa->id));
|
2003-06-16 06:55:13 -07:00
|
|
|
free(name);
|
|
|
|
}
|
2003-06-11 07:14:23 -07:00
|
|
|
}
|
2004-03-27 21:26:17 -08:00
|
|
|
|
2010-01-05 11:26:18 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@property
|
|
|
|
api
|
|
|
|
@parameters
|
|
|
|
[name] [description]
|
|
|
|
@effect
|
|
|
|
Specifies a hint to let applications (or IDE's) know how to bind
|
|
|
|
things. The parameter name should contain the name of the function that
|
|
|
|
the application should use, and description describes how it should
|
|
|
|
be used.
|
|
|
|
@endproperty
|
|
|
|
*/
|
|
|
|
static void
|
|
|
|
st_collections_group_programs_program_api(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Program *ep;
|
|
|
|
|
|
|
|
check_min_arg_count(1);
|
|
|
|
|
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->programs));
|
|
|
|
ep->api.name = parse_str(0);
|
|
|
|
|
|
|
|
if (is_param(1))
|
|
|
|
{
|
|
|
|
check_arg_count(2);
|
|
|
|
ep->api.description = parse_str(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
@property
|
|
|
|
api
|
|
|
|
@parameters
|
|
|
|
[name] [description]
|
|
|
|
@effect
|
|
|
|
Specifies a hint to let applications (or IDE's) know how to bind
|
|
|
|
things. The parameter name should contain the name of the function that
|
|
|
|
the application should use, and description describes how it should
|
|
|
|
be used.
|
|
|
|
@endproperty
|
|
|
|
*/
|
|
|
|
static void
|
|
|
|
st_collections_group_parts_part_api(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Part *ep;
|
|
|
|
|
|
|
|
check_min_arg_count(1);
|
|
|
|
|
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->parts));
|
|
|
|
ep->api.name = parse_str(0);
|
|
|
|
if (is_param(1))
|
|
|
|
{
|
|
|
|
check_arg_count(2);
|
|
|
|
ep->api.description = parse_str(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-03-27 21:26:17 -08:00
|
|
|
static void
|
|
|
|
ob_collections_group_programs_program_script(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Program *ep;
|
|
|
|
Code *cd;
|
2008-03-24 01:22:01 -07:00
|
|
|
|
2008-10-22 04:34:42 -07:00
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->programs));
|
|
|
|
cd = eina_list_data_get(eina_list_last(codes));
|
2008-03-24 01:22:01 -07:00
|
|
|
|
2004-03-27 21:26:17 -08:00
|
|
|
if (!is_verbatim()) track_verbatim(1);
|
|
|
|
else
|
|
|
|
{
|
|
|
|
char *s;
|
2008-03-24 01:22:01 -07:00
|
|
|
|
2004-03-27 21:26:17 -08:00
|
|
|
s = get_verbatim();
|
|
|
|
if (s)
|
|
|
|
{
|
|
|
|
Code_Program *cp;
|
2008-03-24 01:22:01 -07:00
|
|
|
|
2004-03-27 21:26:17 -08:00
|
|
|
cp = mem_alloc(SZ(Code_Program));
|
2004-04-24 21:20:58 -07:00
|
|
|
cp->l1 = get_verbatim_line1();
|
|
|
|
cp->l2 = get_verbatim_line2();
|
2004-03-27 21:26:17 -08:00
|
|
|
cp->id = ep->id;
|
|
|
|
cp->script = s;
|
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-15 19:34:02 -07:00
|
|
|
if (cd->shared && cd->is_lua)
|
|
|
|
{
|
2009-12-22 05:46:00 -08:00
|
|
|
ERR("%s: Error. parse error %s:%i. You're trying to mix Embryo and Lua scripting in the same group",
|
|
|
|
progname, file_in, line - 1);
|
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-15 19:34:02 -07:00
|
|
|
exit(-1);
|
|
|
|
}
|
|
|
|
cd->is_lua = 0;
|
2008-10-22 04:34:42 -07:00
|
|
|
cd->programs = eina_list_append(cd->programs, cp);
|
2004-04-24 21:20:58 -07:00
|
|
|
set_verbatim(NULL, 0, 0);
|
2004-03-27 21:26:17 -08:00
|
|
|
ep->action = EDJE_ACTION_TYPE_SCRIPT;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
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-15 19:34:02 -07:00
|
|
|
|
|
|
|
static void
|
|
|
|
ob_collections_group_programs_program_lua_script(void)
|
|
|
|
{
|
|
|
|
Edje_Part_Collection *pc;
|
|
|
|
Edje_Program *ep;
|
|
|
|
Code *cd;
|
|
|
|
|
|
|
|
pc = eina_list_data_get(eina_list_last(edje_collections));
|
|
|
|
ep = eina_list_data_get(eina_list_last(pc->programs));
|
|
|
|
cd = eina_list_data_get(eina_list_last(codes));
|
|
|
|
|
|
|
|
if (!is_verbatim()) track_verbatim(1);
|
|
|
|
else
|
|
|
|
{
|
|
|
|
char *s;
|
|
|
|
|
|
|
|
s = get_verbatim();
|
|
|
|
if (s)
|
|
|
|
{
|
|
|
|
Code_Program *cp;
|
|
|
|
|
|
|
|
cp = mem_alloc(SZ(Code_Program));
|
|
|
|
cp->l1 = get_verbatim_line1();
|
|
|
|
cp->l2 = get_verbatim_line2();
|
|
|
|
cp->id = ep->id;
|
|
|
|
cp->script = s;
|
|
|
|
if (cd->shared && !cd->is_lua)
|
|
|
|
{
|
2009-12-22 05:46:00 -08:00
|
|
|
ERR("%s: Error. parse error %s:%i. You're trying to mix Embryo and Lua scripting in the same group",
|
|
|
|
progname, file_in, line - 1);
|
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-15 19:34:02 -07:00
|
|
|
exit(-1);
|
|
|
|
}
|
|
|
|
cd->is_lua = 1;
|
|
|
|
cd->programs = eina_list_append(cd->programs, cp);
|
|
|
|
set_verbatim(NULL, 0, 0);
|
|
|
|
ep->action = EDJE_ACTION_TYPE_LUA_SCRIPT;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2007-11-23 08:43:03 -08:00
|
|
|
/**
|
|
|
|
@page edcref
|
|
|
|
</table>
|
|
|
|
*/
|