summaryrefslogtreecommitdiff
path: root/src/lib/elementary/efl_ui_navigation_layout.c
diff options
context:
space:
mode:
authorJaehyun Cho <jae_hyun.cho@samsung.com>2018-04-12 21:30:05 +0900
committerJaehyun Cho <jae_hyun.cho@samsung.com>2018-04-19 23:40:01 +0900
commit7e8722be00f9ce7d1d9f5b43c622fb71baf2fe82 (patch)
tree0f14e8d0bb8e56fca6499688839d7b043a65ca87 /src/lib/elementary/efl_ui_navigation_layout.c
parentab4fa83f62ea8f23e137bd6f245502c5c6cdaaa0 (diff)
efl_ui_navigation_layout: Add Efl.Ui.Navigation_Layout class
Efl.Ui.Navigation_Layout is a widget which provides a layout form useful for navigation.
Diffstat (limited to 'src/lib/elementary/efl_ui_navigation_layout.c')
-rw-r--r--src/lib/elementary/efl_ui_navigation_layout.c59
1 files changed, 59 insertions, 0 deletions
diff --git a/src/lib/elementary/efl_ui_navigation_layout.c b/src/lib/elementary/efl_ui_navigation_layout.c
new file mode 100644
index 0000000..3d280dc
--- /dev/null
+++ b/src/lib/elementary/efl_ui_navigation_layout.c
@@ -0,0 +1,59 @@
1#ifdef HAVE_CONFIG_H
2# include "elementary_config.h"
3#endif
4
5#include <Elementary.h>
6
7#include "elm_priv.h"
8#include "efl_ui_navigation_layout_private.h"
9#include "elm_part_helper.h"
10
11#define MY_CLASS EFL_UI_NAVIGATION_LAYOUT_CLASS
12#define MY_CLASS_NAME "Efl.Ui.Navigation_Layout"
13
14EOLIAN static void
15_efl_ui_navigation_layout_bar_set(Eo *obj, Efl_Ui_Navigation_Layout_Data *pd, Efl_Ui_Layout *bar)
16{
17 EINA_SAFETY_ON_FALSE_RETURN(efl_isa(bar, EFL_UI_LAYOUT_CLASS));
18
19 efl_content_set(efl_part(obj, "bar"), bar);
20 pd->bar = bar;
21}
22
23EOLIAN static Efl_Ui_Layout *
24_efl_ui_navigation_layout_bar_get(const Eo *obj EINA_UNUSED, Efl_Ui_Navigation_Layout_Data *pd)
25{
26 return pd->bar;
27}
28
29EOLIAN static Eo *
30_efl_ui_navigation_layout_efl_object_constructor(Eo *obj, Efl_Ui_Navigation_Layout_Data *pd EINA_UNUSED)
31{
32 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL);
33
34 if (!elm_widget_theme_klass_get(obj))
35 elm_widget_theme_klass_set(obj, "navigation_layout");
36 obj = efl_constructor(efl_super(obj, MY_CLASS));
37 efl_canvas_object_type_set(obj, MY_CLASS_NAME);
38
39 elm_widget_sub_object_parent_add(obj);
40
41 elm_widget_can_focus_set(obj, EINA_TRUE);
42 if (!elm_widget_theme_object_set(obj, wd->resize_obj,
43 elm_widget_theme_klass_get(obj),
44 elm_widget_theme_element_get(obj),
45 elm_widget_theme_style_get(obj)))
46 CRI("Failed to set layout!");
47
48 return obj;
49}
50
51/* Standard widget overrides */
52ELM_PART_CONTENT_DEFAULT_GET(efl_ui_navigation_layout, "content")
53ELM_PART_CONTENT_DEFAULT_IMPLEMENT(efl_ui_navigation_layout, Efl_Ui_Navigation_Layout_Data)
54
55/* Internal EO APIs and hidden overrides */
56#define EFL_UI_NAVIGATION_LAYOUT_EXTRA_OPS \
57 ELM_PART_CONTENT_DEFAULT_OPS(efl_ui_navigation_layout)
58
59#include "efl_ui_navigation_layout.eo.c"