summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2019-12-02 16:25:36 +0100
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-12-02 17:03:06 +0100
commit5766d172cbf8befa9dea0e9f31a14bde9d278e21 (patch)
treecaf4d7cd90b7c00125b88fd4d6e2f04529480588
parent3ee12d7cc651e0cea851b175c62773cb86c09ff4 (diff)
introduce efl_ui_{pager/scroller}devs/bu5hm4n/work_spotlight2
They are just helpers, so a user does not need to handcreate spotlight managers. This also leaves us the possibility of letting spotlight_managers beeing @beta. ref T7991 Differential Revision: https://phab.enlightenment.org/D10773
-rw-r--r--src/bin/elementary/test_ui_spotlight.c8
-rw-r--r--src/lib/elementary/Efl_Ui.h2
-rw-r--r--src/lib/elementary/efl_ui_pager.c27
-rw-r--r--src/lib/elementary/efl_ui_pager.eo10
-rw-r--r--src/lib/elementary/efl_ui_stack.c27
-rw-r--r--src/lib/elementary/efl_ui_stack.eo10
-rw-r--r--src/lib/elementary/meson.build4
-rw-r--r--src/tests/elementary/spec/efl_test_basics.c4
8 files changed, 85 insertions, 7 deletions
diff --git a/src/bin/elementary/test_ui_spotlight.c b/src/bin/elementary/test_ui_spotlight.c
index 281b55e..f38dfca 100644
--- a/src/bin/elementary/test_ui_spotlight.c
+++ b/src/bin/elementary/test_ui_spotlight.c
@@ -881,12 +881,10 @@ test_ui_spotlight_stack(void *data EINA_UNUSED,
881 efl_file_load(efl_added), 881 efl_file_load(efl_added),
882 efl_content_set(efl_part(panes, "second"), efl_added)); 882 efl_content_set(efl_part(panes, "second"), efl_added));
883 883
884 spotlight = efl_add(EFL_UI_SPOTLIGHT_CONTAINER_CLASS, layout, 884 spotlight = efl_add(EFL_UI_STACK_CLASS, layout,
885 efl_content_set(efl_part(layout, "pager"), efl_added), 885 efl_content_set(efl_part(layout, "pager"), efl_added),
886 efl_ui_spotlight_size_set(efl_added, EINA_SIZE2D(200, 300))); 886 efl_ui_spotlight_size_set(efl_added, EINA_SIZE2D(200, 300)));
887 887
888 efl_ui_spotlight_manager_set(spotlight, efl_new(EFL_UI_SPOTLIGHT_MANAGER_STACK_CLASS));
889
890 efl_add(EFL_UI_BUTTON_CLASS, layout, 888 efl_add(EFL_UI_BUTTON_CLASS, layout,
891 efl_text_set(efl_added, "Pop"), 889 efl_text_set(efl_added, "Pop"),
892 efl_event_callback_add(efl_added, 890 efl_event_callback_add(efl_added,
@@ -1073,12 +1071,10 @@ test_ui_spotlight_scroll(void *data EINA_UNUSED,
1073 efl_file_load(efl_added), 1071 efl_file_load(efl_added),
1074 efl_content_set(efl_part(panes, "second"), efl_added)); 1072 efl_content_set(efl_part(panes, "second"), efl_added));
1075 1073
1076 spotlight = efl_add(EFL_UI_SPOTLIGHT_CONTAINER_CLASS, layout, 1074 spotlight = efl_add(EFL_UI_PAGER_CLASS, layout,
1077 efl_content_set(efl_part(layout, "pager"), efl_added), 1075 efl_content_set(efl_part(layout, "pager"), efl_added),
1078 efl_ui_spotlight_size_set(efl_added, EINA_SIZE2D(200, 300))); 1076 efl_ui_spotlight_size_set(efl_added, EINA_SIZE2D(200, 300)));
1079 1077
1080 efl_ui_spotlight_manager_set(spotlight, efl_new(EFL_UI_SPOTLIGHT_MANAGER_SCROLL_CLASS));
1081
1082 efl_add(EFL_UI_BUTTON_CLASS, layout, 1078 efl_add(EFL_UI_BUTTON_CLASS, layout,
1083 efl_text_set(efl_added, "Prev"), 1079 efl_text_set(efl_added, "Prev"),
1084 efl_event_callback_add(efl_added, 1080 efl_event_callback_add(efl_added,
diff --git a/src/lib/elementary/Efl_Ui.h b/src/lib/elementary/Efl_Ui.h
index b3b07b5..9bcac0b 100644
--- a/src/lib/elementary/Efl_Ui.h
+++ b/src/lib/elementary/Efl_Ui.h
@@ -273,6 +273,8 @@ typedef Eo Efl_Ui_Spotlight_Indicator;
273# include <efl_ui_spotlight_manager_scroll.eo.h> 273# include <efl_ui_spotlight_manager_scroll.eo.h>
274# include <efl_ui_spotlight_manager_stack.eo.h> 274# include <efl_ui_spotlight_manager_stack.eo.h>
275# include <efl_ui_spotlight_util.eo.h> 275# include <efl_ui_spotlight_util.eo.h>
276# include <efl_ui_stack.eo.h>
277# include <efl_ui_pager.eo.h>
276 278
277# include <efl_ui_navigation_bar.eo.h> 279# include <efl_ui_navigation_bar.eo.h>
278# include <efl_ui_navigation_bar_part.eo.h> 280# include <efl_ui_navigation_bar_part.eo.h>
diff --git a/src/lib/elementary/efl_ui_pager.c b/src/lib/elementary/efl_ui_pager.c
new file mode 100644
index 0000000..8ac5a42
--- /dev/null
+++ b/src/lib/elementary/efl_ui_pager.c
@@ -0,0 +1,27 @@
1#ifdef HAVE_CONFIG_H
2# include "elementary_config.h"
3#endif
4
5#include <Efl_Ui.h>
6#include "elm_priv.h"
7
8#define MY_CLASS EFL_UI_PAGER_CLASS
9
10typedef struct {
11
12} Efl_Ui_Pager_Data;
13
14EOLIAN static Efl_Object *
15_efl_ui_pager_efl_object_constructor(Eo *obj, Efl_Ui_Pager_Data *sd EINA_UNUSED)
16{
17 Eo *scroller;
18
19 obj = efl_constructor(efl_super(obj, MY_CLASS));
20
21 scroller = efl_new(EFL_UI_SPOTLIGHT_MANAGER_SCROLL_CLASS);
22 efl_ui_spotlight_manager_set(obj, scroller);
23
24 return obj;
25}
26
27#include "efl_ui_pager.eo.c"
diff --git a/src/lib/elementary/efl_ui_pager.eo b/src/lib/elementary/efl_ui_pager.eo
new file mode 100644
index 0000000..0884092
--- /dev/null
+++ b/src/lib/elementary/efl_ui_pager.eo
@@ -0,0 +1,10 @@
1class @beta Efl.Ui.Pager extends Efl.Ui.Spotlight.Container
2{
3 [[A spotlight with predefined @Efl.Ui.Spotlight.Container.spotlight_manager
4
5 The container will slide in the content sideways, the old content will slide out.
6 ]]
7 implements {
8 Efl.Object.constructor;
9 }
10}
diff --git a/src/lib/elementary/efl_ui_stack.c b/src/lib/elementary/efl_ui_stack.c
new file mode 100644
index 0000000..e1769b7
--- /dev/null
+++ b/src/lib/elementary/efl_ui_stack.c
@@ -0,0 +1,27 @@
1#ifdef HAVE_CONFIG_H
2# include "elementary_config.h"
3#endif
4
5#include <Efl_Ui.h>
6#include "elm_priv.h"
7
8#define MY_CLASS EFL_UI_STACK_CLASS
9
10typedef struct {
11
12} Efl_Ui_Stack_Data;
13
14EOLIAN static Efl_Object *
15_efl_ui_stack_efl_object_constructor(Eo *obj, Efl_Ui_Stack_Data *sd EINA_UNUSED)
16{
17 Eo *stack;
18
19 obj = efl_constructor(efl_super(obj, MY_CLASS));
20
21 stack = efl_new(EFL_UI_SPOTLIGHT_MANAGER_STACK_CLASS);
22 efl_ui_spotlight_manager_set(obj, stack);
23
24 return obj;
25}
26
27#include "efl_ui_stack.eo.c"
diff --git a/src/lib/elementary/efl_ui_stack.eo b/src/lib/elementary/efl_ui_stack.eo
new file mode 100644
index 0000000..bdaaeed
--- /dev/null
+++ b/src/lib/elementary/efl_ui_stack.eo
@@ -0,0 +1,10 @@
1class @beta Efl.Ui.Stack extends Efl.Ui.Spotlight.Container
2{
3 [[A spotlight with predefined @Efl.Ui.Spotlight.Container.spotlight_manager
4
5 The container will alpha-blend the new content over the old content.
6 ]]
7 implements {
8 Efl.Object.constructor;
9 }
10}
diff --git a/src/lib/elementary/meson.build b/src/lib/elementary/meson.build
index e9aaa55..cd88cce 100644
--- a/src/lib/elementary/meson.build
+++ b/src/lib/elementary/meson.build
@@ -188,6 +188,8 @@ pub_eo_files = [
188 'efl_ui_collection_view.eo', 188 'efl_ui_collection_view.eo',
189 'efl_ui_collection_view_focus_manager.eo', 189 'efl_ui_collection_view_focus_manager.eo',
190 'efl_ui_grid_view.eo', 190 'efl_ui_grid_view.eo',
191 'efl_ui_pager.eo',
192 'efl_ui_stack.eo',
191] 193]
192 194
193foreach eo_file : pub_eo_files 195foreach eo_file : pub_eo_files
@@ -944,6 +946,8 @@ elementary_src = [
944 'efl_ui_select_model.c', 946 'efl_ui_select_model.c',
945 'efl_ui_view_model.c', 947 'efl_ui_view_model.c',
946 'efl_ui_collection_view.c', 948 'efl_ui_collection_view.c',
949 'efl_ui_pager.c',
950 'efl_ui_stack.c'
947] 951]
948 952
949elementary_deps = [emile, eo, efl, edje, ethumb, ethumb_client, emotion, ecore_imf, ecore_con, eldbus, efreet, efreet_mime, efreet_trash, eio, atspi, dl, intl] 953elementary_deps = [emile, eo, efl, edje, ethumb, ethumb_client, emotion, ecore_imf, ecore_con, eldbus, efreet, efreet_mime, efreet_trash, eio, atspi, dl, intl]
diff --git a/src/tests/elementary/spec/efl_test_basics.c b/src/tests/elementary/spec/efl_test_basics.c
index 1db6a17..c40ffcd 100644
--- a/src/tests/elementary/spec/efl_test_basics.c
+++ b/src/tests/elementary/spec/efl_test_basics.c
@@ -46,7 +46,9 @@
46 "Efl.Ui.Relative_Container", 46 "Efl.Ui.Relative_Container",
47 "Efl.Ui.Animation_View", 47 "Efl.Ui.Animation_View",
48 "Efl.Ui.Table", 48 "Efl.Ui.Table",
49 "Efl.Ui.Flip" 49 "Efl.Ui.Flip",
50 "Efl.Ui.Stack",
51 "Efl.Ui.Pager"
50 ], 52 ],
51 "custom-mapping" : { 53 "custom-mapping" : {
52 "Efl.Ui.Grid" : "EFL_UI_GRID_DEFAULT_ITEM_CLASS", 54 "Efl.Ui.Grid" : "EFL_UI_GRID_DEFAULT_ITEM_CLASS",