summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/bin/edje/edje_cc.h4
-rw-r--r--src/bin/edje/edje_cc_handlers.c69
-rw-r--r--src/bin/edje/edje_cc_out.c41
-rw-r--r--src/bin/exactness/player.c1
-rw-r--r--src/generic/evas/pdf/main.cpp2
-rw-r--r--src/generic/evas/rsvg/main.c50
-rw-r--r--src/generic/evas/rsvg/meson.build5
-rw-r--r--src/lib/ecore/ecore_anim.c1
-rw-r--r--src/lib/ecore_file/ecore_file_monitor_kevent.c12
-rw-r--r--src/lib/edje/Edje_Common.h31
-rw-r--r--src/lib/edje/edje_data.c7
-rw-r--r--src/lib/edje/edje_load.c56
-rw-r--r--src/lib/edje/edje_private.h10
-rw-r--r--src/lib/eet/Eet_private.h31
-rw-r--r--src/lib/eet/eet_dictionary.c158
-rw-r--r--src/lib/eet/eet_lib.c1
-rw-r--r--src/lib/eet/eet_utils.c19
-rw-r--r--src/lib/eina/eina_file_common.c2
-rw-r--r--src/lib/eina/eina_file_win32.c2
-rw-r--r--src/lib/eina/eina_private.h17
-rw-r--r--src/lib/eina/eina_util.c6
-rw-r--r--src/lib/eina/eina_vpath.c4
-rw-r--r--src/lib/eina/eina_vpath_xdg.c14
-rw-r--r--src/lib/eio/eio_monitor_kevent.c14
-rw-r--r--src/lib/elementary/efl_ui_textbox.c34
-rw-r--r--src/lib/elementary/elm_code_widget.c66
-rw-r--r--src/lib/elementary/elm_config.c11
-rw-r--r--src/lib/elementary/elm_config.h1
-rw-r--r--src/lib/elementary/elm_spinner.c13
-rw-r--r--src/lib/elementary/elm_theme.c74
-rw-r--r--src/lib/elementary/elm_theme.h25
-rw-r--r--src/lib/emotion/emotion_smart.c7
-rw-r--r--src/lib/evas/canvas/efl_canvas_image.c3
-rw-r--r--src/lib/evas/canvas/efl_canvas_proxy.c20
-rw-r--r--src/lib/evas/canvas/evas_image_private.h2
-rw-r--r--src/lib/evas/canvas/evas_map.c10
-rw-r--r--src/lib/evas/include/evas_private.h1
-rw-r--r--src/lib/evil/evil_stdio.h15
-rw-r--r--src/modules/ecore_evas/engines/x/ecore_evas_x.c2
-rw-r--r--src/modules/emotion/gstreamer1/emotion_gstreamer.c18
-rw-r--r--src/modules/emotion/gstreamer1/emotion_gstreamer.h1
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_image.c20
-rw-r--r--src/modules/evas/engines/software_generic/evas_engine.c19
-rw-r--r--src/modules/evas/engines/software_x11/Evas_Engine_Software_X11.h13
-rw-r--r--src/modules/evas/engines/software_x11/evas_engine.c41
-rw-r--r--src/modules/evas/engines/software_x11/evas_x_egl.c315
-rw-r--r--src/modules/evas/engines/software_x11/evas_x_egl.h23
-rw-r--r--src/modules/evas/engines/software_x11/meson.build7
-rw-r--r--src/tests/eina/eina_test_simple_xml_parser.c2
-rw-r--r--src/tests/evas/evas_suite.c1
-rw-r--r--src/tests/evas/evas_suite.h1
-rw-r--r--src/tests/evas/evas_test_map.c128
-rw-r--r--src/tests/evas/meson.build1
53 files changed, 868 insertions, 563 deletions
diff --git a/src/bin/edje/edje_cc.h b/src/bin/edje/edje_cc.h
index 27338c3540..d7063ef466 100644
--- a/src/bin/edje/edje_cc.h
+++ b/src/bin/edje/edje_cc.h
@@ -270,6 +270,8 @@ int statement_handler_short_single_num(void);
270int nested_handler_num(void); 270int nested_handler_num(void);
271int nested_handler_short_num(void); 271int nested_handler_short_num(void);
272 272
273void color_class_register(const char *name);
274
273void reorder_parts(void); 275void reorder_parts(void);
274void source_edd(void); 276void source_edd(void);
275void source_fetch(void); 277void source_fetch(void);
@@ -348,6 +350,8 @@ extern Eina_List *color_tree_root;
348extern int beta; 350extern int beta;
349extern int no_warn_unused_images; 351extern int no_warn_unused_images;
350 352
353extern Eina_Hash *color_class_reg;
354
351extern int had_quote; 355extern int had_quote;
352 356
353extern unsigned int max_open_files; 357extern unsigned int max_open_files;
diff --git a/src/bin/edje/edje_cc_handlers.c b/src/bin/edje/edje_cc_handlers.c
index 4377204b69..ac4be862a6 100644
--- a/src/bin/edje/edje_cc_handlers.c
+++ b/src/bin/edje/edje_cc_handlers.c
@@ -190,6 +190,8 @@ struct _Edje_Cc_Handlers_Hierarchy_Info /* Struct that keeps globals value to im
190}; 190};
191typedef struct _Edje_Cc_Handlers_Hierarchy_Info Edje_Cc_Handlers_Hierarchy_Info; 191typedef struct _Edje_Cc_Handlers_Hierarchy_Info Edje_Cc_Handlers_Hierarchy_Info;
192 192
193static void color_class_register_color_tag(const char *tag);
194
193static Eina_Array *part_hierarchy = NULL; /* stack parts,support nested parts */ 195static Eina_Array *part_hierarchy = NULL; /* stack parts,support nested parts */
194static void edje_cc_handlers_hierarchy_set(Edje_Part *src); 196static void edje_cc_handlers_hierarchy_set(Edje_Part *src);
195static Edje_Part *edje_cc_handlers_hierarchy_parent_get(void); 197static Edje_Part *edje_cc_handlers_hierarchy_parent_get(void);
@@ -1131,6 +1133,70 @@ New_Statement_Handler statement_handlers_short_single[] =
1131 {"collections.group.parts.part.description.inherit", st_collections_group_parts_part_description_inherit}, 1133 {"collections.group.parts.part.description.inherit", st_collections_group_parts_part_description_inherit},
1132}; 1134};
1133 1135
1136void
1137color_class_register(const char *name)
1138{
1139 if (!color_class_reg) color_class_reg = eina_hash_string_superfast_new(NULL);
1140 if (!color_class_reg)
1141 {
1142 ERR("Out of memory");
1143 exit(-1);
1144 }
1145 if (eina_hash_find(color_class_reg, name)) return;
1146 eina_hash_add(color_class_reg, name, color_class_reg);
1147}
1148
1149static void
1150color_class_register_color_tag_span(const char *start, const char *end)
1151{
1152 const char *s;
1153 char *ts;
1154
1155 if (!start) return;
1156 char *tmps = malloc(end - start + 1);
1157 if (!tmps)
1158 {
1159 ERR("out of memory");
1160 exit(-1);
1161 }
1162 for (ts = tmps, s = start; s < end; s++, ts++) *ts = *s;
1163 *ts = 0;
1164 color_class_register(tmps);
1165 free(tmps);
1166}
1167
1168static void
1169color_class_register_color_tag(const char *tag)
1170{
1171 // find in tag string "xxx=cc:yyy and pass to color_class_register()
1172 const char *s, *cc_start = NULL, *cc_end = NULL;
1173
1174 for (s = tag; *s; s++)
1175 {
1176 if (!cc_start)
1177 {
1178 if ((s[0] == '=') && (s[1] == 'c') && (s[2] == 'c') && (s[3] == ':'))
1179 {
1180 cc_end = NULL;
1181 cc_start = s + 4;
1182 s += 3;
1183 }
1184 }
1185 else
1186 {
1187 if (isblank(s[0]))
1188 {
1189 cc_end = s;
1190 color_class_register_color_tag_span(cc_start, cc_end);
1191 cc_start = NULL;
1192 cc_end = NULL;
1193 }
1194 }
1195 }
1196 if (cc_start && !cc_end) cc_end = s;
1197 color_class_register_color_tag_span(cc_start, cc_end);
1198}
1199
1134/** @edcsubsection{lazedc_external_params, 1200/** @edcsubsection{lazedc_external_params,
1135 * LazEDC Group.Parts.External.Desc.Params} */ 1201 * LazEDC Group.Parts.External.Desc.Params} */
1136 1202
@@ -3202,6 +3268,7 @@ st_styles_style_base(void)
3202 tag->key = mem_strdup("DEFAULT"); 3268 tag->key = mem_strdup("DEFAULT");
3203 tag->value = parse_str(0); 3269 tag->value = parse_str(0);
3204 stl->tags = eina_list_append(stl->tags, tag); 3270 stl->tags = eina_list_append(stl->tags, tag);
3271 color_class_register_color_tag(tag->value);
3205} 3272}
3206 3273
3207/** 3274/**
@@ -3228,6 +3295,7 @@ st_styles_style_tag(void)
3228 tag->key = parse_str(0); 3295 tag->key = parse_str(0);
3229 tag->value = parse_str(1); 3296 tag->value = parse_str(1);
3230 stl->tags = eina_list_append(stl->tags, tag); 3297 stl->tags = eina_list_append(stl->tags, tag);
3298 color_class_register_color_tag(tag->value);
3231} 3299}
3232 3300
3233/** @edcsubsection{toplevel_text_classes, 3301/** @edcsubsection{toplevel_text_classes,
@@ -9084,6 +9152,7 @@ st_collections_group_parts_part_description_color_class(void)
9084 } 9152 }
9085 9153
9086 current_desc->color_class = parse_str(0); 9154 current_desc->color_class = parse_str(0);
9155 color_class_register(current_desc->color_class);
9087} 9156}
9088 9157
9089/** 9158/**
diff --git a/src/bin/edje/edje_cc_out.c b/src/bin/edje/edje_cc_out.c
index e97a8ec005..5f53fa76b9 100644
--- a/src/bin/edje/edje_cc_out.c
+++ b/src/bin/edje/edje_cc_out.c
@@ -224,6 +224,7 @@ Eina_List *codes = NULL;
224Eina_List *code_lookups = NULL; 224Eina_List *code_lookups = NULL;
225Eina_List *aliases = NULL; 225Eina_List *aliases = NULL;
226Eina_List *color_tree_root = NULL; 226Eina_List *color_tree_root = NULL;
227Eina_Hash *color_class_reg = NULL;
227 228
228static Eet_Data_Descriptor *edd_edje_file = NULL; 229static Eet_Data_Descriptor *edd_edje_file = NULL;
229static Eet_Data_Descriptor *edd_edje_part_collection = NULL; 230static Eet_Data_Descriptor *edd_edje_part_collection = NULL;
@@ -2781,6 +2782,44 @@ data_thread_fontmap_end(void *data EINA_UNUSED, Ecore_Thread *thread EINA_UNUSED
2781 thread_end(0); 2782 thread_end(0);
2782} 2783}
2783 2784
2785static Eina_Bool
2786data_write_color_class_register_each_cb(const Eina_Hash *hash EINA_UNUSED,
2787 const void *key,
2788 void *data EINA_UNUSED,
2789 void *fdata)
2790{
2791 Edje_Color_Class_Info *cc_info = fdata;
2792 cc_info->colors = eina_list_append(cc_info->colors,
2793 eina_stringshare_add(key));
2794 return EINA_TRUE;
2795}
2796
2797static void
2798data_write_color_class_register(Eet_File *ef)
2799{
2800 Edje_Color_Class_Info *cc_info;
2801 const char *s;
2802
2803 if (!color_class_reg) return;
2804 cc_info = calloc(1, sizeof(Edje_Color_Class_Info));
2805 if (!cc_info)
2806 {
2807 ERR("Out of Memory");
2808 exit(-1);
2809 }
2810 eina_hash_foreach(color_class_reg,
2811 data_write_color_class_register_each_cb,
2812 cc_info);
2813
2814 eet_data_write(ef, _edje_edd_edje_color_class_info,
2815 "edje/color_class_info", cc_info, compress_mode);
2816
2817 eina_hash_free(color_class_reg);
2818 color_class_reg = NULL;
2819 EINA_LIST_FREE(cc_info->colors, s) eina_stringshare_del(s);
2820 free(cc_info);
2821}
2822
2784void 2823void
2785data_write(void) 2824data_write(void)
2786{ 2825{
@@ -2893,6 +2932,7 @@ data_write(void)
2893 data_thread_authors_end(ef, NULL); 2932 data_thread_authors_end(ef, NULL);
2894 } 2933 }
2895 } 2934 }
2935 data_write_color_class_register(ef);
2896 data_write_images(); 2936 data_write_images();
2897 data_image_sets_init(); 2937 data_image_sets_init();
2898 INF("images: %3.5f", ecore_time_get() - t); t = ecore_time_get(); 2938 INF("images: %3.5f", ecore_time_get() - t); t = ecore_time_get();
@@ -4458,6 +4498,7 @@ process_color_tree(char *s, const char *f_in, int ln)
4458 4498
4459 ctn = mem_alloc(SZ(Edje_Color_Tree_Node)); 4499 ctn = mem_alloc(SZ(Edje_Color_Tree_Node));
4460 ctn->name = strdup(token[!id]); 4500 ctn->name = strdup(token[!id]);
4501 color_class_register(ctn->name);
4461 ctn->color_classes = NULL; 4502 ctn->color_classes = NULL;
4462 4503
4463 edje_file->color_tree = eina_list_append(edje_file->color_tree, ctn); 4504 edje_file->color_tree = eina_list_append(edje_file->color_tree, ctn);
diff --git a/src/bin/exactness/player.c b/src/bin/exactness/player.c
index 66506ba729..419a236018 100644
--- a/src/bin/exactness/player.c
+++ b/src/bin/exactness/player.c
@@ -209,6 +209,7 @@ _shot_do(Evas *e)
209 209
210 if (ex_img) 210 if (ex_img)
211 { 211 {
212 memset(ex_img, 0, sizeof(*ex_img));
212 _dest_unit->imgs = eina_list_append(_dest_unit->imgs, ex_img); 213 _dest_unit->imgs = eina_list_append(_dest_unit->imgs, ex_img);
213 _dest_unit->nb_shots++; 214 _dest_unit->nb_shots++;
214 e_data = ex_img; 215 e_data = ex_img;
diff --git a/src/generic/evas/pdf/main.cpp b/src/generic/evas/pdf/main.cpp
index 933bae5dd5..253b3f3ebf 100644
--- a/src/generic/evas/pdf/main.cpp
+++ b/src/generic/evas/pdf/main.cpp
@@ -348,8 +348,8 @@ main(int argc, char **argv)
348 D("poppler_file_init\n"); 348 D("poppler_file_init\n");
349 if (!poppler_init(file, page_num, size_w, size_h)) 349 if (!poppler_init(file, page_num, size_w, size_h))
350 { 350 {
351 goto cleanup;
352 ret = 1; 351 ret = 1;
352 goto cleanup;
353 } 353 }
354 D("poppler_file_init done\n"); 354 D("poppler_file_init done\n");
355 355
diff --git a/src/generic/evas/rsvg/main.c b/src/generic/evas/rsvg/main.c
index 1eaf2a32c7..69f8f241c6 100644
--- a/src/generic/evas/rsvg/main.c
+++ b/src/generic/evas/rsvg/main.c
@@ -23,7 +23,8 @@ static int width = 0;
23static int height = 0; 23static int height = 0;
24static RsvgDimensionData dim; 24static RsvgDimensionData dim;
25 25
26static inline Eina_Bool evas_image_load_file_is_svg(const char *file) 26static inline Eina_Bool
27evas_image_load_file_is_svg(const char *file)
27{ 28{
28 int i, len = strlen(file); 29 int i, len = strlen(file);
29 Eina_Bool is_gz = EINA_FALSE; 30 Eina_Bool is_gz = EINA_FALSE;
@@ -97,9 +98,28 @@ static int
97read_svg_header(int scale_down, double dpi, int size_w, int size_h) 98read_svg_header(int scale_down, double dpi, int size_w, int size_h)
98{ 99{
99 rsvg_handle_set_dpi(rsvg, 75.0); 100 rsvg_handle_set_dpi(rsvg, 75.0);
101
102#ifdef HAVE_SVG_2_51
103 double owidth, oheight;
104
105 rsvg_handle_get_intrinsic_size_in_pixels(rsvg, &owidth, &oheight);
106 width = ceil(owidth);
107 height = ceil(oheight);
108 if ((width == 0) || (height == 0))
109 {
110 RsvgLength l1, l2;
111 gboolean has_l1, has_l2, has_vb;
112 RsvgRectangle vb;
113
114 rsvg_handle_get_intrinsic_dimensions(rsvg, &has_l1, &l1, &has_l2, &l2, &has_vb, &vb);
115 width = ceil(vb.width);
116 height = ceil(vb.height);
117 }
118#else
100 rsvg_handle_get_dimensions(rsvg, &dim); 119 rsvg_handle_get_dimensions(rsvg, &dim);
101 width = dim.width; 120 width = dim.width;
102 height = dim.height; 121 height = dim.height;
122#endif
103 123
104 if ((width < 1) || (height < 1)) return 0; 124 if ((width < 1) || (height < 1)) return 0;
105 125
@@ -143,22 +163,41 @@ read_svg_data(void)
143 if (!shm_addr) return 0; 163 if (!shm_addr) return 0;
144 164
145 memset(shm_addr, 0, width * height * sizeof (DATA32)); 165 memset(shm_addr, 0, width * height * sizeof (DATA32));
146 surface = cairo_image_surface_create_for_data((unsigned char *)shm_addr, CAIRO_FORMAT_ARGB32, 166 surface = cairo_image_surface_create_for_data((unsigned char *)shm_addr,
147 width, height, width * sizeof(DATA32));; 167 CAIRO_FORMAT_ARGB32,
168 width, height,
169 width * sizeof(DATA32));;
148 if (!surface) return 0; 170 if (!surface) return 0;
149 171
150 cr = cairo_create(surface); 172 cr = cairo_create(surface);
151 if (!cr) return 0; 173 if (!cr) return 0;
152 174
153 cairo_scale(cr, (double) width / dim.em, (double) height / dim.ex); 175 if ((dim.em > 0.0) && (dim.ex > 0.0))
176 cairo_scale(cr, (double) width / dim.em, (double) height / dim.ex);
177 else
178 cairo_scale(cr, (double)1, (double)1);
179
180#ifdef HAVE_SVG_2_51
181 RsvgRectangle vp =
182 {
183 .x = 0,
184 .y = 0,
185 .width = width,
186 .height = height,
187 };
188 rsvg_handle_render_document(rsvg, cr, &vp, NULL);
189#else
154 rsvg_handle_render_cairo(rsvg, cr); 190 rsvg_handle_render_cairo(rsvg, cr);
191#endif
192
155 cairo_surface_destroy(surface); 193 cairo_surface_destroy(surface);
156 cairo_destroy(cr); 194 cairo_destroy(cr);
157 195
158 return 1; 196 return 1;
159} 197}
160 198
161int main(int argc, char **argv) 199int
200main(int argc, char **argv)
162{ 201{
163 char *file; 202 char *file;
164 int i; 203 int i;
@@ -236,6 +275,5 @@ int main(int argc, char **argv)
236 _svg_shutdown(); 275 _svg_shutdown();
237 fflush(stdout); 276 fflush(stdout);
238 return 0; 277 return 0;
239
240} 278}
241 279
diff --git a/src/generic/evas/rsvg/meson.build b/src/generic/evas/rsvg/meson.build
index a0c5ea12ce..64ae1a2edd 100644
--- a/src/generic/evas/rsvg/meson.build
+++ b/src/generic/evas/rsvg/meson.build
@@ -8,5 +8,10 @@ if rsvg.version() >= '2.36.0'
8 config_h.set('HAVE_SVG_2_36', '1') 8 config_h.set('HAVE_SVG_2_36', '1')
9endif 9endif
10 10
11# Needed for rsvg_handle_get_intrinsic_size_in_pixels
12if rsvg.version() >= '2.51.0'
13 config_h.set('HAVE_SVG_2_51', '1')
14endif
15
11generic_deps = [rsvg] 16generic_deps = [rsvg]
12generic_support = ['svg', 'svgz', 'svg.gz'] 17generic_support = ['svg', 'svgz', 'svg.gz']
diff --git a/src/lib/ecore/ecore_anim.c b/src/lib/ecore/ecore_anim.c
index 61e0e95558..e4cf21c9ff 100644
--- a/src/lib/ecore/ecore_anim.c
+++ b/src/lib/ecore/ecore_anim.c
@@ -423,6 +423,7 @@ static void
423_timer_tick_quit(void) 423_timer_tick_quit(void)
424{ 424{
425 if (timer_fd_read < 0) return; 425 if (timer_fd_read < 0) return;
426 ecore_thread_cancel(timer_thread);
426 _tick_send(-1); 427 _tick_send(-1);
427 if (timer_thread) ecore_thread_wait(timer_thread, 0.5); 428 if (timer_thread) ecore_thread_wait(timer_thread, 0.5);
428} 429}
diff --git a/src/lib/ecore_file/ecore_file_monitor_kevent.c b/src/lib/ecore_file/ecore_file_monitor_kevent.c
index e8c4c1e238..9c5ad66c4e 100644
--- a/src/lib/ecore_file/ecore_file_monitor_kevent.c
+++ b/src/lib/ecore_file/ecore_file_monitor_kevent.c
@@ -121,7 +121,6 @@ _ecore_file_monitor_kevent_ls(const char *directory)
121 121
122 it = eina_file_direct_ls(directory); 122 it = eina_file_direct_ls(directory);
123 if (!it) return NULL; 123 if (!it) return NULL;
124
125 EINA_ITERATOR_FOREACH(it, info) 124 EINA_ITERATOR_FOREACH(it, info)
126 { 125 {
127 File_Info *file = malloc(sizeof(File_Info)); 126 File_Info *file = malloc(sizeof(File_Info));
@@ -191,7 +190,10 @@ _ecore_file_monitor_kevent_handler(void *data EINA_UNUSED, Ecore_Fd_Handler *fdh
191 } 190 }
192 if ((evs[i].fflags & NOTE_WRITE) || (evs[i].fflags & NOTE_ATTRIB)) 191 if ((evs[i].fflags & NOTE_WRITE) || (evs[i].fflags & NOTE_ATTRIB))
193 { 192 {
194 _ecore_file_monitor_kevent_find(em); 193 if (ecore_file_is_dir(em->path))
194 _ecore_file_monitor_kevent_find(em);
195 else
196 em->func(em->data, em, ECORE_FILE_EVENT_MODIFIED, em->path);
195 } 197 }
196 } 198 }
197 199
@@ -206,7 +208,6 @@ _ecore_file_monitor_kevent_find(Ecore_File_Monitor *em)
206 Eina_List *files; 208 Eina_List *files;
207 209
208 files = _ecore_file_monitor_kevent_ls(em->path); 210 files = _ecore_file_monitor_kevent_ls(em->path);
209
210 EINA_LIST_FOREACH(ECORE_FILE_MONITOR_KEVENT(em)->prev, l, file) 211 EINA_LIST_FOREACH(ECORE_FILE_MONITOR_KEVENT(em)->prev, l, file)
211 { 212 {
212 Eina_Bool exists = EINA_FALSE; 213 Eina_Bool exists = EINA_FALSE;
@@ -262,7 +263,7 @@ _ecore_file_monitor_kevent_monitor(Ecore_File_Monitor *em, const char *path)
262 struct kevent ev; 263 struct kevent ev;
263 int fd, res = 0; 264 int fd, res = 0;
264 265
265 if ((!ecore_file_exists(path)) || (!ecore_file_is_dir(path))) 266 if (!ecore_file_exists(path))
266 return 0; 267 return 0;
267 268
268 fd = open(path, O_RDONLY); 269 fd = open(path, O_RDONLY);
@@ -276,7 +277,8 @@ _ecore_file_monitor_kevent_monitor(Ecore_File_Monitor *em, const char *path)
276 eina_file_close_on_exec(fd, EINA_TRUE); 277 eina_file_close_on_exec(fd, EINA_TRUE);
277 278
278 ECORE_FILE_MONITOR_KEVENT(em)->fd = fd; 279 ECORE_FILE_MONITOR_KEVENT(em)->fd = fd;
279 ECORE_FILE_MONITOR_KEVENT(em)->prev = _ecore_file_monitor_kevent_ls(em->path); 280 if (ecore_file_is_dir(em->path))
281 ECORE_FILE_MONITOR_KEVENT(em)->prev = _ecore_file_monitor_kevent_ls(em->path);
280 282
281 eina_hash_direct_add(_kevent_monitors, &(ECORE_FILE_MONITOR_KEVENT(em)->fd), em); 283 eina_hash_direct_add(_kevent_monitors, &(ECORE_FILE_MONITOR_KEVENT(em)->fd), em);
282 284
diff --git a/src/lib/edje/Edje_Common.h b/src/lib/edje/Edje_Common.h
index c94a2ff9ac..e03154e6ec 100644
--- a/src/lib/edje/Edje_Common.h
+++ b/src/lib/edje/Edje_Common.h
@@ -1808,6 +1808,37 @@ EAPI Eina_List *edje_mmap_collection_list(Eina_File *f);
1808EAPI void edje_mmap_collection_list_free(Eina_List *lst); 1808EAPI void edje_mmap_collection_list_free(Eina_List *lst);
1809 1809
1810/** 1810/**
1811 * @brief Returns a list of colorclasses used in this edje file
1812 * @param f The mapped file
1813 *
1814 * @return A list of strings freed by edje_file_color_class_used_free()
1815 *
1816 * @since 1.26
1817 */
1818EAPI Eina_List *edje_mmap_color_class_used_list(Eina_File *f);
1819
1820/**
1821 * @brief Returns a list of colorclasses used in this edje file
1822 * @param file The file path
1823 *
1824 * @return A list of strings freed by edje_file_color_class_used_free()
1825 *
1826 * @since 1.26
1827 */
1828EAPI Eina_List *edje_file_color_class_used_list(const char *file);
1829
1830/**
1831 * @brief Frees a list of color classes used
1832 * @param The list
1833 *
1834 * This frees the list returned by edje_mmap_color_class_used_list() or
1835 * edje_file_color_class_used_list() when you no longer need it.
1836 *
1837 * @since 1.26
1838 */
1839EAPI void edje_file_color_class_used_free(Eina_List *lst);
1840
1841/**
1811 * @brief Determines whether a group matching glob exists in an edje mapped file. 1842 * @brief Determines whether a group matching glob exists in an edje mapped file.
1812 * @param f The mapped file 1843 * @param f The mapped file
1813 * @param glob A glob to match on 1844 * @param glob A glob to match on
diff --git a/src/lib/edje/edje_data.c b/src/lib/edje/edje_data.c
index 6a89fd9ca9..1ce628075f 100644
--- a/src/lib/edje/edje_data.c
+++ b/src/lib/edje/edje_data.c
@@ -2,6 +2,7 @@
2 2
3EAPI Eet_Data_Descriptor * _edje_edd_edje_file = NULL; 3EAPI Eet_Data_Descriptor * _edje_edd_edje_file = NULL;
4EAPI Eet_Data_Descriptor * _edje_edd_edje_part_collection = NULL; 4EAPI Eet_Data_Descriptor * _edje_edd_edje_part_collection = NULL;
5EAPI Eet_Data_Descriptor * _edje_edd_edje_color_class_info = NULL;
5 6
6Eet_Data_Descriptor *_edje_edd_edje_string = NULL; 7Eet_Data_Descriptor *_edje_edd_edje_string = NULL;
7Eet_Data_Descriptor *_edje_edd_edje_style = NULL; 8Eet_Data_Descriptor *_edje_edd_edje_style = NULL;
@@ -310,6 +311,7 @@ _edje_edd_shutdown(void)
310 311
311 FREED(_edje_edd_edje_file); 312 FREED(_edje_edd_edje_file);
312 FREED(_edje_edd_edje_part_collection); 313 FREED(_edje_edd_edje_part_collection);
314 FREED(_edje_edd_edje_color_class_info);
313} 315}
314 316
315#define EDJE_DEFINE_POINTER_TYPE(Type, Name) \ 317#define EDJE_DEFINE_POINTER_TYPE(Type, Name) \
@@ -410,6 +412,11 @@ _edje_edd_init(void)
410 EET_DATA_DESCRIPTOR_ADD_VAR_ARRAY(_edje_edd_edje_image_directory, Edje_Image_Directory, "sets", sets, _edje_edd_edje_image_directory_set); 412 EET_DATA_DESCRIPTOR_ADD_VAR_ARRAY(_edje_edd_edje_image_directory, Edje_Image_Directory, "sets", sets, _edje_edd_edje_image_directory_set);
411 EET_DATA_DESCRIPTOR_ADD_VAR_ARRAY(_edje_edd_edje_image_directory, Edje_Image_Directory, "vectors", vectors, _edje_edd_edje_vector_directory_entry); 413 EET_DATA_DESCRIPTOR_ADD_VAR_ARRAY(_edje_edd_edje_image_directory, Edje_Image_Directory, "vectors", vectors, _edje_edd_edje_vector_directory_entry);
412 414
415 /* collection directory */
416 EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_Color_Class_Info);
417 _edje_edd_edje_color_class_info = eet_data_descriptor_file_new(&eddc);
418 EET_DATA_DESCRIPTOR_ADD_LIST_STRING(_edje_edd_edje_color_class_info, Edje_Color_Class_Info, "colors", colors);
419
413 /*MO*/ 420 /*MO*/
414 421
415 EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_Mo); 422 EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_Mo);
diff --git a/src/lib/edje/edje_load.c b/src/lib/edje/edje_load.c
index acf0826b1d..1b9f025ebf 100644
--- a/src/lib/edje/edje_load.c
+++ b/src/lib/edje/edje_load.c
@@ -207,6 +207,62 @@ edje_mmap_collection_list_free(Eina_List *lst)
207 edje_file_collection_list_free(lst); 207 edje_file_collection_list_free(lst);
208} 208}
209 209
210EAPI Eina_List *
211edje_mmap_color_class_used_list(Eina_File *f)
212{
213 Eina_List *lst = NULL, *l;
214 Edje_File *edf;
215 int error_ret = 0;
216 const char *s;
217
218 if (!f) return NULL;
219 edf = _edje_cache_file_coll_open(f, NULL, &error_ret, NULL, NULL);
220 if (edf)
221 {
222 Edje_Color_Class_Info *cc_info;
223
224 cc_info = eet_data_read(edf->ef, _edje_edd_edje_color_class_info,
225 "edje/color_class_info");
226 if (cc_info)
227 {
228 EINA_LIST_FOREACH(cc_info->colors, l, s)
229 lst = eina_list_append(lst, eina_stringshare_add(s));
230 eina_list_free(cc_info->colors);
231 free(cc_info);
232 }
233 _edje_cache_file_unref(edf);
234 }
235
236 return lst;
237}
238
239EAPI Eina_List *
240edje_file_color_class_used_list(const char *file)
241{
242 Eina_File *f;
243 Eina_List *lst = NULL;
244 char *tmp;
245
246 if ((!file) || (!*file)) return NULL;
247 tmp = eina_vpath_resolve(file);
248 f = eina_file_open(tmp, EINA_FALSE);
249 if (!f) goto err;
250
251 lst = edje_mmap_collection_list(f);
252
253 eina_file_close(f); // close matching open OK
254err:
255 free(tmp);
256 return lst;
257}
258
259EAPI void
260edje_file_color_class_used_free(Eina_List *lst)
261{
262 eina_list_free(lst);
263}
264
265
210EAPI Eina_Bool 266EAPI Eina_Bool
211edje_mmap_group_exists(Eina_File *f, const char *glob) 267edje_mmap_group_exists(Eina_File *f, const char *glob)
212{ 268{
diff --git a/src/lib/edje/edje_private.h b/src/lib/edje/edje_private.h
index 1d289123a7..d7f8ff6a3e 100644
--- a/src/lib/edje/edje_private.h
+++ b/src/lib/edje/edje_private.h
@@ -327,7 +327,7 @@ typedef struct _Edje_Gfx_Filter Edje_Gfx_Filter;
327typedef struct _Edje_Gfx_Filter_Directory Edje_Gfx_Filter_Directory; 327typedef struct _Edje_Gfx_Filter_Directory Edje_Gfx_Filter_Directory;
328typedef struct _Edje_Color_Tree_Node Edje_Color_Tree_Node; 328typedef struct _Edje_Color_Tree_Node Edje_Color_Tree_Node;
329typedef struct _Edje_Vector_Directory_Entry Edje_Vector_Directory_Entry; 329typedef struct _Edje_Vector_Directory_Entry Edje_Vector_Directory_Entry;
330 330typedef struct _Edje_Color_Class_Info Edje_Color_Class_Info;
331 331
332typedef struct _Edje_Vibration_Sample Edje_Vibration_Sample; 332typedef struct _Edje_Vibration_Sample Edje_Vibration_Sample;
333typedef struct _Edje_Vibration_Directory Edje_Vibration_Directory; 333typedef struct _Edje_Vibration_Directory Edje_Vibration_Directory;
@@ -656,7 +656,12 @@ struct _Edje_External_Directory_Entry
656 656
657/*----------*/ 657/*----------*/
658 658
659 659/*----------*/
660struct _Edje_Color_Class_Info
661{
662 Eina_List *colors;
663};
664/*----------*/
660 665
661/*----------*/ 666/*----------*/
662 667
@@ -2334,6 +2339,7 @@ EAPI void _edje_edd_shutdown(void);
2334 2339
2335EAPI extern Eet_Data_Descriptor *_edje_edd_edje_file; 2340EAPI extern Eet_Data_Descriptor *_edje_edd_edje_file;
2336EAPI extern Eet_Data_Descriptor *_edje_edd_edje_part_collection; 2341EAPI extern Eet_Data_Descriptor *_edje_edd_edje_part_collection;
2342EAPI extern Eet_Data_Descriptor *_edje_edd_edje_color_class_info;
2337 2343
2338extern Eina_Inlist *_edje_edjes; 2344extern Eina_Inlist *_edje_edjes;
2339 2345
diff --git a/src/lib/eet/Eet_private.h b/src/lib/eet/Eet_private.h
index ef274a07ad..8b85a9377f 100644
--- a/src/lib/eet/Eet_private.h
+++ b/src/lib/eet/Eet_private.h
@@ -40,19 +40,29 @@ struct _Eet_Dictionary
40 unsigned char *all_hash; 40 unsigned char *all_hash;
41 unsigned char *all_allocated; 41 unsigned char *all_allocated;
42 42
43 const char *start;
44 const char *end;
45
43 Eina_Hash *converts; 46 Eina_Hash *converts;
44 Eina_RWLock rwlock; 47 Eina_RWLock rwlock;
45 48
46 int size; 49 int size;
47 int offset; 50 int offset;
51 int count;
52 int total;
48 53
49 int hash[256]; 54 int hash[256];
50 55
51 int count; 56 Eina_Hash *add_hash;
52 int total;
53 57
54 const char *start; 58 // This is a quick and dirty speedup when building a dictionary
55 const char *end; 59 // or looking stuff up especially when looking up the same set of
60 // strings again and again one after the other
61 struct {
62 int hash, len, current, previous;
63 const char *str;
64 } cache[16];
65 int cache_id;
56}; 66};
57 67
58struct _Eet_Node 68struct _Eet_Node
@@ -240,13 +250,13 @@ int
240eet_dictionary_string_get_size_unlocked(const Eet_Dictionary *ed, 250eet_dictionary_string_get_size_unlocked(const Eet_Dictionary *ed,
241 int index); 251 int index);
242int 252int
243eet_dictionary_string_get_size(const Eet_Dictionary *ed, 253eet_dictionary_string_get_size(Eet_Dictionary *ed,
244 int index); 254 int index);
245const char * 255const char *
246eet_dictionary_string_get_char_unlocked(const Eet_Dictionary *ed, 256eet_dictionary_string_get_char_unlocked(const Eet_Dictionary *ed,
247 int index); 257 int index);
248const char * 258const char *
249eet_dictionary_string_get_char(const Eet_Dictionary *ed, 259eet_dictionary_string_get_char(Eet_Dictionary *ed,
250 int index); 260 int index);
251Eina_Bool 261Eina_Bool
252eet_dictionary_string_get_float_unlocked(const Eet_Dictionary *ed, 262eet_dictionary_string_get_float_unlocked(const Eet_Dictionary *ed,
@@ -276,9 +286,16 @@ int
276eet_dictionary_string_get_hash_unlocked(const Eet_Dictionary *ed, 286eet_dictionary_string_get_hash_unlocked(const Eet_Dictionary *ed,
277 int index); 287 int index);
278int 288int
279eet_dictionary_string_get_hash(const Eet_Dictionary *ed, 289eet_dictionary_string_get_hash(Eet_Dictionary *ed,
280 int index); 290 int index);
281 291
292void
293eet_dictionary_write_prepare(Eet_Dictionary *ed);
294
295int
296_eet_hash_gen_len(const char *key,
297 int hash_size,
298 int *len_ret);
282int _eet_hash_gen(const char *key, 299int _eet_hash_gen(const char *key,
283 int hash_size); 300 int hash_size);
284 301
diff --git a/src/lib/eet/eet_dictionary.c b/src/lib/eet/eet_dictionary.c
index c8756f7b00..ea54b118ad 100644
--- a/src/lib/eet/eet_dictionary.c
+++ b/src/lib/eet/eet_dictionary.c
@@ -43,9 +43,79 @@ eet_dictionary_free(Eet_Dictionary *ed)
43 free(ed->all_allocated); 43 free(ed->all_allocated);
44 44
45 if (ed->converts) eina_hash_free(ed->converts); 45 if (ed->converts) eina_hash_free(ed->converts);
46 if (ed->add_hash) eina_hash_free(ed->add_hash);
46 eet_dictionary_mp_free(ed); 47 eet_dictionary_mp_free(ed);
47} 48}
48 49
50void
51eet_dictionary_lock_read(const Eet_Dictionary *ed)
52{
53 eina_rwlock_take_read((Eina_RWLock *)&ed->rwlock);
54}
55
56void
57eet_dictionary_lock_write(Eet_Dictionary *ed)
58{
59 eina_rwlock_take_write((Eina_RWLock *)&ed->rwlock);
60}
61
62void
63eet_dictionary_unlock(const Eet_Dictionary *ed)
64{
65 eina_rwlock_release((Eina_RWLock *)&ed->rwlock);
66}
67
68static Eina_Bool
69_eet_dictionary_write_prepare_hash_cb(const Eina_Hash *hashtab EINA_UNUSED, const void *key, void *value, void *data)
70{
71 Eet_Dictionary *ed = data;
72 const char *str, *string = key;
73 Eet_String *current;
74 int hash, len, idx = (int)((uintptr_t)value) - 1;
75
76 hash = _eet_hash_gen_len(string, 8, &len);
77 len++;
78
79 str = eina_stringshare_add(string);
80 if (!str) goto on_error;
81
82 current = ed->all + idx;
83
84 ed->all_allocated[idx >> 3] |= (1 << (idx & 0x7));
85 ed->all_hash[idx] = hash;
86
87 current->str = str;
88 current->len = len;
89
90 current->next = ed->hash[hash];
91 ed->hash[hash] = idx;
92
93on_error:
94 return EINA_TRUE;
95}
96
97void
98eet_dictionary_write_prepare(Eet_Dictionary *ed)
99{
100 eina_rwlock_take_write(&ed->rwlock);
101 if (!ed->add_hash)
102 {
103 eina_rwlock_release(&ed->rwlock);
104 return;
105 }
106
107 ed->total = ed->count;
108
109 ed->all = malloc(ed->count * sizeof(Eet_String));
110 ed->all_hash = malloc(ed->count);
111 ed->all_allocated = malloc(((ed->count >> 3) + 1));
112
113 eina_hash_foreach(ed->add_hash, _eet_dictionary_write_prepare_hash_cb, ed);
114 eina_hash_free(ed->add_hash);
115 ed->add_hash = NULL;
116 eina_rwlock_release(&ed->rwlock);
117}
118
49static int 119static int
50_eet_dictionary_lookup(Eet_Dictionary *ed, 120_eet_dictionary_lookup(Eet_Dictionary *ed,
51 const char *string, 121 const char *string,
@@ -53,7 +123,21 @@ _eet_dictionary_lookup(Eet_Dictionary *ed,
53 int hash, 123 int hash,
54 int *previous) 124 int *previous)
55{ 125{
56 int prev = -1, current; 126 int prev = -1, current, i;
127
128 for (i = 0; i < 16; i++)
129 {
130 if ((ed->cache[i].hash == hash) &&
131 (((ed->cache[i].str) &&
132 (ed->cache[i].str == string)) ||
133 ((ed->cache[i].len == len) &&
134 (!strcmp(ed->cache[i].str, string)))))
135 {
136 if (previous) *previous = ed->cache[i].previous;
137 current = ed->cache[i].current;
138 return current;
139 }
140 }
57 141
58 current = ed->hash[hash]; 142 current = ed->hash[hash];
59 while (current != -1) 143 while (current != -1)
@@ -63,6 +147,13 @@ _eet_dictionary_lookup(Eet_Dictionary *ed,
63 ((ed->all[current].len == len) && 147 ((ed->all[current].len == len) &&
64 (!strcmp(ed->all[current].str, string))))) 148 (!strcmp(ed->all[current].str, string)))))
65 { 149 {
150 ed->cache[ed->cache_id].hash = hash;
151 ed->cache[ed->cache_id].current = current;
152 ed->cache[ed->cache_id].previous = prev;
153 ed->cache[ed->cache_id].str = ed->all[current].str;
154 ed->cache[ed->cache_id].len = len;
155 ed->cache_id++;
156 if (ed->cache_id >= 16) ed->cache_id = 0;
66 break; 157 break;
67 } 158 }
68 prev = current; 159 prev = current;
@@ -72,24 +163,6 @@ _eet_dictionary_lookup(Eet_Dictionary *ed,
72 return current; 163 return current;
73} 164}
74 165
75void
76eet_dictionary_lock_read(const Eet_Dictionary *ed)
77{
78 eina_rwlock_take_read((Eina_RWLock *)&ed->rwlock);
79}
80
81void
82eet_dictionary_lock_write(Eet_Dictionary *ed)
83{
84 eina_rwlock_take_write((Eina_RWLock *)&ed->rwlock);
85}
86
87void
88eet_dictionary_unlock(const Eet_Dictionary *ed)
89{
90 eina_rwlock_release((Eina_RWLock *)&ed->rwlock);
91}
92
93int 166int
94eet_dictionary_string_add(Eet_Dictionary *ed, 167eet_dictionary_string_add(Eet_Dictionary *ed,
95 const char *string) 168 const char *string)
@@ -97,11 +170,38 @@ eet_dictionary_string_add(Eet_Dictionary *ed,
97 Eet_String *current; 170 Eet_String *current;
98 const char *str; 171 const char *str;
99 int hash, idx, pidx, len, cnt; 172 int hash, idx, pidx, len, cnt;
173 uintptr_t ret;
100 174
101 if (!ed) return -1; 175 if (!ed) return -1;
102 176
103 hash = _eet_hash_gen(string, 8); 177 // fast path in initial dict build - add hashes to eina hash not eet one
104 len = strlen(string) + 1; 178 // as eina is much faster - prepare for write later
179 eina_rwlock_take_write(&ed->rwlock);
180 if (ed->count == 0)
181 {
182 if (!ed->add_hash) ed->add_hash = eina_hash_string_superfast_new(NULL);
183 }
184 if (ed->add_hash)
185 {
186 ret = (uintptr_t)eina_hash_find(ed->add_hash, string);
187 if (ret > 0)
188 {
189 idx = (int)(ret - 1);
190 eina_rwlock_release(&ed->rwlock);
191 return idx;
192 }
193 ret = ed->count + 1;
194 eina_hash_add(ed->add_hash, string, (void *)ret);
195 ed->count++;
196 eina_rwlock_release(&ed->rwlock);
197 return (int)(ret - 1);
198 }
199 eina_rwlock_release(&ed->rwlock);
200
201 // fall back - we converted/prepared the dict for writing so go to slow
202 // mode - we still have a little cache for looking it up though
203 hash = _eet_hash_gen_len(string, 8, &len);
204 len++;
105 205
106 eina_rwlock_take_read(&ed->rwlock); 206 eina_rwlock_take_read(&ed->rwlock);
107 207
@@ -175,11 +275,12 @@ done:
175} 275}
176 276
177int 277int
178eet_dictionary_string_get_size(const Eet_Dictionary *ed, 278eet_dictionary_string_get_size(Eet_Dictionary *ed,
179 int idx) 279 int idx)
180{ 280{
181 int length; 281 int length;
182 282
283 eet_dictionary_write_prepare(ed);
183 eina_rwlock_take_read((Eina_RWLock *)&ed->rwlock); 284 eina_rwlock_take_read((Eina_RWLock *)&ed->rwlock);
184 length = eet_dictionary_string_get_size_unlocked(ed, idx); 285 length = eet_dictionary_string_get_size_unlocked(ed, idx);
185 eina_rwlock_release((Eina_RWLock *)&ed->rwlock); 286 eina_rwlock_release((Eina_RWLock *)&ed->rwlock);
@@ -214,11 +315,12 @@ done:
214} 315}
215 316
216int 317int
217eet_dictionary_string_get_hash(const Eet_Dictionary *ed, 318eet_dictionary_string_get_hash(Eet_Dictionary *ed,
218 int idx) 319 int idx)
219{ 320{
220 int hash; 321 int hash;
221 322
323 eet_dictionary_write_prepare(ed);
222 eina_rwlock_take_read((Eina_RWLock *)&ed->rwlock); 324 eina_rwlock_take_read((Eina_RWLock *)&ed->rwlock);
223 hash = eet_dictionary_string_get_hash_unlocked(ed, idx); 325 hash = eet_dictionary_string_get_hash_unlocked(ed, idx);
224 eina_rwlock_release((Eina_RWLock *)&ed->rwlock); 326 eina_rwlock_release((Eina_RWLock *)&ed->rwlock);
@@ -251,11 +353,12 @@ done:
251} 353}
252 354
253const char * 355const char *
254eet_dictionary_string_get_char(const Eet_Dictionary *ed, 356eet_dictionary_string_get_char(Eet_Dictionary *ed,
255 int idx) 357 int idx)
256{ 358{
257 const char *s = NULL; 359 const char *s = NULL;
258 360
361 eet_dictionary_write_prepare(ed);
259 eina_rwlock_take_read((Eina_RWLock *)&ed->rwlock); 362 eina_rwlock_take_read((Eina_RWLock *)&ed->rwlock);
260 s = eet_dictionary_string_get_char_unlocked(ed, idx); 363 s = eet_dictionary_string_get_char_unlocked(ed, idx);
261 eina_rwlock_release((Eina_RWLock *)&ed->rwlock); 364 eina_rwlock_release((Eina_RWLock *)&ed->rwlock);
@@ -497,6 +600,7 @@ eet_dictionary_string_check(Eet_Dictionary *ed,
497 600
498 if ((!ed) || (!string)) return 0; 601 if ((!ed) || (!string)) return 0;
499 602
603 eet_dictionary_write_prepare(ed);
500 eina_rwlock_take_read((Eina_RWLock *)&ed->rwlock); 604 eina_rwlock_take_read((Eina_RWLock *)&ed->rwlock);
501 if ((ed->start <= string) && (string < ed->end)) res = 1; 605 if ((ed->start <= string) && (string < ed->end)) res = 1;
502 606
diff --git a/src/lib/eet/eet_lib.c b/src/lib/eet/eet_lib.c
index 1aa2a1c9bb..0ed786e1d7 100644
--- a/src/lib/eet/eet_lib.c
+++ b/src/lib/eet/eet_lib.c
@@ -358,6 +358,7 @@ eet_flush2(Eet_File *ef)
358 } 358 }
359 if (ef->ed) 359 if (ef->ed)
360 { 360 {
361 eet_dictionary_write_prepare(ef->ed);
361 num_dictionary_entries = ef->ed->count; 362 num_dictionary_entries = ef->ed->count;
362 363
363 for (i = 0; i < num_dictionary_entries; ++i) 364 for (i = 0; i < num_dictionary_entries; ++i)
diff --git a/src/lib/eet/eet_utils.c b/src/lib/eet/eet_utils.c
index b04ad1b525..6951eeec7e 100644
--- a/src/lib/eet/eet_utils.c
+++ b/src/lib/eet/eet_utils.c
@@ -9,8 +9,9 @@
9#include "Eet_private.h" 9#include "Eet_private.h"
10 10
11int 11int
12_eet_hash_gen(const char *key, 12_eet_hash_gen_len(const char *key,
13 int hash_size) 13 int hash_size,
14 int *len_ret)
14{ 15{
15 int hash_num = 0; 16 int hash_num = 0;
16 int value, i; 17 int value, i;
@@ -19,13 +20,17 @@ _eet_hash_gen(const char *key,
19 20
20 /* no string - index 0 */ 21 /* no string - index 0 */
21 if (!key) 22 if (!key)
22 return 0; 23 {
24 *len_ret = 0;
25 return 0;
26 }
23 27
24 /* calc hash num */ 28 /* calc hash num */
25 for (i = 0, ptr = (unsigned char *)key, value = (int)(*ptr); 29 for (i = 0, ptr = (unsigned char *)key, value = (int)(*ptr);
26 value; 30 value;
27 ptr++, i++, value = (int)(*ptr)) 31 ptr++, i++, value = (int)(*ptr))
28 hash_num ^= (value | (value << 8)) >> (i & 0x7); 32 hash_num ^= (value | (value << 8)) >> (i & 0x7);
33 *len_ret = i;
29 34
30 /* mask it */ 35 /* mask it */
31 mask = (1 << hash_size) - 1; 36 mask = (1 << hash_size) - 1;
@@ -34,3 +39,11 @@ _eet_hash_gen(const char *key,
34 return hash_num; 39 return hash_num;
35} 40}
36 41
42int
43_eet_hash_gen(const char *key,
44 int hash_size)
45{
46 int len;
47 return _eet_hash_gen_len(key, hash_size, &len);
48}
49
diff --git a/src/lib/eina/eina_file_common.c b/src/lib/eina/eina_file_common.c
index d93d2ef7b7..9e7cd081d3 100644
--- a/src/lib/eina/eina_file_common.c
+++ b/src/lib/eina/eina_file_common.c
@@ -126,7 +126,7 @@ _eina_file_escape(char *path, size_t len)
126 return NULL; 126 return NULL;
127 127
128#ifdef _WIN32 128#ifdef _WIN32
129 EVIL_PATH_SEP_WIN32_TO_UNIX(path); 129 EINA_PATH_TO_UNIX(path);
130#endif 130#endif
131 131
132 while ((p = strchr(p, '/'))) 132 while ((p = strchr(p, '/')))
diff --git a/src/lib/eina/eina_file_win32.c b/src/lib/eina/eina_file_win32.c
index 455d583b96..ddce2137ec 100644
--- a/src/lib/eina/eina_file_win32.c
+++ b/src/lib/eina/eina_file_win32.c
@@ -550,7 +550,7 @@ eina_file_cleanup(Eina_Tmpstr *path)
550 if (!result) 550 if (!result)
551 return NULL; 551 return NULL;
552 552
553 EVIL_PATH_SEP_WIN32_TO_UNIX(result); 553 EINA_PATH_TO_UNIX(result);
554 554
555 return result; 555 return result;
556} 556}
diff --git a/src/lib/eina/eina_private.h b/src/lib/eina/eina_private.h
index 9d4da033ce..0de9dd8f81 100644
--- a/src/lib/eina/eina_private.h
+++ b/src/lib/eina/eina_private.h
@@ -35,6 +35,23 @@
35#include "eina_accessor.h" 35#include "eina_accessor.h"
36#include "eina_stringshare.h" 36#include "eina_stringshare.h"
37 37
38#ifdef _WIN32
39
40# define EINA_PATH_SEP_SWAP(p, s1, s2) \
41 do { \
42 char *iter = p; \
43 while (*iter) \
44 { \
45 if (*iter == s1) \
46 *iter = s2; \
47 iter++; \
48 } \
49 } while (0)
50
51# define EINA_PATH_TO_UNIX(p) EINA_PATH_SEP_SWAP(p, '\\', '/')
52# define EINA_PATH_TO_WIN32(p) EINA_PATH_SEP_SWAP(p, '/', '\\')
53#endif
54
38#ifndef ABS 55#ifndef ABS
39# define ABS(x) ((x) < 0 ? -(x) : (x)) 56# define ABS(x) ((x) < 0 ? -(x) : (x))
40#endif 57#endif
diff --git a/src/lib/eina/eina_util.c b/src/lib/eina/eina_util.c
index a003eb8fdb..036b85a382 100644
--- a/src/lib/eina/eina_util.c
+++ b/src/lib/eina/eina_util.c
@@ -91,6 +91,9 @@ eina_environment_home_get(void)
91 } 91 }
92#endif 92#endif
93 home = strdup(home); 93 home = strdup(home);
94#ifdef _WIN32
95 EINA_PATH_TO_UNIX(home);
96#endif
94 return home; 97 return home;
95} 98}
96 99
@@ -130,5 +133,8 @@ eina_environment_tmp_get(void)
130#endif 133#endif
131 134
132 tmp = strdup(tmp); 135 tmp = strdup(tmp);
136#ifdef _WIN32
137 EINA_PATH_TO_UNIX(tmp);
138#endif
133 return tmp; 139 return tmp;
134} 140}
diff --git a/src/lib/eina/eina_vpath.c b/src/lib/eina/eina_vpath.c
index 38255efcff..5db0071403 100644
--- a/src/lib/eina/eina_vpath.c
+++ b/src/lib/eina/eina_vpath.c
@@ -408,7 +408,9 @@ eina_vpath_interface_user_set(Eina_Vpath_Interface_User *user)
408 ADD(downloads); 408 ADD(downloads);
409 ADD(music); 409 ADD(music);
410 ADD(pictures); 410 ADD(pictures);
411 ADD(pub); 411// should be public ain path string
412// ADD(pub);
413 _eina_vpath_data_add("usr.public", user->pub);
412 ADD(templates); 414 ADD(templates);
413 ADD(videos); 415 ADD(videos);
414 ADD(data); 416 ADD(data);
diff --git a/src/lib/eina/eina_vpath_xdg.c b/src/lib/eina/eina_vpath_xdg.c
index 43ca85e1d9..f9cecc5b1f 100644
--- a/src/lib/eina/eina_vpath_xdg.c
+++ b/src/lib/eina/eina_vpath_xdg.c
@@ -19,6 +19,11 @@ eina_xdg_env_init(void)
19 Eina_Vpath_Interface_User user; 19 Eina_Vpath_Interface_User user;
20 20
21 eina_vpath_resolve_snprintf(home, sizeof(home), "(:home:)/"); 21 eina_vpath_resolve_snprintf(home, sizeof(home), "(:home:)/");
22 // last char is / - we won't want it
23 for (s = home; *s; s++)
24 {
25 if (s[1] == 0) s[0] = 0;
26 }
22 memset(&user, 0, sizeof(Eina_Vpath_Interface_User)); 27 memset(&user, 0, sizeof(Eina_Vpath_Interface_User));
23 28
24#define FATAL_SNPRINTF(_buf, _err, _fmt, ...) \ 29#define FATAL_SNPRINTF(_buf, _err, _fmt, ...) \
@@ -37,6 +42,7 @@ eina_xdg_env_init(void)
37 if (!s) s = home; \ 42 if (!s) s = home; \
38 } else s = home; \ 43 } else s = home; \
39 FATAL_SNPRINTF(_meta, "vpath string '%s' truncated - fatal", "%s\\%s", s, (char *)_dir); \ 44 FATAL_SNPRINTF(_meta, "vpath string '%s' truncated - fatal", "%s\\%s", s, (char *)_dir); \
45 EINA_PATH_TO_UNIX(_meta); \
40 (&user)->_meta = _meta; 46 (&user)->_meta = _meta;
41 47
42# define ENV_SET(_env, _meta) \ 48# define ENV_SET(_env, _meta) \
@@ -45,7 +51,8 @@ eina_xdg_env_init(void)
45 s = getenv(_env); \ 51 s = getenv(_env); \
46 if (!s) s = home; \ 52 if (!s) s = home; \
47 } else s = home; \ 53 } else s = home; \
48 FATAL_SNPRINTF(_meta, "vpath string '%s' truncated - fatal", "%s\\", s); \ 54 FATAL_SNPRINTF(_meta, "vpath string '%s' truncated - fatal", "%s", s); \
55 EINA_PATH_TO_UNIX(_meta); \
49 (&user)->_meta = _meta; 56 (&user)->_meta = _meta;
50 57
51 ENV_DIR_SET(NULL, "Desktop", desktop); 58 ENV_DIR_SET(NULL, "Desktop", desktop);
@@ -63,7 +70,10 @@ eina_xdg_env_init(void)
63 if (!(s = getenv("APPDATA"))) 70 if (!(s = getenv("APPDATA")))
64 user.run = NULL; 71 user.run = NULL;
65 else 72 else
66 user.run = s; 73 {
74 EINA_PATH_TO_UNIX(s);
75 user.run = s;
76 }
67#else /* _WIN32 */ 77#else /* _WIN32 */
68# if defined(HAVE_GETUID) && defined(HAVE_GETEUID) 78# if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
69# define ENV_HOME_SET(_env, _dir, _meta) \ 79# define ENV_HOME_SET(_env, _dir, _meta) \
diff --git a/src/lib/eio/eio_monitor_kevent.c b/src/lib/eio/eio_monitor_kevent.c
index a99b27763f..0750875e88 100644
--- a/src/lib/eio/eio_monitor_kevent.c
+++ b/src/lib/eio/eio_monitor_kevent.c
@@ -189,10 +189,13 @@ _eio_kevent_handler(void *data EINA_UNUSED, Ecore_Fd_Handler *fdh)
189 if(evs[i].fflags & NOTE_WRITE || evs[i].fflags & NOTE_ATTRIB) 189 if(evs[i].fflags & NOTE_WRITE || evs[i].fflags & NOTE_ATTRIB)
190 { 190 {
191 /* Handle directory/file creation and deletion */ 191 /* Handle directory/file creation and deletion */
192 _eio_kevent_event_find(backend); 192 if (ecore_file_is_dir(backend->parent->path))
193 /* Old default behaviour */ 193 _eio_kevent_event_find(backend);
194 event_code = EIO_MONITOR_FILE_MODIFIED; 194 else
195 _eio_monitor_send(backend->parent, backend->parent->path, event_code); 195 {
196 event_code = EIO_MONITOR_FILE_MODIFIED;
197 _eio_monitor_send(backend->parent, backend->parent->path, event_code);
198 }
196 } 199 }
197 } 200 }
198 201
@@ -279,7 +282,8 @@ void eio_monitor_backend_add(Eio_Monitor *monitor)
279 backend->parent = monitor; 282 backend->parent = monitor;
280 monitor->backend = backend; 283 monitor->backend = backend;
281 284
282 backend->prev_list = _eio_kevent_ls(backend->parent->path); 285 if (ecore_file_is_dir(backend->parent->path))
286 backend->prev_list = _eio_kevent_ls(backend->parent->path);
283 287
284 eina_hash_direct_add(_kevent_monitors, &backend->fd, backend); 288 eina_hash_direct_add(_kevent_monitors, &backend->fd, backend);
285 289
diff --git a/src/lib/elementary/efl_ui_textbox.c b/src/lib/elementary/efl_ui_textbox.c
index 165ef1f0e4..b58b3a2c08 100644
--- a/src/lib/elementary/efl_ui_textbox.c
+++ b/src/lib/elementary/efl_ui_textbox.c
@@ -1616,7 +1616,22 @@ _update_text_theme(Eo *obj, Efl_Ui_Textbox_Data *sd)
1616 colorcode = efl_layout_group_data_get(wd->resize_obj, "style.color_disabled"); 1616 colorcode = efl_layout_group_data_get(wd->resize_obj, "style.color_disabled");
1617 if (!colorcode) 1617 if (!colorcode)
1618 colorcode = efl_layout_group_data_get(wd->resize_obj, "style.color"); 1618 colorcode = efl_layout_group_data_get(wd->resize_obj, "style.color");
1619 if (colorcode && _format_color_parse(colorcode, strlen(colorcode), &r, &g, &b, &a)) 1619 if (colorcode && !strncmp(colorcode, "cc:", 3))
1620 {
1621 int r, g, b, a;
1622
1623 if (edje_object_color_class_get(wd->resize_obj, colorcode + 3,
1624 &r, &g, &b, &a,
1625 NULL, NULL, NULL, NULL,
1626 NULL, NULL, NULL, NULL))
1627 {
1628 r = (r * a) / 255;
1629 g = (g * a) / 255;
1630 b = (b * a) / 255;
1631 efl_text_color_set(sd->text_obj, r, g, b, a);
1632 }
1633 }
1634 else if (colorcode && _format_color_parse(colorcode, strlen(colorcode), &r, &g, &b, &a))
1620 { 1635 {
1621 efl_text_color_set(sd->text_obj, r, g, b, a); 1636 efl_text_color_set(sd->text_obj, r, g, b, a);
1622 } 1637 }
@@ -1641,7 +1656,22 @@ _update_text_theme(Eo *obj, Efl_Ui_Textbox_Data *sd)
1641 colorcode = efl_layout_group_data_get(wd->resize_obj, "guide.style.color_disabled"); 1656 colorcode = efl_layout_group_data_get(wd->resize_obj, "guide.style.color_disabled");
1642 if (!colorcode) 1657 if (!colorcode)
1643 colorcode = efl_layout_group_data_get(wd->resize_obj, "guide.style.color"); 1658 colorcode = efl_layout_group_data_get(wd->resize_obj, "guide.style.color");
1644 if (colorcode && _format_color_parse(colorcode, strlen(colorcode), &r, &g, &b, &a)) 1659 if (colorcode && !strncmp(colorcode, "cc:", 3))
1660 {
1661 int r, g, b, a;
1662
1663 if (edje_object_color_class_get(wd->resize_obj, colorcode + 3,
1664 &r, &g, &b, &a,
1665 NULL, NULL, NULL, NULL,
1666 NULL, NULL, NULL, NULL))
1667 {
1668 r = (r * a) / 255;
1669 g = (g * a) / 255;
1670 b = (b * a) / 255;
1671 efl_text_color_set(sd->text_guide_obj, r, g, b, a);
1672 }
1673 }
1674 else if(colorcode && _format_color_parse(colorcode, strlen(colorcode), &r, &g, &b, &a))
1645 { 1675 {
1646 efl_text_color_set(sd->text_guide_obj, r, g, b, a); 1676 efl_text_color_set(sd->text_guide_obj, r, g, b, a);
1647 } 1677 }
diff --git a/src/lib/elementary/elm_code_widget.c b/src/lib/elementary/elm_code_widget.c
index cbced2924d..149d604946 100644
--- a/src/lib/elementary/elm_code_widget.c
+++ b/src/lib/elementary/elm_code_widget.c
@@ -1966,43 +1966,43 @@ _elm_code_widget_setup_palette(Evas_Object *o, Evas_Object *layout, float fade)
1966 edje = elm_layout_edje_get(layout); 1966 edje = elm_layout_edje_get(layout);
1967 1967
1968 // setup status colors 1968 // setup status colors
1969 _elm_code_widget_setup_palette_item(o, ELM_CODE_STATUS_TYPE_DEFAULT, "elm/code/status/default", fade, edje); 1969 _elm_code_widget_setup_palette_item(o, ELM_CODE_STATUS_TYPE_DEFAULT, "/fg/normal/text-status", fade, edje);
1970 _elm_code_widget_setup_palette_item(o, ELM_CODE_STATUS_TYPE_CURRENT, "elm/code/status/current", fade, edje); 1970 _elm_code_widget_setup_palette_item(o, ELM_CODE_STATUS_TYPE_CURRENT, "/fg/normal/text-current", fade, edje);
1971 _elm_code_widget_setup_palette_item(o, ELM_CODE_STATUS_TYPE_IGNORED, "elm/code/status/ignored", fade, edje); 1971 _elm_code_widget_setup_palette_item(o, ELM_CODE_STATUS_TYPE_IGNORED, "/fg/normal/text-ignored", fade, edje);
1972 _elm_code_widget_setup_palette_item(o, ELM_CODE_STATUS_TYPE_NOTE, "elm/code/status/note", fade, edje); 1972 _elm_code_widget_setup_palette_item(o, ELM_CODE_STATUS_TYPE_NOTE, "/fg/normal/text-note", fade, edje);
1973 _elm_code_widget_setup_palette_item(o, ELM_CODE_STATUS_TYPE_WARNING, "elm/code/status/warning", fade, edje); 1973 _elm_code_widget_setup_palette_item(o, ELM_CODE_STATUS_TYPE_WARNING, "/fg/normal/text-warning", fade, edje);
1974 _elm_code_widget_setup_palette_item(o, ELM_CODE_STATUS_TYPE_ERROR, "elm/code/status/error", fade, edje); 1974 _elm_code_widget_setup_palette_item(o, ELM_CODE_STATUS_TYPE_ERROR, "/fg/normal/text-error", fade, edje);
1975 _elm_code_widget_setup_palette_item(o, ELM_CODE_STATUS_TYPE_FATAL, "elm/code/status/fatal", fade, edje); 1975 _elm_code_widget_setup_palette_item(o, ELM_CODE_STATUS_TYPE_FATAL, "/fg/normal/text-fatal", fade, edje);
1976 _elm_code_widget_setup_palette_item(o, ELM_CODE_STATUS_TYPE_ADDED, "elm/code/status/added", fade, edje); 1976 _elm_code_widget_setup_palette_item(o, ELM_CODE_STATUS_TYPE_ADDED, "/fg/normal/text-line-added", fade, edje);
1977 _elm_code_widget_setup_palette_item(o, ELM_CODE_STATUS_TYPE_REMOVED, "elm/code/status/removed", fade, edje); 1977 _elm_code_widget_setup_palette_item(o, ELM_CODE_STATUS_TYPE_REMOVED, "/fg/normal/text-line-removed", fade, edje);
1978 _elm_code_widget_setup_palette_item(o, ELM_CODE_STATUS_TYPE_CHANGED, "elm/code/status/changed", fade, edje); 1978 _elm_code_widget_setup_palette_item(o, ELM_CODE_STATUS_TYPE_CHANGED, "/fg/normal/text-line-changed", fade, edje);
1979 _elm_code_widget_setup_palette_item(o, ELM_CODE_STATUS_TYPE_PASSED, "elm/code/status/passed", fade, edje); 1979 _elm_code_widget_setup_palette_item(o, ELM_CODE_STATUS_TYPE_PASSED, "/fg/normal/text-success", fade, edje);
1980 _elm_code_widget_setup_palette_item(o, ELM_CODE_STATUS_TYPE_FAILED, "elm/code/status/failed", fade, edje); 1980 _elm_code_widget_setup_palette_item(o, ELM_CODE_STATUS_TYPE_FAILED, "/fg/normal/text-failure", fade, edje);
1981 _elm_code_widget_setup_palette_item(o, ELM_CODE_STATUS_TYPE_TODO, "elm/code/status/todo", fade, edje); 1981 _elm_code_widget_setup_palette_item(o, ELM_CODE_STATUS_TYPE_TODO, "/fg/normal/text-todo", fade, edje);
1982 1982
1983 // setup token colors 1983 // setup token colors
1984 _elm_code_widget_setup_palette_item(o, ELM_CODE_TOKEN_TYPE_DEFAULT, "elm/code/token/default", fade, edje); 1984 _elm_code_widget_setup_palette_item(o, ELM_CODE_TOKEN_TYPE_DEFAULT, "/fg/normal/text", fade, edje);
1985 _elm_code_widget_setup_palette_item(o, ELM_CODE_TOKEN_TYPE_COMMENT, "elm/code/token/comment", fade, edje); 1985 _elm_code_widget_setup_palette_item(o, ELM_CODE_TOKEN_TYPE_COMMENT, "/fg/normal/text-comment", fade, edje);
1986 _elm_code_widget_setup_palette_item(o, ELM_CODE_TOKEN_TYPE_STRING, "elm/code/token/string", fade, edje); 1986 _elm_code_widget_setup_palette_item(o, ELM_CODE_TOKEN_TYPE_STRING, "/fg/normal/text-string", fade, edje);
1987 _elm_code_widget_setup_palette_item(o, ELM_CODE_TOKEN_TYPE_NUMBER, "elm/code/token/number", fade, edje); 1987 _elm_code_widget_setup_palette_item(o, ELM_CODE_TOKEN_TYPE_NUMBER, "/fg/normal/text-number", fade, edje);
1988 _elm_code_widget_setup_palette_item(o, ELM_CODE_TOKEN_TYPE_BRACE, "elm/code/token/brace", fade, edje); 1988 _elm_code_widget_setup_palette_item(o, ELM_CODE_TOKEN_TYPE_BRACE, "/fg/normal/text-brace", fade, edje);
1989 _elm_code_widget_setup_palette_item(o, ELM_CODE_TOKEN_TYPE_TYPE, "elm/code/token/type", fade, edje); 1989 _elm_code_widget_setup_palette_item(o, ELM_CODE_TOKEN_TYPE_TYPE, "/fg/normal/text-type", fade, edje);
1990 _elm_code_widget_setup_palette_item(o, ELM_CODE_TOKEN_TYPE_CLASS, "elm/code/token/class", fade, edje); 1990 _elm_code_widget_setup_palette_item(o, ELM_CODE_TOKEN_TYPE_CLASS, "/fg/normal/text-class", fade, edje);
1991 _elm_code_widget_setup_palette_item(o, ELM_CODE_TOKEN_TYPE_FUNCTION, "elm/code/token/function", fade, edje); 1991 _elm_code_widget_setup_palette_item(o, ELM_CODE_TOKEN_TYPE_FUNCTION, "/fg/normal/text-function", fade, edje);
1992 _elm_code_widget_setup_palette_item(o, ELM_CODE_TOKEN_TYPE_PARAM, "elm/code/token/param", fade, edje); 1992 _elm_code_widget_setup_palette_item(o, ELM_CODE_TOKEN_TYPE_PARAM, "/fg/normal/text-param", fade, edje);
1993 _elm_code_widget_setup_palette_item(o, ELM_CODE_TOKEN_TYPE_KEYWORD, "elm/code/token/keyword", fade, edje); 1993 _elm_code_widget_setup_palette_item(o, ELM_CODE_TOKEN_TYPE_KEYWORD, "/fg/normal/text-keyword", fade, edje);
1994 _elm_code_widget_setup_palette_item(o, ELM_CODE_TOKEN_TYPE_PREPROCESSOR, "elm/code/token/preprocessor", fade, edje); 1994 _elm_code_widget_setup_palette_item(o, ELM_CODE_TOKEN_TYPE_PREPROCESSOR, "/fg/normal/text-preprocessor", fade, edje);
1995 _elm_code_widget_setup_palette_item(o, ELM_CODE_TOKEN_TYPE_ADDED, "elm/code/token/added", fade, edje); 1995 _elm_code_widget_setup_palette_item(o, ELM_CODE_TOKEN_TYPE_ADDED, "/fg/normal/text-line-added", fade, edje);
1996 _elm_code_widget_setup_palette_item(o, ELM_CODE_TOKEN_TYPE_REMOVED, "elm/code/token/removed", fade, edje); 1996 _elm_code_widget_setup_palette_item(o, ELM_CODE_TOKEN_TYPE_REMOVED, "/fg/normal/text-line-removed", fade, edje);
1997 _elm_code_widget_setup_palette_item(o, ELM_CODE_TOKEN_TYPE_CHANGED, "elm/code/token/changed", fade, edje); 1997 _elm_code_widget_setup_palette_item(o, ELM_CODE_TOKEN_TYPE_CHANGED, "/fg/normal/text-line-changed", fade, edje);
1998 _elm_code_widget_setup_palette_item(o, ELM_CODE_TOKEN_TYPE_MATCH, "elm/code/token/match", fade, edje); 1998 _elm_code_widget_setup_palette_item(o, ELM_CODE_TOKEN_TYPE_MATCH, "/fg/normal/text-match", fade, edje);
1999 1999
2000 // other styles that the widget uses 2000 // other styles that the widget uses
2001 _elm_code_widget_setup_palette_item(o, ELM_CODE_WIDGET_COLOR_SELECTION, "elm/code/widget/color/selection", fade, edje); 2001 _elm_code_widget_setup_palette_item(o, ELM_CODE_WIDGET_COLOR_SELECTION, "/bg/normal/text-selection", fade, edje);
2002 _elm_code_widget_setup_palette_item(o, ELM_CODE_WIDGET_COLOR_GUTTER_BG, "elm/code/widget/color/gutter/bg", fade, edje); 2002 _elm_code_widget_setup_palette_item(o, ELM_CODE_WIDGET_COLOR_GUTTER_BG, "/bg/normal/text-gutter", fade, edje);
2003 _elm_code_widget_setup_palette_item(o, ELM_CODE_WIDGET_COLOR_GUTTER_FG, "elm/code/widget/color/gutter/fg", fade, edje); 2003 _elm_code_widget_setup_palette_item(o, ELM_CODE_WIDGET_COLOR_GUTTER_FG, "/fg/normal/text-gutter", fade, edje);
2004 _elm_code_widget_setup_palette_item(o, ELM_CODE_WIDGET_COLOR_GUTTER_SCOPE_BG, "elm/code/widget/color/scope/bg", fade, edje); 2004 _elm_code_widget_setup_palette_item(o, ELM_CODE_WIDGET_COLOR_GUTTER_SCOPE_BG, "/bg/normal/text-scope", fade, edje);
2005 _elm_code_widget_setup_palette_item(o, ELM_CODE_WIDGET_COLOR_WHITESPACE, "elm/code/widget/color/whitespace", fade, edje); 2005 _elm_code_widget_setup_palette_item(o, ELM_CODE_WIDGET_COLOR_WHITESPACE, "/bg/normal/text-whitespace", fade, edje);
2006} 2006}
2007 2007
2008static void 2008static void
diff --git a/src/lib/elementary/elm_config.c b/src/lib/elementary/elm_config.c
index 9b570822d8..cb9cd3ffd4 100644
--- a/src/lib/elementary/elm_config.c
+++ b/src/lib/elementary/elm_config.c
@@ -1036,6 +1036,17 @@ elm_config_palette_delete(const char *palette)
1036 ecore_file_unlink(buf); 1036 ecore_file_unlink(buf);
1037} 1037}
1038 1038
1039EAPI Eina_Bool
1040elm_config_palette_system_has(const char *palette)
1041{
1042 char buf[PATH_MAX];
1043
1044 if (!palette) return EINA_TRUE;
1045 if (strchr(palette, '/')) return EINA_FALSE;
1046 _elm_data_dir_snprintf(buf, sizeof(buf), "colors/%s.pal", palette);
1047 return ecore_file_exists(buf);
1048}
1049
1039EAPI Eina_List * 1050EAPI Eina_List *
1040elm_config_palette_list(void) 1051elm_config_palette_list(void)
1041{ 1052{
diff --git a/src/lib/elementary/elm_config.h b/src/lib/elementary/elm_config.h
index a437c31e4a..6f61aa0ad8 100644
--- a/src/lib/elementary/elm_config.h
+++ b/src/lib/elementary/elm_config.h
@@ -1138,6 +1138,7 @@ EAPI void elm_config_palette_color_unset(Elm_Palette *pal, const char *n
1138EAPI void elm_config_palette_save(Elm_Palette *pal, const char *palette); 1138EAPI void elm_config_palette_save(Elm_Palette *pal, const char *palette);
1139EAPI void elm_config_palette_free(Elm_Palette *pal); 1139EAPI void elm_config_palette_free(Elm_Palette *pal);
1140EAPI void elm_config_palette_delete(const char *palette); 1140EAPI void elm_config_palette_delete(const char *palette);
1141EAPI Eina_Bool elm_config_palette_system_has(const char *palette);
1141EAPI Eina_List *elm_config_palette_list(void); 1142EAPI Eina_List *elm_config_palette_list(void);
1142EAPI void elm_config_palette_list_free(Eina_List *list); 1143EAPI void elm_config_palette_list_free(Eina_List *list);
1143/** end new palette code **/ 1144/** end new palette code **/
diff --git a/src/lib/elementary/elm_spinner.c b/src/lib/elementary/elm_spinner.c
index 7441cbd338..565f628c9a 100644
--- a/src/lib/elementary/elm_spinner.c
+++ b/src/lib/elementary/elm_spinner.c
@@ -126,7 +126,7 @@ _is_label_format_integer(const char *fmt)
126} 126}
127 127
128static void 128static void
129_entry_show(Elm_Spinner_Data *sd) 129_entry_show(Evas_Object *obj, Elm_Spinner_Data *sd)
130{ 130{
131 Eina_List *l; 131 Eina_List *l;
132 Elm_Spinner_Special_Value *sv; 132 Elm_Spinner_Special_Value *sv;
@@ -182,6 +182,7 @@ _entry_show(Elm_Spinner_Data *sd)
182 snprintf(buf, sizeof(buf), fmt, sd->val); 182 snprintf(buf, sizeof(buf), fmt, sd->val);
183 183
184apply: 184apply:
185 elm_layout_signal_emit(obj, "elm,state,entry,active", "elm");
185 elm_object_text_set(sd->ent, buf); 186 elm_object_text_set(sd->ent, buf);
186} 187}
187 188
@@ -220,7 +221,7 @@ apply:
220 elm_layout_text_set(obj, "elm.text", buf); 221 elm_layout_text_set(obj, "elm.text", buf);
221 222
222 efl_access_i18n_name_changed_signal_emit(obj); 223 efl_access_i18n_name_changed_signal_emit(obj);
223 if (sd->entry_visible) _entry_show(sd); 224 if (sd->entry_visible) _entry_show(obj, sd);
224} 225}
225 226
226static Eina_Bool 227static Eina_Bool
@@ -394,9 +395,7 @@ _entry_hide(Evas_Object *obj)
394 if (sd->button_layout) 395 if (sd->button_layout)
395 { 396 {
396 elm_layout_signal_emit(obj, "elm,state,button,active", "elm"); 397 elm_layout_signal_emit(obj, "elm,state,button,active", "elm");
397 evas_object_show(sd->text_button);
398 elm_layout_signal_emit(obj, "elm,state,entry,inactive", "elm"); 398 elm_layout_signal_emit(obj, "elm,state,entry,inactive", "elm");
399 evas_object_hide(sd->ent);
400 } 399 }
401 else 400 else
402 elm_layout_signal_emit(obj, "elm,state,inactive", "elm"); 401 elm_layout_signal_emit(obj, "elm,state,inactive", "elm");
@@ -601,9 +600,8 @@ _entry_show_cb(void *data,
601{ 600{
602 ELM_SPINNER_DATA_GET(data, sd); 601 ELM_SPINNER_DATA_GET(data, sd);
603 602
604 _entry_show(sd); 603 _entry_show(obj, sd);
605 elm_layout_signal_emit(data, "elm,state,button,inactive", "elm"); 604 elm_layout_signal_emit(data, "elm,state,button,inactive", "elm");
606 evas_object_hide(sd->text_button);
607 elm_object_focus_set(obj, EINA_TRUE); 605 elm_object_focus_set(obj, EINA_TRUE);
608 elm_entry_select_all(obj); 606 elm_entry_select_all(obj);
609 sd->entry_visible = EINA_TRUE; 607 sd->entry_visible = EINA_TRUE;
@@ -648,7 +646,7 @@ _toggle_entry(Evas_Object *obj)
648 if (!sd->button_layout) 646 if (!sd->button_layout)
649 { 647 {
650 elm_layout_signal_emit(obj, "elm,state,active", "elm"); 648 elm_layout_signal_emit(obj, "elm,state,active", "elm");
651 _entry_show(sd); 649 _entry_show(obj, sd);
652 elm_entry_select_all(sd->ent); 650 elm_entry_select_all(sd->ent);
653 sd->entry_visible = EINA_TRUE; 651 sd->entry_visible = EINA_TRUE;
654 } 652 }
@@ -657,7 +655,6 @@ _toggle_entry(Evas_Object *obj)
657 (sd->ent, EFL_UI_FOCUS_OBJECT_EVENT_FOCUS_CHANGED, _entry_focus_change, obj); 655 (sd->ent, EFL_UI_FOCUS_OBJECT_EVENT_FOCUS_CHANGED, _entry_focus_change, obj);
658 sd->entry_visible = EINA_TRUE; 656 sd->entry_visible = EINA_TRUE;
659 elm_layout_signal_emit(obj, "elm,state,entry,active", "elm"); 657 elm_layout_signal_emit(obj, "elm,state,entry,active", "elm");
660 evas_object_show(sd->ent);
661 { 658 {
662 Eina_List *items = NULL; 659 Eina_List *items = NULL;
663 660
diff --git a/src/lib/elementary/elm_theme.c b/src/lib/elementary/elm_theme.c
index 7a40a4d7e9..123bc0f14e 100644
--- a/src/lib/elementary/elm_theme.c
+++ b/src/lib/elementary/elm_theme.c
@@ -521,6 +521,80 @@ _elm_theme_shutdown(void)
521 } 521 }
522} 522}
523 523
524
525
526
527
528static Eina_List *
529_elm_theme_file_color_class_list(Eina_List *list,
530 Eina_Inlist *handles)
531{
532 Eina_Stringshare *c;
533 Eina_List *ccl;
534 Eina_List *ll;
535 Elm_Theme_File *etf;
536
537 EINA_INLIST_FOREACH(handles, etf)
538 {
539 ccl = edje_mmap_color_class_used_list(etf->handle);
540 EINA_LIST_FOREACH(ccl, ll, c)
541 {
542 list = eina_list_append(list, eina_stringshare_add(c));
543 }
544 edje_file_color_class_used_free(ccl);
545 }
546 return list;
547}
548
549static Eina_Bool
550_elm_theme_color_class_list_hash_cb(const Eina_Hash *hash EINA_UNUSED,
551 const void *key,
552 void *data EINA_UNUSED,
553 void *fdata)
554{
555 Eina_List **list = fdata;
556
557 *list = eina_list_append(*list, eina_stringshare_add(key));
558 return EINA_TRUE;
559}
560
561EAPI Eina_List *
562elm_theme_color_class_list(Elm_Theme *th)
563{
564 Eina_List *list;
565 Eina_Hash *hash;
566 const char *s;
567
568 if (!th) th = theme_default;
569 if (!th) return NULL;
570
571 // go through all possible theme files and find collections that match
572 list = _elm_theme_file_color_class_list(NULL, th->overlay);
573 list = _elm_theme_file_color_class_list(list, th->themes);
574 list = _elm_theme_file_color_class_list(list, th->extension);
575
576 hash = eina_hash_string_superfast_new(NULL);
577 EINA_LIST_FREE(list, s)
578 {
579 if (!eina_hash_find(hash, s)) eina_hash_add(hash, s, hash);
580 eina_stringshare_del(s);
581 }
582 eina_hash_foreach(hash, _elm_theme_color_class_list_hash_cb, &list);
583 eina_hash_free(hash);
584
585 // sort the list nicely at the end
586 list = eina_list_sort(list, 0, EINA_COMPARE_CB(strcmp));
587 return list;
588}
589
590EAPI void
591elm_theme_color_class_list_free(Eina_List *list)
592{
593 const char *s;
594
595 EINA_LIST_FREE(list, s) eina_stringshare_del(s);
596}
597
524EAPI Elm_Theme * 598EAPI Elm_Theme *
525elm_theme_new(void) 599elm_theme_new(void)
526{ 600{
diff --git a/src/lib/elementary/elm_theme.h b/src/lib/elementary/elm_theme.h
index 7bf51d5b28..a5c55295da 100644
--- a/src/lib/elementary/elm_theme.h
+++ b/src/lib/elementary/elm_theme.h
@@ -79,6 +79,31 @@
79typedef struct _Elm_Theme Elm_Theme; 79typedef struct _Elm_Theme Elm_Theme;
80 80
81/** 81/**
82 * Return a list of strings of color classes used in the given theme
83 *
84 * @param th The theme to get the reference from (NULL will be default)
85 * @return The list of color classes
86 *
87 * Free the returned list using elm_theme_color_class_list_free() when done.
88 *
89 * @ingroup Elm_Theme
90 * @sizne 1.26
91 */
92EAPI Eina_List *elm_theme_color_class_list(Elm_Theme *th);
93
94/**
95 * Free list of color classes used in the themes
96 *
97 * @param list The list to free
98 *
99 * Free the returned list returned from elm_theme_color_class_list()
100 *
101 * @ingroup Elm_Theme
102 * @sizne 1.26
103 */
104EAPI void elm_theme_color_class_list_free(Eina_List *list);
105
106/**
82 * Create a new specific theme 107 * Create a new specific theme
83 * 108 *
84 * This creates an empty specific theme that only uses the default theme. A 109 * This creates an empty specific theme that only uses the default theme. A
diff --git a/src/lib/emotion/emotion_smart.c b/src/lib/emotion/emotion_smart.c
index e8c22e912c..3dc5dd4270 100644
--- a/src/lib/emotion/emotion_smart.c
+++ b/src/lib/emotion/emotion_smart.c
@@ -242,12 +242,17 @@ emotion_object_add(Evas *evas)
242} 242}
243 243
244EOLIAN static Eo * 244EOLIAN static Eo *
245_efl_canvas_video_efl_object_constructor(Eo *obj, Efl_Canvas_Video_Data *pd EINA_UNUSED) 245_efl_canvas_video_efl_object_constructor(Eo *obj, Efl_Canvas_Video_Data *pd)
246{ 246{
247 efl_canvas_group_clipped_set(obj, EINA_TRUE); 247 efl_canvas_group_clipped_set(obj, EINA_TRUE);
248 obj = efl_constructor(efl_super(obj, MY_CLASS)); 248 obj = efl_constructor(efl_super(obj, MY_CLASS));
249 efl_canvas_object_type_set(obj, E_OBJ_NAME); 249 efl_canvas_object_type_set(obj, E_OBJ_NAME);
250 250
251 eina_stringshare_replace(&(pd->engine), "gstreamer1");
252 pd->spu.button = -1;
253 pd->ratio = 1.0;
254 _engine_init(obj, pd);
255
251 return obj; 256 return obj;
252} 257}
253 258
diff --git a/src/lib/evas/canvas/efl_canvas_image.c b/src/lib/evas/canvas/efl_canvas_image.c
index d78f1f675b..f4a8cb1f22 100644
--- a/src/lib/evas/canvas/efl_canvas_image.c
+++ b/src/lib/evas/canvas/efl_canvas_image.c
@@ -599,8 +599,7 @@ _evas_image_animated_frame_set(Eo *eo_obj, int frame_index)
599 evas_object_async_block(obj); 599 evas_object_async_block(obj);
600 frame_count = evas_object_image_animated_frame_count_get(eo_obj); 600 frame_count = evas_object_image_animated_frame_count_get(eo_obj);
601 601
602 /* limit the size of frame to FRAME_MAX */ 602 if ((frame_count < 0) || (frame_index > frame_count))
603 if ((frame_count > FRAME_MAX) || (frame_count < 0) || (frame_index > frame_count))
604 return EINA_FALSE; 603 return EINA_FALSE;
605 604
606 if (!ENFN->image_animated_frame_set) return EINA_FALSE; 605 if (!ENFN->image_animated_frame_set) return EINA_FALSE;
diff --git a/src/lib/evas/canvas/efl_canvas_proxy.c b/src/lib/evas/canvas/efl_canvas_proxy.c
index d55cbc2c31..cf44e18c81 100644
--- a/src/lib/evas/canvas/efl_canvas_proxy.c
+++ b/src/lib/evas/canvas/efl_canvas_proxy.c
@@ -159,6 +159,26 @@ _efl_canvas_proxy_source_events_get(const Eo *eo_obj, void *_pd EINA_UNUSED)
159 return _evas_image_proxy_source_events_get(eo_obj); 159 return _evas_image_proxy_source_events_get(eo_obj);
160} 160}
161 161
162void
163_evas_image_proxy_source_scale_get(const Eo *eo_obj, double *sw, double *sh)
164{
165 *sw = 1.0;
166 *sh = 1.0;
167 Evas_Object_Protected_Data *source = NULL;
168
169 Evas_Image_Data *o = efl_data_scope_get(eo_obj, EFL_CANVAS_IMAGE_INTERNAL_CLASS);
170 if (!o->cur->source) return;
171
172 Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
173 source = efl_data_scope_get(o->cur->source, EFL_CANVAS_OBJECT_CLASS);
174
175 if (obj->cur->geometry.w > 0)
176 *sw = (double) source->cur->geometry.w / obj->cur->geometry.w;
177
178 if (obj->cur->geometry.h > 0)
179 *sh = (double) source->cur->geometry.h / obj->cur->geometry.h;
180}
181
162Evas_Object * 182Evas_Object *
163_evas_object_image_source_get(Evas_Object *eo_obj) 183_evas_object_image_source_get(Evas_Object *eo_obj)
164{ 184{
diff --git a/src/lib/evas/canvas/evas_image_private.h b/src/lib/evas/canvas/evas_image_private.h
index 693125fb84..f8888d71ad 100644
--- a/src/lib/evas/canvas/evas_image_private.h
+++ b/src/lib/evas/canvas/evas_image_private.h
@@ -254,6 +254,4 @@ void _evas_image_load(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, Evas
254 EINA_COW_IMAGE_STATE_WRITE_END(Obj, cur_write); \ 254 EINA_COW_IMAGE_STATE_WRITE_END(Obj, cur_write); \
255 } 255 }
256 256
257#define FRAME_MAX 1024
258
259#endif // EVAS_IMAGE_PRIVATE_H 257#endif // EVAS_IMAGE_PRIVATE_H
diff --git a/src/lib/evas/canvas/evas_map.c b/src/lib/evas/canvas/evas_map.c
index 4669595c7c..eaafa8ee72 100644
--- a/src/lib/evas/canvas/evas_map.c
+++ b/src/lib/evas/canvas/evas_map.c
@@ -1377,6 +1377,12 @@ evas_object_map_update(Evas_Object *eo_obj,
1377 pts[0].py = obj->map->cur.map->persp.py << FP; 1377 pts[0].py = obj->map->cur.map->persp.py << FP;
1378 pts[0].foc = obj->map->cur.map->persp.foc << FP; 1378 pts[0].foc = obj->map->cur.map->persp.foc << FP;
1379 pts[0].z0 = obj->map->cur.map->persp.z0 << FP; 1379 pts[0].z0 = obj->map->cur.map->persp.z0 << FP;
1380
1381 double uscale = 1.0, vscale = 1.0;
1382 if (obj->is_image_object)
1383 {
1384 _evas_image_proxy_source_scale_get(eo_obj, &uscale, &vscale);
1385 }
1380 // draw geom +x +y 1386 // draw geom +x +y
1381 for (; p < p_end; p++, pt++) 1387 for (; p < p_end; p++, pt++)
1382 { 1388 {
@@ -1387,9 +1393,9 @@ evas_object_map_update(Evas_Object *eo_obj,
1387 pt->fy = p->y + (float) y; 1393 pt->fy = p->y + (float) y;
1388 pt->fz = p->z; 1394 pt->fz = p->z;
1389 if ((uvw == 0) || (imagew == 0)) pt->u = 0; 1395 if ((uvw == 0) || (imagew == 0)) pt->u = 0;
1390 else pt->u = ((lround(p->u) * imagew) / uvw) * FP1; 1396 else pt->u = ((lround(p->u * uscale) * imagew) / uvw) * FP1;
1391 if ((uvh == 0) || (imageh == 0)) pt->v = 0; 1397 if ((uvh == 0) || (imageh == 0)) pt->v = 0;
1392 else pt->v = ((lround(p->v) * imageh) / uvh) * FP1; 1398 else pt->v = ((lround(p->v * vscale) * imageh) / uvh) * FP1;
1393 if (pt->u < 0) pt->u = 0; 1399 if (pt->u < 0) pt->u = 0;
1394 else if (pt->u > (imagew * FP1)) pt->u = (imagew * FP1); 1400 else if (pt->u > (imagew * FP1)) pt->u = (imagew * FP1);
1395 if (pt->v < 0) pt->v = 0; 1401 if (pt->v < 0) pt->v = 0;
diff --git a/src/lib/evas/include/evas_private.h b/src/lib/evas/include/evas_private.h
index 65a22850a6..3af4addc57 100644
--- a/src/lib/evas/include/evas_private.h
+++ b/src/lib/evas/include/evas_private.h
@@ -1196,6 +1196,7 @@ void evas_smart_cb_descriptions_fix(Evas_Smart_Cb_Description_Array *a) EINA_ARG
1196Eina_Bool evas_smart_cb_descriptions_resize(Evas_Smart_Cb_Description_Array *a, unsigned int size) EINA_ARG_NONNULL(1); 1196Eina_Bool evas_smart_cb_descriptions_resize(Evas_Smart_Cb_Description_Array *a, unsigned int size) EINA_ARG_NONNULL(1);
1197const Evas_Smart_Cb_Description *evas_smart_cb_description_find(const Evas_Smart_Cb_Description_Array *a, const char *name) EINA_ARG_NONNULL(1, 2) EINA_PURE; 1197const Evas_Smart_Cb_Description *evas_smart_cb_description_find(const Evas_Smart_Cb_Description_Array *a, const char *name) EINA_ARG_NONNULL(1, 2) EINA_PURE;
1198 1198
1199void _evas_image_proxy_source_scale_get(const Eo *eo_obj, double *sw, double *sh);
1199Evas_Object *_evas_object_image_source_get(Evas_Object *obj); 1200Evas_Object *_evas_object_image_source_get(Evas_Object *obj);
1200Eina_Bool _evas_object_image_preloading_get(const Evas_Object *obj); 1201Eina_Bool _evas_object_image_preloading_get(const Evas_Object *obj);
1201Evas_Object *_evas_object_image_video_parent_get(Evas_Object *obj); 1202Evas_Object *_evas_object_image_video_parent_get(Evas_Object *obj);
diff --git a/src/lib/evil/evil_stdio.h b/src/lib/evil/evil_stdio.h
index 4a2ed57fd3..f948c674a6 100644
--- a/src/lib/evil/evil_stdio.h
+++ b/src/lib/evil/evil_stdio.h
@@ -12,21 +12,6 @@
12 * @{ 12 * @{
13 */ 13 */
14 14
15#define EVIL_PATH_SEP_SWAP(p, s1, s2) \
16 do { \
17 char *_evil_path_tmp; \
18 _evil_path_tmp = p; \
19 while (*_evil_path_tmp) \
20 { \
21 if (*_evil_path_tmp == s1) \
22 *_evil_path_tmp = s2; \
23 _evil_path_tmp++; \
24 } \
25 } while (0)
26
27#define EVIL_PATH_SEP_WIN32_TO_UNIX(p) EVIL_PATH_SEP_SWAP(p, '\\', '/')
28#define EVIL_PATH_SEP_UNIX_TO_WIN32(p) EVIL_PATH_SEP_SWAP(p, '/', '\\')
29
30 15
31/** 16/**
32 * @brief Emulate the rename() function on Windows. 17 * @brief Emulate the rename() function on Windows.
diff --git a/src/modules/ecore_evas/engines/x/ecore_evas_x.c b/src/modules/ecore_evas/engines/x/ecore_evas_x.c
index d3382686e3..6b70c65d3e 100644
--- a/src/modules/ecore_evas/engines/x/ecore_evas_x.c
+++ b/src/modules/ecore_evas/engines/x/ecore_evas_x.c
@@ -4921,7 +4921,6 @@ ecore_evas_software_x11_new_internal(const char *disp_name, Ecore_X_Window paren
4921 redraw_debug = 0; 4921 redraw_debug = 0;
4922 } 4922 }
4923 4923
4924 einfo->info.backend = EVAS_ENGINE_INFO_SOFTWARE_X11_BACKEND_XLIB;
4925 einfo->info.connection = ecore_x_display_get(); 4924 einfo->info.connection = ecore_x_display_get();
4926 einfo->info.screen = NULL; 4925 einfo->info.screen = NULL;
4927 einfo->info.drawable = ee->prop.window; 4926 einfo->info.drawable = ee->prop.window;
@@ -5120,7 +5119,6 @@ ecore_evas_software_x11_pixmap_new_internal(const char *disp_name, Ecore_X_Windo
5120 redraw_debug = 0; 5119 redraw_debug = 0;
5121 } 5120 }
5122 5121
5123 einfo->info.backend = EVAS_ENGINE_INFO_SOFTWARE_X11_BACKEND_XLIB;
5124 einfo->info.connection = ecore_x_display_get(); 5122 einfo->info.connection = ecore_x_display_get();
5125 einfo->info.screen = NULL; 5123 einfo->info.screen = NULL;
5126 5124
diff --git a/src/modules/emotion/gstreamer1/emotion_gstreamer.c b/src/modules/emotion/gstreamer1/emotion_gstreamer.c
index 2def4d70d3..b96478d02e 100644
--- a/src/modules/emotion/gstreamer1/emotion_gstreamer.c
+++ b/src/modules/emotion/gstreamer1/emotion_gstreamer.c
@@ -922,15 +922,13 @@ em_spu_channel_mute_set(void *video, int mute)
922 Emotion_Gstreamer *ev = video; 922 Emotion_Gstreamer *ev = video;
923 gint flags; 923 gint flags;
924 924
925 ev->spu_mute = !!mute;
926
925 if (!ev->pipeline) return; 927 if (!ev->pipeline) return;
926 928
927 g_object_get(ev->pipeline, "flags", &flags, NULL); 929 g_object_get(ev->pipeline, "flags", &flags, NULL);
928 930 if (ev->spu_mute) flags &= ~GST_PLAY_FLAG_TEXT;
929 if (mute) 931 else flags |= GST_PLAY_FLAG_TEXT;
930 flags &= ~GST_PLAY_FLAG_TEXT;
931 else
932 flags |= GST_PLAY_FLAG_TEXT;
933
934 g_object_set(ev->pipeline, "flags", flags, NULL); 932 g_object_set(ev->pipeline, "flags", flags, NULL);
935} 933}
936 934
@@ -1113,10 +1111,11 @@ em_add(const Emotion_Engine *api,
1113 1111
1114 /* Default values */ 1112 /* Default values */
1115 ev->vis = EMOTION_VIS_NONE; 1113 ev->vis = EMOTION_VIS_NONE;
1116 ev->volume = 0.8; 1114 ev->volume = 1.0;
1117 ev->ready = EINA_FALSE; 1115 ev->ready = EINA_FALSE;
1118 ev->shutdown = EINA_FALSE; 1116 ev->shutdown = EINA_FALSE;
1119 ev->threads = NULL; 1117 ev->threads = NULL;
1118 ev->spu_mute = EINA_TRUE;
1120 1119
1121 return ev; 1120 return ev;
1122} 1121}
@@ -1772,8 +1771,9 @@ _create_pipeline(Emotion_Gstreamer *ev,
1772 g_object_set(G_OBJECT(vsink), "emotion-object", o, NULL); 1771 g_object_set(G_OBJECT(vsink), "emotion-object", o, NULL);
1773 1772
1774 g_object_get(G_OBJECT(playbin), "flags", &flags, NULL); 1773 g_object_get(G_OBJECT(playbin), "flags", &flags, NULL);
1775 g_object_set(G_OBJECT(playbin), "flags", 1774 if (ev->spu_mute) flags &= ~GST_PLAY_FLAG_TEXT;
1776 (flags | GST_PLAY_FLAG_DOWNLOAD) & ~GST_PLAY_FLAG_TEXT, NULL); 1775 else flags |= GST_PLAY_FLAG_TEXT;
1776 g_object_set(G_OBJECT(playbin), "flags", (flags | GST_PLAY_FLAG_DOWNLOAD), NULL);
1777 g_object_set(G_OBJECT(playbin), "video-sink", vsink, NULL); 1777 g_object_set(G_OBJECT(playbin), "video-sink", vsink, NULL);
1778 g_object_set(G_OBJECT(playbin), "uri", uri, NULL); 1778 g_object_set(G_OBJECT(playbin), "uri", uri, NULL);
1779 if (suburi) 1779 if (suburi)
diff --git a/src/modules/emotion/gstreamer1/emotion_gstreamer.h b/src/modules/emotion/gstreamer1/emotion_gstreamer.h
index 2469ef28d4..fd5e24fde7 100644
--- a/src/modules/emotion/gstreamer1/emotion_gstreamer.h
+++ b/src/modules/emotion/gstreamer1/emotion_gstreamer.h
@@ -87,6 +87,7 @@ struct _Emotion_Gstreamer
87 Eina_Bool play : 1; 87 Eina_Bool play : 1;
88 Eina_Bool video_mute : 1; 88 Eina_Bool video_mute : 1;
89 Eina_Bool audio_mute : 1; 89 Eina_Bool audio_mute : 1;
90 Eina_Bool spu_mute : 1;
90 Eina_Bool ready : 1; 91 Eina_Bool ready : 1;
91 Eina_Bool live : 1; 92 Eina_Bool live : 1;
92 Eina_Bool buffering : 1; 93 Eina_Bool buffering : 1;
diff --git a/src/modules/evas/engines/gl_common/evas_gl_image.c b/src/modules/evas/engines/gl_common/evas_gl_image.c
index 78a3fe09b1..f52691f6c5 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_image.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_image.c
@@ -293,26 +293,6 @@ evas_gl_common_image_load(Evas_Engine_GL_Context *gc, const char *file, const ch
293{ 293{
294 RGBA_Image *im_im; 294 RGBA_Image *im_im;
295 295
296#ifdef EVAS_CSERVE2
297 if (evas_cserve2_use_get())
298 {
299 im_im = (RGBA_Image *) evas_cache2_image_open
300 (evas_common_image_cache2_get(), file, key, lo, error);
301 if (im_im)
302 {
303 *error = evas_cache2_image_open_wait(&im_im->cache_entry);
304 if ((*error != EVAS_LOAD_ERROR_NONE)
305 && im_im->cache_entry.animated.animated)
306 {
307 evas_cache2_image_close(&im_im->cache_entry);
308 im_im = NULL;
309 }
310 else
311 return evas_gl_common_image_new_from_rgbaimage(gc, im_im, lo, error);
312 }
313 }
314#endif
315
316 im_im = evas_common_load_image_from_file(file, key, lo, error); 296 im_im = evas_common_load_image_from_file(file, key, lo, error);
317 if (!im_im) return NULL; 297 if (!im_im) return NULL;
318 298
diff --git a/src/modules/evas/engines/software_generic/evas_engine.c b/src/modules/evas/engines/software_generic/evas_engine.c
index 78d8172b93..4d5e104769 100644
--- a/src/modules/evas/engines/software_generic/evas_engine.c
+++ b/src/modules/evas/engines/software_generic/evas_engine.c
@@ -1208,25 +1208,6 @@ static void *
1208eng_image_load(void *data EINA_UNUSED, const char *file, const char *key, int *error, Evas_Image_Load_Opts *lo) 1208eng_image_load(void *data EINA_UNUSED, const char *file, const char *key, int *error, Evas_Image_Load_Opts *lo)
1209{ 1209{
1210 *error = EVAS_LOAD_ERROR_NONE; 1210 *error = EVAS_LOAD_ERROR_NONE;
1211#ifdef EVAS_CSERVE2
1212 if (evas_cserve2_use_get())
1213 {
1214 Image_Entry *ie;
1215 ie = evas_cache2_image_open(evas_common_image_cache2_get(),
1216 file, key, lo, error);
1217 if (ie)
1218 {
1219 *error = evas_cache2_image_open_wait(ie);
1220 if ((*error != EVAS_LOAD_ERROR_NONE) && ie->animated.animated)
1221 {
1222 evas_cache2_image_close(ie);
1223 goto use_local_cache;
1224 }
1225 }
1226 return ie;
1227 }
1228use_local_cache:
1229#endif
1230 1211
1231 return evas_common_load_image_from_file(file, key, lo, error); 1212 return evas_common_load_image_from_file(file, key, lo, error);
1232} 1213}
diff --git a/src/modules/evas/engines/software_x11/Evas_Engine_Software_X11.h b/src/modules/evas/engines/software_x11/Evas_Engine_Software_X11.h
index dab373cd35..5ab24459e5 100644
--- a/src/modules/evas/engines/software_x11/Evas_Engine_Software_X11.h
+++ b/src/modules/evas/engines/software_x11/Evas_Engine_Software_X11.h
@@ -1,11 +1,6 @@
1#ifndef _EVAS_ENGINE_SOFTWARE_X11_H 1#ifndef _EVAS_ENGINE_SOFTWARE_X11_H
2# define _EVAS_ENGINE_SOFTWARE_X11_H 2# define _EVAS_ENGINE_SOFTWARE_X11_H
3 3
4typedef enum
5{
6 EVAS_ENGINE_INFO_SOFTWARE_X11_BACKEND_XLIB
7} Evas_Engine_Info_Software_X11_Backend;
8
9typedef struct _Evas_Engine_Info_Software_X11 Evas_Engine_Info_Software_X11; 4typedef struct _Evas_Engine_Info_Software_X11 Evas_Engine_Info_Software_X11;
10 5
11struct _Evas_Engine_Info_Software_X11 6struct _Evas_Engine_Info_Software_X11
@@ -17,8 +12,6 @@ struct _Evas_Engine_Info_Software_X11
17 /* engine specific data & parameters it needs to set up */ 12 /* engine specific data & parameters it needs to set up */
18 struct 13 struct
19 { 14 {
20 Evas_Engine_Info_Software_X11_Backend backend;
21
22 void *connection, *screen; 15 void *connection, *screen;
23 unsigned int drawable, mask; 16 unsigned int drawable, mask;
24 void *visual; 17 void *visual;
@@ -37,9 +30,9 @@ struct _Evas_Engine_Info_Software_X11
37 /* engine specific function calls to query stuff about the destination */ 30 /* engine specific function calls to query stuff about the destination */
38 struct 31 struct
39 { 32 {
40 void *(*best_visual_get) (int backend, void *connection, int screen); 33 void *(*best_visual_get) (void *connection, int screen);
41 unsigned int (*best_colormap_get) (int backend, void *connection, int screen); 34 unsigned int (*best_colormap_get) (void *connection, int screen);
42 int (*best_depth_get) (int backend, void *connection, int screen); 35 int (*best_depth_get) (void *connection, int screen);
43 } func; 36 } func;
44 37
45 unsigned char mask_changed : 1; 38 unsigned char mask_changed : 1;
diff --git a/src/modules/evas/engines/software_x11/evas_engine.c b/src/modules/evas/engines/software_x11/evas_engine.c
index 211cd84fdd..54bda1385e 100644
--- a/src/modules/evas/engines/software_x11/evas_engine.c
+++ b/src/modules/evas/engines/software_x11/evas_engine.c
@@ -10,7 +10,6 @@
10#include "evas_xlib_color.h" 10#include "evas_xlib_color.h"
11#include "evas_xlib_image.h" 11#include "evas_xlib_image.h"
12#include "evas_xlib_dri_image.h" 12#include "evas_xlib_dri_image.h"
13#include "evas_x_egl.h"
14 13
15#include "../software_generic/evas_native_common.h" 14#include "../software_generic/evas_native_common.h"
16 15
@@ -45,21 +44,13 @@ struct _Render_Engine
45}; 44};
46 45
47/* prototypes we will use here */ 46/* prototypes we will use here */
48static void *_best_visual_get(int backend, void *connection, int screen); 47static void *_best_visual_get(void *connection, int screen);
49static unsigned int _best_colormap_get(int backend, void *connection, int screen); 48static unsigned int _best_colormap_get(void *connection, int screen);
50static int _best_depth_get(int backend, void *connection, int screen); 49static int _best_depth_get(void *connection, int screen);
51 50
52static Eina_List *_outbufs = NULL; 51static Eina_List *_outbufs = NULL;
53 52
54/* internal engine routines */ 53/* internal engine routines */
55static void
56_output_egl_shutdown(Render_Engine *re)
57{
58 if (!re->egl.disp) return;
59 _egl_x_win_surf_free(re->egl.disp, re->egl.surface);
60 _egl_x_disp_terminate(re->egl.disp);
61}
62
63static void * 54static void *
64_output_xlib_setup(void *engine, int w, int h, int rot, Display *disp, Drawable draw, 55_output_xlib_setup(void *engine, int w, int h, int rot, Display *disp, Drawable draw,
65 Visual *vis, Colormap cmap, int depth, int debug, 56 Visual *vis, Colormap cmap, int depth, int debug,
@@ -165,34 +156,27 @@ on_error:
165} 156}
166 157
167static void * 158static void *
168_best_visual_get(int backend, void *connection, int screen) 159_best_visual_get(void *connection, int screen)
169{ 160{
170 if (!connection) return NULL; 161 if (!connection) return NULL;
171 162
172 if (backend == EVAS_ENGINE_INFO_SOFTWARE_X11_BACKEND_XLIB) 163 return DefaultVisual((Display *)connection, screen);
173 return DefaultVisual((Display *)connection, screen);
174
175 return NULL;
176} 164}
177 165
178static unsigned int 166static unsigned int
179_best_colormap_get(int backend, void *connection, int screen) 167_best_colormap_get(void *connection, int screen)
180{ 168{
181 if (!connection) return 0; 169 if (!connection) return 0;
182 170
183 if (backend == EVAS_ENGINE_INFO_SOFTWARE_X11_BACKEND_XLIB) 171 return DefaultColormap((Display *)connection, screen);
184 return DefaultColormap((Display *)connection, screen);
185 return 0;
186} 172}
187 173
188static int 174static int
189_best_depth_get(int backend, void *connection, int screen) 175_best_depth_get(void *connection, int screen)
190{ 176{
191 if (!connection) return 0; 177 if (!connection) return 0;
192 178
193 if (backend == EVAS_ENGINE_INFO_SOFTWARE_X11_BACKEND_XLIB) 179 return DefaultDepth((Display *)connection, screen);
194 return DefaultDepth((Display *)connection, screen);
195 return 0;
196} 180}
197 181
198static void 182static void
@@ -235,9 +219,6 @@ eng_output_setup(void *engine, void *in, unsigned int w, unsigned int h)
235 static int try_swapbuf = -1; 219 static int try_swapbuf = -1;
236 char *s; 220 char *s;
237 221
238 if (info->info.backend != EVAS_ENGINE_INFO_SOFTWARE_X11_BACKEND_XLIB)
239 return NULL;
240
241 if (try_swapbuf == -1) 222 if (try_swapbuf == -1)
242 { 223 {
243 if ((s = getenv("EVAS_NO_DRI_SWAPBUF")) != NULL) 224 if ((s = getenv("EVAS_NO_DRI_SWAPBUF")) != NULL)
@@ -285,9 +266,6 @@ eng_output_update(void *engine EINA_UNUSED, void *data, void *in, unsigned int w
285 Render_Engine *re = data; 266 Render_Engine *re = data;
286 Outbuf *ob = NULL; 267 Outbuf *ob = NULL;
287 268
288 if (info->info.backend != EVAS_ENGINE_INFO_SOFTWARE_X11_BACKEND_XLIB)
289 return 0;
290
291 _outbufs = eina_list_remove(_outbufs, re->generic.ob); 269 _outbufs = eina_list_remove(_outbufs, re->generic.ob);
292 270
293 if (re->generic.outbuf_free == evas_software_xlib_swapbuf_free) 271 if (re->generic.outbuf_free == evas_software_xlib_swapbuf_free)
@@ -346,7 +324,6 @@ eng_output_free(void *engine, void *data)
346 { 324 {
347 _outbufs = eina_list_remove(_outbufs, re->generic.ob); 325 _outbufs = eina_list_remove(_outbufs, re->generic.ob);
348 evas_render_engine_software_generic_clean(engine, &re->generic); 326 evas_render_engine_software_generic_clean(engine, &re->generic);
349 _output_egl_shutdown(re);
350 free(re); 327 free(re);
351 } 328 }
352} 329}
diff --git a/src/modules/evas/engines/software_x11/evas_x_egl.c b/src/modules/evas/engines/software_x11/evas_x_egl.c
deleted file mode 100644
index 3fc3b25f7c..0000000000
--- a/src/modules/evas/engines/software_x11/evas_x_egl.c
+++ /dev/null
@@ -1,315 +0,0 @@
1#ifdef HAVE_CONFIG_H
2# include <config.h>
3#endif
4
5#include "evas_common_private.h"
6#include "evas_macros.h"
7
8#ifdef HAVE_DLSYM
9# include <dlfcn.h> /* dlopen,dlclose,etc */
10#else
11# undef BUILD_ENGINE_SOFTWARE_XLIB
12#endif
13
14#ifdef BUILD_ENGINE_SOFTWARE_XLIB
15#include "evas_x_egl.h"
16
17#define EGL_SURFACE_TYPE 0x3033
18#define EGL_WINDOW_BIT 0x0004
19#define EGL_RENDERABLE_TYPE 0x3040
20#define EGL_ALPHA_SIZE 0x3021
21#define EGL_BLUE_SIZE 0x3022
22#define EGL_GREEN_SIZE 0x3023
23#define EGL_RED_SIZE 0x3024
24#define EGL_DEPTH_SIZE 0x3025
25#define EGL_STENCIL_SIZE 0x3026
26#define EGL_SURFACE_TYPE 0x3033
27#define EGL_NONE 0x3038
28#define EGL_FALSE 0
29#define EGL_TRUE 1
30
31#define EGL_LOCK_SURFACE_BIT_KHR 0x0080
32#define EGL_OPTIMAL_FORMAT_BIT_KHR 0x0100
33#define EGL_MATCH_FORMAT_KHR 0x3043
34#define EGL_FORMAT_RGB_565_EXACT_KHR 0x30C0
35#define EGL_FORMAT_RGB_565_KHR 0x30C1
36#define EGL_FORMAT_RGBA_8888_EXACT_KHR 0x30C2
37#define EGL_FORMAT_RGBA_8888_KHR 0x30C3
38#define EGL_MAP_PRESERVE_PIXELS_KHR 0x30C4
39#define EGL_LOCK_USAGE_HINT_KHR 0x30C5
40#define EGL_READ_SURFACE_BIT_KHR 0x0001
41#define EGL_WRITE_SURFACE_BIT_KHR 0x0002
42#define EGL_BITMAP_POINTER_KHR 0x30C6
43#define EGL_BITMAP_PITCH_KHR 0x30C7
44#define EGL_BITMAP_ORIGIN_KHR 0x30C8
45#define EGL_BITMAP_PIXEL_RED_OFFSET_KHR 0x30C9
46#define EGL_BITMAP_PIXEL_GREEN_OFFSET_KHR 0x30CA
47#define EGL_BITMAP_PIXEL_BLUE_OFFSET_KHR 0x30CB
48#define EGL_BITMAP_PIXEL_ALPHA_OFFSET_KHR 0x30CC
49#define EGL_BITMAP_PIXEL_LUMINANCE_OFFSET_KHR 0x30CD
50#define EGL_LOWER_LEFT_KHR 0x30CE
51#define EGL_UPPER_LEFT_KHR 0x30CF
52
53static int egl_found = -1;
54static void *egl_lib = NULL;
55
56static struct
57{
58 void * (*GetProcAddress)(const char *name);
59 void * (*GetDisplay)(void *d);
60 unsigned int (*Initialize)(void *ed, int *vmaj, int *vmin);
61 unsigned int (*Terminate)(void *ed);
62 const char * (*QueryString)(void *ed, int name);
63 unsigned int (*ChooseConfig)(void *ed, int *attr, void **configs, int config_size, int *num_config);
64 unsigned int (*GetConfigAttrib)(void *ed, void *config, int attr, int *val);
65 unsigned int (*QuerySurface)(void *ed, void *surf, int attr, int *val);
66 void * (*CreateWindowSurface)(void *ed, void *config, Window win, int *attr);
67 unsigned int (*DestroySurface)(void *ed, void *surf);
68 unsigned int (*SwapBuffers)(void *ed, void *surf);
69 unsigned int (*SwapInterval)(void *ed, int interval);
70
71 unsigned int (*LockSurface)(void *ed, void *surf, int *attr);
72 unsigned int (*UnlockSurface)(void *ed, void *surf);
73} egl;
74
75static int
76_egl_find(void)
77{
78 if (egl_found == 0) return 0;
79 if (!egl_lib) egl_lib = dlopen("libEGL.so.1", RTLD_NOW | RTLD_LOCAL);
80 if (!egl_lib)
81 {
82 egl_found = 0;
83 return 0;
84 }
85 if (!(egl.GetProcAddress = dlsym(egl_lib, "eglGetProcAddress"))) goto err;
86
87#define SYM(x, y) if (!(egl.x = egl.GetProcAddress(y))) \
88 goto err
89// core syms used
90 SYM(GetDisplay, "eglGetDisplay");
91 SYM(Initialize, "eglInitialize");
92 SYM(Terminate, "eglTerminate");
93 SYM(QueryString, "eglQueryString");
94 SYM(ChooseConfig, "eglChooseConfig");
95 SYM(UnlockSurface, "eglGetConfigAttrib");
96 SYM(QuerySurface, "eglQuerySurface");
97 SYM(CreateWindowSurface, "eglCreateWindowSurface");
98 SYM(DestroySurface, "eglDestroySurface");
99 SYM(SwapBuffers, "eglSwapBuffers");
100 SYM(SwapInterval, "eglSwapInterval");
101
102#undef SYM
103#define SYM(x, y) egl.x = egl.GetProcAddress(y)
104// extns
105 SYM(LockSurface, "eglLockSurface");
106 if (!egl.LockSurface) SYM(LockSurface, "eglLockSurfaceKHR");
107 SYM(UnlockSurface, "eglUnlockSurface");
108 if (!egl.UnlockSurface) SYM(UnlockSurface, "eglUnlockSurfaceKHR");
109
110 if (!egl.LockSurface) goto err;
111 if (!egl.UnlockSurface) goto err;
112
113 egl_found = 1;
114 return 1;
115err:
116 if (egl_lib) dlclose(egl_lib);
117 egl_lib = NULL;
118 return 0;
119}
120
121#endif
122
123void *
124_egl_x_disp_get(void *d)
125{
126#ifdef BUILD_ENGINE_SOFTWARE_XLIB
127 if (!_egl_find()) return NULL;
128 return egl.GetDisplay(d);
129#else
130 return NULL;
131 (void)d;
132#endif
133}
134
135void
136_egl_x_disp_terminate(void *ed)
137{
138#ifdef BUILD_ENGINE_SOFTWARE_XLIB
139 if (!_egl_find()) return;
140 egl.Terminate(ed);
141#else
142 (void)ed;
143#endif
144}
145
146int
147_egl_x_disp_init(void *ed)
148{
149#ifdef BUILD_ENGINE_SOFTWARE_XLIB
150 int vmaj = 0, vmin = 0;
151 if (!_egl_find()) return 0;
152 if (!egl.Initialize(ed, &vmaj, &vmin)) return 0;
153 return 1;
154#else
155 return 0;
156 (void)ed;
157#endif
158}
159
160void *
161_egl_x_disp_choose_config(void *ed)
162{
163#ifdef BUILD_ENGINE_SOFTWARE_XLIB
164 int config_attrs[40], n = 0, num_config = 0;
165 void *eglconfig = NULL;
166
167 if (!_egl_find()) return NULL;
168 config_attrs[n++] = EGL_SURFACE_TYPE;
169 config_attrs[n++] = EGL_WINDOW_BIT;
170 config_attrs[n++] = EGL_RED_SIZE;
171 config_attrs[n++] = 8;
172 config_attrs[n++] = EGL_GREEN_SIZE;
173 config_attrs[n++] = 8;
174 config_attrs[n++] = EGL_BLUE_SIZE;
175 config_attrs[n++] = 8;
176 config_attrs[n++] = EGL_ALPHA_SIZE;
177 config_attrs[n++] = 8;
178 config_attrs[n++] = EGL_DEPTH_SIZE;
179 config_attrs[n++] = 0;
180 config_attrs[n++] = EGL_STENCIL_SIZE;
181 config_attrs[n++] = 0;
182 config_attrs[n++] = EGL_SURFACE_TYPE;
183 config_attrs[n++] = EGL_LOCK_SURFACE_BIT_KHR;
184 config_attrs[n++] = EGL_MATCH_FORMAT_KHR;
185 config_attrs[n++] = EGL_FORMAT_RGBA_8888_KHR;
186
187 config_attrs[n++] = EGL_NONE;
188
189 if (!egl.ChooseConfig(ed, config_attrs, &eglconfig, 1, &num_config))
190 return NULL;
191 return eglconfig;
192#else
193 return NULL;
194 (void)ed;
195#endif
196}
197
198#ifdef BUILD_ENGINE_SOFTWARE_XLIB
199void *
200_egl_x_win_surf_new(void *ed, Window win, void *config)
201{
202 if (!_egl_find()) return NULL;
203 return egl.CreateWindowSurface(ed, config, win, NULL);
204}
205
206#endif
207
208void
209_egl_x_win_surf_free(void *ed, void *surf)
210{
211#ifdef BUILD_ENGINE_SOFTWARE_XLIB
212 if (!_egl_find()) return;
213 egl.DestroySurface(ed, surf);
214#else
215 (void)ed;
216 (void)surf;
217#endif
218}
219
220void *
221_egl_x_surf_map(void *ed, void *surf, int *stride)
222{
223#ifdef BUILD_ENGINE_SOFTWARE_XLIB
224 int config_attrs[40], n = 0;
225 void *ptr = NULL;
226 int pitch = 0, origin = 0;
227 int r_offset = 0, g_offset = 0, b_offset = 0;
228
229 if (!_egl_find()) return NULL;
230
231 config_attrs[n++] = EGL_MAP_PRESERVE_PIXELS_KHR;
232 config_attrs[n++] = EGL_TRUE;
233 config_attrs[n++] = EGL_LOCK_USAGE_HINT_KHR;
234 config_attrs[n++] = EGL_READ_SURFACE_BIT_KHR | EGL_WRITE_SURFACE_BIT_KHR;
235 config_attrs[n++] = EGL_NONE;
236
237 if (!egl.LockSurface(ed, surf, config_attrs)) return NULL;
238 if (!egl.QuerySurface(ed, surf, EGL_BITMAP_POINTER_KHR, (int *)&ptr)) goto err;
239 if (!egl.QuerySurface(ed, surf, EGL_BITMAP_PITCH_KHR, &pitch)) goto err;
240 if (!egl.QuerySurface(ed, surf, EGL_BITMAP_ORIGIN_KHR, &origin)) goto err;
241 if (!egl.QuerySurface(ed, surf, EGL_BITMAP_PIXEL_RED_OFFSET_KHR, &r_offset)) goto err;
242 if (!egl.QuerySurface(ed, surf, EGL_BITMAP_PIXEL_GREEN_OFFSET_KHR, &g_offset)) goto err;
243 if (!egl.QuerySurface(ed, surf, EGL_BITMAP_PIXEL_BLUE_OFFSET_KHR, &b_offset)) goto err;
244
245 if (!ptr) goto err;
246 if (pitch <= 0) goto err;
247 // must be top-left to bottom-right ordered
248 if (origin != EGL_UPPER_LEFT_KHR) goto err;
249 // must be xRGB
250 if (!((b_offset == 0) && (g_offset == 8) && (r_offset == 16))) goto err;
251 // return stride
252 *stride = pitch; // pitch is in bytes
253 return ptr;
254err:
255 egl.UnlockSurface(ed, surf);
256 return NULL;
257#else
258 return NULL;
259 (void)ed;
260 (void)surf;
261 (void)stride;
262#endif
263}
264
265void
266_egl_x_surf_unmap(void *ed, void *surf)
267{
268#ifdef BUILD_ENGINE_SOFTWARE_XLIB
269 egl.UnlockSurface(ed, surf);
270#else
271 (void)ed;
272 (void)surf;
273#endif
274}
275
276void
277_egl_x_surf_swap(void *ed, void *surf, int vsync)
278{
279#ifdef BUILD_ENGINE_SOFTWARE_XLIB
280 if (vsync) egl.SwapInterval(ed, 1);
281 else egl.SwapInterval(ed, 0);
282 egl.SwapBuffers(ed, surf);
283#else
284 (void)ed;
285 (void)surf;
286 (void)vsync;
287#endif
288}
289
290#ifdef BUILD_ENGINE_SOFTWARE_XLIB
291Outbuf *
292evas_software_egl_outbuf_setup_x(int w, int h, int rot, Outbuf_Depth depth,
293 Display *disp, Drawable draw, Visual *vis,
294 Colormap cmap, int x_depth,
295 int grayscale, int max_colors, Pixmap mask,
296 int shape_dither, int destination_alpha)
297{
298 (void)w;
299 (void)h;
300 (void)rot;
301 (void)depth;
302 (void)draw;
303 (void)cmap;
304 (void)x_depth;
305 (void)grayscale;
306 (void)max_colors;
307 (void)mask;
308 (void)shape_dither;
309 (void)destination_alpha;
310 (void)disp;
311 (void)vis;
312 return NULL;
313}
314
315#endif
diff --git a/src/modules/evas/engines/software_x11/evas_x_egl.h b/src/modules/evas/engines/software_x11/evas_x_egl.h
deleted file mode 100644
index 3807b03762..0000000000
--- a/src/modules/evas/engines/software_x11/evas_x_egl.h
+++ /dev/null
@@ -1,23 +0,0 @@
1#ifndef EVAS_X_EGL_H
2#define EVAS_X_EGL_H
3
4#include "evas_engine.h"
5
6void *_egl_x_disp_get(void *d);
7void _egl_x_disp_terminate(void *ed);
8int _egl_x_disp_init(void *ed);
9void *_egl_x_disp_choose_config(void *ed);
10void *_egl_x_win_surf_new(void *ed, Window win, void *config);
11void _egl_x_win_surf_free(void *ed, void *surf);
12void *_egl_x_surf_map(void *ed, void *surf, int *stride);
13void _egl_x_surf_unmap(void *ed, void *surf);
14void _egl_x_surf_swap(void *ed, void *surf, int vsync);
15
16Outbuf *
17evas_software_egl_outbuf_setup_x(int w, int h, int rot, Outbuf_Depth depth,
18 Display *disp, Drawable draw, Visual *vis,
19 Colormap cmap, int x_depth,
20 int grayscale, int max_colors, Pixmap mask,
21 int shape_dither, int destination_alpha);
22
23#endif
diff --git a/src/modules/evas/engines/software_x11/meson.build b/src/modules/evas/engines/software_x11/meson.build
index ed0a3e4b46..4c498f7adc 100644
--- a/src/modules/evas/engines/software_x11/meson.build
+++ b/src/modules/evas/engines/software_x11/meson.build
@@ -1,8 +1,6 @@
1engine_src = files([ 1engine_src = files([
2 'evas_engine.c', 2 'evas_engine.c',
3 'evas_engine.h', 3 'evas_engine.h',
4 'evas_x_egl.c',
5 'evas_x_egl.h',
6 'Evas_Engine_Software_X11.h', 4 'Evas_Engine_Software_X11.h',
7 'evas_xlib_swapbuf.c', 5 'evas_xlib_swapbuf.c',
8 'evas_xlib_outbuf.c', 6 'evas_xlib_outbuf.c',
@@ -21,12 +19,9 @@ engine_src = files([
21 'evas_xlib_dri_image.h' 19 'evas_xlib_dri_image.h'
22]) 20])
23 21
24#xcb is DEAD ... we only use xlib
25config_h.set('BUILD_ENGINE_SOFTWARE_XLIB', '1')
26
27#ecore_x_deps carries all the extensions etc. so we dont have to search them twice 22#ecore_x_deps carries all the extensions etc. so we dont have to search them twice
28#it looks weird but is right, gl_deps is needed for evas_x_egl.c 23#it looks weird but is right, gl_deps is needed for evas_x_egl.c
29engine_deps += [x11, ecore_x, ecore_x_ext_deps, gl_deps] 24engine_deps += [x11, ecore_x, ecore_x_ext_deps]
30 25
31shared_module(mod_full_name, engine_src, 26shared_module(mod_full_name, engine_src,
32 include_directories : config_dir + [engine_include_dir], 27 include_directories : config_dir + [engine_include_dir],
diff --git a/src/tests/eina/eina_test_simple_xml_parser.c b/src/tests/eina/eina_test_simple_xml_parser.c
index 34c8d69002..5f41d2b038 100644
--- a/src/tests/eina/eina_test_simple_xml_parser.c
+++ b/src/tests/eina/eina_test_simple_xml_parser.c
@@ -237,7 +237,7 @@ EFL_START_TEST(eina_simple_xml_parser_parse_with_custom_callback)
237 237
238 if (buf) 238 if (buf)
239 { 239 {
240 if (fread(buf, 1, sz, f)) 240 if (fread(buf, 1, sz, f) > 0)
241 { 241 {
242 int parse_current_state = simple_xml_parser_current_state_begin; 242 int parse_current_state = simple_xml_parser_current_state_begin;
243 eina_simple_xml_parse(buf, 243 eina_simple_xml_parse(buf,
diff --git a/src/tests/evas/evas_suite.c b/src/tests/evas/evas_suite.c
index 523c10dc76..dedf6841db 100644
--- a/src/tests/evas/evas_suite.c
+++ b/src/tests/evas/evas_suite.c
@@ -25,6 +25,7 @@ static const Efl_Test_Case etc[] = {
25 { "Object Smart", evas_test_object_smart }, 25 { "Object Smart", evas_test_object_smart },
26 { "Events", evas_test_events }, 26 { "Events", evas_test_events },
27 { "Efl Canvas Animation", efl_test_canvas_animation }, 27 { "Efl Canvas Animation", efl_test_canvas_animation },
28 { "Map", evas_test_map },
28 { NULL, NULL } 29 { NULL, NULL }
29}; 30};
30 31
diff --git a/src/tests/evas/evas_suite.h b/src/tests/evas/evas_suite.h
index ec106315b5..af5decaf51 100644
--- a/src/tests/evas/evas_suite.h
+++ b/src/tests/evas/evas_suite.h
@@ -19,5 +19,6 @@ void evas_test_evasgl(TCase *tc);
19void evas_test_object_smart(TCase *tc); 19void evas_test_object_smart(TCase *tc);
20void evas_test_events(TCase *tc); 20void evas_test_events(TCase *tc);
21void efl_test_canvas_animation(TCase *tc); 21void efl_test_canvas_animation(TCase *tc);
22void evas_test_map(TCase *tc);
22 23
23#endif /* _EVAS_SUITE_H */ 24#endif /* _EVAS_SUITE_H */
diff --git a/src/tests/evas/evas_test_map.c b/src/tests/evas/evas_test_map.c
new file mode 100644
index 0000000000..9e1b9ddc78
--- /dev/null
+++ b/src/tests/evas/evas_test_map.c
@@ -0,0 +1,128 @@
1#ifdef HAVE_CONFIG_H
2# include "config.h"
3#endif
4
5#include <stdio.h>
6#include <sys/types.h>
7#include <sys/stat.h>
8#include <unistd.h>
9
10#include <Evas.h>
11#include <Ecore_Evas.h>
12#include <Ecore.h>
13
14#include "evas_suite.h"
15#include "evas_tests_helpers.h"
16
17EFL_START_TEST(evas_object_map_api)
18{
19 Evas_Coord x, y, z;
20 int r, g, b, a;
21 Evas_Map *map;
22
23 map = evas_map_new(4);
24 ck_assert_int_eq(evas_map_count_get(map), 4);
25
26 evas_map_alpha_set(map, EINA_TRUE);
27 ck_assert(evas_map_alpha_get(map));
28
29 evas_map_alpha_set(map, EINA_FALSE);
30 ck_assert(!evas_map_alpha_get(map));
31
32 evas_map_smooth_set(map, EINA_TRUE);
33 ck_assert(evas_map_smooth_get(map));
34
35 evas_map_smooth_set(map, EINA_FALSE);
36 ck_assert(!evas_map_smooth_get(map));
37
38 evas_map_util_object_move_sync_set(map, EINA_TRUE);
39 ck_assert(evas_map_util_object_move_sync_get(map));
40
41 evas_map_util_object_move_sync_set(map, EINA_FALSE);
42 ck_assert(!evas_map_util_object_move_sync_get(map));
43
44 evas_map_point_coord_set(map, 0, 10, 20, 30);
45 evas_map_point_coord_get(map, 0, &x, &y, &z);
46 ck_assert((x == 10) && (y == 20) && (z == 30));
47
48 evas_map_point_coord_set(map, 1, 40, 50, 60);
49 evas_map_point_coord_get(map, 1, &x, &y, &z);
50 ck_assert((x == 40) && (y == 50) && (z == 60));
51
52 evas_map_point_coord_set(map, 2, 70, 80, 90);
53 evas_map_point_coord_get(map, 2, &x, &y, &z);
54 ck_assert((x == 70) && (y == 80) && (z == 90));
55
56 evas_map_point_coord_set(map, 3, 100, 110, 120);
57 evas_map_point_coord_get(map, 3, &x, &y, &z);
58 ck_assert((x == 100) && (y == 110) && (z == 120));
59
60 evas_map_point_color_set(map, 0, 0, 0, 0, 255);
61 evas_map_point_color_get(map, 0, &r, &g, &b, &a);
62 ck_assert((r == 0) && (g == 0) && (b == 0) && (a == 255));
63
64 evas_map_point_color_set(map, 1, 255, 0, 0, 255);
65 evas_map_point_color_get(map, 1, &r, &g, &b, &a);
66 ck_assert((r == 255) && (g == 0) && (b == 0) && (a == 255));
67
68 evas_map_point_color_set(map, 2, 255, 255, 0, 255);
69 evas_map_point_color_get(map, 2, &r, &g, &b, &a);
70 ck_assert((r == 255) && (g == 255) && (b == 0) && (a == 255));
71
72 evas_map_point_color_set(map, 3, 255, 255, 255, 255);
73 evas_map_point_color_get(map, 3, &r, &g, &b, &a);
74 ck_assert((r == 255) && (g == 255) && (b == 255) && (a == 255));
75
76 evas_map_free(map);
77}
78EFL_END_TEST
79
80EFL_START_TEST(evas_object_map_rect)
81{
82 Evas *e;
83 Evas_Object *rect;
84 Evas_Map *map;
85 Evas_Coord x, y, z;
86 double u, v;
87
88 e = _setup_evas();
89 rect = evas_object_rectangle_add(e);
90 evas_object_resize(rect, 100, 100);
91
92 map = evas_map_new(4);
93 evas_map_util_points_populate_from_object(map, rect);
94
95 evas_map_point_coord_get(map, 0, &x, &y, &z);
96 ck_assert((x == 0) && (y == 0) && (z == 0));
97
98 evas_map_point_coord_get(map, 1, &x, &y, &z);
99 ck_assert((x == 100) && (y == 0) && (z == 0));
100
101 evas_map_point_coord_get(map, 2, &x, &y, &z);
102 ck_assert((x == 100) && (y == 100) && (z == 0));
103
104 evas_map_point_coord_get(map, 3, &x, &y, &z);
105 ck_assert((x == 0) && (y == 100) && (z == 0));
106
107 evas_map_point_image_uv_get(map, 0, &u, &v);
108 ck_assert((u == 0) && (v == 0));
109
110 evas_map_point_image_uv_get(map, 1, &u, &v);
111 ck_assert((u == 100) && (v == 0));
112
113 evas_map_point_image_uv_get(map, 2, &u, &v);
114 ck_assert((u == 100) && (v == 100));
115
116 evas_map_point_image_uv_get(map, 3, &u, &v);
117 ck_assert((u == 0) && (v == 100));
118
119 evas_map_free(map);
120 evas_free(e);
121}
122EFL_END_TEST
123
124void evas_test_map(TCase *tc)
125{
126 tcase_add_test(tc, evas_object_map_api);
127 tcase_add_test(tc, evas_object_map_rect);
128}
diff --git a/src/tests/evas/meson.build b/src/tests/evas/meson.build
index bee736035f..01681ffb1d 100644
--- a/src/tests/evas/meson.build
+++ b/src/tests/evas/meson.build
@@ -21,6 +21,7 @@ evas_suite_src = [
21 'efl_test_canvas2.c', 21 'efl_test_canvas2.c',
22 'efl_test_canvas3.c', 22 'efl_test_canvas3.c',
23 'efl_canvas_animation.c', 23 'efl_canvas_animation.c',
24 'evas_test_map.c',
24] 25]
25 26
26evas_suite = executable('evas_suite', 27evas_suite = executable('evas_suite',