Add ABI compatibility code for the toggle control
authorMike McCormack <mj.mccormack@samsung.com>
Tue, 15 Nov 2011 05:53:11 +0000 (14:53 +0900)
committerMike McCormack <mj.mccormack@samsung.com>
Tue, 15 Nov 2011 06:28:03 +0000 (15:28 +0900)
src/lib/Elementary.h.in

index 9131190..8ced6f0 100644 (file)
@@ -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
     *