Edje Perspective

Functions that deal with 3D projection of an 2D object. More...

Typedefs

typedef struct _Edje_Perspective Edje_Perspective
 

Functions

Edje_Perspective * edje_perspective_new (Evas *e)
 Creates a new perspective in the given canvas. More...
 
void edje_perspective_free (Edje_Perspective *ps)
 Delete the given perspective object. More...
 
void edje_perspective_set (Edje_Perspective *ps, Evas_Coord px, Evas_Coord py, Evas_Coord z0, Evas_Coord foc)
 Setup the transform for this perspective object. More...
 
void edje_perspective_global_set (Edje_Perspective *ps, Eina_Bool global)
 Make this perspective object be global for its canvas. More...
 
Eina_Bool edje_perspective_global_get (const Edje_Perspective *ps)
 Get whether the given perspective object is global or not. More...
 
const Edje_Perspective * edje_evas_global_perspective_get (const Evas *e)
 Get the global perspective object set for this canvas. More...
 
#define edje_obj_perspective_set(ps)   EDJE_OBJ_ID(EDJE_OBJ_SUB_ID_PERSPECTIVE_SET), EO_TYPECHECK(Edje_Perspective *, ps)
 
#define edje_obj_perspective_get(ret)   EDJE_OBJ_ID(EDJE_OBJ_SUB_ID_PERSPECTIVE_GET), EO_TYPECHECK(const Edje_Perspective **, ret)
 
void edje_object_perspective_set (Evas_Object *obj, Edje_Perspective *ps)
 Set the given perspective object on this Edje object. More...
 
const Edje_Perspective * edje_object_perspective_get (const Evas_Object *obj)
 Get the current perspective used on this Edje object. More...
 

Detailed Description

Functions that deal with 3D projection of an 2D object.

Perspective is a graphical tool that makes objets represented in 2D look like they have a 3D appearance.

Edje allows us to use perspective on any edje object. This group of functions deal with the use of perspective, by creating and configuring a perspective object that must set to a edje object or a canvas, affecting all the objects inside that have no particular perspective set already.

Macro Definition Documentation

§ edje_obj_perspective_set

#define edje_obj_perspective_set (   ps)    EDJE_OBJ_ID(EDJE_OBJ_SUB_ID_PERSPECTIVE_SET), EO_TYPECHECK(Edje_Perspective *, ps)
Since
1.8

Set the given perspective object on this Edje object.

Parameters
[in]ps
See also
edje_object_perspective_set

Referenced by edje_object_perspective_set().

§ edje_obj_perspective_get

#define edje_obj_perspective_get (   ret)    EDJE_OBJ_ID(EDJE_OBJ_SUB_ID_PERSPECTIVE_GET), EO_TYPECHECK(const Edje_Perspective **, ret)
Since
1.8

Get the current perspective used on this Edje object.

Parameters
[out]ret
See also
edje_object_perspective_get

Referenced by edje_object_perspective_get().

Function Documentation

§ edje_perspective_new()

Edje_Perspective* edje_perspective_new ( Evas e)

Creates a new perspective in the given canvas.

Parameters
eThe given canvas (Evas).
Returns
An Edje Perspective object for this canvas, or NULL on errors.

This function creates a perspective object that can be set on an Edje object, or globally to all Edje objects on this canvas.

See also
edje_perspective_set()
edje_perspective_free()
Examples:
edje-perspective.c.

References EAPI, EVAS_CALLBACK_DEL, evas_object_data_set(), evas_object_event_callback_add(), evas_object_rectangle_add(), and evas_output_viewport_get().

§ edje_perspective_free()

void edje_perspective_free ( Edje_Perspective *  ps)

Delete the given perspective object.

Parameters
psA valid perspective object, or NULL.

This function will delete the perspective object. If the perspective effect was being applied to any Edje object or part, this effect won't be applied anymore.

See also
edje_perspective_new()

References EAPI, and evas_object_del().

§ edje_perspective_set()

