fix genlist item signals on prepend
[framework/uifw/elementary.git] / src / lib / elm_separator.c
index 6580bd3..e852d5e 100644 (file)
@@ -1,13 +1,6 @@
 #include <Elementary.h>
 #include "elm_priv.h"
 
-/**
- * @defgroup Separator Separator
- *
- * A separator is a widget that adds a very thin object to separate other objects.
- * A separator can be vertical or horizontal.
- */
-
 typedef struct _Widget_Data Widget_Data;
 
 struct _Widget_Data
@@ -18,6 +11,7 @@ struct _Widget_Data
 
 static const char *widtype = NULL;
 static void _del_hook(Evas_Object *obj);
+static void _mirrored_set(Evas_Object *obj, Eina_Bool rtl);
 static void _theme_hook(Evas_Object *obj);
 static void _sizing_eval(Evas_Object *obj);
 
@@ -30,10 +24,20 @@ _del_hook(Evas_Object *obj)
 }
 
 static void
+_mirrored_set(Evas_Object *obj, Eina_Bool rtl)
+{
+   Widget_Data *wd = elm_widget_data_get(obj);
+   if (!wd) return;
+   edje_object_mirrored_set(wd->sep, rtl);
+}
+
+static void
 _theme_hook(Evas_Object *obj)
 {
    Widget_Data *wd = elm_widget_data_get(obj);
    if (!wd) return;
+   _elm_widget_mirrored_reload(obj);
+   _mirrored_set(obj, elm_widget_mirrored_get(obj));
    if (wd->horizontal)
      _elm_theme_object_set(obj, wd->sep, "separator", "horizontal", elm_widget_style_get(obj));
    else
@@ -54,15 +58,6 @@ _sizing_eval(Evas_Object *obj)
    evas_object_size_hint_align_set(obj, maxw, maxh);
 }
 
-/**
- * Add a separator object to @p parent
- *
- * @param parent The parent object
- *
- * @return The separator object, or NULL upon failure
- *
- * @ingroup Separator
- */
 EAPI Evas_Object *
 elm_separator_add(Evas_Object *parent)
 {
@@ -70,12 +65,8 @@ elm_separator_add(Evas_Object *parent)
    Evas *e;
    Widget_Data *wd;
 
-   EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
+   ELM_WIDGET_STANDARD_SETUP(wd, Widget_Data, parent, e, obj, NULL);
 
-   wd = ELM_NEW(Widget_Data);
-   e = evas_object_evas_get(parent);
-   if (!e) return NULL;
-   obj = elm_widget_add(e);
    ELM_SET_WIDTYPE(widtype, "separator");
    wd->horizontal = EINA_FALSE;
    elm_widget_type_set(obj, "separator");
@@ -88,18 +79,11 @@ elm_separator_add(Evas_Object *parent)
    wd->sep = edje_object_add(e);
    _elm_theme_object_set(obj, wd->sep, "separator", "vertical", "default");
    elm_widget_resize_object_set(obj, wd->sep);
+   _mirrored_set(obj, elm_widget_mirrored_get(obj));
    _sizing_eval(obj);
    return obj;
 }
 
-/**
- * Set the horizontal mode of a separator object
- *
- * @param obj The separator object
- * @param horizontal If true, the separator is horizontal
- *
- * @ingroup Separator
- */
 EAPI void
 elm_separator_horizontal_set(Evas_Object *obj, Eina_Bool horizontal)
 {
@@ -112,14 +96,6 @@ elm_separator_horizontal_set(Evas_Object *obj, Eina_Bool horizontal)
    _theme_hook(obj);
 }
 
-/**
- * Get the horizontal mode of a separator object
- *
- * @param obj The separator object
- * @return If true, the separator is horizontal
- *
- * @ingroup Separator
- */
 EAPI Eina_Bool
 elm_separator_horizontal_get(const Evas_Object *obj)
 {