diff --git a/data/elementary/themes/edc/efl/scroller.edc b/data/elementary/themes/edc/efl/scroller.edc index 56265262b0..83a377391b 100644 --- a/data/elementary/themes/edc/efl/scroller.edc +++ b/data/elementary/themes/edc/efl/scroller.edc @@ -1281,6 +1281,22 @@ group { name: "efl/scroller:noclip"; } } +group { name: "efl/scroller:popup/no_inset_shadow"; + inherit: "efl/scroller"; + parts { + part { name: "inset"; + description { state: "default" 0.0; + visible: 0; + } + } + part { name: "shadow"; + description { state: "default" 0.0; + visible: 0; + } + } + } +} + group { name: "efl/scroller/contents"; parts { part { name: "efl.content"; diff --git a/header_checks/meson.build b/header_checks/meson.build index 520b4ea843..c83f48b897 100644 --- a/header_checks/meson.build +++ b/header_checks/meson.build @@ -248,8 +248,6 @@ config_h.set('SIZEOF_INT', cc.sizeof('int')) config_h.set('SIZEOF_LONG', cc.sizeof('long')) if sys_windows == true - config_h.set('HAVE_DLSYM', '1') config_h.set('HAVE_NOTIFY_WIN32', '1') - config_h.set10('HAVE_WINDOWS_H', true) config_h.set10('HAVE_DDRAW_H', true) endif diff --git a/src/bin/edje/edje_cc_handlers.c b/src/bin/edje/edje_cc_handlers.c index 9e57d7d82d..2851a51b79 100644 --- a/src/bin/edje/edje_cc_handlers.c +++ b/src/bin/edje/edje_cc_handlers.c @@ -34,9 +34,13 @@ #include #include #include -#include #include #include +#ifdef _WIN32 +# include /* mmap */ +#else +# include +#endif #include "edje_cc.h" diff --git a/src/bin/elementary/elm_prefs_cc_handlers.c b/src/bin/elementary/elm_prefs_cc_handlers.c index a400d5bca9..ce5c01210b 100644 --- a/src/bin/elementary/elm_prefs_cc_handlers.c +++ b/src/bin/elementary/elm_prefs_cc_handlers.c @@ -32,7 +32,6 @@ #include #include #include -#include #include #include "elm_prefs_cc.h" diff --git a/src/bin/elementary/test_label.c b/src/bin/elementary/test_label.c index c00ae7986e..233ce015b4 100644 --- a/src/bin/elementary/test_label.c +++ b/src/bin/elementary/test_label.c @@ -393,6 +393,8 @@ test_label_colors(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *ev elm_object_text_set(lb, "this is red color line(color = red)
" "this is blue color line (color = #0000FF)
" + "this is green color line (color = rgb(0,255,0))
" + "this is blue color line (color = rgba(0,255,0,255))
" ); evas_object_size_hint_weight_set(lb, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_win_resize_object_add(win, lb); diff --git a/src/bin/eolian_mono/eolian/mono/function_definition.hh b/src/bin/eolian_mono/eolian/mono/function_definition.hh index cf85f6844d..f010f6dc2f 100644 --- a/src/bin/eolian_mono/eolian/mono/function_definition.hh +++ b/src/bin/eolian_mono/eolian/mono/function_definition.hh @@ -251,8 +251,26 @@ struct property_extension_method_definition_generator if (property.setter.is_engaged()) { attributes::type_def prop_type = property.setter->parameters[0].type; - if (!as_generator("public static Efl.Bindable<" << type(true) << "> " << managed_name << "(this Efl.Ui.ItemFactory fac) where T : " << name_helpers::klass_full_concrete_or_interface_name(cls) << " {\n" - << scope_tab << scope_tab << "return new Efl.Bindable<" << type(true) << ">(\"" << property.name << "\", fac);\n" + if (!as_generator("public static Efl.BindableProperty<" << type(true) << "> " << managed_name << "(this Efl.Ui.ItemFactory fac, Efl.Csharp.ExtensionTag<" + << name_helpers::klass_full_concrete_or_interface_name(cls) + << ", T>magic = null) where T : " << name_helpers::klass_full_concrete_or_interface_name(cls) << " {\n" + << scope_tab << scope_tab << "return new Efl.BindableProperty<" << type(true) << ">(\"" << property.name << "\", fac);\n" + << scope_tab << "}\n" + ).generate(sink, std::make_tuple(prop_type, prop_type), context)) + return false; + } + + // Do we need BindablePart extensions for this class? + if (!helpers::inherits_from(cls, "Efl.Ui.LayoutPart")) + return true; + + if (property.setter.is_engaged()) + { + attributes::type_def prop_type = property.setter->parameters[0].type; + if (!as_generator("public static Efl.BindableProperty<" << type(true) << "> " << managed_name << "(this Efl.BindablePart part, Efl.Csharp.ExtensionTag<" + << name_helpers::klass_full_concrete_or_interface_name(cls) + << ", T>magic = null) where T : " << name_helpers::klass_full_concrete_or_interface_name(cls) << " {\n" + << scope_tab << scope_tab << "return new Efl.BindableProperty<" << type(true) << ">(part.PartName, \"" << property.name << "\", part.Binder);\n" << scope_tab << "}\n" ).generate(sink, std::make_tuple(prop_type, prop_type), context)) return false; diff --git a/src/bin/eolian_mono/eolian/mono/helpers.hh b/src/bin/eolian_mono/eolian/mono/helpers.hh index c3e1114c98..a7c27c4809 100644 --- a/src/bin/eolian_mono/eolian/mono/helpers.hh +++ b/src/bin/eolian_mono/eolian/mono/helpers.hh @@ -163,6 +163,18 @@ bool has_regular_ancestor(attributes::klass_def const& cls) return std::any_of(inherits.begin(), inherits.end(), is_regular); } +/* + * Sugar for checking if a given class in in the inheritance tree + */ +bool inherits_from(attributes::klass_def const& cls, std::string const& name) +{ + return std::any_of(cls.inherits.begin(), cls.inherits.end(), + [&](attributes::klass_name const& inherit) + { + return name_helpers::klass_full_concrete_or_interface_name(inherit) == name; + }); +} + /* * Gets all methods that this class should implement (i.e. that come from an unimplemented interface/mixin and the class itself) */ diff --git a/src/bin/eolian_mono/eolian/mono/klass.hh b/src/bin/eolian_mono/eolian/mono/klass.hh index f118dea619..9c466d7c24 100644 --- a/src/bin/eolian_mono/eolian/mono/klass.hh +++ b/src/bin/eolian_mono/eolian/mono/klass.hh @@ -348,14 +348,24 @@ struct klass if(!name_helpers::close_namespaces(sink, cls.namespaces, context)) return false; + std::vector implementable_properties; + std::copy(cls.properties.begin(), cls.properties.end(), std::back_inserter(implementable_properties)); + + for (auto&& klass : helpers::non_implemented_interfaces(cls, context)) + { + attributes::klass_def c(get_klass(klass, cls.unit), cls.unit); + std::copy(c.properties.begin(), c.properties.end(), std::back_inserter(implementable_properties)); + } + if(!as_generator (lit("#pragma warning disable CS1591\n") // Disabling warnings as DocFx will hide these classes <<"public static class " << (string % "_") << name_helpers::klass_inherit_name(cls) << "_ExtensionMethods {\n" << *((scope_tab << property_extension_method_definition(cls)) << "\n") + << *((scope_tab << part_extension_method_definition(cls)) << "\n") << "}\n" << lit("#pragma warning restore CS1591\n")) - .generate(sink, std::make_tuple(cls.namespaces, cls.properties), context)) + .generate(sink, std::make_tuple(cls.namespaces, implementable_properties, cls.parts), context)) return false; return true; diff --git a/src/bin/eolian_mono/eolian/mono/part_definition.hh b/src/bin/eolian_mono/eolian/mono/part_definition.hh index 484cd0d65a..ec6ef61551 100644 --- a/src/bin/eolian_mono/eolian/mono/part_definition.hh +++ b/src/bin/eolian_mono/eolian/mono/part_definition.hh @@ -35,6 +35,39 @@ struct part_definition_generator } const part_definition {}; +struct part_extension_method_definition_generator +{ + template + bool generate(OutputIterator sink, attributes::part_def const& part, Context context) const + { + if (blacklist::is_class_blacklisted(part.klass, context)) + return true; + + auto part_klass_name = name_helpers::klass_full_concrete_or_interface_name(part.klass); + /* auto unit = (const Eolian_Unit*) context_find_tag(context).state; */ + /* auto klass = get_klass(part.klass, unit); */ + + if (!as_generator( + scope_tab << "public static Efl.BindablePart<" << part_klass_name << "> " << name_helpers::managed_part_name(part) << "(this Efl.Ui.ItemFactory fac, Efl.Csharp.ExtensionTag<" + << name_helpers::klass_full_concrete_or_interface_name(cls) + << ", T> x=null) where T : " << name_helpers::klass_full_concrete_or_interface_name(cls) << "\n" + << scope_tab << "{\n" + << scope_tab << scope_tab << "return new Efl.BindablePart<" << part_klass_name << ">(\"" << part.name << "\" ,fac);\n" + << scope_tab << "}\n" + ).generate(sink, attributes::unused, context)) + return false; + + return true; + } + + grammar::attributes::klass_def const& cls; +}; + +part_extension_method_definition_generator part_extension_method_definition (grammar::attributes::klass_def const& cls) +{ + return {cls}; +} + } namespace efl { namespace eolian { namespace grammar { @@ -44,10 +77,17 @@ struct is_eager_generator< ::eolian_mono::part_definition_generator> : std::true template <> struct is_generator< ::eolian_mono::part_definition_generator> : std::true_type {}; +template <> +struct is_eager_generator< ::eolian_mono::part_extension_method_definition_generator> : std::true_type {}; +template <> +struct is_generator< ::eolian_mono::part_extension_method_definition_generator> : std::true_type {}; + namespace type_traits { template <> struct attributes_needed< ::eolian_mono::part_definition_generator> : std::integral_constant {}; +template <> +struct attributes_needed< ::eolian_mono::part_extension_method_definition_generator> : std::integral_constant {}; } } } } diff --git a/src/bindings/mono/efl_mono/Bind.cs b/src/bindings/mono/efl_mono/Bind.cs index 5a10f780f5..c1e2a660d7 100644 --- a/src/bindings/mono/efl_mono/Bind.cs +++ b/src/bindings/mono/efl_mono/Bind.cs @@ -8,29 +8,95 @@ using System.ComponentModel; namespace Efl { -/// Representas a bindable property as used by instances. +/// Represents a bindable property as used by instances. /// /// It is internally instantiated and returned by generated extension methods. /// -public class Bindable +public class BindableProperty { + /// Creates a new bindable property with the source name name. - public Bindable(string name, Efl.Ui.IPropertyBind binder) + public BindableProperty(string name, Efl.Ui.IPropertyBind binder) { - this.name = name; + this.propertyName = name; + this.partName = null; this.binder = binder; } - /// Binds the model property model_property to the property name set in the constructor. - public void Bind(string model_property) + /// Creates a new bindable property for part part. + public BindableProperty(string partName, string partProperty, Efl.Ui.IPropertyBind binder) { - binder.PropertyBind(name, model_property); + this.partName = partName; + this.propertyName = partProperty; + this.binder = binder; } - string name; + /// Binds the model property modelProperty to the property name set in the constructor. + public Eina.Error Bind(string modelProperty) + { + if (this.partName == null) + { + return this.binder.PropertyBind(this.propertyName, modelProperty); + } + else + { + var partHolder = this.binder as Efl.IPart; + + if (partHolder == null) + { + throw new InvalidOperationException($"Failed to cast binder {binder} to IPart"); + } + + var partBinder = partHolder.GetPart(this.partName) as Efl.Ui.IPropertyBind; + + if (partBinder != null) + { + return partBinder.PropertyBind(this.propertyName, modelProperty); + } + else + { + throw new InvalidOperationException($"Failed to get part {this.partName}"); + } + } + } + + string propertyName; + string partName; Efl.Ui.IPropertyBind binder; } +/// Represents bindable parts as used by instances. +/// +/// It is internally instantiated and returned by generated extension methods. +/// +public class BindablePart +{ + /// Creates a new bindable property with the binder binder. + public BindablePart(string partName, Efl.Ui.IPropertyBind binder) + { + this.PartName = partName; + this.Binder = binder; + } + + /// The name of the part this instance wraps. + public string PartName { get; private set; } + /// The binder that will be used to bind the properties. + public Efl.Ui.IPropertyBind Binder { get; private set; } +} + +namespace Csharp +{ + +/// Helper class to differentiate between factory extension methods. +/// +/// For internal use only. +public class ExtensionTag + where TInherited : TBase +{ +} + +} + } #endif diff --git a/src/generic/emotion/vlc/emotion_generic_vlc.c b/src/generic/emotion/vlc/emotion_generic_vlc.c index 456509e673..dcfcbe9e8c 100644 --- a/src/generic/emotion/vlc/emotion_generic_vlc.c +++ b/src/generic/emotion/vlc/emotion_generic_vlc.c @@ -8,7 +8,6 @@ #include #include #include -#include #include #include #include diff --git a/src/generic/evas/common/shmfile.c b/src/generic/evas/common/shmfile.c index 0f9361397c..6fe9eb30d6 100644 --- a/src/generic/evas/common/shmfile.c +++ b/src/generic/evas/common/shmfile.c @@ -11,16 +11,19 @@ # include #endif #include -#ifdef HAVE_SHM_OPEN -# include -#endif #include #include #include #include #ifdef _WIN32 +# ifndef WIN32_LEAN_AND_MEAN +# define WIN32_LEAN_AND_MEAN +# endif # include +# undef WIN32_LEAN_AND_MEAN +#else +# include #endif #ifdef __cplusplus diff --git a/src/generic/evas/gst/main.c b/src/generic/evas/gst/main.c index e4f9f00285..3f93507078 100644 --- a/src/generic/evas/gst/main.c +++ b/src/generic/evas/gst/main.c @@ -2,9 +2,6 @@ # include #endif -#ifdef HAVE_SHM_OPEN -# include -#endif #include #include @@ -272,7 +269,11 @@ main(int argc, char **argv) if (!head_only) { +#ifdef _WIN32 + if (shm_fd) +#else if (shm_fd >= 0) +#endif { printf("shmfile %s\n", shmfile); } diff --git a/src/generic/evas/gst/main_0_10.c b/src/generic/evas/gst/main_0_10.c index 8e383334f6..8a197c4208 100644 --- a/src/generic/evas/gst/main_0_10.c +++ b/src/generic/evas/gst/main_0_10.c @@ -2,7 +2,6 @@ # include #endif -#include #include #include diff --git a/src/generic/evas/pdf/main.cpp b/src/generic/evas/pdf/main.cpp index d8532fed54..c7c3ee13bd 100644 --- a/src/generic/evas/pdf/main.cpp +++ b/src/generic/evas/pdf/main.cpp @@ -2,9 +2,6 @@ # include #endif -#ifdef HAVE_SHM_OPEN -# include -#endif #include #include #include @@ -317,11 +314,13 @@ main(int argc, char **argv) if (!head_only) { -#ifdef HAVE_SHM_OPEN +#ifdef _WIN32 + if (shm_fd) +#else if (shm_fd >= 0) +#endif printf("shmfile %s\n", shmfile); else -#endif { // could also to "tmpfile %s\n" like shmfile but just // a mmaped tmp file on the system diff --git a/src/generic/evas/ps/main.c b/src/generic/evas/ps/main.c index 6fdd74ce03..586c7e8f0b 100644 --- a/src/generic/evas/ps/main.c +++ b/src/generic/evas/ps/main.c @@ -2,7 +2,6 @@ # include #endif -#include #include #include @@ -270,7 +269,11 @@ main(int argc, char **argv) if (!head_only) { +#ifdef _WIN32 + if (shm_fd) printf("shmfile %s\n", shmfile); +#else if (shm_fd >= 0) printf("shmfile %s\n", shmfile); +#endif else { // could also to "tmpfile %s\n" like shmfile but just diff --git a/src/generic/evas/raw/main.c b/src/generic/evas/raw/main.c index 70a1625b75..c007bf62ba 100644 --- a/src/generic/evas/raw/main.c +++ b/src/generic/evas/raw/main.c @@ -3,7 +3,6 @@ #endif #include #include -#include #include #include #include @@ -15,6 +14,12 @@ # include #endif +#ifdef _WIN32 +# include /* mmap */ +#else +# include +#endif + #include @@ -204,7 +209,7 @@ int main(int argc, char **argv) } timeout_init(4); - + if (!_raw_init(file)) return -1; if (head_only != 0) { @@ -221,7 +226,11 @@ int main(int argc, char **argv) { printf("size %d %d\n", width, height); printf("alpha 1\n"); +#ifdef _WIN32 + if (shm_fd) printf("shmfile %s\n", shmfile); +#else if (shm_fd >= 0) printf("shmfile %s\n", shmfile); +#endif else { printf("data\n"); diff --git a/src/generic/evas/rsvg/main.c b/src/generic/evas/rsvg/main.c index f1973303ee..f09309f79e 100644 --- a/src/generic/evas/rsvg/main.c +++ b/src/generic/evas/rsvg/main.c @@ -214,7 +214,11 @@ int main(int argc, char **argv) { printf("size %d %d\n", width, height); printf("alpha 1\n"); +#ifdef _WIN32 + if (shm_fd) printf("shmfile %s\n", shmfile); +#else if (shm_fd >= 0) printf("shmfile %s\n", shmfile); +#endif else { printf("data\n"); diff --git a/src/generic/evas/xcf/common.h b/src/generic/evas/xcf/common.h index 34b0cad692..4e605b0022 100644 --- a/src/generic/evas/xcf/common.h +++ b/src/generic/evas/xcf/common.h @@ -14,7 +14,6 @@ # include #endif #include -#include #include #include #include diff --git a/src/generic/evas/xcf/main.c b/src/generic/evas/xcf/main.c index 65e5e1b5b3..767c6bf4b1 100644 --- a/src/generic/evas/xcf/main.c +++ b/src/generic/evas/xcf/main.c @@ -1714,7 +1714,11 @@ main(int argc, char **argv) printf("alpha 1\n"); if (!head_only) { +#ifdef _WIN32 + if (shm_fd) printf("shmfile %s\n", shmfile); +#else if (shm_fd >= 0) printf("shmfile %s\n", shmfile); +#endif else { // could also to "tmpfile %s\n" like shmfile but just diff --git a/src/lib/ecore/ecore.c b/src/lib/ecore/ecore.c index 7aa987b271..b2ca8aa649 100644 --- a/src/lib/ecore/ecore.c +++ b/src/lib/ecore/ecore.c @@ -15,7 +15,9 @@ # include #endif -#if defined(HAVE_SYS_MMAN_H) || defined(_WIN32) +#ifdef _WIN32 +# include /* mmap */ +#else # include #endif diff --git a/src/lib/ecore_evas/ecore_evas.c b/src/lib/ecore_evas/ecore_evas.c index 18c251f007..9d2d4d10f1 100644 --- a/src/lib/ecore_evas/ecore_evas.c +++ b/src/lib/ecore_evas/ecore_evas.c @@ -14,7 +14,9 @@ #include #include -#if defined(HAVE_SYS_MMAN_H) || defined(_WIN32) +#ifdef _WIN32 +# include /* mmap */ +#else # include #endif diff --git a/src/lib/edje/edje_private.h b/src/lib/edje/edje_private.h index 1f56b99a28..0d5217ab25 100644 --- a/src/lib/edje/edje_private.h +++ b/src/lib/edje/edje_private.h @@ -2482,6 +2482,7 @@ EAPI extern Eet_Data_Descriptor *_edje_edd_edje_part_collection; extern Eina_Inlist *_edje_edjes; extern char *_edje_fontset_append; +extern char *_edje_fontset_append_escaped; extern FLOAT_T _edje_scale; extern int _edje_util_freeze_val; extern int _edje_util_freeze_calc_count; diff --git a/src/lib/edje/edje_textblock_styles.c b/src/lib/edje/edje_textblock_styles.c index 555cab92c0..06fbc1e586 100644 --- a/src/lib/edje/edje_textblock_styles.c +++ b/src/lib/edje/edje_textblock_styles.c @@ -1,29 +1,12 @@ #include "edje_private.h" static int -_edje_font_is_embedded(Edje_File *edf, char *font) +_edje_font_is_embedded(Edje_File *edf, const char *font) { if (!eina_hash_find(edf->fonts, font)) return 0; return 1; } -static void -_edje_format_param_parse(char *item, char **key, char **val) -{ - char *p, *k, *v; - - p = strchr(item, '='); - if (!p) return; - - k = malloc(p - item + 1); - strncpy(k, item, p - item); - k[p - item] = 0; - *key = k; - p++; - v = strdup(p); - *val = v; -} - static char * _edje_format_parse(const char **s) { @@ -69,13 +52,6 @@ _edje_format_parse(const char **s) return NULL; } -static int -_edje_format_is_param(char *item) -{ - if (strchr(item, '=')) return 1; - return 0; -} - static char * _edje_format_reparse(Edje_File *edf, const char *str, Edje_Style_Tag **tag_ret) { @@ -87,16 +63,18 @@ _edje_format_reparse(Edje_File *edf, const char *str, Edje_Style_Tag **tag_ret) s = str; while ((item = _edje_format_parse(&s))) { - if (_edje_format_is_param(item)) + const char *pos = strchr(item, '='); + if (pos) { - char *key = NULL, *val = NULL; + size_t key_len = pos - item; + const char *key = item; + const char *val = pos + 1; - _edje_format_param_parse(item, &key, &val); - if (!strcmp(key, "font_source")) + if (!strncmp(key, "font_source", key_len)) { /* dont allow font sources */ } - else if (!strcmp(key, "text_class")) + else if (!strncmp(key, "text_class", key_len)) { if (tag_ret) (*tag_ret)->text_class = eina_stringshare_add(val); @@ -106,12 +84,12 @@ _edje_format_reparse(Edje_File *edf, const char *str, Edje_Style_Tag **tag_ret) // text_class tag. continue; } - else if (!strcmp(key, "font_size")) + else if (!strncmp(key, "font_size", key_len)) { if (tag_ret) (*tag_ret)->font_size = atof(val); } - else if (!strcmp(key, "font")) /* Fix fonts */ + else if (!strncmp(key, "font", key_len)) /* Fix fonts */ { if (tag_ret) { @@ -137,8 +115,6 @@ _edje_format_reparse(Edje_File *edf, const char *str, Edje_Style_Tag **tag_ret) eina_strbuf_append(txt, s2); free(s2); } - free(key); - free(val); } else { @@ -168,7 +144,7 @@ _edje_textblock_style_update(Edje *ed, Edje_Style *stl, Eina_Bool force) Eina_Strbuf *txt = NULL; Edje_Style_Tag *tag; Edje_Text_Class *tc; - char *fontset = NULL, *fontsource = NULL; + char *fontset = _edje_fontset_append_escaped, *fontsource = NULL; if (!ed->file) return; @@ -208,44 +184,36 @@ _edje_textblock_style_update(Edje *ed, Edje_Style *stl, Eina_Bool force) { if (fontset) { - eina_strbuf_append(txt, " "); - eina_strbuf_append(txt, "font_fallbacks="); + eina_strbuf_append(txt, " font_fallbacks="); eina_strbuf_append(txt, fontset); } if (fontsource) { - eina_strbuf_append(txt, " "); - eina_strbuf_append(txt, "font_source="); + eina_strbuf_append(txt, " font_source="); eina_strbuf_append(txt, fontsource); } } - if (!EINA_DBL_EQ(tag->font_size, 0)) + if (tc && tc->size && !EINA_DBL_EQ(tag->font_size, 0)) { - char font_size[32]; + double new_size = _edje_text_size_calc(tag->font_size, tc); + if (!EINA_DBL_EQ(tag->font_size, new_size)) + { + char buffer[32]; - if (tc && tc->size) - snprintf(font_size, sizeof(font_size), "%f", - (double)_edje_text_size_calc(tag->font_size, tc)); - else - snprintf(font_size, sizeof(font_size), "%f", - tag->font_size); - - eina_strbuf_append(txt, " "); - eina_strbuf_append(txt, "font_size="); - eina_strbuf_append(txt, font_size); + snprintf(buffer, sizeof(buffer), "%.1f", new_size); + eina_strbuf_append(txt, " font_size="); + eina_strbuf_append(txt, buffer); + } } /* Add font name last to save evas from multiple loads */ - if (tag->font) + if (tc && tc->font && tag->font) { const char *f; char *sfont = NULL; - eina_strbuf_append(txt, " "); - eina_strbuf_append(txt, "font="); - - if (tc) f = _edje_text_font_get(tag->font, tc->font, &sfont); - else f = tag->font; + eina_strbuf_append(txt, " font="); + f = _edje_text_font_get(tag->font, tc->font, &sfont); eina_strbuf_append_escaped(txt, f); if (sfont) free(sfont); @@ -253,7 +221,6 @@ _edje_textblock_style_update(Edje *ed, Edje_Style *stl, Eina_Bool force) eina_strbuf_append(txt, "'"); } - if (fontset) free(fontset); if (fontsource) free(fontsource); /* Configure the style */ @@ -448,11 +415,12 @@ _edje_textblock_style_parse_and_fix(Edje_File *edf) Eina_Strbuf *txt = NULL; Eina_List *l, *ll; Edje_Style *stl; + char *fontset = _edje_fontset_append_escaped; EINA_LIST_FOREACH(edf->styles, l, stl) { Edje_Style_Tag *tag; - char *fontset = NULL, *fontsource = NULL, *ts; + char *fontsource = NULL, *ts; if (stl->style) break; @@ -464,8 +432,6 @@ _edje_textblock_style_parse_and_fix(Edje_File *edf) stl->style = evas_textblock_style_new(); evas_textblock_style_set(stl->style, NULL); - if (_edje_fontset_append) - fontset = eina_str_escape(_edje_fontset_append); if (edf->fonts) fontsource = eina_str_escape(edf->path); @@ -495,8 +461,7 @@ _edje_textblock_style_parse_and_fix(Edje_File *edf) { if (fontset) { - eina_strbuf_append(txt, " "); - eina_strbuf_append(txt, "font_fallbacks="); + eina_strbuf_append(txt, " font_fallbacks="); eina_strbuf_append(txt, fontset); } if (fontsource) @@ -510,7 +475,6 @@ _edje_textblock_style_parse_and_fix(Edje_File *edf) if (tag->text_class) stl->readonly = EINA_FALSE; } - if (fontset) free(fontset); if (fontsource) free(fontsource); /* Configure the style */ diff --git a/src/lib/edje/edje_util.c b/src/lib/edje/edje_util.c index 2f6c5b2d22..0e74e79855 100644 --- a/src/lib/edje/edje_util.c +++ b/src/lib/edje/edje_util.c @@ -27,6 +27,7 @@ Efl_Observable *_edje_size_class_member = NULL; static Eina_Rbtree *_edje_box_layout_registry = NULL; char *_edje_fontset_append = NULL; +char *_edje_fontset_append_escaped = NULL; FLOAT_T _edje_scale = ZERO; Eina_Bool _edje_password_show_last = EINA_FALSE; double _edje_password_show_last_timeout = 0; @@ -357,8 +358,12 @@ EAPI void edje_fontset_append_set(const char *fonts) { if (_edje_fontset_append) - free(_edje_fontset_append); + { + free(_edje_fontset_append); + free(_edje_fontset_append_escaped); + } _edje_fontset_append = fonts ? strdup(fonts) : NULL; + _edje_fontset_append_escaped = fonts ? eina_str_escape(fonts) : NULL; } EAPI const char * diff --git a/src/lib/eet/eet_cipher.c b/src/lib/eet/eet_cipher.c index 3bdab4c2f1..2314c24e03 100644 --- a/src/lib/eet/eet_cipher.c +++ b/src/lib/eet/eet_cipher.c @@ -9,7 +9,11 @@ #include #ifdef HAVE_SIGNATURE -# include +# ifdef _WIN32 +# include /* mmap */ +# else +# include +# endif # ifdef HAVE_GNUTLS # include # include diff --git a/src/lib/efreet/efreet_mime.c b/src/lib/efreet/efreet_mime.c index e4e1ba896f..9eba8c8db9 100644 --- a/src/lib/efreet/efreet_mime.c +++ b/src/lib/efreet/efreet_mime.c @@ -6,7 +6,6 @@ #include #include #include -#include #include #include diff --git a/src/lib/efreet/efreet_xml.c b/src/lib/efreet/efreet_xml.c index 4f4cd2fea8..97a44aa9de 100644 --- a/src/lib/efreet/efreet_xml.c +++ b/src/lib/efreet/efreet_xml.c @@ -6,7 +6,12 @@ #include #include #include -#include + +#ifdef _WIN32 +# include /* mmap */ +#else +# include +#endif #include diff --git a/src/lib/eina/eina_debug_chunk.c b/src/lib/eina/eina_debug_chunk.c index 4ee9655140..1c6c028647 100644 --- a/src/lib/eina/eina_debug_chunk.c +++ b/src/lib/eina/eina_debug_chunk.c @@ -29,8 +29,13 @@ # include #endif -#ifdef HAVE_MMAP +#ifdef _WIN32 +# include /* mmap */ +#else # include +#endif + +#ifdef HAVE_MMAP // custom memory allocators to avoid malloc/free during backtrace handling // just in case we're inside some signal handler due to mem corruption and diff --git a/src/lib/eina/eina_evlog.c b/src/lib/eina/eina_evlog.c index 994a370779..4dba784ff1 100644 --- a/src/lib/eina/eina_evlog.c +++ b/src/lib/eina/eina_evlog.c @@ -36,9 +36,11 @@ #include #include -# ifdef HAVE_MMAP -# include -# endif +#ifdef _WIN32 +# include /* mmap */ +#else +# include +#endif #if __BYTE_ORDER == __LITTLE_ENDIAN #define SWAP_64(x) x diff --git a/src/lib/eina/eina_safepointer.c b/src/lib/eina/eina_safepointer.c index 8f9d4b62a9..9016aab27a 100644 --- a/src/lib/eina/eina_safepointer.c +++ b/src/lib/eina/eina_safepointer.c @@ -10,10 +10,15 @@ #include #include #include -#include #include #include +#ifdef _WIN32 +# include /* mmap */ +#else +# include +#endif + #include "eina_config.h" #include "eina_private.h" diff --git a/src/lib/eio/eio_private.h b/src/lib/eio/eio_private.h index 36d784752d..aa75336124 100644 --- a/src/lib/eio/eio_private.h +++ b/src/lib/eio/eio_private.h @@ -23,7 +23,6 @@ #include #include #include -#include #include #include diff --git a/src/lib/elementary/efl_ui_collection_focus_manager.eo b/src/lib/elementary/efl_ui_collection_focus_manager.eo index 6fbf57d89a..e015dea7c9 100644 --- a/src/lib/elementary/efl_ui_collection_focus_manager.eo +++ b/src/lib/elementary/efl_ui_collection_focus_manager.eo @@ -1,4 +1,4 @@ -class @beta Efl.Ui.Collection.Focus_Manager extends Efl.Ui.Focus.Manager_Calc { +class @beta Efl.Ui.Collection_Focus_Manager extends Efl.Ui.Focus.Manager_Calc { [[Internal class which implements collection specific behaviour, cannot be used outside of collection]] implements { Efl.Ui.Focus.Manager.manager_focus { set; } diff --git a/src/lib/elementary/efl_ui_layout_factory.c b/src/lib/elementary/efl_ui_layout_factory.c index 709a31fc85..310bc5224a 100644 --- a/src/lib/elementary/efl_ui_layout_factory.c +++ b/src/lib/elementary/efl_ui_layout_factory.c @@ -139,6 +139,7 @@ _efl_ui_layout_factory_efl_ui_property_bind_property_bind(Eo *obj EINA_UNUSED, E ss_prop = eina_stringshare_add(property); ss_old = eina_hash_set(pd->bind.properties, ss_key, ss_prop); if (ss_old) eina_stringshare_del(ss_old); + else ss_key = NULL; // Prevent destruction of key to keep at least one reference end: efl_event_callback_call(obj, EFL_UI_PROPERTY_BIND_EVENT_PROPERTY_BOUND, (void*) ss_key); diff --git a/src/lib/elementary/efl_ui_scroll_alert_popup.c b/src/lib/elementary/efl_ui_scroll_alert_popup.c index bba1392aed..6bc43e2c1e 100644 --- a/src/lib/elementary/efl_ui_scroll_alert_popup.c +++ b/src/lib/elementary/efl_ui_scroll_alert_popup.c @@ -37,20 +37,20 @@ _scroller_sizing_eval(Eo *obj, Efl_Ui_Scroll_Alert_Popup_Data *pd, if ((max_size.w == -1) && (max_size.h == -1)) { - elm_scroller_content_min_limit(pd->scroller, EINA_FALSE, EINA_FALSE); + efl_ui_scrollable_match_content_set(pd->scroller, EINA_FALSE, EINA_FALSE); efl_gfx_entity_size_set(obj, size); } else if ((max_size.w == -1) && (max_size.h != -1)) { if (max_size.h < scr_min.h) { - elm_scroller_content_min_limit(pd->scroller, EINA_FALSE, EINA_FALSE); + efl_ui_scrollable_match_content_set(pd->scroller, EINA_FALSE, EINA_FALSE); efl_gfx_entity_size_set(obj, EINA_SIZE2D(size.w, max_size.h)); } else { new_min.h = scr_min.h; - elm_scroller_content_min_limit(pd->scroller, EINA_FALSE, EINA_TRUE); + efl_ui_scrollable_match_content_set(pd->scroller, EINA_FALSE, EINA_TRUE); efl_gfx_entity_size_set(obj, EINA_SIZE2D(size.w, scr_min.h)); } } @@ -58,13 +58,13 @@ _scroller_sizing_eval(Eo *obj, Efl_Ui_Scroll_Alert_Popup_Data *pd, { if (max_size.w < scr_min.w) { - elm_scroller_content_min_limit(pd->scroller, EINA_FALSE, EINA_FALSE); + efl_ui_scrollable_match_content_set(pd->scroller, EINA_FALSE, EINA_FALSE); efl_gfx_entity_size_set(obj, EINA_SIZE2D(max_size.w, size.h)); } else { new_min.w = scr_min.w; - elm_scroller_content_min_limit(pd->scroller, EINA_TRUE, EINA_FALSE); + efl_ui_scrollable_match_content_set(pd->scroller, EINA_TRUE, EINA_FALSE); efl_gfx_entity_size_set(obj, EINA_SIZE2D(scr_min.w, size.h)); } } @@ -96,7 +96,7 @@ _scroller_sizing_eval(Eo *obj, Efl_Ui_Scroll_Alert_Popup_Data *pd, new_size.h = scr_min.h; } - elm_scroller_content_min_limit(pd->scroller, min_limit_w, min_limit_h); + efl_ui_scrollable_match_content_set(pd->scroller, min_limit_w, min_limit_h); efl_gfx_entity_size_set(obj, new_size); } efl_canvas_group_calculate(pd->scroller); @@ -113,7 +113,7 @@ _sizing_eval(Eo *obj, Efl_Ui_Scroll_Alert_Popup_Data *pd) //Calculate popup's min size including scroller's min size { - elm_scroller_content_min_limit(pd->scroller, EINA_TRUE, EINA_TRUE); + efl_ui_scrollable_match_content_set(pd->scroller, EINA_TRUE, EINA_TRUE); efl_canvas_group_calculate(pd->scroller); elm_coords_finger_size_adjust(1, &scr_minw, 1, &scr_minh); @@ -123,14 +123,13 @@ _sizing_eval(Eo *obj, Efl_Ui_Scroll_Alert_Popup_Data *pd) //Calculate popup's min size except scroller's min size { - elm_scroller_content_min_limit(pd->scroller, EINA_FALSE, EINA_FALSE); + efl_ui_scrollable_match_content_set(pd->scroller, EINA_FALSE, EINA_FALSE); efl_canvas_group_calculate(pd->scroller); elm_coords_finger_size_adjust(1, &obj_minw, 1, &obj_minh); edje_object_size_min_restricted_calc (wd->resize_obj, &obj_minw, &obj_minh, obj_minw, obj_minh); } - _scroller_sizing_eval(obj, pd, EINA_SIZE2D(obj_minw, obj_minh), EINA_SIZE2D(scr_minw, scr_minh)); } @@ -139,13 +138,10 @@ _efl_ui_scroll_alert_popup_efl_canvas_group_group_calculate(Eo *obj, Efl_Ui_Scro { EFL_UI_POPUP_DATA_GET_OR_RETURN(obj, ppd); ppd->in_calc = EINA_TRUE; - /* When efl_canvas_group_change() is called, just flag is set instead of size - * calculation. - * The actual size calculation is done here when the object is rendered to - * avoid duplicate size calculations. */ - efl_canvas_group_need_recalculate_set(obj, EINA_FALSE); _sizing_eval(obj, pd); + efl_canvas_group_need_recalculate_set(pd->scroller, EINA_FALSE); + efl_canvas_group_need_recalculate_set(obj, EINA_FALSE); //Not to calculate size by super class efl_canvas_group_calculate(efl_super(obj, MY_CLASS)); @@ -226,10 +222,9 @@ _efl_ui_scroll_alert_popup_efl_object_constructor(Eo *obj, obj = efl_constructor(efl_super(obj, MY_CLASS)); efl_canvas_object_type_set(obj, MY_CLASS_NAME); - pd->scroller = elm_scroller_add(obj); - elm_object_style_set(pd->scroller, "popup/no_inset_shadow"); - elm_scroller_policy_set(pd->scroller, ELM_SCROLLER_POLICY_AUTO, - ELM_SCROLLER_POLICY_AUTO); + pd->scroller = efl_add(EFL_UI_SCROLLER_CLASS, obj, + efl_ui_widget_style_set(efl_added, "popup/no_inset_shadow"), + efl_ui_scrollbar_bar_mode_set(efl_added, EFL_UI_SCROLLBAR_MODE_AUTO, EFL_UI_SCROLLBAR_MODE_AUTO)); efl_content_set(efl_part(efl_super(obj, MY_CLASS), "efl.content"), pd->scroller); diff --git a/src/lib/elementary/efl_ui_scroll_util.c b/src/lib/elementary/efl_ui_scroll_util.c index f21ed184ae..4336678fc7 100644 --- a/src/lib/elementary/efl_ui_scroll_util.c +++ b/src/lib/elementary/efl_ui_scroll_util.c @@ -210,19 +210,6 @@ _scroll_connector_bar_hide_cb(void *data, const Efl_Event *event) else if (type == EFL_UI_SCROLLBAR_DIRECTION_VERTICAL) efl_layout_signal_emit(wd->resize_obj, "efl,action,hide,vbar", "efl"); } -static void -_scroll_connector_resized_cb(void *data, const Efl_Event *ev EINA_UNUSED) -{ - Scroll_Connector_Context *ctx = data; - efl_canvas_group_change(ctx->obj); -} - -static void -_scroll_connector_size_hint_changed_cb(void *data, const Efl_Event *ev EINA_UNUSED) -{ - Scroll_Connector_Context *ctx = data; - efl_canvas_group_change(ctx->obj); -} void efl_ui_scroll_connector_bind(Eo *obj, Eo *manager) @@ -276,10 +263,6 @@ efl_ui_scroll_connector_bind(Eo *obj, Eo *manager) _scroll_connector_bar_show_cb, ctx); efl_event_callback_add(obj, EFL_UI_SCROLLBAR_EVENT_BAR_HIDE, _scroll_connector_bar_hide_cb, ctx); - efl_event_callback_add(obj, EFL_GFX_ENTITY_EVENT_SIZE_CHANGED, - _scroll_connector_resized_cb, ctx); - efl_event_callback_add(obj, EFL_GFX_ENTITY_EVENT_HINTS_CHANGED, - _scroll_connector_size_hint_changed_cb, ctx); } void diff --git a/src/lib/elementary/efl_ui_scroller.c b/src/lib/elementary/efl_ui_scroller.c index cbcb2c97f2..9a65337674 100644 --- a/src/lib/elementary/efl_ui_scroller.c +++ b/src/lib/elementary/efl_ui_scroller.c @@ -214,7 +214,10 @@ _efl_ui_scroller_efl_content_content_unset(Eo *obj EINA_UNUSED, Efl_Ui_Scroller_ static void _efl_ui_scroller_pan_resized_cb(void *data, const Efl_Event *ev EINA_UNUSED) { - efl_canvas_group_change(data); + if (efl_canvas_scene_group_objects_calculating_get(evas_object_evas_get(data))) + efl_canvas_group_calculate(data); + else + efl_canvas_group_change(data); } static void @@ -238,12 +241,18 @@ _focused_element(void *data, const Efl_Event *event) EOLIAN static Eo * _efl_ui_scroller_efl_object_constructor(Eo *obj, - Efl_Ui_Scroller_Data *sd EINA_UNUSED) + Efl_Ui_Scroller_Data *sd) { if (!elm_widget_theme_klass_get(obj)) elm_widget_theme_klass_set(obj, "scroller"); obj = efl_constructor(efl_super(obj, MY_CLASS)); + sd->smanager = efl_add(EFL_UI_SCROLL_MANAGER_CLASS, obj); + efl_ui_mirrored_set(sd->smanager, efl_ui_mirrored_get(obj)); + efl_composite_attach(obj, sd->smanager); + + efl_ui_scroll_connector_bind(obj, sd->smanager); + return obj; } @@ -255,10 +264,6 @@ _efl_ui_scroller_efl_object_finalize(Eo *obj, ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL); - sd->smanager = efl_add(EFL_UI_SCROLL_MANAGER_CLASS, obj); - efl_ui_mirrored_set(sd->smanager, efl_ui_mirrored_get(obj)); - efl_composite_attach(obj, sd->smanager); - sd->pan_obj = efl_add(EFL_UI_PAN_CLASS, obj); efl_ui_scroll_manager_pan_set(sd->smanager, sd->pan_obj); @@ -266,7 +271,6 @@ _efl_ui_scroller_efl_object_finalize(Eo *obj, elm_widget_can_focus_set(obj, EINA_TRUE); - efl_ui_scroll_connector_bind(obj, sd->smanager); efl_event_callback_add(sd->pan_obj, EFL_GFX_ENTITY_EVENT_SIZE_CHANGED, _efl_ui_scroller_pan_resized_cb, obj); diff --git a/src/lib/elementary/efl_ui_selection_manager.c b/src/lib/elementary/efl_ui_selection_manager.c index 49b3c5a3b1..e857f4fd98 100644 --- a/src/lib/elementary/efl_ui_selection_manager.c +++ b/src/lib/elementary/efl_ui_selection_manager.c @@ -4,7 +4,10 @@ #include #include "elm_priv.h" -#ifdef HAVE_SYS_MMAN_H + +#ifdef _WIN32 +# include /* mmap */ +#else # include #endif diff --git a/src/lib/elementary/efl_ui_text.c b/src/lib/elementary/efl_ui_text.c index 6c8a24d36a..631cd1bd0b 100644 --- a/src/lib/elementary/efl_ui_text.c +++ b/src/lib/elementary/efl_ui_text.c @@ -911,8 +911,17 @@ _efl_ui_text_efl_canvas_group_group_calculate(Eo *obj, Efl_Ui_Text_Data *sd) } else { + Eina_Size2D text_sz = efl_gfx_entity_size_get(sd->text_obj); edje_object_size_min_calc(wd->resize_obj, &edmin.w, &edmin.h); - efl_canvas_text_size_formatted_get(sd->text_obj, &min.w, &min.h); + efl_event_freeze(sd->text_obj); + efl_gfx_entity_size_set(sd->text_obj, EINA_SIZE2D(sz.w, 0)); + /* ignore current object size for single-line since we always need to know the actual size */ + if (sd->single_line) + efl_canvas_text_size_native_get(sd->text_obj, &min.w, &min.h); + else + efl_canvas_text_size_formatted_get(sd->text_obj, &min.w, &min.h); + efl_gfx_entity_size_set(sd->text_obj, text_sz); + efl_event_thaw(sd->text_obj); min.w += edmin.w; min.h += edmin.h; efl_gfx_hint_size_restricted_min_set(obj, min); diff --git a/src/lib/elementary/efl_ui_text_alert_popup.c b/src/lib/elementary/efl_ui_text_alert_popup.c index 64dfcc856f..13b812f57d 100644 --- a/src/lib/elementary/efl_ui_text_alert_popup.c +++ b/src/lib/elementary/efl_ui_text_alert_popup.c @@ -42,35 +42,35 @@ _scroller_sizing_eval(Eo *obj, Efl_Ui_Text_Alert_Popup_Data *pd, Eina_Size2D obj if ((max_size.w == -1) && (max_size.h == -1)) { - elm_scroller_content_min_limit(pd->scroller, EINA_FALSE, EINA_FALSE); + efl_ui_scrollable_match_content_set(pd->scroller, EINA_FALSE, EINA_FALSE); efl_gfx_entity_size_set(obj, size); } else if ((max_size.w == -1) && (max_size.h != -1)) { if (max_size.h < text_min.h) { - elm_scroller_content_min_limit(pd->scroller, EINA_FALSE, EINA_FALSE); - efl_gfx_entity_size_set(obj, EINA_SIZE2D(size.w, max_size.h)); + efl_ui_scrollable_match_content_set(pd->scroller, EINA_FALSE, EINA_FALSE); + size = EINA_SIZE2D(size.w, max_size.h); } else { new_min.h = text_min.h; - elm_scroller_content_min_limit(pd->scroller, EINA_FALSE, EINA_TRUE); - efl_gfx_entity_size_set(obj, EINA_SIZE2D(size.w, text_min.h)); + efl_ui_scrollable_match_content_set(pd->scroller, EINA_FALSE, EINA_TRUE); + size = EINA_SIZE2D(size.w, text_min.h); } } else if ((max_size.w != -1) && (max_size.h == -1)) { if (max_size.w < text_min.w) { - elm_scroller_content_min_limit(pd->scroller, EINA_FALSE, EINA_FALSE); - efl_gfx_entity_size_set(obj, EINA_SIZE2D(max_size.w, size.h)); + efl_ui_scrollable_match_content_set(pd->scroller, EINA_FALSE, EINA_FALSE); + size = EINA_SIZE2D(max_size.w, size.h); } else { new_min.w = text_min.w; - elm_scroller_content_min_limit(pd->scroller, EINA_TRUE, EINA_FALSE); - efl_gfx_entity_size_set(obj, EINA_SIZE2D(text_min.w, size.h)); + efl_ui_scrollable_match_content_set(pd->scroller, EINA_TRUE, EINA_FALSE); + size = EINA_SIZE2D(text_min.w, size.h); } } else if ((max_size.w != -1) && (max_size.h != -1)) @@ -101,9 +101,10 @@ _scroller_sizing_eval(Eo *obj, Efl_Ui_Text_Alert_Popup_Data *pd, Eina_Size2D obj new_size.h = text_min.h; } - elm_scroller_content_min_limit(pd->scroller, min_limit_w, min_limit_h); - efl_gfx_entity_size_set(obj, new_size); + efl_ui_scrollable_match_content_set(pd->scroller, min_limit_w, min_limit_h); + size = new_size; } + efl_gfx_entity_size_set(obj, size); efl_canvas_group_calculate(pd->scroller); efl_gfx_hint_size_restricted_min_set(obj, new_min); @@ -125,7 +126,7 @@ _sizing_eval(Eo *obj, Efl_Ui_Text_Alert_Popup_Data *pd) elm_label_line_wrap_set(pd->message, ELM_WRAP_MIXED); efl_canvas_group_calculate(pd->message); - elm_scroller_content_min_limit(pd->scroller, EINA_FALSE, EINA_TRUE); + efl_ui_scrollable_match_content_set(pd->scroller, EINA_FALSE, EINA_TRUE); efl_canvas_group_calculate(pd->scroller); elm_coords_finger_size_adjust(1, &text_minw, 1, &text_minh); @@ -135,7 +136,7 @@ _sizing_eval(Eo *obj, Efl_Ui_Text_Alert_Popup_Data *pd) //Calculate popup's min size except scroller's min size { - elm_scroller_content_min_limit(pd->scroller, EINA_FALSE, EINA_FALSE); + efl_ui_scrollable_match_content_set(pd->scroller, EINA_FALSE, EINA_FALSE); efl_canvas_group_calculate(pd->scroller); elm_coords_finger_size_adjust(1, &obj_minw, 1, &obj_minh); @@ -152,13 +153,9 @@ _efl_ui_text_alert_popup_efl_canvas_group_group_calculate(Eo *obj, Efl_Ui_Text_A { EFL_UI_POPUP_DATA_GET_OR_RETURN(obj, ppd); ppd->in_calc = EINA_TRUE; - /* When efl_canvas_group_change() is called, just flag is set instead of size - * calculation. - * The actual size calculation is done here when the object is rendered to - * avoid duplicate size calculations. */ - efl_canvas_group_need_recalculate_set(obj, EINA_FALSE); - _sizing_eval(obj, pd); + efl_canvas_group_need_recalculate_set(pd->scroller, EINA_FALSE); + efl_canvas_group_need_recalculate_set(obj, EINA_FALSE); efl_canvas_group_calculate(efl_super(obj, MY_CLASS)); ppd->in_calc = EINA_FALSE; @@ -242,10 +239,9 @@ _efl_ui_text_alert_popup_efl_object_constructor(Eo *obj, obj = efl_constructor(efl_super(obj, MY_CLASS)); efl_canvas_object_type_set(obj, MY_CLASS_NAME); - pd->scroller = elm_scroller_add(obj); - elm_object_style_set(pd->scroller, "popup/no_inset_shadow"); - elm_scroller_policy_set(pd->scroller, ELM_SCROLLER_POLICY_OFF, - ELM_SCROLLER_POLICY_AUTO); + pd->scroller = efl_add(EFL_UI_SCROLLER_CLASS, obj, + efl_ui_widget_style_set(efl_added, "popup/no_inset_shadow"), + efl_ui_scrollbar_bar_mode_set(efl_added, EFL_UI_SCROLLBAR_MODE_OFF, EFL_UI_SCROLLBAR_MODE_AUTO)); efl_content_set(efl_part(efl_super(obj, MY_CLASS), "efl.content"), pd->scroller); diff --git a/src/lib/elementary/elc_hoversel.c b/src/lib/elementary/elc_hoversel.c index b882b87833..ca08e713df 100644 --- a/src/lib/elementary/elc_hoversel.c +++ b/src/lib/elementary/elc_hoversel.c @@ -501,6 +501,7 @@ _activate(Evas_Object *obj) { ELM_HOVERSEL_ITEM_DATA_GET(eo_item, item); evas_object_show(VIEW(item)); + efl_canvas_group_calculate(VIEW(item)); elm_box_pack_end(sd->bx, VIEW(item)); } @@ -678,7 +679,8 @@ _elm_hoversel_efl_gfx_entity_visible_set(Eo *obj, Elm_Hoversel_Data *sd, Eina_Bo return; efl_gfx_entity_visible_set(efl_super(obj, MY_CLASS), vis); - efl_gfx_entity_visible_set(sd->hover, vis); + if (sd->hover) + efl_gfx_entity_visible_set(sd->hover, vis); } EOLIAN static void diff --git a/src/lib/elementary/elm_entry.c b/src/lib/elementary/elm_entry.c index 1fa1a9096a..7e9e838d97 100644 --- a/src/lib/elementary/elm_entry.c +++ b/src/lib/elementary/elm_entry.c @@ -1437,6 +1437,8 @@ _hoversel_position(Evas_Object *obj) edje_object_part_text_cursor_geometry_get (sd->entry_edje, "elm.text", &cx, &cy, &cw, &ch); + if (efl_canvas_group_need_recalculate_get(sd->hoversel)) + efl_canvas_group_calculate(sd->hoversel); evas_object_size_hint_combined_min_get(sd->hoversel, &mw, &mh); if (cx + mw > w) cx = w - mw; @@ -1811,8 +1813,8 @@ _menu_call(Evas_Object *obj) if (sd->hoversel) { _hoversel_position(obj); - evas_object_show(sd->hoversel); elm_hoversel_hover_begin(sd->hoversel); + evas_object_show(sd->hoversel); } if (!_elm_config->desktop_entry) diff --git a/src/lib/elput/elput_private.h b/src/lib/elput/elput_private.h index 16fe305c5b..744c5a92e3 100644 --- a/src/lib/elput/elput_private.h +++ b/src/lib/elput/elput_private.h @@ -13,7 +13,6 @@ # include # include -# include # include # include # include diff --git a/src/lib/elua/cache.c b/src/lib/elua/cache.c index 91fcdac658..b18d690569 100644 --- a/src/lib/elua/cache.c +++ b/src/lib/elua/cache.c @@ -2,7 +2,6 @@ #include #include -#include #include #include diff --git a/src/lib/eo/eo_ptr_indirection.x b/src/lib/eo/eo_ptr_indirection.x index d6affe0cc6..2b3fa5a467 100644 --- a/src/lib/eo/eo_ptr_indirection.x +++ b/src/lib/eo/eo_ptr_indirection.x @@ -1,9 +1,12 @@ #include -#ifdef HAVE_MMAP #include #include #include -#include + +#ifdef _WIN32 +# include /* mmap mprotect */ +#else +# include #endif #ifdef HAVE_VALGRIND diff --git a/src/lib/evas/canvas/evas_image_private.h b/src/lib/evas/canvas/evas_image_private.h index efd53209c8..2d468184eb 100644 --- a/src/lib/evas/canvas/evas_image_private.h +++ b/src/lib/evas/canvas/evas_image_private.h @@ -12,9 +12,6 @@ #include #include -#ifdef HAVE_SYS_MMAN_H -# include -#endif #include #include "evas_private.h" diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c index 6ecc9b1112..433597fa27 100644 --- a/src/lib/evas/canvas/evas_object_textblock.c +++ b/src/lib/evas/canvas/evas_object_textblock.c @@ -657,6 +657,7 @@ struct _Evas_Object_Textblock } gfx_filter; Eina_Bool redraw : 1; Eina_Bool changed : 1; + Eina_Bool pause_change : 1; Eina_Bool obstacle_changed : 1; Eina_Bool content_changed : 1; Eina_Bool format_changed : 1; @@ -1952,6 +1953,8 @@ _format_command(Evas_Object *eo_obj, Evas_Object_Textblock_Format *fmt, const ch * @li "#RRGGBBAA" * @li "#RGB" * @li "#RGBA" + * @li "rgb(r,g,b)" + * @li "rgba(r,g,b,a)" * @li "color_name" like "red" * @code * color= @@ -1971,6 +1974,8 @@ _format_command(Evas_Object *eo_obj, Evas_Object_Textblock_Format *fmt, const ch * @li "#RRGGBBAA" * @li "#RGB" * @li "#RGBA" + * @li "rgb(r,g,b)" + * @li "rgba(r,g,b,a)" * @li "color_name" like "red" * @code * underline_color= @@ -1991,6 +1996,8 @@ _format_command(Evas_Object *eo_obj, Evas_Object_Textblock_Format *fmt, const ch * @li "#RRGGBBAA" * @li "#RGB" * @li "#RGBA" + * @li "rgb(r,g,b)" + * @li "rgba(r,g,b,a)" * @li "color_name" like "red" * @code * underline2_color= @@ -2010,6 +2017,8 @@ _format_command(Evas_Object *eo_obj, Evas_Object_Textblock_Format *fmt, const ch * @li "#RRGGBBAA" * @li "#RGB" * @li "#RGBA" + * @li "rgb(r,g,b)" + * @li "rgba(r,g,b,a)" * @li "color_name" like "red" * @code * underline_dash_color= @@ -2030,6 +2039,8 @@ _format_command(Evas_Object *eo_obj, Evas_Object_Textblock_Format *fmt, const ch * @li "#RRGGBBAA" * @li "#RGB" * @li "#RGBA" + * @li "rgb(r,g,b)" + * @li "rgba(r,g,b,a)" * @li "color_name" like "red" * @code * outline_color= @@ -2050,6 +2061,8 @@ _format_command(Evas_Object *eo_obj, Evas_Object_Textblock_Format *fmt, const ch * @li "#RRGGBBAA" * @li "#RGB" * @li "#RGBA" + * @li "rgb(r,g,b)" + * @li "rgba(r,g,b,a)" * @li "color_name" like "red" * @code * shadow_color= @@ -2070,6 +2083,8 @@ _format_command(Evas_Object *eo_obj, Evas_Object_Textblock_Format *fmt, const ch * @li "#RRGGBBAA" * @li "#RGB" * @li "#RGBA" + * @li "rgb(r,g,b)" + * @li "rgba(r,g,b,a)" * @li "color_name" like "red" * @code * glow_color= @@ -2090,6 +2105,8 @@ _format_command(Evas_Object *eo_obj, Evas_Object_Textblock_Format *fmt, const ch * @li "#RRGGBBAA" * @li "#RGB" * @li "#RGBA" + * @li "rgb(r,g,b)" + * @li "rgba(r,g,b,a)" * @li "color_name" like "red" * @code * glow2_color= @@ -2110,6 +2127,8 @@ _format_command(Evas_Object *eo_obj, Evas_Object_Textblock_Format *fmt, const ch * @li "#RRGGBBAA" * @li "#RGB" * @li "#RGBA" + * @li "rgb(r,g,b)" + * @li "rgba(r,g,b,a)" * @li "color_name" like "red" * @code * backing_color= @@ -2130,6 +2149,8 @@ _format_command(Evas_Object *eo_obj, Evas_Object_Textblock_Format *fmt, const ch * @li "#RRGGBBAA" * @li "#RGB" * @li "#RGBA" + * @li "rgb(r,g,b)" + * @li "rgba(r,g,b,a)" * @li "color_name" like "red" * @code * strikethrough_color= @@ -8075,6 +8096,10 @@ _evas_object_textblock_text_markup_prepend(Eo *eo_obj, Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS); evas_object_async_block(obj); TB_HEAD(); + + /* Stop calls for _evas_textblock_changed for each cursor_text_append or cursor_format_append + * this should be done once, when markup_prepend finished */ + o->pause_change = EINA_TRUE; if (text) { char *s, *p; @@ -8119,6 +8144,12 @@ _evas_object_textblock_text_markup_prepend(Eo *eo_obj, _prepend_escaped_char(cur, esc_start, esc_end + 1); esc_start = esc_end = NULL; } + else if (*p == 0 && esc_start) /* escape start with no end, append it as text */ + { + _prepend_text_run(cur, esc_start, p); + esc_start = esc_end = NULL; + s = NULL; + } else if (*p == 0) { _prepend_text_run(cur, s, p); @@ -8129,6 +8160,12 @@ _evas_object_textblock_text_markup_prepend(Eo *eo_obj, } if (*p == '<') { + if (esc_start) /* escape start with no end, append it as text */ + { + _prepend_text_run(cur, esc_start, p); + esc_start = esc_end = NULL; + s = NULL; + } if (!esc_start) { /* Append the text prior to this to the textblock and mark @@ -8149,6 +8186,12 @@ _evas_object_textblock_text_markup_prepend(Eo *eo_obj, } else if (*p == '&') { + if (esc_start) /* escape start with no end, append it as text */ + { + _prepend_text_run(cur, esc_start, p); + esc_start = esc_end = NULL; + s = NULL; + } if (!tag_start) { /* Append the text prior to this to the textblock and mark @@ -8189,6 +8232,7 @@ _evas_object_textblock_text_markup_prepend(Eo *eo_obj, p++; } } + o->pause_change = EINA_FALSE; _evas_textblock_changed(o, eo_obj); } @@ -10996,7 +11040,8 @@ _evas_textblock_cursor_text_append(Efl_Text_Cursor_Cursor *cur, const char *_tex /* Update all the cursors after our position. */ _evas_textblock_cursors_update_offset(cur, cur->node, cur->pos, len); - _evas_textblock_changed(o, cur->obj); + if (!o->pause_change) + _evas_textblock_changed(o, cur->obj); n->dirty = EINA_TRUE; free(text); @@ -11342,7 +11387,8 @@ _evas_textblock_cursor_format_append(Efl_Text_Cursor_Cursor *cur, o->format_changed = EINA_TRUE; } - _evas_textblock_changed(o, cur->obj); + if (!o->pause_change) + _evas_textblock_changed(o, cur->obj); Efl_Text_Cursor_Cursor *ocur = o->cursor; if (!ocur->node) diff --git a/src/lib/evas/common/evas_image_main.c b/src/lib/evas/common/evas_image_main.c index e42e05d816..1be23a591e 100644 --- a/src/lib/evas/common/evas_image_main.c +++ b/src/lib/evas/common/evas_image_main.c @@ -2,7 +2,9 @@ # include "config.h" /* so that EAPI in Eet.h is correctly defined */ #endif -#ifdef HAVE_SYS_MMAN_H +#ifdef _WIN32 +# include /* mmap */ +#else # include #endif diff --git a/src/lib/evas/common/evas_text_utils.c b/src/lib/evas/common/evas_text_utils.c index b7cbe1b219..e9c5cc2c94 100644 --- a/src/lib/evas/common/evas_text_utils.c +++ b/src/lib/evas/common/evas_text_utils.c @@ -1299,7 +1299,7 @@ _hex_string_get(char ch, Eina_Bool *ok) * * @param source source buffer * @param dest destination buffer - * @param max maximum number of chars to be copyed + * @param max maximum number of chars to be copied * @return number of spaces removed */ @@ -1323,6 +1323,36 @@ size_t remove_spaces_lowercase(const char* source,char * dest,size_t max) return spaces; } +/** + * @internal + * read color component from string + * + * @param source source string + * @param[out] next position after the color compnent + * @param byte store color value read from string + * @return if read success + */ + +Eina_Bool read_byte_color_component(const char* source,char ** next,unsigned char * byte) +{ + const char *p_start = source; + char *p_stop = NULL; + Eina_Bool b_ret = EINA_TRUE; + long value = 0; + value = strtol(p_start, &p_stop, 10); + if ( value > 255 || value < 0 || p_start == p_stop ) + { + b_ret = EINA_FALSE; + } + + if (next) + *next = p_stop; + if (byte) + *byte = (unsigned char) value; + + return b_ret; +} + /** * @internal @@ -1332,12 +1362,11 @@ size_t remove_spaces_lowercase(const char* source,char * dest,size_t max) * 3. "#RGB" * 4. "#RGBA" * 5. "color names" + * 6. "rgb(r,g,b)" + * 7. "rgba(r,g,b,a)" * TODO (we may use specific color parser) - * 6. "rgb(RR,GG,BB)" - * 7. "rgba(RR,GG,BB,AA)" - * 8. "rgb(%R,%G,%B)" - * 9. "rgba(%R,%G,%B,%A)" - * 10."hsv(HH,SS,VV)" + * 8. "hsl(H,S,L)" + * 9. "hsla(H,S,L,A)" * To the rgba values. * * @param[in] str The string to parse - NOT NULL. @@ -1393,24 +1422,61 @@ evas_common_format_color_parse(const char *str, int slen, } else v = EINA_FALSE; } - else + else if (slen <= 21)/* search for rgb(),hsv(),colorname, 20 is length of rgba(255,255,255,255) */ { /*remove spaces and convert name to lowercase*/ char color_name[0xFF] = {0}; slen = slen - (int) remove_spaces_lowercase(str,color_name,0xFF); - static size_t color_array_length = sizeof(color_name_value_sorted)/sizeof(Color_Name_Value); - Color_Name_Value* pcolor = (Color_Name_Value*) bsearch(color_name, color_name_value_sorted, color_array_length, sizeof(Color_Name_Value),_color_name_search); - if (pcolor) + + if ((strncmp(color_name,"rgb(",4) == 0) && color_name[slen-1] == ')'&& slen >= 10 && slen <=16) /* rgb() */ { - *r = pcolor->r; - *g = pcolor->g; - *b = pcolor->b; - *a = 0xff; + char * p_color = &color_name[3]; + + if ( + (!read_byte_color_component(++p_color,&p_color,r) || !p_color || *p_color != ',') || + (!read_byte_color_component(++p_color,&p_color,g) || !p_color || *p_color != ',') || + (!read_byte_color_component(++p_color,&p_color,b) || !p_color || *p_color != ')') + ) + { + *r = *g = *b = *a = 0; + v = EINA_FALSE; + } + else + { + *a = 0xff; + } + } + else if ((strncmp(color_name,"rgba(",4) == 0) && color_name[slen-1] == ')'&& slen >= 13 && slen <=21) /* rgba() */ + { + char * p_color = &color_name[4]; + + if ( + (!read_byte_color_component(++p_color,&p_color,r) || !p_color || *p_color != ',') || + (!read_byte_color_component(++p_color,&p_color,g) || !p_color || *p_color != ',') || + (!read_byte_color_component(++p_color,&p_color,b) || !p_color || *p_color != ',') || + (!read_byte_color_component(++p_color,&p_color,a) || !p_color || *p_color != ')') + ) + { + *r = *g = *b = *a = 0; + v = EINA_FALSE; + } } else { - v = EINA_FALSE; - } + static size_t color_array_length = sizeof(color_name_value_sorted)/sizeof(Color_Name_Value); + Color_Name_Value* pcolor = (Color_Name_Value*) bsearch(color_name, color_name_value_sorted, color_array_length, sizeof(Color_Name_Value),_color_name_search); + if (pcolor) + { + *r = pcolor->r; + *g = pcolor->g; + *b = pcolor->b; + *a = 0xff; + } + else + { + v = EINA_FALSE; + } + } } if(*a != 0xFF) diff --git a/src/lib/evil/evil_mman.c b/src/lib/evil/evil_mman.c index b1bcf35bea..dbcfc31901 100644 --- a/src/lib/evil/evil_mman.c +++ b/src/lib/evil/evil_mman.c @@ -10,7 +10,6 @@ #include -#include "sys/mman.h" #include "evil_private.h" /* diff --git a/src/lib/evil/sys/mman.h b/src/lib/evil/evil_mman.h similarity index 93% rename from src/lib/evil/sys/mman.h rename to src/lib/evil/evil_mman.h index 39ebd20638..990d146058 100644 --- a/src/lib/evil/sys/mman.h +++ b/src/lib/evil/evil_mman.h @@ -3,25 +3,6 @@ #include -#ifdef EAPI -# undef EAPI -#endif - -#ifdef EFL_BUILD -# ifdef DLL_EXPORT -# define EAPI __declspec(dllexport) -# else -# define EAPI -# endif -#else -# define EAPI __declspec(dllimport) -#endif - - -#ifdef __cplusplus -extern "C" { -#endif - /** * @def PROT_NONE @@ -177,14 +158,5 @@ EAPI int munmap(void *addr, EAPI int mprotect(void *addr, size_t len, int prot); -#ifdef __cplusplus -} -#endif - - -#undef EAPI -#define EAPI - - #endif /* __EVIL_SYS_MMAN_H__ */ diff --git a/src/lib/evil/evil_private.h b/src/lib/evil/evil_private.h index a88572bf24..d87ac75423 100644 --- a/src/lib/evil/evil_private.h +++ b/src/lib/evil/evil_private.h @@ -49,6 +49,7 @@ extern "C" { #include "evil_langinfo.h" #include "evil_locale.h" #include "evil_main.h" +#include "evil_mman.h" #include "evil_stdlib.h" #include "evil_stdio.h" #include "evil_string.h" diff --git a/src/lib/evil/meson.build b/src/lib/evil/meson.build index 85978d8e9c..7877c7f914 100644 --- a/src/lib/evil/meson.build +++ b/src/lib/evil/meson.build @@ -15,9 +15,7 @@ if target_machine.system() == 'windows' 'evil_time.h', 'evil_unistd.h', 'evil_util.h', - 'dirent.h', ] - evil_header_sys_src = [join_paths('sys','mman.h')] evil_src = [ 'evil_dlfcn.c', diff --git a/src/modules/ecore_evas/engines/extn/ecore_evas_extn_engine.h b/src/modules/ecore_evas/engines/extn/ecore_evas_extn_engine.h index 511397dfdf..dd82f50293 100644 --- a/src/modules/ecore_evas/engines/extn/ecore_evas_extn_engine.h +++ b/src/modules/ecore_evas/engines/extn/ecore_evas_extn_engine.h @@ -14,9 +14,13 @@ #include #include #include -#ifdef HAVE_SYS_MMAN_H + +#ifdef _WIN32 +# include /* mmap */ +#else # include #endif + #include #include #include diff --git a/src/modules/evas/engines/software_generic/evas_native_dmabuf.c b/src/modules/evas/engines/software_generic/evas_native_dmabuf.c index c71e1b2276..e7c2e162aa 100644 --- a/src/modules/evas/engines/software_generic/evas_native_dmabuf.c +++ b/src/modules/evas/engines/software_generic/evas_native_dmabuf.c @@ -2,15 +2,17 @@ #include "evas_private.h" #include "evas_native_common.h" -#if defined HAVE_DLSYM && ! defined _WIN32 +#if defined HAVE_DLSYM # include /* dlopen,dlclose,etc */ #elif _WIN32 -# include /* dlopen dlclose dlsym */ +# include /* dlopen dlclose dlsym mmap */ #else # warning native_dmabuf should not get compiled if dlsym is not found on the system! #endif -#include +#ifndef _WIN32 +# include +#endif #define DRM_FORMAT_ARGB8888 0x34325241 #define DRM_FORMAT_XRGB8888 0x34325258 diff --git a/src/modules/evas/image_loaders/generic/evas_image_load_generic.c b/src/modules/evas/image_loaders/generic/evas_image_load_generic.c index 7d0c8e3609..94b935bc20 100644 --- a/src/modules/evas/image_loaders/generic/evas_image_load_generic.c +++ b/src/modules/evas/image_loaders/generic/evas_image_load_generic.c @@ -7,11 +7,16 @@ #include #include -#include #include #include #include +#ifdef _WIN32 +# include /* mmap */ +#else +# include +#endif + #ifndef O_BINARY # define O_BINARY 0 #endif diff --git a/src/modules/evas/image_loaders/png/evas_image_load_png.c b/src/modules/evas/image_loaders/png/evas_image_load_png.c index 1eb8b12dc8..3af01a1a2d 100644 --- a/src/modules/evas/image_loaders/png/evas_image_load_png.c +++ b/src/modules/evas/image_loaders/png/evas_image_load_png.c @@ -116,7 +116,7 @@ static Eina_Bool _evas_image_load_file_internal_head_png(Evas_Loader_Internal *loader, Evas_Image_Property *prop, Evas_PNG_Info *epi, - int *error, Eina_Bool close_file) + int *error, Eina_Bool is_for_data) { Evas_Image_Load_Opts *opts = loader->opts; Eina_File *f = loader->f; @@ -125,7 +125,10 @@ _evas_image_load_file_internal_head_png(Evas_Loader_Internal *loader, *error = EVAS_LOAD_ERROR_NONE; epi->hasa = 0; - epi->map = eina_file_map_all(f, EINA_FILE_RANDOM); + if (!is_for_data) + epi->map = eina_file_map_all(f, EINA_FILE_RANDOM); + else + epi->map = eina_file_map_all(f, EINA_FILE_SEQUENTIAL); if (!epi->map) { *error = EVAS_LOAD_ERROR_CORRUPT_FILE; @@ -216,7 +219,7 @@ _evas_image_load_file_internal_head_png(Evas_Loader_Internal *loader, if (png_get_valid(epi->png_ptr, epi->info_ptr, PNG_INFO_tRNS)) { /* expand transparency entry -> alpha channel if present */ - if (!close_file) png_set_tRNS_to_alpha(epi->png_ptr); + if (!is_for_data) png_set_tRNS_to_alpha(epi->png_ptr); epi->hasa = 1; } @@ -245,7 +248,7 @@ _evas_image_load_file_internal_head_png(Evas_Loader_Internal *loader, r = EINA_TRUE; - if (!close_file) return r; + if (!is_for_data) return r; close_file: if (epi->png_ptr) png_destroy_read_struct(&epi->png_ptr, diff --git a/src/static_libs/vg_common/vg_common_svg.c b/src/static_libs/vg_common/vg_common_svg.c index e3866e2018..5f8398d44b 100644 --- a/src/static_libs/vg_common/vg_common_svg.c +++ b/src/static_libs/vg_common/vg_common_svg.c @@ -784,6 +784,15 @@ _apply_vg_property(Svg_Node *node, Efl_VG *vg, Efl_VG *parent, Vg_File_Data *vg_ efl_gfx_shape_stroke_color_set(vg, style->stroke.paint.r, style->stroke.paint.g, style->stroke.paint.b, style->stroke.opacity); } + + //apply node opacity to stroke color + if (style->opacity < 255) + { + int r, g, b, a; + efl_gfx_shape_stroke_color_get(vg, &r, &g, &b, &a); + float fa = ((float) style->opacity / 255); + efl_gfx_shape_stroke_color_set(vg, ((float) r) * fa, ((float) g) * fa, ((float) b) * fa, ((float) a) * fa); + } } static void diff --git a/src/tests/efl_mono/Parts.cs b/src/tests/efl_mono/Parts.cs index 3de0b6c94b..00a67bae56 100644 --- a/src/tests/efl_mono/Parts.cs +++ b/src/tests/efl_mono/Parts.cs @@ -39,6 +39,19 @@ public static class TestParts } } +public static class TestMVVMParts +{ + public static void mvvm_dynamic_parts() + { + var factory = new Efl.Ui.ItemFactory(); + + var bindablePart = factory.TextPart(); + var error = bindablePart.Markup().Bind("name"); + + Test.AssertEquals(error, Eina.Error.NO_ERROR); + } +} + #endif } diff --git a/src/tests/efreet/efreet_icon_cache_dump.c b/src/tests/efreet/efreet_icon_cache_dump.c index 313c890933..a1b71eb855 100644 --- a/src/tests/efreet/efreet_icon_cache_dump.c +++ b/src/tests/efreet/efreet_icon_cache_dump.c @@ -5,7 +5,6 @@ #include #include #include -#include #include #include #include diff --git a/src/tests/elementary/efl_ui_suite.c b/src/tests/elementary/efl_ui_suite.c index a9894a0003..07f3c40b06 100644 --- a/src/tests/elementary/efl_ui_suite.c +++ b/src/tests/elementary/efl_ui_suite.c @@ -30,6 +30,7 @@ static const Efl_Test_Case etc[] = { { "efl_ui_popup", efl_ui_test_popup }, { "efl_ui_progressbar", efl_ui_test_progressbar }, { "efl_ui_radio_group", efl_ui_test_radio_group }, + { "efl_ui_scroller", efl_ui_test_scroller }, { "efl_ui_slider", efl_ui_test_slider }, { "efl_ui_win", efl_ui_test_win }, { "efl_ui_spin", efl_ui_test_spin }, diff --git a/src/tests/elementary/efl_ui_suite.h b/src/tests/elementary/efl_ui_suite.h index 3c6c708e2e..0ddf9bd62f 100644 --- a/src/tests/elementary/efl_ui_suite.h +++ b/src/tests/elementary/efl_ui_suite.h @@ -48,6 +48,7 @@ void efl_ui_test_list_container(TCase *tc); void efl_ui_test_grid_container(TCase *tc); void efl_ui_test_config(TCase *tc); void efl_ui_test_popup(TCase *tc); +void efl_ui_test_scroller(TCase *tc); void loop_timer_interval_set(Eo *obj, double in); diff --git a/src/tests/elementary/efl_ui_test_scroller.c b/src/tests/elementary/efl_ui_test_scroller.c new file mode 100644 index 0000000000..eeb9a84fd2 --- /dev/null +++ b/src/tests/elementary/efl_ui_test_scroller.c @@ -0,0 +1,150 @@ +#ifdef HAVE_CONFIG_H +# include "elementary_config.h" +#endif + +#include +#include +#include "efl_ui_suite.h" + +static void +_startstop_event_cb(void *data, const Efl_Event *ev EINA_UNUSED) +{ + int *called = data; + (*called)++; + /* start/stop always come in pairs */ + if (*called == 2) ecore_main_loop_quit(); +} + +EFL_START_TEST(efl_ui_test_scroller_events) +{ + Eo *sc, *sc2, *sc3, *bx, *bx2, *gd, *gd2; + int i, j, called = 0, called2 = 0, called3 = 0; + Eo *win = win_add(); + efl_gfx_entity_size_set(win, EINA_SIZE2D(500, 500)); + + + sc = efl_add(EFL_UI_SCROLLER_CLASS, win, + efl_event_callback_add(efl_added, EFL_UI_EVENT_SCROLL_START, _startstop_event_cb, &called), + efl_event_callback_add(efl_added, EFL_UI_EVENT_SCROLL_STOP, _startstop_event_cb, &called), + efl_gfx_entity_size_set(efl_added, EINA_SIZE2D(500, 500)) + ); + + bx = efl_add(EFL_UI_BOX_CLASS, sc, + efl_ui_layout_orientation_set(efl_added, EFL_UI_LAYOUT_ORIENTATION_VERTICAL), + efl_gfx_hint_weight_set(efl_added, EVAS_HINT_EXPAND, 0), + efl_gfx_hint_align_set(efl_added, 0.5, 0), + efl_gfx_hint_fill_set(efl_added, EINA_TRUE, EINA_FALSE), + efl_content_set(sc, efl_added)); + + efl_add(EFL_UI_SLIDER_CLASS, bx, + efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(160, 0)), + efl_pack(bx, efl_added)); + + for (i = 0; i < 3; i++) + { + efl_add(EFL_UI_BUTTON_CLASS, bx, + efl_text_set(efl_added, "Vertical"), + efl_gfx_hint_weight_set(efl_added, EVAS_HINT_EXPAND, 0.0), + efl_gfx_hint_fill_set(efl_added, EINA_TRUE, EINA_FALSE), + //efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _bt_clicked, NULL), + efl_pack(bx, efl_added)); + } + + sc2 = efl_add(EFL_UI_SCROLLER_CLASS, bx, + efl_ui_scrollable_match_content_set(efl_added, EINA_FALSE, EINA_TRUE), + efl_event_callback_add(efl_added, EFL_UI_EVENT_SCROLL_START, _startstop_event_cb, &called2), + efl_event_callback_add(efl_added, EFL_UI_EVENT_SCROLL_STOP, _startstop_event_cb, &called2), + efl_pack(bx, efl_added)); + + bx2 = efl_add(EFL_UI_BOX_CLASS, sc2, + efl_ui_layout_orientation_set(efl_added, EFL_UI_LAYOUT_ORIENTATION_HORIZONTAL), + efl_content_set(sc2, efl_added)); + + for (i = 0; i < 10; i++) + { + efl_add(EFL_UI_BUTTON_CLASS, bx2, + efl_text_set(efl_added, "... Horizontal scrolling ..."), + //efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _bt_clicked, NULL), + efl_pack(bx2, efl_added)); + } + + for (i = 0; i < 3; i++) + { + efl_add(EFL_UI_BUTTON_CLASS, bx, + efl_text_set(efl_added, "Vertical"), + efl_gfx_hint_weight_set(efl_added, EVAS_HINT_EXPAND, 0.0), + efl_gfx_hint_fill_set(efl_added, EINA_TRUE, EINA_FALSE), + //efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _bt_clicked, NULL), + efl_pack(bx, efl_added)); + } + + gd = efl_add(EFL_UI_TABLE_CLASS, bx, + efl_gfx_hint_weight_set(efl_added, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND), + efl_gfx_hint_align_set(efl_added, 0.5, 0), + efl_pack(bx, efl_added)); + + efl_add(EFL_CANVAS_RECTANGLE_CLASS, win, + efl_gfx_color_set(efl_added, 0, 0, 0, 0), + efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(200, 120)), + efl_pack_table(gd, efl_added, 0, 0, 1, 1)); + + sc3 = efl_add(EFL_UI_SCROLLER_CLASS, win, + efl_gfx_hint_weight_set(efl_added, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND), + efl_gfx_hint_fill_set(efl_added, EINA_TRUE, EINA_TRUE), + efl_event_callback_add(efl_added, EFL_UI_EVENT_SCROLL_START, _startstop_event_cb, &called3), + efl_event_callback_add(efl_added, EFL_UI_EVENT_SCROLL_STOP, _startstop_event_cb, &called3), + efl_pack_table(gd, efl_added, 0, 0, 1, 1)); + + gd2 = efl_add(EFL_UI_TABLE_CLASS, sc3, + efl_content_set(sc3, efl_added)); + + for (j = 0; j < 4; j++) + { + for (i = 0; i < 4; i++) + { + efl_add(EFL_UI_BUTTON_CLASS, win, + efl_text_set(efl_added, "Both"), + //efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _bt_clicked, NULL), + efl_pack_table(gd2, efl_added, i, j, 1, 1)); + } + } + + for (i = 0; i < 10; i++) + { + efl_add(EFL_UI_BUTTON_CLASS, bx, + efl_text_set(efl_added, "Vertical"), + efl_gfx_hint_weight_set(efl_added, EVAS_HINT_EXPAND, 0.0), + efl_gfx_hint_fill_set(efl_added, EINA_TRUE, EINA_FALSE), + //efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _bt_clicked, NULL), + efl_pack(bx, efl_added)); + } + get_me_to_those_events(sc); + /* this should only trigger the inner scroller */ + wheel_object(sc3, 0, 1); + ecore_main_loop_begin(); + ck_assert_int_eq(called3, 2); + ck_assert_int_eq(called2, 0); + ck_assert_int_eq(called, 0); + called3 = 0; + + /* this should only trigger the horizontal scroller */ + wheel_object(sc2, 1, 1); + ecore_main_loop_begin(); + ck_assert_int_eq(called3, 0); + ck_assert_int_eq(called2, 2); + ck_assert_int_eq(called, 0); + called2 = 0; + + /* this should only trigger the outer scroller */ + wheel_object_at(sc, 250, 400, 0, 1); + ecore_main_loop_begin(); + ck_assert_int_eq(called3, 0); + ck_assert_int_eq(called2, 0); + ck_assert_int_eq(called, 2); +} +EFL_END_TEST + +void efl_ui_test_scroller(TCase *tc) +{ + tcase_add_test(tc, efl_ui_test_scroller_events); +} diff --git a/src/tests/elementary/meson.build b/src/tests/elementary/meson.build index dff90e788b..5204c6473a 100644 --- a/src/tests/elementary/meson.build +++ b/src/tests/elementary/meson.build @@ -153,6 +153,7 @@ efl_ui_suite_src = [ 'efl_ui_test_grid_collection.c', 'efl_ui_test_position_manager_common.c', 'efl_ui_test_popup.c', + 'efl_ui_test_scroller.c', ] efl_ui_suite = executable('efl_ui_suite', diff --git a/src/tests/elementary/suite_helpers.c b/src/tests/elementary/suite_helpers.c index 44c34e58ae..5c89446a47 100644 --- a/src/tests/elementary/suite_helpers.c +++ b/src/tests/elementary/suite_helpers.c @@ -400,11 +400,10 @@ enum BOTTOM = 1 << 3, }; -static void -click_object_internal(Eo *obj, int dir) +static Eina_Position2D +attempt_to_find_the_right_point_for_mouse_positioning(Eo *obj, int dir) { int x, y; - Evas *e = evas_object_evas_get(obj); Eina_Rect r = efl_gfx_entity_geometry_get(obj); if (dir & LEFT) x = r.x + (.1 * r.w); @@ -418,7 +417,15 @@ click_object_internal(Eo *obj, int dir) y = r.y + (.9 * r.h); else y = r.y + r.h / 2; - evas_event_feed_mouse_move(e, x, y, 0, NULL); + return EINA_POSITION2D(x, y); +} + +static void +click_object_internal(Eo *obj, int dir) +{ + Evas *e = evas_object_evas_get(obj); + Eina_Position2D pos = attempt_to_find_the_right_point_for_mouse_positioning(obj, dir); + evas_event_feed_mouse_move(e, pos.x, pos.y, 0, NULL); evas_event_feed_mouse_down(e, 1, 0, 0, NULL); evas_event_feed_mouse_up(e, 1, 0, 0, NULL); } @@ -457,6 +464,47 @@ click_part(Eo *obj, const char *part) efl_unref(part_obj); } +static void +wheel_object_internal(Eo *obj, int dir, Eina_Bool horiz, Eina_Bool down) +{ + Eina_Position2D pos = attempt_to_find_the_right_point_for_mouse_positioning(obj, dir); + wheel_object_at(obj, pos.x, pos.y, horiz, down); +} + +void +wheel_object(Eo *obj, Eina_Bool horiz, Eina_Bool down) +{ + wheel_object_internal(obj, NONE, horiz, down); +} + +void +wheel_part(Eo *obj, const char *part, Eina_Bool horiz, Eina_Bool down) +{ + Efl_Part *part_obj = efl_ref(efl_part(obj, part)); + Eo *content; + int dir = 0; + + if (efl_canvas_layout_part_type_get(part_obj) == EFL_CANVAS_LAYOUT_PART_TYPE_SWALLOW) + content = efl_content_get(part_obj); + else + { + content = part_obj; + if (strstr(part, "left")) + dir |= LEFT; + else if (strstr(part, "right")) + dir |= RIGHT; + if (strstr(part, "top")) + dir |= TOP; + else if (strstr(part, "bottom")) + dir |= BOTTOM; + } + wheel_object_internal(content, dir, horiz, down); + if (efl_isa(content, EFL_LAYOUT_SIGNAL_INTERFACE)) + edje_object_message_signal_process(content); + edje_object_message_signal_process(obj); + efl_unref(part_obj); +} + void event_callback_that_is_called_exactly_one_time_and_sets_a_single_int_data_pointer_when_called(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) { @@ -480,3 +528,11 @@ click_object_at(Eo *obj, int x, int y) evas_event_feed_mouse_down(e, 1, 0, 0, NULL); evas_event_feed_mouse_up(e, 1, 0, 0, NULL); } + +void +wheel_object_at(Eo *obj, int x, int y, Eina_Bool horiz, Eina_Bool down) +{ + Evas *e = evas_object_evas_get(obj); + evas_event_feed_mouse_move(e, x, y, 0, NULL); + evas_event_feed_mouse_wheel(e, horiz, down, 0, NULL); +} diff --git a/src/tests/elementary/suite_helpers.h b/src/tests/elementary/suite_helpers.h index a063869f2b..26cadf1c79 100644 --- a/src/tests/elementary/suite_helpers.h +++ b/src/tests/elementary/suite_helpers.h @@ -14,6 +14,9 @@ void get_me_to_those_events(Eo *obj); void click_object(Eo *obj); void click_part(Eo *obj, const char *part); void click_object_at(Eo *obj, int x, int y); +void wheel_object(Eo *obj, Eina_Bool horiz, Eina_Bool down); +void wheel_part(Eo *obj, const char *part, Eina_Bool horiz, Eina_Bool down); +void wheel_object_at(Eo *obj, int x, int y, Eina_Bool horiz, Eina_Bool down); void event_callback_that_is_called_exactly_one_time_and_sets_a_single_int_data_pointer_when_called(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED); void event_callback_that_quits_the_main_loop_when_called(); #endif diff --git a/src/tests/evas/evas_test_textblock.c b/src/tests/evas/evas_test_textblock.c index ef81ae3172..f61574c065 100644 --- a/src/tests/evas/evas_test_textblock.c +++ b/src/tests/evas/evas_test_textblock.c @@ -4654,6 +4654,29 @@ EFL_START_TEST(efl_canvas_text_markup) } EFL_END_TEST +EFL_START_TEST(efl_canvas_text_markup_invalid_escape) +{ + START_EFL_CANVAS_TEXT_TEST(); + + char * text1 = "Hello"; + char * text2 = "Hello&123"; + char * text3 = "Hello&123&456"; + Evas_Coord fw1, fw2, fw3; + + efl_text_markup_set(txt,text1); + efl_canvas_text_size_native_get(txt, &fw1, NULL); + efl_text_markup_set(txt,text2); + efl_canvas_text_size_native_get(txt, &fw2, NULL); + fail_if(fw2 <= fw1); + efl_text_markup_set(txt,text3); + efl_canvas_text_size_native_get(txt, &fw3, NULL); + fail_if(fw3 <= fw2); + + END_EFL_CANVAS_TEXT_TEST(); +} +EFL_END_TEST + + EFL_START_TEST(efl_text_font) { START_EFL_CANVAS_TEXT_TEST(); @@ -4715,6 +4738,7 @@ void evas_test_textblock(TCase *tc) tcase_add_test(tc, efl_text); tcase_add_test(tc, efl_canvas_text_cursor); tcase_add_test(tc, efl_canvas_text_markup); + tcase_add_test(tc, efl_canvas_text_markup_invalid_escape); tcase_add_test(tc, efl_text_font); }