void edje_perspective_set ( Edje_Perspective *  ps,
Evas_Coord  px,
Evas_Coord  py,
Evas_Coord  z0,
Evas_Coord  foc 
)

Setup the transform for this perspective object.

This sets the parameters of the perspective transformation. X, Y and Z values are used. The px and py points specify the "infinite distance" point in the 3D conversion (where all lines converge to like when artists draw 3D by hand). The z0 value specifies the z value at which there is a 1:1 mapping between spatial coordinates and screen coordinates. Any points on this z value will not have their X and Y values modified in the transform. Those further away (Z value higher) will shrink into the distance, and those less than this value will expand and become bigger. The foc value determines the "focal length" of the camera. This is in reality the distance between the camera lens plane itself (at or closer than this rendering results are undefined) and the "z0" z value. This allows for some "depth" control and foc must be greater than 0.

Parameters
psThe perspective object
pxThe perspective distance X coordinate
pyThe perspective distance Y coordinate
z0The "0" z plane value
focThe focal distance
Examples:
edje-perspective.c.

References EAPI, EINA_LIST_FOREACH, and EINA_TRUE.

§ edje_perspective_global_set()

void edje_perspective_global_set ( Edje_Perspective *  ps,
Eina_Bool  global 
)

Make this perspective object be global for its canvas.

Parameters
psThe given perspective object
globalEINA_TRUE if the perspective should be global, EINA_FALSE otherwise.

The canvas which this perspective object is being set as global is the one given as argument upon the object creation (the evas parameter on the function edje_perspective_new(evas) ).

There can be only one global perspective object set per canvas, and if a perspective object is set to global when there was already another global perspective set, the old one will be set as non-global.

A global perspective just affects a part if its Edje object doesn't have a perspective object set to it, and if the part doesn't point to another part to be used as perspective.

See also
edje_object_perspective_set()
edje_perspective_global_get()
edje_perspective_new()
Examples:
edje-perspective.c.

References EAPI, EINA_LIST_FOREACH, EINA_TRUE, evas_object_evas_get(), evas_object_name_find(), and evas_object_name_set().

§ edje_perspective_global_get()

Eina_Bool edje_perspective_global_get ( const Edje_Perspective *  ps)

Get whether the given perspective object is global or not.

Parameters
psThe given perspective object.
Returns
EINA_TRUE if this perspective object is global, EINA_FALSE otherwise.
See also
edje_perspective_global_set()

References EAPI, and EINA_FALSE.

§ edje_evas_global_perspective_get()

const Edje_Perspective* edje_evas_global_perspective_get ( const Evas e)

Get the global perspective object set for this canvas.

Parameters
eThe given canvas (Evas).
Returns
The perspective object set as global for this canvas. Or NULL if there is no global perspective set and on errors.

This function will return the perspective object that was set as global with edje_perspective_global_set().

See also
edje_perspective_global_set()
edje_perspective_global_get()

References EAPI, evas_object_data_get(), and evas_object_name_find().

§ edje_object_perspective_set()

void edje_object_perspective_set ( Evas_Object obj,
Edje_Perspective *  ps 
)

Set the given perspective object on this Edje object.

Parameters
objThe Edje object on the perspective will be set.
psThe perspective object that will be used.

Make the given perspective object be the default perspective for this Edje object.

There can be only one perspective object per Edje object, and if a previous one was set, it will be removed and the new perspective object will be used.

An Edje perspective will only affect a part if it doesn't point to another part to be used as perspective.

See also
edje_object_perspective_new()
edje_object_perspective_get()
edje_perspective_set()

References EAPI, edje_obj_perspective_set, eina_list_append(), eina_list_remove(), and EINA_TRUE.

§ edje_object_perspective_get()

const Edje_Perspective* edje_object_perspective_get ( const Evas_Object obj)

Get the current perspective used on this Edje object.

Parameters
objthe given Edje object.
Returns
The perspective object being used on this Edje object. Or NULL if there was none, and on errors.
See also
edje_object_perspective_set()

References EAPI, and edje_obj_perspective_get.