summaryrefslogtreecommitdiff
path: root/src/lib/edje
diff options
context:
space:
mode:
authorVitalii Vorobiov <vi.vorobiov@samsung.com>2015-02-19 16:57:17 +0200
committerVitalii Vorobiov <vi.vorobiov@samsung.com>2015-02-19 16:57:17 +0200
commit34c8d3a52d97c9c424a93bc80410eb4a5b3c3dce (patch)
treee6cde68070a6e865bb076b6d6d1be1c04f1e405f /src/lib/edje
parent1b4a80d47703a0468c0fbfc7a064c286008a3417 (diff)
Edje: new set/get API omogeneous, paddings and align for BOX/TABLE in Edje Edit
Those include such functions like: > edje_edit_state_table_homogeneous_set/get (function for TABLE only) > edje_edit_state_container_padding_get (container means that functions both for TABLE and BOX) > edje_edit_state_container_align_get (also for TABLE and BOX) @feature
Diffstat (limited to 'src/lib/edje')
-rw-r--r--src/lib/edje/Edje_Edit.h132
-rw-r--r--src/lib/edje/edje_edit.c176
2 files changed, 304 insertions, 4 deletions
diff --git a/src/lib/edje/Edje_Edit.h b/src/lib/edje/Edje_Edit.h
index 2146b22172..14c83b3477 100644
--- a/src/lib/edje/Edje_Edit.h
+++ b/src/lib/edje/Edje_Edit.h
@@ -1833,10 +1833,10 @@ EAPI Eina_Bool edje_edit_part_drag_threshold_set(Evas_Object *obj, const char *p
1833 1833
1834//@} 1834//@}
1835/******************************************************************************/ 1835/******************************************************************************/
1836/************************** BOX & TABLE API *************************/ 1836/******************************* BOX API ****************************/
1837/******************************************************************************/ 1837/******************************************************************************/
1838/** @name Box and Table API 1838/** @name Box Description API
1839 * Functions to deal with table and box (see @ref edcref). 1839 * Functions to deal with box (see @ref edcref).
1840 */ //@{ 1840 */ //@{
1841 1841
1842/** Get primary layout of the box. 1842/** Get primary layout of the box.
@@ -1933,6 +1933,132 @@ edje_edit_state_box_alt_layout_set(Evas_Object *obj, const char *part,
1933 1933
1934//@} 1934//@}
1935/******************************************************************************/ 1935/******************************************************************************/
1936/************************** TABLE API *************************************/
1937/******************************************************************************/
1938/** @name Table Description API
1939 * Functions to deal with table (see @ref edcref).
1940 */ //@{
1941
1942/** Set homogeneous mode for TABLE part.
1943 *
1944 * @param obj Object being edited.
1945 * @param part Part that have TABLE type.
1946 * @param state Name of the state.
1947 * @param value Value of the state.
1948 * @param homogeneous Homogeneous mode for table.
1949 *
1950 * Possible modes:
1951 * @li EDJE_OBJECT_TABLE_HOMOGENEOUS_NONE,
1952 * @li EDJE_OBJECT_TABLE_HOMOGENEOUS_TABLE,
1953 * @li EDJE_OBJECT_TABLE_HOMOGENEOUS_ITEM
1954 *
1955 * @return @c EINA_TRUE in case of success, @c EINA_FALSE otherwise.
1956 * @since 1.14
1957 */
1958EAPI Eina_Bool
1959edje_edit_state_table_homogeneous_set(Evas_Object *obj, const char *part,
1960 const char *state, double value,
1961 unsigned char homogeneous);
1962
1963/** Get homogeneous mode for TABLE part.
1964 *
1965 * @param obj Object being edited.
1966 * @param part Part that have TABLE type.
1967 * @param state Name of the state.
1968 * @param value Value of the state.
1969 *
1970 * Possible modes:
1971 * @li EDJE_OBJECT_TABLE_HOMOGENEOUS_NONE,
1972 * @li EDJE_OBJECT_TABLE_HOMOGENEOUS_TABLE,
1973 * @li EDJE_OBJECT_TABLE_HOMOGENEOUS_ITEM
1974 *
1975 * @return Table homogeneous mode on success or 0 on any error.
1976 * @since 1.14
1977 */
1978EAPI unsigned char
1979edje_edit_state_table_homogeneous_get(Evas_Object *obj, const char *part,
1980 const char *state, double value);
1981
1982//@}
1983/******************************************************************************/
1984/*********************** TABLE & BOX API **********************************/
1985/******************************************************************************/
1986/** @name "Container" Description API
1987 * Functions to deal both with box and table (see @ref edcref).
1988 * Those functions called edje_edit_state_container_<something> because they
1989 * are working both for TABLE and BOX at same time.
1990 */ //@{
1991
1992/** Get x and y paddings for BOX or TABLE part.
1993 *
1994 * @param obj Object being edited.
1995 * @param part Part that have BOX/TABLE type.
1996 * @param state Name of the state.
1997 * @param value Value of the state.
1998 * @param x Variable to store x padding.
1999 * @param y Variable to store y padding.
2000 *
2001 * @return @c EINA_TRUE in case of success, @c EINA_FALSE otherwise.
2002 * @since 1.14
2003 */
2004EAPI Eina_Bool
2005edje_edit_state_container_padding_get(Evas_Object *obj, const char *part,
2006 const char *state, double value,
2007 int *x, int *y);
2008
2009/** Set x and y paddings for BOX or TABLE part.
2010 *
2011 * @param obj Object being edited.
2012 * @param part Part that have BOX/TABLE type.
2013 * @param state Name of the state.
2014 * @param value Value of the state.
2015 * @param x Value for setting x padding.
2016 * @param y Value for setting y padding.
2017 *
2018 * @return @c EINA_TRUE in case of success, @c EINA_FALSE otherwise.
2019 * @since 1.14
2020 */
2021EAPI Eina_Bool
2022edje_edit_state_container_padding_set(Evas_Object *obj, const char *part,
2023 const char *state, double value,
2024 int x, int y);
2025
2026/** Set x and y align for BOX or TABLE part.
2027 *
2028 * @param obj Object being edited.
2029 * @param part Part that have BOX/TABLE type.
2030 * @param state Name of the state.
2031 * @param value Value of the state.
2032 * @param x Variable to store x value.
2033 * @param y Variable to store y value.
2034 *
2035 * @return @c EINA_TRUE in case of success, @c EINA_FALSE otherwise.
2036 * @since 1.14
2037 */
2038EAPI Eina_Bool
2039edje_edit_state_container_align_set(Evas_Object *obj, const char *part,
2040 const char *state, double value,
2041 double x, double y);
2042
2043/** Get x and y align for BOX or TABLE part.
2044 *
2045 * @param obj Object being edited.
2046 * @param part Part that have BOX/TABLE type.
2047 * @param state Name of the state.
2048 * @param value Value of the state.
2049 * @param x Value for setting x align.
2050 * @param y Value for setting y align.
2051 *
2052 * @return @c EINA_TRUE in case of success, @c EINA_FALSE otherwise.
2053 * @since 1.14
2054 */
2055EAPI Eina_Bool
2056edje_edit_state_container_align_get(Evas_Object *obj, const char *part,
2057 const char *state, double value,
2058 double *x, double *y);
2059
2060//@}
2061/******************************************************************************/
1936/************************** BOX & TABLE ITEMS API *************************/ 2062/************************** BOX & TABLE ITEMS API *************************/
1937/******************************************************************************/ 2063/******************************************************************************/
1938/** @name Items API 2064/** @name Items API
diff --git a/src/lib/edje/edje_edit.c b/src/lib/edje/edje_edit.c
index 49a3290a40..e87c632879 100644
--- a/src/lib/edje/edje_edit.c
+++ b/src/lib/edje/edje_edit.c
@@ -4135,7 +4135,7 @@ FUNC_PART_DRAG_ID(event);
4135FUNC_PART_DRAG_ID(threshold); 4135FUNC_PART_DRAG_ID(threshold);
4136 4136
4137/***************************/ 4137/***************************/
4138/* BOX & TABLE API */ 4138/* BOX API */
4139/***************************/ 4139/***************************/
4140 4140
4141#define FUNC_STATE_BOX_LAYOUT(Layout) \ 4141#define FUNC_STATE_BOX_LAYOUT(Layout) \
@@ -4173,6 +4173,180 @@ FUNC_STATE_BOX_LAYOUT(layout);
4173FUNC_STATE_BOX_LAYOUT(alt_layout); 4173FUNC_STATE_BOX_LAYOUT(alt_layout);
4174 4174
4175/***************************/ 4175/***************************/
4176/* TABLE API */
4177/***************************/
4178
4179EAPI unsigned char
4180edje_edit_state_table_homogeneous_get(Evas_Object *obj, const char *part,
4181 const char *state, double value)
4182{
4183 GET_PD_OR_RETURN(0)
4184
4185 switch (rp->part->type)
4186 {
4187 case EDJE_PART_TYPE_TABLE:
4188 {
4189 Edje_Part_Description_Table *table;
4190 table = (Edje_Part_Description_Table*) pd;
4191 return table->table.homogeneous;
4192 }
4193 default:
4194 return 0;
4195 }
4196 return 0;
4197}
4198
4199EAPI Eina_Bool
4200edje_edit_state_table_homogeneous_set(Evas_Object *obj, const char *part,
4201 const char *state, double value,
4202 unsigned char homogeneous)
4203{
4204 GET_PD_OR_RETURN(EINA_FALSE)
4205
4206 switch (rp->part->type)
4207 {
4208 case EDJE_PART_TYPE_TABLE:
4209 {
4210 Edje_Part_Description_Table *table;
4211 table = (Edje_Part_Description_Table*) pd;
4212 table->table.homogeneous = homogeneous;
4213 break;
4214 }
4215 default:
4216 return EINA_FALSE;
4217 }
4218 return EINA_TRUE;
4219}
4220
4221/***************************/
4222/* BOX & TABLE API */
4223/***************************/
4224
4225EAPI Eina_Bool
4226edje_edit_state_container_align_get(Evas_Object *obj, const char *part,
4227 const char *state, double value,
4228 double *x, double *y)
4229{
4230 GET_PD_OR_RETURN(EINA_FALSE)
4231
4232 switch (rp->part->type)
4233 {
4234 case EDJE_PART_TYPE_TABLE:
4235 {
4236 Edje_Part_Description_Table *table;
4237 table = (Edje_Part_Description_Table*) pd;
4238 if (x) *x = FROM_DOUBLE(table->table.align.x);
4239 if (y) *y = FROM_DOUBLE(table->table.align.y);
4240 break;
4241 }
4242 case EDJE_PART_TYPE_BOX:
4243 {
4244 Edje_Part_Description_Box *box;
4245 box = (Edje_Part_Description_Box*) pd;
4246 if (x) *x = FROM_DOUBLE(box->box.align.x);
4247 if (y) *y = FROM_DOUBLE(box->box.align.y);
4248 break;
4249 }
4250 default:
4251 return EINA_FALSE;
4252 }
4253 return EINA_TRUE;
4254}
4255
4256EAPI Eina_Bool
4257edje_edit_state_container_align_set(Evas_Object *obj, const char *part,
4258 const char *state, double value,
4259 double x, double y)
4260{
4261 GET_PD_OR_RETURN(EINA_FALSE)
4262
4263 switch (rp->part->type)
4264 {
4265 case EDJE_PART_TYPE_TABLE:
4266 {
4267 Edje_Part_Description_Table *table;
4268 table = (Edje_Part_Description_Table*) pd;
4269 table->table.align.x = TO_DOUBLE(x);
4270 table->table.align.y = TO_DOUBLE(y);
4271 break;
4272 }
4273 case EDJE_PART_TYPE_BOX:
4274 {
4275 Edje_Part_Description_Box *box;
4276 box = (Edje_Part_Description_Box*) pd;
4277 box->box.align.x = x;
4278 box->box.align.y = y;
4279 break;
4280 }
4281 default:
4282 return EINA_FALSE;
4283 }
4284 return EINA_TRUE;
4285}
4286
4287EAPI Eina_Bool
4288edje_edit_state_container_padding_get(Evas_Object *obj, const char *part,
4289 const char *state, double value,
4290 int *x, int *y)
4291{
4292 GET_PD_OR_RETURN(EINA_FALSE)
4293
4294 switch (rp->part->type)
4295 {
4296 case EDJE_PART_TYPE_TABLE:
4297 {
4298 Edje_Part_Description_Table *table;
4299 table = (Edje_Part_Description_Table*) pd;
4300 if (x) *x = table->table.padding.x;
4301 if (y) *y = table->table.padding.y;
4302 break;
4303 }
4304 case EDJE_PART_TYPE_BOX:
4305 {
4306 Edje_Part_Description_Box *box;
4307 box = (Edje_Part_Description_Box*) pd;
4308 if (x) *x = box->box.padding.x;
4309 if (y) *y = box->box.padding.y;
4310 break;
4311 }
4312 default:
4313 return EINA_FALSE;
4314 }
4315
4316 return EINA_TRUE;
4317}
4318
4319EAPI Eina_Bool
4320edje_edit_state_container_padding_set(Evas_Object *obj, const char *part,
4321 const char *state, double value,
4322 int x, int y)
4323{
4324 GET_PD_OR_RETURN(EINA_FALSE)
4325
4326 switch (rp->part->type)
4327 {
4328 case EDJE_PART_TYPE_TABLE:
4329 {
4330 Edje_Part_Description_Table *table;
4331 table = (Edje_Part_Description_Table*) pd;
4332 table->table.padding.x = x;
4333 table->table.padding.y = y;
4334 break;
4335 }
4336 case EDJE_PART_TYPE_BOX:
4337 {
4338 Edje_Part_Description_Box *box;
4339 box = (Edje_Part_Description_Box*) pd;
4340 box->box.padding.x = x;
4341 box->box.padding.y = y;
4342 break;
4343 }
4344 default:
4345 return EINA_FALSE;
4346 }
4347 return EINA_TRUE;
4348}
4349/***************************/
4176/* BOX & TABLE ITEMS API */ 4350/* BOX & TABLE ITEMS API */
4177/***************************/ 4351/***************************/
4178 4352