diff --git a/src/bin/eolian_mono/eolian/mono/function_definition.hh b/src/bin/eolian_mono/eolian/mono/function_definition.hh --- a/src/bin/eolian_mono/eolian/mono/function_definition.hh +++ b/src/bin/eolian_mono/eolian/mono/function_definition.hh @@ -293,6 +293,42 @@ return false; } + return true; + } + + grammar::attributes::klass_def const& cls; +}; + +property_extension_method_definition_generator property_extension_method_definition (grammar::attributes::klass_def const& cls) +{ + return {cls}; +} + +struct part_property_extension_method_definition_generator +{ + template + bool generate(OutputIterator sink, attributes::property_def const& property, Context context) const + { + if (blacklist::is_property_blacklisted(property, context)) + return true; + + auto options = efl::eolian::grammar::context_find_tag(context); + + if (!options.want_beta) + return true; // Bindable is a beta feature for now. + + auto get_params = property.getter.is_engaged() ? property.getter->parameters.size() : 0; + auto set_params = property.setter.is_engaged() ? property.setter->parameters.size() : 0; + + std::string managed_name = name_helpers::property_managed_name(property); + + if (get_params > 0 || set_params > 1) + return true; + + std::string dir_mod; + if (property.setter.is_engaged()) + dir_mod = direction_modifier(property.setter->parameters[0]); + // Do we need BindablePart extensions for this class? // IContent parts are handled directly through BindableFactoryParts if (!helpers::inherits_from(cls, "Efl.Ui.LayoutPart") || helpers::inherits_from(cls, "Efl.IContent")) @@ -317,7 +353,7 @@ grammar::attributes::klass_def const& cls; }; -property_extension_method_definition_generator property_extension_method_definition (grammar::attributes::klass_def const& cls) +part_property_extension_method_definition_generator part_property_extension_method_definition (grammar::attributes::klass_def const& cls) { return {cls}; } @@ -573,6 +609,8 @@ template <> struct is_eager_generator< ::eolian_mono::property_extension_method_definition_generator> : std::true_type {}; template <> +struct is_eager_generator< ::eolian_mono::part_property_extension_method_definition_generator> : std::true_type {}; +template <> struct is_eager_generator< ::eolian_mono::property_wrapper_definition_generator> : std::true_type {}; template <> struct is_eager_generator< ::eolian_mono::property_wrapper_definition_parameterized> : std::true_type {}; @@ -585,6 +623,8 @@ template <> struct is_generator< ::eolian_mono::property_extension_method_definition_generator> : std::true_type {}; template <> +struct is_generator< ::eolian_mono::part_property_extension_method_definition_generator> : std::true_type {}; +template <> struct is_generator< ::eolian_mono::property_wrapper_definition_generator> : std::true_type {}; template <> struct is_generator< ::eolian_mono::property_wrapper_definition_parameterized> : std::true_type {}; @@ -602,6 +642,9 @@ template <> struct attributes_needed< ::eolian_mono::property_extension_method_definition_generator> : std::integral_constant {}; +template <> +struct attributes_needed< ::eolian_mono::part_property_extension_method_definition_generator> : std::integral_constant {}; + template <> struct attributes_needed< ::eolian_mono::property_wrapper_definition_generator> : std::integral_constant {}; template <> diff --git a/src/bin/eolian_mono/eolian/mono/klass.hh b/src/bin/eolian_mono/eolian/mono/klass.hh --- a/src/bin/eolian_mono/eolian/mono/klass.hh +++ b/src/bin/eolian_mono/eolian/mono/klass.hh @@ -297,8 +297,9 @@ if (!as_generator (*property_extension_method_definition(cls) + << *part_property_extension_method_definition(cls) << *part_extension_method_definition(cls)) - .generate(extension_method_iterator, std::make_tuple(implementable_properties, cls.parts), context)) + .generate(extension_method_iterator, std::make_tuple(cls.properties, implementable_properties, cls.parts), context)) return false; if (extension_method_stream.tellp() <= 0)