On Wed, Jul 1, 2009 at 4:06 AM, Brian Mattern<reph...@rephorm.com> wrote:
> Hey everyone,
> I've attached a patch that implements a new edje part type: EXTERNAL.
> The basic idea is as follows:

Oh ! That's sounds good !

> An application (or library) can implement swallowable widgets that are keyed
> by a type name. By implementing a few callbacks and registering with edje,
> the app can allow a themer to include a part of this type by simply doing:
>
> part {
>   name: "external_part";
>   type: EXTERNAL;
>   source: "type_name";
>   description {
>      ...
>      params { int: "foo" 10; string: "bar" "str_val"; ... }
>   }
> }
>
>
> The current callbacks are:
>
> Evas_Object *add(void *data, Evas *e, Evas_Object *parent, const Eina_List
> *params)
>   gets called when edje loads and finds an external part of this type
>   the parent object is passed in so that it can be sent signals/messages
>
> void signal_emit(void *data, Evas_Object *obj, const char *emission, const
> char *source)
>   probably should be called 'signal_recv' or so, but gets called when a
> signal like 'external_part:signal_name' is sent to the parent edj (like
> GROUP objects, the part name and colon gets stripped off).
>
> void state_set(void *data, Evas_Object *obj, const Eina_List *from_params,
> const Eina_List *to_params, float pos)
>   called whenever the state changes (including repeatedly while tweening
> between states)
>   use pos to linearly interpolate params between states

> I also attached a really basic test program (nothing fancy, left or right
> click on the bg to trigger state changes or press 's' to switch themes) to
> illustrate the usage.

> It would be interesting to register all of elementary's widgets with edje in
> this fashion. (We'd still need some way for the theme to specify which app
> data should be associated with the widget).

Regarding the association of app data to widget, currently we need to
request the object_part and send data to it. Do you/people consider it
would be really better to just transmit the data to edje and let it do
what ever the theme want with this data ? (Think with an improved
script support like lua in edje).

> Anyway, before committing this, I'd like to get some feedback on the API and
> ideas for how to extend this concept.

Just a small point regarding your patch. All the
edje_external_param_*_get return EINA_FALSE if ret == NULL, I would
prefer to return EINA_TRUE if the param is found. With that it will be
possible to just test the presence of param.

Anyway the rest of the patch is quite small and easy to understand.
Edje need it in my opinion, so I would really accept it as is in svn.
-- 
Cedric BAIL

------------------------------------------------------------------------------
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to