summaryrefslogtreecommitdiff
path: root/src/lib/elementary/efl_ui_separator.c
blob: 887cfb3c40502e25ba91d18de2a1ed991dc47733 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#ifdef HAVE_CONFIG_H
# include "elementary_config.h"
#endif

#include <Efl_Ui.h>
#include "elm_priv.h"

typedef struct {
   Efl_Ui_Layout_Orientation dir;
} Efl_Ui_Separator_Data;

#define MY_CLASS      EFL_UI_SEPARATOR_CLASS


EOLIAN static Efl_Object*
_efl_ui_separator_efl_object_constructor(Eo *obj, Efl_Ui_Separator_Data *pd EINA_UNUSED)
{
   if (!elm_widget_theme_klass_get(obj))
     elm_widget_theme_klass_set(obj, "separator");
   return efl_constructor(efl_super(obj, MY_CLASS));
}

EOLIAN static void
_efl_ui_separator_efl_ui_layout_orientable_orientation_set(Eo *obj EINA_UNUSED, Efl_Ui_Separator_Data *pd, Efl_Ui_Layout_Orientation dir)
{
   pd->dir = dir;
}

EOLIAN static Efl_Ui_Layout_Orientation
_efl_ui_separator_efl_ui_layout_orientable_orientation_get(const Eo *ob EINA_UNUSED, Efl_Ui_Separator_Data *pd)
{
   return pd->dir;
}

EOLIAN static Eina_Error
_efl_ui_separator_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Separator_Data *pd)
{
   if (efl_ui_layout_orientation_is_horizontal(pd->dir, EINA_TRUE))
     elm_widget_theme_element_set(obj, "horizontal");
   else
     elm_widget_theme_element_set(obj, "vertical");
   return efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
}


#include "efl_ui_separator.eo.c"