summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <marcel-hollerbach@t-online.de>2015-09-04 10:44:47 +0200
committerMarcel Hollerbach <marcel-hollerbach@t-online.de>2015-10-05 12:56:26 +0200
commit0f2b070271836b8e1f96387ca9d2d751702f51a6 (patch)
treee8088a3a45fc77a753faa1fd2bd0421449f50f37
parent18dbbbc3add0e977407ced86e360b161459702a2 (diff)
elm_settingspane: fix against (latest) eolian changes
-rw-r--r--src/lib/elc_settingspane.c13
-rw-r--r--src/lib/elm_settingspane.eo145
-rw-r--r--src/lib/elm_settingspane_item.eo376
3 files changed, 244 insertions, 290 deletions
diff --git a/src/lib/elc_settingspane.c b/src/lib/elc_settingspane.c
index d729eb7ed..c0638bcfc 100644
--- a/src/lib/elc_settingspane.c
+++ b/src/lib/elc_settingspane.c
@@ -939,15 +939,18 @@ _elm_settingspane_evas_object_smart_show(Eo *obj, Elm_Settingspane_Data *pd)
939} 939}
940 940
941 941
942EOLIAN static void 942EOLIAN static Eo_Base*
943_elm_settingspane_eo_base_constructor(Eo *obj, Elm_Settingspane_Data *pd) 943_elm_settingspane_eo_base_constructor(Eo *obj, Elm_Settingspane_Data *pd)
944{ 944{
945 eo_do_super(obj, ELM_SETTINGSPANE_CLASS, eo_constructor()); 945 Eo *eo;
946 eo_do_super(obj, ELM_SETTINGSPANE_CLASS, eo = eo_constructor());
946 947
947 pd->itcc = elm_genlist_item_class_new(); 948 pd->itcc = elm_genlist_item_class_new();
948 pd->itcc->item_style = "double_label_unblock"; 949 pd->itcc->item_style = "double_label_unblock";
949 pd->itcc->func.text_get = _elm_settingspane_ii_text_cb; 950 pd->itcc->func.text_get = _elm_settingspane_ii_text_cb;
950 pd->itcc->func.content_get = _elm_settingspane_ii_content_cb; 951 pd->itcc->func.content_get = _elm_settingspane_ii_content_cb;
952
953 return eo;
951} 954}
952 955
953static Evas_Object* 956static Evas_Object*
@@ -1412,7 +1415,7 @@ _elm_settingspane_item_eo_base_destructor(Eo *obj EINA_UNUSED, Elm_Settingspane_
1412} 1415}
1413 1416
1414EOLIAN static void 1417EOLIAN static void
1415_elm_settingspane_item_keywords_set(Elm_Settingspane_Item *obj EINA_UNUSED, Elm_Settingspane_Item_Data *pd, char *v) 1418_elm_settingspane_item_keywords_set(Elm_Settingspane_Item *obj EINA_UNUSED, Elm_Settingspane_Item_Data *pd, const char *v)
1416{ 1419{
1417 char **splits; 1420 char **splits;
1418 char *split; 1421 char *split;
@@ -1445,10 +1448,10 @@ _elm_settingspane_item_keywords_set(Elm_Settingspane_Item *obj EINA_UNUSED, Elm_
1445 pd->key_words = eina_list_append(pd->key_words, str); 1448 pd->key_words = eina_list_append(pd->key_words, str);
1446} 1449}
1447 1450
1448EOLIAN static char * 1451EOLIAN static const char *
1449_elm_settingspane_item_keywords_get(Elm_Settingspane_Item *obj EINA_UNUSED, Elm_Settingspane_Item_Data *pd) 1452_elm_settingspane_item_keywords_get(Elm_Settingspane_Item *obj EINA_UNUSED, Elm_Settingspane_Item_Data *pd)
1450{ 1453{
1451 return ((char*)pd->key_word); 1454 return pd->key_word;
1452} 1455}
1453 1456
1454/* widget api calls */ 1457/* widget api calls */
diff --git a/src/lib/elm_settingspane.eo b/src/lib/elm_settingspane.eo
index bcfaa47ac..dabbd2556 100644
--- a/src/lib/elm_settingspane.eo
+++ b/src/lib/elm_settingspane.eo
@@ -1,107 +1,86 @@
1class Elm_Settingspane(Elm_Layout) 1class Elm.Settingspane(Elm.Layout) {
2{
3 eo_prefix: elm_obj_settingspane; 2 eo_prefix: elm_obj_settingspane;
4 properties {
5 }
6 methods { 3 methods {
7 focused_get{ 4 focused_get {
8 /*@ 5 [[
9 Returns the currently focused item 6 Returns the item which is currently displayed
10 7 ]]
11 Returns the item which is currently displayed. 8 return : Elm.Settingspane.Item*;
12
13 @ingroup Settingspane
14 */
15 return: Elm_Settingspane_Item* ;
16 } 9 }
17 item_get { 10 item_get {
18 /*@ 11 [[
19 Return the Item from this path 12 Return the Item from this path
20 13
21 This will search the item of the given paths. 14 This will search the item of the given paths.
22 If the path is "settings/monitor/resolution" 15 If the path is "settings/monitor/resolution"
23 The Item resolution in the parent "monitor" in the parent "settings" will be searched. 16 The Item resolution in the parent "monitor" in the parent "settings" will be searched.
24 If the item is found, it will be retured, if it isnt, NULL is returned 17 If the item is found, it will be retured, if it isnt, NULL is returned
25 18 ]]
26 @see elm_settingspane_item_focus 19 return : Elm.Settingspane.Item*;
27
28 @ingroup Settingspane */
29 return: Elm_Settingspane_Item* ;
30 params { 20 params {
31 @in const(char) *paths; /*@ the path of the item to return*/ 21 @in paths : const(char)*; [[the path of the item to return]]
32 } 22 }
33 } 23 }
34 item_append { 24 item_append {
35 /*@ 25 [[
36 Append a item. 26 Append a item.
37
38 This will append a item with the given name, description and icon to the widget,
39 if par is not NULL it will be placed as a child of par. If par is NULL it will be placed in the 0 level.
40
41 @see elm_settingspane_item_append_relative
42 27
43 @ingroup Settingspane*/ 28 This will append a item with the given name, description and icon to the widget,
44 return: Elm_Settingspane_Item *; 29 if par is not NULL it will be placed as a child of par. If par is NULL it will be placed in the 0 level.
45 params {
46 @in void *data; /*@ data to attach to the item which gets passed to the callback */
47 30
48 @in const(char) *name; /*@ name of the item */ 31 \@ref elm_obj_settingspane_item_append_relative
49 @in Elm_Settingspane_Item *par; /*@ parent of this item, it will be shown when the parent item is selected. If NULL it will be appended to the 0 lvl */ 32 ]]
50 } 33 return : Elm.Settingspane.Item*;
34 params {
35 @in data : void*; [[data to attach to the item which gets passed to the callback]]
36 @in name : const(char)*; [[name of the item]]
37 @in par : Elm.Settingspane.Item*; [[parent of this item, it will be shown when the parent item is selected. If NULL it will be appended to the 0 lvl ]]
38 }
51 } 39 }
52 item_append_relative { 40 item_append_relative {
53 /*@ 41 [[
54 Append a item relative 42 Append a item relative
55 43
56 This will append a item like item_append, with the only difference that it will be appended to rel, 44 This will append a item like item_append, with the only difference that it will be appended to rel,
57 The parent of rel will be took as parent. 45 The parent of rel will be took as parent.
58 46
59 @note This will fail if rel is NULL 47 note that this will fail if rel is NULL
60 48
61 @see item_append 49 \@ref item_append
62 50 ]]
63 @ingroup Settingspane 51 return : Elm.Settingspane.Item *;
64 52 params {
65 */ 53 @in data : void*; [[data to attach to the item which gets passed to the callback]]
66 return: Elm_Settingspane_Item *; 54 @in name : const(char)*; [[name of the item ]]
67 params { 55 @in rel : Elm.Settingspane.Item*; [[the item after which the current one will be appended, if NULL the call will fail!]]
68 @in void *data; /*@ data to attach to the item which gets passed to the callback */ 56 }
69 @in const(char) *name; /*@ name of the item */
70 @in Elm_Settingspane_Item *rel; /*@ the item after which the current one will be appended, if NULL the call will fail!*/
71 }
72 } 57 }
73 save_quit { 58 save_quit {
74 /*@ 59 [[
75 Check if everything is saved 60 Check if everything is saved
76 61
77 With the internal stack of the widget it is possible that multiple panels are opened above each other. 62 With the internal stack of the widget it is possible that multiple panels are opened above each other.
78 If the changed flag is set to one of this panels the apply/reset buttons are enabled, 63 If the changed flag is set to one of this panels the apply/reset buttons are enabled,
79 and you cannot close this page before you clicked reset or apply. 64 and you cannot close this page before you clicked reset or apply.
80 If there are panels with the change flag set this function will return EINA_FALSE, 65 If there are panels with the change flag set this function will return EINA_FALSE,
81 if no change flag is set on the opened panel it will return EINA_TRUE 66 if no change flag is set on the opened panel it will return EINA_TRUE
82 67
83 @see raise_unsaved 68 \@ref raise_unsaved
84 69 ]]
85 @return EINA_TRUE if no change flag is set on the opened panels. 70 return : bool; [[true if no change flag is set on the opened panels.]]
86 @ingroup Settingspane
87
88 */
89 return: Eina_Bool;
90 } 71 }
91 raise_unsaved { 72 raise_unsaved {
92 /*@ 73 [[
93 Raise unsaved panels in the internal stack 74 Raise unsaved panels in the internal stack
94
95 This will raise internal panels which have the changed flag set.
96 The panels are raised with a error highlighting.
97 75
98 The lowest unsaved panel will later be the lowest unsaved panel. The highest at the top. 76 This will raise internal panels which have the changed flag set.
99 All panels with unsaved changes will be infront of those without unsaved changes. 77 The panels are raised with a error highlighting.
100 78
101 @see save_quit 79 The lowest unsaved panel will later be the lowest unsaved panel. The highest at the top.
80 All panels with unsaved changes will be infront of those without unsaved changes.
102 81
103 @ingroup Settingspane 82 \@ref save_quit
104 */ 83 ]]
105 } 84 }
106 } 85 }
107 implements { 86 implements {
@@ -109,6 +88,6 @@ class Elm_Settingspane(Elm_Layout)
109 Eo.Base.destructor; 88 Eo.Base.destructor;
110 Evas.Object_Smart.add; 89 Evas.Object_Smart.add;
111 Evas.Object_Smart.show; 90 Evas.Object_Smart.show;
112 Elm_Layout.content_aliases.get; 91 Elm.Layout.content_aliases.get;
113 } 92 }
114} 93}
diff --git a/src/lib/elm_settingspane_item.eo b/src/lib/elm_settingspane_item.eo
index 296d34430..c0d4f4f16 100644
--- a/src/lib/elm_settingspane_item.eo
+++ b/src/lib/elm_settingspane_item.eo
@@ -1,207 +1,179 @@
1class Elm_Settingspane_Item(Eo.Base){ 1class Elm.Settingspane.Item(Eo.Base){
2 eo_prefix: elm_obj_settingspane_item; 2 eo_prefix: elm_obj_settingspane_item;
3 data: Elm_Settingspane_Item_Data; 3 methods {
4 properties { 4 @property name {
5 name { 5 get {
6 get { 6 [[
7 /*@ 7 Get the name of the item
8 Returns the name of the item 8
9 9 This will return the name which was passed at the creation via append_item or item_append_relative
10 This will return the name which was passed at the creation via append_item or item_append_relative 10 This is the string displayed in the item.
11 This is the string displayed in the item. 11 ]]
12 12 }
13 @return The name of the item 13 values {
14 14 name : const(char)*;
15 @ingroup Settingspane 15 }
16 */ 16 }
17 } 17 @property description {
18 values { 18 set {
19 const (char) *name; 19 [[
20 } 20 Will set the desrciption for the item.
21 } 21
22 description{ 22 It will be displayed when you hover the item.
23 set { 23 ]]
24 /*@ 24 }
25 Will set the desrciption for the item. 25 get {
26 26 [[
27 It will be displayed when you hover the item. 27 Get the description of the item
28 @ingroup Settingspane 28
29 */ 29 This will return the description which was passed at the creation via
30 } 30 append_item or item_append_relative.
31 get { 31 This is the string displayed lower of the name.
32 /*@ 32 ]]
33 Return the description of the item 33 }
34 34 values {
35 This will return the description which was passed at the creation via 35 description : const(char)*;
36 append_item or item_append_relative. 36 }
37 This is the string displayed lower of the name. 37 }
38 38 @property image {
39 @return The description of the item 39 set {
40 @ingroup Settingspane 40 }
41 */ 41 get {
42 } 42 }
43 values { 43 values {
44 const (char) *description; 44 file : const(char)*;
45 } 45 group : const(char)*;
46 } 46 }
47 image { 47 }
48 set { 48 @property parent {
49 } 49 get {
50 get { 50 [[
51 } 51 Returns the parent of this item
52 values { 52
53 const (char) *file; 53 This will return the parent item of this item. If there is none it will return NULL.
54 const (char) *group; 54
55 } 55 ]]
56 } 56 }
57 parent { 57 values {
58 get { 58 parent : const(Elm.Settingspane.Item)*;
59 /*@ 59 }
60 Returns the parent of this item 60 }
61 61 @property changed {
62 This will return the parent item of this item. If there is none it will return NULL. 62 [[
63 63 This will mark this item internally as changed,
64 @return The Elm_Settingspane_Item of the parent. 64 the apply button will be enabled, and the item cannot be poped from stack anymore.
65 @ingroup Settingspane 65 This can be undo if the user clicks the apply or reset button.
66 */ 66 ]]
67 } 67 get {
68 values { 68 [[
69 const (Elm_Settingspane_Item) *par; 69 Returns the changed flag
70 } 70
71 } 71 This returns the changed flag of this Item.
72 changed { 72
73 /* 73 The changed flag controls the enable/disable of the apply and reset buttons,
74 * This will mark this item internally as changed, 74 and controls if the panel can be closed.
75 * the apply button will be enabled, and the item cannot be poped from stack anymore. 75
76 * This can be undo if the user clicks the apply or reset button. 76 If this flag is set the apply and reset buttons are enabled, a click on them will
77 */ 77 result in the callbacks to the panel.
78 get { 78 If someone tryes to close this panel while there are unsaved changes,
79 /*@ 79 the panel will be highlighted with an error.
80 Returns the changed flag 80 ]]
81 81 }
82 This returns the changed flag of this Item. 82 set {
83 83 [[
84 The changed flag controls the enable/disable of the apply and reset buttons, 84 Set the chagned flag
85 and controls if the panel can be closed. 85
86 86 This will set the changed flag for this item.
87 If this flag is set the apply and reset buttons are enabled, a click on them will 87
88 result in the callbacks to the panel. 88 The changed flag controls the enable/disable of the apply and reset buttons,
89 If someone tryes to close this panel while there are unsaved changes, 89 and controls if the panel can be closed.
90 the panel will be highlighted with an error. 90
91 91 If this flag is set the apply and reset buttons are enabled, a click on them will
92 @return EINA_TRUE if the flag is set, EINA_FALSE if not 92 result in the callbacks to the panel.
93 @ingroup Settingspane 93 If someone tryes to close this panel while there are unsaved changes,
94 */ 94 the panel will be highlighted with an error.
95 } 95
96 set { 96 noet that if this item doesnt have a attached panel settings this is useless
97 /*@ 97
98 Set the chagned flag 98 ]]
99 99 }
100 This will set the changed flag for this item. 100 values {
101 101 changed : bool; [[set this item to changed]]
102 The changed flag controls the enable/disable of the apply and reset buttons, 102 }
103 and controls if the panel can be closed. 103 }
104 104 @property keywords {
105 If this flag is set the apply and reset buttons are enabled, a click on them will 105 get {
106 result in the callbacks to the panel. 106 }
107 If someone tryes to close this panel while there are unsaved changes, 107 set {
108 the panel will be highlighted with an error. 108 [[
109 109 Set the keywords
110 @note if this item doesnt have a attached panel settings this is useless 110
111 111 This is the string for the search of a item
112 @ingroup Settingspane 112
113 */ 113 The string should be from the form word[,word2]
114 } 114 The value of the searchentry will be compared against the values seperated by a ","
115 values { 115 ]]
116 Eina_Bool changed; /*@ set this item to changed*/ 116 }
117 } 117 values {
118 } 118 word : const(char)*;
119 keywords { 119 }
120 get { 120 }
121 /*@ 121 realize {
122 Returns the keywords 122 [[
123 @ingroup Settingspane 123 This will realize this item, means display it if it does not exists yet, or raise it
124 */ 124 ]]
125 } 125 }
126 set { 126 unrealize {
127 /*@ 127 [[
128 Set the keywords 128 Will delete or just hide this item depending if there are unsaved changes or not
129 129 ]]
130 This is the string for the search of a item 130 }
131 131 attach_panel {
132 The string should be from the form word[,word2] 132 [[
133 The value of the searchentry will be compared against the values seperated by a "," 133 Attach a panel to the item
134 134
135 @ingroup Settingspane 135 This will attach a panel to this item.
136 */ 136
137 } 137 Attaching a panel means if this items gets focused this panel will be shown.
138 values { 138
139 char *word; /*@ set the current keywords to look up */ 139 The callback content_get is just called if this item gets displayed.
140 } 140 If it was closed once and opened another time the callback will be called a second time.
141 } 141
142 } 142 reset and apply are called when the apply or reset button is clicked.
143 methods { 143
144 realize { 144 Note that if the panel can just be attached if this node doenst have childs.
145 /*@ 145 Note that if once the panel has a panel it cannot be used as a parent node anymore.
146 This will realize this item, means display it if it does not exists yet, or raise it 146 ]]
147 */ 147 params {
148 } 148 @in content_get : Content_Get_Cb; [[ Callback to call when the content is requested
149 unrealize {
150 /*@
151 Will delete or just hide this item depending if there are unsaved changes or not
152 */
153 }
154 attach_panel {
155 /*@
156 Attach a panel to the item
157
158 This will attach a panel to this item.
159
160 Attaching a panel means if this items gets focused this panel will be shown.
161
162 The callback content_get is just called if this item gets displayed.
163 If it was closed once and opened another time the callback will be called a second time.
164
165 reset and apply are called when the apply or reset button is clicked.
166
167 @note The panel can just be attached if this node doenst have childs.
168 @note Once the panel has a panel it cannot be used as a parent node anymore.
169
170 @ingroup Settingspane
171 */
172 params {
173 @in Content_Get_Cb content_get; /*@ Callback to call when the content is requested
174 Each time the panel is selected content is requested with the content_cb, 149 Each time the panel is selected content is requested with the content_cb,
175 If the content is changed the old Evas_Object will be saved and displayed next time the item is selected. */ 150 If the content is changed the old Evas_Object will be saved and displayed next time the item is selected.
176 @in Evas_Smart_Cb reset; /*@ Callback to call when the reset button is clicked */ 151 ]]
177 @in Evas_Smart_Cb apply; /*@ Callback to call when the apply button is clicked */ 152 @in reset : Evas_Smart_Cb; [[Callback to call when the reset button is clicked]]
178 } 153 @in apply : Evas_Smart_Cb; [[Callback to call when the apply button is clicked]]
179 }
180 focus {
181 /*@
182 Focus this item
183
184 This will focus the item in the widget, this means its children will be displayed in the menu,
185 or the attached panel will be shown, this item will be the highest on the stack.
186
187 @ingroup Settingspane
188 */
189 }
190 delete {
191 /*@
192 Delete this item
193
194 This will delete this item from the widget.
195
196 If there are children they will also be deleted.
197 If the parent of this item is just diplayed it will be refreshed and show
198 the state after this item is deleted.
199 If this item is the current focused item the stack will go back to a not deleted item.
200
201 @ingroup Settingspane
202 */
203 }
204 } 154 }
155 }
156 focus {
157 [[
158 Focus this item
159
160 This will focus the item in the widget, this means its children will be displayed in the menu,
161 or the attached panel will be shown, this item will be the highest on the stack.
162 ]]
163 }
164 delete {
165 [[
166 Delete this item
167
168 This will delete this item from the widget.
169
170 If there are children they will also be deleted.
171 If the parent of this item is just diplayed it will be refreshed and show
172 the state after this item is deleted.
173 If this item is the current focused item the stack will go back to a not deleted item.
174 ]]
175 }
176 }
205 implements { 177 implements {
206 Eo.Base.destructor; 178 Eo.Base.destructor;
207 } 179 }