Evas_Smart_Object_Group (3) - Linux Manuals

Evas_Smart_Object_Group: Functions dealing with evas smart objects.

NAME

Evas Smart Object Functions - Functions dealing with evas smart objects.

Functions


EAPI void evas_object_smart_data_set (Evas_Object *obj, void *data)
Store a pointer to user data for a smart object.
EAPI void * evas_object_smart_data_get (const Evas_Object *obj)
Retrieve user data stored on a smart object.
EAPI Evas_Smart * evas_object_smart_smart_get (const Evas_Object *obj)
Get the Evas_Smart from which obj was created.
EAPI void evas_object_smart_member_add (Evas_Object *obj, Evas_Object *smart_obj)
Set an evas object as a member of a smart object.
EAPI void evas_object_smart_member_del (Evas_Object *obj)
Removes a member object from a smart object.
EAPI Evas_Object * evas_object_smart_parent_get (const Evas_Object *obj)
Gets the smart parent of an Evas_Object.
EAPI Evas_Object * evas_object_smart_add (Evas *e, Evas_Smart *s)
Instantiates a new smart object described by s.
EAPI void evas_object_smart_callback_add (Evas_Object *obj, const char *event, void(*func)(void *data, Evas_Object *obj, void *event_info), const void *data)
Add a callback for the smart event specified by event.
EAPI void * evas_object_smart_callback_del (Evas_Object *obj, const char *event, void(*func)(void *data, Evas_Object *obj, void *event_info))
Remove a smart callback.
EAPI void evas_object_smart_callback_call (Evas_Object *obj, const char *event, void *event_info)
Call any smart callbacks on obj for event.
EAPI void evas_object_smart_need_recalculate_set (Evas_Object *obj, Evas_Bool value)
Set the need_recalculate flag of given smart object.
EAPI Evas_Bool evas_object_smart_need_recalculate_get (Evas_Object *obj)
Get the current value of need_recalculate flag.
EAPI void evas_object_smart_calculate (Evas_Object *obj)
Call user provided calculate() and unset need_calculate.
EAPI void evas_object_smart_changed (Evas_Object *obj)
Mark smart object as changed, dirty.
EAPI void evas_object_smart_move_children_relative (Evas_Object *obj, Evas_Coord dx, Evas_Coord dy)
Moves all children objects relative to given offset.
EAPI Evas_Object * evas_object_smart_clipped_clipper_get (Evas_Object *obj)
Get the clipper object for the given clipped smart object.
EAPI void evas_object_smart_clipped_member_add (Evas_Object *obj, Evas_Object *member)
Add the given member to clipped smart object.
EAPI void evas_object_smart_clipped_member_del (Evas_Object *member)
Remove the given member from clipped smart object.
EAPI void evas_object_smart_clipped_smart_set (Evas_Smart_Class *sc)
Set smart class callbacks so it implements the 'Clipped Smart Object'.

Detailed Description

Functions dealing with evas smart objects.

Smart objects are groupings of primitive evas objects that behave as a cohesive group. For instance, a file manager icon may be a smart object composed of an image object, a text label and two rectangles that appear behind the image and text when the icon is selected. As a smart object, the normal evas api could be used on the icon object.

Function Documentation

EAPI Evas_Object* evas_object_smart_add (Evas * e, Evas_Smart * s)

Instantiates a new smart object described by s.

Parameters:

e the evas on which to add the object
s the Evas_Smart describing the smart object

Returns:

a new Evas_Object

EAPI void evas_object_smart_calculate (Evas_Object * obj)

Call user provided calculate() and unset need_calculate.

Parameters:

obj the smart object

Returns:

if flag is set or not.

EAPI void evas_object_smart_callback_add (Evas_Object * obj, const char * event, void(*)(void *data, Evas_Object *obj, void *event_info) func, const void * data)

Add a callback for the smart event specified by event.

Parameters:

obj a smart object
event the event name
func the callback function
data user data to be passed to the callback function

References evas_list_prepend().

EAPI void evas_object_smart_callback_call (Evas_Object * obj, const char * event, void * event_info)

Call any smart callbacks on obj for event.

Parameters:

obj the smart object
event the event name
event_info an event specific struct of info to pass to the callback

This should be called internally in the smart object when some specific event has occured. The documentation for the smart object should include a list of possible events and what type of event_info to expect.

References _Evas_List::data, and _Evas_List::next.

EAPI void* evas_object_smart_callback_del (Evas_Object * obj, const char * event, void(*)(void *data, Evas_Object *obj, void *event_info) func)

Remove a smart callback.

Removes a callback that was added by evas_object_smart_callback_add()

Parameters:

obj a smart object
event the event name
func the callback function

Returns:

the data pointer

References _Evas_List::data, and _Evas_List::next.

EAPI void evas_object_smart_changed (Evas_Object * obj)

Mark smart object as changed, dirty.

This will inform the scene that it changed and needs to be redraw, also setting need_recalculate on the given object.

See also:

evas_object_smart_need_recalculate_set().

References evas_object_smart_need_recalculate_set().

EAPI Evas_Object* evas_object_smart_clipped_clipper_get (Evas_Object * obj)

Get the clipper object for the given clipped smart object.

Parameters:

obj the clipped smart object to retrieve the associated clipper.

Returns:

the clipper object.

See also:

evas_object_smart_clipped_smart_add()

References evas_object_smart_data_get().

EAPI void evas_object_smart_clipped_member_add (Evas_Object * obj, Evas_Object * member)

Add the given member to clipped smart object.

This method is equivalent to evas_object_smart_member_add(), but will do extra work required to have clipped smart object to use the clipper, also shows the clipper if this is the first object and object is visible.

Warning:

the parameter order is different from evas_object_smart_member_add()

Parameters:

obj the smart object to use.
member the child/member to add to obj

Todo

add member_add() callback to Evas_Smart_Class.

References evas_object_clip_set(), evas_object_show(), evas_object_smart_member_add(), and evas_object_visible_get().

EAPI void evas_object_smart_clipped_member_del (Evas_Object * member)

Remove the given member from clipped smart object.

This method is equivalent to evas_object_smart_member_del(), but will do extra work required to have clipped smart object to stop using the clipper, also hide the clipper if this is the last object.

Parameters:

member the child/member to remove from its parent smart object.

Todo

add member_del() callback to Evas_Smart_Class.

References evas_object_clip_unset(), evas_object_clipees_get(), evas_object_hide(), evas_object_smart_member_del(), and evas_object_smart_parent_get().

EAPI void evas_object_smart_clipped_smart_set (Evas_Smart_Class * sc)

Set smart class callbacks so it implements the 'Clipped Smart Object'.

This call will assign all the required methods of Evas_Smart_Class, if one wants to 'subclass' it, call this function and later override values, if one wants to call the original method, save it somewhere, example:

 static Evas_Smart_Class parent_sc = {NULL};

 static void my_class_smart_add(Evas_Object *o)
 {
    parent_sc.add(o);
    evas_object_color_set(evas_object_smart_clipped_clipper_get(o),
                          255, 0, 0, 255);
 }

 Evas_Smart_Class *my_class_new(void)
 {
    static Evas_Smart_Class sc = {'MyClass'};
    if (parent_sc.name)
      {
         evas_object_smart_clipped_smart_set(&sc);
         parent_sc = sc;
         sc.add = my_class_smart_add;
      }
    return ≻
 }

Default behavior is:

*
add: creates a hidden clipper with 'infinite' size;
*
del: delete all children objects;
*
move: move all objects relative relatively;
*
resize: not defined;
*
show: if there are children objects, show clipper;
*
hide: hides clipper;
*
color_set: set the color of clipper;
*
clip_set: set clipper of clipper;
*
clip_unset: unset the clipper of clipper;

EAPI void* evas_object_smart_data_get (const Evas_Object * obj)

Retrieve user data stored on a smart object.

Parameters:

obj The smart object

Returns:

A pointer to data stored using evas_object_smart_data_set(), or NULL if none has been set.

Referenced by evas_object_smart_clipped_clipper_get().

EAPI void evas_object_smart_data_set (Evas_Object * obj, void * data)

Store a pointer to user data for a smart object.

Parameters:

obj The smart object
data A pointer to user data

EAPI void evas_object_smart_member_add (Evas_Object * obj, Evas_Object * smart_obj)

Set an evas object as a member of a smart object.

Parameters:

obj The member object
smart_obj The smart object

Members will automatically be stacked and layered with the smart object. The various stacking function will operate on members relative to the other members instead of the entire canvas.

Non-member objects can not interleave a smart object's members.

References evas_object_smart_member_del().

Referenced by evas_object_smart_clipped_member_add().

EAPI void evas_object_smart_member_del (Evas_Object * obj)

Removes a member object from a smart object.

Parameters:

obj the member object

This removes a member object from a smart object. The object will still be on the canvas, but no longer associated with whichever smart object it was associated with.

Referenced by evas_object_smart_clipped_member_del(), and evas_object_smart_member_add().

EAPI void evas_object_smart_move_children_relative (Evas_Object * obj, Evas_Coord dx, Evas_Coord dy)

Moves all children objects relative to given offset.

Parameters:

obj the smart evas object to use.
dx horizontal offset.
dy vertical offset.

References _Evas_List::data, evas_list_free(), evas_object_geometry_get(), evas_object_move(), and _Evas_List::next.

EAPI Evas_Bool evas_object_smart_need_recalculate_get (Evas_Object * obj)

Get the current value of need_recalculate flag.

Note:

this flag will be unset during the render phase, after calculate() is called if one is provided. If no calculate() is provided, then the flag will be left unchanged after render phase.

Parameters:

obj the smart object

Returns:

if flag is set or not.

EAPI void evas_object_smart_need_recalculate_set (Evas_Object * obj, Evas_Bool value)

Set the need_recalculate flag of given smart object.

If this flag is set then calculate() callback (method) of the given smart object will be called, if one is provided, during render phase usually evas_render(). After this step, this flag will be automatically unset.

If no calculate() is provided, this flag will be left unchanged.

Note:

just setting this flag will not make scene dirty and evas_render() will have no effect. To do that, use evas_object_smart_changed(), that will automatically call this function with 1 as parameter.

Parameters:

obj the smart object
value if one want to set or unset the need_recalculate flag.

Referenced by evas_object_smart_changed().

EAPI Evas_Object* evas_object_smart_parent_get (const Evas_Object * obj)

Gets the smart parent of an Evas_Object.

Parameters:

obj the Evas_Object you want to get the parent

Returns:

Returns the smart parent of obj, or NULL if obj is not a smart member of another Evas_Object

Referenced by evas_object_smart_clipped_member_del().

EAPI Evas_Smart* evas_object_smart_smart_get (const Evas_Object * obj)

Get the Evas_Smart from which obj was created.

Parameters:

obj a smart object

Returns:

the Evas_Smart

Author

Generated automatically by Doxygen for Evas from the source code.