summaryrefslogtreecommitdiff
path: root/src/lib/edje
diff options
context:
space:
mode:
authorVitalii Vorobiov <vi.vorobiov@samsung.com>2015-02-13 18:47:56 +0200
committerVitalii Vorobiov <vi.vorobiov@samsung.com>2015-02-13 19:08:40 +0200
commit87a5388919385ba489626797806f1618e3207111 (patch)
treef5d4861486380687bd3340d4b44a6b1b0edfa12c /src/lib/edje
parentb552cfb50ba73952e187732b628114a61622f939 (diff)
edje: Edje_Edit - functions to edit layouts of BOX parts
New functions for setting such BOX's params like primary and fallback layouts: > edje_edit_state_box_layout_set > edje_edit_state_box_layout_get > edje_edit_state_box_alt_layout_set > edje_edit_state_box_alt_layout_get @feature
Diffstat (limited to 'src/lib/edje')
-rw-r--r--src/lib/edje/Edje_Edit.h100
-rw-r--r--src/lib/edje/edje_edit.c38
2 files changed, 138 insertions, 0 deletions
diff --git a/src/lib/edje/Edje_Edit.h b/src/lib/edje/Edje_Edit.h
index 12db53b4c0..2146b22172 100644
--- a/src/lib/edje/Edje_Edit.h
+++ b/src/lib/edje/Edje_Edit.h
@@ -1833,6 +1833,106 @@ 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 *************************/
1837/******************************************************************************/
1838/** @name Box and Table API
1839 * Functions to deal with table and box (see @ref edcref).
1840 */ //@{
1841
1842/** Get primary layout of the box.
1843 *
1844 * @note The returned string should be freed with @c eina_stringshare_del().
1845 * @param obj Object being edited.
1846 * @param part Part that have BOX type.
1847 * @param state Name of the state.
1848 * @param value Value of the state.
1849 *
1850 * @return Primary layout of a BOX part in given state.
1851 * @since 1.14
1852 */
1853EAPI Eina_Stringshare *
1854edje_edit_state_box_layout_get(Evas_Object *obj, const char *part,
1855 const char *state, double value);
1856
1857/** Set primary layout of the box.
1858 *
1859 * When trying to set primary layout to NULL, function will use
1860 * alternative layout instead.
1861 *
1862 * @param obj Object being edited.
1863 * @param part Part that have BOX type.
1864 * @param state Name of the state.
1865 * @param value Value of the state.
1866 * @param layout New primary layout to set name.
1867 *
1868 * Possible layouts:
1869 * @li horizontal (default)
1870 * @li vertical
1871 * @li horizontal_homogeneous
1872 * @li vertical_homogeneous
1873 * @li horizontal_max (homogeneous to the max sized child)
1874 * @li vertical_max
1875 * @li horizontal_flow
1876 * @li vertical_flow
1877 * @li stack
1878 * @li some_other_custom_layout_set_by_the_application
1879 *
1880 * @return @c EINA_TRUE in case of success, @c EINA_FALSE otherwise.
1881 * @since 1.14
1882 */
1883EAPI Eina_Bool
1884edje_edit_state_box_layout_set(Evas_Object *obj, const char *part,
1885 const char *state, double value,
1886 char *layout);
1887
1888/** Get fallback layout of the box.
1889 *
1890 * @note The returned string should be freed with @c eina_stringshare_del().
1891 * @param obj Object being edited.
1892 * @param part Part that have BOX type.
1893 * @param state Name of the state.
1894 * @param value Value of the state.
1895 *
1896 * @return Fallback layout of a BOX part in given state.
1897 * @since 1.14
1898 */
1899EAPI Eina_Stringshare *
1900edje_edit_state_box_alt_layout_get(Evas_Object *obj, const char *part,
1901 const char *state, double value);
1902
1903/** Set fallback layout of the box.
1904 *
1905 * When trying to set fallback layout to NULL, function will use
1906 * default layout ("horizontal") instead.
1907 *
1908 * @param obj Object being edited.
1909 * @param part Part that have BOX type.
1910 * @param state Name of the state.
1911 * @param value Value of the state.
1912 * @param layout New fallback layout to set name.
1913 *
1914 * Possible layouts:
1915 * @li horizontal (default)
1916 * @li vertical
1917 * @li horizontal_homogeneous
1918 * @li vertical_homogeneous
1919 * @li horizontal_max (homogeneous to the max sized child)
1920 * @li vertical_max
1921 * @li horizontal_flow
1922 * @li vertical_flow
1923 * @li stack
1924 * @li some_other_custom_layout_set_by_the_application
1925 *
1926 * @return @c EINA_TRUE in case of success, @c EINA_FALSE otherwise.
1927 * @since 1.14
1928 */
1929EAPI Eina_Bool
1930edje_edit_state_box_alt_layout_set(Evas_Object *obj, const char *part,
1931 const char *state, double value,
1932 char *layout);
1933
1934//@}
1935/******************************************************************************/
1836/************************** BOX & TABLE ITEMS API *************************/ 1936/************************** BOX & TABLE ITEMS API *************************/
1837/******************************************************************************/ 1937/******************************************************************************/
1838/** @name Items API 1938/** @name Items API
diff --git a/src/lib/edje/edje_edit.c b/src/lib/edje/edje_edit.c
index f7fe9094b7..49a3290a40 100644
--- a/src/lib/edje/edje_edit.c
+++ b/src/lib/edje/edje_edit.c
@@ -4135,6 +4135,44 @@ FUNC_PART_DRAG_ID(event);
4135FUNC_PART_DRAG_ID(threshold); 4135FUNC_PART_DRAG_ID(threshold);
4136 4136
4137/***************************/ 4137/***************************/
4138/* BOX & TABLE API */
4139/***************************/
4140
4141#define FUNC_STATE_BOX_LAYOUT(Layout) \
4142 EAPI Eina_Stringshare * \
4143 edje_edit_state_box_##Layout##_get(Evas_Object *obj, const char *part, \
4144 const char *state, double value) \
4145 { \
4146 GET_PD_OR_RETURN(0) \
4147 if (rp->part->type == EDJE_PART_TYPE_BOX) \
4148 { \
4149 Edje_Part_Description_Box *box; \
4150 box = (Edje_Part_Description_Box *) pd; \
4151 return eina_stringshare_add(box->box.Layout); \
4152 } \
4153 return NULL; \
4154 } \
4155 EAPI Eina_Bool \
4156 edje_edit_state_box_##Layout##_set(Evas_Object *obj, const char *part, \
4157 const char *state, double value, \
4158 char *layout) \
4159 { \
4160 GET_PD_OR_RETURN(EINA_FALSE) \
4161 if (rp->part->type == EDJE_PART_TYPE_BOX) \
4162 { \
4163 Edje_Part_Description_Box *box; \
4164 box = (Edje_Part_Description_Box *) pd; \
4165 box->box.Layout = layout; \
4166 } \
4167 else \
4168 return EINA_FALSE; \
4169 return EINA_TRUE; \
4170 }
4171
4172FUNC_STATE_BOX_LAYOUT(layout);
4173FUNC_STATE_BOX_LAYOUT(alt_layout);
4174
4175/***************************/
4138/* BOX & TABLE ITEMS API */ 4176/* BOX & TABLE ITEMS API */
4139/***************************/ 4177/***************************/
4140 4178