summaryrefslogtreecommitdiff
path: root/src/lib/edje
diff options
context:
space:
mode:
authorVitalii Vorobiov <vi.vorobiov@samsung.com>2015-02-24 12:12:39 +0200
committerVitalii Vorobiov <vi.vorobiov@samsung.com>2015-02-24 12:36:25 +0200
commit54b090b0afe37ea3f07fb434578f1f8537852092 (patch)
tree1e7b69444f3345ae7d49cc3c18d4cd25a20ac53b /src/lib/edje
parent65775c2e0421139951f17dd582c254a3e3e1f325 (diff)
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
Diffstat (limited to 'src/lib/edje')
-rw-r--r--src/lib/edje/Edje_Edit.h34
-rw-r--r--src/lib/edje/edje_edit.c60
2 files changed, 94 insertions, 0 deletions
diff --git a/src/lib/edje/Edje_Edit.h b/src/lib/edje/Edje_Edit.h
index 14c83b3477..6b87dbd9e9 100644
--- a/src/lib/edje/Edje_Edit.h
+++ b/src/lib/edje/Edje_Edit.h
@@ -1989,6 +1989,40 @@ edje_edit_state_table_homogeneous_get(Evas_Object *obj, const char *part,
1989 * are working both for TABLE and BOX at same time. 1989 * are working both for TABLE and BOX at same time.
1990 */ //@{ 1990 */ //@{
1991 1991
1992/** Get whether vertical or horizontal minimum size's of the box are equal
1993 * to the minimum vertical or horizontal size of items
1994 * (function for BOX or TABLE part.
1995 * If EINA_TRUE - is equal, if EINA_FALSE - is not)
1996 *
1997 * @param obj Object being edited.
1998 * @param part Part that have BOX/TABLE type.
1999 * @param state Name of the state.
2000 * @param value Value of the state.
2001 * @param h Variable to store horizontal min value.
2002 * @param v Variable to store vertical min value.
2003 *
2004 * @return @c EINA_TRUE in case of success, @c EINA_FALSE otherwise.
2005 * @since 1.14
2006 */
2007EAPI 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);
2008
2009/** Set whether vertical or horizontal minimum size's of the box are equal
2010 * to the minimum vertical or horizontal size of items
2011 * (function for BOX or TABLE part.
2012 * If EINA_TRUE - is equal, if EINA_FALSE - is not)
2013 *
2014 * @param obj Object being edited.
2015 * @param part Part that have BOX/TABLE type.
2016 * @param state Name of the state.
2017 * @param value Value of the state.
2018 * @param h horizontal min value.
2019 * @param v vertical min value.
2020 *
2021 * @return @c EINA_TRUE in case of success, @c EINA_FALSE otherwise.
2022 * @since 1.14
2023 */
2024EAPI 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);
2025
1992/** Get x and y paddings for BOX or TABLE part. 2026/** Get x and y paddings for BOX or TABLE part.
1993 * 2027 *
1994 * @param obj Object being edited. 2028 * @param obj Object being edited.
diff --git a/src/lib/edje/edje_edit.c b/src/lib/edje/edje_edit.c
index e87c632879..6fcffcee02 100644
--- a/src/lib/edje/edje_edit.c
+++ b/src/lib/edje/edje_edit.c
@@ -4346,6 +4346,66 @@ edje_edit_state_container_padding_set(Evas_Object *obj, const char *part,
4346 } 4346 }
4347 return EINA_TRUE; 4347 return EINA_TRUE;
4348} 4348}
4349
4350EAPI Eina_Bool
4351edje_edit_state_container_min_get(Evas_Object *obj, const char *part, const char *state, double value, Eina_Bool *h, Eina_Bool *v)
4352{
4353 GET_PD_OR_RETURN(EINA_FALSE)
4354
4355 switch (rp->part->type)
4356 {
4357 case EDJE_PART_TYPE_TABLE:
4358 {
4359 Edje_Part_Description_Table *table;
4360 table = (Edje_Part_Description_Table*) pd;
4361 if (h) *h = table->table.min.h;
4362 if (v) *v = table->table.min.v;
4363 break;
4364 }
4365 case EDJE_PART_TYPE_BOX:
4366 {
4367 Edje_Part_Description_Box *box;
4368 box = (Edje_Part_Description_Box*) pd;
4369 if (h) *h = box->box.min.h;
4370 if (v) *v = box->box.min.v;
4371 break;
4372 }
4373 default:
4374 return EINA_FALSE;
4375 }
4376
4377 return EINA_TRUE;
4378}
4379
4380EAPI Eina_Bool
4381edje_edit_state_container_min_set(Evas_Object *obj, const char *part, const char *state, double value, Eina_Bool h, Eina_Bool v)
4382{
4383 GET_PD_OR_RETURN(EINA_FALSE)
4384
4385 switch (rp->part->type)
4386 {
4387 case EDJE_PART_TYPE_TABLE:
4388 {
4389 Edje_Part_Description_Table *table;
4390 table = (Edje_Part_Description_Table*) pd;
4391 table->table.min.h = h;
4392 table->table.min.v = v;
4393 break;
4394 }
4395 case EDJE_PART_TYPE_BOX:
4396 {
4397 Edje_Part_Description_Box *box;
4398 box = (Edje_Part_Description_Box*) pd;
4399 box->box.min.h = h;
4400 box->box.min.v = v;
4401 break;
4402 }
4403 default:
4404 return EINA_FALSE;
4405 }
4406 return EINA_TRUE;
4407}
4408
4349/***************************/ 4409/***************************/
4350/* BOX & TABLE ITEMS API */ 4410/* BOX & TABLE ITEMS API */
4351/***************************/ 4411/***************************/