edje_embryo: add box attributes support to set_state_val()

Summary: Add box attributes support to set_state_val().

Reviewers: raster, cedric

Reviewed By: cedric

Subscribers: jpeg

Differential Revision: https://phab.enlightenment.org/D3734

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
This commit is contained in:
Jee-Yong Um 2016-03-04 15:53:08 -08:00 committed by Cedric BAIL
parent d32aa995e0
commit 4ed9b83258
3 changed files with 76 additions and 2 deletions

View File

@ -252,7 +252,12 @@ enum State_Param
STATE_PHYSICS_Z = 56,
STATE_PHYSICS_DEPTH = 57,
STATE_PROXY_SRC_VISIBLE = 58,
STATE_PROXY_SRC_CLIP = 59
STATE_PROXY_SRC_CLIP = 59,
STATE_BOX_LAYOUT = 60,
STATE_BOX_FALLBACK_LAYOUT = 61,
STATE_BOX_ALIGN = 62,
STATE_BOX_PADDING = 63,
STATE_BOX_MIN = 64
};
native set_state_val(part_id, State_Param:p, ...);

View File

@ -169,6 +169,11 @@
* map_persp_on[on]
* persp_zplane[z]
* persp_focal[z]
* box[layout]
* box[fallback_layout]
* box[Float:align_x, Float:align_y]
* box[padding_x, padding_y]
* box[min_x, min_y]
*
* ** part_id and program_id need to be able to be "found" from strings
*
@ -2716,6 +2721,65 @@ _edje_embryo_fn_set_state_val(Embryo_Program *ep, Embryo_Cell *params)
break;
}
case EDJE_STATE_PARAM_BOX_LAYOUT:
{
Edje_Part_Description_Box *box;
if ((rp->part->type != EDJE_PART_TYPE_BOX)) return 0;
CHKPARAM(3);
GETSTR(s, params[3]);
s = strdup(s);
box = (Edje_Part_Description_Box *)rp->custom->description;
box->box.layout = s;
}
case EDJE_STATE_PARAM_BOX_FALLBACK_LAYOUT:
{
Edje_Part_Description_Box *box;
if ((rp->part->type != EDJE_PART_TYPE_BOX)) return 0;
CHKPARAM(3);
GETSTR(s, params[3]);
s = strdup(s);
box = (Edje_Part_Description_Box *)rp->custom->description;
box->box.alt_layout = s;
}
case EDJE_STATE_PARAM_BOX_ALIGN:
{
Edje_Part_Description_Box *box;
if ((rp->part->type != EDJE_PART_TYPE_BOX)) return 0;
CHKPARAM(4);
box = (Edje_Part_Description_Box *)rp->custom->description;
GETFLOAT_T(box->box.align.x, params[3]);
GETFLOAT_T(box->box.align.y, params[4]);
}
case EDJE_STATE_PARAM_BOX_PADDING:
{
Edje_Part_Description_Box *box;
if ((rp->part->type != EDJE_PART_TYPE_BOX)) return 0;
CHKPARAM(4);
box = (Edje_Part_Description_Box *)rp->custom->description;
GETINT(box->box.padding.x, params[3]);
GETINT(box->box.padding.y, params[4]);
}
case EDJE_STATE_PARAM_BOX_MIN:
{
Edje_Part_Description_Box *box;
if ((rp->part->type != EDJE_PART_TYPE_BOX)) return 0;
CHKPARAM(4);
box = (Edje_Part_Description_Box *)rp->custom->description;
GETINT(box->box.min.h, params[3]);
GETINT(box->box.min.v, params[4]);
}
#ifdef HAVE_EPHYSICS
case EDJE_STATE_PARAM_PHYSICS_MASS:
CHKPARAM(3);

View File

@ -490,7 +490,12 @@ typedef struct _Edje_Signal_Callback_Custom Edje_Signal_Callback_Custom;
#define EDJE_STATE_PARAM_PHYSICS_DEPTH 57
#define EDJE_STATE_PARAM_PROXY_SRC_VISIBLE 58
#define EDJE_STATE_PARAM_PROXY_SRC_CLIP 59
#define EDJE_STATE_PARAM_LAST 60
#define EDJE_STATE_PARAM_BOX_LAYOUT 60
#define EDJE_STATE_PARAM_BOX_FALLBACK_LAYOUT 61
#define EDJE_STATE_PARAM_BOX_ALIGN 62
#define EDJE_STATE_PARAM_BOX_PADDING 63
#define EDJE_STATE_PARAM_BOX_MIN 64
#define EDJE_STATE_PARAM_LAST 65
#define EDJE_ENTRY_EDIT_MODE_NONE 0
#define EDJE_ENTRY_EDIT_MODE_SELECTABLE 1