aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHermet Park <hermetpark@gmail.com>2019-04-24 11:30:54 +0900
committerHermet Park <hermetpark@gmail.com>2019-04-24 11:30:54 +0900
commitf954a2315efb1acec4f32e7e482d137ce419a290 (patch)
treeb82df01d060cef4a5ce71c639bd58ca478b95228
parentefl_ui_animation_view: Fix cmake build error (diff)
parentevas wbmp loader: coming previous patch with fixing wrong calc. (diff)
downloadefl-devs/hermet/lottie.tar.gz
Merge branch 'master' into devs/hermet/lottiedevs/hermet/lottie
-rw-r--r--doc/docfx/default_efl/partials/class.header.tmpl.partial4
-rw-r--r--doc/docfx/default_efl/partials/title.tmpl.partial43
-rw-r--r--doc/docfx/filterConfig.yml2
-rwxr-xr-xdoc/docfx/gendoc.sh14
-rw-r--r--meson.build29
-rwxr-xr-xmeson/meson_csharp_docs.sh2
-rw-r--r--src/Makefile_Evas.am3
-rw-r--r--src/bin/eolian_mono/eolian/mono/alias_definition.hh9
-rw-r--r--src/bin/eolian_mono/eolian/mono/async_function_definition.hh4
-rw-r--r--src/bin/eolian_mono/eolian/mono/documentation.hh14
-rw-r--r--src/bin/eolian_mono/eolian/mono/enum_definition.hh2
-rw-r--r--src/bin/eolian_mono/eolian/mono/function_definition.hh77
-rw-r--r--src/bin/eolian_mono/eolian/mono/function_registration.hh27
-rw-r--r--src/bin/eolian_mono/eolian/mono/klass.hh206
-rw-r--r--src/bin/eolian_mono/eolian/mono/marshall_annotation.hh44
-rw-r--r--src/bin/eolian_mono/eolian/mono/name_helpers.hh37
-rw-r--r--src/bin/eolian_mono/eolian/mono/parameter.hh17
-rw-r--r--src/bin/eolian_mono/eolian/mono/part_definition.hh2
-rw-r--r--src/bin/eolian_mono/eolian/mono/struct_fields.hh2
-rw-r--r--src/bin/eolian_mono/eolian/mono/variable_definition.hh2
-rw-r--r--src/examples/elementary/efl_ui_list_view_example_1.c2
-rw-r--r--src/examples/elementary/efl_ui_list_view_example_2.c2
-rw-r--r--src/examples/elementary/efl_ui_list_view_example_3.c4
-rw-r--r--src/lib/ecore/ecore_events.c105
-rw-r--r--src/lib/ecore/ecore_private.h2
-rw-r--r--src/lib/ecore/efl_boolean_model.c117
-rw-r--r--src/lib/ecore/efl_boolean_model.eo8
-rw-r--r--src/lib/ecore/efl_core_command_line.c5
-rw-r--r--src/lib/ecore/efl_loop_model.c27
-rw-r--r--src/lib/ecore/efl_loop_model.eo1
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_input.c2
-rw-r--r--src/lib/edje/edje_calc.c35
-rw-r--r--src/lib/edje/edje_private.h6
-rw-r--r--src/lib/eio/efl_io_model.c12
-rw-r--r--src/lib/elementary/efl_ui_layout.c7
-rw-r--r--src/lib/elementary/efl_ui_panel.c36
-rw-r--r--src/lib/elementary/efl_ui_popup.c2
-rw-r--r--src/lib/elementary/efl_ui_relative_layout.c10
-rw-r--r--src/lib/elementary/efl_ui_scroller.c21
-rw-r--r--src/lib/elementary/efl_ui_tab_page.c22
-rw-r--r--src/lib/elementary/efl_ui_table.c729
-rw-r--r--src/lib/elementary/efl_ui_table.eo3
-rw-r--r--src/lib/elementary/efl_ui_table_layout.c18
-rw-r--r--src/lib/elementary/efl_ui_table_private.h13
-rw-r--r--src/lib/elementary/efl_ui_widget.c319
-rw-r--r--src/lib/elementary/efl_ui_win.c2
-rw-r--r--src/lib/elementary/elc_fileselector.c2
-rw-r--r--src/lib/elementary/elc_fileselector_button.c3
-rw-r--r--src/lib/elementary/elc_fileselector_entry.c29
-rw-r--r--src/lib/elementary/elc_hoversel.c2
-rw-r--r--src/lib/elementary/elm_atspi_bridge.c6
-rw-r--r--src/lib/elementary/elm_main.c17
-rw-r--r--src/lib/elementary/elm_part_helper.h23
-rw-r--r--src/lib/elementary/elm_priv.h2
-rw-r--r--src/lib/elput/elput_logind.c1
-rw-r--r--src/lib/evas/meson.build25
-rw-r--r--src/lib/evas/software_generic/filters/meson.build (renamed from src/modules/evas/engines/software_generic/filters/meson.build)10
-rw-r--r--src/lib/evas/software_generic/meson.build36
-rw-r--r--src/modules/ecore_evas/engines/extn/meson.build2
-rw-r--r--src/modules/ecore_imf/ibus/meson.build2
-rw-r--r--src/modules/ecore_imf/scim/meson.build2
-rw-r--r--src/modules/ecore_imf/xim/meson.build2
-rw-r--r--src/modules/evas/engines/buffer/meson.build4
-rw-r--r--src/modules/evas/engines/drm/meson.build4
-rw-r--r--src/modules/evas/engines/fb/meson.build4
-rw-r--r--src/modules/evas/engines/gl_cocoa/meson.build4
-rw-r--r--src/modules/evas/engines/gl_common/meson.build45
-rw-r--r--src/modules/evas/engines/gl_drm/meson.build4
-rw-r--r--src/modules/evas/engines/gl_generic/meson.build41
-rw-r--r--src/modules/evas/engines/gl_x11/meson.build4
-rw-r--r--src/modules/evas/engines/meson.build72
-rw-r--r--src/modules/evas/engines/software_ddraw/meson.build4
-rw-r--r--src/modules/evas/engines/software_gdi/meson.build4
-rw-r--r--src/modules/evas/engines/software_generic/meson.build45
-rw-r--r--src/modules/evas/engines/software_x11/meson.build4
-rw-r--r--src/modules/evas/engines/wayland_egl/meson.build4
-rw-r--r--src/modules/evas/engines/wayland_shm/meson.build4
-rw-r--r--src/modules/evas/image_loaders/wbmp/evas_image_load_wbmp.c21
-rw-r--r--src/modules/evas/meson.build95
-rw-r--r--src/tests/efl_mono/dummy_test_object.eo1
-rw-r--r--src/tests/efl_mono/libefl_mono_native_test.c37
-rw-r--r--src/tests/elementary/efl_ui_test_table.c152
-rw-r--r--src/tests/elementary/spec/efl_test_content.c114
-rw-r--r--src/tests/elementary/spec/efl_ui_spec_suite.c1
-rw-r--r--src/tests/elementary/spec/efl_ui_spec_suite.h2
-rwxr-xr-xsrc/tests/elementary/spec/generator.py4
-rw-r--r--src/tests/elementary/spec/meson.build1
87 files changed, 1604 insertions, 1285 deletions
diff --git a/doc/docfx/default_efl/partials/class.header.tmpl.partial b/doc/docfx/default_efl/partials/class.header.tmpl.partial
index 1a445ab3ca..561d929da1 100644
--- a/doc/docfx/default_efl/partials/class.header.tmpl.partial
+++ b/doc/docfx/default_efl/partials/class.header.tmpl.partial
@@ -12,15 +12,13 @@
{{/inheritance}}
<div class="level{{level}}"><span class="xref"><b>{{fullName.0.value}}</b></span></div>
{{#derivedClasses}}
- <div class="level{{index}}">{{{specName.0.value}}}</div>
+ <div class="level{{index}}"><xref uid="{{uid}}" text="{{fullName.0.value}}"/></div>
{{/derivedClasses}}
</div>
</div>
{{/inClass}}
{{#inheritedMembers.0}}
-<h6><strong>{{__global.namespace}}</strong>: {{{namespace.specName.0.value}}}</h6>
-<h6><strong>{{__global.assembly}}</strong>: {{assemblies.0}}.dll</h6>
<h5 id="{{id}}_syntax">{{__global.syntax}}</h5>
<div class="codewrapper">
<pre><code class="lang-{{_lang}} hljs">{{syntax.content.0.value}}</code></pre>
diff --git a/doc/docfx/default_efl/partials/title.tmpl.partial b/doc/docfx/default_efl/partials/title.tmpl.partial
new file mode 100644
index 0000000000..186d9171d3
--- /dev/null
+++ b/doc/docfx/default_efl/partials/title.tmpl.partial
@@ -0,0 +1,43 @@
+{{!Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See LICENSE file in the project root for full license information.}}
+{{#isNamespace}}
+Namespace {{fullName.0.value}}
+{{/isNamespace}}
+{{#inClass}}
+Class {{fullName.0.value}}
+{{/inClass}}
+{{#inStruct}}
+Struct {{fullName.0.value}}
+{{/inStruct}}
+{{#inInterface}}
+Interface {{fullName.0.value}}
+{{/inInterface}}
+{{#inEnum}}
+Enum {{fullName.0.value}}
+{{/inEnum}}
+{{#inDelegate}}
+Delegate {{fullName.0.value}}
+{{/inDelegate}}
+{{#inConstructor}}
+Constructor {{fullName.0.value}}
+{{/inConstructor}}
+{{#inField}}
+Field {{fullName.0.value}}
+{{/inField}}
+{{#inProperty}}
+Property {{fullName.0.value}}
+{{/inProperty}}
+{{#inMethod}}
+Method {{fullName.0.value}}
+{{/inMethod}}
+{{#inEvent}}
+Event {{fullName.0.value}}
+{{/inEvent}}
+{{#inOperator}}
+Operator {{fullName.0.value}}
+{{/inOperator}}
+{{#inEii}}
+Explict Interface Implementation {{fullName.0.value}}
+{{/inEii}}
+{{#inPackage}}
+Package {{fullName.0.value}}
+{{/inPackage}}
diff --git a/doc/docfx/filterConfig.yml b/doc/docfx/filterConfig.yml
index d6ddf9d5b4..87d52fac80 100644
--- a/doc/docfx/filterConfig.yml
+++ b/doc/docfx/filterConfig.yml
@@ -1,6 +1,6 @@
apiRules:
- exclude:
- uidRegex: ^.*NativeInherit$
+ uidRegex: ^.*NativeMethods$
- exclude:
uidRegex: ^.*NativeStruct$
- include:
diff --git a/doc/docfx/gendoc.sh b/doc/docfx/gendoc.sh
index 99da2d9f18..48d781cd81 100755
--- a/doc/docfx/gendoc.sh
+++ b/doc/docfx/gendoc.sh
@@ -22,5 +22,19 @@ for f in `ls api/*.yml`; do
sed -e 's/\(<xref href=\\"[^\\]*\)\\"/\1?displayProperty=fullName\\"/g' -i $f
done;
+# Add missing references to derived classes, so they can be rendered with
+# their full name.
+# https://github.com/dotnet/docfx/issues/3769#issuecomment-485616064
+for f in `grep -l derivedClasses api/*.yml`; do
+ sed "1,/^ derivedClasses:$/d" $f > /tmp/efl_docfx_gendoc
+ sed -i "/^ [^-]/,$ d" /tmp/efl_docfx_gendoc
+ sed -i "/^[^ ]/,$ d" /tmp/efl_docfx_gendoc
+ while read dash class
+ do
+ sed -i "s/^references:$/references:\n- uid: $class\n fullName: $class/g" $f
+ done <<< "$(cat /tmp/efl_docfx_gendoc)"
+done;
+rm -rf /tmp/efl_docfx_gendoc
+
# DocFX Step 2: Generate HTML files
mono bin/docfx.exe build docfx.json && echo "Docs ready in the _site folder!"
diff --git a/meson.build b/meson.build
index 1ee603192a..9af4f86505 100644
--- a/meson.build
+++ b/meson.build
@@ -248,6 +248,27 @@ boot_strap_eolian = [
['eolian' ,[] , false, true, true, false, false, false, ['eina'], []],
]
+evas_lib = ['evas' ,[], false, true, false, false, true, true, ['eina', 'efl', 'eo'], ['vg_common', 'libunibreak']]
+evas_img_modules = ['evas' ,[], true, false, false, false, false, false, ['eina', 'efl', 'eo'], ['vg_common', 'libunibreak']]
+evas_engines = [join_paths('evas', 'engines'),[], true, false, false, false, false, false, [], []]
+evas_goal = ['evas_goal' ,[], false, true, false, false, false, false, ['eina', 'efl', 'eo'], []]
+
+if get_option('evas-modules') == 'static'
+ evas_settings = [
+ evas_lib,
+ evas_img_modules,
+ evas_engines,
+ evas_goal,
+ ]
+else
+ evas_settings = [
+ evas_lib,
+ evas_img_modules,
+ evas_goal,
+ evas_engines,
+ ]
+endif
+
subprojects = [
# name | option | mod | lib | bin | bench | tests | examples | pkg-config options | name of static libs
['evil' ,[] , false, true, false, false, false, false, [], []],
@@ -275,9 +296,7 @@ subprojects = [
['ector' ,[] , false, true, false, false, true, false, ['eina', 'efl'], ['draw', 'triangulator', 'freetype']],
['elput' ,['drm'] , false, true, false, false, true, false, ['eina', 'eldbus'], []],
['ecore_drm2' ,['drm'] , false, true, false, false, false, false, ['ecore'], ['libdrm']],
-['ecore_cocoa' ,['cocoa'] , false, true, false, false, false, false, ['eina'], []],
-['evas' ,[] , true, true, false, false, true, true, ['eina', 'efl', 'eo'], ['vg_common', 'libunibreak']],
-['evas_goal' ,[] , false, true, false, false, false, false, ['eina', 'efl', 'eo'], []],
+['ecore_cocoa' ,['cocoa'] , false, true, false, false, false, false, ['eina'], []]] + evas_settings +[
['ecore_input_evas' ,[] , false, true, false, false, false, false, ['eina', 'evas'], []],
['ecore_evas' ,[] , true, true, true, false, false, false, ['evas', 'ector'], []],
['ecore_imf' ,[] , true, true, false, false, false, false, ['eina'], []],
@@ -323,7 +342,7 @@ foreach package : subprojects
]
automatic_pkgfile = true
if package[1].length() == 0 or get_option(package[1][0])
- config_h.set('HAVE_'+package_name.to_upper(), '1')
+ config_h.set('HAVE_'+package_name.to_upper().underscorify(), '1')
dir_package_include = join_paths(dir_include, package_version_name)
dir_package_modules = join_paths(dir_lib, package_name, 'modules')
@@ -376,7 +395,7 @@ foreach package : subprojects
example_dirs += [package_name]
endif
- set_variable('build_'+package_name, true)
+ set_variable('build_'+package_name.underscorify(), true)
# generate automatic pc files for libraries
if automatic_pkgfile == true and package[3]
diff --git a/meson/meson_csharp_docs.sh b/meson/meson_csharp_docs.sh
index 4e6577a173..ea0a000328 100755
--- a/meson/meson_csharp_docs.sh
+++ b/meson/meson_csharp_docs.sh
@@ -4,4 +4,4 @@
# as meson's library() call can't track files other than the generated
# efl_mono.dll
-cp $1 $2
+cp "$1" "$DESTDIR$2"
diff --git a/src/Makefile_Evas.am b/src/Makefile_Evas.am
index ea84cd2546..84e7115c65 100644
--- a/src/Makefile_Evas.am
+++ b/src/Makefile_Evas.am
@@ -588,6 +588,7 @@ lib/evas/common/evas_map_image_internal.c \
lib/evas/common/evas_map_image_core.c \
lib/evas/common/evas_map_image_loop.c \
lib/evas/common/evas_map_image_aa.c \
+lib/evas/common/evas_map_image_internal_high.c \
lib/evas/common/evas_scale_smooth_scaler.c \
lib/evas/common/evas_scale_smooth_scaler_down.c \
lib/evas/common/evas_scale_smooth_scaler_downx.c \
@@ -2237,6 +2238,7 @@ modules_evas_image_loaders_tgv_module_la_CPPFLAGS = \
-I$(top_builddir)/src/lib/efl \
-I$(top_srcdir)/src/static_libs/rg_etc \
-I$(top_srcdir)/src/lib/evas/ \
+-I$(top_srcdir)/src/lib/evas/include \
-DEFL_BUILD \
@EVAS_CFLAGS@ \
@NEON_CFLAGS@
@@ -2274,6 +2276,7 @@ modules_evas_image_savers_tgv_module_la_CPPFLAGS = \
-I$(top_builddir)/src/lib/efl \
-I$(top_srcdir)/src/static_libs/rg_etc \
-I$(top_srcdir)/src/lib/evas/ \
+-I$(top_srcdir)/src/lib/evas/include \
-DEFL_BUILD \
@EVAS_CFLAGS@
diff --git a/src/bin/eolian_mono/eolian/mono/alias_definition.hh b/src/bin/eolian_mono/eolian/mono/alias_definition.hh
index cf9d3495ce..f9c7f435ca 100644
--- a/src/bin/eolian_mono/eolian/mono/alias_definition.hh
+++ b/src/bin/eolian_mono/eolian/mono/alias_definition.hh
@@ -35,17 +35,18 @@ struct alias_definition_generator
std::string const alias_name = utils::remove_all(alias.eolian_name, '_');
if (!as_generator(
- "public struct " << alias_name << " {\n"
+ "public struct " << alias_name << "\n"
+ << "{\n"
<< scope_tab << "private " << type << " payload;\n"
<< scope_tab << "public static implicit operator " << alias_name << "(" << type << " x)\n"
<< scope_tab << "{\n"
<< scope_tab << scope_tab << "return new " << alias_name << "{payload=x};\n"
- << scope_tab << "}\n"
+ << scope_tab << "}\n\n"
<< scope_tab << "public static implicit operator " << type << "(" << alias_name << " x)\n"
<< scope_tab << "{\n"
<< scope_tab << scope_tab << "return x.payload;\n"
- << scope_tab << "}\n"
- << "}\n"
+ << scope_tab << "}\n\n"
+ << "}\n\n"
).generate(sink, std::make_tuple(alias.base_type, alias.base_type, alias.base_type), context))
return false;
diff --git a/src/bin/eolian_mono/eolian/mono/async_function_definition.hh b/src/bin/eolian_mono/eolian/mono/async_function_definition.hh
index 5164311ee7..f6a3ff5dc2 100644
--- a/src/bin/eolian_mono/eolian/mono/async_function_definition.hh
+++ b/src/bin/eolian_mono/eolian/mono/async_function_definition.hh
@@ -55,7 +55,7 @@ struct async_function_declaration_generator
if (!as_generator(
scope_tab << "System.Threading.Tasks.Task<Eina.Value> " << name_helpers::managed_async_method_name(f) << "(" << *(parameter << ",") <<
- " System.Threading.CancellationToken token=default(System.Threading.CancellationToken));\n"
+ " System.Threading.CancellationToken token = default(System.Threading.CancellationToken));\n"
).generate(sink, f.parameters, context))
return false;
@@ -89,7 +89,7 @@ struct async_function_definition_generator
std::transform(f.parameters.begin(), f.parameters.end(), std::back_inserter(param_forwarding), parameter_forwarding);
if(!as_generator(
- scope_tab << "public System.Threading.Tasks.Task<Eina.Value> " << name_helpers::managed_async_method_name(f) << "(" << *(parameter << ",") << " System.Threading.CancellationToken token=default(System.Threading.CancellationToken))\n"
+ scope_tab << "public System.Threading.Tasks.Task<Eina.Value> " << name_helpers::managed_async_method_name(f) << "(" << *(parameter << ",") << " System.Threading.CancellationToken token = default(System.Threading.CancellationToken))\n"
<< scope_tab << "{\n"
<< scope_tab << scope_tab << "Eina.Future future = " << name_helpers::managed_method_name(f) << "(" << (string % ",") << ");\n"
<< scope_tab << scope_tab << "return Efl.Eo.Globals.WrapAsync(future, token);\n"
diff --git a/src/bin/eolian_mono/eolian/mono/documentation.hh b/src/bin/eolian_mono/eolian/mono/documentation.hh
index 9646fd314f..ac072a4220 100644
--- a/src/bin/eolian_mono/eolian/mono/documentation.hh
+++ b/src/bin/eolian_mono/eolian/mono/documentation.hh
@@ -74,8 +74,7 @@ struct documentation_generator
if (blacklist::is_function_blacklisted(
::eolian_function_full_c_name_get(function, ftype))) return "";
name += ".";
- name += name_helpers::managed_method_name(
- ::eolian_object_short_name_get(klass), eo_name);
+ name += name_helpers::managed_method_name({function, ftype, NULL, eolian_object_unit_get(EOLIAN_OBJECT(function))});
break;
case ::EOLIAN_PROP_SET:
name += ".Set";
@@ -118,7 +117,7 @@ struct documentation_generator
case attributes::function_type::prop_get:
if (blacklist::is_function_blacklisted(func.c_name))return "";
if (!name.empty()) name += ".";
- name += name_helpers::managed_method_name(func.klass.eolian_name, func.name);
+ name += name_helpers::managed_method_name(func);
break;
default:
// No need to deal with property as function_defs are converted to get/set when building a given klass_def.
@@ -285,6 +284,9 @@ struct documentation_generator
template<typename OutputIterator, typename Context>
bool generate_tag(OutputIterator sink, std::string const& tag, std::string const &text, Context const& context, std::string tag_params = "") const
{
+ if (text == "")
+ return true;
+
if (!as_generator(scope_tab(scope_size) << "/// ").generate(sink, attributes::unused, context)) return false;
if (!generate_opening_tag(sink, tag, context, tag_params)) return false;
if (!generate_escaped_content(sink, text, context)) return false;
@@ -429,7 +431,7 @@ struct documentation_generator
return generate_all_tag_examples(sink,
name_helpers::klass_full_concrete_or_interface_name(func.klass),
- name_helpers::managed_method_name(func.klass.eolian_name, func.name),
+ name_helpers::managed_method_name(func),
context);
}
@@ -448,7 +450,7 @@ struct documentation_generator
return generate_all_tag_examples(sink,
name_helpers::klass_full_concrete_or_interface_name(func.klass),
- name_helpers::managed_method_name(func.klass.eolian_name, func.name),
+ name_helpers::managed_method_name(func),
context);
}
@@ -485,7 +487,7 @@ struct documentation_generator
for (auto &&param : ctor.function.parameters)
{
if (!as_generator(
- scope_tab << "///<param name=\"" << constructor_parameter_name(ctor) << "\">" << summary << " See <see cref=\"" << function_conversion(func) << "\"/></param>\n"
+ scope_tab << "/// <param name=\"" << constructor_parameter_name(ctor) << "\">" << summary << " See <see cref=\"" << function_conversion(func) << "\"/></param>\n"
).generate(sink, param, context))
return false;
}
diff --git a/src/bin/eolian_mono/eolian/mono/enum_definition.hh b/src/bin/eolian_mono/eolian/mono/enum_definition.hh
index 78af78af2c..922463936e 100644
--- a/src/bin/eolian_mono/eolian/mono/enum_definition.hh
+++ b/src/bin/eolian_mono/eolian/mono/enum_definition.hh
@@ -44,7 +44,7 @@ struct enum_definition_generator
return false;
}
- if(!as_generator("}\n").generate(sink, attributes::unused, context)) return false;
+ if(!as_generator("}\n\n").generate(sink, attributes::unused, context)) return false;
if(!name_helpers::close_namespaces(sink, enum_.namespaces, context))
return false;
diff --git a/src/bin/eolian_mono/eolian/mono/function_definition.hh b/src/bin/eolian_mono/eolian/mono/function_definition.hh
index 23025480c0..0dbd097f1d 100644
--- a/src/bin/eolian_mono/eolian/mono/function_definition.hh
+++ b/src/bin/eolian_mono/eolian/mono/function_definition.hh
@@ -34,12 +34,14 @@ struct native_function_definition_generator
EINA_CXX_DOM_LOG_DBG(eolian_mono::domain) << "native_function_definition_generator: " << f.c_name << std::endl;
if(blacklist::is_function_blacklisted(f, context))
return true;
- else
- {
+
+ auto const& indent = current_indentation(context);
+
+ // Delegate for the C# method we will export to EO as a method implementation.
if(!as_generator
- ("\n\n" << scope_tab
- << eolian_mono::marshall_annotation(true)
- << " private delegate "
+ (
+ indent << eolian_mono::marshall_annotation(true) << "\n"
+ << indent << "private delegate "
<< eolian_mono::marshall_type(true)
<< " "
<< string
@@ -49,14 +51,15 @@ struct native_function_definition_generator
(
(marshall_annotation << " " << marshall_parameter)
) % ", ")
- << ");\n")
+ << ");\n\n")
.generate(sink, std::make_tuple(f.return_type, f.return_type, f.c_name, f.parameters), context))
return false;
+ // API delegate is the wrapper for the Eo methods exported from C that we will use from C#.
if(!as_generator
- ("\n\n" << scope_tab
- << eolian_mono::marshall_annotation(true)
- << " public delegate "
+ (
+ indent << eolian_mono::marshall_annotation(true) << "\n"
+ << indent << "public delegate "
<< eolian_mono::marshall_type(true)
<< " "
<< string << "_api_delegate(" << (f.is_static ? "" : "System.IntPtr obj")
@@ -65,17 +68,18 @@ struct native_function_definition_generator
(
(marshall_annotation << " " << marshall_parameter)
) % ", ")
- << ");\n")
+ << ");\n\n")
.generate(sink, std::make_tuple(f.return_type, f.return_type, f.c_name, f.parameters), context))
return false;
+ // Delegate holder (so it can't be collected).
if(!as_generator
- (scope_tab
- << " public static Efl.Eo.FunctionWrapper<" << string << "_api_delegate> " << string << "_ptr = new Efl.Eo.FunctionWrapper<"
- << string << "_api_delegate>(_Module, \"" << string << "\");\n")
+ (indent << "public static Efl.Eo.FunctionWrapper<" << string << "_api_delegate> " << string << "_ptr = new Efl.Eo.FunctionWrapper<"
+ << string << "_api_delegate>(Module, \"" << string << "\");\n\n")
.generate(sink, std::make_tuple(f.c_name, f.c_name, f.c_name, f.c_name), context))
return false;
+ // Actual method implementation to be called from C.
std::string return_type;
if(!as_generator(eolian_mono::type(true)).generate(std::back_inserter(return_type), f.return_type, context))
return false;
@@ -92,34 +96,37 @@ struct native_function_definition_generator
self = "";
if(!as_generator
- (scope_tab
- << " private static "
+ (indent << "private static "
<< eolian_mono::marshall_type(true) << " "
<< string
<< "(System.IntPtr obj, System.IntPtr pd"
<< *(", " << marshall_parameter)
<< ")\n"
- << scope_tab << "{\n"
- /****/
- << scope_tab << scope_tab << "Eina.Log.Debug(\"function " << string << " was called\");\n"
- /****/
- << scope_tab << scope_tab << "Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);\n"
- << scope_tab << scope_tab << "if(wrapper != null) {\n"
- << scope_tab << scope_tab << scope_tab << eolian_mono::native_function_definition_preamble()
- << scope_tab << scope_tab << scope_tab << "try {\n"
- << scope_tab << scope_tab << scope_tab << scope_tab << (return_type != "void" ? "_ret_var = " : "")
+ << indent << "{\n"
+ << indent << scope_tab << "Eina.Log.Debug(\"function " << string << " was called\");\n"
+ << indent << scope_tab << "Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);\n"
+ << indent << scope_tab << "if (wrapper != null)\n"
+ << indent << scope_tab << "{\n"
+ << eolian_mono::native_function_definition_preamble()
+ << indent << scope_tab << scope_tab << "try\n"
+ << indent << scope_tab << scope_tab << "{\n"
+ << indent << scope_tab << scope_tab << scope_tab << (return_type != "void" ? "_ret_var = " : "")
<< (f.is_static ? "" : "((") << klass_cast_name << (f.is_static ? "." : ")wrapper).") << string
<< "(" << (native_argument_invocation % ", ") << ");\n"
- << scope_tab << scope_tab << scope_tab << "} catch (Exception e) {\n"
- << scope_tab << scope_tab << scope_tab << scope_tab << "Eina.Log.Warning($\"Callback error: {e.ToString()}\");\n"
- << scope_tab << scope_tab << scope_tab << scope_tab << "Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);\n"
- << scope_tab << scope_tab << scope_tab << "}\n"
- << eolian_mono::native_function_definition_epilogue(*klass)
- << scope_tab << scope_tab << "} else {\n"
- << scope_tab << scope_tab << scope_tab << (return_type != "void" ? "return " : "") << string
+ << indent << scope_tab << scope_tab << "}\n"
+ << indent << scope_tab << scope_tab << "catch (Exception e)\n"
+ << indent << scope_tab << scope_tab << "{\n"
+ << indent << scope_tab << scope_tab << scope_tab << "Eina.Log.Warning($\"Callback error: {e.ToString()}\");\n"
+ << indent << scope_tab << scope_tab << scope_tab << "Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);\n"
+ << indent << scope_tab << scope_tab << "}\n\n"
+ << eolian_mono::native_function_definition_epilogue(*klass) << "\n"
+ << indent << scope_tab << "}\n"
+ << indent << scope_tab << "else\n"
+ << indent << scope_tab << "{\n"
+ << indent << scope_tab << scope_tab << (return_type != "void" ? "return " : "") << string
<< "_ptr.Value.Delegate(" << self << ((!f.is_static && f.parameters.size() > 0) ? ", " : "") << (argument % ", ") << ");\n"
- << scope_tab << scope_tab << "}\n"
- << scope_tab << "}\n"
+ << indent << scope_tab << "}\n"
+ << indent << "}\n\n"
)
.generate(sink, std::make_tuple(f.return_type, escape_keyword(f.name), f.parameters
, /***/f.c_name/***/
@@ -139,11 +146,11 @@ struct native_function_definition_generator
// This is the delegate that will be passed to Eo to be called from C.
if(!as_generator(
- scope_tab << "private static " << f.c_name << "_delegate " << f.c_name << "_static_delegate;\n"
+ indent << "private static " << f.c_name << "_delegate " << f.c_name << "_static_delegate;\n\n"
).generate(sink, attributes::unused, context))
return false;
+
return true;
- }
}
};
diff --git a/src/bin/eolian_mono/eolian/mono/function_registration.hh b/src/bin/eolian_mono/eolian/mono/function_registration.hh
index fc044e6b72..b490808b9a 100644
--- a/src/bin/eolian_mono/eolian/mono/function_registration.hh
+++ b/src/bin/eolian_mono/eolian/mono/function_registration.hh
@@ -30,35 +30,34 @@ struct function_registration_generator
bool generate(OutputIterator sink, attributes::function_def const& f, Context const& context) const
{
EINA_CXX_DOM_LOG_DBG(eolian_mono::domain) << "function_registration_generator: " << f.name << std::endl;
+ auto const& indent = current_indentation(context);
+
if(blacklist::is_function_blacklisted(f, context) || f.is_static) // Static methods aren't overrideable
return true;
- else
- {
- // auto index = index_generator();
if(!as_generator(
- scope_tab << scope_tab << "if (" << f.c_name << "_static_delegate == null)\n"
- << scope_tab << scope_tab << scope_tab << f.c_name << "_static_delegate = new " << f.c_name << "_delegate(" <<
- escape_keyword(f.name) << ");\n"
+ indent << "if (" << f.c_name << "_static_delegate == null)\n"
+ << indent << "{\n"
+ << indent << scope_tab << f.c_name << "_static_delegate = new " << f.c_name << "_delegate(" << escape_keyword(f.name) << ");\n"
+ << indent << "}\n\n"
).generate(sink, attributes::unused, context))
return false;
- if(!as_generator
- (scope_tab << scope_tab
- << "if (methods.FirstOrDefault(m => m.Name == \"" << string << "\") != null)\n"
- << scope_tab << scope_tab << scope_tab
- << "descs.Add(new Efl_Op_Description() {"
+ if(!as_generator(
+ indent << "if (methods.FirstOrDefault(m => m.Name == \"" << string << "\") != null)\n"
+ << indent << "{\n"
+ << indent << scope_tab << "descs.Add(new Efl_Op_Description() {"
#ifdef _WIN32
<< "api_func = Marshal.StringToHGlobalAnsi(\"" << string << "\")"
#else
- << "api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, \"" << string << "\")"
+ << "api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, \"" << string << "\")"
#endif
- << ", func = Marshal.GetFunctionPointerForDelegate(" << string << "_static_delegate)});\n"
+ << ", func = Marshal.GetFunctionPointerForDelegate(" << string << "_static_delegate) });\n"
+ << indent << "}\n\n"
)
.generate(sink, std::make_tuple(name_helpers::managed_method_name(f), f.c_name, f.c_name), context))
return false;
return true;
- }
}
};
diff --git a/src/bin/eolian_mono/eolian/mono/klass.hh b/src/bin/eolian_mono/eolian/mono/klass.hh
index fd4c629ffd..c81a23fe08 100644
--- a/src/bin/eolian_mono/eolian/mono/klass.hh
+++ b/src/bin/eolian_mono/eolian/mono/klass.hh
@@ -35,24 +35,30 @@ template <typename OutputIterator, typename Context>
static bool generate_equals_method(OutputIterator sink, Context const &context)
{
return as_generator(
- scope_tab << "///<summary>Verifies if the given object is equal to this one.</summary>\n"
- << scope_tab << "public override bool Equals(object obj)\n"
+ scope_tab << "/// <summary>Verifies if the given object is equal to this one.</summary>\n"
+ << scope_tab << "/// <param name=\"instance\">The object to compare to.</param>\n"
+ << scope_tab << "/// <returns>True if both objects point to the same native object.</returns>\n"
+ << scope_tab << "public override bool Equals(object instance)\n"
<< scope_tab << "{\n"
- << scope_tab << scope_tab << "var other = obj as Efl.Object;\n"
+ << scope_tab << scope_tab << "var other = instance as Efl.Object;\n"
<< scope_tab << scope_tab << "if (other == null)\n"
+ << scope_tab << scope_tab << "{\n"
<< scope_tab << scope_tab << scope_tab << "return false;\n"
+ << scope_tab << scope_tab << "}\n"
<< scope_tab << scope_tab << "return this.NativeHandle == other.NativeHandle;\n"
- << scope_tab << "}\n"
- << scope_tab << "///<summary>Gets the hash code for this object based on the native pointer it points to.</summary>\n"
+ << scope_tab << "}\n\n"
+ << scope_tab << "/// <summary>Gets the hash code for this object based on the native pointer it points to.</summary>\n"
+ << scope_tab << "/// <returns>The value of the pointer, to be used as the hash code of this object.</returns>\n"
<< scope_tab << "public override int GetHashCode()\n"
<< scope_tab << "{\n"
<< scope_tab << scope_tab << "return this.NativeHandle.ToInt32();\n"
- << scope_tab << "}\n"
- << scope_tab << "///<summary>Turns the native pointer into a string representation.</summary>\n"
+ << scope_tab << "}\n\n"
+ << scope_tab << "/// <summary>Turns the native pointer into a string representation.</summary>\n"
+ << scope_tab << "/// <returns>A string with the type and the native pointer for this object.</returns>\n"
<< scope_tab << "public override String ToString()\n"
<< scope_tab << "{\n"
<< scope_tab << scope_tab << "return $\"{this.GetType().Name}@[{this.NativeHandle.ToInt32():x}]\";\n"
- << scope_tab << "}\n"
+ << scope_tab << "}\n\n"
).generate(sink, nullptr, context);
}
@@ -82,6 +88,8 @@ struct klass
{
EINA_CXX_DOM_LOG_DBG(eolian_mono::domain) << "klass_generator: " << cls.eolian_name << std::endl;
+ auto const& indent = current_indentation(context);
+
if (blacklist::is_class_blacklisted(cls, context))
{
EINA_CXX_DOM_LOG_DBG(eolian_mono::domain) << "class " << cls.eolian_name << " is blacklisted. Skipping." << std::endl;
@@ -125,7 +133,7 @@ struct klass
return false;
// Mark the interface with the proper native Efl_Class* getter
- if(!as_generator(lit("[") << name_helpers::klass_native_inherit_name(cls) << "]\n")
+ if(!as_generator(lit("[") << name_helpers::klass_full_native_inherit_name(cls) << "]\n")
.generate(sink, attributes::unused, iface_cxt))
return false;
@@ -203,10 +211,12 @@ struct klass
auto concrete_name = name_helpers::klass_concrete_name(cls);
auto interface_name = name_helpers::klass_interface_name(cls);
+ // We can't make these internal yet as they have methods that are used by
+ // other classes that implement the interface.
if(!as_generator
(
documentation
- << "sealed internal class " << concrete_name << " : " << "\n"
+ << "sealed public class " << concrete_name << " : " << "\n"
<< (klass_full_concrete_or_interface_name % ",") << "\n"
<< (inherit_classes.size() > 0 ? ", " : "" ) << interface_name << "\n"
<< scope_tab << *(", " << name_helpers::klass_full_concrete_or_interface_name) << "\n"
@@ -223,7 +233,8 @@ struct klass
scope_tab << "[System.Runtime.InteropServices.DllImport(" << context_find_tag<library_context>(concrete_cxt).actual_library_name(cls.filename)
<< ")] internal static extern System.IntPtr\n"
<< scope_tab << scope_tab << name_helpers::klass_get_name(cls) << "();\n"
- << scope_tab << "///<summary>Internal usage: Constructs an instance from a native pointer. This is used when interacting with C code and should not be used directly.</summary>\n"
+ << scope_tab << "/// <summary>Initializes a new instance of the <see cref=\"" << interface_name << "\"/> class.\n"
+ << scope_tab << "/// Internal usage: This is used when interacting with C code and should not be used directly.</summary>\n"
<< scope_tab << "private " << concrete_name << "(System.IntPtr raw)" << (root ? "" : " : base(raw)") << "\n"
<< scope_tab << "{\n"
<< scope_tab << scope_tab << (root ? "handle = raw;\n" : "")
@@ -274,6 +285,8 @@ struct klass
).generate(sink, attributes::unused, concrete_cxt))
return false;
+ if(!generate_native_inherit_class(sink, cls, change_indentation(indent.inc(), context)))
+ return true;
if(!as_generator("}\n").generate(sink, attributes::unused, concrete_cxt)) return false;
}
@@ -289,7 +302,7 @@ struct klass
if(!as_generator
(
documentation
- << "[" << name_helpers::klass_native_inherit_name(cls) << "]\n"
+ << "[" << name_helpers::klass_full_native_inherit_name(cls) << "]\n"
<< "public " << class_type << " " << name_helpers::klass_concrete_name(cls) << " : "
<< (klass_full_concrete_or_interface_name % ",") // classes
<< (inherit_classes.empty() ? "" : ",")
@@ -351,11 +364,24 @@ struct klass
).generate(sink, attributes::unused, inherit_cxt))
return false;
+ if(!generate_native_inherit_class(sink, cls, change_indentation(indent.inc(), context)))
+ return true;
+
if(!as_generator("}\n").generate(sink, attributes::unused, inherit_cxt)) return false;
}
- // Native Inherit class
- //if(class_type == "class")
+
+ if(!name_helpers::close_namespaces(sink, cls.namespaces, context))
+ return false;
+
+ return true;
+ }
+
+ // NativeInherit class. Contains function pointers for the native Eo methods and delegates that are registered in Eo as virtual method implementations
+ // These delegates are called from C to C#, checking whether the C# subclass reimplemented it.
+ template <typename OutputIterator, typename Context>
+ bool generate_native_inherit_class(OutputIterator sink, attributes::klass_def const& cls, Context const& context) const
+ {
{
auto inative_cxt = context_add_tag(class_context{class_context::inherit_native,
name_helpers::klass_full_concrete_or_interface_name(cls)},
@@ -363,6 +389,9 @@ struct klass
auto native_inherit_name = name_helpers::klass_native_inherit_name(cls);
auto inherit_name = name_helpers::klass_inherit_name(cls);
auto implementable_methods = helpers::get_all_implementable_methods(cls);
+ bool root = !helpers::has_regular_ancestor(cls);
+ auto const& indent = current_indentation(inative_cxt);
+
std::string base_name;
if(!root)
{
@@ -372,12 +401,28 @@ struct klass
if(!as_generator
(
- "public class " << native_inherit_name << " " << (root ? " : Efl.Eo.NativeClass" : (": " + base_name)) <<"{\n"
- << scope_tab << "public " << (root ? "" : "new ") << " static Efl.Eo.NativeModule _Module = new Efl.Eo.NativeModule("
- << context_find_tag<library_context>(context).actual_library_name(cls.filename) << ");\n"
- << scope_tab << "public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)\n"
- << scope_tab << "{\n"
- << scope_tab << scope_tab << "var descs = new System.Collections.Generic.List<Efl_Op_Description>();\n"
+ indent << lit("/// <summary>Wrapper for native methods and virtual method delegates.\n")
+ << indent << "/// For internal use by generated code only.</summary>\n"
+ << indent << "public " << (root ? "" : "new " ) << "class " << native_inherit_name << " " << (root ? " : Efl.Eo.NativeClass" : (": " + base_name)) <<"\n"
+ << indent << "{\n"
+ ).generate(sink, attributes::unused, inative_cxt))
+ return false;
+
+ if(implementable_methods.size() >= 1)
+ {
+ if(!as_generator(
+ indent << scope_tab << "private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule("
+ << indent << context_find_tag<library_context>(context).actual_library_name(cls.filename) << ");\n"
+ ).generate(sink, attributes::unused, inative_cxt))
+ return false;
+ }
+
+ if(!as_generator(
+ indent << scope_tab << "/// <summary>Gets the list of Eo operations to override.</summary>\n"
+ << indent << scope_tab << "/// <returns>The list of Eo operations to be overload.</returns>\n"
+ << indent << scope_tab << "public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)\n"
+ << indent << scope_tab << "{\n"
+ << indent << scope_tab << scope_tab << "var descs = new System.Collections.Generic.List<Efl_Op_Description>();\n"
)
.generate(sink, attributes::unused, inative_cxt))
return false;
@@ -387,54 +432,46 @@ struct klass
// only non-registrable methods like class functions, leading to unused `methods` variable.
std::string tmp_registration;
if(!as_generator(*(function_registration(cls)))
- .generate(std::back_inserter(tmp_registration), implementable_methods, inative_cxt))
+ .generate(std::back_inserter(tmp_registration), implementable_methods, change_indentation(indent.inc(2), inative_cxt)))
return false;
if (tmp_registration.find("methods") != std::string::npos)
if (!as_generator(
- scope_tab << scope_tab << "var methods = Efl.Eo.Globals.GetUserMethods(type);\n"
+ indent << scope_tab << scope_tab << "var methods = Efl.Eo.Globals.GetUserMethods(type);\n\n"
<< tmp_registration
).generate(sink, attributes::unused, inative_cxt))
return false;
-
if(!root)
- if(!as_generator(scope_tab << scope_tab << "descs.AddRange(base.GetEoOps(type));\n").generate(sink, attributes::unused, inative_cxt))
+ if(!as_generator(indent << scope_tab << scope_tab << "descs.AddRange(base.GetEoOps(type));\n").generate(sink, attributes::unused, inative_cxt))
return false;
if(!as_generator(
- scope_tab << scope_tab << "return descs;\n"
- << scope_tab << "}\n"
+ indent << scope_tab << scope_tab << "return descs;\n"
+ << indent << scope_tab << "}\n"
).generate(sink, attributes::unused, inative_cxt))
return false;
// Attribute getter of the native 'Efl_Class *' handle (for proper inheritance from additional explicit interfaces)
if(!as_generator(
- scope_tab << "public override IntPtr GetEflClass()\n"
- << scope_tab << "{\n"
- << scope_tab << scope_tab << "return " << name_helpers::klass_get_full_name(cls) << "();\n"
- << scope_tab << "}\n"
- ).generate(sink, attributes::unused, inative_cxt))
- return false;
-
- if(!as_generator(
- scope_tab << "public static " << (root ? "" : "new ") << " IntPtr GetEflClassStatic()\n"
- << scope_tab << "{\n"
- << scope_tab << scope_tab << "return " << name_helpers::klass_get_full_name(cls) << "();\n"
- << scope_tab << "}\n"
+ indent << scope_tab << "/// <summary>Returns the Eo class for the native methods of this class.</summary>\n"
+ << indent << scope_tab << "/// <returns>The native class pointer.</returns>\n"
+ << indent << scope_tab << "public override IntPtr GetEflClass()\n"
+ << indent << scope_tab << "{\n"
+ << indent << scope_tab << scope_tab << "return " << name_helpers::klass_get_full_name(cls) << "();\n"
+ << indent << scope_tab << "}\n\n"
).generate(sink, attributes::unused, inative_cxt))
return false;
// Native method definitions
- if(!as_generator(*(native_function_definition(cls)))
- .generate(sink, implementable_methods, inative_cxt)) return false;
+ if(!as_generator(
+ indent << scope_tab << "#pragma warning disable CA1707, SA1300, SA1600\n\n"
+ << *(native_function_definition(cls))
+ << indent << scope_tab << "#pragma warning restore CA1707, SA1300, SA1600\n\n")
+ .generate(sink, implementable_methods, change_indentation(indent.inc(), inative_cxt))) return false;
if(!as_generator("}\n").generate(sink, attributes::unused, inative_cxt)) return false;
}
-
- if(!name_helpers::close_namespaces(sink, cls.namespaces, context))
- return false;
-
return true;
}
@@ -457,14 +494,20 @@ struct klass
if(!as_generator(
scope_tab << "///<summary>Pointer to the native class description.</summary>\n"
- << scope_tab << "public " << raw_klass_modifier << "System.IntPtr NativeClass {\n"
- << scope_tab << scope_tab << "get {\n"
- << scope_tab << scope_tab << scope_tab << "if (((object)this).GetType() == typeof (" << inherit_name << "))\n"
- << scope_tab << scope_tab << scope_tab << scope_tab << "return " << native_inherit_full_name << ".GetEflClassStatic();\n"
+ << scope_tab << "public " << raw_klass_modifier << "System.IntPtr NativeClass\n"
+ << scope_tab << "{\n"
+ << scope_tab << scope_tab << "get\n"
+ << scope_tab << scope_tab << "{\n"
+ << scope_tab << scope_tab << scope_tab << "if (((object)this).GetType() == typeof(" << inherit_name << "))\n"
+ << scope_tab << scope_tab << scope_tab << "{\n"
+ << scope_tab << scope_tab << scope_tab << scope_tab << "return GetEflClassStatic();\n"
+ << scope_tab << scope_tab << scope_tab << "}\n"
<< scope_tab << scope_tab << scope_tab << "else\n"
+ << scope_tab << scope_tab << scope_tab << "{\n"
<< scope_tab << scope_tab << scope_tab << scope_tab << "return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];\n"
+ << scope_tab << scope_tab << scope_tab << "}\n"
<< scope_tab << scope_tab << "}\n"
- << scope_tab << "}\n"
+ << scope_tab << "}\n\n"
).generate(sink, attributes::unused, context))
return false;
@@ -489,9 +532,10 @@ struct klass
return as_generator(
scope_tab << visibility << " System.IntPtr handle;\n"
<< scope_tab << "///<summary>Pointer to the native instance.</summary>\n"
- << scope_tab << "public System.IntPtr NativeHandle {\n"
+ << scope_tab << "public System.IntPtr NativeHandle\n"
+ << scope_tab << "{\n"
<< scope_tab << scope_tab << "get { return handle; }\n"
- << scope_tab << "}\n"
+ << scope_tab << "}\n\n"
).generate(sink, attributes::unused, context);
}
@@ -500,7 +544,6 @@ struct klass
{
bool root = !helpers::has_regular_ancestor(cls);
auto inherit_name = name_helpers::klass_concrete_name(cls);
- auto native_inherit_name = name_helpers::klass_native_inherit_name(cls);
if(!as_generator(
scope_tab << "[System.Runtime.InteropServices.DllImport(" << context_find_tag<library_context>(context).actual_library_name(cls.filename)
@@ -518,22 +561,24 @@ struct klass
// Public (API) constructors
if (!as_generator(
- scope_tab << "///<summary>Creates a new instance.</summary>\n"
- << scope_tab << "///<param name=\"parent\">Parent instance.</param>\n"
+ scope_tab << "/// <summary>Initializes a new instance of the <see cref=\"" << inherit_name << "\"/> class.</summary>\n"
+ << scope_tab << "/// <param name=\"parent\">Parent instance.</param>\n"
<< *(documentation)
// For constructors with arguments, the parent is also required, as optional parameters can't come before non-optional paramenters.
<< scope_tab << "public " << inherit_name << "(Efl.Object parent" << ((constructors.size() > 0) ? "" : "= null") << "\n"
- << scope_tab << scope_tab << scope_tab << *(", " << constructor_param ) << ") :\n"
- << scope_tab << scope_tab << (root ? "this" : "base") << "(" << name_helpers::klass_get_name(cls) << "(), typeof(" << inherit_name << "), parent)\n"
+ << scope_tab << scope_tab << scope_tab << *(", " << constructor_param ) << ") : "
+ << (root ? "this" : "base") << "(" << name_helpers::klass_get_name(cls) << "(), typeof(" << inherit_name << "), parent)\n"
<< scope_tab << "{\n"
- << *(scope_tab << scope_tab << constructor_invocation << "\n" )
+ << (*(scope_tab << scope_tab << constructor_invocation << "\n"))
<< scope_tab << scope_tab << "FinishInstantiation();\n"
- << scope_tab << "}\n"
- << scope_tab << "///<summary>Internal usage: Constructs an instance from a native pointer. This is used when interacting with C code and should not be used directly.</summary>\n"
+ << scope_tab << "}\n\n"
+ << scope_tab << "/// <summary>Initializes a new instance of the <see cref=\"" << inherit_name << "\"/> class.\n"
+ << scope_tab << "/// Internal usage: Constructs an instance from a native pointer. This is used when interacting with C code and should not be used directly.</summary>\n"
+ << scope_tab << "/// <param name=\"raw\">The native pointer to be wrapped.</param>\n"
<< scope_tab << "protected " << inherit_name << "(System.IntPtr raw)" << (root ? "" : " : base(raw)") << "\n"
<< scope_tab << "{\n"
<< scope_tab << scope_tab << (root ? "handle = raw;\n" : "")
- << scope_tab << "}\n"
+ << scope_tab << "}\n\n"
).generate(sink, std::make_tuple(constructors, constructors, constructors), context))
return false;
@@ -558,8 +603,14 @@ struct klass
if (!root)
{
return as_generator(
- scope_tab << "///<summary>Internal usage: Constructor to forward the wrapper initialization to the root class that interfaces with native code. Should not be used directly.</summary>\n"
- << scope_tab << "protected " << inherit_name << "(IntPtr base_klass, System.Type managed_type, Efl.Object parent) : base(base_klass, managed_type, parent) {}\n"
+ scope_tab << "/// <summary>Initializes a new instance of the <see cref=\"" << inherit_name << "\"/> class.\n"
+ << scope_tab << "/// Internal usage: Constructor to forward the wrapper initialization to the root class that interfaces with native code. Should not be used directly.</summary>\n"
+ << scope_tab << "/// <param name=\"baseKlass\">The pointer to the base native Eo class.</param>\n"
+ << scope_tab << "/// <param name=\"managedType\">The managed type of the public constructor that originated this call.</param>\n"
+ << scope_tab << "/// <param name=\"parent\">The Efl.Object parent of this instance.</param>\n"
+ << scope_tab << "protected " << inherit_name << "(IntPtr baseKlass, System.Type managedType, Efl.Object parent) : base(baseKlass, managedType, parent)\n"
+ << scope_tab << "{\n"
+ << scope_tab << "}\n\n"
).generate(sink, attributes::unused, context);
}
@@ -567,25 +618,34 @@ struct klass
// Detailed constructors go only in root classes.
return as_generator(
/// Actual root costructor that creates class and instantiates
- scope_tab << "protected " << inherit_name << "(IntPtr base_klass, System.Type managed_type, Efl.Object parent)\n"
+ scope_tab << "/// <summary>Initializes a new instance of the <see cref=\"" << inherit_name << "\"/> class.\n"
+ << scope_tab << "/// Internal usage: Constructor to actually call the native library constructors. C# subclasses\n"
+ << scope_tab << "/// must use the public constructor only.</summary>\n"
+ << scope_tab << "/// <param name=\"baseKlass\">The pointer to the base native Eo class.</param>\n"
+ << scope_tab << "/// <param name=\"managedType\">The managed type of the public constructor that originated this call.</param>\n"
+ << scope_tab << "/// <param name=\"parent\">The Efl.Object parent of this instance.</param>\n"
+ << scope_tab << "protected " << inherit_name << "(IntPtr baseKlass, System.Type managedType, Efl.Object parent)\n"
<< scope_tab << "{\n"
- << scope_tab << scope_tab << "inherited = ((object)this).GetType() != managed_type;\n"
- << scope_tab << scope_tab << "IntPtr actual_klass = base_klass;\n"
- << scope_tab << scope_tab << "if (inherited) {\n"
- << scope_tab << scope_tab << scope_tab << "actual_klass = Efl.Eo.ClassRegister.GetInheritKlassOrRegister(base_klass, ((object)this).GetType());\n"
- << scope_tab << scope_tab << "}\n"
+ << scope_tab << scope_tab << "inherited = ((object)this).GetType() != managedType;\n"
+ << scope_tab << scope_tab << "IntPtr actual_klass = baseKlass;\n"
+ << scope_tab << scope_tab << "if (inherited)\n"
+ << scope_tab << scope_tab << "{\n"
+ << scope_tab << scope_tab << scope_tab << "actual_klass = Efl.Eo.ClassRegister.GetInheritKlassOrRegister(baseKlass, ((object)this).GetType());\n"
+ << scope_tab << scope_tab << "}\n\n"
<< scope_tab << scope_tab << "handle = Efl.Eo.Globals.instantiate_start(actual_klass, parent);\n"
<< scope_tab << scope_tab << "if (inherited)\n"
<< scope_tab << scope_tab << "{\n"
<< scope_tab << scope_tab << scope_tab << "Efl.Eo.Globals.PrivateDataSet(this);\n"
<< scope_tab << scope_tab << "}\n"
- << scope_tab << "}\n"
+ << scope_tab << "}\n\n"
+ << scope_tab << "/// <summary>Finishes instantiating this object.\n"
+ << scope_tab << "/// Internal usage by generated code.</summary>\n"
<< scope_tab << "protected void FinishInstantiation()\n"
<< scope_tab << "{\n"
<< scope_tab << scope_tab << "handle = Efl.Eo.Globals.instantiate_end(handle);\n"
<< scope_tab << scope_tab << "Eina.Error.RaiseIfUnhandledException();\n"
- << scope_tab << "}\n"
+ << scope_tab << "}\n\n"
).generate(sink, attributes::unused, context);
}
@@ -597,7 +657,7 @@ struct klass
if (helpers::has_regular_ancestor(cls))
return true;
- std::string visibility = is_inherit_context(context) ? "protected virtual " : "";
+ std::string visibility = is_inherit_context(context) ? "protected virtual " : "private ";
auto inherit_name = name_helpers::klass_concrete_name(cls);
@@ -647,7 +707,7 @@ struct klass
<< scope_tab << scope_tab << scope_tab << scope_tab << "}\n\n"
<< scope_tab << scope_tab << scope_tab << scope_tab << "Monitor.Exit(Efl.All.InitLock);\n"
<< scope_tab << scope_tab << scope_tab << "}\n"
- << scope_tab << scope_tab << "}\n"
+ << scope_tab << scope_tab << "}\n\n"
<< scope_tab << "}\n\n"
<< scope_tab << "///<summary>Releases the underlying native instance.</summary>\n"
@@ -734,7 +794,7 @@ struct klass
<< scope_tab << scope_tab << "{\n"
<< scope_tab << scope_tab << scope_tab << "Eina.Log.Error($\"Trying to remove proxy for event {key} when it is nothing registered.\");\n"
<< scope_tab << scope_tab << "}\n"
- << scope_tab << "}\n"
+ << scope_tab << "}\n\n"
)
.generate(sink, NULL, context))
return false;
diff --git a/src/bin/eolian_mono/eolian/mono/marshall_annotation.hh b/src/bin/eolian_mono/eolian/mono/marshall_annotation.hh
index 296b59c04c..632696d6a7 100644
--- a/src/bin/eolian_mono/eolian/mono/marshall_annotation.hh
+++ b/src/bin/eolian_mono/eolian/mono/marshall_annotation.hh
@@ -51,71 +51,71 @@ struct marshall_annotation_visitor_generate
match const parameter_match_table[] =
{
// signed primitives
- {"bool", nullptr, [&] { return " [MarshalAs(UnmanagedType.U1)]"; }},
+ {"bool", nullptr, [&] { return "[MarshalAs(UnmanagedType.U1)]"; }},
{"string", true, [&] {
- return " [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringPassOwnershipMarshaler))]";
+ return "[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringPassOwnershipMarshaler))]";
}},
{"string", false, [&] {
- return " [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))]";
+ return "[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))]";
}},
{"mstring", true, [&] {
- return " [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringPassOwnershipMarshaler))]";
+ return "[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringPassOwnershipMarshaler))]";
}},
{"mstring", false, [&] {
- return " [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))]";
+ return "[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))]";
}},
{"stringshare", true, [&] {
- return " [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringsharePassOwnershipMarshaler))]";
+ return "[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringsharePassOwnershipMarshaler))]";
}},
{"stringshare", false, [&] {
- return " [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringshareKeepOwnershipMarshaler))]";
+ return "[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringshareKeepOwnershipMarshaler))]";
}},
{"any_value_ptr", true, [&] {
- return " [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Eina.ValueMarshalerOwn))]";
+ return "[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Eina.ValueMarshalerOwn))]";
}},
{"any_value_ptr", false, [&] {
- return " [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Eina.ValueMarshaler))]";
+ return "[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Eina.ValueMarshaler))]";
}},
{"strbuf", true, [&] {
- return " [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StrbufPassOwnershipMarshaler))]";
+ return "[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StrbufPassOwnershipMarshaler))]";
}},
{"strbuf", false, [&] {
- return " [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StrbufKeepOwnershipMarshaler))]";
+ return "[MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StrbufKeepOwnershipMarshaler))]";
}},
};
match const return_match_table[] =
{
// signed primitives
- {"bool", nullptr, [&] { return " [return: MarshalAs(UnmanagedType.U1)]"; }},
+ {"bool", nullptr, [&] { return "[return: MarshalAs(UnmanagedType.U1)]"; }},
{"string", true, [&] {
- return " [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringPassOwnershipMarshaler))]";
+ return "[return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringPassOwnershipMarshaler))]";
}},
{"string", nullptr, [&] {
- return " [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))]";
+ return "[return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))]";
}},
{"mstring", true, [&] {
- return " [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringPassOwnershipMarshaler))]";
+ return "[return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringPassOwnershipMarshaler))]";
}},
{"mstring", false, [&] {
- return " [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))]";
+ return "[return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))]";
}},
{"stringshare", true, [&] {
- return " [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringsharePassOwnershipMarshaler))]";
+ return "[return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringsharePassOwnershipMarshaler))]";
}},
{"stringshare", false, [&] {
- return " [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringshareKeepOwnershipMarshaler))]";
+ return "[return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringshareKeepOwnershipMarshaler))]";
}},
{"any_value_ptr", true, [&] {
- return " [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Eina.ValueMarshalerOwn))]";
+ return "[return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Eina.ValueMarshalerOwn))]";
}},
{"any_value_ptr", false, [&] {
- return " [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Eina.ValueMarshaler))]";
+ return "[return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Eina.ValueMarshaler))]";
}},
{"strbuf", true, [&] {
- return " [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StrbufPassOwnershipMarshaler))]";
+ return "[return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StrbufPassOwnershipMarshaler))]";
}},
{"strbuf", false, [&] {
- return " [return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StrbufKeepOwnershipMarshaler))]";
+ return "[return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StrbufKeepOwnershipMarshaler))]";
}},
};
diff --git a/src/bin/eolian_mono/eolian/mono/name_helpers.hh b/src/bin/eolian_mono/eolian/mono/name_helpers.hh
index 6e913556a2..1ae35cab6d 100644
--- a/src/bin/eolian_mono/eolian/mono/name_helpers.hh
+++ b/src/bin/eolian_mono/eolian/mono/name_helpers.hh
@@ -176,22 +176,22 @@ inline std::string managed_namespace(std::string const& ns)
return escape_keyword(utils::remove_all(ns, '_'));
}
-inline std::string managed_method_name(std::string const& klass, std::string const& name)
+inline std::string managed_method_name(attributes::function_def const& f)
{
- std::vector<std::string> names = utils::split(name, '_');
+ std::vector<std::string> names = utils::split(f.name, '_');
name_helpers::reorder_verb(names);
std::string candidate = escape_keyword(utils::to_pascal_case(names));
// Some eolian methods have the same name as their parent class
- if (candidate == klass)
+ if (candidate == klass_concrete_or_interface_name(f.klass))
candidate = "Do" + candidate;
// Avoid clashing with System.Object.GetType
if (candidate == "GetType" || candidate == "SetType")
{
- candidate.insert(3, klass);
+ candidate.insert(3, f.klass.eolian_name);
}
return candidate;
@@ -203,11 +203,6 @@ inline std::string managed_name(std::string const& name, char separator='_')
return utils::to_pascal_case(tokens);
}
-inline std::string managed_method_name(attributes::function_def const& f)
-{
- return managed_method_name(f.klass.eolian_name, f.name);
-}
-
inline std::string alias_full_eolian_name(attributes::alias_def const& alias)
{
@@ -398,29 +393,15 @@ inline std::string klass_inherit_name(T const& klass)
}
template<typename T>
-inline std::string klass_native_inherit_name(T const& klass)
+inline std::string klass_native_inherit_name(EINA_UNUSED T const& klass)
{
- switch(klass.type)
- {
- case attributes::class_type::abstract_:
- case attributes::class_type::regular:
- return klass_concrete_name(klass) + "NativeInherit";
- default:
- return klass_interface_name(klass) + "NativeInherit";
- }
+ return "NativeMethods";
}
template<typename T>
inline std::string klass_full_native_inherit_name(T const& klass)
{
- switch(klass.type)
- {
- case attributes::class_type::abstract_:
- case attributes::class_type::regular:
- return klass_full_concrete_name(klass) + "NativeInherit";
- default:
- return klass_full_interface_name(klass) + "NativeInherit";
- }
+ return klass_full_concrete_name(klass) + "." + klass_native_inherit_name(klass);
}
template<typename T>
@@ -465,14 +446,14 @@ bool open_namespaces(OutputIterator sink, std::vector<std::string> namespaces, C
{
std::transform(namespaces.begin(), namespaces.end(), namespaces.begin(), managed_namespace);
- auto open_namespace = *("namespace " << string << " { ") << "\n";
+ auto open_namespace = *("namespace " << string << " {\n\n");
return as_generator(open_namespace).generate(sink, namespaces, context);
}
template<typename OutputIterator, typename Context>
bool close_namespaces(OutputIterator sink, std::vector<std::string> const& namespaces, Context const& context)
{
- auto close_namespace = *(lit("} ")) << "\n";
+ auto close_namespace = (lit("}") % "\n\n" ) << "\n\n";
return as_generator(close_namespace).generate(sink, namespaces, context);
}
diff --git a/src/bin/eolian_mono/eolian/mono/parameter.hh b/src/bin/eolian_mono/eolian/mono/parameter.hh
index acd0c5dfe1..ca3c573df7 100644
--- a/src/bin/eolian_mono/eolian/mono/parameter.hh
+++ b/src/bin/eolian_mono/eolian/mono/parameter.hh
@@ -389,22 +389,22 @@ inline std::string direction_modifier(attributes::parameter_def const& param)
{
if (param.direction == attributes::parameter_direction::inout)
{
- return " ref ";
+ return "ref ";
}
else if (param.direction != attributes::parameter_direction::in)
{
if (param.type.c_type == "Eina_Slice" || param.type.c_type == "Eina_Rw_Slice")
- return " ref ";
+ return "ref ";
else
- return " out ";
+ return "out ";
}
else if (param.direction == attributes::parameter_direction::in && param.type.is_ptr)
{
auto regular = efl::eina::get<attributes::regular_type_def>(&param.type.original_type);
if (helpers::need_struct_conversion(regular))
- return " ref "; // Don't add ref on Marshal if it is ptr
+ return "ref "; // Don't add ref on Marshal if it is ptr
}
- return " ";
+ return "";
}
std::string marshall_direction_modifier(attributes::parameter_def const& param)
@@ -1477,7 +1477,8 @@ struct constructor_invocation_generator
if (!as_generator(
"if (" <<
(efl::eolian::grammar::attribute_reorder<-1>
- ("Efl.Eo.Globals.ParamHelperCheck(" << constructor_parameter_name(ctor) << ")") % "||") << ")\n"
+ ("Efl.Eo.Globals.ParamHelperCheck(" << constructor_parameter_name(ctor) << ")") % " || ") << ")\n"
+ << scope_tab << scope_tab << "{\n"
<< scope_tab << scope_tab << scope_tab << name_helpers::managed_method_name(ctor.function) << "("
).generate(sink, params, context))
return false;
@@ -1493,7 +1494,9 @@ struct constructor_invocation_generator
return false;
}
- if (!as_generator(");").generate(sink, attributes::unused, context))
+ if (!as_generator(
+ ");\n"
+ << scope_tab << scope_tab << "}\n").generate(sink, attributes::unused, 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 06cdf1584f..9c57587b33 100644
--- a/src/bin/eolian_mono/eolian/mono/part_definition.hh
+++ b/src/bin/eolian_mono/eolian/mono/part_definition.hh
@@ -27,7 +27,7 @@ struct part_definition_generator
<< scope_tab << "{\n"
<< scope_tab << scope_tab << "get\n"
<< scope_tab << scope_tab << "{\n"
- << scope_tab << scope_tab << scope_tab << "return Efl.IPartNativeInherit.efl_part_get_ptr.Value.Delegate(NativeHandle, \"" << part.name << "\") as " << part_klass_name << ";\n"
+ << scope_tab << scope_tab << scope_tab << "return GetPart(\"" << part.name << "\") as " << part_klass_name << ";\n"
<< scope_tab << scope_tab << "}\n"
<< scope_tab << "}\n"
).generate(sink, part.documentation, context);
diff --git a/src/bin/eolian_mono/eolian/mono/struct_fields.hh b/src/bin/eolian_mono/eolian/mono/struct_fields.hh
index 42a20e1aba..163d1b94db 100644
--- a/src/bin/eolian_mono/eolian/mono/struct_fields.hh
+++ b/src/bin/eolian_mono/eolian/mono/struct_fields.hh
@@ -18,7 +18,7 @@ struct field_argument_default_generator
template<typename OutputIterator, typename Context>
bool generate(OutputIterator sink, attributes::struct_field_def const& field, Context const& context) const
{
- if (!as_generator(type << " " << string << "=default(" << type << ")")
+ if (!as_generator(type << " " << string << " = default(" << type << ")")
.generate(sink, std::make_tuple(field.type, name_helpers::to_field_name(field.name), field.type), context))
return false;
return true;
diff --git a/src/bin/eolian_mono/eolian/mono/variable_definition.hh b/src/bin/eolian_mono/eolian/mono/variable_definition.hh
index f13efdecc2..29211d079a 100644
--- a/src/bin/eolian_mono/eolian/mono/variable_definition.hh
+++ b/src/bin/eolian_mono/eolian/mono/variable_definition.hh
@@ -34,7 +34,7 @@ struct constant_definition_generator
if (!name_helpers::open_namespaces(sink, constant.namespaces, context))
return false;
- if (!as_generator("public partial class Constants {\n").generate(sink, attributes::unused, context))
+ if (!as_generator("public partial class Constants\n{\n").generate(sink, attributes::unused, context))
return false;
std::string literal;
diff --git a/src/examples/elementary/efl_ui_list_view_example_1.c b/src/examples/elementary/efl_ui_list_view_example_1.c
index 04ae147f2a..78489017ca 100644
--- a/src/examples/elementary/efl_ui_list_view_example_1.c
+++ b/src/examples/elementary/efl_ui_list_view_example_1.c
@@ -87,10 +87,10 @@ elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
);
factory = efl_add(EFL_UI_LAYOUT_FACTORY_CLASS, win);
+ efl_ui_widget_factory_item_class_set(factory, EFL_UI_LIST_DEFAULT_ITEM_CLASS);
efl_ui_property_bind(factory, "signal/efl,state,%v", "odd_style");
efl_ui_property_bind(factory, "signal/efl,state,%{selected;unselected}", "selected");
efl_ui_property_bind(factory, "efl.text", "name");
- efl_ui_layout_factory_theme_config(factory, "list_item", NULL, "default");
li = efl_add(EFL_UI_LIST_VIEW_CLASS, win
, efl_ui_list_view_layout_factory_set(efl_added, factory)
diff --git a/src/examples/elementary/efl_ui_list_view_example_2.c b/src/examples/elementary/efl_ui_list_view_example_2.c
index a843f6ed9c..5a4d680614 100644
--- a/src/examples/elementary/efl_ui_list_view_example_2.c
+++ b/src/examples/elementary/efl_ui_list_view_example_2.c
@@ -33,8 +33,8 @@ elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
model = efl_add(EFL_IO_MODEL_CLASS, win, efl_io_model_path_set(efl_added, dirname));
factory = efl_add(EFL_UI_LAYOUT_FACTORY_CLASS, win);
+ efl_ui_widget_factory_item_class_set(factory, EFL_UI_LIST_DEFAULT_ITEM_CLASS);
efl_ui_property_bind(factory, "efl.text", "filename");
- efl_ui_layout_factory_theme_config(factory, "list_item", NULL, "default");
li = efl_add(EFL_UI_LIST_VIEW_CLASS, win);
efl_ui_list_view_layout_factory_set(li, factory);
diff --git a/src/examples/elementary/efl_ui_list_view_example_3.c b/src/examples/elementary/efl_ui_list_view_example_3.c
index c027856df7..5a233b3430 100644
--- a/src/examples/elementary/efl_ui_list_view_example_3.c
+++ b/src/examples/elementary/efl_ui_list_view_example_3.c
@@ -223,7 +223,7 @@ elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
priv->model = _make_model();
factory = efl_add(EFL_UI_LAYOUT_FACTORY_CLASS, win);
efl_ui_property_bind(factory, "efl.text", "filename");
- efl_ui_layout_factory_theme_config(factory, "list_item", NULL, "default");
+ efl_ui_widget_factory_item_class_set(factory, EFL_UI_LIST_DEFAULT_ITEM_CLASS);
priv->list1 = efl_add(EFL_UI_LIST_VIEW_CLASS, win, efl_ui_view_model_set(efl_added, priv->model));
efl_event_callback_add(priv->list1, EFL_UI_LIST_VIEW_EVENT_ITEM_REALIZED, _realized_1_cb, priv);
@@ -235,7 +235,7 @@ elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
factory = efl_add(EFL_UI_LAYOUT_FACTORY_CLASS, win);
efl_ui_property_bind(factory, "efl.text", "filename");
efl_ui_property_bind(factory, "signal/efl,state,%v", "selected");
- efl_ui_layout_factory_theme_config(factory, "list_item", NULL, "default");
+ efl_ui_widget_factory_item_class_set(factory, EFL_UI_LIST_DEFAULT_ITEM_CLASS);
priv->list2 = efl_add(EFL_UI_LIST_VIEW_CLASS, win, efl_ui_view_model_set(efl_added, priv->model));
efl_event_callback_add(priv->list2, EFL_UI_LIST_VIEW_EVENT_ITEM_REALIZED, _realized_2_cb, priv->list2);
evas_object_size_hint_weight_set(priv->list2, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
diff --git a/src/lib/ecore/ecore_events.c b/src/lib/ecore/ecore_events.c
index 15667e9bd9..01a4c3d019 100644
--- a/src/lib/ecore/ecore_events.c
+++ b/src/lib/ecore/ecore_events.c
@@ -12,16 +12,13 @@ typedef struct _Ecore_Future_Schedule_Entry
Eina_Future_Schedule_Entry base;
Eina_Future_Scheduler_Cb cb;
Eina_Future *future;
- Eo *event;
Eina_Value value;
} Ecore_Future_Schedule_Entry;
//////
// XXX: still using legacy ecore events
-//static Ecore_Event_Handler *future_handler = NULL;
static Eina_Bool shutting_down = EINA_FALSE;
static Eina_Mempool *mp_future_schedule_entry = NULL;
-//static int ECORE_EV_FUTURE_ID = -1;
//
//////
@@ -129,52 +126,47 @@ ecore_event_current_event_get(void)
return ecore_event_message_handler_current_event_get(_event_msg_handler);
}
-/* XXX:
-static Eina_Bool
-ecore_future_dispatched(void *data EINA_UNUSED,
- int type EINA_UNUSED,
- void *event)
-{
- Ecore_Future_Schedule_Entry *entry = event;
- EINA_SAFETY_ON_NULL_RETURN_VAL(entry, EINA_FALSE);
+static void _future_dispatch_cb(void *data, const Efl_Event *ev EINA_UNUSED);
+static void _event_del_cb(void *data, const Efl_Event *ev);
- entry->event = NULL;
- entry->cb(entry->future, entry->value);
- return EINA_FALSE;
-}
+EFL_CALLBACKS_ARRAY_DEFINE(ecore_future_callbacks,
+ { EFL_LOOP_EVENT_IDLE_ENTER, _future_dispatch_cb },
+ { EFL_LOOP_EVENT_IDLE, _future_dispatch_cb },
+ { EFL_EVENT_DEL, _event_del_cb });
static void
-ecore_future_free(void *user_data,
- void *func_data EINA_UNUSED)
+_future_dispatch_cb(void *data, const Efl_Event *ev EINA_UNUSED)
{
- Ecore_Future_Schedule_Entry *entry = user_data;
- if (entry->event)
+ Efl_Loop_Future_Scheduler *loopsched = data;
+ Eina_List *entries = loopsched->future_entries;
+ Ecore_Future_Schedule_Entry *entry;
+
+ loopsched->future_entries = NULL;
+ efl_event_callback_array_del((Eo *) loopsched->loop, ecore_future_callbacks(), loopsched);
+
+ EINA_LIST_FREE(entries, entry)
{
- eina_future_cancel(entry->future);
- eina_value_flush(&entry->value);
+ entry->cb(entry->future, entry->value);
+ eina_mempool_free(mp_future_schedule_entry, entry);
}
- eina_mempool_free(mp_future_schedule_entry, entry);
}
-*/
static void
-_future_dispatch_cb(void *data, const Efl_Event *ev EINA_UNUSED)
+_event_del_cb(void *data, const Efl_Event *ev EINA_UNUSED)
{
- Ecore_Future_Schedule_Entry *entry = data;
- entry->event = NULL;
- entry->cb(entry->future, entry->value);
-}
+ Efl_Loop_Future_Scheduler *loopsched = data;
+ Eina_List *entries = loopsched->future_entries;
+ Ecore_Future_Schedule_Entry *entry;
-static void
-_event_del_cb(void *data, const Efl_Event *ev)
-{
- Ecore_Future_Schedule_Entry *entry = data;
- if ((ev->object == (Eo *) entry->event) && entry->future)
+ loopsched->future_entries = NULL;
+ efl_event_callback_array_del((Eo *) loopsched->loop, ecore_future_callbacks(), loopsched);
+
+ EINA_LIST_FREE(entries, entry)
{
eina_future_cancel(entry->future);
eina_value_flush(&entry->value);
+ eina_mempool_free(mp_future_schedule_entry, entry);
}
- eina_mempool_free(mp_future_schedule_entry, entry);
}
static Eina_Future_Schedule_Entry *
@@ -192,40 +184,35 @@ ecore_future_schedule(Eina_Future_Scheduler *sched,
entry->cb = cb;
entry->future = future;
entry->value = value;
- entry->event = efl_loop_message_future_handler_message_type_add
- (loopsched->loop_data->future_message_handler);
- EINA_SAFETY_ON_NULL_GOTO(entry->event, err);
- efl_loop_message_future_data_set(entry->event, entry);
- efl_loop_message_handler_message_send
- (loopsched->loop_data->future_message_handler, entry->event);
-// XXX:
-// entry->event = ecore_event_add(ECORE_EV_FUTURE_ID, entry,
-// ecore_future_free, entry);
- efl_event_callback_add((Eo *)entry->event, EFL_LOOP_MESSAGE_EVENT_MESSAGE,
- _future_dispatch_cb, entry);
- efl_event_callback_add((Eo *)entry->event, EFL_EVENT_DEL,
- _event_del_cb, entry);
- return &entry->base;
- err:
- eina_mempool_free(mp_future_schedule_entry, entry);
- return NULL;
+ if (!loopsched->future_entries)
+ efl_event_callback_array_add((Eo *) loopsched->loop, ecore_future_callbacks(), loopsched);
+
+ loopsched->future_entries = eina_list_append(loopsched->future_entries, entry);
+ return &entry->base;
}
static void
ecore_future_recall(Eina_Future_Schedule_Entry *s_entry)
{
- Eo *msg;
+ Ecore_Future_Schedule_Entry *entry = (Ecore_Future_Schedule_Entry *)s_entry;
+ Efl_Loop_Future_Scheduler *loopsched;
+ Eina_List *lookup;
if (shutting_down) return;
- Ecore_Future_Schedule_Entry *entry = (Ecore_Future_Schedule_Entry *)s_entry;
- EINA_SAFETY_ON_NULL_RETURN(entry->event);
-// XXX:
-// ecore_event_del(entry->event);
- msg = entry->event;
+
+ loopsched = (Efl_Loop_Future_Scheduler *) entry->base.scheduler;
+
+ lookup = eina_list_data_find_list(loopsched->future_entries, entry);
+ if (!lookup) return;
+
+ loopsched->future_entries = eina_list_remove_list(loopsched->future_entries, lookup);
+ if (!loopsched->future_entries)
+ efl_event_callback_array_del((Eo *) loopsched->loop, ecore_future_callbacks(), loopsched);
+
eina_value_flush(&entry->value);
- entry->event = NULL;
- efl_del(msg);
+ eina_mempool_free(mp_future_schedule_entry, entry);
+
}
static Eina_Future_Scheduler ecore_future_scheduler = {
diff --git a/src/lib/ecore/ecore_private.h b/src/lib/ecore/ecore_private.h
index 2022526182..9bd3c3eb0e 100644
--- a/src/lib/ecore/ecore_private.h
+++ b/src/lib/ecore/ecore_private.h
@@ -109,6 +109,8 @@ struct _Efl_Loop_Future_Scheduler
Eina_Future_Scheduler eina_future_scheduler;
const Eo *loop;
Efl_Loop_Data *loop_data;
+
+ Eina_List *future_entries;
};
struct _Efl_Loop_Data
diff --git a/src/lib/ecore/efl_boolean_model.c b/src/lib/ecore/efl_boolean_model.c
index da9d3bdf96..20aed0fe50 100644
--- a/src/lib/ecore/efl_boolean_model.c
+++ b/src/lib/ecore/efl_boolean_model.c
@@ -207,4 +207,121 @@ _efl_boolean_model_boolean_del(Eo *obj EINA_UNUSED,
eina_stringshare_del(s);
}
+typedef struct _Eina_Iterator_Boolean Eina_Iterator_Boolean;
+
+struct _Eina_Iterator_Boolean
+{
+ Eina_Iterator iterator;
+
+ Eo *obj;
+ Efl_Boolean_Model_Data *pd;
+ Efl_Boolean_Model_Value *v;
+
+ uint64_t index;
+ uint64_t total;
+
+ Eina_Bool request;
+};
+
+static inline Eina_Bool
+_lookup_next_chunk(uint64_t *index, uint64_t total,
+ Efl_Boolean_Model_Value *v, unsigned char pattern)
+{
+ uint64_t upidx = *index >> 3;
+
+ while (upidx < v->buffer_count &&
+ v->buffer[upidx] == pattern)
+ upidx++;
+
+ *index = upidx << 3;
+ if (upidx == v->buffer_count &&
+ *index >= total) return EINA_FALSE;
+ return EINA_TRUE;
+}
+
+static Eina_Bool
+efl_boolean_model_iterator_next(Eina_Iterator_Boolean *it, void **data)
+{
+ uint64_t upidx;
+
+ *data = &it->index;
+ it->index++;
+
+ retry:
+ if (it->index >= it->total) return EINA_FALSE;
+ if ((it->index >> 3) >= it->v->buffer_count)
+ {
+ if (it->v->default_value != it->request)
+ return EINA_FALSE;
+ return EINA_TRUE;
+ }
+
+ upidx = it->index >> 3;
+ while ((it->index >> 3) == upidx)
+ {
+ Eina_Bool flag = it->v->buffer[it->index >> 3] &
+ (((unsigned char)1) << (it->index & 0x7));
+
+ if (it->request == !!flag)
+ break;
+
+ it->index++;
+ }
+
+ if ((it->index >> 3) != upidx)
+ {
+ if (!_lookup_next_chunk(&it->index, it->total, it->v, it->request ? 0x00 : 0xFF))
+ return EINA_FALSE;
+ goto retry;
+ }
+
+ return EINA_TRUE;
+}
+
+static Eo *
+efl_boolean_model_iterator_get_container(Eina_Iterator_Boolean *it)
+{
+ return it->obj;
+}
+
+static void
+efl_boolean_model_iterator_free(Eina_Iterator_Boolean *it)
+{
+ efl_unref(it->obj);
+ EINA_MAGIC_SET(&it->iterator, EINA_MAGIC_NONE);
+ free(it);
+}
+
+static Eina_Iterator *
+_efl_boolean_model_boolean_iterator_get(Eo *obj, Efl_Boolean_Model_Data *pd, const char *name, Eina_Bool request)
+{
+ Eina_Iterator_Boolean *itb;
+ Efl_Boolean_Model_Value *v;
+ Eina_Stringshare *s;
+
+ s = eina_stringshare_add(name);
+ v = eina_hash_find(pd->values, s);
+ eina_stringshare_del(s);
+ if (!v) return NULL;
+
+ itb = calloc(1, sizeof (Eina_Iterator_Boolean));
+ if (!itb) return NULL;
+
+ itb->obj = efl_ref(obj);
+ itb->pd = pd;
+ itb->v = v;
+ itb->index = 0;
+ itb->total = efl_model_children_count_get(obj);
+ itb->request = !!request;
+
+ itb->iterator.version = EINA_ITERATOR_VERSION;
+ itb->iterator.next = FUNC_ITERATOR_NEXT(efl_boolean_model_iterator_next);
+ itb->iterator.get_container = FUNC_ITERATOR_GET_CONTAINER(efl_boolean_model_iterator_get_container);
+ itb->iterator.free = FUNC_ITERATOR_FREE(efl_boolean_model_iterator_free);
+
+ EINA_MAGIC_SET(&itb->iterator, EINA_MAGIC_ITERATOR);
+ return &itb->iterator;
+}
+
+
#include "efl_boolean_model.eo.c"
diff --git a/src/lib/ecore/efl_boolean_model.eo b/src/lib/ecore/efl_boolean_model.eo
index 19f8f02935..049344d2bb 100644
--- a/src/lib/ecore/efl_boolean_model.eo
+++ b/src/lib/ecore/efl_boolean_model.eo
@@ -15,6 +15,14 @@ class @beta Efl.Boolean_Model extends Efl.Composite_Model
@in name: string;
}
}
+ boolean_iterator_get {
+ [[Get an iterator that will quickly find all the index with the requested value for a specific boolean.]]
+ params {
+ @in name: string;
+ @in request: bool;
+ }
+ return: iterator<ptr(uint64)>; [[The iterator that is valid until any change is made on the model.]]
+ }
}
implements {
Efl.Model.properties { get; }
diff --git a/src/lib/ecore/efl_core_command_line.c b/src/lib/ecore/efl_core_command_line.c
index 1c084030f1..64de7a9766 100644
--- a/src/lib/ecore/efl_core_command_line.c
+++ b/src/lib/ecore/efl_core_command_line.c
@@ -215,6 +215,7 @@ _efl_core_command_line_command_array_set(Eo *obj EINA_UNUSED, Efl_Core_Command_L
{
char *content = eina_array_data_get(array, i);
char *param = calloc(1, strlen(content) + 1);
+ char *esc;
if (!param)
{
@@ -236,7 +237,9 @@ _efl_core_command_line_command_array_set(Eo *obj EINA_UNUSED, Efl_Core_Command_L
//build the command
if (i != 0)
eina_strbuf_append(command, " ");
- eina_strbuf_append(command, _escape(content));
+ esc = _escape(content);
+ eina_strbuf_append(command, esc);
+ free(esc);
//convert string to stringshare
strcpy(param, content);
_remove_invalid_chars(param);
diff --git a/src/lib/ecore/efl_loop_model.c b/src/lib/ecore/efl_loop_model.c
index 0f212f1283..48309a5102 100644
--- a/src/lib/ecore/efl_loop_model.c
+++ b/src/lib/ecore/efl_loop_model.c
@@ -125,6 +125,33 @@ _efl_loop_model_volatile_make(Eo *obj, void *pd EINA_UNUSED)
efl_event_callback_add(obj, EFL_EVENT_NOREF, _noref_death, NULL);
}
+static Eina_Future *
+_efl_loop_model_efl_model_property_set(Eo *obj, void *pd EINA_UNUSED,
+ const char *property, Eina_Value *value)
+{
+ Eina_Error err;
+
+ if (!value) return efl_loop_future_rejected(obj, EFL_MODEL_ERROR_INCORRECT_VALUE);
+ err = efl_property_reflection_set(obj, property, *value);
+ if (err) return efl_loop_future_rejected(obj, err);
+
+ return efl_loop_future_resolved(obj, efl_property_reflection_get(obj, property));
+}
+
+static Eina_Value *
+_efl_loop_model_efl_model_property_get(const Eo *obj, void *pd EINA_UNUSED,
+ const char *property)
+{
+ Eina_Value *r;
+ Eina_Value direct;
+
+ direct = efl_property_reflection_get(obj, property);
+ r = eina_value_dup(&direct);
+ eina_value_flush(&direct);
+
+ return r;
+}
+
static void
_efl_loop_model_efl_object_invalidate(Eo *obj, void *pd EINA_UNUSED)
{
diff --git a/src/lib/ecore/efl_loop_model.eo b/src/lib/ecore/efl_loop_model.eo
index 362b8bff09..7d727efbc3 100644
--- a/src/lib/ecore/efl_loop_model.eo
+++ b/src/lib/ecore/efl_loop_model.eo
@@ -14,5 +14,6 @@ abstract @beta Efl.Loop_Model extends Efl.Loop_Consumer implements Efl.Model
implements {
Efl.Object.invalidate;
Efl.Model.property_ready_get;
+ Efl.Model.property { get; set; }
}
}
diff --git a/src/lib/ecore_wl2/ecore_wl2_input.c b/src/lib/ecore_wl2/ecore_wl2_input.c
index 0d480f50e8..fb50d04117 100644
--- a/src/lib/ecore_wl2/ecore_wl2_input.c
+++ b/src/lib/ecore_wl2/ecore_wl2_input.c
@@ -1242,6 +1242,8 @@ _touch_cb_up(void *data, struct wl_touch *touch EINA_UNUSED, unsigned int serial
if ((input->grab.window) && (input->grab.button == BTN_LEFT) &&
(!input->grab.count))
_ecore_wl2_input_ungrab(input);
+
+ input->focus.touch = NULL;
}
static void
diff --git a/src/lib/edje/edje_calc.c b/src/lib/edje/edje_calc.c
index 9c8ddb3b47..9bfd5ccb7f 100644
--- a/src/lib/edje/edje_calc.c
+++ b/src/lib/edje/edje_calc.c
@@ -2397,29 +2397,12 @@ _edje_filter_get(Edje *ed, Edje_Part_Description_Spec_Filter *filter)
static void
_edje_part_pixel_adjust(Edje *ed,
Edje_Real_Part *ep,
- Edje_Calc_Params *params,
- Eina_Bool round)
+ Edje_Calc_Params *params)
{
- int xw, yh, fxw, fyh;
-
- xw = ABS(params->final.x) + params->final.w;
- yh = ABS(params->final.y) + params->final.h;
-
- if (round)
- {
- fxw = TO_INT_ROUND(ADD(ABS(params->eval.x), params->eval.w));
- fyh = TO_INT_ROUND(ADD(ABS(params->eval.y), params->eval.h));
- }
- else
- {
- fxw = TO_INT(ADD(ABS(params->eval.x), params->eval.w));
- fyh = TO_INT(ADD(ABS(params->eval.y), params->eval.h));
- }
-
/* Adjust rounding to not loose one pixels compared to float
information only when rendering to avoid infinite adjustement
when doing min restricted calc */
- if (xw < fxw)
+ if (ABS(params->final.x) + params->final.w < TO_INT(ADD(ABS(params->eval.x), params->eval.w)))
{
if (!ed->calc_only)
{
@@ -2430,7 +2413,7 @@ _edje_part_pixel_adjust(Edje *ed,
ep->invalidate = EINA_TRUE;
}
}
- else if (xw > fxw)
+ else if (ABS(params->final.x) + params->final.w > TO_INT(ADD(ABS(params->eval.x), params->eval.w)))
{
if (!ed->calc_only)
{
@@ -2441,8 +2424,7 @@ _edje_part_pixel_adjust(Edje *ed,
ep->invalidate = EINA_TRUE;
}
}
-
- if (yh < fyh)
+ if (ABS(params->final.y) + params->final.h < TO_INT(ADD(ABS(params->eval.y), params->eval.h)))
{
if (!ed->calc_only)
{
@@ -2453,7 +2435,7 @@ _edje_part_pixel_adjust(Edje *ed,
ep->invalidate = EINA_TRUE;
}
}
- else if (yh > fyh)
+ else if (ABS(params->final.y) + params->final.h > TO_INT(ADD(ABS(params->eval.y), params->eval.h)))
{
if (!ed->calc_only)
{
@@ -2467,6 +2449,7 @@ _edje_part_pixel_adjust(Edje *ed,
if (params->final.w < 0 || params->final.h < 0)
ERR("The params final size became negative");
+
}
static void
@@ -3011,7 +2994,7 @@ _edje_part_recalc_single(Edje *ed,
params->final.w = TO_INT(params->eval.w);
params->final.h = TO_INT(params->eval.h);
- _edje_part_pixel_adjust(ed, ep, params, EINA_FALSE);
+ _edje_part_pixel_adjust(ed, ep, params);
/* fill */
if (ep->part->type == EDJE_PART_TYPE_IMAGE)
_edje_part_recalc_single_fill(ep, &((Edje_Part_Description_Image *)desc)->image.fill, params);
@@ -3614,7 +3597,7 @@ _edje_physics_body_add(Edje *ed, Edje_Real_Part *rp, EPhysics_World *world)
? (_x1) \
: ADD(_x1, MUL(_p, SUB(_x2, _x1))));
-#define INTP(_x1, _x2, _p) TO_INT_ROUND(FINTP(_x1, _x2, _p))
+#define INTP(_x1, _x2, _p) TO_INT(FINTP(_x1, _x2, _p))
static void
_map_colors_free(Edje_Calc_Params *pf)
@@ -4501,7 +4484,7 @@ _edje_part_recalc(Edje *ed, Edje_Real_Part *ep, int flags, Edje_Calc_Params *sta
p3->req.w = INTP(p1->req.w, p2->req.w, pos);
p3->req.h = INTP(p1->req.h, p2->req.h, pos);
- _edje_part_pixel_adjust(ed, ep, p3, EINA_TRUE);
+ _edje_part_pixel_adjust(ed, ep, p3);
if (ep->part->dragable.x)
{
diff --git a/src/lib/edje/edje_private.h b/src/lib/edje/edje_private.h
index fbff62f664..0e6f68f564 100644
--- a/src/lib/edje/edje_private.h
+++ b/src/lib/edje/edje_private.h
@@ -155,9 +155,7 @@ EAPI extern int _edje_default_log_dom ;
#define FROM_DOUBLE(a) eina_f32p32_double_from(a)
#define FROM_INT(a) eina_f32p32_int_from(a)
#define TO_INT(a) eina_f32p32_int_to(a)
-#define TO_INT_ROUND(a) (((a) >= 0.0) \
- ? eina_f32p32_int_to(ADD(a, FROM_DOUBLE(0.5)) \
- : eina_f32p32_int_to(ADD(a, FROM_DOUBLE(-0.5))
+#define TO_INT_ROUND(a) eina_f32p32_int_to(ADD(a, FROM_DOUBLE(0.5)))
#define ZERO 0
#define COS(a) eina_f32p32_cos(a)
#define SIN(a) eina_f32p32_sin(a)
@@ -180,7 +178,7 @@ EAPI extern int _edje_default_log_dom ;
#define FROM_DOUBLE(a) (a)
#define FROM_INT(a) (double)(a)
#define TO_INT(a) (int)(a)
-#define TO_INT_ROUND(a) (((a) >= 0.0) ? (int)(a + 0.5) : (int)(a - 0.5))
+#define TO_INT_ROUND(a) (int)(a + 0.5)
#define ZERO 0.0
#define COS(a) cos(a)
#define SIN(a) sin(a)
diff --git a/src/lib/eio/efl_io_model.c b/src/lib/eio/efl_io_model.c
index 300dac0e21..f5d46649d0 100644
--- a/src/lib/eio/efl_io_model.c
+++ b/src/lib/eio/efl_io_model.c
@@ -496,12 +496,6 @@ _property_filename_cb(const Eo *obj, Efl_Io_Model_Data *pd)
}
static Eina_Value *
-_property_path_cb(const Eo *obj EINA_UNUSED, Efl_Io_Model_Data *pd)
-{
- return eina_value_stringshare_new(pd->path);
-}
-
-static Eina_Value *
_property_direct_info_cb(const Eo *obj, Efl_Io_Model_Data *pd)
{
_efl_io_model_info_build(obj, pd);
@@ -620,7 +614,7 @@ static struct {
const char *name;
Eina_Value *(*cb)(const Eo *obj, Efl_Io_Model_Data *pd);
} properties[] = {
- PP(filename), PP(path),
+ PP(filename),
PP(direct_info),
PP(mtime), PP(atime), PP(ctime), PP(is_dir), PP(is_lnk), PP(size),
PP(stat),
@@ -649,9 +643,7 @@ _efl_io_model_efl_model_property_get(const Eo *obj, Efl_Io_Model_Data *pd, const
!strcmp(property, properties[i].name))
return properties[i].cb(obj, pd);
- ERR("Could not find property '%s'.", property);
- // Unknow value request
- return eina_value_error_new(EFL_MODEL_ERROR_NOT_SUPPORTED);
+ return efl_model_property_get(efl_super(obj, EFL_IO_MODEL_CLASS), property);
}
static Eina_Future *
diff --git a/src/lib/elementary/efl_ui_layout.c b/src/lib/elementary/efl_ui_layout.c
index 63f9491467..fa47bc1d1f 100644
--- a/src/lib/elementary/efl_ui_layout.c
+++ b/src/lib/elementary/efl_ui_layout.c
@@ -1010,8 +1010,11 @@ _efl_ui_layout_content_set(Eo *obj, Efl_Ui_Layout_Data *sd, const char *part, Ev
if (!strcmp(part, sub_d->part))
{
if (content == sub_d->obj) goto end;
- _eo_unparent_helper(sub_d->obj, obj);
- evas_object_del(sub_d->obj);
+ if (efl_alive_get(sub_d->obj))
+ {
+ _eo_unparent_helper(sub_d->obj, obj);
+ evas_object_del(sub_d->obj);
+ }
break;
}
/* was previously swallowed at another part -- mimic
diff --git a/src/lib/elementary/efl_ui_panel.c b/src/lib/elementary/efl_ui_panel.c
index 84aa6f08d9..bfa7a9391d 100644
--- a/src/lib/elementary/efl_ui_panel.c
+++ b/src/lib/elementary/efl_ui_panel.c
@@ -711,24 +711,36 @@ _efl_ui_panel_efl_ui_widget_widget_input_event_handler(Eo *obj, Efl_Ui_Panel_Dat
return _panel_efl_ui_widget_widget_input_event_handler(obj, pd, eo_event, src);
}
+static void
+_invalidate_cb(void *data, const Efl_Event *ev EINA_UNUSED)
+{
+ efl_content_set(data, NULL);
+}
+
static Eina_Bool
_efl_ui_panel_efl_content_content_set(Eo *obj, Efl_Ui_Panel_Data *sd, Efl_Gfx_Entity *content)
{
if (sd->content == content) return EINA_TRUE;
+
if (sd->content)
- evas_object_box_remove_all(sd->bx, EINA_TRUE);
+ {
+ efl_event_callback_del(sd->content, EFL_EVENT_INVALIDATE, _invalidate_cb, obj);
+ if (!efl_invalidated_get(sd->content) && !efl_invalidating_get(sd->content))
+ efl_del(sd->content);
+ sd->content = NULL;
+ }
+ if (content && !elm_widget_sub_object_add(obj, content)) return EINA_FALSE;
sd->content = content;
- if (content)
+ if (sd->content)
{
+ efl_event_callback_add(sd->content, EFL_EVENT_INVALIDATE, _invalidate_cb, obj);
evas_object_box_append(sd->bx, sd->content);
evas_object_show(sd->content);
if (sd->scrollable)
elm_widget_sub_object_add(sd->scr_ly, sd->content);
- else
- elm_widget_sub_object_add(obj, sd->content);
}
efl_event_callback_call(obj, EFL_CONTENT_EVENT_CONTENT_CHANGED, content);
- if (efl_finalized_get(obj))
+ if (efl_alive_get(obj))
elm_layout_sizing_eval(obj);
return EINA_TRUE;
@@ -741,18 +753,10 @@ _efl_ui_panel_efl_content_content_get(const Eo *obj EINA_UNUSED, Efl_Ui_Panel_Da
}
static Efl_Gfx_Entity*
-_efl_ui_panel_efl_content_content_unset(Eo *obj EINA_UNUSED, Efl_Ui_Panel_Data *sd)
+_efl_ui_panel_efl_content_content_unset(Eo *obj EINA_UNUSED, Efl_Ui_Panel_Data *sd EINA_UNUSED)
{
- Efl_Gfx_Entity *ret = NULL;
-
- if (!sd->content) return NULL;
- ret = sd->content;
-
- evas_object_box_remove_all(sd->bx, EINA_FALSE);
- if (sd->scrollable)
- _elm_widget_sub_object_redirect_to_top(sd->scr_ly, sd->content);
- sd->content = NULL;
- efl_event_callback_call(obj, EFL_CONTENT_EVENT_CONTENT_CHANGED, NULL);
+ Efl_Gfx_Entity *ret = efl_content_get(obj);
+ efl_content_set(obj, NULL);
return ret;
}
diff --git a/src/lib/elementary/efl_ui_popup.c b/src/lib/elementary/efl_ui_popup.c
index 47ef65b4a9..341de7e750 100644
--- a/src/lib/elementary/efl_ui_popup.c
+++ b/src/lib/elementary/efl_ui_popup.c
@@ -112,6 +112,8 @@ _efl_ui_popup_efl_ui_widget_widget_parent_set(Eo *obj, Efl_Ui_Popup_Data *pd EIN
efl_event_callback_add(pd->win_parent, EFL_GFX_ENTITY_EVENT_SIZE_CHANGED, _parent_geom_cb, obj);
efl_event_callback_add(pd->win_parent, EFL_GFX_ENTITY_EVENT_POSITION_CHANGED, _parent_geom_cb, obj);
+
+ efl_ui_widget_parent_set(efl_super(obj, MY_CLASS), parent);
}
EOLIAN static void
diff --git a/src/lib/elementary/efl_ui_relative_layout.c b/src/lib/elementary/efl_ui_relative_layout.c
index fa47d7591c..66bedb87ef 100644
--- a/src/lib/elementary/efl_ui_relative_layout.c
+++ b/src/lib/elementary/efl_ui_relative_layout.c
@@ -446,10 +446,9 @@ _hash_child_init_foreach_cb(const Eina_Hash *hash, const void *key EINA_UNUSED,
}
static void
-_on_size_hints_changed(void *data EINA_UNUSED, Evas *e EINA_UNUSED,
- Evas_Object *obj, void *event_info EINA_UNUSED)
+_efl_ui_relative_layout_hints_changed_cb(void *data EINA_UNUSED, const Efl_Event *ev)
{
- efl_pack_layout_request(obj);
+ efl_pack_layout_request(ev->object);
}
EOLIAN static void
@@ -490,7 +489,8 @@ _efl_ui_relative_layout_efl_gfx_entity_position_set(Eo *obj, Efl_Ui_Relative_Lay
EOLIAN static void
_efl_ui_relative_layout_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Relative_Layout_Data *pd EINA_UNUSED)
{
- evas_object_event_callback_add(obj, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _on_size_hints_changed, NULL);
+ efl_event_callback_add(obj, EFL_GFX_ENTITY_EVENT_HINTS_CHANGED,
+ _efl_ui_relative_layout_hints_changed_cb, NULL);
efl_canvas_group_add(efl_super(obj, MY_CLASS));
elm_widget_highlight_ignore_set(obj, EINA_TRUE);
@@ -514,6 +514,8 @@ _efl_ui_relative_layout_efl_object_constructor(Eo *obj, Efl_Ui_Relative_Layout_D
EOLIAN static void
_efl_ui_relative_layout_efl_object_destructor(Eo *obj, Efl_Ui_Relative_Layout_Data *pd)
{
+ efl_event_callback_del(obj, EFL_GFX_ENTITY_EVENT_HINTS_CHANGED,
+ _efl_ui_relative_layout_hints_changed_cb, NULL);
eina_hash_free(pd->children);
efl_destructor(efl_super(obj, MY_CLASS));
}
diff --git a/src/lib/elementary/efl_ui_scroller.c b/src/lib/elementary/efl_ui_scroller.c
index 0fef382346..50113c12b1 100644
--- a/src/lib/elementary/efl_ui_scroller.c
+++ b/src/lib/elementary/efl_ui_scroller.c
@@ -152,11 +152,7 @@ static void
_efl_ui_scroller_content_del_cb(void *data,
const Efl_Event *event EINA_UNUSED)
{
- EFL_UI_SCROLLER_DATA_GET_OR_RETURN(data, sd);
-
- sd->content = NULL;
- if (!sd->smanager) return;
- efl_ui_scrollbar_bar_visibility_update(sd->smanager);
+ efl_content_unset(data);
}
EOLIAN static Eina_Bool
@@ -167,14 +163,23 @@ _efl_ui_scroller_efl_content_content_set(Eo *obj,
if (sd->content)
{
efl_content_set(sd->pan_obj, NULL);
- efl_event_callback_del(sd->content, EFL_EVENT_DEL,
+ efl_event_callback_del(sd->content, EFL_EVENT_INVALIDATE,
_efl_ui_scroller_content_del_cb, obj);
+ efl_del(sd->content);
+ sd->content = NULL;
+ }
+
+ if (content && !efl_ui_widget_sub_object_add(obj, content))
+ {
+ efl_event_callback_call(obj, EFL_CONTENT_EVENT_CONTENT_CHANGED, NULL);
+ return EINA_FALSE;
}
sd->content = content;
+ efl_event_callback_call(obj, EFL_CONTENT_EVENT_CONTENT_CHANGED, sd->content);
if (!content) return EINA_TRUE;
- efl_event_callback_add(sd->content, EFL_EVENT_DEL,
+ efl_event_callback_add(sd->content, EFL_EVENT_INVALIDATE,
_efl_ui_scroller_content_del_cb, obj);
efl_content_set(sd->pan_obj, content);
@@ -195,7 +200,9 @@ _efl_ui_scroller_efl_content_content_unset(Eo *obj EINA_UNUSED, Efl_Ui_Scroller_
{
Efl_Gfx_Entity *old_content = pd->content;
+ efl_event_callback_del(pd->content, EFL_EVENT_INVALIDATE, _efl_ui_scroller_content_del_cb, obj);
pd->content = NULL;
+ efl_event_callback_call(obj, EFL_CONTENT_EVENT_CONTENT_CHANGED, NULL);
if (pd->smanager)
{
efl_ui_scrollbar_bar_visibility_update(pd->smanager);
diff --git a/src/lib/elementary/efl_ui_tab_page.c b/src/lib/elementary/efl_ui_tab_page.c
index a0bd26ef70..cb17b98bcf 100644
--- a/src/lib/elementary/efl_ui_tab_page.c
+++ b/src/lib/elementary/efl_ui_tab_page.c
@@ -11,24 +11,44 @@
#define MY_CLASS EFL_UI_TAB_PAGE_CLASS
+static void
+_invalidate_cb(void *data, const Efl_Event *ev EINA_UNUSED)
+{
+ efl_content_unset(data);
+}
+
EOLIAN static Eina_Bool
_efl_ui_tab_page_efl_content_content_set(Eo *obj, Efl_Ui_Tab_Page_Data *sd, Eo *content)
{
if (sd->content)
{
efl_content_unset(efl_part(obj, "efl.content"));
+ efl_event_callback_del(sd->content, EFL_EVENT_INVALIDATE, _invalidate_cb, obj);
efl_del(sd->content);
+ sd->content = NULL;
+ }
+
+ if (content && !efl_ui_widget_sub_object_add(obj, content))
+ {
+ efl_event_callback_call(obj, EFL_CONTENT_EVENT_CONTENT_CHANGED, NULL);
+ return EINA_FALSE;
}
sd->content = content;
+ efl_event_callback_add(sd->content, EFL_EVENT_INVALIDATE, _invalidate_cb, obj);
+ efl_event_callback_call(obj, EFL_CONTENT_EVENT_CONTENT_CHANGED, content);
+
efl_content_set(efl_part(obj, "efl.content"), sd->content);
return EINA_TRUE;
}
EOLIAN static Efl_Gfx_Entity*
-_efl_ui_tab_page_efl_content_content_unset(Eo *obj, Efl_Ui_Tab_Page_Data *pd EINA_UNUSED)
+_efl_ui_tab_page_efl_content_content_unset(Eo *obj, Efl_Ui_Tab_Page_Data *pd)
{
+ efl_event_callback_del(pd->content, EFL_EVENT_INVALIDATE, _invalidate_cb, obj);
+ pd->content = NULL;
+ efl_event_callback_call(obj, EFL_CONTENT_EVENT_CONTENT_CHANGED, NULL);
return efl_content_unset(efl_part(obj, "efl.content"));
}
diff --git a/src/lib/elementary/efl_ui_table.c b/src/lib/elementary/efl_ui_table.c
index 7a11f2fb71..402b812bc8 100644
--- a/src/lib/elementary/efl_ui_table.c
+++ b/src/lib/elementary/efl_ui_table.c
@@ -1,136 +1,153 @@
#include "efl_ui_table_private.h"
-#include "../evas/canvas/evas_table_eo.h"
-
#define MY_CLASS EFL_UI_TABLE_CLASS
#define MY_CLASS_NAME "Efl.Ui.Table"
-#define MY_CLASS_NAME_LEGACY "elm_grid"
-
-typedef struct _Custom_Table_Data Custom_Table_Data;
-
-static void _subobj_del_cb(void *data, const Efl_Event *event);
-static void _item_remove(Efl_Ui_Table *obj, Efl_Ui_Table_Data *pd, Efl_Gfx_Entity *subobj);
-
-struct _Custom_Table_Data
-{
- Efl_Ui_Table *parent;
- Efl_Ui_Table_Data *gd;
-};
-EFL_CALLBACKS_ARRAY_DEFINE(subobj_callbacks,
- { EFL_EVENT_DEL, _subobj_del_cb });
+#define EFL_UI_TABLE_DATA_GET(o, pd) \
+ Efl_Ui_Table_Data *pd = efl_data_scope_get(o, EFL_UI_TABLE_CLASS)
-static void
-_mirrored_set(Evas_Object *obj, Eina_Bool rtl)
+inline static Table_Item *
+_efl_ui_table_item_date_get(Eo *obj, Efl_Ui_Table_Data *pd, Efl_Gfx_Entity *subobj)
{
- ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
-
- evas_object_table_mirrored_set(wd->resize_obj, rtl);
+ Table_Item *gi;
+ if (!efl_invalidated_get(subobj) &&
+ (obj != efl_canvas_object_render_parent_get(subobj)))
+ {
+ ERR("%p is not a child of %p", subobj, obj);
+ return NULL;
+ }
+ gi = efl_key_data_get(subobj, TABLE_ITEM_KEY);
+ if (!gi)
+ {
+ WRN("item %p has no table internal data", subobj);
+ EINA_INLIST_FOREACH(EINA_INLIST_GET(pd->items), gi)
+ {
+ if (gi->object == subobj)
+ break;
+ }
+ if (!gi)
+ {
+ ERR("item %p was not found in this table", subobj);
+ return NULL;
+ }
+ }
+ return gi;
}
-EOLIAN static Eina_Error
-_efl_ui_table_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Table_Data *pd EINA_UNUSED)
+static void
+_on_child_size_changed(void *data, const Efl_Event *event EINA_UNUSED)
{
- Eina_Error int_ret = EFL_UI_THEME_APPLY_ERROR_GENERIC;
- int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
- if (int_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) return int_ret;
-
- _mirrored_set(obj, efl_ui_mirrored_get(obj));
-
- return int_ret;
+ Eo *table = data;
+ efl_pack_layout_request(table);
}
static void
-_layout_updated_emit(Efl_Ui_Table *obj)
+_on_child_hints_changed(void *data, const Efl_Event *event EINA_UNUSED)
{
- efl_event_callback_legacy_call(obj, EFL_PACK_EVENT_LAYOUT_UPDATED, NULL);
+ Eo *table = data;
+ efl_pack_layout_request(table);
}
static void
-_sizing_eval(Evas_Object *obj, Efl_Ui_Table_Data *pd EINA_UNUSED)
+_on_child_del(void *data, const Efl_Event *event)
{
- Evas_Coord minw = 0, minh = 0, maxw = -1, maxh = -1;
- Evas_Coord w, h;
-
- ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
- if (!efl_alive_get(obj)) return;
+ Eo *table = data;
+ Table_Item *gi;
+ EFL_UI_TABLE_DATA_GET(table, pd);
- evas_object_size_hint_combined_min_get(wd->resize_obj, &minw, &minh);
- evas_object_size_hint_max_get(wd->resize_obj, &maxw, &maxh);
- evas_object_size_hint_min_set(obj, minw, minh);
- evas_object_size_hint_max_set(obj, maxw, maxh);
- evas_object_geometry_get(obj, NULL, NULL, &w, &h);
- if (w < minw) w = minw;
- if (h < minh) h = minh;
- if ((maxw >= 0) && (w > maxw)) w = maxw;
- if ((maxh >= 0) && (h > maxh)) h = maxh;
- evas_object_resize(obj, w, h);
-}
+ gi = _efl_ui_table_item_date_get(table, pd, event->object);
+ if (!gi) return;
-static void
-_table_size_hints_changed(void *data, Evas *e EINA_UNUSED,
- Evas_Object *table EINA_UNUSED,
- void *event_info EINA_UNUSED)
-{
- Efl_Ui_Table_Data *pd = efl_data_scope_get(data, MY_CLASS);
+ pd->items = (Table_Item *)
+ eina_inlist_remove(EINA_INLIST_GET(pd->items), EINA_INLIST_GET(gi));
+ free(gi);
- if (table == data)
- efl_pack_layout_request(data);
- else
- _sizing_eval(data, pd);
-}
+ pd->count--;
+ efl_key_data_set(event->object, TABLE_ITEM_KEY, NULL);
-static void
-_efl_ui_table_size_hints_changed_cb(void *data EINA_UNUSED, const Efl_Event *ev)
-{
- efl_pack_layout_request(ev->object);
+ efl_pack_layout_request(table);
}
-/* Custom table class: overrides smart_calculate. */
-static void _custom_table_calc(Eo *obj, Custom_Table_Data *pd);
+EFL_CALLBACKS_ARRAY_DEFINE(efl_ui_table_callbacks,
+ { EFL_GFX_ENTITY_EVENT_SIZE_CHANGED, _on_child_size_changed },
+ { EFL_GFX_ENTITY_EVENT_HINTS_CHANGED, _on_child_hints_changed },
+ { EFL_EVENT_DEL, _on_child_del }
+);
-static Eina_Bool
-_custom_table_initializer(Efl_Class *klass)
+static void
+_efl_ui_table_last_position_get(Eo * obj, Efl_Ui_Table_Data *pd, int *last_col, int *last_row)
{
- EFL_OPS_DEFINE(ops,
- EFL_OBJECT_OP_FUNC(efl_canvas_group_calculate, _custom_table_calc)
- );
-
- return efl_class_functions_set(klass, &ops, NULL);
-};
+ Table_Item *gi;
+ int col = -1, row = -1;
+ int req_cols, req_rows;
-static const Efl_Class_Description custom_table_class_desc = {
- EO_VERSION, "Efl.Ui.Table.Internal", EFL_CLASS_TYPE_REGULAR,
- sizeof(Custom_Table_Data), _custom_table_initializer, NULL, NULL
-};
+ if (!pd->linear_recalc)
+ {
+ *last_col = pd->last_col;
+ *last_row = pd->last_row;
+ return;
+ }
-EFL_DEFINE_CLASS(_efl_ui_table_custom_table_class_get, &custom_table_class_desc,
- EVAS_TABLE_CLASS, NULL)
+ efl_pack_table_size_get(obj, &req_cols, &req_rows);
-#define CUSTOM_TABLE_CLASS _efl_ui_table_custom_table_class_get()
+ if (efl_ui_dir_is_horizontal(pd->dir1, EINA_TRUE))
+ {
+ EINA_INLIST_REVERSE_FOREACH(EINA_INLIST_GET(pd->items), gi)
+ {
+ if ((gi->row < row) || (req_cols < gi->col) || (req_rows < gi->row))
+ continue;
+
+ if (gi->row > row)
+ {
+ row = gi->row;
+ col = gi->col;
+ }
+ else if (gi->col > col)
+ {
+ col = gi->col;
+ }
+ }
+ }
+ else
+ {
+ EINA_INLIST_REVERSE_FOREACH(EINA_INLIST_GET(pd->items), gi)
+ {
+ if ((gi->col < col) || (req_cols < gi->col) || (req_rows < gi->row))
+ continue;
+
+ if (gi->col > col)
+ {
+ col = gi->col;
+ row = gi->row;
+ }
+ else if (gi->row > row)
+ {
+ row = gi->row;
+ }
+ }
+ }
+ *last_col = col;
+ *last_row = row;
+ pd->linear_recalc = EINA_FALSE;
+}
static void
-_custom_table_calc(Eo *obj, Custom_Table_Data *pd)
+_efl_ui_table_size_hints_changed_cb(void *data EINA_UNUSED, const Efl_Event *ev)
{
- int cols, rows;
-
- evas_object_table_col_row_size_get(obj, &cols, &rows);
- if ((cols < 1) || (rows < 1)) return;
-
- efl_pack_layout_update(pd->parent);
- _layout_updated_emit(pd->parent);
+ efl_pack_layout_request(ev->object);
}
-/* End of custom table class */
EOLIAN static void
_efl_ui_table_homogeneous_set(Eo *obj, Efl_Ui_Table_Data *pd, Eina_Bool homogeneoush, Eina_Bool homogeneousv)
{
- if ((pd->homogeneoush == !!homogeneoush) &&
- (pd->homogeneousv == !!homogeneousv))
+ homogeneoush = !!homogeneoush;
+ homogeneousv = !!homogeneousv;
+
+ if ((pd->homogeneoush == homogeneoush) && (pd->homogeneousv == homogeneousv))
return;
- pd->homogeneoush = !!homogeneoush;
- pd->homogeneousv = !!homogeneousv;
+ pd->homogeneoush = homogeneoush;
+ pd->homogeneousv = homogeneousv;
efl_pack_layout_request(obj);
}
@@ -148,66 +165,50 @@ _efl_ui_table_efl_pack_layout_layout_update(Eo *obj, Efl_Ui_Table_Data *pd)
}
EOLIAN void
-_efl_ui_table_efl_canvas_group_group_calculate(Eo *obj, Efl_Ui_Table_Data *pd EINA_UNUSED)
+_efl_ui_table_efl_canvas_group_group_calculate(Eo *obj, Efl_Ui_Table_Data *_pd EINA_UNUSED)
{
- ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
-
efl_pack_layout_update(obj);
}
EOLIAN static void
-_efl_ui_table_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Table_Data *pd)
+_efl_ui_table_efl_gfx_entity_size_set(Eo *obj, Efl_Ui_Table_Data *_pd EINA_UNUSED, Eina_Size2D sz)
{
- Custom_Table_Data *custom;
- Evas_Object *table;
-
- table = efl_add(CUSTOM_TABLE_CLASS, obj);
- custom = efl_data_scope_get(table, CUSTOM_TABLE_CLASS);
- custom->gd = pd;
- custom->parent = obj;
+ efl_gfx_entity_size_set(efl_super(obj, MY_CLASS), sz);
+ efl_canvas_group_change(obj);
+}
- evas_object_table_homogeneous_set(table, EVAS_OBJECT_TABLE_HOMOGENEOUS_TABLE);
- elm_widget_resize_object_set(obj, table);
+EOLIAN static void
+_efl_ui_table_efl_gfx_entity_position_set(Eo *obj, Efl_Ui_Table_Data *_pd EINA_UNUSED, Eina_Position2D pos)
+{
+ efl_gfx_entity_position_set(efl_super(obj, MY_CLASS), pos);
+ efl_canvas_group_change(obj);
+}
- evas_object_event_callback_add
- (table, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _table_size_hints_changed, obj);
- efl_event_callback_add(obj, EFL_GFX_ENTITY_EVENT_HINTS_CHANGED,
- _efl_ui_table_size_hints_changed_cb, NULL);
+EOLIAN static void
+_efl_ui_table_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Table_Data *pd)
+{
+ pd->clipper = efl_add(EFL_CANVAS_RECTANGLE_CLASS, obj);
+ evas_object_static_clip_set(pd->clipper, EINA_TRUE);
+ efl_gfx_entity_geometry_set(pd->clipper, EINA_RECT(-49999, -49999, 99999, 99999));
+ efl_canvas_group_member_add(obj, pd->clipper);
+ efl_ui_widget_sub_object_add(obj, pd->clipper);
efl_canvas_group_add(efl_super(obj, MY_CLASS));
+ elm_widget_sub_object_parent_add(obj);
- elm_widget_can_focus_set(obj, EINA_FALSE);
+ efl_ui_widget_focus_allow_set(obj, EINA_FALSE);
elm_widget_highlight_ignore_set(obj, EINA_FALSE);
- efl_ui_widget_theme_apply(obj);
+ efl_event_callback_add(obj, EFL_GFX_ENTITY_EVENT_HINTS_CHANGED,
+ _efl_ui_table_size_hints_changed_cb, NULL);
}
EOLIAN static void
-_efl_ui_table_efl_canvas_group_group_del(Eo *obj, Efl_Ui_Table_Data *pd EINA_UNUSED)
+_efl_ui_table_efl_canvas_group_group_del(Eo *obj, Efl_Ui_Table_Data *_pd EINA_UNUSED)
{
- Eina_List *l;
- Evas_Object *child;
-
- ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
-
- evas_object_event_callback_del_full
- (wd->resize_obj, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
- _table_size_hints_changed, obj);
efl_event_callback_del(obj, EFL_GFX_ENTITY_EVENT_HINTS_CHANGED,
_efl_ui_table_size_hints_changed_cb, NULL);
- /* let's make our table object the *last* to be processed, since it
- * may (smart) parent other sub objects here */
- EINA_LIST_FOREACH(wd->subobjs, l, child)
- {
- if (child == wd->resize_obj)
- {
- wd->subobjs =
- eina_list_demote_list(wd->subobjs, l);
- break;
- }
- }
-
efl_canvas_group_del(efl_super(obj, MY_CLASS));
}
@@ -216,6 +217,7 @@ _efl_ui_table_efl_object_constructor(Eo *obj, Efl_Ui_Table_Data *pd)
{
obj = efl_constructor(efl_super(obj, MY_CLASS));
efl_canvas_object_type_set(obj, MY_CLASS_NAME);
+ efl_access_object_access_type_set(obj, EFL_ACCESS_TYPE_SKIPPED);
efl_access_object_role_set(obj, EFL_ACCESS_ROLE_FILLER);
pd->dir1 = EFL_UI_DIR_RIGHT;
@@ -224,38 +226,35 @@ _efl_ui_table_efl_object_constructor(Eo *obj, Efl_Ui_Table_Data *pd)
pd->last_row = -1;
pd->req_cols = 0;
pd->req_rows = 0;
+ pd->cols = 0;
+ pd->rows = 0;
pd->align.h = 0.5;
pd->align.v = 0.5;
return obj;
}
-
-
EOLIAN static void
-_efl_ui_table_efl_pack_pack_padding_set(Eo *obj, Efl_Ui_Table_Data *pd EINA_UNUSED, double h, double v, Eina_Bool scalable)
+_efl_ui_table_efl_pack_pack_padding_set(Eo *obj, Efl_Ui_Table_Data *pd, double h, double v, Eina_Bool scalable)
{
- ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
-
+ scalable = !!scalable;
if (h < 0) h = 0;
if (v < 0) v = 0;
+
+ if (EINA_DBL_EQ(pd->pad.h, h) && EINA_DBL_EQ(pd->pad.v, v) &&
+ (pd->pad.scalable == scalable))
+ return;
+
pd->pad.h = h;
pd->pad.v = v;
- pd->pad.scalable = !!scalable;
- if (pd->pad.scalable)
- {
- double scale = elm_object_scale_get(obj);
- evas_object_table_padding_set(wd->resize_obj, h * scale, v * scale);
- }
- else
- evas_object_table_padding_set(wd->resize_obj, h, v);
+ pd->pad.scalable = scalable;
+
+ efl_pack_layout_request(obj);
}
EOLIAN static void
-_efl_ui_table_efl_pack_pack_padding_get(const Eo *obj, Efl_Ui_Table_Data *pd EINA_UNUSED, double *h, double *v, Eina_Bool *scalable)
+_efl_ui_table_efl_pack_pack_padding_get(const Eo *obj EINA_UNUSED, Efl_Ui_Table_Data *pd, double *h, double *v, Eina_Bool *scalable)
{
- ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
-
if (scalable) *scalable = pd->pad.scalable;
if (h) *h = pd->pad.h;
if (v) *v = pd->pad.v;
@@ -264,12 +263,14 @@ _efl_ui_table_efl_pack_pack_padding_get(const Eo *obj, Efl_Ui_Table_Data *pd EIN
EOLIAN static void
_efl_ui_table_efl_pack_pack_align_set(Eo *obj, Efl_Ui_Table_Data *pd, double h, double v)
{
- ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
-
if (h < 0) h = -1;
+ else if (h > 1) h = 1;
if (v < 0) v = -1;
- if (h > 1) h = 1;
- if (v > 1) v = 1;
+ else if (v > 1) v = 1;
+
+ if (EINA_DBL_EQ(pd->align.h, h) && EINA_DBL_EQ(pd->align.v, v))
+ return;
+
pd->align.h = h;
pd->align.v = v;
@@ -283,38 +284,20 @@ _efl_ui_table_efl_pack_pack_align_get(const Eo *obj EINA_UNUSED, Efl_Ui_Table_Da
if (v) *v = pd->align.v;
}
-static void
-_subobj_del_cb(void *data, const Efl_Event *event)
-{
- Efl_Ui_Table *obj = data;
- Efl_Ui_Table_Data *pd = efl_data_scope_get(obj, EFL_UI_TABLE_CLASS);
-
- efl_event_callback_array_del(event->object, subobj_callbacks(), data);
- _item_remove(obj, pd, event->object);
-
- if (!elm_widget_sub_object_del(obj, event->object))
- WRN("failed to remove child from its parent");
-}
-
static Eina_Bool
-_pack_at(Eo *obj, Efl_Ui_Table_Data *pd, Efl_Gfx_Entity *subobj,
- int col, int row, int colspan, int rowspan, Eina_Bool linear)
+_pack_at(Eo *obj, Efl_Ui_Table_Data *pd, Efl_Gfx_Entity *subobj, int col, int row, int colspan, int rowspan)
{
- Table_Item *gi = NULL;
-
- ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
-
- gi = efl_key_data_get(subobj, TABLE_ITEM_KEY);
+ Table_Item *gi;
- if (gi && efl_ui_widget_parent_get(subobj) == obj)
+ if (efl_key_data_get(subobj, TABLE_ITEM_KEY))
{
- ERR("subobj %p %s is already added to this", subobj, efl_class_name_get(subobj) );
+ if (efl_canvas_object_render_parent_get(subobj) == obj)
+ ERR("subobj %p %s is already added to this", subobj, efl_class_name_get(subobj));
+ else
+ ERR("subobj %p %s currently belongs to different table", subobj, efl_class_name_get(subobj));
+
return EINA_FALSE;
}
- else if (gi && efl_ui_widget_parent_get(subobj) != obj)
- {
- gi = NULL;
- }
if (col < 0) col = 0;
if (row < 0) row = 0;
@@ -337,28 +320,39 @@ _pack_at(Eo *obj, Efl_Ui_Table_Data *pd, Efl_Gfx_Entity *subobj,
col, row, colspan, rowspan, pd->req_cols, pd->req_rows);
}
- if (!gi)
- {
- if (!elm_widget_sub_object_add(obj, subobj))
- return EINA_FALSE;
- gi = calloc(1, sizeof(*gi));
- if (!gi) return EINA_FALSE;
- gi->col = col;
- gi->row = row;
- gi->col_span = colspan;
- gi->row_span = rowspan;
- gi->linear = !!linear;
- gi->object = subobj; // xref(, obj);
- pd->count++;
- pd->items = (Table_Item *)
- eina_inlist_append(EINA_INLIST_GET(pd->items), EINA_INLIST_GET(gi));
+ if (!efl_ui_widget_sub_object_add(obj, subobj))
+ return EINA_FALSE;
- efl_key_data_set(subobj, TABLE_ITEM_KEY, gi);
- efl_event_callback_legacy_call(obj, EFL_CONTAINER_EVENT_CONTENT_ADDED, subobj);
- efl_event_callback_array_add(subobj, subobj_callbacks(), obj);
- }
+ gi = calloc(1, sizeof(*gi));
+ if (!gi) return EINA_FALSE;
+ gi->col = col;
+ gi->row = row;
+ gi->col_span = colspan;
+ gi->row_span = rowspan;
+ gi->object = subobj;
+ pd->count++;
+ pd->items = (Table_Item *)
+ eina_inlist_append(EINA_INLIST_GET(pd->items), EINA_INLIST_GET(gi));
+
+ efl_key_data_set(subobj, TABLE_ITEM_KEY, gi);
+ efl_key_data_set(subobj, "_elm_leaveme", obj);
+ efl_canvas_object_clipper_set(subobj, pd->clipper);
+ efl_event_callback_array_add(subobj, efl_ui_table_callbacks(), obj);
- return evas_object_table_pack(wd->resize_obj, subobj, col, row, colspan, rowspan);
+ efl_canvas_group_member_add(obj, subobj);
+ efl_event_callback_call(obj, EFL_CONTAINER_EVENT_CONTENT_ADDED, subobj);
+
+ if ((gi->col > pd->last_col) || (gi->row > pd->last_row))
+ pd->linear_recalc = EINA_TRUE;
+
+ if (pd->cols < gi->col + gi->col_span)
+ pd->cols = gi->col + gi->col_span;
+ if (pd->rows < gi->row + gi->row_span)
+ pd->rows = gi->row + gi->row_span;
+
+ efl_pack_layout_request(obj);
+
+ return EINA_TRUE;
}
EOLIAN static Eina_Bool
@@ -368,35 +362,26 @@ _efl_ui_table_efl_pack_table_pack_table(Eo *obj, Efl_Ui_Table_Data *pd,
{
EINA_SAFETY_ON_NULL_RETURN_VAL(subobj, EINA_FALSE);
- return _pack_at(obj, pd, subobj, col, row, colspan, rowspan, EINA_FALSE);
+ return _pack_at(obj, pd, subobj, col, row, colspan, rowspan);
}
EOLIAN static Eina_Bool
-_efl_ui_table_efl_pack_table_table_position_get(const Eo *obj, Efl_Ui_Table_Data *pd EINA_UNUSED, Evas_Object *subobj, int *col, int *row, int *colspan, int *rowspan)
+_efl_ui_table_efl_pack_table_table_position_get(const Eo *obj, Efl_Ui_Table_Data *pd, Evas_Object *subobj, int *col, int *row, int *colspan, int *rowspan)
{
int c = -1, r = -1, cs = 0, rs = 0;
Table_Item *gi;
Eina_Bool ret = EINA_FALSE;
- if (obj != elm_widget_parent_widget_get(subobj))
- {
- if (efl_invalidated_get(subobj)) goto end;
- ERR("%p is not a child of %p", subobj, obj);
- goto end;
- }
-
- gi = efl_key_data_get(subobj, TABLE_ITEM_KEY);
+ gi = _efl_ui_table_item_date_get((Eo *)obj, pd, subobj);
if (gi)
{
c = gi->col;
r = gi->row;
cs = gi->col_span;
rs = gi->row_span;
+ ret = EINA_TRUE;
}
- ret = EINA_TRUE;
-
-end:
if (col) *col = c;
if (row) *row = r;
if (colspan) *colspan = cs;
@@ -405,96 +390,86 @@ end:
}
EOLIAN static Efl_Gfx_Entity *
-_efl_ui_table_efl_pack_table_table_content_get(Eo *obj, Efl_Ui_Table_Data *pd EINA_UNUSED, int col, int row)
+_efl_ui_table_efl_pack_table_table_content_get(Eo *obj EINA_UNUSED, Efl_Ui_Table_Data *pd, int col, int row)
{
- ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL);
+ Table_Item *gi;
+ EINA_INLIST_FOREACH(EINA_INLIST_GET(pd->items), gi)
+ {
+ if (gi->col == col && gi->row == row)
+ return gi->object;
+ }
- return evas_object_table_child_get(wd->resize_obj, col, row);
+ return NULL;
}
-static void
-_item_remove(Efl_Ui_Table *obj, Efl_Ui_Table_Data *pd, Efl_Gfx_Entity *subobj)
+static Eina_Bool
+_item_remove(Efl_Ui_Table *obj, Efl_Ui_Table_Data *pd, Table_Item *gi)
{
- Table_Item *gi = efl_key_data_get(subobj, TABLE_ITEM_KEY);
- Table_Item *gi2, *last = NULL;
+ Efl_Gfx_Entity *subobj = gi->object;
- if (!gi)
- {
- WRN("item %p has no table internal data", subobj);
- EINA_INLIST_FOREACH(EINA_INLIST_GET(pd->items), gi)
- if (gi->object == subobj)
- break;
- if (!gi)
- {
- ERR("item %p was not found in this table", subobj);
- return;
- }
- }
+ if (!subobj || !_elm_widget_sub_object_redirect_to_top(obj, subobj))
+ return EINA_FALSE;
- if (!gi->linear)
- goto end;
+ efl_canvas_object_clipper_set(subobj, NULL);
+ efl_key_data_set(subobj, "_elm_leaveme", NULL);
+ efl_key_data_set(subobj, TABLE_ITEM_KEY, NULL);
+ efl_event_callback_array_del(subobj, efl_ui_table_callbacks(), obj);
- EINA_INLIST_REVERSE_FOREACH(EINA_INLIST_GET(pd->items), gi2)
- {
- if (gi2 == gi) continue;
- if (!gi2->linear) continue;
- last = gi2;
- break;
- }
- if (last)
- {
- if (efl_ui_dir_is_horizontal(pd->dir1, EINA_TRUE))
- {
- pd->last_col = last->col + last->col_span - 1;
- pd->last_row = last->row;
- }
- else
- {
- pd->last_row = last->row + last->row_span - 1;
- pd->last_col = last->col;
- }
- }
- else
- {
- pd->last_col = -1;
- pd->last_row = -1;
- }
+ efl_canvas_group_member_remove(obj, subobj);
+ efl_event_callback_call(obj, EFL_CONTAINER_EVENT_CONTENT_REMOVED, subobj);
+
+ if ((gi->col == pd->last_col) && (gi->row == pd->last_row))
+ pd->linear_recalc = EINA_TRUE;
+
+ if (gi->col + gi->col_span >= pd->cols)
+ pd->cols_recalc = EINA_TRUE;
+ if (gi->row + gi->row_span >= pd->rows)
+ pd->rows_recalc = EINA_TRUE;
-end:
- efl_event_callback_legacy_call(obj, EFL_CONTAINER_EVENT_CONTENT_REMOVED, subobj);
pd->items = (Table_Item *)
eina_inlist_remove(EINA_INLIST_GET(pd->items), EINA_INLIST_GET(gi));
- pd->count--;
- efl_key_data_set(subobj, TABLE_ITEM_KEY, NULL);
- efl_event_callback_array_del(subobj, subobj_callbacks(), obj);
free(gi);
+
+ pd->count--;
+ efl_pack_layout_request(obj);
+
+ return EINA_TRUE;
}
EOLIAN static Eina_Bool
_efl_ui_table_efl_pack_unpack(Eo *obj, Efl_Ui_Table_Data *pd, Efl_Gfx_Entity *subobj)
{
- ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
+ Table_Item *gi = _efl_ui_table_item_date_get(obj, pd, subobj);
+ if (!gi) return EINA_FALSE;
- _item_remove(obj, pd, subobj);
- if (evas_object_table_unpack(wd->resize_obj, subobj))
- {
- if (elm_widget_sub_object_del(obj, subobj))
- return EINA_TRUE;
- return EINA_FALSE; // oops - unlikely
- }
-
- return EINA_FALSE;
+ return _item_remove(obj, pd, gi);
}
EOLIAN static Eina_Bool
_efl_ui_table_efl_pack_pack_clear(Eo *obj, Efl_Ui_Table_Data *pd)
{
- ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
+ Table_Item *gi;
- while (pd->items)
- _item_remove(obj, pd, pd->items->object);
+ EINA_INLIST_FREE(EINA_INLIST_GET(pd->items), gi)
+ {
+ efl_event_callback_array_del(gi->object, efl_ui_table_callbacks(), obj);
+ efl_del(gi->object);
- evas_object_table_clear(wd->resize_obj, EINA_TRUE);
+ pd->items = (Table_Item *)
+ eina_inlist_remove(EINA_INLIST_GET(pd->items), EINA_INLIST_GET(gi));
+ free(gi);
+ }
+
+ pd->linear_recalc = EINA_TRUE;
+ pd->cols_recalc = EINA_TRUE;
+ pd->rows_recalc = EINA_TRUE;
+
+ pd->last_col = -1;
+ pd->last_row = -1;
+ pd->cols = 0;
+ pd->rows = 0;
+ pd->count = 0;
+ efl_pack_layout_request(obj);
return EINA_TRUE;
}
@@ -502,79 +477,106 @@ _efl_ui_table_efl_pack_pack_clear(Eo *obj, Efl_Ui_Table_Data *pd)
EOLIAN static Eina_Bool
_efl_ui_table_efl_pack_unpack_all(Eo *obj, Efl_Ui_Table_Data *pd)
{
- ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
+ Table_Item *gi;
+ Eina_Bool ret = EINA_TRUE;
- while (pd->items)
- _item_remove(obj, pd, pd->items->object);
+ EINA_INLIST_FREE(EINA_INLIST_GET(pd->items), gi)
+ ret &= _item_remove(obj, pd, gi);
- evas_object_table_clear(wd->resize_obj, EINA_FALSE);
+ pd->linear_recalc = EINA_TRUE;
+ pd->cols_recalc = EINA_TRUE;
+ pd->rows_recalc = EINA_TRUE;
- return EINA_TRUE;
+ pd->last_col = -1;
+ pd->last_row = -1;
+ pd->cols = 0;
+ pd->rows = 0;
+
+ return ret;
}
EOLIAN static void
_efl_ui_table_efl_pack_layout_layout_request(Eo *obj, Efl_Ui_Table_Data *pd EINA_UNUSED)
{
- evas_object_smart_need_recalculate_set(obj, EINA_TRUE);
+ efl_canvas_group_need_recalculate_set(obj, EINA_TRUE);
}
static Eina_Bool
-_table_item_iterator_next(Table_Item_Iterator *it, void **data)
+_efl_ui_table_item_iterator_next(Table_Item_Iterator *it, void **data)
{
- Efl_Gfx_Entity *sub;
+ Table_Item *gi;
- if (!eina_iterator_next(it->real_iterator, (void **) &sub))
+ if (!it->cur)
return EINA_FALSE;
- if (data) *data = sub;
+ if (data)
+ {
+ gi = EINA_INLIST_CONTAINER_GET(it->cur, Table_Item);
+ *data = gi->object;
+ }
+
+ it->cur = it->cur->next;
+
return EINA_TRUE;
}
static Eo *
-_table_item_iterator_get_container(Table_Item_Iterator *it)
+_efl_ui_table_item_iterator_get_container(Table_Item_Iterator *it)
{
return it->object;
}
static void
-_table_item_iterator_free(Table_Item_Iterator *it)
+_efl_ui_table_item_iterator_free(Table_Item_Iterator *it)
{
- eina_iterator_free(it->real_iterator);
- eina_list_free(it->list);
free(it);
}
static inline Eina_Iterator *
-_table_item_iterator_create(Eo *obj, Eina_List *list)
+_efl_ui_table_item_iterator_create(Eo *obj, Eina_Inlist *list)
{
Table_Item_Iterator *it;
- if (!list) return NULL;
it = calloc(1, sizeof(*it));
if (!it) return NULL;
EINA_MAGIC_SET(&it->iterator, EINA_MAGIC_ITERATOR);
- it->list = list;
- it->real_iterator = eina_list_iterator_new(it->list);
- it->iterator.version = EINA_ITERATOR_VERSION;
- it->iterator.next = FUNC_ITERATOR_NEXT(_table_item_iterator_next);
- it->iterator.get_container = FUNC_ITERATOR_GET_CONTAINER(_table_item_iterator_get_container);
- it->iterator.free = FUNC_ITERATOR_FREE(_table_item_iterator_free);
it->object = obj;
+ it->cur = list;
+
+ it->iterator.version = EINA_ITERATOR_VERSION;
+ it->iterator.next = FUNC_ITERATOR_NEXT(_efl_ui_table_item_iterator_next);
+ it->iterator.get_container = FUNC_ITERATOR_GET_CONTAINER(
+ _efl_ui_table_item_iterator_get_container);
+ it->iterator.free = FUNC_ITERATOR_FREE(_efl_ui_table_item_iterator_free);
return &it->iterator;
}
EOLIAN static Eina_Iterator *
-_efl_ui_table_efl_container_content_iterate(Eo *obj, Efl_Ui_Table_Data *pd EINA_UNUSED)
+_efl_ui_table_efl_container_content_iterate(Eo *obj, Efl_Ui_Table_Data *pd)
{
- Eina_List *list;
+ Table_Item_Iterator *it;
+
+ if (!pd->count)
+ return NULL;
+
+ it = calloc(1, sizeof(*it));
+ if (!it) return NULL;
+
+ EINA_MAGIC_SET(&it->iterator, EINA_MAGIC_ITERATOR);
+
+ it->object = obj;
+ it->cur = EINA_INLIST_GET(pd->items);
- ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL);
+ it->iterator.version = EINA_ITERATOR_VERSION;
+ it->iterator.next = FUNC_ITERATOR_NEXT(_efl_ui_table_item_iterator_next);
+ it->iterator.get_container = FUNC_ITERATOR_GET_CONTAINER(
+ _efl_ui_table_item_iterator_get_container);
+ it->iterator.free = FUNC_ITERATOR_FREE(_efl_ui_table_item_iterator_free);
- list = evas_object_table_children_get(wd->resize_obj);
- return _table_item_iterator_create(obj, list);
+ return &it->iterator;
}
EOLIAN static int
@@ -584,36 +586,35 @@ _efl_ui_table_efl_container_content_count(Eo *obj EINA_UNUSED, Efl_Ui_Table_Data
}
EOLIAN static Eina_Iterator *
-_efl_ui_table_efl_pack_table_table_contents_get(Eo *obj, Efl_Ui_Table_Data *pd EINA_UNUSED,
- int col, int row, Eina_Bool below)
+_efl_ui_table_efl_pack_table_table_contents_get(Eo *obj EINA_UNUSED, Efl_Ui_Table_Data *pd, int col, int row, Eina_Bool below)
{
- Eina_List *list, *atlist = NULL;
- Evas_Object *sobj;
-
- ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL);
+ Table_Item *gi;
+ Eina_List *atlist = NULL;
- list = evas_object_table_children_get(wd->resize_obj);
- EINA_LIST_FREE(list, sobj)
+ EINA_INLIST_FOREACH(EINA_INLIST_GET(pd->items), gi)
{
- Table_Item *gi = efl_key_data_get(sobj, TABLE_ITEM_KEY);
- if (!gi) continue;
-
if ((gi->col == col) && (gi->row == row))
- atlist = eina_list_append(atlist, sobj);
+ atlist = eina_list_append(atlist, gi->object);
else if (below)
{
if ((gi->col <= col) && (gi->col + gi->col_span >= col) &&
(gi->row <= row) && (gi->row + gi->row_span >= row))
- atlist = eina_list_append(atlist, sobj);
+ atlist = eina_list_append(atlist, gi->object);
}
}
- return _table_item_iterator_create(obj, atlist);
+ return eina_list_iterator_new(atlist);
}
EOLIAN static void
_efl_ui_table_efl_ui_direction_direction_set(Eo *obj, Efl_Ui_Table_Data *pd, Efl_Ui_Dir dir)
{
+ if (pd->dir1 == dir)
+ return;
+
+ if (dir == EFL_UI_DIR_DEFAULT)
+ dir = EFL_UI_DIR_RIGHT;
+
pd->dir1 = dir;
/* if both directions are either horizontal or vertical, need to adjust
@@ -621,10 +622,10 @@ _efl_ui_table_efl_ui_direction_direction_set(Eo *obj, Efl_Ui_Table_Data *pd, Efl
if (efl_ui_dir_is_horizontal(pd->dir1, EINA_TRUE) ==
efl_ui_dir_is_horizontal(pd->dir2, EINA_FALSE))
{
- if (!efl_ui_dir_is_horizontal(pd->dir1, EINA_TRUE))
- pd->dir2 = EFL_UI_DIR_RIGHT;
- else
+ if (efl_ui_dir_is_horizontal(pd->dir1, EINA_TRUE))
pd->dir2 = EFL_UI_DIR_DOWN;
+ else
+ pd->dir2 = EFL_UI_DIR_RIGHT;
}
efl_pack_layout_request(obj);
@@ -639,6 +640,9 @@ _efl_ui_table_efl_ui_direction_direction_get(const Eo *obj EINA_UNUSED, Efl_Ui_T
EOLIAN static void
_efl_ui_table_efl_pack_table_table_direction_set(Eo *obj, Efl_Ui_Table_Data *pd, Efl_Ui_Dir primary, Efl_Ui_Dir secondary)
{
+ if ((pd->dir1 == primary) && (pd->dir2 == secondary))
+ return;
+
pd->dir1 = primary;
pd->dir2 = secondary;
@@ -664,19 +668,23 @@ _efl_ui_table_efl_pack_table_table_direction_get(const Eo *obj EINA_UNUSED, Efl_
}
EOLIAN static void
-_efl_ui_table_efl_pack_table_table_size_set(Eo *obj, Efl_Ui_Table_Data *pd EINA_UNUSED, int cols, int rows)
+_efl_ui_table_efl_pack_table_table_size_set(Eo *obj, Efl_Ui_Table_Data *pd, int cols, int rows)
{
if (cols < 0) cols = 0;
if (rows < 0) rows = 0;
+ if ((pd->req_cols == cols) && (pd->req_rows == rows))
+ return;
+
pd->req_cols = cols;
pd->req_rows = rows;
+ pd->linear_recalc = EINA_TRUE;
efl_pack_layout_request(obj);
}
EOLIAN static void
-_efl_ui_table_efl_pack_table_table_size_get(const Eo *obj EINA_UNUSED, Efl_Ui_Table_Data *pd EINA_UNUSED, int *cols, int *rows)
+_efl_ui_table_efl_pack_table_table_size_get(const Eo *obj, Efl_Ui_Table_Data *pd EINA_UNUSED, int *cols, int *rows)
{
if (cols) *cols = efl_pack_table_columns_get(obj);
if (rows) *rows = efl_pack_table_rows_get(obj);
@@ -685,7 +693,11 @@ _efl_ui_table_efl_pack_table_table_size_get(const Eo *obj EINA_UNUSED, Efl_Ui_Ta
EOLIAN static void
_efl_ui_table_efl_pack_table_table_columns_set(Eo *obj, Efl_Ui_Table_Data *pd, int columns)
{
+ if (pd->req_cols == columns)
+ return;
+
pd->req_cols = columns;
+ pd->linear_recalc = EINA_TRUE;
efl_pack_layout_request(obj);
}
@@ -693,20 +705,28 @@ _efl_ui_table_efl_pack_table_table_columns_set(Eo *obj, Efl_Ui_Table_Data *pd, i
EOLIAN static int
_efl_ui_table_efl_pack_table_table_columns_get(const Eo *obj EINA_UNUSED, Efl_Ui_Table_Data *pd)
{
- if (!pd->req_cols)
+ Table_Item *gi;
+ if (pd->cols_recalc)
{
- ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, 0);
- int cols;
- evas_object_table_col_row_size_get(wd->resize_obj, &cols, NULL);
- return cols;
+ pd->cols = 0;
+ EINA_INLIST_REVERSE_FOREACH(EINA_INLIST_GET(pd->items), gi)
+ {
+ if (pd->cols < gi->col + gi->col_span)
+ pd->cols = gi->col+ gi->col_span;
+ }
+ pd->cols_recalc = EINA_FALSE;
}
- return pd->req_cols;
+ return pd->req_cols ? : pd->cols;
}
EOLIAN static void
_efl_ui_table_efl_pack_table_table_rows_set(Eo *obj, Efl_Ui_Table_Data *pd, int rows)
{
+ if (pd->req_rows == rows)
+ return;
+
pd->req_rows = rows;
+ pd->linear_recalc = EINA_TRUE;
efl_pack_layout_request(obj);
}
@@ -714,50 +734,55 @@ _efl_ui_table_efl_pack_table_table_rows_set(Eo *obj, Efl_Ui_Table_Data *pd, int
EOLIAN static int
_efl_ui_table_efl_pack_table_table_rows_get(const Eo *obj EINA_UNUSED, Efl_Ui_Table_Data *pd)
{
- if (!pd->req_rows)
+ Table_Item *gi;
+ if (pd->rows_recalc)
{
- ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, 0);
- int rows;
- evas_object_table_col_row_size_get(wd->resize_obj, NULL, &rows);
- return rows;
+ pd->rows = 0;
+ EINA_INLIST_REVERSE_FOREACH(EINA_INLIST_GET(pd->items), gi)
+ {
+ if (pd->rows < gi->row + gi->row_span)
+ pd->rows = gi->row + gi->row_span;
+ }
+ pd->rows_recalc = EINA_FALSE;
}
- return pd->req_rows;
+ return pd->req_rows ? : pd->rows;
}
EOLIAN static Eina_Bool
_efl_ui_table_efl_pack_pack(Eo *obj, Efl_Ui_Table_Data *pd, Efl_Gfx_Entity *subobj)
{
+ int last_col, last_row;
+
EINA_SAFETY_ON_NULL_RETURN_VAL(subobj, EINA_FALSE);
- int col = pd->last_col;
- int row = pd->last_row;
+ _efl_ui_table_last_position_get(obj, pd, &last_col, &last_row);
if (efl_ui_dir_is_horizontal(pd->dir1, EINA_TRUE))
{
- col++;
- if (pd->req_cols && (col >= pd->req_cols))
+ last_col++;
+ if (pd->req_cols && (last_col >= pd->req_cols))
{
- col = 0;
- row++;
+ last_col = 0;
+ last_row++;
}
- if (row < 0) row = 0;
+ if (last_row < 0) last_row = 0;
}
else
{
- row++;
- if (pd->req_rows && (row >= pd->req_rows))
+ last_row++;
+ if (pd->req_rows && (last_row >= pd->req_rows))
{
- row = 0;
- col++;
+ last_row = 0;
+ last_col++;
}
- if (col < 0) col = 0;
+ if (last_col < 0) last_col = 0;
}
- pd->last_col = col;
- pd->last_row = row;
+ pd->last_col = last_col;
+ pd->last_row = last_row;
- DBG("packing new obj at %d,%d", col, row);
- return _pack_at(obj, pd, subobj, col, row, 1, 1, EINA_TRUE);
+ DBG("packing new obj at %d,%d", last_col, last_row);
+ return _pack_at(obj, pd, subobj, last_col, last_row, 1, 1);
}
/* Internal EO APIs and hidden overrides */
diff --git a/src/lib/elementary/efl_ui_table.eo b/src/lib/elementary/efl_ui_table.eo
index 7bcf3195a1..dd4b0f7bc7 100644
--- a/src/lib/elementary/efl_ui_table.eo
+++ b/src/lib/elementary/efl_ui_table.eo
@@ -20,7 +20,8 @@ class @beta Efl.Ui.Table extends Efl.Ui.Widget implements Efl.Pack_Table, Efl.Pa
implements {
Efl.Object.constructor;
Efl.Canvas.Group.group_calculate;
- Efl.Ui.Widget.theme_apply;
+ Efl.Gfx.Entity.position { set; }
+ Efl.Gfx.Entity.size { set; }
Efl.Container.content_iterate;
Efl.Container.content_count;
Efl.Ui.Direction.direction { get; set; }
diff --git a/src/lib/elementary/efl_ui_table_layout.c b/src/lib/elementary/efl_ui_table_layout.c
index 3d29551de5..ac90b63876 100644
--- a/src/lib/elementary/efl_ui_table_layout.c
+++ b/src/lib/elementary/efl_ui_table_layout.c
@@ -224,13 +224,14 @@ _efl_ui_table_custom_layout(Efl_Ui_Table *ui_table, Efl_Ui_Table_Data *pd)
Table_Item *ti;
Item_Calc *items, *item;
Efl_Ui_Container_Item_Hints *hints;
- int id = 0, i = 0, rows, cols;
+ int id = 0, i = 0, count, rows, cols;
int (*_efl_ui_table_item_pos_get[2])(Table_Calc *, Item_Calc *, Eina_Bool);
int (*_efl_ui_table_item_size_get[2])(Table_Calc *, Item_Calc *, Eina_Bool);
-
Table_Calc table_calc;
- if (!pd->count)
+ count = pd->count;
+
+ if (!count)
{
efl_gfx_hint_size_restricted_min_set(ui_table, EINA_SIZE2D(0, 0));
return;
@@ -249,20 +250,21 @@ _efl_ui_table_custom_layout(Efl_Ui_Table *ui_table, Efl_Ui_Table_Data *pd)
memset(table_calc.cell_calc[0], 0, cols * sizeof(Cell_Calc));
memset(table_calc.cell_calc[1], 0, rows * sizeof(Cell_Calc));
- items = alloca(pd->count * sizeof(*items));
+ items = alloca(count * sizeof(*items));
#ifdef DEBUG
- memset(items, 0, pd->count * sizeof(*items));
+ memset(items, 0, count * sizeof(*items));
#endif
table_calc.cols = cols;
table_calc.rows = rows;
// scan all items, get their properties, calculate total weight & min size
- EINA_INLIST_FOREACH(pd->items, ti)
+ EINA_INLIST_FOREACH(EINA_INLIST_GET(pd->items), ti)
{
if (((ti->col + ti->col_span) > cols) ||
((ti->row + ti->row_span) > rows))
{
- efl_gfx_entity_visible_set(ti->object, EINA_FALSE);
+ efl_gfx_entity_geometry_set(ti->object, EINA_RECT(9999, 9999, 0, 0));
+ count--;
continue;
}
@@ -343,7 +345,7 @@ _efl_ui_table_custom_layout(Efl_Ui_Table *ui_table, Efl_Ui_Table_Data *pd)
_efl_ui_table_item_size_get[1] = _efl_ui_table_regular_item_size_get;
}
- for (i = 0; i < pd->count; i++)
+ for (i = 0; i < count; i++)
{
Eina_Rect space, item_geom;
item = &items[i];
diff --git a/src/lib/elementary/efl_ui_table_private.h b/src/lib/elementary/efl_ui_table_private.h
index 4aea410376..5b1e193646 100644
--- a/src/lib/elementary/efl_ui_table_private.h
+++ b/src/lib/elementary/efl_ui_table_private.h
@@ -25,17 +25,17 @@ struct _Table_Item
Efl_Gfx_Entity *object;
int col_span, row_span;
int col, row;
-
- Eina_Bool linear : 1;
};
struct _Efl_Ui_Table_Data
{
Table_Item *items;
+ Eo *clipper;
int count;
+ int cols, rows;
int req_cols, req_rows; // requested - 0 means infinite
- int last_col, last_row; // only used by linear apis
+ int last_col, last_row; // only used by pack api
Efl_Ui_Dir dir1, dir2; // must be orthogonal (H,V or V,H)
struct {
double h, v;
@@ -44,6 +44,8 @@ struct _Efl_Ui_Table_Data
struct {
double h, v;
} align;
+ Eina_Bool cols_recalc : 1;
+ Eina_Bool rows_recalc : 1;
Eina_Bool linear_recalc : 1;
Eina_Bool homogeneoush : 1;
Eina_Bool homogeneousv : 1;
@@ -52,9 +54,8 @@ struct _Efl_Ui_Table_Data
struct _Table_Item_Iterator
{
Eina_Iterator iterator;
- Eina_Iterator *real_iterator;
- Eina_List *list;
- Efl_Ui_Table *object;
+ Efl_Ui_Table *object;
+ Eina_Inlist *cur;
};
#endif
diff --git a/src/lib/elementary/efl_ui_widget.c b/src/lib/elementary/efl_ui_widget.c
index 872e32a744..69d1700281 100644
--- a/src/lib/elementary/efl_ui_widget.c
+++ b/src/lib/elementary/efl_ui_widget.c
@@ -1968,325 +1968,6 @@ _propagate_event(void *data EINA_UNUSED, const Efl_Event *eo_event)
}
}
-double
-_elm_widget_focus_direction_weight_get(const Evas_Object *obj1,
- const Evas_Object *obj2,
- double degree)
-{
- Evas_Coord obj_x1, obj_y1, w1, h1, obj_x2, obj_y2, w2, h2;
- double x1, yy1, x2, yy2, xx1, yyy1, xx2, yyy2;
- double ax, ay, cx, cy;
- double weight = -1.0, g = 0.0;
-
- if (obj1 == obj2) return 0.0;
-
- degree -= 90.0;
- while (degree >= 360.0)
- degree -= 360.0;
- while (degree < 0.0)
- degree += 360.0;
-
- evas_object_geometry_get(obj1, &obj_x1, &obj_y1, &w1, &h1);
- cx = obj_x1 + (w1 / 2.0);
- cy = obj_y1 + (h1 / 2.0);
- evas_object_geometry_get(obj2, &obj_x2, &obj_y2, &w2, &h2);
-
- /* For overlapping cases. */
- if (ELM_RECTS_INTERSECT(obj_x1, obj_y1, w1, h1, obj_x2, obj_y2, w2, h2))
- return 0.0;
-
- /* Change all points to relative one. */
- x1 = obj_x1 - cx;
- xx1 = x1 + w1;
- yy1 = obj_y1 - cy;
- yyy1 = yy1 + h1;
- x2 = obj_x2 - cx;
- xx2 = x2 + w2;
- yy2 = obj_y2 - cy;
- yyy2 = yy2 + h2;
-
- /* Get crossing points (ax, ay) between obj1 and a line extending
- * to the direction of current degree. */
- if (degree == 0.0)
- {
- ax = xx1;
- ay = 0.0;
- }
- else if (degree == 90.0)
- {
- ax = 0.0;
- ay = yyy1;
- }
- else if (degree == 180.0)
- {
- ax = x1;
- ay = 0.0;
- }
- else if (degree == 270.0)
- {
- ax = 0.0;
- ay = yy1;
- }
- else
- {
- g = tan(degree * (M_PI / 180.0));
- if ((degree > 0.0) && (degree < 90.0))
- {
- ay = g * xx1;
- if (ay <= yyy1) ax = xx1;
- else
- {
- ax = yyy1 / g;
- ay = yyy1;
- }
- }
- else if ((degree > 90.0) && (degree < 180.0))
- {
- ay = g * x1;
- if (ay <= yyy1) ax = x1;
- else
- {
- ax = yyy1 / g;
- ay = yyy1;
- }
- }
- else if ((degree > 180.0) && (degree < 270.0))
- {
- ay = g * x1;
- if (ay >= yy1) ax = x1;
- else
- {
- ax = yy1 / g;
- ay = yy1;
- }
- }
- else
- {
- ay = g * xx1;
- if (ay >= yy1) ax = xx1;
- else
- {
- ax = yy1 / g;
- ay = yy1;
- }
- }
- }
-
- /* Filter obj2, if it is not in the specific derection. */
- int i = 0;
- double rx[4] = {0.0, 0.0, 0.0, 0.0}, ry[4] = {0.0, 0.0, 0.0, 0.0};
- double t1, t2, u1, v1, u2, v2;
-
- if ((degree == 45.0) || (degree == 225.0) || (degree == 135.0) ||
- (degree == 315.0))
- {
- u1 = 1.0;
- v1 = 0.0;
- u2 = 0.0;
- v2 = 1.0;
- }
- else
- {
- double g2 = tan((degree + 45.0) * (M_PI / 180.0));
- u1 = (-1.0 * g2);
- u2 = (1.0 / g2);
- v1 = v2 = 1.0;
- }
- t1 = (u1 * ax) + (v1 * ay);
- t2 = (u2 * ax) + (v2 * ay);
-
-#define _R(x) (int)((x + 0.05) * 10.0)
-
- if ((_R(t1 * ((u1 * x2) + (v1 * yy2))) > 0) && (_R(t2 * ((u2 * x2) +
- (v2 * yy2))) > 0))
- {
- rx[i] = x2;
- ry[i++] = yy2;
- }
- if ((_R(t1 * ((u1 * x2) + (v1 * yyy2))) > 0) && (_R(t2 * ((u2 * x2) +
- (v2 * yyy2))) > 0))
- {
- rx[i] = x2;
- ry[i++] = yyy2;
- }
- if ((_R(t1 * ((u1 * xx2) + (v1 * yy2))) > 0) && (_R(t2 * ((u2 * xx2) +
- (v2 * yy2))) > 0))
- {
- rx[i] = xx2;
- ry[i++] = yy2;
- }
- if ((_R(t1 * ((u1 * xx2) + (v1 * yyy2))) > 0) &&
- (_R(t2 * ((u2 * xx2) + (v2 * yyy2))) > 0))
- {
- rx[i] = xx2;
- ry[i++] = yyy2;
- }
- if (i == 0)
- {
- if (degree == 0.0)
- {
- if ((_R(xx2) < 0) || (_R(yy2) > 0) || (_R(yyy2) < 0)) return 0.0;
- }
- else if (degree == 90.0)
- {
- if ((_R(yyy2) < 0) || (_R(x2) > 0) || (_R(xx2) < 0)) return 0.0;
- }
- else if (degree == 180.0)
- {
- if ((_R(x2) > 0) || (_R(yy2) > 0) || (_R(yyy2) < 0)) return 0.0;
- }
- else if (degree == 270.0)
- {
- if ((_R(yy2) > 0) || (_R(x2) > 0) || (_R(xx2) < 0)) return 0.0;
- }
- else
- {
- if ((_R(g * x2) >= _R(yy2)) && (_R((g * x2)) <= _R(yyy2)))
- {
- if (!((_R(ax * x2) > 0) && (_R(ay * (g * x2)) > 0)))
- return 0.0;
- }
- else if ((_R(g * xx2) >= _R(yy2)) && (_R((g * xx2)) <= _R(yyy2)))
- {
- if (!((_R(ax * xx2) > 0) && (_R(ay * (g * xx2)) > 0)))
- return 0.0;
- }
- else if ((_R((1.0 / g) * yy2) >= _R(xx2)) && (_R((1.0 / g) * yy2)
- <= _R(xx2)))
- {
- if (!((_R(ax * ((1.0 / g) * yy2)) > 0)
- && (_R(ay * yy2) > 0)))
- return 0.0;
- }
- else if ((_R((1.0 / g) * yyy2) >= _R(xx2)) &&
- (_R((1.0 / g) * yyy2) <= _R(xx2)))
- {
- if (!((_R(ax * ((1.0 / g) * yyy2)) > 0)
- && (_R(ay * yyy2) > 0))) return 0.0;
- }
- else return 0.0;
- }
- }
-
- /* Calculate the weight for obj2. */
- if (degree == 0.0)
- {
- if (_R(xx1) > _R(x2)) weight = -1.0;
- else if ((_R(yy2) >= _R(yy1)) && (_R(yyy2) <= _R(yyy1)))
- weight = (x2 - xx1) * (x2 - xx1);
- else if (_R(yy2) > 0)
- weight = ((x2 - xx1) * (x2 - xx1)) + (yy2 * yy2);
- else if (_R(yyy2) < 0)
- weight = ((x2 - xx1) * (x2 - xx1)) + (yyy2 * yyy2);
- else weight = (x2 - xx1) * (x2 - xx1);
- }
- else if (degree == 90.0)
- {
- if (_R(yyy1) > _R(yy2)) weight = -1.0;
- else if ((_R(x2) >= _R(x1)) && (_R(xx2) <= _R(xx1)))
- weight = (yy2 - yyy1) * (yy2 - yyy1);
- else if (_R(x2) > 0)
- weight = (x2 * x2) + ((yy2 - yyy1) * (yy2 - yyy1));
- else if (_R(xx2) < 0)
- weight = (xx2 * xx2) + ((yy2 - yyy1) * (yy2 - yyy1));
- else weight = (yy2 - yyy1) * (yy2 - yyy1);
- }
- else if (degree == 180.0)
- {
- if (_R(x1) < _R(xx2)) weight = -1.0;
- else if ((_R(yy2) >= _R(yy1)) && (_R(yyy2) <= _R(yyy1)))
- weight = (x1 - xx2) * (x1 - xx2);
- else if (_R(yy2) > 0)
- weight = ((x1 - xx2) * (x1 - xx2)) + (yy2 * yy2);
- else if (_R(yyy2) < 0)
- weight = ((x1 - xx2) * (x1 - xx2)) + (yyy2 * yyy2);
- else weight = (x1 - xx2) * (x1 - xx2);
- }
- else if (degree == 270.0)
- {
- if (_R(yy1) < _R(yyy2)) weight = -1.0;
- else if ((_R(x2) >= _R(x1)) && (_R(xx2) <= _R(xx1)))
- weight = (yy1 - yyy2) * (yy1 - yyy2);
- else if (_R(x2) > 0)
- weight = (x2 * x2) + ((yy1 - yyy2) * (yy1 - yyy2));
- else if (_R(xx2) < 0)
- weight = (xx2 * xx2) + ((yy1 - yyy2) * (yy1 - yyy2));
- else weight = (yy1 - yyy2) * (yy1 - yyy2);
- }
- else
- {
- int j = 0, k = 0;
- double sx[4] = {0.0, 0.0, 0.0, 0.0}, sy[4] = {0.0, 0.0, 0.0, 0.0};
- double t_weight[4] = {-1.0, -1.0, -1.0, -1.0};
- if ((_R(g * x2) >= _R(yy2)) && (_R(g * x2) <= _R(yyy2)))
- {
- sx[j] = x2;
- sy[j] = g * x2;
- t_weight[j++] = ((ax - x2) * (ax - x2)) +
- ((ay - (g * x2)) * (ay - (g * x2)));
- }
- if ((_R(g * xx2) >= _R(yy2)) && (_R(g * xx2) <= _R(yyy2)))
- {
- sx[j] = xx2;
- sy[j] = g * xx2;
- t_weight[j++] = ((ax - xx2) * (ax - xx2)) +
- ((ay - (g * xx2)) * (ay - (g * xx2)));
- }
- if ((_R((1.0 / g) * yy2) >= _R(x2)) && (_R((1.0 / g) * yy2) <= _R(xx2)))
- {
- sx[j] = (1.0 / g) * yy2;
- sy[j] = yy2;
- t_weight[j++] =
- ((ax - ((1.0 / g) * yy2)) * (ax - ((1.0 / g) * yy2))) +
- ((ay - yy2) * (ay - yy2));
- }
- if ((_R((1.0 / g) * yyy2) >= _R(x2)) && (_R((1.0 / g) * yyy2)
- <= _R(xx2)))
- {
- sx[j] = (1.0 / g) * yyy2;
- sy[j] = yyy2;
- t_weight[j++] =
- ((ax - ((1.0 / g) * yyy2)) * (ax - ((1.0 / g) * yyy2))) +
- ((ay - yyy2) * (ay - yyy2));
- }
-
- if ((j > 2) || ((j == 2) && ((_R(sx[0]) != _R(sx[1])) ||
- (_R(sy[0]) != _R(sy[1])))))
- {
- for (; k < j; k++)
- {
- if (_R(t_weight[k]) == 0) return -1.0;
- if ((1 / weight) < (1 / t_weight[k])) weight = t_weight[k];
- }
- }
- else
- {
- for (; k < i; k++)
- {
- double ccx, ccy, t1_weight, x_diff, y_diff;
- ccx = ((1.0 / g) * rx[k] + ry[k]) / (g + (1.0 / g));
- ccy = g * ccx;
- x_diff = rx[k] - ccx;
- if (x_diff < 0) x_diff *= -1.0;
- y_diff = ry[k] - ccy;
- if (y_diff < 0) y_diff *= -1.0;
- t1_weight =
- (((ax - ccx) * (ax - ccx)) + ((ay - ccy) * (ay - ccy))) +
- ((x_diff * x_diff * x_diff) + (y_diff * y_diff * y_diff));
- if ((_R(t1_weight) != 0) && ((1 / weight) < (1 / t1_weight)))
- weight = t1_weight;
- }
- }
- }
- /* Return the current object's weight. */
- if (weight == -1.0) return 0.0;
- if (_R(weight) == 0) return -1.0;
-
-#undef _R
-
- return 1.0 / weight;
-}
-
/** @internal */
EAPI void
elm_widget_parent_highlight_set(Eo *obj, Eina_Bool highlighted)
diff --git a/src/lib/elementary/efl_ui_win.c b/src/lib/elementary/efl_ui_win.c
index b37c1de997..d69e734083 100644
--- a/src/lib/elementary/efl_ui_win.c
+++ b/src/lib/elementary/efl_ui_win.c
@@ -7547,7 +7547,7 @@ _efl_ui_win_content_set(Eo *obj, Efl_Ui_Win_Data *sd, const char *part, Eo *cont
if (eina_streq(part, "content"))
{
if (sd->content == content) return EINA_TRUE;
- if (!elm_widget_sub_object_add(obj, content))
+ if (content && !elm_widget_sub_object_add(obj, content))
goto err;
/* FIXME: Switch to swallow inside the frame
if (!edje_object_part_swallow(sd->frame_obj, "elm.swallow.client", content))
diff --git a/src/lib/elementary/elc_fileselector.c b/src/lib/elementary/elc_fileselector.c
index 59ce7b1321..9283dc3190 100644
--- a/src/lib/elementary/elc_fileselector.c
+++ b/src/lib/elementary/elc_fileselector.c
@@ -2115,6 +2115,8 @@ _elm_fileselector_path_set_internal(Evas_Object *obj, const char *_path)
EOLIAN static void
_elm_fileselector_efl_ui_view_model_set(Eo *obj, Elm_Fileselector_Data *sd EINA_UNUSED, Efl_Model *model)
{
+ if (!efl_isa(model, EFL_IO_MODEL_CLASS))
+ return ;
_populate(obj, model, NULL, NULL);
}
diff --git a/src/lib/elementary/elc_fileselector_button.c b/src/lib/elementary/elc_fileselector_button.c
index 1a644534f1..30aa8b225f 100644
--- a/src/lib/elementary/elc_fileselector_button.c
+++ b/src/lib/elementary/elc_fileselector_button.c
@@ -351,6 +351,9 @@ _elm_fileselector_button_efl_ui_view_model_set(Eo *obj EINA_UNUSED, Elm_Filesele
{
char *file = NULL;
+ if (!efl_isa(model, EFL_IO_MODEL_CLASS))
+ return ;
+
efl_replace(&sd->fsd.model, model);
if (model)
diff --git a/src/lib/elementary/elc_fileselector_entry.c b/src/lib/elementary/elc_fileselector_entry.c
index df9ac79d2c..7274b1dd85 100644
--- a/src/lib/elementary/elc_fileselector_entry.c
+++ b/src/lib/elementary/elc_fileselector_entry.c
@@ -94,7 +94,6 @@ _ACTIVATED_fwd(void *data, const Efl_Event *event)
{
const char *file;
Efl_Model *bmodel, *model;
- Eina_Value path;
ELM_FILESELECTOR_ENTRY_DATA_GET(data, sd);
@@ -103,12 +102,9 @@ _ACTIVATED_fwd(void *data, const Efl_Event *event)
bmodel = efl_ui_view_model_get(sd->button);
if (bmodel)
{
- model = efl_add(efl_class_get(bmodel), NULL);
- eina_value_setup(&path, EINA_VALUE_TYPE_STRING);
- eina_value_set(&path, file);
- efl_model_property_set(model, "path", &path);
- eina_value_flush(&path);
- efl_ui_view_model_set(sd->button, model);
+ model = efl_add(efl_class_get(bmodel), sd->button,
+ efl_io_model_path_set(efl_added, file));
+ efl_ui_view_model_set(sd->button, model);
}
efl_event_callback_legacy_call
@@ -406,6 +402,8 @@ _elm_fileselector_entry_path_set_internal(Evas_Object *obj, const char *path)
EOLIAN static void
_elm_fileselector_entry_efl_ui_view_model_set(Eo *obj EINA_UNUSED, Elm_Fileselector_Entry_Data *sd, Efl_Model *model)
{
+ if (!efl_isa(model, EFL_IO_MODEL_CLASS))
+ return ;
efl_ui_view_model_set(sd->button, model);
efl_ui_view_model_set(sd->entry, model);
efl_ui_property_bind(sd->entry, "default", "path");
@@ -428,10 +426,10 @@ _elm_fileselector_entry_path_get_internal(const Evas_Object *obj)
}
EOLIAN static Efl_Model *
-_elm_fileselector_entry_efl_ui_view_model_get(const Eo *obj EINA_UNUSED, Elm_Fileselector_Entry_Data *sd)
+_elm_fileselector_entry_efl_ui_view_model_get(const Eo *obj, Elm_Fileselector_Entry_Data *sd)
{
Efl_Model *bmodel, *ret;
- Eina_Value path;
+
bmodel = efl_ui_view_model_get(sd->button);
if (!bmodel)
{
@@ -439,13 +437,16 @@ _elm_fileselector_entry_efl_ui_view_model_get(const Eo *obj EINA_UNUSED, Elm_Fil
return NULL;
}
- ret = efl_add(efl_class_get(bmodel), NULL);
free(sd->path);
sd->path = elm_entry_markup_to_utf8(elm_object_text_get(sd->entry));
- eina_value_setup(&path, EINA_VALUE_TYPE_STRING);
- eina_value_set(&path, sd->path);
- efl_model_property_set(ret, "path", &path);
- eina_value_flush(&path);
+
+ if (!strcmp(sd->path, efl_io_model_path_get(bmodel)))
+ return bmodel;
+
+ ret = efl_add_ref(efl_class_get(bmodel), (Eo*) obj,
+ efl_io_model_path_set(efl_added, sd->path),
+ efl_loop_model_volatile_make(efl_added));
+ eina_freeq_ptr_add(postponed_fq, ret, EINA_FREE_CB(efl_unref), sizeof (void*));
return ret;
}
diff --git a/src/lib/elementary/elc_hoversel.c b/src/lib/elementary/elc_hoversel.c
index a7b5685f21..56b7113b62 100644
--- a/src/lib/elementary/elc_hoversel.c
+++ b/src/lib/elementary/elc_hoversel.c
@@ -176,7 +176,7 @@ _on_item_clicked(void *data EINA_UNUSED, const Efl_Event *event EINA_UNUSED)
ELM_HOVERSEL_DATA_GET(obj2, sd);
if (item->func) item->func((void *)WIDGET_ITEM_DATA_GET(eo_it), obj2, eo_it);
- efl_event_callback_legacy_call(obj2, EFL_UI_EVENT_ITEM_SELECTED, eo_it);
+ evas_object_smart_callback_call(obj2, "selected", eo_it);
evas_object_event_callback_add(sd->hover, EVAS_CALLBACK_DEL, _auto_update, item);
diff --git a/src/lib/elementary/elm_atspi_bridge.c b/src/lib/elementary/elm_atspi_bridge.c
index c689557d6c..9341b64981 100644
--- a/src/lib/elementary/elm_atspi_bridge.c
+++ b/src/lib/elementary/elm_atspi_bridge.c
@@ -4688,7 +4688,11 @@ _elm_atspi_bridge_key_filter(void *data, void *loop EINA_UNUSED, int type, void
}
ke = _key_event_info_new(type, key_event, bridge);
- if (!ke) return EINA_TRUE;
+ if (!ke)
+ {
+ eldbus_message_unref(req);
+ return EINA_TRUE;
+ }
iter = eldbus_message_iter_get(req);
_iter_marshall_key_event(iter, ke);
diff --git a/src/lib/elementary/elm_main.c b/src/lib/elementary/elm_main.c
index 676f1a9e8a..f3438364e3 100644
--- a/src/lib/elementary/elm_main.c
+++ b/src/lib/elementary/elm_main.c
@@ -43,6 +43,8 @@ Eina_Bool _use_build_config;
static Elm_Version _version = { VMAJ, VMIN, VMIC, VREV };
EAPI Elm_Version *elm_version = &_version;
+Eina_FreeQ *postponed_fq = NULL;
+
static void
_focus_ev_redirect_cb(void *data, const Efl_Event *ev EINA_UNUSED)
{
@@ -755,6 +757,12 @@ elm_quicklaunch_mode_get(void)
return quicklaunch_on;
}
+static void
+_postpone_cb(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED)
+{
+ eina_freeq_clear(postponed_fq);
+}
+
EAPI int
elm_quicklaunch_init(int argc EINA_UNUSED,
char **argv)
@@ -766,6 +774,8 @@ elm_quicklaunch_init(int argc EINA_UNUSED,
_elm_log_dom = eina_log_domain_register("elementary", EINA_COLOR_LIGHTBLUE);
EINA_SAFETY_ON_TRUE_GOTO(_elm_log_dom < 0, fail_eina_log);
+ postponed_fq = eina_freeq_new(EINA_FREEQ_POSTPONED);
+
EINA_SAFETY_ON_FALSE_GOTO(eet_init(), fail_eet);
EINA_SAFETY_ON_FALSE_GOTO(ecore_init(), fail_ecore);
EINA_SAFETY_ON_FALSE_GOTO(ecore_event_init(), fail_ecore_event);
@@ -812,6 +822,8 @@ elm_quicklaunch_init(int argc EINA_UNUSED,
if (!_elm_lib_dir) _elm_lib_dir = eina_stringshare_add("/");
if (!_property_style_ss) _property_style_ss = eina_stringshare_add("style");
+ efl_event_callback_add(efl_main_loop_get(), EFL_LOOP_EVENT_IDLE_EXIT, _postpone_cb, NULL);
+
eina_log_timing(_elm_log_dom, EINA_LOG_STATE_STOP, EINA_LOG_STATE_INIT);
if (quicklaunch_on)
@@ -946,6 +958,11 @@ elm_quicklaunch_shutdown(void)
emap_shutdown();
#endif
+ efl_event_callback_del(efl_main_loop_get(), EFL_LOOP_EVENT_IDLE_EXIT, _postpone_cb, NULL);
+
+ eina_freeq_free(postponed_fq);
+ postponed_fq = NULL;
+
ecore_file_shutdown();
eio_shutdown();
ecore_event_shutdown();
diff --git a/src/lib/elementary/elm_part_helper.h b/src/lib/elementary/elm_part_helper.h
index 8f83f98c6f..30230e7007 100644
--- a/src/lib/elementary/elm_part_helper.h
+++ b/src/lib/elementary/elm_part_helper.h
@@ -33,10 +33,25 @@ struct _Elm_Part_Data
EFL_OBJECT_OP_FUNC(efl_ui_widget_default_text_part_get, _ ## type ## _default_text_part_get)
#define ELM_PART_CONTENT_DEFAULT_IMPLEMENT(type, typedata) \
+ static void \
+ _ ## type ## _invalidated_cb(void *data, const Efl_Event *ev EINA_UNUSED) \
+ { \
+ efl_content_set(data, NULL); \
+ } \
+ \
EOLIAN static Eina_Bool \
_ ## type ## _efl_content_content_set(Eo *obj, typedata *sd EINA_UNUSED, Evas_Object *content) \
{ \
- return efl_content_set(efl_part(obj, efl_ui_widget_default_content_part_get(obj)), content); \
+ Eina_Bool result; \
+ Efl_Ui_Widget *former; \
+ former = efl_content_get(efl_part(obj, efl_ui_widget_default_content_part_get(obj))); \
+ if (former) \
+ efl_event_callback_del(former, EFL_EVENT_INVALIDATE, _ ## type ## _invalidated_cb, obj); \
+ result = efl_content_set(efl_part(obj, efl_ui_widget_default_content_part_get(obj)), content); \
+ if (content && result) \
+ efl_event_callback_add(content, EFL_EVENT_INVALIDATE, _ ## type ## _invalidated_cb, obj); \
+ efl_event_callback_call(obj, EFL_CONTENT_EVENT_CONTENT_CHANGED, result ? content : NULL); \
+ return result; \
} \
\
EOLIAN static Evas_Object* \
@@ -48,7 +63,11 @@ struct _Elm_Part_Data
EOLIAN static Evas_Object* \
_ ## type ## _efl_content_content_unset(Eo *obj, typedata *sd EINA_UNUSED) \
{ \
- return efl_content_unset(efl_part(obj, efl_ui_widget_default_content_part_get(obj))); \
+ Eo *result = efl_content_unset(efl_part(obj, efl_ui_widget_default_content_part_get(obj))); \
+ if (result) \
+ efl_event_callback_del(result, EFL_EVENT_INVALIDATE, _ ## type ## _invalidated_cb, obj); \
+ efl_event_callback_call(obj, EFL_CONTENT_EVENT_CONTENT_CHANGED, NULL); \
+ return result; \
}
static inline Eo *
diff --git a/src/lib/elementary/elm_priv.h b/src/lib/elementary/elm_priv.h
index 478497468d..94316191a5 100644
--- a/src/lib/elementary/elm_priv.h
+++ b/src/lib/elementary/elm_priv.h
@@ -907,6 +907,8 @@ extern Eina_Stringshare *_property_style_ss;
extern Eina_Bool _config_profile_lock;
+extern Eina_FreeQ *postponed_fq;
+
# ifdef HAVE_ELEMENTARY_WL2
extern Ecore_Wl2_Display *_elm_wl_display;
# endif
diff --git a/src/lib/elput/elput_logind.c b/src/lib/elput/elput_logind.c
index 40e483ebe5..cca5ea7eb7 100644
--- a/src/lib/elput/elput_logind.c
+++ b/src/lib/elput/elput_logind.c
@@ -41,7 +41,6 @@ _logind_device_pause_complete(Elput_Manager *em, uint32_t major, uint32_t minor)
if (!msg)
{
ERR("Could not create method call for proxy");
- eldbus_message_unref(msg);
return;
}
diff --git a/src/lib/evas/meson.build b/src/lib/evas/meson.build
index b7238b6b44..3f39e294b5 100644
--- a/src/lib/evas/meson.build
+++ b/src/lib/evas/meson.build
@@ -12,16 +12,21 @@
# For now loaders and savers are ALWAYS build statically.
#
+rel_evas_modules = join_paths('..', '..', '..', 'modules', 'evas', 'engines', 'software_generic')
evas_deps = [eo, eet, eina, efl, emile, ector, ecore, buildsystem, intl]
pub_eo_file_target = []
priv_eo_files = []
-
+evas_include_directories = []
+pub_eo_files = []
pub_evas_eo_files = []
pub_evas_eot_files = []
pub_legacy_eo_files = [
]
+evas_src = []
+
+subdir('software_generic')
foreach eo_file : pub_legacy_eo_files
pub_eo_file_target += custom_target('eolian_gen_' + eo_file,
@@ -37,15 +42,11 @@ foreach eo_file : pub_legacy_eo_files
'-gchd', '@INPUT@'])
endforeach
-pub_eo_files = [
-
-]
-
foreach eo_file : pub_eo_files
- pub_eo_file_target += custom_target('eolian_gen_' + eo_file,
+ pub_eo_file_target += custom_target('eolian_gen_' + eo_file.underscorify(),
input : eo_file,
- output : [eo_file + '.h'],
- depfile : eo_file + '.d',
+ output : [eo_file.underscorify() + '.h'],
+ depfile : eo_file.underscorify() + '.d',
install : true,
install_dir : dir_package_include,
command : eolian_gen + [ '-I', meson.current_source_dir(), eolian_include_directories,
@@ -75,6 +76,8 @@ endforeach
eolian_include_directories += ['-I', meson.current_source_dir()]
+evas_src += pub_eo_file_target
+
evas_header_src = [
'Evas.h',
'Evas_Common.h',
@@ -84,7 +87,7 @@ evas_header_src = [
'Evas_Loader.h',
]
-evas_include_directories = [
+evas_include_directories += [
include_directories('.'),
include_directories('common'),
include_directories('common3d'),
@@ -94,7 +97,7 @@ evas_include_directories = [
vg_common_inc_dir
]
-evas_src = [
+evas_src += [
'main.c'
]
@@ -165,7 +168,7 @@ if get_option('opengl') != 'none'
endif
evas_pre = declare_dependency(
- include_directories: evas_include_directories + [vg_common_inc_dir],
+ include_directories: evas_include_directories + [vg_common_inc_dir] + [include_directories(join_paths('..', '..', 'modules', 'evas', 'engines', 'buffer'))],
sources : pub_eo_file_target + priv_eo_file_target,
dependencies: [eina, eo, ector, emile, evas_deps, m],
)
diff --git a/src/modules/evas/engines/software_generic/filters/meson.build b/src/lib/evas/software_generic/filters/meson.build
index 6ccd5f59a1..b23ce09b1d 100644
--- a/src/modules/evas/engines/software_generic/filters/meson.build
+++ b/src/lib/evas/software_generic/filters/meson.build
@@ -1,6 +1,6 @@
-engine_include_dir += include_directories('.')
+evas_include_directories += include_directories(join_paths('..', rel_evas_modules, 'filters'))
-engine_src += files([
+raw_evas_src = [
'evas_engine_filter.h',
'evas_filter_blend.c',
'evas_filter_blur.c',
@@ -10,4 +10,8 @@ engine_src += files([
'evas_filter_fill.c',
'evas_filter_mask.c',
'evas_filter_transform.c',
-]) \ No newline at end of file
+]
+
+foreach file : raw_evas_src
+ evas_src += files(join_paths('..', rel_evas_modules, 'filters', file))
+endforeach
diff --git a/src/lib/evas/software_generic/meson.build b/src/lib/evas/software_generic/meson.build
new file mode 100644
index 0000000000..187002a6af
--- /dev/null
+++ b/src/lib/evas/software_generic/meson.build
@@ -0,0 +1,36 @@
+raw_evas_src = [
+ 'evas_engine.c',
+ 'Evas_Engine_Software_Generic.h',
+ 'Evas_Engine_Software_Shared.h',
+ 'evas_native_tbm.c',
+ 'evas_native_dmabuf.c',
+ 'evas_ector_software_buffer.c',
+ 'evas_native_common.h',
+ 'evas_ector_software.h',
+]
+
+gen_src = []
+
+raw_pub_eo_files = [
+ 'evas_ector_software_buffer.eo'
+]
+
+foreach eo_file : raw_pub_eo_files
+ pub_eo_file_target += custom_target('eolian_gen_' + eo_file.underscorify(),
+ input : join_paths(rel_evas_modules, eo_file),
+ output : [eo_file + '.h'],
+ depfile : eo_file + '.d',
+ install : true,
+ install_dir : dir_package_include,
+ command : eolian_gen + [ '-I', join_paths(meson.current_source_dir(), rel_evas_modules), eolian_include_directories,
+ '-o', 'h:' + join_paths(meson.current_build_dir(), eo_file + '.h'),
+ '-o', 'c:' + join_paths(meson.current_build_dir(), eo_file + '.c'),
+ '-o', 'd:' + join_paths(meson.current_build_dir(), eo_file + '.d'),
+ '-gchd', '@INPUT@'])
+endforeach
+
+foreach file : raw_evas_src
+ evas_src += files(join_paths(rel_evas_modules, file))
+endforeach
+
+subdir('filters')
diff --git a/src/modules/ecore_evas/engines/extn/meson.build b/src/modules/ecore_evas/engines/extn/meson.build
index 1afabb3916..901a126f52 100644
--- a/src/modules/ecore_evas/engines/extn/meson.build
+++ b/src/modules/ecore_evas/engines/extn/meson.build
@@ -3,7 +3,7 @@ engine_deps = [ecore_input, ecore_ipc]
shared_module(mod_full_name, engine_src,
include_directories : config_dir + [engine_include_dir],
- dependencies : [eina, ecore_evas, ecore_input_evas] + engine_deps,
+ dependencies : [eina, ecore_evas, ecore_input_evas, rt] + engine_deps,
install : true,
install_dir : mod_install_dir,
name_suffix : sys_mod_extension
diff --git a/src/modules/ecore_imf/ibus/meson.build b/src/modules/ecore_imf/ibus/meson.build
index dc37b3865e..f81543974b 100644
--- a/src/modules/ecore_imf/ibus/meson.build
+++ b/src/modules/ecore_imf/ibus/meson.build
@@ -4,7 +4,7 @@ mod_src = files([
'ibus_imcontext.h'
])
-mod_deps = [ecore, ecore_imf, ecore_x, dependency('ibus-1.0'), dependency('glib-2.0'), ecore_evas]
+mod_deps = [ecore, ecore_imf, ecore_x, ecore_x_deps, dependency('ibus-1.0'), dependency('glib-2.0'), ecore_evas]
shared_module(mod_name,
mod_src,
diff --git a/src/modules/ecore_imf/scim/meson.build b/src/modules/ecore_imf/scim/meson.build
index 102c631281..9356a00526 100644
--- a/src/modules/ecore_imf/scim/meson.build
+++ b/src/modules/ecore_imf/scim/meson.build
@@ -9,7 +9,7 @@ if not scim_dep.found()
scim_dep = dependency('scim-1.0')
endif
-mod_deps = [ecore, ecore_imf, ecore_x, ecore_evas, scim_dep, dependency('glib-2.0')]
+mod_deps = [ecore, ecore_imf, ecore_x, ecore_x_deps, ecore_evas, scim_dep, dependency('glib-2.0')]
shared_module(mod_name,
mod_src,
diff --git a/src/modules/ecore_imf/xim/meson.build b/src/modules/ecore_imf/xim/meson.build
index 5db9e187c5..4ffa1f177c 100644
--- a/src/modules/ecore_imf/xim/meson.build
+++ b/src/modules/ecore_imf/xim/meson.build
@@ -2,7 +2,7 @@ mod_src = files([
'ecore_imf_xim.c',
])
-mod_deps = [ecore, ecore_imf, ecore_input, ecore_x, ecore_evas]
+mod_deps = [ecore, ecore_imf, ecore_input, ecore_x, ecore_x_deps, ecore_evas]
shared_module(mod_name,
mod_src,
diff --git a/src/modules/evas/engines/buffer/meson.build b/src/modules/evas/engines/buffer/meson.build
index e5a2510db9..b5b5541466 100644
--- a/src/modules/evas/engines/buffer/meson.build
+++ b/src/modules/evas/engines/buffer/meson.build
@@ -13,10 +13,10 @@ install_headers('Evas_Engine_Buffer.h',
install_dir : dir_package_include,
)
-if get_option('evas-modules') == 'shared' and not evas_force_static.contains(engine)
+if get_option('evas-modules') == 'shared'
shared_module(mod_full_name, engine_src,
include_directories : config_dir + [engine_include_dir],
- dependencies : [eina, evas_pre] + engine_deps,
+ dependencies : [eina, evas] + engine_deps,
install : true,
install_dir : mod_install_dir,
name_suffix : sys_mod_extension
diff --git a/src/modules/evas/engines/drm/meson.build b/src/modules/evas/engines/drm/meson.build
index 6445a560f2..441a09a316 100644
--- a/src/modules/evas/engines/drm/meson.build
+++ b/src/modules/evas/engines/drm/meson.build
@@ -7,10 +7,10 @@ engine_src = files([
engine_deps = [ecore_drm2, libdrm]
-if get_option('evas-modules') == 'shared' and not evas_force_static.contains(engine)
+if get_option('evas-modules') == 'shared'
shared_module(mod_full_name, engine_src,
include_directories : config_dir + [engine_include_dir],
- dependencies : [eina, evas_pre] + engine_deps,
+ dependencies : [eina, evas] + engine_deps,
install : true,
install_dir : mod_install_dir,
name_suffix : sys_mod_extension
diff --git a/src/modules/evas/engines/fb/meson.build b/src/modules/evas/engines/fb/meson.build
index 2900f4afc6..c857e83aec 100644
--- a/src/modules/evas/engines/fb/meson.build
+++ b/src/modules/evas/engines/fb/meson.build
@@ -9,10 +9,10 @@ engine_src = files([
engine_deps = [ecore_fb]
-if get_option('evas-modules') == 'shared' and not evas_force_static.contains(engine)
+if get_option('evas-modules') == 'shared'
shared_module(mod_full_name, engine_src,
include_directories : config_dir + [engine_include_dir],
- dependencies : [eina, evas_pre] + engine_deps,
+ dependencies : [eina, evas] + engine_deps,
install : true,
install_dir : mod_install_dir,
name_suffix : sys_mod_extension
diff --git a/src/modules/evas/engines/gl_cocoa/meson.build b/src/modules/evas/engines/gl_cocoa/meson.build
index 9900862904..a175c3c730 100644
--- a/src/modules/evas/engines/gl_cocoa/meson.build
+++ b/src/modules/evas/engines/gl_cocoa/meson.build
@@ -7,10 +7,10 @@ engine_src = files([
engine_deps = [ecore_cocoa, gl_deps]
-if get_option('evas-modules') == 'shared' and not evas_force_static.contains(engine)
+if get_option('evas-modules') == 'shared'
shared_module(mod_full_name, engine_src,
include_directories : config_dir + [engine_include_dir],
- dependencies : [eina, evas_pre] + engine_deps,
+ dependencies : [eina, evas] + engine_deps,
install : true,
install_dir : mod_install_dir,
name_suffix : sys_mod_extension
diff --git a/src/modules/evas/engines/gl_common/meson.build b/src/modules/evas/engines/gl_common/meson.build
deleted file mode 100644
index 0242012759..0000000000
--- a/src/modules/evas/engines/gl_common/meson.build
+++ /dev/null
@@ -1,45 +0,0 @@
-engine_src = files([
- 'evas_gl_private.h',
- 'evas_gl_common.h',
- 'evas_gl_define.h',
- 'evas_gl_context.c',
- 'evas_gl_file_cache.c',
- 'evas_gl_shader.c',
- 'evas_gl_rectangle.c',
- 'evas_gl_texture.c',
- 'evas_gl_preload.c',
- 'evas_gl_image.c',
- 'evas_gl_font.c',
- 'evas_gl_polygon.c',
- 'evas_gl_line.c',
- 'evas_gl_core.c',
- 'evas_gl_api_ext.h',
- 'evas_gl_api_ext_def.h',
- 'evas_gl_core.h',
- 'evas_gl_core_private.h',
- 'evas_gl_api.c',
- 'evas_gl_api_def.h',
- 'evas_gl_api_gles1.c',
- 'evas_gl_api_gles3_def.h',
- 'evas_gl_api_ext.c',
- 'evas_gl_3d_common.h',
- 'evas_gl_3d_private.h',
- 'evas_gl_3d.c',
- 'evas_gl_3d_renderer.c',
- 'evas_gl_3d_shader.c',
- #join_paths('shader_3d', 'evas_gl_3d_shaders.x'),
- #join_paths('shader','evas_gl_shaders.x'),
-])
-
-engine_deps = [gl_deps]
-
-if get_option('evas-modules') == 'shared' and not evas_force_static.contains(engine)
- shared_module(mod_full_name, engine_src,
- include_directories : config_dir + [engine_include_dir],
- dependencies : [eina, evas_pre] + engine_deps,
- install : true,
- install_dir : mod_install_dir,
- name_suffix : sys_mod_extension
- )
- module_files += join_paths(mod_install_dir, 'lib'+mod_full_name + '.' + sys_mod_extension)
-endif
diff --git a/src/modules/evas/engines/gl_drm/meson.build b/src/modules/evas/engines/gl_drm/meson.build
index b85f1c082a..28988d5599 100644
--- a/src/modules/evas/engines/gl_drm/meson.build
+++ b/src/modules/evas/engines/gl_drm/meson.build
@@ -7,10 +7,10 @@ engine_src = files([
engine_deps = [ecore_drm2, libdrm, gl_deps, dependency('gbm')]
-if get_option('evas-modules') == 'shared' and not evas_force_static.contains(engine)
+if get_option('evas-modules') == 'shared'
shared_module(mod_full_name, engine_src,
include_directories : config_dir + [engine_include_dir],
- dependencies : [eina, evas_pre] + engine_deps,
+ dependencies : [eina, evas] + engine_deps,
install : true,
install_dir : mod_install_dir,
name_suffix : sys_mod_extension
diff --git a/src/modules/evas/engines/gl_generic/meson.build b/src/modules/evas/engines/gl_generic/meson.build
index c9957d4923..d18e032f7a 100644
--- a/src/modules/evas/engines/gl_generic/meson.build
+++ b/src/modules/evas/engines/gl_generic/meson.build
@@ -13,7 +13,40 @@ engine_src = files([
join_paths('filters','gl_filter_fill.c'),
join_paths('filters','gl_filter_mask.c'),
])
+common_engine_src = [
+ 'evas_gl_private.h',
+ 'evas_gl_common.h',
+ 'evas_gl_define.h',
+ 'evas_gl_context.c',
+ 'evas_gl_file_cache.c',
+ 'evas_gl_shader.c',
+ 'evas_gl_rectangle.c',
+ 'evas_gl_texture.c',
+ 'evas_gl_preload.c',
+ 'evas_gl_image.c',
+ 'evas_gl_font.c',
+ 'evas_gl_polygon.c',
+ 'evas_gl_line.c',
+ 'evas_gl_core.c',
+ 'evas_gl_api_ext.h',
+ 'evas_gl_api_ext_def.h',
+ 'evas_gl_core.h',
+ 'evas_gl_core_private.h',
+ 'evas_gl_api.c',
+ 'evas_gl_api_def.h',
+ 'evas_gl_api_gles1.c',
+ 'evas_gl_api_gles3_def.h',
+ 'evas_gl_api_ext.c',
+ 'evas_gl_3d_common.h',
+ 'evas_gl_3d_private.h',
+ 'evas_gl_3d.c',
+ 'evas_gl_3d_renderer.c',
+ 'evas_gl_3d_shader.c',
+]
+foreach src : common_engine_src
+ engine_src += files(join_paths('..','gl_common', src))
+endforeach
pub_eo_files = [
'evas_ector_gl_buffer.eo',
@@ -32,14 +65,14 @@ foreach eo_file : pub_eo_files
'-gchd', '@INPUT@'])
endforeach
-engine_deps = [gl_common]
+engine_deps = [gl_deps]
-engine_include_dir = include_directories(join_paths('..','software_generic'))
+engine_include_dir = include_directories(join_paths('..','software_generic'), join_paths('..', 'gl_common'))
-if get_option('evas-modules') == 'shared' and not evas_force_static.contains(engine)
+if get_option('evas-modules') == 'shared'
shared_module(mod_full_name, engine_src,
include_directories : config_dir + [engine_include_dir],
- dependencies : [eina, evas_pre] + engine_deps + [software_generic],
+ dependencies : [eina, evas] + engine_deps,
install : true,
install_dir : mod_install_dir,
name_suffix : sys_mod_extension
diff --git a/src/modules/evas/engines/gl_x11/meson.build b/src/modules/evas/engines/gl_x11/meson.build
index 910c72a917..7aec198e39 100644
--- a/src/modules/evas/engines/gl_x11/meson.build
+++ b/src/modules/evas/engines/gl_x11/meson.build
@@ -7,10 +7,10 @@ engine_src = files([
engine_deps = [ecore_x_deps, gl_deps]
-if get_option('evas-modules') == 'shared' and not evas_force_static.contains(engine)
+if get_option('evas-modules') == 'shared'
shared_module(mod_full_name, engine_src,
include_directories : config_dir + [engine_include_dir],
- dependencies : [eina, evas_pre] + engine_deps,
+ dependencies : [eina, evas] + engine_deps,
install : true,
install_dir : mod_install_dir,
name_suffix : sys_mod_extension
diff --git a/src/modules/evas/engines/meson.build b/src/modules/evas/engines/meson.build
new file mode 100644
index 0000000000..6eb53e4c04
--- /dev/null
+++ b/src/modules/evas/engines/meson.build
@@ -0,0 +1,72 @@
+engines = [
+ ['buffer', []],
+ ['fb', ['fb']],
+ ['drm', ['drm']],
+ ['software_x11', ['x11']],
+ ['wayland_shm', ['wl']],
+]
+
+if get_option('opengl') != 'none'
+ engines += [
+ ['gl_generic', []],
+ ['gl_x11', ['x11']],
+ ['gl_drm', ['drm']],
+ ['gl_cocoa', ['cocoa']],
+ ]
+endif
+
+if get_option('opengl') == 'es-egl'
+ engines += [['wayland_egl', ['wl']]]
+endif
+
+
+foreach engine_conf : engines
+ engine = engine_conf[0]
+ build = true
+ if engine_conf[1].length() > 0
+ build = get_option(engine_conf[1][0])
+ endif
+ if build
+ engine_include_dir = []
+ engine_src = []
+ engine_deps = []
+ engine_dep = declare_dependency(
+ include_directories: include_directories(engine),
+ )
+
+ var_name = 'engine_'+engine
+ set_variable(var_name, engine_dep)
+
+ mod_full_name = engine
+ mod_install_dir = join_paths(dir_package_modules, 'engines', engine, version_name)
+
+ subdir(engine)
+
+ if get_option('evas-modules') == 'static'
+ tmp = static_library(mod_full_name, engine_src,
+ include_directories : config_dir + [engine_include_dir],
+ dependencies : [eina, evas_pre] + engine_deps,
+ )
+ evas_static_list += declare_dependency(
+ include_directories: [include_directories('.')] + config_dir + [engine_include_dir],
+ link_with: tmp,
+ dependencies : [eina, evas_pre] + engine_deps,
+ sources : engine_src
+ )
+ if engine == 'gl_generic'
+ #special case, see evas_module.c
+ config_h.set('EVAS_STATIC_BUILD_GL_COMMON', '1')
+ else
+ config_h.set('EVAS_STATIC_BUILD_'+engine.to_upper(), '1')
+ endif
+ else
+ #nothing here shared building is handled directly on the engine configuration side
+ #reason for this is that the .so files have to be placed in the correct directory in order
+ # to make them discoverable by evas module code
+ endif
+ config_h.set('BUILD_ENGINE_'+engine.to_upper(), '1')
+ endif
+endforeach
+
+config_h.set('EVAS_STATIC_BUILD_SOFTWARE_GENERIC', '1')
+config_h.set('BUILD_ENGINE_SOFTWARE_GENERIC', '1')
diff --git a/src/modules/evas/engines/software_ddraw/meson.build b/src/modules/evas/engines/software_ddraw/meson.build
index 9d3724f5b1..2f6f580e3f 100644
--- a/src/modules/evas/engines/software_ddraw/meson.build
+++ b/src/modules/evas/engines/software_ddraw/meson.build
@@ -9,10 +9,10 @@ engine_src = files([
engine_deps = []
-if get_option('evas-modules') == 'shared' and not evas_force_static.contains(engine)
+if get_option('evas-modules') == 'shared'
shared_module(mod_full_name, engine_src,
include_directories : config_dir + [engine_include_dir],
- dependencies : [eina, evas_pre] + engine_deps,
+ dependencies : [eina, evas] + engine_deps,
install : true,
install_dir : mod_install_dir,
name_suffix : sys_mod_extension
diff --git a/src/modules/evas/engines/software_gdi/meson.build b/src/modules/evas/engines/software_gdi/meson.build
index 9347ecd4d8..63a1c2c232 100644
--- a/src/modules/evas/engines/software_gdi/meson.build
+++ b/src/modules/evas/engines/software_gdi/meson.build
@@ -9,10 +9,10 @@ engine_src = files([
engine_deps = []
-if get_option('evas-modules') == 'shared' and not evas_force_static.contains(engine)
+if get_option('evas-modules') == 'shared'
shared_module(mod_full_name, engine_src,
include_directories : config_dir + [engine_include_dir],
- dependencies : [eina, evas_pre] + engine_deps,
+ dependencies : [eina, evas] + engine_deps,
install : true,
install_dir : mod_install_dir,
name_suffix : sys_mod_extension
diff --git a/src/modules/evas/engines/software_generic/meson.build b/src/modules/evas/engines/software_generic/meson.build
deleted file mode 100644
index 4d52667838..0000000000
--- a/src/modules/evas/engines/software_generic/meson.build
+++ /dev/null
@@ -1,45 +0,0 @@
-engine_src = files([
- 'evas_engine.c',
- 'Evas_Engine_Software_Generic.h',
- 'Evas_Engine_Software_Shared.h',
- 'evas_native_tbm.c',
- 'evas_native_dmabuf.c',
- 'evas_ector_software_buffer.c',
- 'evas_native_common.h',
- 'evas_ector_software.h',
-])
-
-gen_src = []
-
-pub_eo_files = [
- 'evas_ector_software_buffer.eo'
-]
-
-subdir('filters')
-
-foreach eo_file : pub_eo_files
- gen_src += custom_target('eolian_gen_' + eo_file,
- input : eo_file,
- output : [eo_file + '.h'],
- depfile : eo_file + '.d',
- command : eolian_gen + [ '-I', meson.current_source_dir(), eolian_include_directories,
- '-o', 'h:' + join_paths(meson.current_build_dir(), eo_file + '.h'),
- '-o', 'c:' + join_paths(meson.current_build_dir(), eo_file + '.c'),
- '-o', 'd:' + join_paths(meson.current_build_dir(), eo_file + '.d'),
- '-gchd', '@INPUT@'])
-endforeach
-
-engine_src += gen_src
-
-engine_deps = [draw, dl]
-
-if get_option('evas-modules') == 'shared' and not evas_force_static.contains(engine)
- shared_module(mod_full_name, engine_src,
- include_directories : config_dir + [engine_include_dir],
- dependencies : [eina, evas_pre] + engine_deps,
- install : true,
- install_dir : mod_install_dir,
- name_suffix : sys_mod_extension
- )
- module_files += join_paths(mod_install_dir, 'lib'+mod_full_name + '.' + sys_mod_extension)
-endif
diff --git a/src/modules/evas/engines/software_x11/meson.build b/src/modules/evas/engines/software_x11/meson.build
index 950c93ed04..b5409568c0 100644
--- a/src/modules/evas/engines/software_x11/meson.build
+++ b/src/modules/evas/engines/software_x11/meson.build
@@ -28,10 +28,10 @@ config_h.set('BUILD_ENGINE_SOFTWARE_XLIB', '1')
#it looks weird but is right, gl_deps is needed for evas_x_egl.c
engine_deps = [x11, ecore_x, ecore_x_deps, gl_deps]
-if get_option('evas-modules') == 'shared' and not evas_force_static.contains(engine)
+if get_option('evas-modules') == 'shared'
shared_module(mod_full_name, engine_src,
include_directories : config_dir + [engine_include_dir],
- dependencies : [eina, evas_pre] + engine_deps,
+ dependencies : [eina, evas] + engine_deps,
install : true,
install_dir : mod_install_dir,
name_suffix : sys_mod_extension
diff --git a/src/modules/evas/engines/wayland_egl/meson.build b/src/modules/evas/engines/wayland_egl/meson.build
index 7dc76cac37..818210fc62 100644
--- a/src/modules/evas/engines/wayland_egl/meson.build
+++ b/src/modules/evas/engines/wayland_egl/meson.build
@@ -9,10 +9,10 @@ engine_deps = [ecore_wl2, dependency('wayland-egl'), gl_deps]
engine_include_dir = include_directories(join_paths('..','wayland_common'))
-if get_option('evas-modules') == 'shared' and not evas_force_static.contains(engine)
+if get_option('evas-modules') == 'shared'
shared_module(mod_full_name, engine_src,
include_directories : config_dir + [engine_include_dir],
- dependencies : [eina, evas_pre] + engine_deps,
+ dependencies : [eina, evas] + engine_deps,
install : true,
install_dir : mod_install_dir,
name_suffix : sys_mod_extension
diff --git a/src/modules/evas/engines/wayland_shm/meson.build b/src/modules/evas/engines/wayland_shm/meson.build
index 5c1fe875a4..29453841cc 100644
--- a/src/modules/evas/engines/wayland_shm/meson.build
+++ b/src/modules/evas/engines/wayland_shm/meson.build
@@ -8,10 +8,10 @@ engine_deps = [ecore_wl2]
engine_include_dir = include_directories(join_paths('..','wayland_common'))
-if get_option('evas-modules') == 'shared' and not evas_force_static.contains(engine)
+if get_option('evas-modules') == 'shared'
shared_module(mod_full_name, engine_src,
include_directories : config_dir + [engine_include_dir],
- dependencies : [eina, evas_pre] + engine_deps,
+ dependencies : [eina, evas] + engine_deps,
install : true,
install_dir : mod_install_dir,
name_suffix : sys_mod_extension
diff --git a/src/modules/evas/image_loaders/wbmp/evas_image_load_wbmp.c b/src/modules/evas/image_loaders/wbmp/evas_image_load_wbmp.c
index 633afe9567..181b14fa90 100644
--- a/src/modules/evas/image_loaders/wbmp/evas_image_load_wbmp.c
+++ b/src/modules/evas/image_loaders/wbmp/evas_image_load_wbmp.c
@@ -73,6 +73,15 @@ evas_image_load_file_head_wbmp(void *loader_data,
position++; /* skipping one byte */
if (read_mb(&w, map, length, &position) < 0) goto bail;
if (read_mb(&h, map, length, &position) < 0) goto bail;
+
+ /* Wbmp header identifier is too weak....
+ Here checks size validation whether it's acutal wbmp or not. */
+ if ((((w * h) + 7) >> 3) + position != length)
+ {
+ *error = EVAS_LOAD_ERROR_UNKNOWN_FORMAT;
+ goto bail;
+ }
+
if ((w < 1) || (h < 1) || (w > IMG_MAX_SIZE) || (h > IMG_MAX_SIZE) ||
IMG_TOO_BIG(w, h))
{
@@ -116,11 +125,20 @@ evas_image_load_file_data_wbmp(void *loader_data,
if (!map) goto bail;
if (read_mb(&type, map, length, &position) < 0) goto bail;
+
+ if (type != 0)
+ {
+ *error = EVAS_LOAD_ERROR_UNKNOWN_FORMAT;
+ goto bail;
+ }
+
position++; /* skipping one byte */
if (read_mb(&w, map, length, &position) < 0) goto bail;
if (read_mb(&h, map, length, &position) < 0) goto bail;
- if (type != 0)
+ /* Wbmp header identifier is too weak....
+ Here checks size validation whether it's acutal wbmp or not. */
+ if ((((w * h) + 7) >> 3) + position != length)
{
*error = EVAS_LOAD_ERROR_UNKNOWN_FORMAT;
goto bail;
@@ -145,7 +163,6 @@ evas_image_load_file_data_wbmp(void *loader_data,
for (y = 0; y < (int)prop->h; y++)
{
- if (position + line_length > length) goto bail;
line = ((unsigned char*) map) + position;
position += line_length;
for (x = 0; x < (int)prop->w; x++)
diff --git a/src/modules/evas/meson.build b/src/modules/evas/meson.build
index 8ad6aafa9f..c49a24c3ea 100644
--- a/src/modules/evas/meson.build
+++ b/src/modules/evas/meson.build
@@ -1,30 +1,3 @@
-engines = [
- ['buffer', []],
- ['software_generic', []],
- ['fb', ['fb']],
- ['drm', ['drm']],
- ['software_x11', ['x11']],
- ['wayland_shm', ['wl']],
-]
-
-if get_option('opengl') != 'none'
- engines += [
- ['gl_common', []],
- ['gl_generic', []],
- ['gl_x11', ['x11']],
- ['gl_drm', ['drm']],
- ['gl_cocoa', ['cocoa']],
- ]
-endif
-
-if get_option('opengl') == 'es-egl'
- engines += [['wayland_egl', ['wl']]]
-endif
-
-#there are a few modules that should NEVER be build as a module but rather be build as static lib and linked in later
-evas_force_static = ['software_generic', 'gl_common']
-evas_static_list = []
-
#fixed dependencies by efl
png = dependency('libpng')
tiff = dependency('libtiff-4')
@@ -32,74 +5,12 @@ giflib = cc.find_library('gif')
json = dependency('rlottie', required: get_option('evas-loaders-disabler').contains('json') == false)
webp = dependency('libwebp', required: get_option('evas-loaders-disabler').contains('webp') == false)
+#there are a few modules that should NEVER be build as a module but rather be build as static lib and linked in later
+evas_static_list = []
+
subdir('image_loaders')
subdir('image_savers')
subdir('model_savers')
subdir('model_loaders')
subdir('vg_savers')
subdir('vg_loaders')
-
-foreach engine_conf : engines
- engine = engine_conf[0]
- build = true
- if engine_conf[1].length() > 0
- build = get_option(engine_conf[1][0])
- endif
- if build
- engine_include_dir = []
- engine_src = []
- engine_deps = []
- engine_dep = declare_dependency(
- include_directories: include_directories(join_paths('engines', engine)),
- )
-
- var_name = 'engine_'+engine
- set_variable(var_name, engine_dep)
-
- mod_full_name = engine
- mod_install_dir = join_paths(dir_package_modules, 'engines', engine, version_name)
-
- subdir(join_paths('engines', engine))
-
- if get_option('evas-modules') == 'static' or evas_force_static.contains(engine)
- tmp = static_library(mod_full_name, engine_src,
- include_directories : config_dir + [engine_include_dir],
- dependencies : [eina, evas_pre] + engine_deps,
- )
-
- if engine == 'software_generic'
- software_generic = declare_dependency(
- include_directories: engine_include_dir,
- sources : gen_src,
- dependencies : [eina, evas_pre] + engine_deps,
- link_with : tmp
- )
- endif
- if engine == 'gl_common'
- #gl_common will only be used by gl_generic, NOT by libevas.so, so we work arround the static list
- gl_common = declare_dependency(
- include_directories : include_directories(join_paths('engines', 'gl_common')),
- link_with: tmp,
- )
- else
- evas_static_list += declare_dependency(
- include_directories: [include_directories('.')] + config_dir + [engine_include_dir],
- link_with: tmp,
- dependencies : [eina, evas_pre] + engine_deps,
- sources : engine_src
- )
- if engine == 'gl_generic'
- #special case, see evas_module.c
- config_h.set('EVAS_STATIC_BUILD_GL_COMMON', '1')
- else
- config_h.set('EVAS_STATIC_BUILD_'+engine.to_upper(), '1')
- endif
- endif
- else
- #nothing here shared building is handled directly on the engine configuration side
- #reason for this is that the .so files have to be placed in the correct directory in order
- # to make them discoverable by evas module code
- endif
- config_h.set('BUILD_ENGINE_'+engine.to_upper(), '1')
- endif
-endforeach
diff --git a/src/tests/efl_mono/dummy_test_object.eo b/src/tests/efl_mono/dummy_test_object.eo
index a50c70e2e6..b5436a636e 100644
--- a/src/tests/efl_mono/dummy_test_object.eo
+++ b/src/tests/efl_mono/dummy_test_object.eo
@@ -1412,6 +1412,7 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface {
}
implements {
Efl.Object.constructor;
+ Efl.Object.destructor;
Efl.Object.provider_find;
Dummy.Test_Iface.emit_nonconflicted;
Dummy.Test_Iface.iface_prop { get; set; }
diff --git a/src/tests/efl_mono/libefl_mono_native_test.c b/src/tests/efl_mono/libefl_mono_native_test.c
index 17ef5065b2..52d9190994 100644
--- a/src/tests/efl_mono/libefl_mono_native_test.c
+++ b/src/tests/efl_mono/libefl_mono_native_test.c
@@ -162,6 +162,30 @@ _dummy_test_object_efl_object_constructor(Eo *obj, Dummy_Test_Object_Data *pd)
return obj;
}
+static void
+_dummy_test_object_efl_object_destructor(Eo *obj, Dummy_Test_Object_Data *pd)
+{
+ if (pd->stored_value)
+ {
+ eina_value_free(pd->stored_value);
+ pd->stored_value = NULL;
+ }
+
+ if (pd->promise)
+ {
+ eina_promise_reject(pd->promise, ECANCELED);
+ pd->promise = NULL;
+ }
+
+ if (pd->list_for_accessor)
+ {
+ eina_list_free(pd->list_for_accessor);
+ pd->list_for_accessor = NULL;
+ }
+
+ efl_destructor(efl_super(obj, DUMMY_TEST_OBJECT_CLASS));
+}
+
Efl_Object *_dummy_test_object_return_object(Eo *obj, EINA_UNUSED Dummy_Test_Object_Data *pd)
{
return obj;
@@ -3700,11 +3724,11 @@ void _dummy_test_object_set_value_ptr_own(EINA_UNUSED Eo *obj, Dummy_Test_Object
void _dummy_test_object_set_value(EINA_UNUSED Eo *obj, Dummy_Test_Object_Data *pd, Eina_Value value)
{
- if (pd->stored_value) {
- eina_value_free(pd->stored_value);
- } else {
- pd->stored_value = eina_value_new(EINA_VALUE_TYPE_INT);
- }
+ if (pd->stored_value)
+ eina_value_free(pd->stored_value);
+
+ pd->stored_value = eina_value_new(EINA_VALUE_TYPE_INT);
+
eina_value_copy(&value, pd->stored_value);
}
@@ -3922,7 +3946,6 @@ int _dummy_test_object_dummy_test_iface_iface_prop_get(EINA_UNUSED const Eo *obj
Eo * _dummy_test_object_efl_object_provider_find(EINA_UNUSED const Eo *obj, Dummy_Test_Object_Data *pd, const Efl_Class *klass)
{
- EINA_LOG_ERR("klass: %p, NUMBERWRAPPER: %p", klass, DUMMY_NUMBERWRAPPER_CLASS);
if (klass == DUMMY_NUMBERWRAPPER_CLASS)
return pd->provider;
else if (klass == DUMMY_TEST_IFACE_INTERFACE)
@@ -3932,13 +3955,11 @@ Eo * _dummy_test_object_efl_object_provider_find(EINA_UNUSED const Eo *obj, Dumm
Efl_Object *_dummy_test_object_call_find_provider(Eo *obj, EINA_UNUSED Dummy_Test_Object_Data *pd, const Efl_Class *type)
{
- printf("CALLING FIND PROVIDER FROM C");
return efl_provider_find(obj, type);
}
Efl_Object *_dummy_test_object_call_find_provider_for_iface(Eo *obj, EINA_UNUSED Dummy_Test_Object_Data *pd)
{
- printf("CALLING FIND PROVIDER FROM C");
return efl_provider_find(obj, DUMMY_TEST_IFACE_INTERFACE);
}
diff --git a/src/tests/elementary/efl_ui_test_table.c b/src/tests/elementary/efl_ui_test_table.c
index f299fdd9bc..0762528641 100644
--- a/src/tests/elementary/efl_ui_test_table.c
+++ b/src/tests/elementary/efl_ui_test_table.c
@@ -251,9 +251,7 @@ layout_setup()
{
win = win_add();
- layout = efl_add(EFL_UI_TABLE_CLASS, win,
- efl_pack_align_set(efl_added, 0.8, 0.2),
- efl_ui_direction_set(efl_added, EFL_UI_DIR_VERTICAL));
+ layout = efl_add(EFL_UI_TABLE_CLASS, win);
}
static void
@@ -281,6 +279,9 @@ EFL_START_TEST (efl_ui_table_layout_update)
{
int i, max_index = (sizeof(hints) / sizeof(Hint));
+ efl_pack_align_set(layout, 0.8, 0.2);
+ efl_ui_direction_set(layout, EFL_UI_DIR_VERTICAL);
+
Eo *btn = efl_add(EFL_UI_BUTTON_CLASS, layout,
efl_pack_table(layout, efl_added, 0, 0, 1, 1));
@@ -297,6 +298,9 @@ EFL_START_TEST (efl_ui_table_layout_update_pack)
int i, max_index2, max_index3;
Eo *btn, *btn2, *btn3;
+ efl_pack_align_set(layout, 0.8, 0.2);
+ efl_ui_direction_set(layout, EFL_UI_DIR_VERTICAL);
+
max_index2 = ((sizeof(hints2) / sizeof(Hint)) / 2);
max_index3 = ((sizeof(hints3) / sizeof(Hint)) / 3);
@@ -333,6 +337,9 @@ EFL_START_TEST (efl_ui_table_layout_update_matrix)
int i, j, max_index = (sizeof(hints_matrix) / sizeof(Hint));
Eo *btn[9];
+ efl_pack_align_set(layout, 0.8, 0.2);
+ efl_ui_direction_set(layout, EFL_UI_DIR_VERTICAL);
+
efl_gfx_hint_margin_set(layout, 10, 10, 20, 20);
efl_ui_table_homogeneous_set(layout, 0, 1);
efl_pack_padding_set(layout, 10, 5, 0);
@@ -419,6 +426,143 @@ EFL_START_TEST (efl_ui_table_size)
}
EFL_END_TEST
+EFL_START_TEST (efl_ui_table_pack_table)
+{
+#define BTN_NUM 3
+ Eo *o, *btn[BTN_NUM];
+ Eina_Iterator *itr;
+ int i, cols, rows;
+
+ for (i = 0; i < BTN_NUM; i++)
+ btn[i] = efl_add(EFL_UI_BUTTON_CLASS, layout);
+
+ //pack test
+ ck_assert(efl_pack(layout, btn[0]));
+ ck_assert_ptr_eq(efl_pack_table_content_get(layout, 0, 0), btn[0]);
+ efl_pack_table_size_get(layout, &cols, &rows);
+ ck_assert_int_eq(cols, 1);
+ ck_assert_int_eq(rows, 1);
+
+ ck_assert(efl_pack_table(layout, btn[1], 6, 0, 1, 1));
+ ck_assert_ptr_eq(efl_pack_table_content_get(layout, 6, 0), btn[1]);
+ efl_pack_table_size_get(layout, &cols, &rows);
+ ck_assert_int_eq(cols, 7);
+ ck_assert_int_eq(rows, 1);
+
+ ck_assert(efl_pack(layout, btn[2]));
+ ck_assert_ptr_eq(efl_pack_table_content_get(layout, 7, 0), btn[2]);
+ efl_pack_table_size_get(layout, &cols, &rows);
+ ck_assert_int_eq(cols, 8);
+ ck_assert_int_eq(rows, 1);
+
+ ck_assert_int_eq(efl_content_count(layout), BTN_NUM);
+
+ i = 0;
+ itr = efl_content_iterate(layout);
+ EINA_ITERATOR_FOREACH(itr, o)
+ {
+ ck_assert_ptr_eq(o, btn[i++]);
+ }
+ eina_iterator_free(itr);
+
+ //unpack test
+ ck_assert(efl_pack_unpack(layout, btn[2]));
+ ck_assert(!efl_pack_unpack(layout, btn[2]));
+
+ efl_pack_unpack_all(layout);
+ ck_assert_int_eq(efl_content_count(layout), 0);
+ ck_assert(!efl_invalidated_get(btn[0]));
+
+ for (i = 0; i < BTN_NUM; i++)
+ efl_pack(layout, btn[i]);
+
+ efl_pack_clear(layout);
+ ck_assert_int_eq(efl_content_count(layout), 0);
+ ck_assert(efl_invalidated_get(btn[0]));
+#undef BTN_NUM
+}
+EFL_END_TEST
+
+EFL_START_TEST (efl_ui_table_properties)
+{
+ double h, v;
+ Eina_Bool b;
+ Eina_Bool homogeneoush, homogeneousv;
+ Efl_Ui_Dir dirh, dirv;
+
+ //align test
+ efl_pack_align_get(layout, &h, &v);
+ ck_assert(EINA_DBL_EQ(h, 0.5));
+ ck_assert(EINA_DBL_EQ(v, 0.5));
+
+ efl_pack_align_set(layout, 0.3, 0.8234);
+ efl_pack_align_get(layout, &h, &v);
+ ck_assert(EINA_DBL_EQ(h, 0.3));
+ ck_assert(EINA_DBL_EQ(v, 0.8234));
+
+ efl_pack_align_set(layout, -0.23, 123);
+ efl_pack_align_get(layout, &h, &v);
+ ck_assert(EINA_DBL_EQ(h, -1));
+ ck_assert(EINA_DBL_EQ(v, 1));
+
+ //padding test
+ efl_pack_padding_get(layout, &h, &v, &b);
+ ck_assert(EINA_DBL_EQ(h, 0.0));
+ ck_assert(EINA_DBL_EQ(v, 0.0));
+ ck_assert_int_eq(b, 0);
+
+ efl_pack_padding_set(layout, 0.3, 0.8234, 1);
+ efl_pack_padding_get(layout, &h, &v, &b);
+ ck_assert(EINA_DBL_EQ(h, 0.3));
+ ck_assert(EINA_DBL_EQ(v, 0.8234));
+ ck_assert_int_eq(b, 1);
+
+ efl_pack_padding_set(layout, -1.23, 123, 45);
+ efl_pack_padding_get(layout, &h, &v, &b);
+ ck_assert(EINA_DBL_EQ(h, 0));
+ ck_assert(EINA_DBL_EQ(v, 123));
+ ck_assert_int_eq(b, 1);
+
+ //direction test
+ efl_pack_table_direction_get(layout, &dirh, &dirv);
+ ck_assert_int_eq(dirh, EFL_UI_DIR_RIGHT);
+ ck_assert_int_eq(dirv, EFL_UI_DIR_DOWN);
+
+ efl_pack_table_direction_set(layout, EFL_UI_DIR_VERTICAL, EFL_UI_DIR_HORIZONTAL);
+ efl_pack_table_direction_get(layout, &dirh, &dirv);
+ ck_assert_int_eq(dirh, EFL_UI_DIR_VERTICAL);
+ ck_assert_int_eq(dirv, EFL_UI_DIR_HORIZONTAL);
+
+ efl_pack_table_direction_set(layout, EFL_UI_DIR_RIGHT, EFL_UI_DIR_RIGHT);
+ efl_pack_table_direction_get(layout, &dirh, &dirv);
+ ck_assert_int_eq(dirh, EFL_UI_DIR_RIGHT);
+ ck_assert_int_eq(dirv, EFL_UI_DIR_DOWN);
+
+ ck_assert_int_eq(efl_ui_direction_get(layout), EFL_UI_DIR_RIGHT);
+
+ efl_ui_direction_set(layout, EFL_UI_DIR_DEFAULT);
+ ck_assert_int_eq(efl_ui_direction_get(layout), EFL_UI_DIR_RIGHT);
+
+ efl_ui_direction_set(layout, EFL_UI_DIR_HORIZONTAL);
+ ck_assert_int_eq(efl_ui_direction_get(layout), EFL_UI_DIR_HORIZONTAL);
+
+ //homogeneous test
+ efl_ui_table_homogeneous_get(layout, &homogeneoush, &homogeneousv);
+ ck_assert_int_eq(homogeneoush, 0);
+ ck_assert_int_eq(homogeneousv, 0);
+
+ efl_ui_table_homogeneous_set(layout, 123, -123);
+ efl_ui_table_homogeneous_get(layout, &homogeneoush, &homogeneousv);
+ ck_assert_int_eq(homogeneoush, 1);
+ ck_assert_int_eq(homogeneousv, 1);
+
+ efl_ui_table_homogeneous_set(layout, 1, 0);
+ efl_ui_table_homogeneous_get(layout, &homogeneoush, &homogeneousv);
+ ck_assert_int_eq(homogeneoush, 1);
+ ck_assert_int_eq(homogeneousv, 0);
+}
+EFL_END_TEST
+
void efl_ui_test_table(TCase *tc)
{
tcase_add_checked_fixture(tc, layout_setup, layout_teardown);
@@ -427,4 +571,6 @@ void efl_ui_test_table(TCase *tc)
tcase_add_test(tc, efl_ui_table_layout_update);
tcase_add_test(tc, efl_ui_table_layout_update_pack);
tcase_add_test(tc, efl_ui_table_layout_update_matrix);
+ tcase_add_test(tc, efl_ui_table_pack_table);
+ tcase_add_test(tc, efl_ui_table_properties);
}
diff --git a/src/tests/elementary/spec/efl_test_content.c b/src/tests/elementary/spec/efl_test_content.c
new file mode 100644
index 0000000000..e0652b6e02
--- /dev/null
+++ b/src/tests/elementary/spec/efl_test_content.c
@@ -0,0 +1,114 @@
+#ifdef HAVE_CONFIG_H
+# include "elementary_config.h"
+#endif
+
+#include <Efl_Ui.h>
+#include "efl_ui_spec_suite.h"
+#include "suite_helpers.h"
+
+EFL_START_TEST(content_set_get)
+{
+ Efl_Ui_Widget *w = efl_add(WIDGET_CLASS, win);
+
+ ck_assert_int_eq(efl_content_set(widget, w), EINA_TRUE);
+ ck_assert_ptr_eq(efl_ui_widget_parent_get(w), widget);
+ ck_assert_ptr_eq(efl_content_get(widget), w);
+
+ EXPECT_ERROR_START;
+ ck_assert_int_eq(efl_content_set(widget, (void*)0x1), EINA_FALSE);
+ EXPECT_ERROR_END;
+ ck_assert_ptr_eq(efl_content_get(widget), NULL);
+}
+EFL_END_TEST
+
+EFL_START_TEST(content_set_get2)
+{
+ Efl_Ui_Widget *w = efl_add(WIDGET_CLASS, win);
+
+ ck_assert_int_eq(efl_content_set(widget, w), EINA_TRUE);
+ ck_assert_ptr_eq(efl_ui_widget_parent_get(w), widget);
+ ck_assert_ptr_eq(efl_content_get(widget), w);
+
+ ck_assert_int_eq(efl_content_set(widget, NULL), EINA_TRUE);
+ ck_assert_ptr_eq(efl_content_get(widget), NULL);
+}
+EFL_END_TEST
+
+
+EFL_START_TEST(content_unset)
+{
+ Efl_Ui_Widget *w = efl_add(WIDGET_CLASS, win);
+
+ ck_assert_int_eq(efl_content_set(widget, w), EINA_TRUE);
+ efl_content_unset(widget);
+ ck_assert_ptr_eq(efl_content_get(widget), NULL);
+}
+EFL_END_TEST
+
+EFL_START_TEST(content_lifetime1)
+{
+ Efl_Ui_Widget *w1 = efl_add(WIDGET_CLASS, win);
+
+ efl_wref_add(w1, &w1);
+ ck_assert_int_eq(efl_content_set(widget, w1), EINA_TRUE);
+ efl_del(widget);
+ ck_assert_ptr_eq(w1, NULL);
+}
+EFL_END_TEST
+
+EFL_START_TEST(content_lifetime2)
+{
+ Efl_Ui_Widget *w1 = efl_add(WIDGET_CLASS, win), *w2 = efl_add(WIDGET_CLASS, win);
+
+ efl_wref_add(w2, &w2);
+ efl_wref_add(w1, &w1);
+
+ ck_assert_int_eq(efl_content_set(widget, w1), EINA_TRUE);
+ ck_assert_int_eq(efl_content_set(widget, w2), EINA_TRUE);
+ ck_assert_ptr_eq(w1, NULL);
+ efl_del(widget);
+ ck_assert_ptr_eq(w2, NULL);
+}
+EFL_END_TEST
+
+EFL_START_TEST(content_lifetime3)
+{
+ Efl_Ui_Widget *w1 = efl_add(WIDGET_CLASS, win);
+ Eina_Bool content_changed_event = EINA_FALSE;
+
+ ck_assert_int_eq(efl_content_set(widget, w1), EINA_TRUE);
+ efl_test_container_expect_evt_content_added(widget, EFL_CONTENT_EVENT_CONTENT_CHANGED, &content_changed_event, NULL);
+ efl_del(w1);
+ ck_assert_int_eq(content_changed_event, EINA_TRUE);
+ ck_assert_ptr_eq(efl_content_get(widget), NULL);
+}
+EFL_END_TEST
+
+EFL_START_TEST(content_event)
+{
+ Efl_Ui_Widget *w1 = efl_add(WIDGET_CLASS, win), *w2 = efl_add(WIDGET_CLASS, win);
+ Eina_Bool content_changed_event;
+
+ content_changed_event = EINA_FALSE;
+ efl_test_container_expect_evt_content_added(widget, EFL_CONTENT_EVENT_CONTENT_CHANGED, &content_changed_event, w1);
+ ck_assert_int_eq(efl_content_set(widget, w1), EINA_TRUE);
+ ck_assert_int_eq(content_changed_event, EINA_TRUE);
+
+ content_changed_event = EINA_FALSE;
+ efl_test_container_expect_evt_content_added(widget, EFL_CONTENT_EVENT_CONTENT_CHANGED, &content_changed_event, w2);
+ ck_assert_int_eq(efl_content_set(widget, w2), EINA_TRUE);
+ ck_assert_int_eq(content_changed_event, EINA_TRUE);
+}
+EFL_END_TEST
+
+void
+efl_content_behavior_test(TCase *tc)
+{
+ tcase_add_test(tc, content_set_get);
+ tcase_add_test(tc, content_set_get2);
+ tcase_add_test(tc, content_lifetime1);
+ tcase_add_test(tc, content_lifetime2);
+ tcase_add_test(tc, content_lifetime3);
+ tcase_add_test(tc, content_unset);
+ tcase_add_test(tc, content_event);
+}
diff --git a/src/tests/elementary/spec/efl_ui_spec_suite.c b/src/tests/elementary/spec/efl_ui_spec_suite.c
index 1b84cf540e..22ed329647 100644
--- a/src/tests/elementary/spec/efl_ui_spec_suite.c
+++ b/src/tests/elementary/spec/efl_ui_spec_suite.c
@@ -2,6 +2,7 @@
# include "elementary_config.h"
#endif
+#include <Elementary.h>
#include <Efl_Ui.h>
#include "efl_ui_spec_suite.h"
#include "suite_helpers.h"
diff --git a/src/tests/elementary/spec/efl_ui_spec_suite.h b/src/tests/elementary/spec/efl_ui_spec_suite.h
index c8e008fa60..6585fb58bd 100644
--- a/src/tests/elementary/spec/efl_ui_spec_suite.h
+++ b/src/tests/elementary/spec/efl_ui_spec_suite.h
@@ -12,7 +12,7 @@ extern Evas_Object *widget;
void efl_pack_behavior_test(TCase *tc);
void efl_pack_linear_behavior_test(TCase *tc);
-
+void efl_content_behavior_test(TCase *tc);
void efl_test_container_content_equal(Efl_Ui_Widget **wid, unsigned int len);
void efl_test_container_expect_evt_content_added(Efl_Ui_Widget *widget, const Efl_Event_Description *ev, Eina_Bool *flag, void *event_data);
diff --git a/src/tests/elementary/spec/generator.py b/src/tests/elementary/spec/generator.py
index 47749fac07..3a84b01862 100755
--- a/src/tests/elementary/spec/generator.py
+++ b/src/tests/elementary/spec/generator.py
@@ -3,6 +3,10 @@
tests = [
["Efl.Pack_Linear" , "Efl.Ui.Box"],
["Efl.Pack" , "Efl.Ui.Table"],
+ ["Efl.Content" , "Efl.Ui.Button", "Efl.Ui.Frame", "Efl.Ui.Grid_Default_Item",
+ "Efl.Ui.List_Default_Item", "Efl.Ui.List_Empty_Item",
+ "Efl.Ui.Navigation_Layout", "Efl.Ui.Panel", "Efl.Ui.Progressbar",
+ "Efl.Ui.Radio", "Efl.Ui.Popup", "Efl.Ui.Tab_Page", "Efl.Ui.Scroller"]
]
fixture_gen_template = """
diff --git a/src/tests/elementary/spec/meson.build b/src/tests/elementary/spec/meson.build
index 495d864bda..7f87d8e8e4 100644
--- a/src/tests/elementary/spec/meson.build
+++ b/src/tests/elementary/spec/meson.build
@@ -6,6 +6,7 @@ efl_ui_suite_behavior_src = [
'efl_test_pack.c',
'efl_test_pack_linear.c',
'efl_test_container.c',
+ 'efl_test_content.c',
]
test_generator = find_program('generator.py')