forked from enlightenment/efl
evas: implement Efl.Gfx.Base in Evas.VG_Node.
This commit is contained in:
parent
651436f410
commit
c1118e7282
|
@ -4,6 +4,7 @@
|
|||
#include "evas_vg_private.h"
|
||||
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
|
||||
#define MY_CLASS EVAS_VG_NODE_CLASS
|
||||
|
||||
|
@ -50,21 +51,40 @@ _evas_vg_node_origin_get(Eo *obj EINA_UNUSED,
|
|||
}
|
||||
|
||||
void
|
||||
_evas_vg_node_visibility_set(Eo *obj EINA_UNUSED,
|
||||
_evas_vg_node_efl_gfx_base_position_set(Eo *obj EINA_UNUSED,
|
||||
Evas_VG_Node_Data *pd,
|
||||
Eina_Bool v)
|
||||
int x, int y)
|
||||
{
|
||||
pd->x = lrint(x);
|
||||
pd->y = lrint(y);
|
||||
}
|
||||
|
||||
void
|
||||
_evas_vg_node_efl_gfx_base_position_get(Eo *obj EINA_UNUSED,
|
||||
Evas_VG_Node_Data *pd,
|
||||
int *x, int *y)
|
||||
{
|
||||
if (x) *x = pd->x;
|
||||
if (y) *y = pd->y;
|
||||
}
|
||||
|
||||
void
|
||||
_evas_vg_node_efl_gfx_base_visible_set(Eo *obj EINA_UNUSED,
|
||||
Evas_VG_Node_Data *pd, Eina_Bool v)
|
||||
{
|
||||
pd->visibility = v;
|
||||
}
|
||||
|
||||
|
||||
Eina_Bool
|
||||
_evas_vg_node_visibility_get(Eo *obj EINA_UNUSED, Evas_VG_Node_Data *pd)
|
||||
_evas_vg_node_efl_gfx_base_visible_get(Eo *obj EINA_UNUSED,
|
||||
Evas_VG_Node_Data *pd)
|
||||
{
|
||||
return pd->visibility;
|
||||
}
|
||||
|
||||
void
|
||||
_evas_vg_node_color_set(Eo *obj EINA_UNUSED,
|
||||
_evas_vg_node_efl_gfx_base_color_set(Eo *obj EINA_UNUSED,
|
||||
Evas_VG_Node_Data *pd,
|
||||
int r, int g, int b, int a)
|
||||
{
|
||||
|
@ -75,7 +95,7 @@ _evas_vg_node_color_set(Eo *obj EINA_UNUSED,
|
|||
}
|
||||
|
||||
void
|
||||
_evas_vg_node_color_get(Eo *obj EINA_UNUSED,
|
||||
_evas_vg_node_efl_gfx_base_color_get(Eo *obj EINA_UNUSED,
|
||||
Evas_VG_Node_Data *pd,
|
||||
int *r, int *g, int *b, int *a)
|
||||
{
|
||||
|
@ -102,6 +122,18 @@ _evas_vg_node_mask_get(Eo *obj EINA_UNUSED, Evas_VG_Node_Data *pd)
|
|||
return pd->mask;
|
||||
}
|
||||
|
||||
void
|
||||
_evas_vg_node_efl_gfx_base_size_get(Eo *obj,
|
||||
Evas_VG_Node_Data *pd EINA_UNUSED,
|
||||
int *w, int *h)
|
||||
{
|
||||
Eina_Rectangle bound = { 0, 0, 0, 0 };
|
||||
|
||||
eo_do(obj, evas_vg_node_bound_get(&bound));
|
||||
if (w) *w = bound.w;
|
||||
if (h) *h = bound.h;
|
||||
}
|
||||
|
||||
// Parent should be a container otherwise dismissing the stacking operation
|
||||
static Eina_Bool
|
||||
_evas_vg_node_parent_checked_get(Eo *obj,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
abstract Evas.VG_Node (Eo.Base)
|
||||
abstract Evas.VG_Node (Eo.Base, Efl.Gfx.Base)
|
||||
{
|
||||
eo_prefix: evas_vg_node;
|
||||
legacy_prefix: null;
|
||||
|
@ -22,49 +22,6 @@ abstract Evas.VG_Node (Eo.Base)
|
|||
double y;
|
||||
}
|
||||
}
|
||||
visibility {
|
||||
set {
|
||||
/*@ Makes the given Evas_VG node visible or invisible. */
|
||||
}
|
||||
get {
|
||||
/*@ Retrieves whether or not the given Evas_VG node is visible. */
|
||||
}
|
||||
values {
|
||||
Eina_Bool v; /*@ @c EINA_TRUE if to make the object visible, @c EINA_FALSE otherwise */
|
||||
}
|
||||
}
|
||||
color {
|
||||
set {
|
||||
/*@
|
||||
Sets the general/main color of the given Evas_VG node to the given
|
||||
one.
|
||||
|
||||
@note These color values are expected to be premultiplied by @p a.
|
||||
|
||||
@ingroup Evas_VG_Node_Group */
|
||||
}
|
||||
get {
|
||||
/*@
|
||||
Retrieves the general/main color of the given Evas_VG node.
|
||||
|
||||
Retrieves the “main” color's RGB component (and alpha channel)
|
||||
values, <b>which range from 0 to 255</b>. For the alpha channel,
|
||||
which defines the object's transparency level, 0 means totally
|
||||
transparent, while 255 means opaque. These color values are
|
||||
premultiplied by the alpha value.
|
||||
|
||||
@note Use @c NULL pointers on the components you're not interested
|
||||
in: they'll be ignored by the function.
|
||||
|
||||
@ingroup Evas_VG_Node_Group */
|
||||
}
|
||||
values {
|
||||
int r; /*@ The red component of the given color. */
|
||||
int g; /*@ The green component of the given color. */
|
||||
int b; /*@ The blue component of the given color. */
|
||||
int a; /*@ The alpha component of the given color. */
|
||||
}
|
||||
}
|
||||
mask {
|
||||
set {
|
||||
}
|
||||
|
@ -173,6 +130,13 @@ abstract Evas.VG_Node (Eo.Base)
|
|||
implements {
|
||||
Eo.Base.parent.set;
|
||||
Eo.Base.constructor;
|
||||
Efl.Gfx.Base.visible.set;
|
||||
Efl.Gfx.Base.visible.get;
|
||||
Efl.Gfx.Base.color.set;
|
||||
Efl.Gfx.Base.color.get;
|
||||
Efl.Gfx.Base.size.get;
|
||||
Efl.Gfx.Base.position.set;
|
||||
Efl.Gfx.Base.position.get;
|
||||
@virtual .bound_get;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue