edje: edje_edit - add getters/setters for container padding
This functions designed that make the edje edit API's more homogeneous. The all edje attribute setters and getters treated only ony attribute, besides container API's.
This commit is contained in:
parent
f73174f980
commit
2f87a20c3b
|
@ -2125,12 +2125,41 @@ edje_edit_state_container_min_y_set(Evas_Object *obj, const char *part, const ch
|
|||
* @param x Variable to store x padding.
|
||||
* @param y Variable to store y padding.
|
||||
*
|
||||
* @deprecated Use edje_edit_state_container_padding_x_get() and
|
||||
* edje_edit_state_container_padding_y_get() instead.
|
||||
*
|
||||
* @return @c EINA_TRUE in case of success, @c EINA_FALSE otherwise.
|
||||
* @since 1.14
|
||||
*/
|
||||
EAPI Eina_Bool
|
||||
EINA_DEPRECATED EAPI Eina_Bool
|
||||
edje_edit_state_container_padding_get(Evas_Object *obj, const char *part, const char *state, double value, int *x, int *y);
|
||||
|
||||
/** Get x padding for BOX or TABLE part.
|
||||
*
|
||||
* @param obj Object being edited.
|
||||
* @param part Part that has BOX/TABLE type.
|
||||
* @param state Name of the state.
|
||||
* @param value Value of the state.
|
||||
*
|
||||
* @return The padding by x axis.
|
||||
* @since 1.16
|
||||
*/
|
||||
EAPI int
|
||||
edje_edit_state_container_padding_x_get(Evas_Object *obj, const char *part, const char *state, double value);
|
||||
|
||||
/** Get y padding for BOX or TABLE part.
|
||||
*
|
||||
* @param obj Object being edited.
|
||||
* @param part Part that has BOX/TABLE type.
|
||||
* @param state Name of the state.
|
||||
* @param value Value of the state.
|
||||
*
|
||||
* @return The padding by y axis.
|
||||
* @since 1.16
|
||||
*/
|
||||
EAPI int
|
||||
edje_edit_state_container_padding_y_get(Evas_Object *obj, const char *part, const char *state, double value);
|
||||
|
||||
/** Set x and y paddings for BOX or TABLE part.
|
||||
*
|
||||
* @param obj Object being edited.
|
||||
|
@ -2140,12 +2169,43 @@ edje_edit_state_container_padding_get(Evas_Object *obj, const char *part, const
|
|||
* @param x Value for setting x padding.
|
||||
* @param y Value for setting y padding.
|
||||
*
|
||||
* @deprecated Use edje_edit_state_container_padding_x_set() and
|
||||
* edje_edit_state_container_padding_y_set() instead.
|
||||
*
|
||||
* @return @c EINA_TRUE in case of success, @c EINA_FALSE otherwise.
|
||||
* @since 1.14
|
||||
*/
|
||||
EAPI Eina_Bool
|
||||
EINA_DEPRECATED EAPI Eina_Bool
|
||||
edje_edit_state_container_padding_set(Evas_Object *obj, const char *part, const char *state, double value, int x, int y);
|
||||
|
||||
/** Set x padding for BOX or TABLE part.
|
||||
*
|
||||
* @param obj Object being edited.
|
||||
* @param part Part that has BOX/TABLE type.
|
||||
* @param state Name of the state.
|
||||
* @param value Value of the state.
|
||||
* @param x New x padding value.
|
||||
*
|
||||
* @return @c EINA_TRUE in case of success, @c EINA_FALSE otherwise.
|
||||
* @since 1.16
|
||||
*/
|
||||
EAPI Eina_Bool
|
||||
edje_edit_state_container_padding_x_set(Evas_Object *obj, const char *part, const char *state, double value, int x);
|
||||
|
||||
/** Set y padding for BOX or TABLE part.
|
||||
*
|
||||
* @param obj Object being edited.
|
||||
* @param part Part that has BOX/TABLE type.
|
||||
* @param state Name of the state.
|
||||
* @param value Value of the state.
|
||||
* @param y New y padding value.
|
||||
*
|
||||
* @return @c EINA_TRUE in case of success, @c EINA_FALSE otherwise.
|
||||
* @since 1.16
|
||||
*/
|
||||
EAPI Eina_Bool
|
||||
edje_edit_state_container_padding_y_set(Evas_Object *obj, const char *part, const char *state, double value, int y);
|
||||
|
||||
/** Set x and y align for BOX or TABLE part.
|
||||
*
|
||||
* @param obj Object being edited.
|
||||
|
|
|
@ -4362,6 +4362,64 @@ FUNC_CONTAINER_BOOL(min, h)
|
|||
|
||||
#undef FUNC_CONTAINER_BOOL
|
||||
|
||||
#define FUNC_CONTAINER_INT(CLASS, VALUE) \
|
||||
EAPI int \
|
||||
edje_edit_state_container_##CLASS##_##VALUE##_get(Evas_Object *obj, const char *part, const char *state, double value) \
|
||||
{ \
|
||||
int val; \
|
||||
GET_PD_OR_RETURN(EINA_FALSE) \
|
||||
switch (rp->part->type) \
|
||||
{ \
|
||||
case EDJE_PART_TYPE_TABLE: \
|
||||
{ \
|
||||
Edje_Part_Description_Table *table; \
|
||||
table = (Edje_Part_Description_Table *)pd; \
|
||||
val = table->table.CLASS.VALUE; \
|
||||
break; \
|
||||
} \
|
||||
case EDJE_PART_TYPE_BOX: \
|
||||
{ \
|
||||
Edje_Part_Description_Box *box; \
|
||||
box = (Edje_Part_Description_Box *)pd; \
|
||||
val = box->box.CLASS.VALUE; \
|
||||
break; \
|
||||
} \
|
||||
default: \
|
||||
val = 0; \
|
||||
} \
|
||||
return val; \
|
||||
} \
|
||||
EAPI Eina_Bool \
|
||||
edje_edit_state_container_##CLASS##_##VALUE##_set(Evas_Object *obj, const char *part, const char *state, double value, int new_val) \
|
||||
{ \
|
||||
GET_PD_OR_RETURN(EINA_FALSE) \
|
||||
switch (rp->part->type) \
|
||||
{ \
|
||||
case EDJE_PART_TYPE_TABLE: \
|
||||
{ \
|
||||
Edje_Part_Description_Table *table; \
|
||||
table = (Edje_Part_Description_Table *)pd; \
|
||||
table->table.CLASS.VALUE = new_val; \
|
||||
break; \
|
||||
} \
|
||||
case EDJE_PART_TYPE_BOX: \
|
||||
{ \
|
||||
Edje_Part_Description_Box *box; \
|
||||
box = (Edje_Part_Description_Box *)pd; \
|
||||
box->box.CLASS.VALUE = new_val; \
|
||||
break; \
|
||||
} \
|
||||
default: \
|
||||
return EINA_FALSE; \
|
||||
} \
|
||||
return EINA_TRUE; \
|
||||
}
|
||||
|
||||
FUNC_CONTAINER_INT(padding, x)
|
||||
FUNC_CONTAINER_INT(padding, y)
|
||||
|
||||
#undef FUNC_CONTAINER_INT
|
||||
|
||||
EAPI Eina_Bool
|
||||
edje_edit_state_container_align_get(Evas_Object *obj, const char *part, const char *state, double value, double *x, double *y)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue