From: Gustavo Sverzut Barbieri Date: Thu, 25 Mar 2010 17:27:00 +0000 (+0000) Subject: Some missing getters... X-Git-Tag: v1.0.0~4706 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2b629c67f9b7e6d24b0354e0901e5ec7e5dd8d88;p=platform%2Fupstream%2Felementary.git Some missing getters... I'm working on edje_externals param_get/param_set and they will need these functions. SVN revision: 47450 --- diff --git a/src/lib/Elementary.h.in b/src/lib/Elementary.h.in index f09faa8..2a670d1 100644 --- a/src/lib/Elementary.h.in +++ b/src/lib/Elementary.h.in @@ -465,6 +465,7 @@ extern "C" { EAPI void elm_toggle_icon_set(Evas_Object *obj, Evas_Object *icon); EAPI Evas_Object *elm_toggle_icon_get(const Evas_Object *obj); EAPI void elm_toggle_states_labels_set(Evas_Object *obj, const char *onlabel, const char *offlabel); + EAPI void elm_toggle_states_labels_get(const Evas_Object *obj, const char **onlabel, const char **offlabel); EAPI void elm_toggle_state_set(Evas_Object *obj, Eina_Bool state); EAPI Eina_Bool elm_toggle_state_get(const Evas_Object *obj); EAPI void elm_toggle_state_pointer_set(Evas_Object *obj, Eina_Bool *statep); @@ -572,7 +573,9 @@ extern "C" { typedef struct _Elm_Hoversel_Item Elm_Hoversel_Item; EAPI Evas_Object *elm_entry_add(Evas_Object *parent); EAPI void elm_entry_single_line_set(Evas_Object *obj, Eina_Bool single_line); + EAPI Eina_Bool elm_entry_single_line_get(const Evas_Object *obj); EAPI void elm_entry_password_set(Evas_Object *obj, Eina_Bool password); + EAPI Eina_Bool elm_entry_password_get(const Evas_Object *obj); EAPI void elm_entry_entry_set(Evas_Object *obj, const char *entry); EAPI const char *elm_entry_entry_get(const Evas_Object *obj); EAPI const char *elm_entry_selection_get(const Evas_Object *obj); @@ -580,6 +583,7 @@ extern "C" { EAPI void elm_entry_line_wrap_set(Evas_Object *obj, Eina_Bool wrap); EAPI void elm_entry_line_char_wrap_set(Evas_Object *obj, Eina_Bool wrap); EAPI void elm_entry_editable_set(Evas_Object *obj, Eina_Bool editable); + EAPI Eina_Bool elm_entry_editable_get(const Evas_Object *obj); EAPI void elm_entry_select_none(Evas_Object *obj); EAPI void elm_entry_select_all(Evas_Object *obj); EAPI Eina_Bool elm_entry_cursor_next(Evas_Object *obj); @@ -856,14 +860,20 @@ extern "C" { EAPI void elm_slider_icon_set(Evas_Object *obj, Evas_Object *icon); EAPI Evas_Object *elm_slider_icon_get(const Evas_Object *obj); EAPI void elm_slider_span_size_set(Evas_Object *obj, Evas_Coord size); + EAPI int elm_slider_span_size_get(const Evas_Object *obj); EAPI void elm_slider_unit_format_set(Evas_Object *obj, const char *format); + EAPI const char *elm_slider_unit_format_get(const Evas_Object *obj); EAPI void elm_slider_indicator_format_set(Evas_Object *obj, const char *indicator); + EAPI const char *elm_slider_indicator_format_get(const Evas_Object *obj); EAPI void elm_slider_indicator_format_function_set(Evas_Object *obj, const char *(*func)(double val)); EAPI void elm_slider_horizontal_set(Evas_Object *obj, Eina_Bool horizontal); + EAPI Eina_Bool elm_slider_horizontal_get(const Evas_Object *obj); EAPI void elm_slider_min_max_set(Evas_Object *obj, double min, double max); + EAPI void elm_slider_min_max_get(const Evas_Object *obj, double *min, double *max); EAPI void elm_slider_value_set(Evas_Object *obj, double val); EAPI double elm_slider_value_get(const Evas_Object *obj); EAPI void elm_slider_inverted_set(Evas_Object *obj, Eina_Bool inverted); + EAPI Eina_Bool elm_slider_inverted_get(const Evas_Object *obj); typedef enum _Elm_Genlist_Item_Flags { @@ -1268,7 +1278,9 @@ extern "C" { EAPI Evas_Object *elm_scrolled_entry_add(Evas_Object *parent); EAPI void elm_scrolled_entry_single_line_set(Evas_Object *obj, Eina_Bool single_line); + EAPI Eina_Bool elm_scrolled_entry_single_line_get(const Evas_Object *obj); EAPI void elm_scrolled_entry_password_set(Evas_Object *obj, Eina_Bool password); + EAPI Eina_Bool elm_scrolled_entry_password_get(const Evas_Object *obj); EAPI void elm_scrolled_entry_entry_set(Evas_Object *obj, const char *entry); EAPI const char *elm_scrolled_entry_entry_get(const Evas_Object *obj); EAPI const char *elm_scrolled_entry_selection_get(const Evas_Object *obj); @@ -1276,6 +1288,7 @@ extern "C" { EAPI void elm_scrolled_entry_line_wrap_set(Evas_Object *obj, Eina_Bool wrap); EAPI void elm_scrolled_entry_line_char_wrap_set(Evas_Object *obj, Eina_Bool wrap); EAPI void elm_scrolled_entry_editable_set(Evas_Object *obj, Eina_Bool editable); + EAPI Eina_Bool elm_scrolled_entry_editable_get(const Evas_Object *obj); EAPI void elm_scrolled_entry_select_none(Evas_Object *obj); EAPI void elm_scrolled_entry_select_all(Evas_Object *obj); EAPI Eina_Bool elm_scrolled_entry_cursor_next(Evas_Object *obj); diff --git a/src/lib/elc_scrolled_entry.c b/src/lib/elc_scrolled_entry.c index 9c63c88..4a2e4c5 100644 --- a/src/lib/elc_scrolled_entry.c +++ b/src/lib/elc_scrolled_entry.c @@ -209,6 +209,15 @@ elm_scrolled_entry_single_line_set(Evas_Object *obj, Eina_Bool single_line) } } +EAPI Eina_Bool +elm_scrolled_entry_single_line_get(const Evas_Object *obj) +{ + ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE; + Widget_Data *wd = elm_widget_data_get(obj); + if (!wd) return EINA_FALSE; + return elm_entry_single_line_get(wd->entry); +} + EAPI void elm_scrolled_entry_password_set(Evas_Object *obj, Eina_Bool password) { @@ -218,6 +227,15 @@ elm_scrolled_entry_password_set(Evas_Object *obj, Eina_Bool password) elm_entry_password_set(wd->entry, password); } +EAPI Eina_Bool +elm_scrolled_entry_password_get(const Evas_Object *obj) +{ + ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE; + Widget_Data *wd = elm_widget_data_get(obj); + if (!wd) return EINA_FALSE; + return elm_entry_password_get(wd->entry); +} + EAPI void elm_scrolled_entry_entry_set(Evas_Object *obj, const char *entry) { @@ -281,6 +299,15 @@ elm_scrolled_entry_editable_set(Evas_Object *obj, Eina_Bool editable) elm_entry_editable_set(wd->entry, editable); } +EAPI Eina_Bool +elm_scrolled_entry_editable_get(const Evas_Object *obj) +{ + ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE; + Widget_Data *wd = elm_widget_data_get(obj); + if (!wd) return EINA_FALSE; + return elm_entry_editable_get(wd->entry); +} + EAPI void elm_scrolled_entry_select_none(Evas_Object *obj) { diff --git a/src/lib/elm_entry.c b/src/lib/elm_entry.c index 58e5b0a..eb5245d 100644 --- a/src/lib/elm_entry.c +++ b/src/lib/elm_entry.c @@ -1197,6 +1197,15 @@ elm_entry_single_line_set(Evas_Object *obj, Eina_Bool single_line) _sizing_eval(obj); } +EAPI Eina_Bool +elm_entry_single_line_get(const Evas_Object *obj) +{ + ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE; + Widget_Data *wd = elm_widget_data_get(obj); + if (!wd) return EINA_FALSE; + return wd->single_line; +} + EAPI void elm_entry_password_set(Evas_Object *obj, Eina_Bool password) { @@ -1216,6 +1225,15 @@ elm_entry_password_set(Evas_Object *obj, Eina_Bool password) _sizing_eval(obj); } +EAPI Eina_Bool +elm_entry_password_get(const Evas_Object *obj) +{ + ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE; + Widget_Data *wd = elm_widget_data_get(obj); + if (!wd) return EINA_FALSE; + return wd->password; +} + EAPI void elm_entry_entry_set(Evas_Object *obj, const char *entry) { @@ -1320,6 +1338,15 @@ elm_entry_editable_set(Evas_Object *obj, Eina_Bool editable) _sizing_eval(obj); } +EAPI Eina_Bool +elm_entry_editable_get(const Evas_Object *obj) +{ + ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE; + Widget_Data *wd = elm_widget_data_get(obj); + if (!wd) return EINA_FALSE; + return wd->editable; +} + EAPI void elm_entry_select_none(Evas_Object *obj) { diff --git a/src/lib/elm_slider.c b/src/lib/elm_slider.c index cd94d72..a1ad769 100644 --- a/src/lib/elm_slider.c +++ b/src/lib/elm_slider.c @@ -414,7 +414,7 @@ elm_slider_icon_get(const Evas_Object *obj) /** * Set the length of the dragable region of the slider * - * Thois sets the minimum width or height (depending on orientation) of the + * This sets the minimum width or height (depending on orientation) of the * area of the slider that allows the slider to be dragged around. This in * turn affects the objects minimum size (along with icon label and unit * text). Note that this will also get multiplied by the scale factor. @@ -441,6 +441,28 @@ elm_slider_span_size_set(Evas_Object *obj, Evas_Coord size) } /** + * Get the length of the dragable region of the slider + * + * This gets the minimum width or height (depending on orientation) of + * the area of the slider that allows the slider to be dragged + * around. Note that this will also get multiplied by the scale + * factor. + * + * @param obj The slider object + * @return The length of the slider area + * + * @ingroup Slider + */ +EAPI int +elm_slider_span_size_get(const Evas_Object *obj) +{ + ELM_CHECK_WIDTYPE(obj, widtype) 0; + Widget_Data *wd = elm_widget_data_get(obj); + if (!wd) return 0; + return wd->size; +} + +/** * Set the format string of the unit area * * If NULL, this disabls the unit area display. If not it sets the format @@ -475,7 +497,29 @@ elm_slider_unit_format_set(Evas_Object *obj, const char *units) } /** - * Set the format string for the inducator area + * Get the format string for the unit area + * + * The slider may also display a value (the value of the slider) somewhere + * (for example above the slider knob that is dragged around). This sets the + * format string for this. See elm_slider_unit_format_set() for more + * information on how this works. + * + * @param obj The slider object + * @return The format string for the unit display. + * + * @ingroup Slider + */ +EAPI const char * +elm_slider_unit_format_get(const Evas_Object *obj) +{ + ELM_CHECK_WIDTYPE(obj, widtype) NULL; + Widget_Data *wd = elm_widget_data_get(obj); + if (!wd) return NULL; + return wd->units; +} + +/** + * Set the format string for the indicator area * * The slider may also display a value (the value of the slider) somewhere * (for example above the slider knob that is dragged around). This sets the @@ -498,6 +542,28 @@ elm_slider_indicator_format_set(Evas_Object *obj, const char *indicator) } /** + * Get the format string for the indicator area + * + * The slider may also display a value (the value of the slider) somewhere + * (for example above the slider knob that is dragged around). This sets the + * format string for this. See elm_slider_indicator_format_set() for more + * information on how this works. + * + * @param obj The slider object + * @return The format string for the indicator display. + * + * @ingroup Slider + */ +EAPI const char * +elm_slider_indicator_format_get(const Evas_Object *obj) +{ + ELM_CHECK_WIDTYPE(obj, widtype) NULL; + Widget_Data *wd = elm_widget_data_get(obj); + if (!wd) return NULL; + return wd->indicator; +} + +/** * Set orientation of the slider * * @param obj The slider object @@ -518,6 +584,23 @@ elm_slider_horizontal_set(Evas_Object *obj, Eina_Bool horizontal) } /** + * Get orientation of the slider + * + * @param obj The slider object + * @return If @c EINA_TRUE the slider will be horizontal, else it is + * vertical. + * @ingroup Slider + */ +EAPI Eina_Bool +elm_slider_horizontal_get(const Evas_Object *obj) +{ + ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE; + Widget_Data *wd = elm_widget_data_get(obj); + if (!wd) return EINA_FALSE; + return wd->horizontal; +} + +/** * Set the minimum and maximum values for the slider * * Maximum mut be greater than minimum. @@ -545,6 +628,27 @@ elm_slider_min_max_set(Evas_Object *obj, double min, double max) } /** + * Get the minimum and maximum values for the slider + * + * @param obj The slider object + * @param min The pointer to store minimum value, may be @c NULL. + * @param max The pointer to store maximum value, may be @c NULL. + * + * @ingroup Slider + */ +EAPI void +elm_slider_min_max_get(const Evas_Object *obj, double *min, double *max) +{ + if (min) *min = 0.0; + if (max) *max = 0.0; + ELM_CHECK_WIDTYPE(obj, widtype); + Widget_Data *wd = elm_widget_data_get(obj); + if (!wd) return; + if (min) *min = wd->val_min; + if (max) *max = wd->val_max; +} + +/** * Set the value the slider indicates * * @param obj The slider object @@ -617,6 +721,22 @@ elm_slider_inverted_set(Evas_Object *obj, Eina_Bool inverted) } /** + * Get if the slider display is inverted (backwards) + * + * @param obj The slider object + * @return If @c EINA_TRUE the slider will be inverted. + * @ingroup Slider + */ +EAPI Eina_Bool +elm_slider_inverted_get(const Evas_Object *obj) +{ + ELM_CHECK_WIDTYPE(obj, widtype) EINA_FALSE; + Widget_Data *wd = elm_widget_data_get(obj); + if (!wd) return EINA_FALSE; + return wd->inverted; +} + +/** * Set the format function pointer for the inducator area * * Set the callback function to format the indicator string. diff --git a/src/lib/elm_toggle.c b/src/lib/elm_toggle.c index 17d8962..21532de 100644 --- a/src/lib/elm_toggle.c +++ b/src/lib/elm_toggle.c @@ -232,6 +232,18 @@ elm_toggle_states_labels_set(Evas_Object *obj, const char *onlabel, const char * } EAPI void +elm_toggle_states_labels_get(const Evas_Object *obj, const char **onlabel, const char **offlabel) +{ + if (onlabel) *onlabel = NULL; + if (offlabel) *offlabel = NULL; + ELM_CHECK_WIDTYPE(obj, widtype); + Widget_Data *wd = elm_widget_data_get(obj); + if (!wd) return; + if (onlabel) *onlabel = wd->ontext; + if (offlabel) *offlabel = wd->offtext; +} + +EAPI void elm_toggle_state_set(Evas_Object *obj, Eina_Bool state) { ELM_CHECK_WIDTYPE(obj, widtype);