summaryrefslogtreecommitdiff
path: root/src/lib
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
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')
-rw-r--r--src/lib/elementary/Elementary.h1
-rw-r--r--src/lib/elementary/efl_ui_navigation_layout.c59
-rw-r--r--src/lib/elementary/efl_ui_navigation_layout.eo29
-rw-r--r--src/lib/elementary/efl_ui_navigation_layout_private.h20
4 files changed, 109 insertions, 0 deletions
diff --git a/src/lib/elementary/Elementary.h b/src/lib/elementary/Elementary.h
index 4099503..38b814c 100644
--- a/src/lib/elementary/Elementary.h
+++ b/src/lib/elementary/Elementary.h
@@ -336,6 +336,7 @@ typedef Eo Efl_Ui_Focus_Manager;
336# include <efl_selection.eo.h> 336# include <efl_selection.eo.h>
337# include <efl_ui_dnd.eo.h> 337# include <efl_ui_dnd.eo.h>
338# include <efl_ui_dnd_container.eo.h> 338# include <efl_ui_dnd_container.eo.h>
339# include <efl_ui_navigation_layout.eo.h>
339# include <efl_ui_stack.eo.h> 340# include <efl_ui_stack.eo.h>
340#endif 341#endif
341 342
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"
diff --git a/src/lib/elementary/efl_ui_navigation_layout.eo b/src/lib/elementary/efl_ui_navigation_layout.eo
new file mode 100644
index 0000000..aea7b8b
--- /dev/null
+++ b/src/lib/elementary/efl_ui_navigation_layout.eo
@@ -0,0 +1,29 @@
1class Efl.Ui.Navigation_Layout (Efl.Ui.Layout, Efl.Content)
2{
3 [[Navigation_Layout widget.
4
5 Navigation_Layout widget provides a layout form useful for navigation.
6 Navigation_Layout widget is used to be pushed to or popped from Stack
7 widget(Efl.Ui.Stack class) as a content.
8 ]]
9 methods {
10 @property bar {
11 [[The bar object which is located at the top area as a title.
12 ]]
13 set {
14 }
15 get {
16 }
17 values {
18 value: Efl.Ui.Layout;
19 [[The bar object located at the top area of the Navigation Layout.
20 ]]
21 }
22 }
23 }
24 implements {
25 Efl.Object.constructor;
26 Efl.Content.content { set; get; }
27 Efl.Content.content_unset;
28 }
29}
diff --git a/src/lib/elementary/efl_ui_navigation_layout_private.h b/src/lib/elementary/efl_ui_navigation_layout_private.h
new file mode 100644
index 0000000..47d3e44
--- /dev/null
+++ b/src/lib/elementary/efl_ui_navigation_layout_private.h
@@ -0,0 +1,20 @@
1#ifndef EFL_UI_WIDGET_NAVIGATION_LAYOUT_H
2#define EFL_UI_WIDGET_NAVIGATION_LAYOUT_H
3
4typedef struct _Efl_Ui_Navigation_Layout_Data Efl_Ui_Navigation_Layout_Data;
5struct _Efl_Ui_Navigation_Layout_Data
6{
7 Efl_Ui_Layout *bar;
8};
9
10#define EFL_UI_NAVIGATION_LAYOUT_DATA_GET_OR_RETURN(o, ptr, ...) \
11 Efl_Ui_Navigation_Layout_Data *ptr; \
12 ptr = efl_data_scope_get(o, EFL_UI_NAVIGATION_LAYOUT_CLASS); \
13 if (EINA_UNLIKELY(!ptr)) \
14 { \
15 CRI("no ui navigation layout data for object %p (%s)", \
16 o, evas_object_type_get(o)); \
17 return __VA_ARGS__; \
18 }
19
20#endif