summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunsuChoi <jsuya.choi@samsung.com>2020-02-18 13:30:12 +0900
committerJunsuChoi <jsuya.choi@samsung.com>2020-03-19 13:17:18 +0900
commit4dff49c026cb9c33cee8003ce1a692b9c809a66a (patch)
tree10b6f1b1d30a10013126217503ec7d79047d5a6e
parentb2e56fd9d8ae8a57a31ea7b27d9679d28d08ad19 (diff)
Introduce Micro controller widget class
-rw-r--r--src/lib/elementary/Efl_Ui.h3
-rw-r--r--src/lib/elementary/efl_ui_mi_controller.c257
-rw-r--r--src/lib/elementary/efl_ui_mi_controller.eo77
-rw-r--r--src/lib/elementary/efl_ui_mi_controller_private.h30
-rw-r--r--src/lib/elementary/efl_ui_mi_rule.c140
-rw-r--r--src/lib/elementary/efl_ui_mi_rule.eo27
-rw-r--r--src/lib/elementary/efl_ui_mi_rule_private.h26
-rw-r--r--src/lib/elementary/efl_ui_mi_state.c107
-rw-r--r--src/lib/elementary/efl_ui_mi_state.eo40
-rw-r--r--src/lib/elementary/efl_ui_mi_state_private.h27
-rw-r--r--src/lib/elementary/meson.build9
-rw-r--r--src/lib/evas/canvas/efl_canvas_vg_object.c13
-rw-r--r--src/lib/evas/canvas/efl_canvas_vg_object.eo7
-rw-r--r--src/static_libs/vg_common/vg_common_json.c1
14 files changed, 764 insertions, 0 deletions
diff --git a/src/lib/elementary/Efl_Ui.h b/src/lib/elementary/Efl_Ui.h
index ffc5fd43c5..ad1b5c235b 100644
--- a/src/lib/elementary/Efl_Ui.h
+++ b/src/lib/elementary/Efl_Ui.h
@@ -227,6 +227,9 @@ typedef void (*Context_Item_Clicked_Cb)(void *data, Eo *obj, void *event_info);
227# include <efl_ui_textbox_async.eo.h> 227# include <efl_ui_textbox_async.eo.h>
228 228
229# include <efl_ui_vg_animation.eo.h> 229# include <efl_ui_vg_animation.eo.h>
230# include <efl_ui_mi_rule.eo.h>
231# include <efl_ui_mi_state.eo.h>
232# include <efl_ui_mi_controller.eo.h>
230# include <efl_ui_clock.eo.h> 233# include <efl_ui_clock.eo.h>
231# include <efl_ui_video.eo.h> 234# include <efl_ui_video.eo.h>
232 235
diff --git a/src/lib/elementary/efl_ui_mi_controller.c b/src/lib/elementary/efl_ui_mi_controller.c
new file mode 100644
index 0000000000..0ccb0260fa
--- /dev/null
+++ b/src/lib/elementary/efl_ui_mi_controller.c
@@ -0,0 +1,257 @@
1#ifdef HAVE_CONFIG_H
2# include "elementary_config.h"
3#endif
4
5#define EFL_ACCESS_OBJECT_PROTECTED
6#define EFL_PART_PROTECTED
7
8#include <Elementary.h>
9
10#include "elm_priv.h"
11#include "efl_ui_mi_state.eo.h"
12#include "efl_ui_mi_controller_private.h"
13//#include "efl_ui_mi_controller_part.eo.h"
14//#include "elm_part_helper.h"
15
16#define MY_CLASS EFL_UI_MI_CONTROLLER_CLASS
17
18#define MY_CLASS_NAME "Efl_Ui_Mi_Controller"
19
20static const char SIG_FOCUSED[] = "focused";
21static const char SIG_UNFOCUSED[] = "unfocused";
22
23/* smart callbacks coming from efl_ui_mi_controller objects: */
24static const Evas_Smart_Cb_Description _smart_callbacks[] = {
25 {SIG_FOCUSED, ""},
26 {SIG_UNFOCUSED, ""},
27 {SIG_WIDGET_LANG_CHANGED, ""}, /**< handled by elm_widget */
28 {NULL, NULL}
29};
30
31EOLIAN static void
32_efl_ui_mi_controller_repeat_mode_set(Eo *obj EINA_UNUSED, Efl_Ui_Mi_Controller_Data *pd, Efl_Ui_Mi_Controller_Repeat_Mode mode)
33{
34}
35
36EOLIAN static Efl_Ui_Mi_Controller_Repeat_Mode
37_efl_ui_mi_controller_repeat_mode_get(const Eo *obj EINA_UNUSED, Efl_Ui_Mi_Controller_Data *pd)
38{
39 return 0;
40}
41
42Eina_Bool
43_efl_ui_mi_controller_trigger(Eo *obj, Efl_Ui_Mi_Controller_Data *pd, const char *start, Eina_Bool animation)
44{
45
46 Efl_Ui_Mi_State *state;
47 Eina_Array_Iterator iter;
48 unsigned int i;
49 const char *_start;
50 const char *_end;
51
52 EINA_ARRAY_ITER_NEXT(pd->states, i, state, iter)
53 {
54 efl_ui_mi_state_sector_get(state, &_start, NULL);
55 if (_start && !strcmp(start, _start))
56 break;
57 }
58
59 pd->cur_state_idx = i;
60 efl_ui_mi_state_sector_get(state, &_start, &_end);
61 if (_start)
62 efl_ui_vg_animation_playing_sector(pd->anim, _start, _end);
63 else
64 ERR("No start point");
65
66 return EINA_FALSE;
67}
68
69Eina_Bool
70_efl_ui_mi_controller_trigger_next(Eo *obj, Efl_Ui_Mi_Controller_Data *pd, Eina_Bool animation)
71{
72 if (!pd->states) return EINA_FALSE;
73
74 int states = eina_array_count_get (pd->states);
75 int cur_idx = 0;
76 if (states < pd->cur_state_idx)
77 cur_idx = pd->cur_state_idx;
78 else
79 cur_idx = pd->cur_state_idx + 1;
80
81
82 Efl_Ui_Mi_State *cur_state = eina_array_data_get (pd->states, cur_idx);
83 if (!cur_state) return EINA_FALSE;
84
85 const char *_start;
86 const char *_end;
87 efl_ui_mi_state_sector_get(cur_state, &_start, &_end);
88
89 if (_start)
90 efl_ui_vg_animation_playing_sector(pd->anim, _start, _end);
91 else
92 ERR("No start point");
93
94 pd->cur_state_idx++;
95 return EINA_TRUE;
96}
97
98Eina_Bool
99_efl_ui_mi_controller_trigger_prev(Eo *obj, Efl_Ui_Mi_Controller_Data *pd, Eina_Bool animation)
100{
101 //change state and play
102 return EINA_FALSE;
103}
104
105EOLIAN static Eo*
106_efl_ui_mi_controller_state_get(const Eo *eo_obj, Efl_Ui_Mi_Controller_Data *pd,
107 const char *state_name)
108{
109 Efl_Ui_Mi_State *state;
110 Eina_Array_Iterator iter;
111 unsigned int i;
112 const char *_name;
113
114 EINA_ARRAY_ITER_NEXT(pd->states, i, state, iter)
115 {
116 efl_ui_mi_state_sector_get(state, &_name, NULL);
117 if (_name && !strcmp(state_name, _name))
118 return state;
119 }
120
121 return NULL;
122}
123
124Eina_Bool
125_efl_ui_mi_controller_state_add(Eo *obj, Efl_Ui_Mi_Controller_Data *pd, Efl_Ui_Mi_State *state)
126{
127
128 if (!state) return EINA_FALSE;
129 if (!pd->states)
130 {
131 pd->states = eina_array_new(sizeof(Efl_Ui_Mi_State*));
132 }
133
134 eina_array_push(pd->states, state);
135 return EINA_FALSE;
136}
137
138
139static void
140_sizing_eval(Eo *obj, void *data)
141{
142 Efl_Ui_Mi_Controller_Data *pd = data;
143 if (!efl_file_loaded_get(pd->anim)) return;
144
145 double hw,hh;
146 efl_gfx_hint_weight_get(obj, &hw, &hh);
147
148 Eina_Size2D size = efl_ui_vg_animation_default_view_size_get(pd->anim);
149
150 Eina_Size2D min = {-1, -1};
151 if (hw == 0) min.w = size.w;
152 if (hh == 0) min.h = size.h;
153 efl_gfx_hint_size_min_set(obj, min);
154}
155
156EOLIAN static Eina_Error
157_efl_ui_mi_controller_efl_file_load(Eo *obj, Efl_Ui_Mi_Controller_Data *pd)
158{
159 Eina_Error err;
160 Eina_Bool ret;
161 const char *file;
162 const char *key;
163
164 if (efl_file_loaded_get(obj)) return 0;
165
166 err = efl_file_load(efl_super(obj, MY_CLASS));
167 if (err) return err;
168
169 file = efl_file_get(obj);
170 key = efl_file_key_get(obj);
171 ret = efl_file_simple_load(pd->anim, file, key);
172 if (!ret)
173 {
174 ERR("Efl.Ui.Mi_Controller File load fail : %s\n", file);
175 efl_file_unload(obj);
176 return eina_error_get();
177 }
178 _sizing_eval(obj, pd);
179
180 return 0;
181}
182
183EOLIAN static void
184_efl_ui_mi_controller_efl_gfx_view_view_size_set(Eo *obj EINA_UNUSED,
185 Efl_Ui_Mi_Controller_Data *pd,
186 Eina_Size2D size)
187{
188 efl_gfx_view_size_set(pd->anim, size);
189}
190
191EOLIAN Eina_Size2D
192_efl_ui_mi_controller_efl_gfx_view_view_size_get(const Eo *obj EINA_UNUSED,
193 Efl_Ui_Mi_Controller_Data *pd)
194{
195 Eina_Size2D view_size = efl_gfx_view_size_get(pd->anim);
196
197 return view_size;
198}
199static void
200_size_hint_event_cb(void *data, const Efl_Event *event)
201{
202 _sizing_eval(event->object, data);
203}
204
205EOLIAN static void
206_efl_ui_mi_controller_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Mi_Controller_Data *pd)
207{
208 efl_canvas_group_add(efl_super(obj, MY_CLASS));
209 elm_widget_sub_object_parent_add(obj);
210
211 pd->anim = efl_add(EFL_UI_VG_ANIMATION_CLASS, obj);
212 elm_widget_resize_object_set(obj, pd->anim);
213
214 efl_key_data_set(obj, "anim", pd->anim);
215
216 efl_event_callback_add(obj, EFL_GFX_ENTITY_EVENT_HINTS_CHANGED, _size_hint_event_cb, pd);
217}
218
219EOLIAN static void
220_efl_ui_mi_controller_efl_canvas_group_group_del(Eo *obj, Efl_Ui_Mi_Controller_Data *pd EINA_UNUSED)
221{
222 efl_canvas_group_del(efl_super(obj, MY_CLASS));
223
224 if (pd->states) eina_array_free(pd->states);
225}
226
227EOLIAN static void
228_efl_ui_mi_controller_efl_object_destructor(Eo *obj,
229 Efl_Ui_Mi_Controller_Data *pd EINA_UNUSED)
230{
231 efl_destructor(efl_super(obj, MY_CLASS));
232}
233
234EOLIAN static Eo *
235_efl_ui_mi_controller_efl_object_constructor(Eo *obj,
236 Efl_Ui_Mi_Controller_Data *pd EINA_UNUSED)
237{
238 obj = efl_constructor(efl_super(obj, MY_CLASS));
239 evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
240
241 return obj;
242}
243
244/* Efl.Part begin */
245/*ELM_PART_OVERRIDE_CONTENT_SET(efl_ui_mi_controller, EFL_UI_MI_CONTROLLER, Efl_Ui_Mi_Controller_Data)
246ELM_PART_OVERRIDE_CONTENT_GET(efl_ui_mi_controller, EFL_UI_MI_CONTROLLER, Efl_Ui_Mi_Controller_Data)
247ELM_PART_OVERRIDE_CONTENT_UNSET(efl_ui_mi_controller, EFL_UI_MI_CONTROLLER, Efl_Ui_Mi_Controller_Data)
248#include "efl_ui_mi_controller_part.eo.c"*/
249/* Efl.Part end */
250
251/* Internal EO APIs and hidden overrides */
252
253
254#define EFL_UI_MI_CONTROLLER_EXTRA_OPS \
255 EFL_CANVAS_GROUP_ADD_DEL_OPS(efl_ui_mi_controller)
256
257#include "efl_ui_mi_controller.eo.c"
diff --git a/src/lib/elementary/efl_ui_mi_controller.eo b/src/lib/elementary/efl_ui_mi_controller.eo
new file mode 100644
index 0000000000..a428e6ba4e
--- /dev/null
+++ b/src/lib/elementary/efl_ui_mi_controller.eo
@@ -0,0 +1,77 @@
1enum Efl.Ui.Mi_Controller.Repeat_Mode {
2 none,
3 loop,
4 once,
5 play_rewind
6}
7
8
9class @beta Efl.Ui.Mi_Controller extends Efl.Ui.Widget implements Efl.File, Efl.Gfx.View
10{
11 [[ Micro controller Widget class
12 @since 1.24
13 ]]
14 event_c_prefix: efl_ui_mi_controller;
15 methods {
16 @property repeat_mode {
17 [[ repeat mode , normal/ play_rewind /loop
18 ]]
19 set {
20 }
21 get {
22 }
23 values {
24 mode: Efl.Ui.Mi_Controller.Repeat_Mode; [[mode]]
25 }
26 }
27 @property state {
28 [[ ]]
29 get {
30 }
31 keys {
32 state_name: string;
33 }
34 values {
35 state: Efl.Object;
36 }
37
38 }
39 //temporary
40 state_add {
41 [[ ]]
42 params {
43 @in state: Efl.Ui.Mi_State;
44 }
45 return: bool; [[$true when it's successful. $false otherwise.]]
46 }
47 //
48 trigger {
49 [[ ]]
50 params {
51 @in state: string; [[ ]]
52 @in animation: bool; [[ ]]
53 }
54 return: bool; [[$true when it's successful. $false otherwise.]]
55 }
56 trigger_next {
57 [[ ]]
58 params {
59 @in animation: bool; [[ ]]
60 }
61 return: bool; [[$true when it's successful. $false otherwise.]]
62 }
63 trigger_prev {
64 [[ ]]
65 params {
66 @in animation: bool; [[ ]]
67 }
68 return: bool; [[$true when it's successful. $false otherwise.]]
69 }
70 }
71 implements {
72 Efl.Object.constructor;
73 Efl.Object.destructor;
74 Efl.File.load;
75 Efl.Gfx.View.view_size { set; get; }
76 }
77}
diff --git a/src/lib/elementary/efl_ui_mi_controller_private.h b/src/lib/elementary/efl_ui_mi_controller_private.h
new file mode 100644
index 0000000000..7ab81a573a
--- /dev/null
+++ b/src/lib/elementary/efl_ui_mi_controller_private.h
@@ -0,0 +1,30 @@
1#ifndef EFL_UI_MI_CONTROLLER_PRIVATE_H
2#define EFL_UI_MI_CONTROLLER_PRIVATE_H
3
4#include "Elementary.h"
5#include "efl_ui_mi_controller.eo.h"
6
7typedef struct _Efl_Ui_Mi_Controller_Data Efl_Ui_Mi_Controller_Data;
8
9struct _Efl_Ui_Mi_Controller_Data
10{
11 Efl_Ui_Vg_Animation* anim;
12 int cur_state_idx;
13 Eina_Array* states;
14 //Eina_Inarray *states; //array of Efl_Ui_Mi_State*;
15
16};
17
18#define EFL_UI_MI_CONTROLLER_DATA_GET(o, sd) \
19 Efl_Ui_Mi_Controller_Data * sd = efl_data_scope_safe_get(o, EFL_UI_MI_CONTROLLER_CLASS)
20
21#define EFL_UI_MI_CONTROLLER_DATA_GET_OR_RETURN(o, ptr) \
22 EFL_UI_MI_CONTROLLER_DATA_GET(o, ptr); \
23 if (EINA_UNLIKELY(!ptr)) \
24 { \
25 ERR("No widget data for object %p (%s)", \
26 o, evas_object_type_get(o)); \
27 return; \
28 }
29
30#endif
diff --git a/src/lib/elementary/efl_ui_mi_rule.c b/src/lib/elementary/efl_ui_mi_rule.c
new file mode 100644
index 0000000000..92497fbd96
--- /dev/null
+++ b/src/lib/elementary/efl_ui_mi_rule.c
@@ -0,0 +1,140 @@
1#ifdef HAVE_CONFIG_H
2# include "elementary_config.h"
3#endif
4
5#define EFL_ACCESS_OBJECT_PROTECTED
6#define EFL_PART_PROTECTED
7
8#include <Elementary.h>
9
10#include "elm_priv.h"
11#include "efl_ui_mi_rule_private.h"
12//#include "efl_ui_mi_controller_part.eo.h"
13//#include "elm_part_helper.h"
14
15#define MY_CLASS EFL_UI_MI_RULE_CLASS
16
17#define MY_CLASS_NAME "Efl_Ui_Mi_Rule"
18
19void
20_tb_resize(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
21{
22 int x, y, w,h;
23
24 evas_object_geometry_get(obj, &x, &y, &w, &h);
25 evas_object_move(data, x, y);
26 evas_object_resize(data, w, h);
27 evas_object_color_set(data, 0, 0, 0, 0);
28 evas_object_show(data);
29}
30
31static void
32tap_gesture_cb(void *data , const Efl_Event *ev)
33{
34 Eo* obj = (Eo*)data;
35 Efl_Canvas_Gesture *g = ev->info;
36 switch(efl_gesture_state_get(g))
37 {
38/* case EFL_GESTURE_STATE_STARTED:
39 break;
40 case EFL_GESTURE_STATE_CANCELED:
41 break;*/
42 case EFL_GESTURE_STATE_FINISHED:
43 efl_event_callback_call(obj, EFL_EVENT_GESTURE_TAP, &ev);
44 break;
45 default:
46 break;
47 }
48}
49
50EOLIAN static void
51_efl_ui_mi_rule_keypath_set(Eo *obj EINA_UNUSED, Efl_Ui_Mi_Rule_Data *pd, const char* keypath)
52{
53 Eo *parent;
54 Eo *object = obj;
55 Evas *e = NULL;
56 do
57 {
58 parent = efl_parent_get(object);
59 if (!parent) continue;
60
61 if (efl_class_get(parent) == EFL_UI_MI_CONTROLLER_CLASS)
62 {
63 e = evas_object_evas_get(parent);
64 }
65 object = parent;
66 } while(!e);
67
68 pd->event_rect = evas_object_rectangle_add(e);
69
70 efl_event_callback_add(pd->event_rect, EFL_EVENT_GESTURE_TAP, tap_gesture_cb, obj);
71
72#if DEBUG
73 printf("%s (%p)\n", efl_class_name_get(efl_class_get(parent)), parent);
74#endif
75
76 evas_object_event_callback_add(parent, EVAS_CALLBACK_RESIZE, _tb_resize, pd->event_rect);
77 if (!strcmp(keypath, "*"))
78 {
79 return ;
80 }
81
82 /* tracking keypath object */
83
84 /* Set rect geometry */
85
86
87}
88
89EOLIAN const char*
90_efl_ui_mi_rule_keypath_get(const Eo *obj EINA_UNUSED, Efl_Ui_Mi_Rule_Data *pd)
91{
92 return NULL;
93}
94
95
96EOLIAN static void
97_efl_ui_mi_rule_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Mi_Rule_Data *priv)
98{
99 efl_canvas_group_add(efl_super(obj, MY_CLASS));
100 elm_widget_sub_object_parent_add(obj);
101
102
103}
104
105EOLIAN static void
106_efl_ui_mi_rule_efl_canvas_group_group_del(Eo *obj, Efl_Ui_Mi_Rule_Data *pd EINA_UNUSED)
107{
108 efl_canvas_group_del(efl_super(obj, MY_CLASS));
109}
110
111EOLIAN static void
112_efl_ui_mi_rule_efl_object_destructor(Eo *obj,
113 Efl_Ui_Mi_Rule_Data *pd EINA_UNUSED)
114{
115 efl_destructor(efl_super(obj, MY_CLASS));
116}
117
118EOLIAN static Eo *
119_efl_ui_mi_rule_efl_object_constructor(Eo *obj,
120 Efl_Ui_Mi_Rule_Data *pd EINA_UNUSED)
121{
122 obj = efl_constructor(efl_super(obj, MY_CLASS));
123 //evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
124
125 return obj;
126}
127
128/* Efl.Part begin */
129/*ELM_PART_OVERRIDE_CONTENT_SET(efl_ui_mi_controller, EFL_UI_MI_CONTROLLER, Efl_Ui_Mi_Rule_Data)
130ELM_PART_OVERRIDE_CONTENT_GET(efl_ui_mi_controller, EFL_UI_MI_CONTROLLER, Efl_Ui_Mi_Rule_Data)
131ELM_PART_OVERRIDE_CONTENT_UNSET(efl_ui_mi_controller, EFL_UI_MI_CONTROLLER, Efl_Ui_Mi_Rule_Data)
132#include "efl_ui_mi_controller_part.eo.c"*/
133/* Efl.Part end */
134
135/* Internal EO APIs and hidden overrides */
136
137#define EFL_UI_MI_RULE_EXTRA_OPS \
138 EFL_CANVAS_GROUP_ADD_DEL_OPS(efl_ui_mi_rule)
139
140#include "efl_ui_mi_rule.eo.c"
diff --git a/src/lib/elementary/efl_ui_mi_rule.eo b/src/lib/elementary/efl_ui_mi_rule.eo
new file mode 100644
index 0000000000..339dc52c05
--- /dev/null
+++ b/src/lib/elementary/efl_ui_mi_rule.eo
@@ -0,0 +1,27 @@
1
2class @beta Efl.Ui.Mi_Rule extends Efl.Object implements Efl.Canvas.Gesture_Events
3{
4 [[ Micro Interaction Rule class
5 @since 1.24
6 ]]
7 event_c_prefix: efl_ui_mi_rule;
8 methods {
9 @property keypath {
10 [[
11 ]]
12 set {
13 }
14 get {
15 }
16 values {
17 keypath: string; [[ ]]
18 }
19 }
20 }
21 implements {
22 Efl.Object.constructor;
23 Efl.Object.destructor;
24 }
25 events {
26 }
27}
diff --git a/src/lib/elementary/efl_ui_mi_rule_private.h b/src/lib/elementary/efl_ui_mi_rule_private.h
new file mode 100644
index 0000000000..18de373c36
--- /dev/null
+++ b/src/lib/elementary/efl_ui_mi_rule_private.h
@@ -0,0 +1,26 @@
1#ifndef EFL_UI_MI_RULE_PRIVATE_H
2#define EFL_UI_MI_RULE_PRIVATE_H
3
4#include "Elementary.h"
5#include "efl_ui_mi_rule.eo.h"
6
7typedef struct _Efl_Ui_Mi_Rule_Data Efl_Ui_Mi_Rule_Data;
8
9struct _Efl_Ui_Mi_Rule_Data
10{
11 Evas_Object *event_rect;
12};
13
14#define EFL_UI_MI_RULE_DATA_GET(o, sd) \
15 Efl_Ui_Mi_Rule_Data * sd = efl_data_scope_safe_get(o, EFL_UI_MI_RULE_CLASS)
16
17#define EFL_UI_MI_RULE_DATA_GET_OR_RETURN(o, ptr) \
18 EFL_UI_MI_RULE_DATA_GET(o, ptr); \
19 if (EINA_UNLIKELY(!ptr)) \
20 { \
21 ERR("No widget data for object %p (%s)", \
22 o, evas_object_type_get(o)); \
23 return; \
24 }
25
26#endif
diff --git a/src/lib/elementary/efl_ui_mi_state.c b/src/lib/elementary/efl_ui_mi_state.c
new file mode 100644
index 0000000000..86b149cbfb
--- /dev/null
+++ b/src/lib/elementary/efl_ui_mi_state.c
@@ -0,0 +1,107 @@
1#ifdef HAVE_CONFIG_H
2# include "elementary_config.h"
3#endif
4
5#define EFL_ACCESS_OBJECT_PROTECTED
6#define EFL_PART_PROTECTED
7
8#include <Elementary.h>
9
10#include "elm_priv.h"
11#include "efl_ui_mi_state_private.h"
12//#include "efl_ui_mi_controller_part.eo.h"
13//#include "elm_part_helper.h"
14
15#define MY_CLASS EFL_UI_MI_STATE_CLASS
16
17#define MY_CLASS_NAME "Efl_Ui_Mi_State"
18
19
20EOLIAN static void
21_efl_ui_mi_state_sector_set(Eo *eo_obj, Efl_Ui_Mi_State_Data *pd,
22 const char *start, const char *end)
23{
24 if (!start) return ;
25
26 if (pd->start) free(pd->start);
27 pd->start = strdup(start);
28
29 if (!end) return ;
30
31 if (pd->end) free(pd->end);
32 pd->end = strdup(end);
33
34}
35
36EOLIAN void
37_efl_ui_mi_state_sector_get(const Eo *obj, Efl_Ui_Mi_State_Data *pd, const char **start, const char **end)
38{
39 if (start)
40 *start = pd->start;
41 if (end)
42 *end = pd->end;
43}
44
45EOLIAN void
46_efl_ui_mi_state_rule_set(Eo *obj, Efl_Ui_Mi_State_Data *pd, const char *keypath, Efl_Ui_Mi_Rule *rule)
47{
48
49}
50
51EOLIAN Efl_Ui_Mi_Rule*
52_efl_ui_mi_state_rule_get(const Eo *obj, Efl_Ui_Mi_State_Data *pd, const char *keypath)
53{
54 return 0;
55}
56
57
58EOLIAN static void
59_efl_ui_mi_state_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Mi_State_Data *pd)
60{
61 efl_canvas_group_add(efl_super(obj, MY_CLASS));
62 elm_widget_sub_object_parent_add(obj);
63
64
65 pd->start = NULL;
66 pd->end = NULL;
67}
68
69EOLIAN static void
70_efl_ui_mi_state_efl_canvas_group_group_del(Eo *obj, Efl_Ui_Mi_State_Data *pd EINA_UNUSED)
71{
72 efl_canvas_group_del(efl_super(obj, MY_CLASS));
73
74 if (pd->start) free(pd->start);
75 if (pd->end) free(pd->end);
76}
77
78EOLIAN static void
79_efl_ui_mi_state_efl_object_destructor(Eo *obj,
80 Efl_Ui_Mi_State_Data *pd EINA_UNUSED)
81{
82 efl_destructor(efl_super(obj, MY_CLASS));
83}
84
85EOLIAN static Eo *
86_efl_ui_mi_state_efl_object_constructor(Eo *obj,
87 Efl_Ui_Mi_State_Data *pd EINA_UNUSED)
88{
89 obj = efl_constructor(efl_super(obj, MY_CLASS));
90 //evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
91
92 return obj;
93}
94
95/* Efl.Part begin */
96/*ELM_PART_OVERRIDE_CONTENT_SET(efl_ui_mi_controller, EFL_UI_MI_CONTROLLER, Efl_Ui_Mi_State_Data)
97ELM_PART_OVERRIDE_CONTENT_GET(efl_ui_mi_controller, EFL_UI_MI_CONTROLLER, Efl_Ui_Mi_State_Data)
98ELM_PART_OVERRIDE_CONTENT_UNSET(efl_ui_mi_controller, EFL_UI_MI_CONTROLLER, Efl_Ui_Mi_State_Data)
99#include "efl_ui_mi_controller_part.eo.c"*/
100/* Efl.Part end */
101
102/* Internal EO APIs and hidden overrides */
103
104#define EFL_UI_MI_STATE_EXTRA_OPS \
105 EFL_CANVAS_GROUP_ADD_DEL_OPS(efl_ui_mi_state)
106
107#include "efl_ui_mi_state.eo.c"
diff --git a/src/lib/elementary/efl_ui_mi_state.eo b/src/lib/elementary/efl_ui_mi_state.eo
new file mode 100644
index 0000000000..bfae1273c7
--- /dev/null
+++ b/src/lib/elementary/efl_ui_mi_state.eo
@@ -0,0 +1,40 @@
1
2class @beta Efl.Ui.Mi_State extends Efl.Object
3{
4 [[ Micro Interaction State class
5 @since 1.24
6 ]]
7 event_c_prefix: efl_ui_mi_state;
8 methods {
9 @property sector {
10 [[ sector info
11 ]]
12 set {}
13 get {}
14 values {
15 start: string; [[ The name of start sector ]]
16 end: string; [[ The name of end sector ]]
17 }
18 }
19 @property rule {
20 [[ rule get/set ]]
21 set {}
22 get {}
23 keys {
24 keypath: string; [[ rule_name (keypath) ]]
25 }
26 values {
27 rule: Efl.Ui.Mi_Rule;
28 }
29 }
30 }
31 implements {
32 Efl.Object.constructor;
33 Efl.Object.destructor;
34 }
35 events {
36 trigger : bool;
37 feedback : float;
38 feedback,done : bool;
39 }
40}
diff --git a/src/lib/elementary/efl_ui_mi_state_private.h b/src/lib/elementary/efl_ui_mi_state_private.h
new file mode 100644
index 0000000000..9cc226cdf1
--- /dev/null
+++ b/src/lib/elementary/efl_ui_mi_state_private.h
@@ -0,0 +1,27 @@
1#ifndef EFL_UI_MI_STATE_PRIVATE_H
2#define EFL_UI_MI_STATE_PRIVATE_H
3
4#include "Elementary.h"
5#include "efl_ui_mi_state.eo.h"
6
7typedef struct _Efl_Ui_Mi_State_Data Efl_Ui_Mi_State_Data;
8
9struct _Efl_Ui_Mi_State_Data
10{
11 const char *start;
12 const char *end;
13};
14
15#define EFL_UI_MI_STATE_DATA_GET(o, sd) \
16 Efl_Ui_Mi_State_Data * sd = efl_data_scope_safe_get(o, EFL_UI_MI_STATE_CLASS)
17
18#define EFL_UI_MI_STATE_DATA_GET_OR_RETURN(o, ptr) \
19 EFL_UI_MI_STATE_DATA_GET(o, ptr); \
20 if (EINA_UNLIKELY(!ptr)) \
21 { \
22 ERR("No widget data for object %p (%s)", \
23 o, evas_object_type_get(o)); \
24 return; \
25 }
26
27#endif
diff --git a/src/lib/elementary/meson.build b/src/lib/elementary/meson.build
index 9f58fa2ea9..2c81b98775 100644
--- a/src/lib/elementary/meson.build
+++ b/src/lib/elementary/meson.build
@@ -41,6 +41,9 @@ pub_eo_files = [
41 'efl_ui_widget_scrollable_content.eo', 41 'efl_ui_widget_scrollable_content.eo',
42 'efl_ui_vg_animation.eo', 42 'efl_ui_vg_animation.eo',
43 'efl_ui_vg_animation_part.eo', 43 'efl_ui_vg_animation_part.eo',
44 'efl_ui_mi_controller.eo',
45 'efl_ui_mi_state.eo',
46 'efl_ui_mi_rule.eo',
44 'efl_ui_bg.eo', 47 'efl_ui_bg.eo',
45 'efl_ui_button.eo', 48 'efl_ui_button.eo',
46 'efl_ui_calendar.eo', 49 'efl_ui_calendar.eo',
@@ -301,6 +304,9 @@ elementary_headers_unstable = [
301 'elm_widget_flipselector.h', 304 'elm_widget_flipselector.h',
302 'efl_ui_widget_frame.h', 305 'efl_ui_widget_frame.h',
303 'efl_ui_vg_animation_private.h', 306 'efl_ui_vg_animation_private.h',
307 'efl_ui_mi_controller_private.h',
308 'efl_ui_mi_state_private.h',
309 'efl_ui_mi_rule_private.h',
304 'elm_widget_gengrid.h', 310 'elm_widget_gengrid.h',
305 'elm_widget_genlist.h', 311 'elm_widget_genlist.h',
306 'elm_widget_glview.h', 312 'elm_widget_glview.h',
@@ -731,6 +737,9 @@ elementary_src = [
731 'elc_scrolled_entry.c', 737 'elc_scrolled_entry.c',
732 'elm_access.c', 738 'elm_access.c',
733 'efl_ui_vg_animation.c', 739 'efl_ui_vg_animation.c',
740 'efl_ui_mi_controller.c',
741 'efl_ui_mi_state.c',
742 'efl_ui_mi_rule.c',
734 'elm_actionslider.c', 743 'elm_actionslider.c',
735 'elm_atspi_app_object.c', 744 'elm_atspi_app_object.c',
736 'elm_atspi_bridge.c', 745 'elm_atspi_bridge.c',
diff --git a/src/lib/evas/canvas/efl_canvas_vg_object.c b/src/lib/evas/canvas/efl_canvas_vg_object.c
index 7963776889..1bd1a2602f 100644
--- a/src/lib/evas/canvas/efl_canvas_vg_object.c
+++ b/src/lib/evas/canvas/efl_canvas_vg_object.c
@@ -396,6 +396,7 @@ _efl_canvas_vg_object_efl_object_finalize(Eo *obj, Efl_Canvas_Vg_Object_Data *pd
396 return obj; 396 return obj;
397} 397}
398 398
399
399static void 400static void
400_evas_vg_render(Evas_Object_Protected_Data *obj, Efl_Canvas_Vg_Object_Data *pd, 401_evas_vg_render(Evas_Object_Protected_Data *obj, Efl_Canvas_Vg_Object_Data *pd,
401 void *engine, void *output, void *context, Efl_VG *node, 402 void *engine, void *output, void *context, Efl_VG *node,
@@ -1017,6 +1018,18 @@ _efl_canvas_vg_object_default_size_get(const Eo *eo_obj EINA_UNUSED,
1017 return evas_cache_vg_entry_default_size_get(pd->vg_entry); 1018 return evas_cache_vg_entry_default_size_get(pd->vg_entry);
1018} 1019}
1019 1020
1021EOLIAN Eina_List *
1022_efl_canvas_vg_object_list_by_keypath_get(Eo *obj, Efl_Canvas_Vg_Object_Data *pd, const char *keypath)
1023{
1024
1025 // *
1026
1027
1028
1029 // *path.path
1030 return NULL;
1031}
1032
1020/* the actual api call to add a vector graphic object */ 1033/* the actual api call to add a vector graphic object */
1021EAPI Eo * 1034EAPI Eo *
1022evas_object_vg_add(Evas *e) 1035evas_object_vg_add(Evas *e)
diff --git a/src/lib/evas/canvas/efl_canvas_vg_object.eo b/src/lib/evas/canvas/efl_canvas_vg_object.eo
index 51eded82d5..7c3f71c221 100644
--- a/src/lib/evas/canvas/efl_canvas_vg_object.eo
+++ b/src/lib/evas/canvas/efl_canvas_vg_object.eo
@@ -74,6 +74,13 @@ class @beta Efl.Canvas.Vg.Object extends Efl.Canvas.Object implements Efl.File,
74 size: Eina.Size2D; 74 size: Eina.Size2D;
75 } 75 }
76 } 76 }
77 list_by_keypath_get {
78 [[ ]]
79 params {
80 keypath: string;
81 }
82 return: list<Efl.Object>;
83 }
77 } 84 }
78 implements { 85 implements {
79 Efl.Object.constructor; 86 Efl.Object.constructor;
diff --git a/src/static_libs/vg_common/vg_common_json.c b/src/static_libs/vg_common/vg_common_json.c
index a36c045c75..b9b2900ff8 100644
--- a/src/static_libs/vg_common/vg_common_json.c
+++ b/src/static_libs/vg_common/vg_common_json.c
@@ -359,6 +359,7 @@ _construct_masks(Efl_Canvas_Vg_Container *mtarget, LOTMask *masks, unsigned int
359 for (int i = 0; i < depth; i++) printf(" "); 359 for (int i = 0; i < depth; i++) printf(" ");
360 printf("%s (%p), real mask:%d => %p\n", efl_class_name_get(efl_class_get(msource)), msource, mask->mMode, mtarget); 360 printf("%s (%p), real mask:%d => %p\n", efl_class_name_get(efl_class_get(msource)), msource, mask->mMode, mtarget);
361#endif 361#endif
362
362 _construct_mask_nodes(msource, mask, depth + 1); 363 _construct_mask_nodes(msource, mask, depth + 1);
363 364
364 Efl_Gfx_Vg_Composite_Method mask_mode; 365 Efl_Gfx_Vg_Composite_Method mask_mode;