From: Mike McCormack Date: Tue, 15 Nov 2011 05:53:11 +0000 (+0900) Subject: Add ABI compatibility code for the toggle control X-Git-Tag: REBUILDD-ARMEL-68411~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1ae9c746cbbd8af54f3437c3ca80a8f406caeb7a;p=framework%2Fuifw%2Felementary.git Add ABI compatibility code for the toggle control --- diff --git a/src/lib/Elementary.h.in b/src/lib/Elementary.h.in index 9131190..8ced6f0 100644 --- a/src/lib/Elementary.h.in +++ b/src/lib/Elementary.h.in @@ -7711,152 +7711,6 @@ extern "C" { */ /** - * @defgroup Toggle Toggle - * - * @image html img/widget/toggle/preview-00.png - * @image latex img/widget/toggle/preview-00.eps - * - * @brief A toggle is a slider which can be used to toggle between - * two values. It has two states: on and off. - * - * This widget is deprecated. Please use elm_check_add() instead using the - * toggle style like: - * - * @code - * obj = elm_check_add(parent); - * elm_object_style_set(obj, "toggle"); - * elm_object_text_part_set(obj, "on", "ON"); - * elm_object_text_part_set(obj, "off", "OFF"); - * @endcode - * - * Signals that you can add callbacks for are: - * @li "changed" - Whenever the toggle value has been changed. Is not called - * until the toggle is released by the cursor (assuming it - * has been triggered by the cursor in the first place). - * - * @ref tutorial_toggle show how to use a toggle. - * @{ - */ - /** - * @brief Add a toggle to @p parent. - * - * @param parent The parent object - * - * @return The toggle object - */ - EINA_DEPRECATED EAPI Evas_Object *elm_toggle_add(Evas_Object *parent) EINA_ARG_NONNULL(1); - /** - * @brief Sets the label to be displayed with the toggle. - * - * @param obj The toggle object - * @param label The label to be displayed - * - * @deprecated use elm_object_text_set() instead. - */ - EINA_DEPRECATED EAPI void elm_toggle_label_set(Evas_Object *obj, const char *label) EINA_ARG_NONNULL(1); - /** - * @brief Gets the label of the toggle - * - * @param obj toggle object - * @return The label of the toggle - * - * @deprecated use elm_object_text_get() instead. - */ - EINA_DEPRECATED EAPI const char *elm_toggle_label_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - /** - * @brief Set the icon used for the toggle - * - * @param obj The toggle object - * @param icon The icon object for the button - * - * Once the icon object is set, a previously set one will be deleted - * If you want to keep that old content object, use the - * elm_toggle_icon_unset() function. - * - * @deprecated use elm_object_content_set() instead. - */ - EINA_DEPRECATED EAPI void elm_toggle_icon_set(Evas_Object *obj, Evas_Object *icon) EINA_ARG_NONNULL(1); - /** - * @brief Get the icon used for the toggle - * - * @param obj The toggle object - * @return The icon object that is being used - * - * Return the icon object which is set for this widget. - * - * @see elm_toggle_icon_set() - * - * @deprecated use elm_object_content_get() instead. - */ - EINA_DEPRECATED EAPI Evas_Object *elm_toggle_icon_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - /** - * @brief Unset the icon used for the toggle - * - * @param obj The toggle object - * @return The icon object that was being used - * - * Unparent and return the icon object which was set for this widget. - * - * @see elm_toggle_icon_set() - * - * @deprecated use elm_object_content_unset() instead. - */ - EINA_DEPRECATED EAPI Evas_Object *elm_toggle_icon_unset(Evas_Object *obj) EINA_ARG_NONNULL(1); - /** - * @brief Sets the labels to be associated with the on and off states of the toggle. - * - * @param obj The toggle object - * @param onlabel The label displayed when the toggle is in the "on" state - * @param offlabel The label displayed when the toggle is in the "off" state - * - * @deprecated use elm_object_text_part_set() for "on" and "off" parts - * instead. - */ - EINA_DEPRECATED EAPI void elm_toggle_states_labels_set(Evas_Object *obj, const char *onlabel, const char *offlabel) EINA_ARG_NONNULL(1); - /** - * @brief Gets the labels associated with the on and off states of the - * toggle. - * - * @param obj The toggle object - * @param onlabel A char** to place the onlabel of @p obj into - * @param offlabel A char** to place the offlabel of @p obj into - * - * @deprecated use elm_object_text_part_get() for "on" and "off" parts - * instead. - */ - EINA_DEPRECATED EAPI void elm_toggle_states_labels_get(const Evas_Object *obj, const char **onlabel, const char **offlabel) EINA_ARG_NONNULL(1); - /** - * @brief Sets the state of the toggle to @p state. - * - * @param obj The toggle object - * @param state The state of @p obj - * - * @deprecated use elm_check_state_set() instead. - */ - EINA_DEPRECATED EAPI void elm_toggle_state_set(Evas_Object *obj, Eina_Bool state) EINA_ARG_NONNULL(1); - /** - * @brief Gets the state of the toggle to @p state. - * - * @param obj The toggle object - * @return The state of @p obj - * - * @deprecated use elm_check_state_get() instead. - */ - EINA_DEPRECATED EAPI Eina_Bool elm_toggle_state_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); - /** - * @brief Sets the state pointer of the toggle to @p statep. - * - * @param obj The toggle object - * @param statep The state pointer of @p obj - * - * @deprecated use elm_check_state_pointer_set() instead. - */ - EINA_DEPRECATED EAPI void elm_toggle_state_pointer_set(Evas_Object *obj, Eina_Bool *statep) EINA_ARG_NONNULL(1); - /** - * @} - */ - - /** * @defgroup Frame Frame * * @image html img/widget/frame/preview-00.png @@ -19901,6 +19755,71 @@ extern "C" { * @} */ + /* compatibility code for toggle controls */ + + EINA_DEPRECATED EAPI extern inline Evas_Object *elm_toggle_add(Evas_Object *parent) EINA_ARG_NONNULL(1) + { + Evas_Object *obj; + + obj = elm_check_add(parent); + elm_object_style_set(obj, "toggle"); + elm_object_text_part_set(obj, "on", "ON"); + elm_object_text_part_set(obj, "off", "OFF"); + return obj; + } + + EINA_DEPRECATED EAPI extern inline void elm_toggle_label_set(Evas_Object *obj, const char *label) EINA_ARG_NONNULL(1) + { + elm_object_text_set(obj, label); + } + + EINA_DEPRECATED EAPI extern inline const char *elm_toggle_label_get(const Evas_Object *obj) EINA_ARG_NONNULL(1) + { + return elm_object_text_get(obj); + } + + EINA_DEPRECATED EAPI extern inline void elm_toggle_icon_set(Evas_Object *obj, Evas_Object *icon) EINA_ARG_NONNULL(1) + { + elm_object_content_set(obj, icon); + } + + EINA_DEPRECATED EAPI extern inline Evas_Object *elm_toggle_icon_get(const Evas_Object *obj) EINA_ARG_NONNULL(1) + { + return elm_object_content_get(obj); + } + + EINA_DEPRECATED EAPI extern inline Evas_Object *elm_toggle_icon_unset(Evas_Object *obj) EINA_ARG_NONNULL(1) + { + return elm_object_content_unset(obj); + } + + EINA_DEPRECATED EAPI extern inline void elm_toggle_states_labels_set(Evas_Object *obj, const char *onlabel, const char *offlabel) EINA_ARG_NONNULL(1) + { + elm_object_text_part_set(obj, "on", onlabel); + elm_object_text_part_set(obj, "off", offlabel); + } + + EINA_DEPRECATED EAPI extern inline void elm_toggle_states_labels_get(const Evas_Object *obj, const char **onlabel, const char **offlabel) EINA_ARG_NONNULL(1) + { + if (onlabel) *onlabel = elm_object_text_part_get(obj, "on"); + if (offlabel) *offlabel = elm_object_text_part_get(obj, "off"); + } + + EINA_DEPRECATED EAPI extern inline void elm_toggle_state_set(Evas_Object *obj, Eina_Bool state) EINA_ARG_NONNULL(1) + { + elm_check_state_set(obj, state); + } + + EINA_DEPRECATED EAPI extern inline Eina_Bool elm_toggle_state_get(const Evas_Object *obj) EINA_ARG_NONNULL(1) + { + return elm_check_state_get(obj); + } + + EINA_DEPRECATED EAPI extern inline void elm_toggle_state_pointer_set(Evas_Object *obj, Eina_Bool *statep) EINA_ARG_NONNULL(1) + { + elm_check_state_pointer_set(obj, statep); + } + /** * @defgroup Radio Radio *