Edje: Edje_Edit - setter and getter for min param of TABLE/BOX parts

Add new functions for set and get whether
minimum size's of the box are equal to the minimum vertical or horizontal size
of the items or not.

@feature
This commit is contained in:
Vitalii Vorobiov 2015-02-24 12:12:39 +02:00
parent 65775c2e04
commit 54b090b0af
2 changed files with 94 additions and 0 deletions

View File

@ -1989,6 +1989,40 @@ edje_edit_state_table_homogeneous_get(Evas_Object *obj, const char *part,
* are working both for TABLE and BOX at same time.
*/ //@{
/** Get whether vertical or horizontal minimum size's of the box are equal
* to the minimum vertical or horizontal size of items
* (function for BOX or TABLE part.
* If EINA_TRUE - is equal, if EINA_FALSE - is not)
*
* @param obj Object being edited.
* @param part Part that have BOX/TABLE type.
* @param state Name of the state.
* @param value Value of the state.
* @param h Variable to store horizontal min value.
* @param v Variable to store vertical min value.
*
* @return @c EINA_TRUE in case of success, @c EINA_FALSE otherwise.
* @since 1.14
*/
EAPI Eina_Bool edje_edit_state_container_min_get(Evas_Object *obj, const char *part, const char *state, double value, Eina_Bool *h, Eina_Bool *v);
/** Set whether vertical or horizontal minimum size's of the box are equal
* to the minimum vertical or horizontal size of items
* (function for BOX or TABLE part.
* If EINA_TRUE - is equal, if EINA_FALSE - is not)
*
* @param obj Object being edited.
* @param part Part that have BOX/TABLE type.
* @param state Name of the state.
* @param value Value of the state.
* @param h horizontal min value.
* @param v vertical min value.
*
* @return @c EINA_TRUE in case of success, @c EINA_FALSE otherwise.
* @since 1.14
*/
EAPI Eina_Bool edje_edit_state_container_min_set(Evas_Object *obj, const char *part, const char *state, double value, Eina_Bool h, Eina_Bool v);
/** Get x and y paddings for BOX or TABLE part.
*
* @param obj Object being edited.

View File

@ -4346,6 +4346,66 @@ edje_edit_state_container_padding_set(Evas_Object *obj, const char *part,
}
return EINA_TRUE;
}
EAPI Eina_Bool
edje_edit_state_container_min_get(Evas_Object *obj, const char *part, const char *state, double value, Eina_Bool *h, Eina_Bool *v)
{
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;
if (h) *h = table->table.min.h;
if (v) *v = table->table.min.v;
break;
}
case EDJE_PART_TYPE_BOX:
{
Edje_Part_Description_Box *box;
box = (Edje_Part_Description_Box*) pd;
if (h) *h = box->box.min.h;
if (v) *v = box->box.min.v;
break;
}
default:
return EINA_FALSE;
}
return EINA_TRUE;
}
EAPI Eina_Bool
edje_edit_state_container_min_set(Evas_Object *obj, const char *part, const char *state, double value, Eina_Bool h, Eina_Bool v)
{
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.min.h = h;
table->table.min.v = v;
break;
}
case EDJE_PART_TYPE_BOX:
{
Edje_Part_Description_Box *box;
box = (Edje_Part_Description_Box*) pd;
box->box.min.h = h;
box->box.min.v = v;
break;
}
default:
return EINA_FALSE;
}
return EINA_TRUE;
}
/***************************/
/* BOX & TABLE ITEMS API */
/***************************/