Clipped Smart Object
[Smart Object Functions]

Clipped smart object is a base to construct other smart objects that based on the concept of having an internal clipper that is applied to all its other children. More...

Functions

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_Objectevas_object_smart_clipped_clipper_get (Evas_Object *obj)
 Get the clipper object for the given 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".
EAPI const Evas_Smart_Classevas_object_smart_clipped_class_get (void)
 Get a pointer to the Clipped Smart Class to use for proper inheritance.

Detailed Description

Clipped smart object is a base to construct other smart objects that based on the concept of having an internal clipper that is applied to all its other children.

This clipper will control the visibility, clipping and color of sibling objects (remember that the clipping is recursive, and clipper color modulates the color of its clippees). By default, this base will also move children relatively to the parent, and delete them when parent is deleted. In other words, it is the base for simple object grouping.

See also:
evas_object_smart_clipped_smart_set()

Function Documentation

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_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 = EVAS_SMART_CLASS_INIT_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 = EVAS_SMART_CLASS_INIT_NAME_VERSION("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;

Referenced by evas_object_smart_clipped_class_get().

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_object_move().