summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2019-09-20 13:46:51 -0400
committerMike Blumenkrantz <zmike@samsung.com>2019-09-23 11:49:12 -0400
commitf0a9125fd5f9fc12c5cb414918bbb238afd14ea3 (patch)
treed72dd62128a68d8b6914a45f75676711f494aac3
parent8c2f012f1f3badd8edf675e6cf181c3ae9b4790c (diff)
add list of currently-examined classes, check 'required' statedevs/zmike/edje-theme-spec
-rw-r--r--src/main.c92
1 files changed, 80 insertions, 12 deletions
diff --git a/src/main.c b/src/main.c
index 800dbb0..5e32a65 100644
--- a/src/main.c
+++ b/src/main.c
@@ -19,6 +19,7 @@ typedef struct {
19} Theme_Group; 19} Theme_Group;
20 20
21static Evas *evas; 21static Evas *evas;
22static Evas_Object *edje;
22 23
23static Evas* 24static Evas*
24create_canvas(int width, int height) 25create_canvas(int width, int height)
@@ -107,32 +108,31 @@ void
107add_parts(Theme *theme, Theme_Group *group) 108add_parts(Theme *theme, Theme_Group *group)
108{ 109{
109 Eina_List *parts, *programs, *node; 110 Eina_List *parts, *programs, *node;
110 Evas_Object *o;
111 const char *part, *program; 111 const char *part, *program;
112 112
113 o = edje_edit_object_add(evas); 113 edje = edje_edit_object_add(evas);
114 114
115 edje_object_file_set(o, theme->file, group->name); 115 edje_object_file_set(edje, theme->file, group->name);
116 parts = edje_edit_parts_list_get(o); 116 parts = edje_edit_parts_list_get(edje);
117 117
118 EINA_LIST_FOREACH(parts, node, part) 118 EINA_LIST_FOREACH(parts, node, part)
119 { 119 {
120 Edje_Part_Type type; 120 Edje_Part_Type type;
121 121
122 type = edje_edit_part_type_get(o, part); 122 type = edje_edit_part_type_get(edje, part);
123 123
124 if (eina_list_data_find(group->parts[type], part)) continue; 124 if (eina_list_data_find(group->parts[type], part)) continue;
125 125
126 group->parts[type] = eina_list_sorted_insert(group->parts[type], sort, part); 126 group->parts[type] = eina_list_sorted_insert(group->parts[type], sort, part);
127 } 127 }
128 128
129 programs = edje_edit_programs_list_get(o); 129 programs = edje_edit_programs_list_get(edje);
130 130
131 EINA_LIST_FOREACH(programs, node, program) 131 EINA_LIST_FOREACH(programs, node, program)
132 { 132 {
133 const char *_signal; 133 const char *_signal;
134 134
135 _signal = edje_edit_program_signal_get(o, program); 135 _signal = edje_edit_program_signal_get(edje, program);
136 if (!_signal) continue; 136 if (!_signal) continue;
137 137
138 if (eina_list_data_find(group->signals, _signal)) continue; 138 if (eina_list_data_find(group->signals, _signal)) continue;
@@ -191,6 +191,65 @@ static char *type_string[] =
191 "Last" //EDJE_PART_TYPE_LAST 191 "Last" //EDJE_PART_TYPE_LAST
192}; 192};
193 193
194static const char *grps[] =
195{
196"efl/alert_popup/backwall",
197"efl/alert_popup",
198"efl/alert_popup/button_layout2",
199"efl/alert_popup/button",
200"efl/alert_popup/button_layout1",
201"efl/alert_popup/button_layout3",
202"efl/alert_popup/left_button",
203"efl/alert_popup/right_button",
204"efl/bg",
205"efl/button",
206"efl/check",
207"efl/check",
208"efl/collection",
209"efl/datepicker",
210"efl/datepicker/spin_button",
211"efl/focus_highlight/top",
212"efl/focus_highlight/top",
213"efl/grid",
214"efl/grid_item",
215"efl/group_item",
216"efl/image_zoomable",
217"efl/list",
218"efl/list_item",
219"efl/list_item",
220"efl/list_view",
221"efl/photocam",
222"efl/popup",
223"efl/popup/backwall",
224"efl/radio",
225"efl/scroller/contents",
226"efl/scroller",
227"efl/scroller",
228"efl/scroller",
229"efl/slider/horizontal",
230"efl/slider/horizontal",
231"efl/slider/vertical",
232"efl/slider/vertical",
233"efl/spin_button/horizontal/dec_button",
234"efl/spin_button/horizontal/entry",
235"efl/spin_button/horizontal/inc_button",
236"efl/spin_button/vertical/dec_button",
237"efl/spin_button/vertical",
238"efl/spin_button/vertical/entry",
239"efl/spin_button/horizontal",
240"efl/spin",
241"efl/spin_button/horizontal/text_button",
242"efl/spin_button/vertical/inc_button",
243"efl/spin_button/vertical/text_button",
244"efl/tab_bar/tab",
245"efl/tab_bar",
246"efl/tab_pager",
247"efl/tab_page",
248"efl/timepicker/button",
249"efl/timepicker",
250"efl/view_grid"
251};
252
194static void 253static void
195output_theme(Theme *theme, regex_t *group, regex_t *part, regex_t *signal) 254output_theme(Theme *theme, regex_t *group, regex_t *part, regex_t *signal)
196{ 255{
@@ -201,8 +260,16 @@ output_theme(Theme *theme, regex_t *group, regex_t *part, regex_t *signal)
201 { 260 {
202 const char *signals, *parts; 261 const char *signals, *parts;
203 Eina_List *node; 262 Eina_List *node;
263 Eina_Bool found = EINA_FALSE;
204 if (!!regexec(group, theme_group->name, 0, NULL, 0)) 264 if (!!regexec(group, theme_group->name, 0, NULL, 0))
205 continue; 265 continue;
266 for (int i = 0; i < EINA_C_ARRAY_LENGTH(grps); i++)
267 if (strstr(theme_group->name, grps[i]))
268 {
269 found = EINA_TRUE;
270 break;
271 }
272 if (!found) continue;
206 printf("Group: %s\n", theme_group->name); 273 printf("Group: %s\n", theme_group->name);
207 274
208 for(int type = EDJE_PART_TYPE_NONE; type < EDJE_PART_TYPE_LAST; type++){ 275 for(int type = EDJE_PART_TYPE_NONE; type < EDJE_PART_TYPE_LAST; type++){
@@ -210,7 +277,8 @@ output_theme(Theme *theme, regex_t *group, regex_t *part, regex_t *signal)
210 { 277 {
211 if (!!regexec(part, parts, 0, NULL, 0)) continue; 278 if (!!regexec(part, parts, 0, NULL, 0)) continue;
212 279
213 printf("\t %s: %s\n", type_string[type], parts); 280 edje_object_file_set(edje, theme->file, theme_group->name);
281 printf("\t Part %s: %s%s\n", type_string[type], parts, edje_edit_part_required_get(edje, parts) ? " (required)" : "");
214 } 282 }
215 } 283 }
216 284
@@ -250,19 +318,19 @@ int main(int argc, char const *argv[])
250 318
251 theme = parse_theme(file); 319 theme = parse_theme(file);
252 320
253 if (regcomp(&group, "^(e|elm)\\/[a-zA-Z\\_\\/]*", REG_EXTENDED)) 321 if (regcomp(&group, "^(efl)\\/[a-zA-Z\\_\\/]*", REG_EXTENDED))
254 { 322 {
255 printf("Failed to compile regex for group"); 323 printf("Failed to compile regex for group");
256 return -1; 324 return -1;
257 } 325 }
258 326
259 if (regcomp(&part, "^(e|elm)\\.[a-zA-Z\\_\\.]*", REG_EXTENDED)) 327 if (regcomp(&part, "^(efl)\\.[a-zA-Z\\_\\.]*", REG_EXTENDED))
260 { 328 {
261 printf("Failed to compile regex for part"); 329 printf("Failed to compile regex for part");
262 return -1; 330 return -1;
263 } 331 }
264 332
265 if (regcomp(&signal, "^(e|elm),[a-zA-Z\\_,]*", REG_EXTENDED)) 333 if (regcomp(&signal, "^(efl),[a-zA-Z\\_,]*", REG_EXTENDED))
266 { 334 {
267 printf("Failed to compile regex for signal"); 335 printf("Failed to compile regex for signal");
268 return -1; 336 return -1;
@@ -275,4 +343,4 @@ int main(int argc, char const *argv[])
275 evas_shutdown(); 343 evas_shutdown();
276 eina_shutdown(); 344 eina_shutdown();
277 return 0; 345 return 0;
278} \ No newline at end of file 346}