summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorm.biliavskyi <m.biliavskyi@samsung.com>2013-11-01 11:17:24 +0900
committerCedric Bail <cedric.bail@samsung.com>2013-11-01 11:31:36 +0900
commit6f8b1c1b02e4b59da437e40acd2f3434e78d1c7a (patch)
tree94a2d96485077e997701daebb2b3e2c3dd8fd50d /src/lib
parentcba1fa5dd525b72504ac7530454a71267b853e70 (diff)
edje: make functions "edje_edit_state_fill/aspect/align..." return Eina_Bool
Make the following function return Eina_Bool so the caller can detect errors : List of updated functions: edje_edit_state_align_x_set edje_edit_state_align_y_set edje_edit_state_aspect_min_set edje_edit_state_aspect_max_set edje_edit_state_aspect_pref_set edje_edit_state_fill_origin_relative_x_set edje_edit_state_fill_origin_relative_y_set edje_edit_state_fill_origin_offset_x_set edje_edit_state_fill_origin_offset_y_set edje_edit_state_fill_size_relative_x_set edje_edit_state_fill_size_relative_y_set edje_edit_state_fill_size_offset_x_set edje_edit_state_fill_size_offset_y_set Reviewers: cedric, seoz Reviewed By: cedric CC: reutskiy.v.v Differential Revision: https://phab.enlightenment.org/D300 Signed-off-by: Cedric Bail <cedric.bail@samsung.com>
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/edje/Edje_Edit.h52
-rw-r--r--src/lib/edje/edje_edit.c33
2 files changed, 57 insertions, 28 deletions
diff --git a/src/lib/edje/Edje_Edit.h b/src/lib/edje/Edje_Edit.h
index 10ad69fc80..2a2f5e1bc2 100644
--- a/src/lib/edje/Edje_Edit.h
+++ b/src/lib/edje/Edje_Edit.h
@@ -1648,8 +1648,10 @@ EAPI double edje_edit_state_align_y_get(Evas_Object *obj, const char *part, cons
1648 * @param state The name of the state to get horizontal align (not including the state value). 1648 * @param state The name of the state to get horizontal align (not including the state value).
1649 * @param value The state value. 1649 * @param value The state value.
1650 * @param align The new vertical align value. 1650 * @param align The new vertical align value.
1651 *
1652 * @return EINA_TRUE if the parameter was found, EINA_FALSE otherwise.
1651 */ 1653 */
1652EAPI void edje_edit_state_align_x_set(Evas_Object *obj, const char *part, const char *state, double value, double align); 1654EAPI Eina_Bool edje_edit_state_align_x_set(Evas_Object *obj, const char *part, const char *state, double value, double align);
1653 1655
1654/** Set the vertical align value of a part state. 1656/** Set the vertical align value of a part state.
1655 * 1657 *
@@ -1658,8 +1660,10 @@ EAPI void edje_edit_state_align_x_set(Evas_Object *obj, const char *part, const
1658 * @param state The name of the state to get vertical align (not including the state value). 1660 * @param state The name of the state to get vertical align (not including the state value).
1659 * @param value The state value. 1661 * @param value The state value.
1660 * @param align The new vertical align value. 1662 * @param align The new vertical align value.
1663 *
1664 * @return EINA_TRUE if the parameter was found, EINA_FALSE otherwise.
1661 */ 1665 */
1662EAPI void edje_edit_state_align_y_set(Evas_Object *obj, const char *part, const char *state, double value, double align); 1666EAPI Eina_Bool edje_edit_state_align_y_set(Evas_Object *obj, const char *part, const char *state, double value, double align);
1663 1667
1664/** Get the minimum width value of a part state. 1668/** Get the minimum width value of a part state.
1665 * 1669 *
@@ -1790,8 +1794,10 @@ EAPI double edje_edit_state_aspect_max_get(Evas_Object *obj, const char *part, c
1790 * @param state The name of the state to set minimum aspect (not including the state value). 1794 * @param state The name of the state to set minimum aspect (not including the state value).
1791 * @param value The state value. 1795 * @param value The state value.
1792 * @param aspect Minimum aspect value. 1796 * @param aspect Minimum aspect value.
1797 *
1798 * @return EINA_TRUE if the parameter was found, EINA_FALSE otherwise.
1793 */ 1799 */
1794EAPI void edje_edit_state_aspect_min_set(Evas_Object *obj, const char *part, const char *state, double value, double aspect); 1800EAPI Eina_Bool edje_edit_state_aspect_min_set(Evas_Object *obj, const char *part, const char *state, double value, double aspect);
1795 1801
1796/** Set the maximum aspect value of a part state. 1802/** Set the maximum aspect value of a part state.
1797 * 1803 *
@@ -1800,8 +1806,10 @@ EAPI void edje_edit_state_aspect_min_set(Evas_Object *obj, const char *part, con
1800 * @param state The name of the state to set maximum aspect (not including the state value). 1806 * @param state The name of the state to set maximum aspect (not including the state value).
1801 * @param value The state value. 1807 * @param value The state value.
1802 * @param aspect Maximum aspect value. 1808 * @param aspect Maximum aspect value.
1809 *
1810 * @return EINA_TRUE if the parameter was found, EINA_FALSE otherwise.
1803 */ 1811 */
1804EAPI void edje_edit_state_aspect_max_set(Evas_Object *obj, const char *part, const char *state, double value, double aspect); 1812EAPI Eina_Bool edje_edit_state_aspect_max_set(Evas_Object *obj, const char *part, const char *state, double value, double aspect);
1805 1813
1806/** Get the aspect preference of a part state. 1814/** Get the aspect preference of a part state.
1807 * 1815 *
@@ -1823,8 +1831,10 @@ EAPI unsigned char edje_edit_state_aspect_pref_get(Evas_Object *obj, const char
1823 * @param value The state value. 1831 * @param value The state value.
1824 * @param pref The aspect preference to set (0 = None, 1 = Vertical, 2 1832 * @param pref The aspect preference to set (0 = None, 1 = Vertical, 2
1825 * = Horizontal, 3 = Both) 1833 * = Horizontal, 3 = Both)
1834 *
1835 * @return EINA_TRUE if the parameter was found, EINA_FALSE otherwise.
1826 */ 1836 */
1827EAPI void edje_edit_state_aspect_pref_set(Evas_Object *obj, const char *part, const char *state, double value, unsigned char pref); 1837EAPI Eina_Bool edje_edit_state_aspect_pref_set(Evas_Object *obj, const char *part, const char *state, double value, unsigned char pref);
1828 1838
1829/** Get the fill horizontal origin relative value of a part state. 1839/** Get the fill horizontal origin relative value of a part state.
1830 * 1840 *
@@ -1877,8 +1887,10 @@ EAPI int edje_edit_state_fill_origin_offset_y_get(Evas_Object *obj, const char *
1877 * @param state The name of the state to set fill horizontal origin relative to area (not including the state value). 1887 * @param state The name of the state to set fill horizontal origin relative to area (not including the state value).
1878 * @param value The state value. 1888 * @param value The state value.
1879 * @param x The fill horizontal origin value. 1889 * @param x The fill horizontal origin value.
1890 *
1891 * @return EINA_TRUE if the parameter was found, EINA_FALSE otherwise.
1880 */ 1892 */
1881EAPI void edje_edit_state_fill_origin_relative_x_set(Evas_Object *obj, const char *part, const char *state, double value, double x); 1893EAPI Eina_Bool edje_edit_state_fill_origin_relative_x_set(Evas_Object *obj, const char *part, const char *state, double value, double x);
1882 1894
1883/** Set the fill horizontal origin relative value of a part state. 1895/** Set the fill horizontal origin relative value of a part state.
1884 * 1896 *
@@ -1887,8 +1899,10 @@ EAPI void edje_edit_state_fill_origin_relative_x_set(Evas_Object *obj, const cha
1887 * @param state The name of the state to set fill vertical origin relative to area (not including the state value). 1899 * @param state The name of the state to set fill vertical origin relative to area (not including the state value).
1888 * @param value The state value. 1900 * @param value The state value.
1889 * @param y The fill vertical origin value. 1901 * @param y The fill vertical origin value.
1902 *
1903 * @return EINA_TRUE if the parameter was found, EINA_FALSE otherwise.
1890 */ 1904 */
1891EAPI void edje_edit_state_fill_origin_relative_y_set(Evas_Object *obj, const char *part, const char *state, double value, double y); 1905EAPI Eina_Bool edje_edit_state_fill_origin_relative_y_set(Evas_Object *obj, const char *part, const char *state, double value, double y);
1892 1906
1893/** Set the fill horizontal origin offset value of a part state. 1907/** Set the fill horizontal origin offset value of a part state.
1894 * 1908 *
@@ -1897,8 +1911,10 @@ EAPI void edje_edit_state_fill_origin_relative_y_set(Evas_Object *obj, const cha
1897 * @param state The name of the state to set fill horizontal origin offset relative to area (not including the state value). 1911 * @param state The name of the state to set fill horizontal origin offset relative to area (not including the state value).
1898 * @param value The state value. 1912 * @param value The state value.
1899 * @param x The fill horizontal origin offset value. 1913 * @param x The fill horizontal origin offset value.
1914 *
1915 * @return EINA_TRUE if the parameter was found, EINA_FALSE otherwise.
1900 */ 1916 */
1901EAPI void edje_edit_state_fill_origin_offset_x_set(Evas_Object *obj, const char *part, const char *state, double value, double x); 1917EAPI Eina_Bool edje_edit_state_fill_origin_offset_x_set(Evas_Object *obj, const char *part, const char *state, double value, double x);
1902 1918
1903/** Set the fill vertical origin offset value of a part state. 1919/** Set the fill vertical origin offset value of a part state.
1904 * 1920 *
@@ -1907,8 +1923,10 @@ EAPI void edje_edit_state_fill_origin_offset_x_set(Evas_Object *obj, const char
1907 * @param state The name of the state to set fill vertical origin offset relative to area (not including the state value). 1923 * @param state The name of the state to set fill vertical origin offset relative to area (not including the state value).
1908 * @param value The state value. 1924 * @param value The state value.
1909 * @param y The fill vertical origin offset value. 1925 * @param y The fill vertical origin offset value.
1926 *
1927 * @return EINA_TRUE if the parameter was found, EINA_FALSE otherwise.
1910 */ 1928 */
1911EAPI void edje_edit_state_fill_origin_offset_y_set(Evas_Object *obj, const char *part, const char *state, double value, double y); 1929EAPI Eina_Bool edje_edit_state_fill_origin_offset_y_set(Evas_Object *obj, const char *part, const char *state, double value, double y);
1912 1930
1913/** Get the fill horizontal size relative value of a part state. 1931/** Get the fill horizontal size relative value of a part state.
1914 * 1932 *
@@ -1964,8 +1982,10 @@ EAPI int edje_edit_state_fill_size_offset_y_get(Evas_Object *obj, const char *pa
1964 * relative value (not including the state value). 1982 * relative value (not including the state value).
1965 * @param value The state value. 1983 * @param value The state value.
1966 * @param x The horizontal size relative value. 1984 * @param x The horizontal size relative value.
1985 *
1986 * @return EINA_TRUE if the parameter was found, EINA_FALSE otherwise.
1967 */ 1987 */
1968EAPI void edje_edit_state_fill_size_relative_x_set(Evas_Object *obj, const char *part, const char *state, double value, double x); 1988EAPI Eina_Bool edje_edit_state_fill_size_relative_x_set(Evas_Object *obj, const char *part, const char *state, double value, double x);
1969 1989
1970/** Set the fill vertical size relative value of a part state. 1990/** Set the fill vertical size relative value of a part state.
1971 * 1991 *
@@ -1975,8 +1995,10 @@ EAPI void edje_edit_state_fill_size_relative_x_set(Evas_Object *obj, const char
1975 * relative value (not including the state value). 1995 * relative value (not including the state value).
1976 * @param value The state value. 1996 * @param value The state value.
1977 * @param x The vertical size relative value. 1997 * @param x The vertical size relative value.
1998 *
1999 * @return EINA_TRUE if the parameter was found, EINA_FALSE otherwise.
1978 */ 2000 */
1979EAPI void edje_edit_state_fill_size_relative_y_set(Evas_Object *obj, const char *part, const char *state, double value, double x); 2001EAPI Eina_Bool edje_edit_state_fill_size_relative_y_set(Evas_Object *obj, const char *part, const char *state, double value, double x);
1980 2002
1981/** Set the fill horizontal size offset value of a part state. 2003/** Set the fill horizontal size offset value of a part state.
1982 * 2004 *
@@ -1986,8 +2008,10 @@ EAPI void edje_edit_state_fill_size_relative_y_set(Evas_Object *obj, const char
1986 * offset relative value (not including the state value). 2008 * offset relative value (not including the state value).
1987 * @param value The state value. 2009 * @param value The state value.
1988 * @param x The horizontal size offset value. 2010 * @param x The horizontal size offset value.
2011 *
2012 * @return EINA_TRUE if the parameter was found, EINA_FALSE otherwise.
1989 */ 2013 */
1990EAPI void edje_edit_state_fill_size_offset_x_set(Evas_Object *obj, const char *part, const char *state, double value, double x); 2014EAPI Eina_Bool edje_edit_state_fill_size_offset_x_set(Evas_Object *obj, const char *part, const char *state, double value, double x);
1991 2015
1992/** Set the fill vertical size offset value of a part state. 2016/** Set the fill vertical size offset value of a part state.
1993 * 2017 *
@@ -1997,8 +2021,10 @@ EAPI void edje_edit_state_fill_size_offset_x_set(Evas_Object *obj, const char *p
1997 * relative value (not including the state value). 2021 * relative value (not including the state value).
1998 * @param value The state value. 2022 * @param value The state value.
1999 * @param y The vertical size offset value. 2023 * @param y The vertical size offset value.
2024 *
2025 * @return EINA_TRUE if the parameter was found, EINA_FALSE otherwise.
2000 */ 2026 */
2001EAPI void edje_edit_state_fill_size_offset_y_set(Evas_Object *obj, const char *part, const char *state, double value, double y); 2027EAPI Eina_Bool edje_edit_state_fill_size_offset_y_set(Evas_Object *obj, const char *part, const char *state, double value, double y);
2002 2028
2003/** Get the visibility of a part state. 2029/** Get the visibility of a part state.
2004 * 2030 *
diff --git a/src/lib/edje/edje_edit.c b/src/lib/edje/edje_edit.c
index 46ad74c97d..d75b55f707 100644
--- a/src/lib/edje/edje_edit.c
+++ b/src/lib/edje/edje_edit.c
@@ -3357,12 +3357,13 @@ edje_edit_state_color3_set(Evas_Object *obj, const char *part, const char *state
3357 GET_PD_OR_RETURN(0); \ 3357 GET_PD_OR_RETURN(0); \
3358 return TO_DOUBLE(pd->Class.Value); \ 3358 return TO_DOUBLE(pd->Class.Value); \
3359 } \ 3359 } \
3360 EAPI void \ 3360 EAPI Eina_Bool \
3361 edje_edit_state_##Class##_##Value##_set(Evas_Object *obj, const char *part, const char *state, double value, double v) \ 3361 edje_edit_state_##Class##_##Value##_set(Evas_Object *obj, const char *part, const char *state, double value, double v) \
3362 { \ 3362 { \
3363 GET_PD_OR_RETURN(); \ 3363 GET_PD_OR_RETURN(EINA_FALSE); \
3364 pd->Class.Value = FROM_DOUBLE(v); \ 3364 pd->Class.Value = FROM_DOUBLE(v); \
3365 edje_object_calc_force(obj); \ 3365 edje_object_calc_force(obj); \
3366 return EINA_TRUE; \
3366 } 3367 }
3367 3368
3368#define FUNC_STATE_INT(Class, Value, Min) \ 3369#define FUNC_STATE_INT(Class, Value, Min) \
@@ -3421,10 +3422,10 @@ FUNC_STATE_DOUBLE(aspect, max);
3421 \ 3422 \
3422 return 0; \ 3423 return 0; \
3423 } \ 3424 } \
3424 EAPI void \ 3425 EAPI Eina_Bool \
3425 edje_edit_state_fill_##Type##_relative_##Value##_set(Evas_Object *obj, const char *part, const char *state, double value, double v) \ 3426 edje_edit_state_fill_##Type##_relative_##Value##_set(Evas_Object *obj, const char *part, const char *state, double value, double v) \
3426 { \ 3427 { \
3427 GET_PD_OR_RETURN(); \ 3428 GET_PD_OR_RETURN(EINA_FALSE); \
3428 \ 3429 \
3429 switch (rp->part->type) \ 3430 switch (rp->part->type) \
3430 { \ 3431 { \
@@ -3449,10 +3450,11 @@ FUNC_STATE_DOUBLE(aspect, max);
3449 break; \ 3450 break; \
3450 } \ 3451 } \
3451 default: \ 3452 default: \
3452 return; \ 3453 return EINA_FALSE; \
3453 } \ 3454 } \
3454 \ 3455 \
3455 edje_object_calc_force(obj); \ 3456 edje_object_calc_force(obj); \
3457 return EINA_TRUE; \
3456 } 3458 }
3457 3459
3458#define FUNC_STATE_INT_FILL(Class, Type, Value) \ 3460#define FUNC_STATE_INT_FILL(Class, Type, Value) \
@@ -3482,10 +3484,10 @@ FUNC_STATE_DOUBLE(aspect, max);
3482 } \ 3484 } \
3483 return 0; \ 3485 return 0; \
3484 } \ 3486 } \
3485 EAPI void \ 3487 EAPI Eina_Bool \
3486 edje_edit_state_fill_##Type##_offset_##Value##_set(Evas_Object *obj, const char *part, const char *state, double value, double v) \ 3488 edje_edit_state_fill_##Type##_offset_##Value##_set(Evas_Object *obj, const char *part, const char *state, double value, double v) \
3487 { \ 3489 { \
3488 GET_PD_OR_RETURN(); \ 3490 GET_PD_OR_RETURN(EINA_FALSE); \
3489 \ 3491 \
3490 switch (rp->part->type) \ 3492 switch (rp->part->type) \
3491 { \ 3493 { \
@@ -3496,7 +3498,7 @@ FUNC_STATE_DOUBLE(aspect, max);
3496 img = (Edje_Part_Description_Image*) pd; \ 3498 img = (Edje_Part_Description_Image*) pd; \
3497 \ 3499 \
3498 img->image.fill.Class##abs_##Value = FROM_DOUBLE(v); \ 3500 img->image.fill.Class##abs_##Value = FROM_DOUBLE(v); \
3499 return; \ 3501 break; \
3500 } \ 3502 } \
3501 case EDJE_PART_TYPE_PROXY: \ 3503 case EDJE_PART_TYPE_PROXY: \
3502 { \ 3504 { \
@@ -3505,13 +3507,14 @@ FUNC_STATE_DOUBLE(aspect, max);
3505 pro = (Edje_Part_Description_Proxy*) pd; \ 3507 pro = (Edje_Part_Description_Proxy*) pd; \
3506 \ 3508 \
3507 pro->proxy.fill.Class##abs_##Value = FROM_DOUBLE(v); \ 3509 pro->proxy.fill.Class##abs_##Value = FROM_DOUBLE(v); \
3508 return; \ 3510 break; \
3509 } \ 3511 } \
3510 default: \ 3512 default: \
3511 return; \ 3513 return EINA_FALSE; \
3512 } \ 3514 } \
3513 \ 3515 \
3514 edje_object_calc_force(obj); \ 3516 edje_object_calc_force(obj); \
3517 return EINA_TRUE; \
3515 } 3518 }
3516 3519
3517FUNC_STATE_DOUBLE_FILL(pos_, origin, x); 3520FUNC_STATE_DOUBLE_FILL(pos_, origin, x);
@@ -3556,13 +3559,13 @@ edje_edit_state_aspect_pref_get(Evas_Object *obj, const char *part, const char *
3556 return pd->aspect.prefer; 3559 return pd->aspect.prefer;
3557} 3560}
3558 3561
3559EAPI void 3562EAPI Eina_Bool
3560edje_edit_state_aspect_pref_set(Evas_Object *obj, const char *part, const char *state, double value, unsigned char pref) 3563edje_edit_state_aspect_pref_set(Evas_Object *obj, const char *part, const char *state, double value, unsigned char pref)
3561{ 3564{
3562 GET_PD_OR_RETURN(); 3565 GET_PD_OR_RETURN(EINA_FALSE);
3563 3566 if ((!pref) || (pref > 3)) return EINA_FALSE;
3564 //printf("SET ASPECT_PREF of state '%s' [to: %d]\n", state, pref);
3565 pd->aspect.prefer = pref; 3567 pd->aspect.prefer = pref;
3568 return EINA_TRUE;
3566} 3569}
3567 3570
3568EAPI const char* 3571EAPI const char*