summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYakov Goldberg <yakov.g@samsung.com>2016-01-24 13:30:21 +0200
committerYakov Goldberg <yakov.g@samsung.com>2016-04-06 18:01:06 +0300
commitc0e9fe63d6130400f50d0d8e946d554e45a37b64 (patch)
tree94213fa904b7ed386a87f13e5d512ef20513c8b3
parent027c6bcbba24e2d83ce3263b90183d0aea5ed96c (diff)
Add Simple view support to Property View
Now Property view has two represenation modes: Expert and Simlple. Expert shows all widget properties grouped by class in inheritace sequence. Simple mode shows only pre-definded commonly used properties grouped by categories. Set of properties and its handlers in Simple view can be modified in config file.
-rw-r--r--data/config/CMakeLists.txt1
-rw-r--r--data/config/simple_op_db.txt367
-rw-r--r--src/bin/gui/CMakeLists.txt1
-rw-r--r--src/bin/gui/editor.c57
-rw-r--r--src/bin/gui/egui_layout.json746
-rw-r--r--src/bin/gui/egui_logic.c13
-rw-r--r--src/bin/gui/prop_layout.c38
-rw-r--r--src/bin/gui/props_helper.c12
-rw-r--r--src/bin/gui/props_helper.h6
-rw-r--r--src/bin/gui/propview.c37
-rw-r--r--src/bin/gui/propview.h2
-rw-r--r--src/bin/gui/simple_propview.c600
-rw-r--r--src/bin/gui/simple_propview.h14
-rw-r--r--src/lib/CMakeLists.txt1
-rw-r--r--src/lib/database.c250
-rw-r--r--src/lib/database.h78
-rw-r--r--src/lib/desc_simple_parser.c757
-rw-r--r--src/lib/desc_simple_parser.h28
-rw-r--r--src/lib/gui_widget.c11
-rw-r--r--src/lib/gui_widget.h3
-rw-r--r--src/lib/test_simple_op.txt7
21 files changed, 2646 insertions, 383 deletions
diff --git a/data/config/CMakeLists.txt b/data/config/CMakeLists.txt
index 4696272..720b5f1 100644
--- a/data/config/CMakeLists.txt
+++ b/data/config/CMakeLists.txt
@@ -3,6 +3,7 @@ cmake_minimum_required(VERSION 2.8.1)
3LIST(APPEND CONFIG_FILES 3LIST(APPEND CONFIG_FILES
4 func_names.json 4 func_names.json
5 black_list.json 5 black_list.json
6 simple_op_db.txt
6 egui_all.eo 7 egui_all.eo
7 ) 8 )
8#always copy config files into build directory, so egui_cmd will be able to generate egui_auto 9#always copy config files into build directory, so egui_cmd will be able to generate egui_auto
diff --git a/data/config/simple_op_db.txt b/data/config/simple_op_db.txt
new file mode 100644
index 0000000..9a3d33d
--- /dev/null
+++ b/data/config/simple_op_db.txt
@@ -0,0 +1,367 @@
1UI_Component_Specification.Visible {
2 Elm.Widget.visible;
3}
4
5UI_Component_Specification.Disabled {
6 none Elm.Box, Elm.Image, Elm.Icon, Elm.Bg;
7 Elm.Widget.disabled;
8}
9
10Component_Specific_Properties.Autodel {
11 Elm.Win.autodel;
12}
13
14Component_Specific_Properties.Title {
15 Elm.Win.title;
16}
17
18Component_Specific_Properties.Type {
19 Elm.Win.type;
20}
21
22Component_Specific_Properties.Maximized {
23 Elm.Win.maximized;
24}
25
26UI_Component_Specification.Text {
27 Elm.Widget.part_text(NULL, %1) for Elm.Button, Elm.Check, Elm.Label, Elm.Entry, Elm.Frame, Elm.Bubble, Elm.Fileselector_Entry, Elm.Fileselector_Button, Elm.Hoversel;
28 none Elm.Box, Elm.Table, Elm.Image, Elm.Icon, Elm.Toolbar, Elm.Slider, Elm.Win, Elm.Panes, Elm.Progressbar, Elm.Bg, Elm.Calendar, Elm.Clock, Elm.Fileselector, Elm.Separator, Elm.Colorselector, Elm.Dayselector, Elm.Actionslider, Elm.Naviframe;
29 Elm.Widget.part_text;
30}
31
32UI_Component_Specification.Style {
33 none Elm.Toolbar, Elm.Table, Elm.Entry, Elm.Bg, Elm.Win, Elm.Panes, Elm.Image, Elm.Icon, Elm.Frame, Elm.Calendar, Elm.Clock, Elm.Bubble, Elm.Fileselector, Elm.Fileselector_Entry, Elm.Fileselector_Button, Elm.Hoversel, Elm.Separator, Elm.Colorselector, Elm.Dayselector, Elm.Actionslider, Elm.Naviframe;
34 Elm.Widget.style;
35}
36
37Component_Specific_Properties.Autorepeat {
38 none Elm.Fileselector_Button, Elm.Hoversel;
39 Elm.Button.autorepeat;
40}
41
42Component_Specific_Properties.Autorepeat_Initial_Timeout {
43 none Elm.Fileselector_Button, Elm.Hoversel;
44 Elm.Button.autorepeat_initial_timeout;
45}
46
47Component_Specific_Properties.Autorepeat_Gap_Timeout {
48 none Elm.Fileselector_Button, Elm.Hoversel;
49 Elm.Button.autorepeat_gap_timeout;
50}
51
52Component_Specific_Properties.UI_Component_Specification.Horizontal {
53 Elm.Box.horizontal;
54 Elm.Toolbar.horizontal;
55 Elm.Slider.horizontal;
56 Elm.Panes.horizontal;
57 Elm.Progressbar.horizontal;
58 Elm.Hoversel.horizontal;
59 Elm.Separator.horizontal;
60}
61
62Component_Specific_Properties.Hover_Parent {
63 Elm.Hoversel.hover_parent;
64}
65
66Component_Specific_Properties.Auto_Update {
67 Elm.Hoversel.auto_update;
68}
69
70Component_Specific_Properties.Fixed {
71 Elm.Panes.fixed;
72}
73
74Component_Specific_Properties.Right_Size {
75 Elm.Panes.content_right_size;
76}
77
78Component_Specific_Properties.Homogeneous {
79 Elm.Box.homogeneous;
80 Elm.Table.homogeneous;
81 Elm.Toolbar.homogeneous;
82}
83
84Component_Specific_Properties.Padding {
85 Elm.Box.padding;
86 Elm.Table.padding;
87}
88
89Component_Specific_Properties.Image_Path {
90 Efl.File.file(%0, NULL) for Elm.Image, Elm.Icon, Elm.Entry, Elm.Bg;
91}
92Component_Specific_Properties.No_Scale {
93 none Elm.Icon;
94 Elm.Image.no_scale;
95}
96
97Component_Specific_Properties.Resizable {
98 none Elm.Icon;
99 Elm.Image.resizable;
100}
101
102Component_Specific_Properties.Orientation {
103 none Elm.Icon;
104 Efl.Image.orientation;
105}
106
107Component_Specific_Properties.Aspect_Fixed {
108 none Elm.Icon;
109 Elm.Image.aspect_fixed;
110}
111
112Component_Specific_Properties.Fill_Inside {
113 none Elm.Icon;
114 Elm.Image.fill_inside;
115}
116
117Component_Specific_Properties.Standard {
118 Elm.Icon.standard;
119}
120
121Component_Specific_Properties.Order_Lookup {
122 Elm.Icon.order_lookup;
123}
124
125Component_Specific_Properties.Shrink_Mode {
126 Elm.Toolbar.shrink_mode;
127}
128
129Component_Specific_Properties.Select_Mode {
130 Elm.Toolbar.select_mode;
131}
132
133Component_Specific_Properties.Icon_Size {
134 Elm.Toolbar.icon_size;
135}
136
137Component_Specific_Properties.Icon_Order_Lookup {
138 Elm.Toolbar.icon_order_lookup;
139}
140
141Component_Specific_Properties.Single_Line {
142 Elm.Entry.single_line;
143}
144
145Component_Specific_Properties.Password {
146 Elm.Entry.password;
147}
148
149Component_Specific_Properties.Editable {
150 Elm.Entry.editable;
151}
152
153Component_Specific_Properties.Context_Menu_Disabled {
154 Elm.Entry.context_menu_disabled;
155}
156
157Component_Specific_Properties.Scrollable {
158 Elm.Entry.scrollable;
159}
160
161Component_Specific_Properties.Tect_Format {
162 Elm.Entry.file_text_format;
163}
164
165Component_Specific_Properties.Wrap_Type {
166 Elm.Label.line_wrap;
167}
168
169Component_Specific_Properties.Wrap_Width {
170 Elm.Label.wrap_width;
171}
172
173Component_Specific_Properties.Ellipsis {
174 Elm.Label.ellipsis;
175}
176
177Component_Specific_Properties.Option {
178 Elm.Bg.option;
179}
180
181Component_Specific_Properties.Load_Size {
182 Elm.Bg.load_size;
183}
184
185Component_Specific_Properties.Indicator_Format {
186 Elm.Slider.indicator_format;
187}
188
189Component_Specific_Properties.Min_Max {
190 Elm.Slider.min_max;
191}
192
193Component_Specific_Properties.Value {
194 Elm.Slider.value;
195 Elm.Progressbar.value;
196}
197
198Component_Specific_Properties.Step {
199 Elm.Slider.step;
200}
201
202Component_Specific_Properties.Show_Indicator {
203 Elm.Slider.indicator_show;
204}
205
206Component_Specific_Properties.Span_Size {
207 Elm.Progressbar.span_size;
208}
209
210Component_Specific_Properties.Inverted {
211 Elm.Progressbar.inverted;
212}
213
214Component_Specific_Properties.Collapse {
215 Elm.Frame.collapse;
216}
217
218Component_Specific_Properties.Autocollapse {
219 Elm.Frame.autocollapse;
220}
221
222Component_Specific_Properties.First_Day_Of_Week {
223 Elm.Calendar.first_day_of_week;
224}
225
226Component_Specific_Properties.Selectable {
227 Elm.Calendar.selectable;
228}
229
230Component_Specific_Properties.Interval {
231 Elm.Calendar.interval;
232}
233
234Component_Specific_Properties.Select_Mode {
235 Elm.Calendar.select_mode;
236}
237
238Component_Specific_Properties.Min_Max_Year {
239 Elm.Calendar.min_max_year;
240}
241
242Component_Specific_Properties.Show_Am_Pm {
243 Elm.Clock.show_am_pm;
244}
245
246Component_Specific_Properties.First_Interval {
247 Elm.Clock.first_interval;
248}
249
250Component_Specific_Properties.Show_Seconds {
251 Elm.Clock.show_seconds;
252}
253
254Component_Specific_Properties.Edit {
255 Elm.Clock.edit;
256}
257
258Component_Specific_Properties.Pause {
259 Elm.Clock.pause;
260}
261
262Component_Specific_Properties.Time {
263 Elm.Clock.time;
264}
265
266Component_Specific_Properties.Edit_Mode {
267 Elm.Clock.edit_mode;
268}
269
270Component_Specific_Properties.Pos {
271 Elm.Bubble.pos;
272}
273
274Component_Specific_Properties.Event_Enabled {
275 Elm.Naviframe.event_enabled;
276}
277
278Component_Specific_Properties.Preserve_On_Pop {
279 Elm.Naviframe.content_preserve_on_pop;
280}
281
282Component_Specific_Properties.Prev_Btn_Auto_Pushed {
283 Elm.Naviframe.prev_btn_auto_pushed;
284}
285
286Component_Specific_Properties.Buttons_Ok_Cancel {
287 Elm.Fileselector.buttons_ok_cancel;
288}
289
290Component_Specific_Properties.Inwin_Mode {
291 Elm.Fileselector_Button.inwin_mode;
292 Elm.Fileselector_Entry.inwin_mode;
293}
294
295Component_Specific_Properties.Window_Size {
296 Elm.Fileselector_Button.window_size;
297 Elm.Fileselector_Entry.window_size;
298}
299
300Component_Specific_Properties.Window_Title {
301 Elm.Fileselector_Button.window_title;
302 Elm.Fileselector_Entry.window_title;
303}
304
305Component_Specific_Properties.Folder_Only {
306 Elm.Interface_Fileselector.folder_only;
307}
308
309Component_Specific_Properties.Hidden_Visible {
310 Elm.Interface_Fileselector.hidden_visible;
311}
312
313Component_Specific_Properties.Sort_Method {
314 Elm.Interface_Fileselector.sort_method;
315}
316Component_Specific_Properties.Multi_Select {
317 Elm.Interface_Fileselector.multi_select;
318}
319Component_Specific_Properties.Expandable {
320 Elm.Interface_Fileselector.expandable;
321}
322Component_Specific_Properties.Mode {
323 Elm.Interface_Fileselector.mode;
324 Elm.Colorselector.mode;
325}
326Component_Specific_Properties.Is_Save {
327 Elm.Interface_Fileselector.is_save;
328}
329Component_Specific_Properties.Color_Value {
330 Elm.Colorselector.color;
331}
332Component_Specific_Properties.Palette_Name {
333 Elm.Colorselector.palette_name;
334}
335
336Component_Specific_Properties.Week_Start {
337 Elm.Dayselector.week_start;
338}
339
340Component_Specific_Properties.Weekend_Start {
341 Elm.Dayselector.weekend_start;
342}
343
344Component_Specific_Properties.Indicator_Pos {
345 Elm.Actionslider.indicator_pos;
346}
347
348Component_Specific_Properties.Magnet_Pos {
349 Elm.Actionslider.magnet_pos;
350}
351Component_Specific_Properties.Enabled_Pos {
352 Elm.Actionslider.enabled_pos;
353}
354
355Alingment.Weight_Hint {
356 Evas.Object.size_hint_weight;
357}
358
359Alingment.Align_Hint as Slider(0.0, 1.0, 0.1) {
360 Evas.Object.size_hint_align;
361}
362
363UI_Component_Specification.Color as Color {
364 Elm.Bg.color;
365 none Elm.Box, Elm.Table, Elm.Win, Elm.Panes, Elm.Icon, Elm.Image, Elm.Separator;
366 Efl.Gfx.Base.color;
367}
diff --git a/src/bin/gui/CMakeLists.txt b/src/bin/gui/CMakeLists.txt
index 8b17ca7..6a0b530 100644
--- a/src/bin/gui/CMakeLists.txt
+++ b/src/bin/gui/CMakeLists.txt
@@ -59,6 +59,7 @@ add_executable(${TARGET}
59 props_helper.c 59 props_helper.c
60 objtree.c 60 objtree.c
61 propview.c 61 propview.c
62 simple_propview.c
62 cbview.c 63 cbview.c
63 descview.c 64 descview.c
64 contentview.c 65 contentview.c
diff --git a/src/bin/gui/editor.c b/src/bin/gui/editor.c
index 7379ca7..0ee48c6 100644
--- a/src/bin/gui/editor.c
+++ b/src/bin/gui/editor.c
@@ -11,6 +11,7 @@
11#include "contentview.h" 11#include "contentview.h"
12#include "itemview.h" 12#include "itemview.h"
13#include "propview.h" 13#include "propview.h"
14#include "simple_propview.h"
14#include "cbview.h" 15#include "cbview.h"
15#include "key_bindings.h" 16#include "key_bindings.h"
16#include "settings.h" 17#include "settings.h"
@@ -3455,6 +3456,10 @@ _prop_update_from_propview_int(void *data EINA_UNUSED, Eo *obj, const Eo_Event_D
3455 /* Get data for changed field. */ 3456 /* Get data for changed field. */
3456 pfd = eo_key_data_get(obj, _STR_EDITOR); 3457 pfd = eo_key_data_get(obj, _STR_EDITOR);
3457 op = pfd->it_data->op_desc; 3458 op = pfd->it_data->op_desc;
3459 /* For Simple_Prop_View */
3460 if (!op)
3461 op = original_op_desc_get(pfd->it_data->orig_op_desc);
3462
3458 wdg = pfd->it_data->wdg; 3463 wdg = pfd->it_data->wdg;
3459 prop = (Gui_Widget_Property *)pfd->it_data->prop; 3464 prop = (Gui_Widget_Property *)pfd->it_data->prop;
3460 idx = pfd->par_idx; 3465 idx = pfd->par_idx;
@@ -3518,6 +3523,19 @@ _prop_update_from_propview_int(void *data EINA_UNUSED, Eo *obj, const Eo_Event_D
3518 state = elm_obj_check_state_get(obj); 3523 state = elm_obj_check_state_get(obj);
3519 gui_value_bool_set(val, state); 3524 gui_value_bool_set(val, state);
3520 } 3525 }
3526 if (kl == ELM_SLIDER_CLASS)
3527 {
3528 double num = elm_obj_slider_value_get(obj);
3529 Param_Default_Value *def_val = NULL;
3530 def_val = eo_key_data_get(obj, _DEFAULT_VALUE);
3531 if (def_val)
3532 {
3533 num = atof(param_default_value_get(def_val));
3534 gui_value_double_set(val, num);
3535 eo_key_data_del(obj, _DEFAULT_VALUE);
3536 }
3537 gui_value_double_set(val, num);
3538 }
3521 if (kl == ELM_HOVERSEL_CLASS) 3539 if (kl == ELM_HOVERSEL_CLASS)
3522 { 3540 {
3523 const char *new_enum_value = NULL; 3541 const char *new_enum_value = NULL;
@@ -3663,6 +3681,44 @@ end:
3663 return EO_CALLBACK_CONTINUE; 3681 return EO_CALLBACK_CONTINUE;
3664} 3682}
3665 3683
3684static Eina_Bool
3685_default_hover_selected_cb(void *data, const Eo_Event *event)
3686{
3687 const char *choosen_value = elm_object_item_part_text_get(event->event_info, NULL);
3688 Eo *handler = data;
3689 Par_Field_Data *pfd = NULL;
3690 pfd = eo_key_data_get(handler, _STR_EDITOR);
3691 const Op_Desc *op = pfd->it_data->op_desc;
3692 if (!op) op = original_op_desc_get(pfd->it_data->orig_op_desc);
3693 Eina_List *def_vals = (Eina_List *) op_param_desc_default_values_list_get(db_op_desc_nth_param_desc_get(op, pfd->par_idx));
3694 if (def_vals)
3695 {
3696 Param_Default_Value *def_val;
3697 Eina_List *itr;
3698 EINA_LIST_FOREACH(def_vals, itr, def_val)
3699 {
3700 if (!strcmp(choosen_value, param_default_value_name_get(def_val)))
3701 {
3702 if (eo_class_get(handler) == ELM_ENTRY_CLASS)
3703 {
3704 elm_obj_widget_part_text_set(handler, NULL, param_default_value_get(def_val));
3705 }
3706 else if (eo_class_get(handler) == ELM_SLIDER_CLASS)
3707 {
3708 elm_obj_slider_value_set(handler, atof(param_default_value_get(def_val)));
3709 eo_key_data_set(handler, _DEFAULT_VALUE, def_val);
3710 }
3711 break;
3712 }
3713 }
3714 }
3715 Eo_Event *tmp_event = calloc(1, sizeof(Eo_Event));
3716 tmp_event->obj = handler;
3717 _prop_update_from_propview(NULL, tmp_event);
3718 free(tmp_event);
3719 return EO_CALLBACK_CONTINUE;
3720}
3721
3666/* Callback to dissmiss "Drop Property" ctxpopup */ 3722/* Callback to dissmiss "Drop Property" ctxpopup */
3667static void 3723static void
3668_ctxpopup_dismissed(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED) 3724_ctxpopup_dismissed(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
@@ -4940,6 +4996,7 @@ editor_init(GuiLogicCbs *_guilogic_cbs)
4940 PropViewCbs *prop_cbs = propview_cbs_get(); 4996 PropViewCbs *prop_cbs = propview_cbs_get();
4941 prop_cbs->property_update_cb_func = _prop_update_from_propview; 4997 prop_cbs->property_update_cb_func = _prop_update_from_propview;
4942 prop_cbs->property_ctx_menu_cb_func = _prop_ctx_menu_cb_func; 4998 prop_cbs->property_ctx_menu_cb_func = _prop_ctx_menu_cb_func;
4999 prop_cbs->default_hover_selected_cb_func = _default_hover_selected_cb;
4943 5000
4944 ContentViewCbs *content_cbs = contentview_cbs_get(); 5001 ContentViewCbs *content_cbs = contentview_cbs_get();
4945 content_cbs->content_delete_cb_func = _content_del_from_propview; 5002 content_cbs->content_delete_cb_func = _content_del_from_propview;
diff --git a/src/bin/gui/egui_layout.json b/src/bin/gui/egui_layout.json
index 0143077..148b562 100644
--- a/src/bin/gui/egui_layout.json
+++ b/src/bin/gui/egui_layout.json
@@ -3,6 +3,7 @@
3 "Settings": 3 "Settings":
4 { 4 {
5 "project":"egui_layout", 5 "project":"egui_layout",
6 "basedir":".",
6 "start_points":["main_win"] 7 "start_points":["main_win"]
7 }, 8 },
8 "Resources": 9 "Resources":
@@ -42,7 +43,8 @@
42 "_custom_theme_del_button_clicked":"_custom_theme_del_button_clicked", 43 "_custom_theme_del_button_clicked":"_custom_theme_del_button_clicked",
43 "_theme_selector_hover_selected_cb":"_theme_selector_hover_selected_cb", 44 "_theme_selector_hover_selected_cb":"_theme_selector_hover_selected_cb",
44 "_rmview_toolbar_clicked":"_rmview_toolbar_clicked", 45 "_rmview_toolbar_clicked":"_rmview_toolbar_clicked",
45 "_canvas_resize_cb":"_canvas_resize_cb" 46 "_canvas_resize_cb":"_canvas_resize_cb",
47 "_expert_simple_mode_toggle_changed":"_expert_simple_mode_toggle_changed"
46 }, 48 },
47 "Edjes": 49 "Edjes":
48 { 50 {
@@ -428,7 +430,7 @@
428 }, 430 },
429 "Properties": 431 "Properties":
430 { 432 {
431 "Elm.Toolbar.horizontal":[true], 433 "Elm.Widget.style":["item_horizontal"],
432 "Elm.Toolbar.shrink_mode":["ELM_TOOLBAR_SHRINK_MENU"], 434 "Elm.Toolbar.shrink_mode":["ELM_TOOLBAR_SHRINK_MENU"],
433 "Elm.Toolbar.select_mode":["ELM_OBJECT_SELECT_MODE_ALWAYS"], 435 "Elm.Toolbar.select_mode":["ELM_OBJECT_SELECT_MODE_ALWAYS"],
434 "Elm.Toolbar.icon_size":[16], 436 "Elm.Toolbar.icon_size":[16],
@@ -698,6 +700,27 @@
698 "Efl.Gfx.Base.visible":[true] 700 "Efl.Gfx.Base.visible":[true]
699 } 701 }
700 }, 702 },
703 "settings_table":
704 {
705 "Desc":
706 {
707 "parent":"settings_win",
708 "class":"Elm.Table"
709 },
710 "Properties":
711 {
712 "Evas.Object.size_hint_weight":[1, 1],
713 "Efl.Gfx.Base.visible":[true],
714 "Efl.Gfx.Base.size":[70, 60]
715 },
716 "Contains":
717 {
718 "settings_toolbar":[0, 0, 1, 1],
719 "project_settings_box":[0, 1, 1, 1],
720 "erigo_settings_box":[0, 1, 1, 1],
721 "settings_buttons_box":[0, 2, 1, 1]
722 }
723 },
701 "settings_toolbar": 724 "settings_toolbar":
702 { 725 {
703 "Desc": 726 "Desc":
@@ -736,29 +759,6 @@
736 } 759 }
737 } 760 }
738 }, 761 },
739 "project_settings_table":
740 {
741 "Desc":
742 {
743 "parent":"project_settings_box",
744 "class":"Elm.Table",
745 "public":true
746 },
747 "Properties":
748 {
749 "Efl.Gfx.Base.visible":[true],
750 "Elm.Table.padding":[6, 7],
751 "Evas.Object.size_hint_align":[-1, -1],
752 "Evas.Object.size_hint_weight":[1, 1]
753 },
754 "Contains":
755 {
756 "project_name_label":[0, 0, 1, 1],
757 "project_name_entry":[1, 0, 1, 1],
758 "start_points_label":[0, 2, 1, 1],
759 "start_points_genlist":[0, 3, 2, 2]
760 }
761 },
762 "settings_buttons_box": 762 "settings_buttons_box":
763 { 763 {
764 "Desc": 764 "Desc":
@@ -795,6 +795,45 @@
795 "clicked":["Invoke", "_settings_apply_button_clicked", null] 795 "clicked":["Invoke", "_settings_apply_button_clicked", null]
796 } 796 }
797 }, 797 },
798 "project_settings_box":
799 {
800 "Desc":
801 {
802 "parent":"settings_table",
803 "class":"Elm.Box",
804 "public":true
805 },
806 "Properties":
807 {
808 "Evas.Object.size_hint_weight":[1, 1],
809 "Efl.Gfx.Base.visible":[true],
810 "Evas.Object.size_hint_align":[-1, -1]
811 },
812 "Contains":["project_settings_table"]
813 },
814 "project_settings_table":
815 {
816 "Desc":
817 {
818 "parent":"project_settings_box",
819 "class":"Elm.Table",
820 "public":true
821 },
822 "Properties":
823 {
824 "Efl.Gfx.Base.visible":[true],
825 "Elm.Table.padding":[6, 7],
826 "Evas.Object.size_hint_align":[-1, -1],
827 "Evas.Object.size_hint_weight":[1, 1]
828 },
829 "Contains":
830 {
831 "project_name_label":[0, 0, 1, 1],
832 "project_name_entry":[1, 0, 1, 1],
833 "start_points_label":[0, 2, 1, 1],
834 "start_points_genlist":[0, 3, 2, 2]
835 }
836 },
798 "project_name_label": 837 "project_name_label":
799 { 838 {
800 "Desc": 839 "Desc":
@@ -858,6 +897,113 @@
858 "Efl.Gfx.Base.visible":[true] 897 "Efl.Gfx.Base.visible":[true]
859 } 898 }
860 }, 899 },
900 "erigo_settings_box":
901 {
902 "Desc":
903 {
904 "parent":"settings_table",
905 "class":"Elm.Box",
906 "public":true
907 },
908 "Properties":
909 {
910 "Evas.Object.size_hint_weight":[1, 1],
911 "Efl.Gfx.Base.visible":[true],
912 "Evas.Object.size_hint_align":[-1, -1]
913 },
914 "Contains":["erigo_settings_table"]
915 },
916 "erigo_settings_table":
917 {
918 "Desc":
919 {
920 "parent":"erigo_settings_box",
921 "class":"Elm.Table"
922 },
923 "Properties":
924 {
925 "Evas.Object.size_hint_weight":[1, 1],
926 "Efl.Gfx.Base.visible":[true],
927 "Efl.Gfx.Base.size":[70, 60],
928 "Evas.Object.size_hint_align":[-1, -1]
929 },
930 "Contains":
931 {
932 "custom_themes_genlist":[0, 1, 1, 1],
933 "custom_theme_buttons":[0, 0, 1, 1]
934 }
935 },
936 "custom_themes_genlist":
937 {
938 "Desc":
939 {
940 "parent":"erigo_settings_table",
941 "class":"Elm.Genlist",
942 "public":true
943 },
944 "Properties":
945 {
946 "Evas.Object.size_hint_weight":[1, 1],
947 "Efl.Gfx.Base.visible":[true],
948 "Efl.Gfx.Base.size":[70, 60],
949 "Evas.Object.size_hint_align":[-1, -1]
950 }
951 },
952 "custom_theme_buttons":
953 {
954 "Desc":
955 {
956 "parent":"erigo_settings_table",
957 "class":"Elm.Box"
958 },
959 "Properties":
960 {
961 "Efl.Gfx.Base.visible":[true],
962 "Evas.Object.size_hint_weight":[1, 0],
963 "Elm.Box.horizontal":[true],
964 "Evas.Object.size_hint_align":[-1, 0]
965 },
966 "Contains":["cutom_theme_fs_bt", "custom_theme_del_bt"]
967 },
968 "cutom_theme_fs_bt":
969 {
970 "Desc":
971 {
972 "parent":"custom_theme_buttons",
973 "class":"Elm.Button",
974 "public":true
975 },
976 "Properties":
977 {
978 "Evas.Object.size_hint_weight":[1, 1],
979 "Efl.Gfx.Base.visible":[true],
980 "Efl.Gfx.Base.size":[73, 30],
981 "Elm.Widget.part_text":[null, "Add"]
982 },
983 "Callbacks":
984 {
985 "clicked":["Invoke", "_custom_theme_add_button_clicked", null]
986 }
987 },
988 "custom_theme_del_bt":
989 {
990 "Desc":
991 {
992 "parent":"custom_theme_buttons",
993 "class":"Elm.Button"
994 },
995 "Properties":
996 {
997 "Evas.Object.size_hint_weight":[1, 1],
998 "Efl.Gfx.Base.visible":[true],
999 "Efl.Gfx.Base.size":[73, 30],
1000 "Elm.Widget.part_text":[null, "Delete"]
1001 },
1002 "Callbacks":
1003 {
1004 "clicked":["Invoke", "_custom_theme_del_button_clicked", null]
1005 }
1006 },
861 "main_win": 1007 "main_win":
862 { 1008 {
863 "Desc": 1009 "Desc":
@@ -1047,7 +1193,7 @@
1047 }, 1193 },
1048 "Properties": 1194 "Properties":
1049 { 1195 {
1050 "Elm.Toolbar.horizontal":[true], 1196 "Elm.Widget.style":["item_horizontal"],
1051 "Elm.Toolbar.select_mode":["ELM_OBJECT_SELECT_MODE_DEFAULT"], 1197 "Elm.Toolbar.select_mode":["ELM_OBJECT_SELECT_MODE_DEFAULT"],
1052 "Elm.Toolbar.shrink_mode":["ELM_TOOLBAR_SHRINK_NONE"], 1198 "Elm.Toolbar.shrink_mode":["ELM_TOOLBAR_SHRINK_NONE"],
1053 "Evas.Object.size_hint_weight":[1, 0], 1199 "Evas.Object.size_hint_weight":[1, 0],
@@ -1072,44 +1218,44 @@
1072 }, 1218 },
1073 "Contains":["left_panes"] 1219 "Contains":["left_panes"]
1074 }, 1220 },
1075 "left_pane_layout": 1221 "left_panes":
1076 { 1222 {
1077 "Desc": 1223 "Desc":
1078 { 1224 {
1079 "parent":"left_panes", 1225 "parent":"hor_box",
1080 "class":"Elm.Layout" 1226 "class":"Elm.Panes",
1227 "public":true
1081 }, 1228 },
1082 "Properties": 1229 "Properties":
1083 { 1230 {
1084 "Evas.Object.size_hint_weight":[1, 1], 1231 "Evas.Object.size_hint_weight":[1, 1],
1085 "Efl.Gfx.Base.visible":[true], 1232 "Evas.Object.size_hint_align":[-1, -1],
1086 "Efl.File.file":["panes_layout", "elm/layout/panes/pane"] 1233 "Elm.Panes.content_right_size":[0.83],
1234 "Efl.Gfx.Base.visible":[true]
1087 }, 1235 },
1088 "Contains": 1236 "Contains":
1089 { 1237 {
1090 "left_pane_bg":["erigo.swallow.bg"], 1238 "left_pane_layout":["left"],
1091 "left_panel_box":["erigo.swallow.content"] 1239 "right_panes":["right"]
1092 } 1240 }
1093 }, 1241 },
1094 "left_panes": 1242 "left_pane_layout":
1095 { 1243 {
1096 "Desc": 1244 "Desc":
1097 { 1245 {
1098 "parent":"hor_box", 1246 "parent":"left_panes",
1099 "class":"Elm.Panes", 1247 "class":"Elm.Layout"
1100 "public":true
1101 }, 1248 },
1102 "Properties": 1249 "Properties":
1103 { 1250 {
1104 "Evas.Object.size_hint_weight":[1, 1], 1251 "Evas.Object.size_hint_weight":[1, 1],
1105 "Evas.Object.size_hint_align":[-1, -1], 1252 "Efl.Gfx.Base.visible":[true],
1106 "Elm.Panes.content_right_size":[0.83], 1253 "Efl.File.file":["panes_layout", "elm/layout/panes/pane"]
1107 "Efl.Gfx.Base.visible":[true]
1108 }, 1254 },
1109 "Contains": 1255 "Contains":
1110 { 1256 {
1111 "left_pane_layout":["left"], 1257 "left_pane_bg":["erigo.swallow.bg"],
1112 "right_panes":["right"] 1258 "left_panel_box":["erigo.swallow.content"]
1113 } 1259 }
1114 }, 1260 },
1115 "left_pane_bg": 1261 "left_pane_bg":
@@ -1451,6 +1597,74 @@
1451 "Efl.Gfx.Base.visible":[true] 1597 "Efl.Gfx.Base.visible":[true]
1452 } 1598 }
1453 }, 1599 },
1600 "theme_selector_box":
1601 {
1602 "Desc":
1603 {
1604 "parent":"left_panel_box",
1605 "class":"Elm.Box"
1606 },
1607 "Properties":
1608 {
1609 "Efl.Gfx.Base.visible":[true],
1610 "Elm.Box.horizontal":[true],
1611 "Evas.Object.size_hint_align":[-1, 0],
1612 "Evas.Object.size_hint_weight":[1, 0]
1613 },
1614 "Contains":["theme_selector_label", "theme_selector_hoversel", "zoom_label"]
1615 },
1616 "theme_selector_label":
1617 {
1618 "Desc":
1619 {
1620 "parent":"theme_selector_box",
1621 "class":"Elm.Label"
1622 },
1623 "Properties":
1624 {
1625 "Evas.Object.size_hint_weight":[1, 1],
1626 "Efl.Gfx.Base.visible":[true],
1627 "Efl.Gfx.Base.size":[60, 30],
1628 "Elm.Widget.part_text":[null, "Select Theme:"]
1629 }
1630 },
1631 "theme_selector_hoversel":
1632 {
1633 "Desc":
1634 {
1635 "parent":"theme_selector_box",
1636 "class":"Elm.Hoversel",
1637 "public":true
1638 },
1639 "Properties":
1640 {
1641 "Evas.Object.size_hint_weight":[1, 1],
1642 "Efl.Gfx.Base.visible":[true],
1643 "Efl.Gfx.Base.size":[73, 30],
1644 "Elm.Widget.part_text":[null, "default"],
1645 "Elm.Hoversel.hover_parent":["hor_box"]
1646 },
1647 "Callbacks":
1648 {
1649 "selected":["Invoke", "_theme_selector_hover_selected_cb", null]
1650 }
1651 },
1652 "zoom_label":
1653 {
1654 "Desc":
1655 {
1656 "parent":"theme_selector_box",
1657 "class":"Elm.Label",
1658 "public":true
1659 },
1660 "Properties":
1661 {
1662 "Evas.Object.size_hint_weight":[0, 0],
1663 "Evas.Object.size_hint_align":[1, 0],
1664 "Efl.Gfx.Base.visible":[true],
1665 "Elm.Widget.part_text":[null, "100%"]
1666 }
1667 },
1454 "right_panes": 1668 "right_panes":
1455 { 1669 {
1456 "Desc": 1670 "Desc":
@@ -1513,55 +1727,55 @@
1513 "Efl.Gfx.Base.visible":[true] 1727 "Efl.Gfx.Base.visible":[true]
1514 } 1728 }
1515 }, 1729 },
1516 "right_pane_bg": 1730 "right_pane_layout":
1517 { 1731 {
1518 "Desc": 1732 "Desc":
1519 { 1733 {
1520 "parent":"right_pane_layout", 1734 "parent":"right_panes",
1521 "class":"Elm.Bg" 1735 "class":"Elm.Layout",
1736 "public":true
1522 }, 1737 },
1523 "Properties": 1738 "Properties":
1524 { 1739 {
1525 "Evas.Object.size_hint_weight":[1, 1], 1740 "Evas.Object.size_hint_weight":[1, 1],
1526 "Efl.Gfx.Base.visible":[true] 1741 "Evas.Object.size_hint_align":[-1, -1],
1742 "Efl.Gfx.Base.visible":[true],
1743 "Efl.File.file":["panes_layout", "elm/layout/panes/pane"]
1744 },
1745 "Contains":
1746 {
1747 "right_pane_bg":["erigo.swallow.bg"],
1748 "right_panel_box":["erigo.swallow.content"]
1527 } 1749 }
1528 }, 1750 },
1529 "right_panel_box": 1751 "right_pane_bg":
1530 { 1752 {
1531 "Desc": 1753 "Desc":
1532 { 1754 {
1533 "parent":"right_pane_layout", 1755 "parent":"right_pane_layout",
1534 "class":"Elm.Box", 1756 "class":"Elm.Bg"
1535 "public":true
1536 }, 1757 },
1537 "Properties": 1758 "Properties":
1538 { 1759 {
1539 "Evas.Object.size_hint_weight":[1, 1], 1760 "Evas.Object.size_hint_weight":[1, 1],
1540 "Evas.Object.size_hint_align":[-1, -1],
1541 "Efl.Gfx.Base.visible":[true] 1761 "Efl.Gfx.Base.visible":[true]
1542 }, 1762 }
1543 "Contains":["right_panes_internal"]
1544 }, 1763 },
1545 "right_pane_layout": 1764 "right_panel_box":
1546 { 1765 {
1547 "Desc": 1766 "Desc":
1548 { 1767 {
1549 "parent":"right_panes", 1768 "parent":"right_pane_layout",
1550 "class":"Elm.Layout", 1769 "class":"Elm.Box",
1551 "public":true 1770 "public":true
1552 }, 1771 },
1553 "Properties": 1772 "Properties":
1554 { 1773 {
1555 "Evas.Object.size_hint_weight":[1, 1], 1774 "Evas.Object.size_hint_weight":[1, 1],
1556 "Evas.Object.size_hint_align":[-1, -1], 1775 "Evas.Object.size_hint_align":[-1, -1],
1557 "Efl.Gfx.Base.visible":[true], 1776 "Efl.Gfx.Base.visible":[true]
1558 "Efl.File.file":["panes_layout", "elm/layout/panes/pane"]
1559 }, 1777 },
1560 "Contains": 1778 "Contains":["right_panes_internal"]
1561 {
1562 "right_pane_bg":["erigo.swallow.bg"],
1563 "right_panel_box":["erigo.swallow.content"]
1564 }
1565 }, 1779 },
1566 "right_panes_internal": 1780 "right_panes_internal":
1567 { 1781 {
@@ -1739,6 +1953,27 @@
1739 "Efl.Gfx.Base.visible":[true] 1953 "Efl.Gfx.Base.visible":[true]
1740 } 1954 }
1741 }, 1955 },
1956 "propsview_toggle":
1957 {
1958 "Desc":
1959 {
1960 "parent":"propsview_table",
1961 "class":"Elm.Check",
1962 "public":true
1963 },
1964 "Properties":
1965 {
1966 "Elm.Widget.style":["toggle"],
1967 "Evas.Object.size_hint_weight":[1, 0],
1968 "Evas.Object.size_hint_align":[0.50, 0],
1969 "Elm.Widget.part_text":["on", "Simple Mode"],
1970 "Elm.Widget.part_text":["off", "Expert Mode"]
1971 },
1972 "Callbacks":
1973 {
1974 "changed":["Invoke", "_expert_simple_mode_toggle_changed", null]
1975 }
1976 },
1742 "properties_list": 1977 "properties_list":
1743 { 1978 {
1744 "Desc": 1979 "Desc":
@@ -1753,6 +1988,40 @@
1753 "Evas.Object.size_hint_align":[-1, -1] 1988 "Evas.Object.size_hint_align":[-1, -1]
1754 } 1989 }
1755 }, 1990 },
1991 "simple_properties_scroll":
1992 {
1993 "Desc":
1994 {
1995 "parent":"propsview_table",
1996 "class":"Elm.Scroller",
1997 "public":true
1998 },
1999 "Properties":
2000 {
2001 "Evas.Object.size_hint_weight":[1, 1],
2002 "Evas.Object.size_hint_align":[-1, -1],
2003 "Elm.Interface_Scrollable.bounce_allow":[false, true]
2004 },
2005 "Contains":
2006 {
2007 "simple_properties_box":[null]
2008 }
2009 },
2010 "simple_properties_box":
2011 {
2012 "Desc":
2013 {
2014 "parent":"simple_properties_scroll",
2015 "class":"Elm.Box",
2016 "public":true
2017 },
2018 "Properties":
2019 {
2020 "Evas.Object.size_hint_weight":[1, 0],
2021 "Evas.Object.size_hint_align":[-1, 0],
2022 "Efl.Gfx.Base.visible":[true]
2023 }
2024 },
1756 "description_list": 2025 "description_list":
1757 { 2026 {
1758 "Desc": 2027 "Desc":
@@ -1890,6 +2159,21 @@
1890 "callbacksview_up_btn_icon":[null] 2159 "callbacksview_up_btn_icon":[null]
1891 } 2160 }
1892 }, 2161 },
2162 "callbacksview_up_btn_icon":
2163 {
2164 "Desc":
2165 {
2166 "parent":"callbacksview_up_btn",
2167 "class":"Elm.Icon"
2168 },
2169 "Properties":
2170 {
2171 "Evas.Object.size_hint_weight":[1, 1],
2172 "Efl.Gfx.Base.visible":[true],
2173 "Efl.Gfx.Base.size":[40, 40],
2174 "Efl.File.file":["move_up_icon", null]
2175 }
2176 },
1893 "callbacksview_down_btn": 2177 "callbacksview_down_btn":
1894 { 2178 {
1895 "Desc": 2179 "Desc":
@@ -1911,6 +2195,21 @@
1911 "callbacksview_down_btn_icon":[null] 2195 "callbacksview_down_btn_icon":[null]
1912 } 2196 }
1913 }, 2197 },
2198 "callbacksview_down_btn_icon":
2199 {
2200 "Desc":
2201 {
2202 "parent":"callbacksview_down_btn",
2203 "class":"Elm.Icon"
2204 },
2205 "Properties":
2206 {
2207 "Evas.Object.size_hint_weight":[1, 1],
2208 "Efl.Gfx.Base.visible":[true],
2209 "Efl.Gfx.Base.size":[40, 40],
2210 "Efl.File.file":["move_down_icon", null]
2211 }
2212 },
1914 "callbacksview_del_btn": 2213 "callbacksview_del_btn":
1915 { 2214 {
1916 "Desc": 2215 "Desc":
@@ -2016,6 +2315,21 @@
2016 "contentview_down_btn_icon":[null] 2315 "contentview_down_btn_icon":[null]
2017 } 2316 }
2018 }, 2317 },
2318 "contentview_down_btn_icon":
2319 {
2320 "Desc":
2321 {
2322 "parent":"contentview_down_btn",
2323 "class":"Elm.Icon"
2324 },
2325 "Properties":
2326 {
2327 "Evas.Object.size_hint_weight":[1, 1],
2328 "Efl.Gfx.Base.visible":[true],
2329 "Efl.Gfx.Base.size":[40, 40],
2330 "Efl.File.file":["move_down_icon", null]
2331 }
2332 },
2019 "contentview_up_btn": 2333 "contentview_up_btn":
2020 { 2334 {
2021 "Desc": 2335 "Desc":
@@ -2037,6 +2351,21 @@
2037 "contentview_up_btn_icon":[null] 2351 "contentview_up_btn_icon":[null]
2038 } 2352 }
2039 }, 2353 },
2354 "contentview_up_btn_icon":
2355 {
2356 "Desc":
2357 {
2358 "parent":"contentview_up_btn",
2359 "class":"Elm.Icon"
2360 },
2361 "Properties":
2362 {
2363 "Evas.Object.size_hint_weight":[1, 1],
2364 "Efl.Gfx.Base.visible":[true],
2365 "Efl.Gfx.Base.size":[40, 40],
2366 "Efl.File.file":["move_up_icon", null]
2367 }
2368 },
2040 "itemview_box": 2369 "itemview_box":
2041 { 2370 {
2042 "Desc": 2371 "Desc":
@@ -2176,32 +2505,11 @@
2176 "itemview_up_btn_icon":[null] 2505 "itemview_up_btn_icon":[null]
2177 } 2506 }
2178 }, 2507 },
2179 "itemview_down_btn": 2508 "itemview_up_btn_icon":
2180 {
2181 "Desc":
2182 {
2183 "parent":"itemview_buttons_box",
2184 "class":"Elm.Button"
2185 },
2186 "Properties":
2187 {
2188 "Efl.Gfx.Base.visible":[true],
2189 "Efl.Gfx.Base.size":[73, 30]
2190 },
2191 "Callbacks":
2192 {
2193 "clicked":["Invoke", "_itemview_down_btn_clicked", null]
2194 },
2195 "Contains":
2196 {
2197 "itemview_down_btn_icon":[null]
2198 }
2199 },
2200 "contentview_up_btn_icon":
2201 { 2509 {
2202 "Desc": 2510 "Desc":
2203 { 2511 {
2204 "parent":"contentview_up_btn", 2512 "parent":"itemview_up_btn",
2205 "class":"Elm.Icon" 2513 "class":"Elm.Icon"
2206 }, 2514 },
2207 "Properties": 2515 "Properties":
@@ -2212,64 +2520,25 @@
2212 "Efl.File.file":["move_up_icon", null] 2520 "Efl.File.file":["move_up_icon", null]
2213 } 2521 }
2214 }, 2522 },
2215 "contentview_down_btn_icon": 2523 "itemview_down_btn":
2216 {
2217 "Desc":
2218 {
2219 "parent":"contentview_down_btn",
2220 "class":"Elm.Icon"
2221 },
2222 "Properties":
2223 {
2224 "Evas.Object.size_hint_weight":[1, 1],
2225 "Efl.Gfx.Base.visible":[true],
2226 "Efl.Gfx.Base.size":[40, 40],
2227 "Efl.File.file":["move_down_icon", null]
2228 }
2229 },
2230 "callbacksview_up_btn_icon":
2231 { 2524 {
2232 "Desc": 2525 "Desc":
2233 { 2526 {
2234 "parent":"callbacksview_up_btn", 2527 "parent":"itemview_buttons_box",
2235 "class":"Elm.Icon" 2528 "class":"Elm.Button"
2236 }, 2529 },
2237 "Properties": 2530 "Properties":
2238 { 2531 {
2239 "Evas.Object.size_hint_weight":[1, 1],
2240 "Efl.Gfx.Base.visible":[true], 2532 "Efl.Gfx.Base.visible":[true],
2241 "Efl.Gfx.Base.size":[40, 40], 2533 "Efl.Gfx.Base.size":[73, 30]
2242 "Efl.File.file":["move_up_icon", null]
2243 }
2244 },
2245 "callbacksview_down_btn_icon":
2246 {
2247 "Desc":
2248 {
2249 "parent":"callbacksview_down_btn",
2250 "class":"Elm.Icon"
2251 }, 2534 },
2252 "Properties": 2535 "Callbacks":
2253 {
2254 "Evas.Object.size_hint_weight":[1, 1],
2255 "Efl.Gfx.Base.visible":[true],
2256 "Efl.Gfx.Base.size":[40, 40],
2257 "Efl.File.file":["move_down_icon", null]
2258 }
2259 },
2260 "itemview_up_btn_icon":
2261 {
2262 "Desc":
2263 { 2536 {
2264 "parent":"itemview_up_btn", 2537 "clicked":["Invoke", "_itemview_down_btn_clicked", null]
2265 "class":"Elm.Icon"
2266 }, 2538 },
2267 "Properties": 2539 "Contains":
2268 { 2540 {
2269 "Evas.Object.size_hint_weight":[1, 1], 2541 "itemview_down_btn_icon":[null]
2270 "Efl.Gfx.Base.visible":[true],
2271 "Efl.Gfx.Base.size":[40, 40],
2272 "Efl.File.file":["move_up_icon", null]
2273 } 2542 }
2274 }, 2543 },
2275 "itemview_down_btn_icon": 2544 "itemview_down_btn_icon":
@@ -2287,222 +2556,11 @@
2287 "Efl.File.file":["move_down_icon", null] 2556 "Efl.File.file":["move_down_icon", null]
2288 } 2557 }
2289 }, 2558 },
2290 "project_settings_box":
2291 {
2292 "Desc":
2293 {
2294 "parent":"settings_table",
2295 "class":"Elm.Box",
2296 "public":true
2297 },
2298 "Properties":
2299 {
2300 "Evas.Object.size_hint_weight":[1, 1],
2301 "Efl.Gfx.Base.visible":[true],
2302 "Evas.Object.size_hint_align":[-1, -1]
2303 },
2304 "Contains":["project_settings_table"]
2305 },
2306 "settings_table":
2307 {
2308 "Desc":
2309 {
2310 "parent":"settings_win",
2311 "class":"Elm.Table"
2312 },
2313 "Properties":
2314 {
2315 "Evas.Object.size_hint_weight":[1, 1],
2316 "Efl.Gfx.Base.visible":[true],
2317 "Efl.Gfx.Base.size":[70, 60]
2318 },
2319 "Contains":
2320 {
2321 "settings_toolbar":[0, 0, 1, 1],
2322 "project_settings_box":[0, 1, 1, 1],
2323 "erigo_settings_box":[0, 1, 1, 1],
2324 "settings_buttons_box":[0, 2, 1, 1]
2325 }
2326 },
2327 "erigo_settings_box":
2328 {
2329 "Desc":
2330 {
2331 "parent":"settings_table",
2332 "class":"Elm.Box",
2333 "public":true
2334 },
2335 "Properties":
2336 {
2337 "Evas.Object.size_hint_weight":[1, 1],
2338 "Efl.Gfx.Base.visible":[true],
2339 "Evas.Object.size_hint_align":[-1, -1]
2340 },
2341 "Contains":["erigo_settings_table"]
2342 },
2343 "erigo_settings_table":
2344 {
2345 "Desc":
2346 {
2347 "parent":"erigo_settings_box",
2348 "class":"Elm.Table"
2349 },
2350 "Properties":
2351 {
2352 "Evas.Object.size_hint_weight":[1, 1],
2353 "Efl.Gfx.Base.visible":[true],
2354 "Efl.Gfx.Base.size":[70, 60],
2355 "Evas.Object.size_hint_align":[-1, -1]
2356 },
2357 "Contains":
2358 {
2359 "custom_themes_genlist":[0, 1, 1, 1],
2360 "custom_theme_buttons":[0, 0, 1, 1]
2361 }
2362 },
2363 "custom_themes_genlist":
2364 {
2365 "Desc":
2366 {
2367 "parent":"erigo_settings_table",
2368 "class":"Elm.Genlist",
2369 "public":true
2370 },
2371 "Properties":
2372 {
2373 "Evas.Object.size_hint_weight":[1, 1],
2374 "Efl.Gfx.Base.visible":[true],
2375 "Efl.Gfx.Base.size":[70, 60],
2376 "Evas.Object.size_hint_align":[-1, -1]
2377 }
2378 },
2379 "cutom_theme_fs_bt":
2380 {
2381 "Desc":
2382 {
2383 "parent":"custom_theme_buttons",
2384 "class":"Elm.Button",
2385 "public":true
2386 },
2387 "Properties":
2388 {
2389 "Evas.Object.size_hint_weight":[1, 1],
2390 "Efl.Gfx.Base.visible":[true],
2391 "Efl.Gfx.Base.size":[73, 30],
2392 "Elm.Widget.part_text":[null, "Add"]
2393 },
2394 "Callbacks":
2395 {
2396 "clicked":["Invoke", "_custom_theme_add_button_clicked", null]
2397 }
2398 },
2399 "custom_theme_buttons":
2400 {
2401 "Desc":
2402 {
2403 "parent":"erigo_settings_table",
2404 "class":"Elm.Box"
2405 },
2406 "Properties":
2407 {
2408 "Efl.Gfx.Base.visible":[true],
2409 "Evas.Object.size_hint_weight":[1, 0],
2410 "Elm.Box.horizontal":[true],
2411 "Evas.Object.size_hint_align":[-1, 0]
2412 },
2413 "Contains":["cutom_theme_fs_bt", "custom_theme_del_bt"]
2414 },
2415 "custom_theme_del_bt":
2416 {
2417 "Desc":
2418 {
2419 "parent":"custom_theme_buttons",
2420 "class":"Elm.Button"
2421 },
2422 "Properties":
2423 {
2424 "Evas.Object.size_hint_weight":[1, 1],
2425 "Efl.Gfx.Base.visible":[true],
2426 "Efl.Gfx.Base.size":[73, 30],
2427 "Elm.Widget.part_text":[null, "Delete"]
2428 },
2429 "Callbacks":
2430 {
2431 "clicked":["Invoke", "_custom_theme_del_button_clicked", null]
2432 }
2433 },
2434 "theme_selector_box":
2435 {
2436 "Desc":
2437 {
2438 "parent":"left_panel_box",
2439 "class":"Elm.Box"
2440 },
2441 "Properties":
2442 {
2443 "Efl.Gfx.Base.visible":[true],
2444 "Elm.Box.horizontal":[true],
2445 "Evas.Object.size_hint_align":[-1, 0],
2446 "Evas.Object.size_hint_weight":[1, 0]
2447 },
2448 "Contains":["theme_selector_label", "theme_selector_hoversel", "zoom_label"]
2449 },
2450 "theme_selector_label":
2451 {
2452 "Desc":
2453 {
2454 "parent":"theme_selector_box",
2455 "class":"Elm.Label"
2456 },
2457 "Properties":
2458 {
2459 "Evas.Object.size_hint_weight":[1, 1],
2460 "Efl.Gfx.Base.visible":[true],
2461 "Efl.Gfx.Base.size":[60, 30],
2462 "Elm.Widget.part_text":[null, "Select Theme:"]
2463 }
2464 },
2465 "theme_selector_hoversel":
2466 {
2467 "Desc":
2468 {
2469 "parent":"theme_selector_box",
2470 "class":"Elm.Hoversel",
2471 "public":true
2472 },
2473 "Properties":
2474 {
2475 "Evas.Object.size_hint_weight":[1, 1],
2476 "Efl.Gfx.Base.visible":[true],
2477 "Efl.Gfx.Base.size":[73, 30],
2478 "Elm.Widget.part_text":[null, "default"],
2479 "Elm.Hoversel.hover_parent":["hor_box"]
2480 },
2481 "Callbacks":
2482 {
2483 "selected":["Invoke", "_theme_selector_hover_selected_cb", null]
2484 }
2485 },
2486 "zoom_label":
2487 {
2488 "Desc":
2489 {
2490 "parent":"theme_selector_box",
2491 "class":"Elm.Label",
2492 "public":true
2493 },
2494 "Properties":
2495 {
2496 "Evas.Object.size_hint_weight":[0, 0],
2497 "Evas.Object.size_hint_align":[1, 0],
2498 "Efl.Gfx.Base.visible":[true],
2499 "Elm.Widget.part_text":[null, "100%"]
2500 }
2501 },
2502 "naviframe_part": 2559 "naviframe_part":
2503 { 2560 {
2504 "Desc": 2561 "Desc":
2505 { 2562 {
2563 "parent":null,
2506 "class":"Elm.Box", 2564 "class":"Elm.Box",
2507 "public":true 2565 "public":true
2508 }, 2566 },
diff --git a/src/bin/gui/egui_logic.c b/src/bin/gui/egui_logic.c
index 7b58aa1..d77e0c1 100644
--- a/src/bin/gui/egui_logic.c
+++ b/src/bin/gui/egui_logic.c
@@ -896,7 +896,7 @@ _toolbar_simulate_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info
896 896
897 if (!gui_context_start_points_get(ctx)) 897 if (!gui_context_start_points_get(ctx))
898 { 898 {
899 popup_show(g_main_wdgs->main_win->main_win, "Error", "Start point is not defined. Open \"Settings\" to define.", NULL, 899 popup_show(g_main_wdgs->main_win->main_win, "Error", "Start point is not defined. Open \"Settings\" to define.", NULL, NULL,
900 POPUP_OK_BUTTON, NULL, NULL); 900 POPUP_OK_BUTTON, NULL, NULL);
901 return; 901 return;
902 } 902 }
@@ -1140,11 +1140,12 @@ egui_start(const char *filename)
1140 evas_object_smart_callback_add(g_main_wdgs->main_win->main_win, "delete,request", _main_win_del_cb, NULL); 1140 evas_object_smart_callback_add(g_main_wdgs->main_win->main_win, "delete,request", _main_win_del_cb, NULL);
1141 _egui_project_open(filename); 1141 _egui_project_open(filename);
1142 elm_obj_table_pack(g_main_wdgs->main_win->objtree_table, g_main_wdgs->main_win->objtree_list, 0, 1, 1, 1); 1142 elm_obj_table_pack(g_main_wdgs->main_win->objtree_table, g_main_wdgs->main_win->objtree_list, 0, 1, 1, 1);
1143 elm_obj_table_pack(g_main_wdgs->main_win->propsview_table, g_main_wdgs->main_win->description_list, 0, 2, 1, 1); 1143 elm_obj_table_pack(g_main_wdgs->main_win->propsview_table, g_main_wdgs->main_win->description_list, 0, 3, 1, 1);
1144 elm_obj_table_pack(g_main_wdgs->main_win->propsview_table, g_main_wdgs->main_win->properties_list, 0, 2, 1, 1); 1144 elm_obj_table_pack(g_main_wdgs->main_win->propsview_table, g_main_wdgs->main_win->properties_list, 0, 3, 1, 1);
1145 elm_obj_table_pack(g_main_wdgs->main_win->propsview_table, g_main_wdgs->main_win->callbacksview_box, 0, 2, 1, 1); 1145 elm_obj_table_pack(g_main_wdgs->main_win->propsview_table, g_main_wdgs->main_win->simple_properties_scroll, 0, 3, 1, 1);
1146 elm_obj_table_pack(g_main_wdgs->main_win->propsview_table, g_main_wdgs->main_win->itemview_box, 0, 2, 1, 1); 1146 elm_obj_table_pack(g_main_wdgs->main_win->propsview_table, g_main_wdgs->main_win->callbacksview_box, 0, 3, 1, 1);
1147 elm_obj_table_pack(g_main_wdgs->main_win->propsview_table, g_main_wdgs->main_win->contentview_box, 0, 2, 1, 1); 1147 elm_obj_table_pack(g_main_wdgs->main_win->propsview_table, g_main_wdgs->main_win->itemview_box, 0, 3, 1, 1);
1148 elm_obj_table_pack(g_main_wdgs->main_win->propsview_table, g_main_wdgs->main_win->contentview_box, 0, 3, 1, 1);
1148 elm_obj_box_pack_end(g_main_wdgs->main_win->left_panel_box, g_main_wdgs->main_win->fctr_scroll); 1149 elm_obj_box_pack_end(g_main_wdgs->main_win->left_panel_box, g_main_wdgs->main_win->fctr_scroll);
1149} 1150}
1150 1151
diff --git a/src/bin/gui/prop_layout.c b/src/bin/gui/prop_layout.c
index f98c833..a12ae1b 100644
--- a/src/bin/gui/prop_layout.c
+++ b/src/bin/gui/prop_layout.c
@@ -6,6 +6,7 @@
6#include "egui_logic_private.h" 6#include "egui_logic_private.h"
7 7
8#include "propview.h" 8#include "propview.h"
9#include "simple_propview.h"
9#include "contentview.h" 10#include "contentview.h"
10#include "descview.h" 11#include "descview.h"
11#include "cbview.h" 12#include "cbview.h"
@@ -65,6 +66,29 @@ _class_item_del(void *data, Evas_Object *obj EINA_UNUSED)
65 free(cl); 66 free(cl);
66} 67}
67 68
69Eina_Bool
70_expert_simple_mode_toggle_changed(void *data EINA_UNUSED, const Eo_Event *event EINA_UNUSED)
71{
72 Eo *obj = event->obj;
73 Eina_Bool state = elm_obj_check_state_get(obj);
74 Egui_Layout_Widgets *g = egui_layout_gui_get();
75 const Gui_Context *ctx = _active_context_get();
76 if (!ctx) return EINA_TRUE;
77 const Gui_Widget *wdg = gui_context_data_get(ctx, SELECTED_WDG);
78 if (state)
79 {
80 efl_gfx_visible_set(g->main_win->simple_properties_scroll, EINA_TRUE);
81 efl_gfx_visible_set(g->main_win->properties_list, EINA_FALSE);
82 simple_propview_build(wdg);
83 }
84 else
85 {
86 efl_gfx_visible_set(g->main_win->simple_properties_scroll, EINA_FALSE);
87 efl_gfx_visible_set(g->main_win->properties_list, EINA_TRUE);
88 propview_build(wdg);
89 }
90 return EINA_TRUE;
91}
68/* This callback is called in the end of propview_build() 92/* This callback is called in the end of propview_build()
69 * in order to switch between scrollbox for properties 93 * in order to switch between scrollbox for properties
70 * and genlist for items. */ 94 * and genlist for items. */
@@ -81,6 +105,8 @@ _proplayout_build_post_cb(const Gui_Widget *wdg, It_Data_Type new_type)
81 } 105 }
82 case PROPERTY_TYPE: 106 case PROPERTY_TYPE:
83 { 107 {
108 efl_gfx_visible_set(g->main_win->propsview_toggle, EINA_FALSE);
109 elm_obj_table_unpack(g->main_win->propsview_table, g->main_win->propsview_toggle);
84 break; 110 break;
85 } 111 }
86 case CALLBACK_TYPE: 112 case CALLBACK_TYPE:
@@ -108,11 +134,11 @@ _proplayout_build_post_cb(const Gui_Widget *wdg, It_Data_Type new_type)
108 /* Setting view according to new selected toolbar's item. */ 134 /* Setting view according to new selected toolbar's item. */
109 efl_gfx_visible_set(g->main_win->contentview_box, EINA_FALSE); 135 efl_gfx_visible_set(g->main_win->contentview_box, EINA_FALSE);
110 efl_gfx_visible_set(g->main_win->properties_list, EINA_FALSE); 136 efl_gfx_visible_set(g->main_win->properties_list, EINA_FALSE);
137 efl_gfx_visible_set(g->main_win->simple_properties_scroll, EINA_FALSE);
111 efl_gfx_visible_set(g->main_win->itemview_box, EINA_FALSE); 138 efl_gfx_visible_set(g->main_win->itemview_box, EINA_FALSE);
112 efl_gfx_visible_set(g->main_win->callbacksview_box, EINA_FALSE); 139 efl_gfx_visible_set(g->main_win->callbacksview_box, EINA_FALSE);
113 efl_gfx_visible_set(g->main_win->description_list, EINA_FALSE); 140 efl_gfx_visible_set(g->main_win->description_list, EINA_FALSE);
114 141
115
116 elm_obj_box_unpack(g->main_win->itemview_box, g->main_win->itemview_buttons_box); 142 elm_obj_box_unpack(g->main_win->itemview_box, g->main_win->itemview_buttons_box);
117 efl_gfx_visible_set(g->main_win->itemview_buttons_box, EINA_FALSE); 143 efl_gfx_visible_set(g->main_win->itemview_buttons_box, EINA_FALSE);
118 144
@@ -125,7 +151,13 @@ _proplayout_build_post_cb(const Gui_Widget *wdg, It_Data_Type new_type)
125 } 151 }
126 case PROPERTY_TYPE: 152 case PROPERTY_TYPE:
127 { 153 {
128 efl_gfx_visible_set(g->main_win->properties_list, EINA_TRUE); 154 efl_gfx_visible_set(g->main_win->propsview_toggle, EINA_TRUE);
155 elm_obj_table_pack(g->main_win->propsview_table, g->main_win->propsview_toggle, 0, 2, 1, 1);
156 /* Call expert/simple view callback in order to show proper view. */
157 Eo_Event *tmp_event = calloc(1, sizeof(Eo_Event));
158 tmp_event->obj = g->main_win->propsview_toggle;
159 _expert_simple_mode_toggle_changed(NULL, tmp_event);
160 free(tmp_event);
129 break; 161 break;
130 } 162 }
131 case CALLBACK_TYPE: 163 case CALLBACK_TYPE:
@@ -324,6 +356,7 @@ proplayout_init()
324 descview_init(); 356 descview_init();
325 contentview_init(); 357 contentview_init();
326 propview_init(); 358 propview_init();
359 simple_propview_init();
327 itemview_init(); 360 itemview_init();
328 settingsview_init(); 361 settingsview_init();
329 362
@@ -350,6 +383,7 @@ proplayout_shutdown()
350 cbview_shutdown(); 383 cbview_shutdown();
351 descview_shutdown(); 384 descview_shutdown();
352 contentview_shutdown(); 385 contentview_shutdown();
386 simple_propview_shutdown();
353 propview_shutdown(); 387 propview_shutdown();
354 itemview_shutdown(); 388 itemview_shutdown();
355 389
diff --git a/src/bin/gui/props_helper.c b/src/bin/gui/props_helper.c
index 2de1c23..7809e8f 100644
--- a/src/bin/gui/props_helper.c
+++ b/src/bin/gui/props_helper.c
@@ -259,6 +259,18 @@ props_entry_add(Eo *box, const char *str, Gui_Type type)
259 return en; 259 return en;
260} 260}
261 261
262Eo*
263props_colorselector_add(Eo *box)
264{
265 Eo *cs = eo_add(ELM_COLORSELECTOR_CLASS, box);
266 evas_obj_size_hint_weight_set(cs, EVAS_HINT_EXPAND, 0.0);
267 evas_obj_size_hint_align_set(cs, EVAS_HINT_FILL, 0.5);
268 efl_gfx_visible_set(cs, EINA_TRUE);
269
270 elm_obj_box_pack_end(box, cs);
271 return cs;
272}
273
262Eo * 274Eo *
263props_label_add(Eo *box, const char *str) 275props_label_add(Eo *box, const char *str)
264{ 276{
diff --git a/src/bin/gui/props_helper.h b/src/bin/gui/props_helper.h
index d9b8a96..ba22775 100644
--- a/src/bin/gui/props_helper.h
+++ b/src/bin/gui/props_helper.h
@@ -26,6 +26,7 @@
26 }) 26 })
27 27
28#define _STR_EDITOR "editor" 28#define _STR_EDITOR "editor"
29#define _DEFAULT_VALUE "__default_value__"
29 30
30typedef enum 31typedef enum
31{ 32{
@@ -53,7 +54,9 @@ typedef struct
53 { 54 {
54 /* This Op_Desc is needed when we want to create empty property or content. */ 55 /* This Op_Desc is needed when we want to create empty property or content. */
55 /* For both: property and container. */ 56 /* For both: property and container. */
57 Simple_Op_Handler_Type input_handler_type;
56 const Op_Desc *op_desc; 58 const Op_Desc *op_desc;
59 const Original_Op_Desc *orig_op_desc;
57 const Gui_Widget_Property *prop; 60 const Gui_Widget_Property *prop;
58 /* Index of content in container. */ 61 /* Index of content in container. */
59 int idx; 62 int idx;
@@ -101,6 +104,9 @@ props_toggle_add(Eo *box, Eina_Bool state);
101Eo * 104Eo *
102props_button_add(Eo *box, char *text); 105props_button_add(Eo *box, char *text);
103 106
107Eo*
108props_colorselector_add(Eo *box);
109
104/* Only one list (or none) should be provided. */ 110/* Only one list (or none) should be provided. */
105Eo * 111Eo *
106props_hoversel_enums_add(Eo *box, Eo *hover_parent, const char *default_val, const Eina_List *enums_lst, const Eina_List *defaults_lst); 112props_hoversel_enums_add(Eo *box, Eo *hover_parent, const char *default_val, const Eina_List *enums_lst, const Eina_List *defaults_lst);
diff --git a/src/bin/gui/propview.c b/src/bin/gui/propview.c
index b5cbd08..0a66301 100644
--- a/src/bin/gui/propview.c
+++ b/src/bin/gui/propview.c
@@ -33,35 +33,6 @@ PropViewCbs *propview_cbs_get()
33 return _view_cbs; 33 return _view_cbs;
34} 34}
35 35
36static Eina_Bool
37_default_hover_selected_cb(void *data, const Eo_Event *event)
38{
39 const char *choosen_value = elm_object_item_part_text_get(event->event_info, NULL);
40 Eo *entry = data;
41 Par_Field_Data *pfd = NULL;
42 pfd = eo_key_data_get(entry, _STR_EDITOR);
43 const Op_Desc *op = pfd->it_data->op_desc;
44 Eina_List *def_vals = (Eina_List *) op_param_desc_default_values_list_get(db_op_desc_nth_param_desc_get(op, pfd->par_idx));
45 if (def_vals)
46 {
47 Param_Default_Value *def_val;
48 Eina_List *itr;
49 EINA_LIST_FOREACH(def_vals, itr, def_val)
50 {
51 if (!strcmp(choosen_value, param_default_value_name_get(def_val)))
52 {
53 elm_obj_widget_part_text_set(entry, NULL, param_default_value_get(def_val));
54 break;
55 }
56 }
57 }
58 Eo_Event *event_tmp = calloc(1, sizeof(Eo_Event));
59 event_tmp->obj = entry;
60 _view_cbs->property_update_cb_func(NULL, event_tmp);
61 free(event_tmp);
62 return EO_CALLBACK_CONTINUE;
63}
64
65/* This will be called when hoversel item is selected. 36/* This will be called when hoversel item is selected.
66 * If "Add resource..." item was selected, oper Resource Manager*/ 37 * If "Add resource..." item was selected, oper Resource Manager*/
67static Eina_Bool 38static Eina_Bool
@@ -150,7 +121,7 @@ _property_item_content_get(It_Data *it_data)
150 if (def_vals) 121 if (def_vals)
151 { 122 {
152 Eo *hover = props_hoversel_enums_add(box, elm_widget_top_get(box), "...", NULL, def_vals); 123 Eo *hover = props_hoversel_enums_add(box, elm_widget_top_get(box), "...", NULL, def_vals);
153 eo_event_callback_add(hover, EVAS_SELECTABLE_INTERFACE_EVENT_SELECTED, _default_hover_selected_cb, obj); 124 eo_event_callback_add(hover, EVAS_SELECTABLE_INTERFACE_EVENT_SELECTED, _view_cbs->default_hover_selected_cb_func, obj);
154 } 125 }
155 } 126 }
156 } 127 }
@@ -239,6 +210,12 @@ _prop_item_content_get(void *data, Evas_Object *obj EINA_UNUSED, const char *par
239 return it_box; 210 return it_box;
240} 211}
241 212
213Evas_Object *
214prop_item_content_get(It_Data *data)
215{
216 return _prop_item_content_get(data, NULL, NULL);
217}
218
242static void 219static void
243_prop_item_del(void *data, Evas_Object *obj EINA_UNUSED) 220_prop_item_del(void *data, Evas_Object *obj EINA_UNUSED)
244{ 221{
diff --git a/src/bin/gui/propview.h b/src/bin/gui/propview.h
index 739f0c4..1116da0 100644
--- a/src/bin/gui/propview.h
+++ b/src/bin/gui/propview.h
@@ -1,4 +1,3 @@
1
2#ifndef _PROPVIEW_H 1#ifndef _PROPVIEW_H
3#define _PROPVIEW_H 2#define _PROPVIEW_H
4 3
@@ -10,6 +9,7 @@ typedef struct
10{ 9{
11 Eina_Bool (*property_update_cb_func)(void *data, const Eo_Event *event); 10 Eina_Bool (*property_update_cb_func)(void *data, const Eo_Event *event);
12 Eina_Bool (*property_ctx_menu_cb_func)(void *data, const Eo_Event *event); 11 Eina_Bool (*property_ctx_menu_cb_func)(void *data, const Eo_Event *event);
12 Eina_Bool (*default_hover_selected_cb_func)(void *data, const Eo_Event *event);
13} PropViewCbs; 13} PropViewCbs;
14 14
15PropViewCbs * 15PropViewCbs *
diff --git a/src/bin/gui/simple_propview.c b/src/bin/gui/simple_propview.c
new file mode 100644
index 0000000..c9e7d07
--- /dev/null
+++ b/src/bin/gui/simple_propview.c
@@ -0,0 +1,600 @@
1#include <Elementary.h>
2#include "props_helper.h"
3#include "egui_log.h"
4#include "gui_widget.h"
5#include "propview.h"
6#include "simple_propview.h"
7#include "egui_logic_private.h"
8#include "ffi_glue.h"
9#include "rmview.h"
10#include "popup.h"
11
12#include "elm_widget_container.h"
13
14#define __SECTION_NAME "__section_name__"
15
16static Eo *_simple_properties_box;
17
18static PropViewCbs *_simple_propview_cbs = NULL;
19
20static Eina_Bool
21_pfd_free_cb(void *pfd, const Eo_Event *event EINA_UNUSED)
22{
23 free(pfd);
24 return EINA_TRUE;
25}
26
27static Eina_Bool
28_it_data_free_cb(void *data, const Eo_Event *event EINA_UNUSED)
29{
30 _it_data_free(data);
31 return EINA_TRUE;
32}
33
34static Eina_Bool
35_hover_selected_cb(void *data EINA_UNUSED, const Eo_Event *event)
36{
37 Eo *obj = event->obj;
38 void *event_info = event->event_info;
39 const char *choosen_value = elm_object_item_part_text_get(event_info, NULL);
40 if (!strcmp(choosen_value, PROP_HOVERSEL_ADD_RESOURCE_VALUE))
41 {
42 const Egui_Layout_Widgets *g_main_wdgs = egui_layout_gui_get();
43 rm_win_set(egui_layout_rm_win_create(g_main_wdgs->main_win->main_win));
44 rm_win_post_configure();
45 }
46 else
47 {
48 Eo_Event *tmp_event = calloc(1, sizeof(Eo_Event));
49 tmp_event->obj = obj;
50 tmp_event->event_info = event_info;
51 _simple_propview_cbs->property_update_cb_func(NULL, event);
52 free(tmp_event);
53 }
54 return EO_CALLBACK_CONTINUE;
55}
56
57static Eina_Bool
58_slider_drag_stop_cb(void *data EINA_UNUSED, const Eo_Event *event)
59{
60 double num = elm_obj_slider_value_get(event->obj);
61 num = (round(num * 10))/10;
62 elm_obj_slider_value_set(event->obj, num);
63
64 Eo_Event *tmp_event = calloc(1, sizeof(Eo_Event));
65 tmp_event->obj = event->obj;
66 _simple_propview_cbs->property_update_cb_func(NULL, tmp_event);
67 free(tmp_event);
68
69 return EO_CALLBACK_CONTINUE;
70}
71
72void
73simple_propview_init()
74{
75 Egui_Layout_Widgets *g = egui_layout_gui_get();
76 _simple_properties_box = g->main_win->simple_properties_box;
77 _simple_propview_cbs = propview_cbs_get();
78}
79
80void
81simple_propview_shutdown()
82{
83}
84
85typedef struct
86{
87 int r, g, b, a;
88 It_Data *it_data;
89 Eo *button;
90 Eo *rect;
91} Prop_Change_Data;
92
93static Eina_Bool
94_colorselector_changed_cb(void *data, const Eo_Event *event)
95{
96 Prop_Change_Data *pcd = data;
97 elm_obj_colorselector_color_get(event->obj, &pcd->r, &pcd->g, &pcd->b, &pcd->a);
98 efl_gfx_color_set(pcd->rect, pcd->r, pcd->g, pcd->b, pcd->a);
99 return EO_CALLBACK_CONTINUE;
100}
101
102static Eo *
103_popup_colorselector_get(void *data, Eo *popup)
104{
105 Prop_Change_Data *pcd = data;
106
107 Eo *bx = eo_add(ELM_BOX_CLASS, popup);
108 evas_obj_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
109 evas_obj_size_hint_align_set(bx, EVAS_HINT_FILL, EVAS_HINT_FILL);
110 efl_gfx_visible_set(bx, EINA_TRUE);
111
112 Eo *re = eo_add(EVAS_RECTANGLE_CLASS, popup);
113 evas_obj_size_hint_min_set(re, 1, ELM_SCALE_SIZE(100));
114 evas_obj_size_hint_align_set(re, EVAS_HINT_FILL, EVAS_HINT_FILL);
115 efl_gfx_visible_set(re, EINA_TRUE);
116 elm_box_pack_end(bx, re);
117 pcd->rect = re;
118 efl_gfx_color_set(pcd->rect, pcd->r, pcd->g, pcd->b, pcd->a);
119
120 Eo *cs = eo_add(ELM_COLORSELECTOR_CLASS, popup);
121 efl_gfx_visible_set(cs, EINA_TRUE);
122
123 elm_obj_colorselector_color_set(cs, pcd->r, pcd->g, pcd->b, pcd->a);
124 evas_obj_size_hint_weight_set(cs, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
125 evas_obj_size_hint_align_set(cs, EVAS_HINT_FILL, EVAS_HINT_FILL);
126 eo_event_callback_add(cs, ELM_COLORSELECTOR_EVENT_CHANGED, _colorselector_changed_cb, pcd);
127
128 elm_box_pack_end(bx, cs);
129 return bx;
130}
131
132/* Callback called when Ok or Cancel button is pressed. */
133static void
134_color_change_popup_cb(Popup_Button_Type button_type, void *data)
135{
136 Prop_Change_Data *pcd = data;
137 if (button_type == POPUP_OK_BUTTON)
138 {
139 efl_gfx_color_set(pcd->button, pcd->r, pcd->g, pcd->b, pcd->a);
140 It_Data *it_data = pcd->it_data;
141
142 const Gui_Widget *wdg = it_data->wdg;
143 Gui_Widget_Property *prop = NULL, *old_property = NULL;
144 Gui_Value *val = NULL;
145 Gui_Context *ctx = _active_context_get();
146
147 prop = (Gui_Widget_Property *) it_data->prop;
148 /* propdata box, change its color then value changed from default. */
149 Eo *box = it_data->box;
150
151 /* Save old property to be able to add it to UndoRedo stack. */
152 old_property = prop;
153 /* Every time value is changed, crete new property. */
154 prop = prop_copy(prop);
155
156 val = prop_value_nth_get(prop, 0);
157 gui_value_int_set(val, pcd->r);
158 val = prop_value_nth_get(prop, 1);
159 gui_value_int_set(val, pcd->g);
160 val = prop_value_nth_get(prop, 2);
161 gui_value_int_set(val, pcd->b);
162 val = prop_value_nth_get(prop, 3);
163 gui_value_int_set(val, pcd->a);
164
165 if (prop_wdg_get(old_property))
166 {
167 memento_command_add(wdg_eid_get(wdg), MEMENTO_PROPERTY, old_property, prop);
168 memento_focused_widget_add(wdg_eid_get(wdg));
169 wdg_prop_remove((Gui_Widget *) wdg, old_property);
170 }
171 /* If not, this prop is default property which was fetched from _ffi_eo_do, don't need to save it,
172 * but need to make it white.
173 * This happens only when value is changed for the first time. */
174 else
175 {
176 efl_gfx_color_set(box, 255, 255, 255, 255);
177 prop_ref(old_property);
178 prop_unref(old_property);
179 old_property = NULL;
180 memento_command_add(wdg_eid_get(wdg), MEMENTO_PROPERTY, old_property, prop);
181 memento_focused_widget_add(wdg_eid_get(wdg));
182 }
183
184 /* Assign new prop to widget */
185 wdg_prop_add((Gui_Widget *) wdg, prop);
186 /* Save new prop in item. */
187 it_data->prop = prop;
188 context_memento_finalize(ctx);
189 }
190 free(pcd);
191}
192
193static Eina_Bool
194_csb_clicked_cb(void *data, const Eo_Event *event)
195{
196 const Egui_Layout_Widgets *g_main_wdgs = egui_layout_gui_get();
197
198 It_Data *it_data = data;
199 const Gui_Widget_Property *prop = it_data->prop;
200 int r = 255, g = 255, b = 255, a = 255;
201 if (prop)
202 {
203 r = INT_GET(prop_value_nth_get(prop, 0));
204 g = INT_GET(prop_value_nth_get(prop, 1));
205 b = INT_GET(prop_value_nth_get(prop, 2));
206 a = INT_GET(prop_value_nth_get(prop, 3));
207 }
208
209 Prop_Change_Data *pcd = calloc(1, sizeof(Prop_Change_Data));
210 pcd->r = r;
211 pcd->g = g;
212 pcd->b = b;
213 pcd->a = a;
214 pcd->it_data = it_data;
215 pcd->button = event->obj;
216
217 popup_show(g_main_wdgs->main_win->main_win, NULL, NULL, _popup_colorselector_get, pcd, POPUP_OK_BUTTON | POPUP_CANCEL_BUTTON, _color_change_popup_cb, pcd);
218 return EO_CALLBACK_CONTINUE;
219}
220
221static void
222_simple_property_handler_get(Eo *box, It_Data *it_data, const char *name)
223{
224 it_data->box = box;
225
226 //const Original_Op_Desc *orig_op_desc = it_data->orig_op_desc;
227 //const Op_Desc *op = original_op_desc_get(orig_op_desc);
228
229 props_label_add(box, name);
230
231 if (it_data->input_handler_type == SIMPLE_OP_HANDLER_COLORSELECTOR)
232 {
233 int r = 255, g = 255, b = 255, a = 255;
234 const Gui_Widget_Property *prop = it_data->prop;
235 if (prop)
236 {
237 r = INT_GET(prop_value_nth_get(prop, 0));
238 g = INT_GET(prop_value_nth_get(prop, 1));
239 b = INT_GET(prop_value_nth_get(prop, 2));
240 a = INT_GET(prop_value_nth_get(prop, 3));
241 }
242
243 Eo *re = eo_add(EVAS_RECTANGLE_CLASS, box);
244 evas_obj_size_hint_weight_set(re, EVAS_HINT_EXPAND, 0);
245 evas_obj_size_hint_align_set(re, EVAS_HINT_FILL, EVAS_HINT_FILL);
246 efl_gfx_color_set(re, r, g, b, a);
247 efl_gfx_visible_set(re, EINA_TRUE);
248 eo_event_callback_add(re, EVAS_OBJECT_EVENT_MOUSE_UP, _csb_clicked_cb, it_data);
249 elm_box_pack_end(box, re);
250 }
251 else if (it_data->input_handler_type == SIMPLE_OP_HANDLER_SLIDER)
252 {
253 unsigned int count, i;
254 const Gui_Widget_Property *prop = it_data->prop;
255 const Op_Desc *op = prop_op_desc_get(prop);
256 count = db_op_desc_param_number_get(op);
257
258 for (i = 0; i < count; i++)
259 {
260 double val = DOUBLE_GET(prop_value_nth_get(prop, i));
261
262 const Simple_View_Slider_Data *sd = original_op_data_get(it_data->orig_op_desc);
263
264 Eo *sldr = eo_add(ELM_SLIDER_CLASS, box);
265 efl_gfx_visible_set(sldr, EINA_TRUE);
266 evas_obj_size_hint_weight_set(sldr, EVAS_HINT_EXPAND, 1);
267 evas_obj_size_hint_align_set(sldr, EVAS_HINT_FILL, -1);
268 elm_obj_slider_indicator_show_set(sldr, EINA_TRUE);
269 elm_obj_slider_indicator_format_set(sldr, "%1.1f");
270 elm_obj_slider_unit_format_set(sldr, "%1.1f");
271 elm_obj_slider_min_max_set(sldr, sd->min, sd->max);
272 elm_obj_slider_step_set(sldr, sd->step);
273 elm_obj_slider_value_set(sldr, val);
274
275 eo_event_callback_add(sldr, ELM_SLIDER_EVENT_SLIDER_DRAG_STOP, _slider_drag_stop_cb, NULL);
276 elm_box_pack_end(box, sldr);
277
278 Par_Field_Data *pfd = calloc (1, sizeof(Par_Field_Data));
279 pfd->it_data = it_data;
280 pfd->par_idx = i;
281
282 eo_key_data_set(sldr, _STR_EDITOR, pfd);
283 eo_event_callback_add(sldr, EO_BASE_EVENT_DEL, _pfd_free_cb, pfd);
284
285 const char *tooltip_text = op_param_desc_name_get(db_op_desc_nth_param_desc_get(op, pfd->par_idx));
286 elm_object_tooltip_text_set(sldr, tooltip_text);
287
288
289 Eina_List *def_vals = (Eina_List *) op_param_desc_default_values_list_get(db_op_desc_nth_param_desc_get(op, i));
290 if (def_vals)
291 {
292 Eo *hover = props_hoversel_enums_add(box, elm_widget_top_get(box), "...", NULL, def_vals);
293 eo_event_callback_add(hover, EVAS_SELECTABLE_INTERFACE_EVENT_SELECTED, _simple_propview_cbs->default_hover_selected_cb_func, sldr);
294 }
295 }
296 }
297}
298
299static void
300_property_item_content_get(Eo *box, It_Data *it_data, const char *name)
301{
302 it_data->box = box;
303
304 const Original_Op_Desc *orig_op_desc = it_data->orig_op_desc;
305 const Op_Desc *op = original_op_desc_get(orig_op_desc);
306 const Gui_Widget_Property *prop = it_data->prop;
307 /* Add label with op name. */
308 props_label_add(box, name);
309
310 unsigned int count, i;
311 count = db_op_desc_param_number_get(op);
312
313 const Eina_List *param_mapping_list = original_op_mapping_array_get(orig_op_desc);
314
315 for (i = 0; i < count; i++)
316 {
317 /* Get value, for which we want to build field.
318 * If it is NULL, field will be build, for nth value in Op_Desc*/
319 Gui_Value *value = ((prop && prop_value_get(prop)) ? prop_value_nth_get(prop, i) : NULL);
320 /* Checking mapping array. If value is not IDX, means this is constant and we don't show edit field. */
321 if (param_mapping_list)
322 {
323 Gui_Value *mapping_value = eina_list_nth(param_mapping_list, i);
324 if (gui_value_type_get(mapping_value) != GUI_TYPE_IDX)
325 {
326 /* If mapping_value is not IDX(i.e constant) and property value is not equal,
327 * box mus be disabled. */
328 if (gui_value_cmp(value, mapping_value))
329 {
330 elm_obj_widget_disabled_set(box, EINA_TRUE);
331 efl_gfx_color_set(box, 180, 180, 180, 255);
332 }
333 continue;
334 }
335 }
336 Eo *obj = props_value_add(box, it_data->wdg, value, op, i);
337 if (obj)
338 {
339 Par_Field_Data *pfd = calloc (1, sizeof(Par_Field_Data));
340 pfd->it_data = it_data;
341 pfd->par_idx = i;
342
343 eo_key_data_set(obj, _STR_EDITOR, pfd);
344 eo_event_callback_add(obj, EO_BASE_EVENT_DEL, _pfd_free_cb, pfd);
345
346 const char *tooltip_text = op_param_desc_name_get(db_op_desc_nth_param_desc_get(op, pfd->par_idx));
347 elm_object_tooltip_text_set(obj, tooltip_text);
348
349 if (eo_isa(obj, ELM_HOVERSEL_CLASS))
350 {
351 /* pass box as a data, in order to change its color then value changed from default. */
352 eo_event_callback_add(obj, EVAS_SELECTABLE_INTERFACE_EVENT_SELECTED, _hover_selected_cb, NULL);
353 }
354 else if (eo_isa(obj, ELM_CHECK_CLASS))
355 {
356 /* pass box as a data, in order to change its color then value changed from default. */
357 eo_event_callback_add(obj, ELM_CHECK_EVENT_CHANGED, _simple_propview_cbs->property_update_cb_func, NULL);
358 }
359 else if (eo_isa(obj, ELM_ENTRY_CLASS))
360 {
361 /*FIXME: decide how to handle CHANGE ON ACTIVATE*/
362 /* pass box as a data, in order to change its color then value changed from default. */
363 eo_event_callback_add(obj, ELM_ENTRY_EVENT_CHANGED_USER, _simple_propview_cbs->property_update_cb_func, NULL);
364
365 /* If there are default values, add Hoversel. */
366 Eina_List *def_vals = (Eina_List *) op_param_desc_default_values_list_get(db_op_desc_nth_param_desc_get(op, i));
367 if (def_vals)
368 {
369 Eo *hover = props_hoversel_enums_add(box, elm_widget_top_get(box), "...", NULL, def_vals);
370 eo_event_callback_add(hover, EVAS_SELECTABLE_INTERFACE_EVENT_SELECTED, _simple_propview_cbs->default_hover_selected_cb_func, obj);
371 }
372 }
373 }
374 else
375 {
376 /*
377 ERR("Can't create field for %dnth parameter in \"%s\", \
378 probably this parameter is NULL pointer", i + 1, db_op_desc_op_name_get(op));
379 */
380 }
381 }
382}
383
384static Eo *
385_simple_prop_item_content_get(It_Data *data, const char *simple_op_name)
386{
387 It_Data *it_data = data;
388 const Op_Desc *op_desc = original_op_desc_get(it_data->orig_op_desc);
389
390 if (!it_data->prop)
391 {
392 it_data->prop = prop_create_for_op(op_desc);
393 const Gui_Context *ctx = _active_context_get();
394 Gui_Session *session = (Gui_Session *) gui_context_editor_session_get(ctx);
395
396 /* Check if get function is implemented for this property. */
397 Eolian_Function_Type func_type = db_op_desc_type_get(op_desc);
398 const Eolian_Class *f_klass = eolian_class_get_by_name(db_op_desc_class_name_get(op_desc));
399 const Eolian_Class *w_klass = eolian_class_get_by_name(wdg_class_name_get(it_data->wdg));
400
401 const char *func_name = db_op_desc_op_name_get(op_desc);
402
403 const Eolian_Function *func_id = eolian_class_function_get_by_name(f_klass, func_name, func_type);
404 Eina_Bool ret = eolian_function_is_implemented(func_id, func_type, w_klass);
405 if (ret)
406 {
407 manager_widget_property_get(session, it_data->wdg, it_data->prop);
408 }
409 else
410 {
411 ERR("Func: \"%s::%s\" was not implemented for class \"%s\"", eolian_class_name_get(f_klass),
412 func_name,
413 eolian_class_name_get(w_klass));
414 }
415 }
416
417 Evas_Object * it_box = NULL;
418 it_box = eo_add(ELM_BOX_CLASS, _simple_properties_box);
419 efl_gfx_visible_set(it_box, EINA_TRUE);
420 elm_obj_box_horizontal_set(it_box, EINA_TRUE);
421 elm_obj_box_padding_set(it_box, 5, 0);
422 evas_obj_size_hint_weight_set(it_box, EVAS_HINT_EXPAND, 0);
423 evas_obj_size_hint_align_set(it_box, EVAS_HINT_FILL, 0);
424
425 if (it_data->input_handler_type == SIMPLE_OP_HANDLER_REGULAR)
426 {
427 _property_item_content_get(it_box, it_data, simple_op_name);
428 }
429 else
430 {
431 _simple_property_handler_get(it_box, it_data, simple_op_name);
432 }
433
434 Eo *prop_menu_button = props_button_add(it_box, NULL);
435 evas_obj_size_hint_align_set(prop_menu_button, 1, 0);
436 evas_obj_size_hint_weight_set(prop_menu_button, 0.01, 0);
437 eo_key_data_set(prop_menu_button, _STR_EDITOR, it_data);
438 eo_event_callback_add(prop_menu_button, EVAS_CLICKABLE_INTERFACE_EVENT_CLICKED, _simple_propview_cbs->property_ctx_menu_cb_func, NULL);
439
440 Eo *ic = eo_add(ELM_ICON_CLASS, it_box);
441 efl_file_set(ic, EGUI_LAYOUT_IMAGES_PATH"/icon_prop_menu2.png", NULL);
442 elm_obj_container_content_set(prop_menu_button, "icon", ic);
443
444 if (!prop_wdg_get(it_data->prop))
445 efl_gfx_color_set(it_box, 150, 150, 150, 255);
446 else
447 efl_gfx_color_set(it_box, 255, 255, 255, 255);
448
449 return it_box;
450}
451
452Original_Op_Desc*
453gui_widget_original_desc_by_simple_get(const Gui_Widget *wdg, Simple_Op_Desc *simple_op_desc)
454{
455 Original_Op_Desc *ret = NULL;
456
457 const Eina_List *orig_op_desc_list, *itr1, *itr2;
458 Original_Op_Desc *orig_op_desc;
459 Eina_Stringshare *wdg_class_name = wdg_class_name_get(wdg), *class_name;
460
461 orig_op_desc_list = simple_op_desc_original_ops_list_get(simple_op_desc);
462 Eina_Bool inherits = EINA_FALSE;
463
464 const Op_Desc *op_desc = NULL;
465 EINA_LIST_FOREACH(orig_op_desc_list, itr1, orig_op_desc)
466 {
467 const Eina_List *class_list = original_op_classes_list_get(orig_op_desc);
468 op_desc = original_op_desc_get(orig_op_desc);
469 /* If op_desc == NULL, this is black list case*/
470 if (!op_desc)
471 {
472 if (!class_list) return ret;
473 EINA_LIST_FOREACH(class_list, itr2, class_name)
474 {
475 if (class_name == wdg_class_name)
476 return ret;
477 }
478 }
479 if ((inherits = eo_class_inherits_from(wdg_class_name, db_op_desc_class_name_get(op_desc))))
480 {
481 Eina_Bool found_in_list = EINA_FALSE;
482 /* If class_list is not NULL, look for class name in it.
483 * If class_list is NULL - this means this is default op*/
484 if (class_list)
485 {
486 EINA_LIST_FOREACH(class_list, itr2, class_name)
487 {
488 if (class_name == wdg_class_name)
489 {
490 found_in_list = EINA_TRUE;
491 break;
492 }
493 }
494 }
495 else
496 {
497 found_in_list = EINA_TRUE;
498 }
499
500 if (found_in_list)
501 {
502 ret = orig_op_desc;
503 break;
504 }
505 }
506 }
507
508 return ret;
509}
510
511void
512simple_propview_build(const Gui_Widget *wdg)
513{
514 const Eina_List *simple_op_desc_list, *itr1;
515 Simple_Op_Desc *simple_op_desc;
516 const Original_Op_Desc *orig_op_desc;
517
518 elm_obj_box_clear(_simple_properties_box);
519
520 simple_op_desc_list = simple_op_desc_list_get();
521 EINA_LIST_FOREACH(simple_op_desc_list, itr1, simple_op_desc)
522 {
523 if (!simple_op_desc_section_name_get(simple_op_desc))
524 {
525 simple_op_desc_section_name_set(simple_op_desc, "Others");
526 }
527
528 Simple_Op_Handler_Type input_handler_type = simple_op_desc_input_handler_type_get(simple_op_desc);
529
530 if ((orig_op_desc = gui_widget_original_desc_by_simple_get(wdg, simple_op_desc)))
531 {
532 Eina_Stringshare *section_name = simple_op_desc_section_name_get(simple_op_desc);
533 const Op_Desc *op_desc = original_op_desc_get(orig_op_desc);
534
535 Eina_List *pitems = NULL, *itr2;
536 Eina_List *wdg_prop_lst = wdg_prop_list_get(wdg);
537 Gui_Widget_Property *prop;
538
539 // Find which class properties are in widget. Can be more than one.
540 EINA_LIST_FOREACH(wdg_prop_lst, itr2, prop)
541 if (prop_op_desc_get(prop) == op_desc) pitems = eina_list_append(pitems, prop);
542
543 // If none found, its a default one
544 if (!eina_list_count(pitems)) pitems = eina_list_append(pitems, NULL);
545
546 // Looking for a section with desired name
547 Eo *section_frame = NULL, *sect_itr;
548 Eina_Bool section_not_found = EINA_TRUE;
549 Eina_List *sections = elm_obj_box_children_get(_simple_properties_box);
550 EINA_LIST_FREE(sections, sect_itr)
551 {
552 if (section_not_found)
553 {
554 if (eo_key_data_get(sect_itr, __SECTION_NAME) == section_name)
555 {
556 section_frame = sect_itr;
557 section_not_found = EINA_FALSE;
558 }
559 }
560 }
561
562 Eo *section_box = NULL;
563 if (!section_frame)
564 {
565 section_frame = eo_add(ELM_FRAME_CLASS, _simple_properties_box);
566 evas_obj_size_hint_weight_set(section_frame, EVAS_HINT_EXPAND, 0);
567 evas_obj_size_hint_align_set(section_frame, EVAS_HINT_FILL, 0);
568 efl_gfx_visible_set(section_frame, EINA_TRUE);
569 eo_key_data_set(section_frame, __SECTION_NAME, section_name);
570 elm_obj_widget_part_text_set(section_frame, NULL, section_name);
571 elm_obj_box_pack_end(_simple_properties_box, section_frame);
572 elm_obj_frame_autocollapse_set(section_frame, EINA_TRUE);
573
574 section_box = eo_add(ELM_BOX_CLASS, section_frame);
575 evas_obj_size_hint_weight_set(section_box, EVAS_HINT_EXPAND, 0);
576 evas_obj_size_hint_align_set(section_box, EVAS_HINT_FILL, 0);
577 efl_gfx_visible_set(section_box, EINA_TRUE);
578
579 elm_obj_container_content_set(section_frame, NULL, section_box);
580 }
581 else
582 {
583 section_box = elm_obj_container_content_get(section_frame, NULL);
584 }
585
586 EINA_LIST_FREE(pitems, prop)
587 {
588 It_Data *it_data = IT_DATA_BUILD(PROPERTY_TYPE, wdg);
589 it_data->orig_op_desc = orig_op_desc;
590 it_data->prop = prop;
591 it_data->input_handler_type = input_handler_type;
592 Eo *prop_box = _simple_prop_item_content_get(it_data, simple_op_desc_name_get(simple_op_desc));
593 eo_event_callback_add(prop_box, EO_BASE_EVENT_DEL, _it_data_free_cb, it_data);
594 //elm_obj_box_pack_end(_simple_properties_box, prop_box);
595 elm_obj_box_pack_end(section_box, prop_box);
596 }
597 }
598 }
599}
600
diff --git a/src/bin/gui/simple_propview.h b/src/bin/gui/simple_propview.h
new file mode 100644
index 0000000..8b6bc94
--- /dev/null
+++ b/src/bin/gui/simple_propview.h
@@ -0,0 +1,14 @@
1#ifndef _SIMPLE_PROPVIEW_H
2#define _SIMPLE_PROPVIEW_H
3
4#include <Eo.h>
5
6void
7simple_propview_init();
8
9void
10simple_propview_shutdown();
11
12void
13simple_propview_build(const Gui_Widget *wdg);
14#endif
diff --git a/src/lib/CMakeLists.txt b/src/lib/CMakeLists.txt
index 2591e1b..88c874e 100644
--- a/src/lib/CMakeLists.txt
+++ b/src/lib/CMakeLists.txt
@@ -12,6 +12,7 @@ LIST(APPEND GUI_PARSER_CC_SOURCES
12 plugin_C.c 12 plugin_C.c
13 undoredo.c 13 undoredo.c
14 updater.c 14 updater.c
15 desc_simple_parser.c
15 ) 16 )
16 17
17LIST(APPEND ESPION_CC_SOURCES 18LIST(APPEND ESPION_CC_SOURCES
diff --git a/src/lib/database.c b/src/lib/database.c
index eb227ce..8de7cda 100644
--- a/src/lib/database.c
+++ b/src/lib/database.c
@@ -19,6 +19,8 @@
19#include "elm_interface_atspi_accessible.eo.h" 19#include "elm_interface_atspi_accessible.eo.h"
20#include "elm_interface_atspi_window.eo.h" 20#include "elm_interface_atspi_window.eo.h"
21 21
22#include "desc_simple_parser.h"
23
22static int _db_log_dom = -1; 24static int _db_log_dom = -1;
23 25
24static Eina_Bool _db_init_count = 0; 26static Eina_Bool _db_init_count = 0;
@@ -45,6 +47,33 @@ struct _Op_Desc
45 Eina_Bool is_constructor; 47 Eina_Bool is_constructor;
46}; 48};
47 49
50/* Simple op description:
51 * - input handler type;
52 * - list of original op descriptions with mapping rules*/
53struct _Simple_Op_Desc
54{
55 Eina_Stringshare *section_name;
56 Eina_Stringshare *simple_op_name;
57 Simple_Op_Handler_Type input_handler_type;
58 Eina_List *original_op_desc;
59
60 /* Info about additional settings on handler.
61 * Like min, max, step, etc
62 * Actually it must be implemented in Original_Op_Desc per parameter. */
63 void *data;
64 void (*_data_free_cb)(void *data);
65};
66
67struct _Original_Op_Desc
68{
69 Op_Desc *op_desc;
70 Eina_List *params_mapping_array; /* Parameters mapping array - list of Gui_Value */
71 Eina_List *classes; /* List of classes this op_desc active for. List of Eina_Stringshare */
72
73 /* Pointer to data in Simple op desc. */
74 const void *data;
75};
76
48struct _Container_Desc 77struct _Container_Desc
49{ 78{
50 Op_Desc *_op_pack; 79 Op_Desc *_op_pack;
@@ -96,6 +125,8 @@ static Eina_Hash *enum_table = NULL; /* ["ENUM_NAME"]->[{1}] */
96static Eina_Hash *enum_types_table = NULL; /* ["Elm_Win_Type"]->[ELM_WIN_BASIC, ELM_WIN_DIALOG_BASIC, ..] */ 125static Eina_Hash *enum_types_table = NULL; /* ["Elm_Win_Type"]->[ELM_WIN_BASIC, ELM_WIN_DIALOG_BASIC, ..] */
97static Eina_Hash *container_table = NULL; /* Hash ["Elm_Box"]-> struct describing container */ 126static Eina_Hash *container_table = NULL; /* Hash ["Elm_Box"]-> struct describing container */
98 127
128static Eina_List *simple_op_list = NULL; /* List ["color"]-> struct describing mapping of simple into real property */
129
99static char *gui_type_names[] = 130static char *gui_type_names[] =
100{ 131{
101 "GUI_TYPE_ZERO", 132 "GUI_TYPE_ZERO",
@@ -1228,6 +1259,8 @@ db_init(const char *db_path, const char *all_eo_path, const char *black_list)
1228 1259
1229 eina_hash_free(typedef_table); 1260 eina_hash_free(typedef_table);
1230 1261
1262 simple_op_parser_db_init(PACKAGE_DATA_DIR"/config/simple_op_db.txt");
1263
1231 return EINA_TRUE; 1264 return EINA_TRUE;
1232} 1265}
1233 1266
@@ -1237,6 +1270,12 @@ db_shutdown()
1237 if (--_db_init_count > 0) 1270 if (--_db_init_count > 0)
1238 return EINA_TRUE; 1271 return EINA_TRUE;
1239 1272
1273 Simple_Op_Desc *s_op_desc;
1274 EINA_LIST_FREE(simple_op_list, s_op_desc)
1275 {
1276 simple_op_desc_del(s_op_desc);
1277 }
1278
1240 eina_hash_free(cl_table); 1279 eina_hash_free(cl_table);
1241 eina_hash_free(enum_table); 1280 eina_hash_free(enum_table);
1242 eina_hash_free(enum_types_table); 1281 eina_hash_free(enum_types_table);
@@ -1625,3 +1664,214 @@ db_op_desc_is_constructor(const Op_Desc *op_desc)
1625{ 1664{
1626 return (op_desc ? op_desc->is_constructor : EINA_FALSE); 1665 return (op_desc ? op_desc->is_constructor : EINA_FALSE);
1627} 1666}
1667
1668static Simple_Op_Desc *
1669_simple_op_desc_find(const char *_simple_op_name)
1670{
1671 Eina_List *itr;
1672 Simple_Op_Desc *ret = NULL, *s_op_desc;
1673 Eina_Stringshare *simple_op_name;
1674
1675 char *_simple_op_name_lower = strdup(_simple_op_name);
1676 //eina_str_tolower(&_simple_op_name_lower);
1677 simple_op_name = eina_stringshare_add(_simple_op_name_lower);
1678
1679 EINA_LIST_FOREACH(simple_op_list, itr, s_op_desc)
1680 {
1681 if (simple_op_name == s_op_desc->simple_op_name)
1682 {
1683 ret = s_op_desc;
1684 break;
1685 }
1686 }
1687
1688 free(_simple_op_name_lower);
1689 eina_stringshare_del(simple_op_name);
1690 return ret;
1691}
1692
1693/* Get list of all Simple Op Descs in order it was added,
1694 * t.e. database order. */
1695const Eina_List *
1696simple_op_desc_list_get()
1697{
1698 return simple_op_list;
1699}
1700
1701/* Returns Simple_Op_Desc for op_name.
1702 * If op description doesn't exist it will be created
1703 * for lower cased name. */
1704Simple_Op_Desc *
1705simple_op_desc_get(const char *_simple_op_name)
1706{
1707 EINA_SAFETY_ON_NULL_RETURN_VAL(_simple_op_name, NULL);
1708 Simple_Op_Desc *ret = NULL;
1709
1710 ret = _simple_op_desc_find(_simple_op_name);
1711
1712 if (!ret)
1713 {
1714 char *_simple_op_name_lower = strdup(_simple_op_name);
1715 //eina_str_tolower(&_simple_op_name_lower);
1716
1717 ret = calloc(1, sizeof(Simple_Op_Desc));
1718 ret->simple_op_name = eina_stringshare_add(_simple_op_name_lower);
1719 simple_op_list = eina_list_append(simple_op_list, ret);
1720
1721 free(_simple_op_name_lower);
1722 }
1723 return ret;
1724}
1725
1726static void
1727_simple_op_desc_data_set(Simple_Op_Desc *simple_op_desc, void *data, void (*_data_free_cb)(void *data))
1728{
1729 EINA_SAFETY_ON_NULL_RETURN(simple_op_desc);
1730 simple_op_desc->data = data;
1731 simple_op_desc->_data_free_cb = _data_free_cb;
1732}
1733
1734void *
1735simple_op_desc_data_get(Simple_Op_Desc *simple_op_desc)
1736{
1737 EINA_SAFETY_ON_NULL_RETURN_VAL(simple_op_desc, NULL);
1738 return simple_op_desc->data;
1739}
1740
1741static void
1742_simple_op_desc_data_del(Simple_Op_Desc *simple_op_desc)
1743{
1744 EINA_SAFETY_ON_NULL_RETURN(simple_op_desc);
1745 if (simple_op_desc->data && simple_op_desc->_data_free_cb)
1746 {
1747 simple_op_desc->_data_free_cb(simple_op_desc->data);
1748 }
1749 simple_op_desc->data = NULL;
1750 simple_op_desc->_data_free_cb = NULL;
1751}
1752
1753/* Delete Simple_Op_Desc */
1754void
1755simple_op_desc_del(Simple_Op_Desc *s_op_desc)
1756{
1757 EINA_SAFETY_ON_NULL_RETURN(s_op_desc);
1758 Eina_Stringshare *class_name;
1759 Original_Op_Desc *o_op_desc;
1760
1761 EINA_LIST_FREE(s_op_desc->original_op_desc, o_op_desc)
1762 {
1763 EINA_LIST_FREE(o_op_desc->classes, class_name)
1764 {
1765 eina_stringshare_del(class_name);
1766 }
1767
1768 Gui_Value *gui_value;
1769 EINA_LIST_FREE(o_op_desc->params_mapping_array, gui_value)
1770 {
1771 gui_value_type_set(gui_value, GUI_TYPE_SINT);
1772 gui_value_del(gui_value);
1773 }
1774 free(o_op_desc);
1775 }
1776
1777 eina_stringshare_del(s_op_desc->section_name);
1778 eina_stringshare_del(s_op_desc->simple_op_name);
1779 _simple_op_desc_data_del(s_op_desc);
1780 free(s_op_desc);
1781}
1782
1783/* Set input handler type for current Simple Op*/
1784void
1785simple_op_desc_input_handler_type_set(Simple_Op_Desc *simple_op_desc, Simple_Op_Handler_Type input_handler_type)
1786{
1787 EINA_SAFETY_ON_NULL_RETURN(simple_op_desc);
1788 simple_op_desc->input_handler_type = input_handler_type;
1789
1790 _simple_op_desc_data_del(simple_op_desc);
1791 if (input_handler_type == SIMPLE_OP_HANDLER_SLIDER)
1792 {
1793 Simple_View_Slider_Data *p = calloc (1, sizeof(Simple_View_Slider_Data));
1794 _simple_op_desc_data_set(simple_op_desc, p, free);
1795 }
1796}
1797
1798/* Get input handler type for current Simple Op*/
1799Simple_Op_Handler_Type
1800simple_op_desc_input_handler_type_get(Simple_Op_Desc *simple_op_desc)
1801{
1802 EINA_SAFETY_ON_NULL_RETURN_VAL(simple_op_desc, SIMPLE_OP_HANDLER_NONE);
1803 return simple_op_desc->input_handler_type;
1804}
1805
1806/* Get list of original ops from Simple Op Desc */
1807const Eina_List *
1808simple_op_desc_original_ops_list_get(Simple_Op_Desc *simple_op_desc)
1809{
1810 EINA_SAFETY_ON_NULL_RETURN_VAL(simple_op_desc, NULL);
1811 return simple_op_desc->original_op_desc;
1812}
1813
1814/* Set section name from Simple Op Desc */
1815void
1816simple_op_desc_section_name_set(Simple_Op_Desc *simple_op_desc, const char *name)
1817{
1818 EINA_SAFETY_ON_NULL_RETURN(simple_op_desc);
1819 eina_stringshare_del(simple_op_desc->section_name);
1820 simple_op_desc->section_name = eina_stringshare_add(name);
1821}
1822
1823/* Get section name from Simple Op Desc */
1824Eina_Stringshare*
1825simple_op_desc_section_name_get(Simple_Op_Desc *simple_op_desc)
1826{
1827 EINA_SAFETY_ON_NULL_RETURN_VAL(simple_op_desc, NULL);
1828 return simple_op_desc->section_name;
1829}
1830
1831/* Get simple op name from Simple Op Desc */
1832Eina_Stringshare*
1833simple_op_desc_name_get(Simple_Op_Desc *simple_op_desc)
1834{
1835 EINA_SAFETY_ON_NULL_RETURN_VAL(simple_op_desc, NULL);
1836 return simple_op_desc->simple_op_name;
1837}
1838
1839/* Push original op data into simple op descriptor */
1840void
1841simple_op_desc_data_push(Simple_Op_Desc *simple_op_desc, Op_Desc *_op_desc, Eina_List *params_mapping_array, Eina_List *classes)
1842{
1843 Original_Op_Desc *o_op_desc = calloc(1, sizeof(Original_Op_Desc));
1844 o_op_desc->op_desc = _op_desc;
1845 o_op_desc->params_mapping_array = params_mapping_array;
1846 o_op_desc->classes = classes;
1847 o_op_desc->data = simple_op_desc->data;
1848 simple_op_desc->original_op_desc = eina_list_append(simple_op_desc->original_op_desc, o_op_desc);
1849}
1850
1851const Op_Desc*
1852original_op_desc_get(const Original_Op_Desc *original_op_desc)
1853{
1854 EINA_SAFETY_ON_NULL_RETURN_VAL(original_op_desc, NULL);
1855 return original_op_desc->op_desc;
1856}
1857
1858const void*
1859original_op_data_get(const Original_Op_Desc *original_op_desc)
1860{
1861 EINA_SAFETY_ON_NULL_RETURN_VAL(original_op_desc, NULL);
1862 return original_op_desc->data;
1863}
1864
1865const Eina_List*
1866original_op_mapping_array_get(const Original_Op_Desc *original_op_desc)
1867{
1868 EINA_SAFETY_ON_NULL_RETURN_VAL(original_op_desc, NULL);
1869 return original_op_desc->params_mapping_array;
1870}
1871
1872const Eina_List*
1873original_op_classes_list_get(const Original_Op_Desc *original_op_desc)
1874{
1875 EINA_SAFETY_ON_NULL_RETURN_VAL(original_op_desc, NULL);
1876 return original_op_desc->classes;
1877}
diff --git a/src/lib/database.h b/src/lib/database.h
index 0e683c8..525db9c 100644
--- a/src/lib/database.h
+++ b/src/lib/database.h
@@ -54,6 +54,19 @@ typedef enum _Gui_Type
54 GUI_TYPE_NONE 54 GUI_TYPE_NONE
55} Gui_Type; 55} Gui_Type;
56 56
57/* GUI_TYPE_IDX is int which is used in simple database,
58 * but no in FFI/eo_do infrastructure*/
59#define GUI_TYPE_IDX GUI_TYPE_NONE + 1
60
61/* Input field type in Simple view*/
62typedef enum _Simple_Op_Handler_Type
63{
64 SIMPLE_OP_HANDLER_REGULAR,
65 SIMPLE_OP_HANDLER_COLORSELECTOR,
66 SIMPLE_OP_HANDLER_SLIDER,
67 SIMPLE_OP_HANDLER_NONE
68} Simple_Op_Handler_Type;
69
57typedef enum _Gui_Cb_Type 70typedef enum _Gui_Cb_Type
58{ 71{
59 GUI_CB_USER, 72 GUI_CB_USER,
@@ -78,8 +91,17 @@ typedef struct
78 char *value; /* Value for default value, t.e. -1.0 in case of EVAS_HINT_FILL */ 91 char *value; /* Value for default value, t.e. -1.0 in case of EVAS_HINT_FILL */
79} Param_Default_Value; 92} Param_Default_Value;
80 93
94typedef struct
95{
96 double min;
97 double max;
98 double step;
99} Simple_View_Slider_Data;
100
81typedef struct _Op_Desc Op_Desc; 101typedef struct _Op_Desc Op_Desc;
82typedef struct _Container_Desc Container_Desc; 102typedef struct _Container_Desc Container_Desc;
103typedef struct _Simple_Op_Desc Simple_Op_Desc;
104typedef struct _Original_Op_Desc Original_Op_Desc;
83#define DB_DEF_PUBLIC "public" 105#define DB_DEF_PUBLIC "public"
84#define DB_DEF_PARENT "parent" 106#define DB_DEF_PARENT "parent"
85#define DB_DEF_CLASS "class" 107#define DB_DEF_CLASS "class"
@@ -298,4 +320,60 @@ db_op_desc_type_get(const Op_Desc *op_desc);
298Eina_Bool 320Eina_Bool
299db_op_desc_is_constructor(const Op_Desc *op_desc); 321db_op_desc_is_constructor(const Op_Desc *op_desc);
300 322
323/* Get list of all Simple Op Descs in order it was added,
324 * t.e. database order. */
325const Eina_List *
326simple_op_desc_list_get();
327
328/* Get section name from Simple Op Desc */
329Eina_Stringshare*
330simple_op_desc_section_name_get(Simple_Op_Desc *simple_op_desc);
331
332/* Set section name from Simple Op Desc */
333void
334simple_op_desc_section_name_set(Simple_Op_Desc *simple_op_desc, const char *name);
335
336/* Get simple op name from Simple Op Desc */
337Eina_Stringshare*
338simple_op_desc_name_get(Simple_Op_Desc *simple_op_desc);
339
340/* Returns Simple_Op_Desc for op_name.
341 * If op description doesn't exist it will be created
342 * for lower cased name. */
343Simple_Op_Desc *
344simple_op_desc_get(const char *_simple_op_name);
345
346/* Set input handler type for current Simple Op */
347void
348simple_op_desc_input_handler_type_set(Simple_Op_Desc *simple_op_desc, Simple_Op_Handler_Type input_handler_type);
349
350/* Get input handler type for current Simple Op */
351Simple_Op_Handler_Type
352simple_op_desc_input_handler_type_get(Simple_Op_Desc *simple_op_desc);
353
354const Eina_List *
355simple_op_desc_original_ops_list_get(Simple_Op_Desc *simple_op_desc);
356
357/* Push original op data into simple op descriptor */
358void
359simple_op_desc_data_push(Simple_Op_Desc *simple_op_desc, Op_Desc *_op_desc, Eina_List *params_mapping_array, Eina_List *classes);
360
361/* Delete Simple_Op_Desc */
362void
363simple_op_desc_del(Simple_Op_Desc *s_op_desc);
364
365void *
366simple_op_desc_data_get(Simple_Op_Desc *simple_op_desc);
367
368const Op_Desc*
369original_op_desc_get(const Original_Op_Desc *original_op_desc);
370
371const void*
372original_op_data_get(const Original_Op_Desc *original_op_desc);
373
374const Eina_List*
375original_op_mapping_array_get(const Original_Op_Desc *original_op_desc);
376
377const Eina_List*
378original_op_classes_list_get(const Original_Op_Desc *original_op_desc);
301#endif 379#endif
diff --git a/src/lib/desc_simple_parser.c b/src/lib/desc_simple_parser.c
new file mode 100644
index 0000000..0e821e1
--- /dev/null
+++ b/src/lib/desc_simple_parser.c
@@ -0,0 +1,757 @@
1#include <Eina.h>
2#include <unistd.h>
3#include "desc_simple_parser.h"
4#include "egui_log.h"
5#include "database.h"
6#include "gui_widget.h"
7
8#define DEBUG_PRINT 0
9
10#if DEBUG_PRINT
11#define DEBUG(msg, ...) printf((msg), ##__VA_ARGS__)
12#else
13#define DEBUG(msg, ...) do {} while(0);
14#endif
15
16static struct _Ctx
17{
18 struct
19 {
20 const char *file; /* the input file to read UNUSED */
21 FILE *fp; /* File descriptor handle */
22 size_t file_size; /* File size UNUSED */
23 char buf[30000]; /* read chunk buffer */
24 size_t buf_size; /* size of read chunk */
25 size_t buf_off; /* offset of the start of buffer in the file */
26 size_t cur_pos; /* offset in file */
27 } file_buf;
28
29 enum
30 {
31 CTX_STATUS_NONE = 0,
32 CTX_STATUS_FILE_START = 1,
33 CTX_STATUS_FILE_DONE = 1 << 2,
34 CTX_STATUS_FILE_ERROR = 1 << 3,
35 CTX_STATUS_SYNTAX_ERROR = 1 << 4,
36 /* TODO: maybe more error types */
37 } status;
38
39 char *buf;
40 size_t pos;
41 char cur_char;
42
43} _ctx;
44
45/* Simple_Op Parse data */
46typedef struct _Handle_Type_Entry
47{
48 char *str;
49 Simple_Op_Handler_Type type;
50} Handle_Type_Entry;
51
52Handle_Type_Entry _table_handlers[] =
53{
54 {"Regular", SIMPLE_OP_HANDLER_REGULAR},
55 {"Color", SIMPLE_OP_HANDLER_COLORSELECTOR},
56 {"Slider", SIMPLE_OP_HANDLER_SLIDER},
57 { NULL, 0 }
58};
59
60static Simple_Op_Handler_Type
61_parse_handler_str_to_type(const char *str)
62{
63 Simple_Op_Handler_Type type = SIMPLE_OP_HANDLER_NONE;
64 Handle_Type_Entry *pos = _table_handlers;
65
66 while (pos->str)
67 {
68 if (!strncmp(pos->str, str, strlen(pos->str)))
69 {
70 type = pos->type;
71 break;
72 }
73 pos++;
74 }
75
76 return type;
77}
78
79static void
80_buf_read_file(void)
81{
82 _ctx.file_buf.buf_size = fread(_ctx.file_buf.buf, 1, sizeof(_ctx.file_buf.buf), _ctx.file_buf.fp);
83 if (_ctx.file_buf.buf_size == 0)
84 {
85 _ctx.status = CTX_STATUS_FILE_DONE;
86 }
87 _ctx.buf = _ctx.file_buf.buf;
88 _ctx.pos = 0;
89}
90
91static void
92_open_file(const char *filename)
93{
94 FILE *fp;
95
96 if (!filename)
97 {
98 ERR("No input file specified");
99 _ctx.status = CTX_STATUS_FILE_ERROR;
100 return;
101 }
102
103
104 fp = fopen(filename, "r");
105 if (!fp)
106 {
107 printf("Can not open file: \"%s\".\n", filename);
108 _ctx.status = CTX_STATUS_FILE_ERROR;
109 return;
110 }
111
112 _ctx.file_buf.fp = fp;
113 _ctx.status = CTX_STATUS_FILE_START;
114 _buf_read_file();
115}
116
117static void
118_ctxt_cleanup(void)
119{
120 /* TODO: cleanup _ctxt */
121 if (_ctx.file_buf.fp)
122 {
123 fclose(_ctx.file_buf.fp);
124 _ctx.file_buf.fp = NULL;
125 }
126}
127
128/* Parse code */
129
130#define CUR_CHAR (_ctx.buf[_ctx.pos])
131#define CUR_OFF (_ctx.buf + _ctx.pos)
132#define IGNORE(x) ((x) && (((x) == ' ') || ((x) == '\n')))
133#define ALPHA(x) ((((x) >= 'A') && ((x) <= 'Z')) || (((x) >= 'a') && ((x) <= 'z')))
134#define ALPHA_CLASS(x) (ALPHA(x) || ((x) == '.'))
135#define NUM(x) (((x) >= '0') && ((x) <= '9'))
136#define ANUM(x) (ALPHA(x) || (((x) >= '0') && ((x) <= '9')))
137
138#define SHORT_SIZE 128
139
140static void
141_error_syntax_unknown_token(void)
142{
143 ERR("Syntax error: Unexpected character \"%c\". Aborting.", CUR_CHAR);
144 _ctx.status = CTX_STATUS_SYNTAX_ERROR;
145}
146
147static void
148_skip_ignores(void)
149{
150 while (IGNORE(CUR_CHAR))
151 {
152 _ctx.pos++;
153 }
154}
155
156static Eina_Bool
157_is_alpha(char c)
158{
159 return ALPHA(c);
160}
161
162static Eina_Bool
163_is_anum(char c)
164{
165 return ANUM(c);
166}
167
168static Eina_Bool
169_is_num(char c)
170{
171 return NUM(c);
172}
173
174static char *
175_next_pat(Eina_Bool (*cmp)(char c), const char *extra)
176{
177 size_t pos;
178 size_t len;
179 char c;
180 char *ret = NULL;
181
182 _skip_ignores();
183 pos = _ctx.pos;
184 while ((c = _ctx.buf[pos]))
185 {
186 if (cmp(c) || strchr(extra, c))
187 {
188 pos++;
189 }
190 else
191 {
192 break;
193 }
194 }
195 len = pos - _ctx.pos;
196 if (len > 0) ret = strndup(_ctx.buf + _ctx.pos, len);
197 _ctx.pos = pos;
198
199 return ret;
200}
201
202static char *
203_next_word(const char *extra)
204{
205 size_t len;
206 char *str;
207
208 len = strlen(extra) + 1; // for the "_"
209 str = calloc(1, len + 1);
210 strcat(str, "_");
211 strcat(str, extra);
212 char *ret = _next_pat(_is_alpha, str);
213 free(str);
214 return ret;
215}
216
217static Eina_Bool
218_next_token(const char *str)
219{
220 size_t len = strlen(str);
221 size_t pos = _ctx.pos;
222 while(IGNORE(_ctx.buf[pos]))
223 {
224 pos++;
225 }
226 if (!strncmp(_ctx.buf + pos, str, len))
227 {
228 _ctx.pos = pos;
229 _ctx.pos += len;
230 return EINA_TRUE;
231 }
232 return EINA_FALSE;
233}
234
235static Eina_Bool
236_next_keyword(const char *str)
237{
238 size_t len = strlen(str);
239 size_t pos = _ctx.pos;
240
241 if (!IGNORE(CUR_CHAR))
242 return EINA_FALSE;
243
244 while(IGNORE(_ctx.buf[pos]))
245 {
246 pos++;
247 }
248
249 if (!strncmp(_ctx.buf + pos, str, len) && IGNORE(_ctx.buf[pos + len]))
250 {
251 _ctx.pos = pos;
252 _ctx.pos += len + 1;
253 return EINA_TRUE;
254 }
255 return EINA_FALSE;
256}
257
258static char *
259_parse_string()
260{
261 char *start, *off;
262
263 start = _ctx.buf + _ctx.pos;
264
265 while ((off = &_ctx.buf[_ctx.pos++]) && *off)
266 {
267 if (*off == '\"')
268 {
269 return strndup(start, off - start);
270 }
271 }
272
273 _error_syntax_unknown_token();
274
275 return NULL;
276}
277
278static Eina_Bool
279_is_str_num(const char *str)
280{
281 if (!str) return EINA_FALSE;
282 char c;
283 while ((c = *(str++)))
284 {
285 if (!NUM(c)) return EINA_FALSE;
286 }
287 return EINA_TRUE;
288}
289
290static Eina_Bool
291_is_str_alpha(const char *str)
292{
293 if (!str) return EINA_FALSE;
294 char c;
295 while ((c = *(str++)))
296 {
297 if (!ALPHA(c)) return EINA_FALSE;
298 }
299 return EINA_TRUE;
300}
301
302static Gui_Value *
303_parse_gui_idx(const char *str)
304{
305 Gui_Value *val;
306 val = _gui_value_new();
307 gui_value_int_set(val, atoi(str));
308 gui_value_type_set(val, GUI_TYPE_IDX);
309 return val;
310}
311
312static Gui_Value *
313_parse_gui_value(Op_Desc *od, size_t idx, const char *str, Eina_Bool is_lstr)
314{
315 Gui_Value *val = NULL;
316 Gui_Type type;
317
318 val = _gui_value_new();
319 type = db_op_desc_nth_par_type_get(od, idx);
320 switch (type)
321 {
322 case GUI_TYPE_SINT:
323 {
324 if (!_is_str_num(str))
325 {
326 _error_syntax_unknown_token();
327 goto end;
328 }
329 gui_value_int_set(val, atoi(str));
330 break;
331 }
332 case GUI_TYPE_BOOL:
333 {
334 gui_value_bool_set(val, EINA_FALSE);
335 break;
336 }
337 case GUI_TYPE_DOUBLE:
338 {
339 gui_value_double_set(val, 0);
340 break;
341 }
342 case GUI_TYPE_ENUM:
343 {
344 if (!_is_str_alpha(str))
345 {
346 _error_syntax_unknown_token();
347 goto end;
348 }
349 gui_value_enum_set(val, NULL);
350 break;
351 }
352 case GUI_TYPE_STRING:
353 {
354 if (is_lstr)
355 {
356 gui_value_string_set(val, str);
357 }
358 else if (!strcmp("NULL", str))
359 {
360 gui_value_string_set(val, NULL);
361 }
362 else
363 {
364 _error_syntax_unknown_token();
365 goto end;
366 }
367 break;
368 }
369 case GUI_TYPE_FILE:
370 case GUI_TYPE_THEME:
371 case GUI_TYPE_OBJECT:
372 case GUI_TYPE_CB:
373 case GUI_TYPE_OBJECT_ITEM:
374 {
375 gui_value_name_id_set(val, type, 0);
376 break;
377 }
378 case GUI_TYPE_VOID:
379 {
380 gui_value_pointer_set(val, type, NULL);
381 break;
382 }
383 default:
384 ERR("%s: switch default for type: %s",
385 db_op_desc_op_name_get(od), db_gui_type_name_get(type));
386 }
387end:
388 if ((_ctx.status >= CTX_STATUS_FILE_ERROR))
389 {
390 if (val)
391 {
392 free(val);
393 val = NULL;
394 }
395 }
396 return val;
397}
398
399static Eina_List *
400_parse_org_op_values(Op_Desc *od)
401{
402 Eina_List *ret = NULL;
403 Eina_Bool empty = EINA_FALSE;
404 size_t idx = 0;
405
406 while (_ctx.status < CTX_STATUS_FILE_ERROR)
407 {
408 Gui_Value *val = NULL;
409 if (_next_token("%"))
410 {
411 char *str = _next_pat(_is_num, "");
412 if (!str)
413 {
414 _error_syntax_unknown_token();
415 goto end;
416 }
417 DEBUG("Parsing index value: %s\n", str);
418 val = _parse_gui_idx(str);
419 free(str);
420 }
421 else
422 {
423 char *str = NULL;
424 Eina_Bool is_lstr = EINA_FALSE;
425
426 if (_next_token("\""))
427 {
428 str = _parse_string();
429 is_lstr = EINA_TRUE;
430 }
431 else
432 {
433 str = _next_pat(_is_anum, "");
434 }
435 if (str)
436 {
437 DEBUG("Parsing gui value: %s, idx: %zu, literal string? %d\n",
438 str, idx, is_lstr);
439 val = _parse_gui_value(od, (unsigned long) idx, str, is_lstr);
440 }
441 if (!str)
442 {
443 if (empty) /* implies we had one pass due to "," */
444 {
445 _error_syntax_unknown_token();
446 }
447 empty = EINA_TRUE;
448 }
449 free(str);
450 }
451
452 ret = eina_list_append(ret, val);
453
454 if (_next_token(")"))
455 {
456 goto end;
457 }
458 else if (!empty && !_next_token(","))
459 {
460 _error_syntax_unknown_token();
461 }
462 idx++;
463 }
464end:
465 return ret;
466}
467
468static Eina_List *
469_parse_org_op_classes(void)
470{
471 Eina_List *classes = NULL;
472 char *str;
473 while ((str = _next_word(".")))
474 {
475 classes = eina_list_append(classes, eina_stringshare_add(str));
476 free(str);
477 if (!_next_token(","))
478 break;
479 }
480 return classes;
481}
482
483static Op_Desc *
484_op_desc_get(const char *prop_full)
485{
486 Op_Desc *ret = NULL;
487 char *off, *class, *prop;
488
489 off = strrchr(prop_full, '.');
490 if (off && (off > prop_full))
491 {
492 class = strndup(prop_full, (off - prop_full));
493 prop = strdup(off + 1);
494
495 ret = db_mro_op_desc_get(class, NULL, prop);
496 free(class);
497 free(prop);
498 }
499 return ret;
500}
501
502#if DEBUG_PRINT
503static void
504_print_list_of_str(Eina_List *list)
505{
506 Eina_List *i;
507 char *s;
508
509 printf("Listing contents\n");
510
511 EINA_LIST_FOREACH(list, i, s)
512 {
513 printf(" -> %s\n", s);
514 }
515}
516#endif
517
518static Eina_List *
519_parse_none_classes(void)
520{
521 Eina_Bool cont = EINA_TRUE;
522 char *str;
523 Eina_List *classes = NULL;
524
525 while (cont && (str = _next_word(".")))
526 {
527 classes = eina_list_append(classes, eina_stringshare_add(str));
528 free(str);
529 if (!_next_token(","))
530 {
531 cont = EINA_FALSE;
532 }
533 }
534 if (!_next_token(";"))
535 {
536 _error_syntax_unknown_token();
537 }
538
539 return classes;
540}
541
542static void
543_parse_org_op(Simple_Op_Desc *sop)
544{
545 char *str;
546 Op_Desc *od = NULL;
547 Eina_List *none_classes = NULL;
548 Eina_List *classes = NULL;
549 Eina_List *values = NULL;
550
551 if (_next_keyword("none"))
552 {
553 none_classes = _parse_none_classes();
554 simple_op_desc_data_push(sop, NULL, NULL, none_classes);
555#if DEBUG_PRINT
556 printf("Black list set to sop %p:\n", sop);
557 _print_list_of_str(none_classes);
558#endif
559 }
560
561 str = _next_word(".");
562 if (str)
563 {
564 DEBUG("Creating original description: %s\n", str);
565 od = _op_desc_get(str);
566 free(str);
567 if (_next_token("("))
568 {
569 values = _parse_org_op_values(od);
570 }
571 }
572 else
573 {
574 _error_syntax_unknown_token();
575 goto end;
576 }
577
578 if (_next_keyword("for"))
579 {
580 classes = _parse_org_op_classes();
581#if DEBUG_PRINT
582 DEBUG("Op_Desc applied to classes:\n");
583 _print_list_of_str(classes);
584#endif
585 }
586
587 if (!_next_token(";"))
588 {
589 _error_syntax_unknown_token();
590 }
591end:
592 if (od)
593 {
594 simple_op_desc_data_push(sop, od, values, classes);
595 }
596}
597
598static void
599_parse_org_ops(Simple_Op_Desc *sop)
600{
601 while (_ctx.status < CTX_STATUS_FILE_ERROR)
602 {
603 if (_next_token("}"))
604 return;
605
606 _parse_org_op(sop);
607 }
608}
609
610static void
611_parse_simple_op_desc(void)
612{
613 char *str;
614 Simple_Op_Desc *sop;
615 Simple_Op_Handler_Type type = SIMPLE_OP_HANDLER_REGULAR;
616
617 str = _next_word(".");
618 if (!str)
619 {
620 _error_syntax_unknown_token();
621 return;
622 }
623
624 char *p = NULL, *section_name = NULL;
625 const char *simple_op_name = str;
626 if ((p = strchr(str, '.')))
627 {
628 simple_op_name = p + 1;
629 section_name = strndup(str, p - str);
630 p = section_name;
631 while (*p)
632 {
633 if (*p == '_') *p = ' ';
634 p++;
635 }
636 }
637
638 sop = simple_op_desc_get(simple_op_name);
639 simple_op_desc_section_name_set(sop, section_name);
640 DEBUG("Handling Simple Op %p (%s)\n", sop, simple_op_name);
641 free(str);
642
643 if (_next_keyword("as"))
644 {
645 str = _next_word("_");
646 if (!str)
647 {
648 _error_syntax_unknown_token();
649 return;
650 }
651 type = _parse_handler_str_to_type(str);
652 free(str);
653 }
654 simple_op_desc_input_handler_type_set(sop, type);
655 if (type == SIMPLE_OP_HANDLER_SLIDER)
656 {
657 if (_next_token("("))
658 {
659 double min = 0.0, max = 0.0, step = 0.0;
660 char *s = _next_pat(_is_num, ".");
661 if (!str)
662 {
663 _error_syntax_unknown_token();
664 return;
665 }
666 min = atof(s);
667 free(s);
668
669 if (!_next_token(",")) return;
670 s = _next_pat(_is_num, ".");
671 if (!str)
672 {
673 _error_syntax_unknown_token();
674 return;
675 }
676 max = atof(s);
677 free(s);
678
679 if (!_next_token(",")) return;
680 s = _next_pat(_is_num, ".");
681 if (!str)
682 {
683 _error_syntax_unknown_token();
684 return;
685 }
686 step = atof(s);
687 free(s);
688 if (!_next_token(")")) return;
689 Simple_View_Slider_Data *sd = simple_op_desc_data_get(sop);
690 sd->min = min;
691 sd->max = max;
692 sd->step = step;
693 }
694 }
695 if (_next_token("{"))
696 {
697 _parse_org_ops(sop);
698 }
699 else
700 {
701 _error_syntax_unknown_token();
702 }
703}
704
705static void
706_parse_next(void)
707{
708 while (_ctx.status < CTX_STATUS_FILE_ERROR)
709 {
710 _skip_ignores();
711 if (!CUR_CHAR)
712 {
713 _ctx.status = CTX_STATUS_FILE_DONE;
714 return;
715 }
716 if ALPHA(CUR_CHAR)
717 {
718 _parse_simple_op_desc();
719 }
720 else if (IGNORE(CUR_CHAR))
721 {
722 _ctx.pos++;
723 }
724 else
725 {
726 _error_syntax_unknown_token();
727 }
728 }
729}
730
731/* Scan functions */
732static void
733_parse_all(void)
734{
735 while (_ctx.status < CTX_STATUS_FILE_DONE)
736 {
737 _parse_next();
738 }
739}
740
741Eina_Bool
742simple_op_parser_db_init(const char *path)
743{
744 memset(&_ctx, 0, sizeof(_ctx));
745 _open_file(path);
746
747 if (_ctx.status >= CTX_STATUS_FILE_ERROR)
748 {
749 goto end;
750 }
751
752 _parse_all();
753
754end:
755 _ctxt_cleanup();
756 return EINA_TRUE;
757}
diff --git a/src/lib/desc_simple_parser.h b/src/lib/desc_simple_parser.h
new file mode 100644
index 0000000..89bc7fd
--- /dev/null
+++ b/src/lib/desc_simple_parser.h
@@ -0,0 +1,28 @@
1#ifndef DESC_SIMPLE_PARSER_H_
2#define DESC_SIMPLE_PARSER_H_
3
4#include <Eina.h>
5
6/* This is a parser for simple descriptions for Erigo.
7 *
8 * A database entry of a Simple_Op_Desc:
9 *
10 * Simple_Op_Desc
11 * {
12 * List [ op_desc1, op_desc2 ],
13 * ViewData
14 * }
15 */
16
17/* Populates a given database with given Description input file.
18 * @p path the simple of description input file to parse */
19Eina_Bool simple_op_parser_db_init(const char *path);
20
21/* Does cleanup and frees up data */
22void simple_op_parser_free(void);
23
24#if 1
25void simple_op_parser_file_test(void);
26#endif
27
28#endif //DESC_SIMPLE_PARSER_H_
diff --git a/src/lib/gui_widget.c b/src/lib/gui_widget.c
index fe3f95d..7cd4359 100644
--- a/src/lib/gui_widget.c
+++ b/src/lib/gui_widget.c
@@ -3063,6 +3063,17 @@ _gui_value_new()
3063 return val; 3063 return val;
3064} 3064}
3065 3065
3066int
3067_gui_value_idx_get(const Gui_Value *_val)
3068{
3069 int ret;
3070 Gui_Value *val = GUI_VALUE(_val);
3071 gui_value_type_set(val, GUI_TYPE_SINT);
3072 ret = INT_GET(val);
3073 gui_value_type_set(val, GUI_TYPE_IDX);
3074 return ret;
3075}
3076
3066Gui_Value * 3077Gui_Value *
3067gui_value_copy(const Gui_Value *val_source) 3078gui_value_copy(const Gui_Value *val_source)
3068{ 3079{
diff --git a/src/lib/gui_widget.h b/src/lib/gui_widget.h
index 133eea8..72c69f9 100644
--- a/src/lib/gui_widget.h
+++ b/src/lib/gui_widget.h
@@ -748,6 +748,9 @@ cb_modify(Gui_Widget_Callback *cb, const char *type, Eid *action_id);
748Gui_Value * 748Gui_Value *
749_gui_value_new(); 749_gui_value_new();
750 750
751int
752_gui_value_idx_get(const Gui_Value *_val);
753
751Gui_Value * 754Gui_Value *
752gui_value_copy(const Gui_Value *gui_value); 755gui_value_copy(const Gui_Value *gui_value);
753 756
diff --git a/src/lib/test_simple_op.txt b/src/lib/test_simple_op.txt
new file mode 100644
index 0000000..308dcfc
--- /dev/null
+++ b/src/lib/test_simple_op.txt
@@ -0,0 +1,7 @@
1 MyClass as Regular {
2 none Elm.Box;
3 Elm.Bg.color for Elm.Bg, Elm.Widget;
4 Efl.Gfx.Base.color(%1, %3, %2) for Evas.Object;
5 Elm.Widget.part_text(NULL, "hello", %1) for Elm.Entry;
6 Efl.Gfx.Base.size;
7 }