forked from enlightenment/efl
efl-csharp: Respect beta for classes and other stuff.
Summary: In order to work around an issue with Efl.App, which is stable but inherits from Efl.Core.Command_Line, @beta interfaces/mixins in the inheritance chain are simply skipped. Also changed the class used int test for inheritance from C# Efl.Loop is stable but internally it uses a @beta class as argument to its Register() method in the constructor. When instantiating a user-defined C# subclass, the binding calls the C# override in the NativeInherit class and the marshalling fails as no code is generated for the beta class. Also moved Efl.Part test to a beta class. Efl.Part is still beta. Regarding parts, they are skipped if its class is @beta too. Also rejected all elm_* files in elm public eo files. They should get back in as they are converted to Efl.Ui.* api. An exception is elm_interface_scrollable.eo, as efl_ui_panel depends on it. Fixes T7730 Test Plan: Run tests Reviewers: vitor.sousa, segfaultxavi, felipealmeida, cedric, bu5hm4n, zmike Reviewed By: vitor.sousa Subscribers: #reviewers, #committers Tags: #efl Maniphest Tasks: T7730 Differential Revision: https://phab.enlightenment.org/D8268
This commit is contained in:
parent
2a003420f8
commit
f29ceef500
|
@ -67,6 +67,7 @@ efl_mono_test_files = \
|
||||||
tests/efl_mono/dummy_test_iface.eo \
|
tests/efl_mono/dummy_test_iface.eo \
|
||||||
tests/efl_mono/dummy_another_iface.eo \
|
tests/efl_mono/dummy_another_iface.eo \
|
||||||
tests/efl_mono/dummy_child.eo \
|
tests/efl_mono/dummy_child.eo \
|
||||||
|
tests/efl_mono/dummy_part_holder.eo \
|
||||||
tests/efl_mono/dummy_numberwrapper.eo \
|
tests/efl_mono/dummy_numberwrapper.eo \
|
||||||
tests/efl_mono/mono_test_driver.sh
|
tests/efl_mono/mono_test_driver.sh
|
||||||
|
|
||||||
|
@ -177,6 +178,10 @@ lib/elementary/elm_genlist_eo.cs \
|
||||||
lib/elementary/elm_view_list_eo.cs \
|
lib/elementary/elm_view_list_eo.cs \
|
||||||
lib/elementary/elm_genlist_item_eo.cs \
|
lib/elementary/elm_genlist_item_eo.cs \
|
||||||
lib/elementary/elm_gengrid_eo.cs \
|
lib/elementary/elm_gengrid_eo.cs \
|
||||||
|
lib/elementary/elm_code_widget.eo.cs \
|
||||||
|
lib/elementary/elm_multibuttonentry_part.eo.cs \
|
||||||
|
lib/elementary/elm_atspi_bridge.eo.cs \
|
||||||
|
lib/elementary/elm_atspi_app_object.eo.cs \
|
||||||
lib/elementary/elm_glview_eo.cs
|
lib/elementary/elm_glview_eo.cs
|
||||||
|
|
||||||
efl_mono_blacklisted_files = \
|
efl_mono_blacklisted_files = \
|
||||||
|
@ -406,6 +411,8 @@ tests/efl_mono/libefl_mono_native_test.c: \
|
||||||
tests/efl_mono/dummy_another_iface.eo.c \
|
tests/efl_mono/dummy_another_iface.eo.c \
|
||||||
tests/efl_mono/dummy_child.eo.h \
|
tests/efl_mono/dummy_child.eo.h \
|
||||||
tests/efl_mono/dummy_child.eo.c \
|
tests/efl_mono/dummy_child.eo.c \
|
||||||
|
tests/efl_mono/dummy_part_holder.eo.h \
|
||||||
|
tests/efl_mono/dummy_part_holder.eo.c \
|
||||||
tests/efl_mono/dummy_numberwrapper.eo.h \
|
tests/efl_mono/dummy_numberwrapper.eo.h \
|
||||||
tests/efl_mono/dummy_numberwrapper.eo.c \
|
tests/efl_mono/dummy_numberwrapper.eo.c \
|
||||||
tests/efl_mono/dummy_inherit_iface.eo.h \
|
tests/efl_mono/dummy_inherit_iface.eo.h \
|
||||||
|
@ -418,6 +425,7 @@ efl_mono_test_eolian_mono_files = tests/efl_mono/dummy_test_object.eo.cs \
|
||||||
tests/efl_mono/dummy_test_iface.eo.cs \
|
tests/efl_mono/dummy_test_iface.eo.cs \
|
||||||
tests/efl_mono/dummy_another_iface.eo.cs \
|
tests/efl_mono/dummy_another_iface.eo.cs \
|
||||||
tests/efl_mono/dummy_child.eo.cs \
|
tests/efl_mono/dummy_child.eo.cs \
|
||||||
|
tests/efl_mono/dummy_part_holder.eo.cs \
|
||||||
tests/efl_mono/dummy_numberwrapper.eo.cs \
|
tests/efl_mono/dummy_numberwrapper.eo.cs \
|
||||||
tests/efl_mono/dummy_inherit_iface.eo.cs \
|
tests/efl_mono/dummy_inherit_iface.eo.cs \
|
||||||
tests/efl_mono/dummy_inherit_helper.eo.cs
|
tests/efl_mono/dummy_inherit_helper.eo.cs
|
||||||
|
@ -493,7 +501,7 @@ tests/efl_mono/%.eo.cs: tests/efl_mono/%.eo $(_EOLIAN_MONO_DEP)
|
||||||
$(MKDIR_P) $(dir $@); \
|
$(MKDIR_P) $(dir $@); \
|
||||||
$(EOLIAN_MONO) $(EOLIAN_FLAGS) $(EOLIAN_MONO_FLAGS) --dllimport "@DLIB_PREFIX_MONO@efl_mono_native_test@DLIB_SUFFIX_MONO@" -o $@ $(ALL_EO_REFS) $<
|
$(EOLIAN_MONO) $(EOLIAN_FLAGS) $(EOLIAN_MONO_FLAGS) --dllimport "@DLIB_PREFIX_MONO@efl_mono_native_test@DLIB_SUFFIX_MONO@" -o $@ $(ALL_EO_REFS) $<
|
||||||
|
|
||||||
CLEANFILES += tests/efl_mono/libefl_mono_test.dll tests/efl_mono/dummy_test_object.eo.cs tests/efl_mono/dummy_child.eo.cs tests/efl_mono/dummy_numberwrapper.eo.cs tests/efl_mono/dummy_test_object.eo.c tests/efl_mono/dummy_child.eo.c tests/efl_mono/dummy_numberwrapper.eo.c tests/efl_mono/dummy_test_object.eo.h tests/efl_mono/dummy_child.eo.h tests/efl_mono/dummy_numberwrapper.eo.h tests/efl_mono/efl_mono.config
|
CLEANFILES += tests/efl_mono/libefl_mono_test.dll tests/efl_mono/dummy_test_object.eo.cs tests/efl_mono/dummy_child.eo.cs tests/efl_mono/dummy_numberwrapper.eo.cs tests/efl_mono/dummy_test_object.eo.c tests/efl_mono/dummy_child.eo.c tests/efl_mono/dummy_numberwrapper.eo.c tests/efl_mono/dummy_test_object.eo.h tests/efl_mono/dummy_child.eo.h tests/efl_mono/dummy_part_holder.eo.cs tests/efl_mono/dummy_part_holder.eo.c tests/efl_mono/dummy_part_holder.eo.h tests/efl_mono/dummy_numberwrapper.eo.h tests/efl_mono/efl_mono.config
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
|
@ -67,6 +67,7 @@ inline bool is_function_blacklisted(attributes::function_def const& func, Contex
|
||||||
// Blacklist structs that require some kind of manual binding.
|
// Blacklist structs that require some kind of manual binding.
|
||||||
inline bool is_struct_blacklisted(std::string const& full_name)
|
inline bool is_struct_blacklisted(std::string const& full_name)
|
||||||
{
|
{
|
||||||
|
// For now, these manual structs are blacklisted regardless of beta status
|
||||||
return full_name == "Efl.Event_Description"
|
return full_name == "Efl.Event_Description"
|
||||||
|| full_name == "Eina.Binbuf"
|
|| full_name == "Eina.Binbuf"
|
||||||
|| full_name == "Eina.Strbuf"
|
|| full_name == "Eina.Strbuf"
|
||||||
|
@ -78,11 +79,28 @@ inline bool is_struct_blacklisted(std::string const& full_name)
|
||||||
|| full_name == "Eina.Future";
|
|| full_name == "Eina.Future";
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool is_struct_blacklisted(attributes::struct_def const& struct_)
|
template <typename Context>
|
||||||
|
inline bool is_struct_blacklisted(attributes::struct_def const& struct_, Context context)
|
||||||
{
|
{
|
||||||
|
auto options = efl::eolian::grammar::context_find_tag<options_context>(context);
|
||||||
|
if (struct_.is_beta && !options.want_beta)
|
||||||
|
return true;
|
||||||
|
|
||||||
return is_struct_blacklisted(name_helpers::struct_full_eolian_name(struct_));
|
return is_struct_blacklisted(name_helpers::struct_full_eolian_name(struct_));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Struct as type_def is for places where the struct is used as a struct field or parameter/return.
|
||||||
|
template <typename Context>
|
||||||
|
inline bool is_struct_blacklisted(attributes::type_def const& struct_, Context context)
|
||||||
|
{
|
||||||
|
auto options = efl::eolian::grammar::context_find_tag<options_context>(context);
|
||||||
|
if (struct_.is_beta && !options.want_beta)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
auto regular = efl::eina::get<attributes::regular_type_def>(struct_.original_type);
|
||||||
|
return is_struct_blacklisted(name_helpers::type_full_eolian_name(regular));
|
||||||
|
}
|
||||||
|
|
||||||
inline bool is_struct_blacklisted(attributes::regular_type_def const& struct_)
|
inline bool is_struct_blacklisted(attributes::regular_type_def const& struct_)
|
||||||
{
|
{
|
||||||
return is_struct_blacklisted(name_helpers::type_full_eolian_name(struct_));
|
return is_struct_blacklisted(name_helpers::type_full_eolian_name(struct_));
|
||||||
|
@ -114,6 +132,31 @@ inline bool is_property_blacklisted(attributes::property_def const& property, Co
|
||||||
return is_property_blacklisted(name);
|
return is_property_blacklisted(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<typename Context>
|
||||||
|
inline bool is_class_blacklisted(attributes::klass_def const& cls, Context context)
|
||||||
|
{
|
||||||
|
auto options = efl::eolian::grammar::context_find_tag<options_context>(context);
|
||||||
|
|
||||||
|
return cls.is_beta && !options.want_beta;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename Context>
|
||||||
|
inline bool is_class_blacklisted(attributes::klass_name const& cls, Context context)
|
||||||
|
{
|
||||||
|
auto options = efl::eolian::grammar::context_find_tag<options_context>(context);
|
||||||
|
|
||||||
|
return cls.is_beta && !options.want_beta;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<typename Context>
|
||||||
|
inline bool is_event_blacklisted(attributes::event_def const& evt, Context context)
|
||||||
|
{
|
||||||
|
auto options = efl::eolian::grammar::context_find_tag<options_context>(context);
|
||||||
|
|
||||||
|
return evt.beta && !options.want_beta;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -93,6 +93,9 @@ struct event_argument_wrapper_generator
|
||||||
if (!etype.is_engaged())
|
if (!etype.is_engaged())
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
if (blacklist::is_event_blacklisted(evt, context))
|
||||||
|
return true;
|
||||||
|
|
||||||
std::string evt_name = name_helpers::managed_event_name(evt.name);
|
std::string evt_name = name_helpers::managed_event_name(evt.name);
|
||||||
|
|
||||||
return as_generator("///<summary>Event argument wrapper for event <see cref=\""
|
return as_generator("///<summary>Event argument wrapper for event <see cref=\""
|
||||||
|
@ -119,6 +122,9 @@ struct event_declaration_generator
|
||||||
std::string wrapper_args_type;
|
std::string wrapper_args_type;
|
||||||
std::string evt_name = name_helpers::managed_event_name(evt.name);
|
std::string evt_name = name_helpers::managed_event_name(evt.name);
|
||||||
|
|
||||||
|
if (blacklist::is_event_blacklisted(evt, context))
|
||||||
|
return true;
|
||||||
|
|
||||||
if (evt.type.is_engaged())
|
if (evt.type.is_engaged())
|
||||||
wrapper_args_type = "<" + name_helpers::managed_event_args_name(evt) + ">";
|
wrapper_args_type = "<" + name_helpers::managed_event_args_name(evt) + ">";
|
||||||
|
|
||||||
|
@ -143,6 +149,9 @@ struct event_registration_generator
|
||||||
{
|
{
|
||||||
std::string wrapper_event_name;
|
std::string wrapper_event_name;
|
||||||
|
|
||||||
|
if (blacklist::is_event_blacklisted(evt, context))
|
||||||
|
return true;
|
||||||
|
|
||||||
if (is_inherited_event && !helpers::is_unique_event(evt, leaf_klass))
|
if (is_inherited_event && !helpers::is_unique_event(evt, leaf_klass))
|
||||||
wrapper_event_name = name_helpers::translate_inherited_event_name(evt, klass);
|
wrapper_event_name = name_helpers::translate_inherited_event_name(evt, klass);
|
||||||
else
|
else
|
||||||
|
@ -172,6 +181,9 @@ struct event_definition_generator
|
||||||
template<typename OutputIterator, typename Context>
|
template<typename OutputIterator, typename Context>
|
||||||
bool generate(OutputIterator sink, attributes::event_def const& evt, Context context) const
|
bool generate(OutputIterator sink, attributes::event_def const& evt, Context context) const
|
||||||
{
|
{
|
||||||
|
if (blacklist::is_event_blacklisted(evt, context))
|
||||||
|
return true;
|
||||||
|
|
||||||
std::string managed_evt_name = name_helpers::managed_event_name(evt.name);
|
std::string managed_evt_name = name_helpers::managed_event_name(evt.name);
|
||||||
|
|
||||||
bool is_unique = helpers::is_unique_event(evt, leaf_klass);
|
bool is_unique = helpers::is_unique_event(evt, leaf_klass);
|
||||||
|
|
|
@ -9,15 +9,17 @@
|
||||||
#include "function_helpers.hh"
|
#include "function_helpers.hh"
|
||||||
#include "documentation.hh"
|
#include "documentation.hh"
|
||||||
#include "generation_contexts.hh"
|
#include "generation_contexts.hh"
|
||||||
|
#include "blacklist.hh"
|
||||||
|
|
||||||
namespace eolian_mono {
|
namespace eolian_mono {
|
||||||
|
|
||||||
// Blacklist structs that require some kind of manual binding.
|
// Blacklist structs that require some kind of manual binding.
|
||||||
static bool is_function_ptr_blacklisted(attributes::function_def const& func)
|
template <typename Context>
|
||||||
|
static bool is_function_ptr_blacklisted(attributes::function_def const& func, Context context)
|
||||||
{
|
{
|
||||||
std::string name = name_helpers::function_ptr_full_eolian_name(func);
|
std::string name = name_helpers::function_ptr_full_eolian_name(func);
|
||||||
|
|
||||||
return false;
|
return blacklist::is_function_blacklisted(func, context);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct function_pointer {
|
struct function_pointer {
|
||||||
|
@ -28,13 +30,13 @@ struct function_pointer {
|
||||||
// FIXME export Typedecl in eolian_cxx API
|
// FIXME export Typedecl in eolian_cxx API
|
||||||
auto funcptr_ctx = context_add_tag(class_context{class_context::function_ptr}, context);
|
auto funcptr_ctx = context_add_tag(class_context{class_context::function_ptr}, context);
|
||||||
|
|
||||||
|
if (is_function_ptr_blacklisted(f, context))
|
||||||
|
return true;
|
||||||
|
|
||||||
std::string return_type;
|
std::string return_type;
|
||||||
if(!as_generator(eolian_mono::type(true)).generate(std::back_inserter(return_type), f.return_type, context))
|
if(!as_generator(eolian_mono::type(true)).generate(std::back_inserter(return_type), f.return_type, context))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (is_function_ptr_blacklisted(f))
|
|
||||||
return true;
|
|
||||||
|
|
||||||
if (!name_helpers::open_namespaces(sink, f.namespaces, funcptr_ctx))
|
if (!name_helpers::open_namespaces(sink, f.namespaces, funcptr_ctx))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
|
@ -102,8 +102,10 @@ std::set<attributes::klass_name, attributes::compare_klass_name_by_name> interfa
|
||||||
|
|
||||||
// Returns the set of interfaces implemented by this type that haven't been implemented
|
// Returns the set of interfaces implemented by this type that haven't been implemented
|
||||||
// by a regular parent class.
|
// by a regular parent class.
|
||||||
std::set<attributes::klass_name, attributes::compare_klass_name_by_name> non_implemented_interfaces(attributes::klass_def const& cls)
|
template<typename Context>
|
||||||
|
std::set<attributes::klass_name, attributes::compare_klass_name_by_name> non_implemented_interfaces(attributes::klass_def const& cls, Context context)
|
||||||
{
|
{
|
||||||
|
auto options = efl::eolian::grammar::context_find_tag<options_context>(context);
|
||||||
std::set<attributes::klass_name, attributes::compare_klass_name_by_name> implemented_interfaces;
|
std::set<attributes::klass_name, attributes::compare_klass_name_by_name> implemented_interfaces;
|
||||||
std::set<attributes::klass_name, attributes::compare_klass_name_by_name> interfaces;
|
std::set<attributes::klass_name, attributes::compare_klass_name_by_name> interfaces;
|
||||||
|
|
||||||
|
@ -114,6 +116,9 @@ std::set<attributes::klass_name, attributes::compare_klass_name_by_name> non_imp
|
||||||
attributes::klass_def c(get_klass(klass, cls.unit), cls.unit);
|
attributes::klass_def c(get_klass(klass, cls.unit), cls.unit);
|
||||||
for(auto&& inherit : c.immediate_inherits)
|
for(auto&& inherit : c.immediate_inherits)
|
||||||
{
|
{
|
||||||
|
if (inherit.is_beta && !options.want_beta)
|
||||||
|
continue;
|
||||||
|
|
||||||
switch(inherit.type)
|
switch(inherit.type)
|
||||||
{
|
{
|
||||||
case attributes::class_type::mixin:
|
case attributes::class_type::mixin:
|
||||||
|
|
|
@ -95,6 +95,13 @@ struct klass
|
||||||
bool generate(OutputIterator sink, attributes::klass_def const& cls, Context const& context) const
|
bool generate(OutputIterator sink, attributes::klass_def const& cls, Context const& context) const
|
||||||
{
|
{
|
||||||
EINA_CXX_DOM_LOG_DBG(eolian_mono::domain) << "klass_generator: " << cls.eolian_name << std::endl;
|
EINA_CXX_DOM_LOG_DBG(eolian_mono::domain) << "klass_generator: " << cls.eolian_name << std::endl;
|
||||||
|
|
||||||
|
if (blacklist::is_class_blacklisted(cls, context))
|
||||||
|
{
|
||||||
|
EINA_CXX_DOM_LOG_DBG(eolian_mono::domain) << "class " << cls.eolian_name << " is blacklisted. Skipping." << std::endl;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
std::string suffix, class_type;
|
std::string suffix, class_type;
|
||||||
switch(cls.type)
|
switch(cls.type)
|
||||||
{
|
{
|
||||||
|
@ -183,7 +190,7 @@ struct klass
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
bool root = !helpers::has_regular_ancestor(cls);
|
bool root = !helpers::has_regular_ancestor(cls);
|
||||||
std::set<attributes::klass_name, attributes::compare_klass_name_by_name> inherit_interfaces = helpers::non_implemented_interfaces(cls);
|
std::set<attributes::klass_name, attributes::compare_klass_name_by_name> inherit_interfaces = helpers::non_implemented_interfaces(cls, context);
|
||||||
std::vector<attributes::klass_name> inherit_classes;
|
std::vector<attributes::klass_name> inherit_classes;
|
||||||
std::copy_if(cls.immediate_inherits.begin(), cls.immediate_inherits.end()
|
std::copy_if(cls.immediate_inherits.begin(), cls.immediate_inherits.end()
|
||||||
, std::back_inserter(inherit_classes)
|
, std::back_inserter(inherit_classes)
|
||||||
|
@ -268,7 +275,7 @@ struct klass
|
||||||
if (!as_generator(*(property_wrapper_definition)).generate(sink, cls.properties, concrete_cxt))
|
if (!as_generator(*(property_wrapper_definition)).generate(sink, cls.properties, concrete_cxt))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
for (auto&& klass : helpers::non_implemented_interfaces(cls))
|
for (auto&& klass : helpers::non_implemented_interfaces(cls, concrete_cxt))
|
||||||
{
|
{
|
||||||
attributes::klass_def c(get_klass(klass, cls.unit), cls.unit);
|
attributes::klass_def c(get_klass(klass, cls.unit), cls.unit);
|
||||||
if (!as_generator(*(property_wrapper_definition)).generate(sink, c.properties, concrete_cxt))
|
if (!as_generator(*(property_wrapper_definition)).generate(sink, c.properties, concrete_cxt))
|
||||||
|
@ -340,7 +347,7 @@ struct klass
|
||||||
if (!as_generator(*(property_wrapper_definition)).generate(sink, cls.properties, inherit_cxt))
|
if (!as_generator(*(property_wrapper_definition)).generate(sink, cls.properties, inherit_cxt))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
for (auto&& klass : helpers::non_implemented_interfaces(cls))
|
for (auto&& klass : helpers::non_implemented_interfaces(cls, inherit_cxt))
|
||||||
{
|
{
|
||||||
attributes::klass_def c(get_klass(klass, cls.unit), cls.unit);
|
attributes::klass_def c(get_klass(klass, cls.unit), cls.unit);
|
||||||
if (!as_generator(*(property_wrapper_definition)).generate(sink, c.properties, inherit_cxt))
|
if (!as_generator(*(property_wrapper_definition)).generate(sink, c.properties, inherit_cxt))
|
||||||
|
@ -644,7 +651,7 @@ struct klass
|
||||||
if (!as_generator(*(event_registration(cls, cls))).generate(sink, cls.events, context))
|
if (!as_generator(*(event_registration(cls, cls))).generate(sink, cls.events, context))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
for (auto&& c : helpers::non_implemented_interfaces(cls))
|
for (auto&& c : helpers::non_implemented_interfaces(cls, context))
|
||||||
{
|
{
|
||||||
// Only non-regular types (which declare events through interfaces) need to register them.
|
// Only non-regular types (which declare events through interfaces) need to register them.
|
||||||
if (c.type == attributes::class_type::regular)
|
if (c.type == attributes::class_type::regular)
|
||||||
|
@ -742,7 +749,7 @@ struct klass
|
||||||
// Inherited events
|
// Inherited events
|
||||||
|
|
||||||
// For now, as mixins can inherit from regular classes, we can't filter out inherited events.
|
// For now, as mixins can inherit from regular classes, we can't filter out inherited events.
|
||||||
auto inherits = helpers::non_implemented_interfaces(cls);
|
auto inherits = helpers::non_implemented_interfaces(cls, context);
|
||||||
for (auto&& c : inherits)
|
for (auto&& c : inherits)
|
||||||
{
|
{
|
||||||
attributes::klass_def klass(get_klass(c, cls.unit), cls.unit);
|
attributes::klass_def klass(get_klass(c, cls.unit), cls.unit);
|
||||||
|
|
|
@ -18,6 +18,9 @@ struct part_definition_generator
|
||||||
template <typename OutputIterator, typename Context>
|
template <typename OutputIterator, typename Context>
|
||||||
bool generate(OutputIterator sink, attributes::part_def const& part, Context const& context) const
|
bool generate(OutputIterator sink, attributes::part_def const& part, Context const& context) const
|
||||||
{
|
{
|
||||||
|
if (blacklist::is_class_blacklisted(part.klass, context))
|
||||||
|
return true;
|
||||||
|
|
||||||
auto part_klass_name = name_helpers::klass_full_concrete_or_interface_name(part.klass);
|
auto part_klass_name = name_helpers::klass_full_concrete_or_interface_name(part.klass);
|
||||||
return as_generator(scope_tab << documentation
|
return as_generator(scope_tab << documentation
|
||||||
<< scope_tab << "public " << part_klass_name << " " << name_helpers::managed_part_name(part) << "\n"
|
<< scope_tab << "public " << part_klass_name << " " << name_helpers::managed_part_name(part) << "\n"
|
||||||
|
|
|
@ -196,6 +196,7 @@ struct to_internal_field_convert_generator
|
||||||
bool generate(OutputIterator sink, attributes::struct_field_def const& field, Context const& context) const
|
bool generate(OutputIterator sink, attributes::struct_field_def const& field, Context const& context) const
|
||||||
{
|
{
|
||||||
auto field_name = name_helpers::to_field_name(field.name);
|
auto field_name = name_helpers::to_field_name(field.name);
|
||||||
|
// FIXME Replace need_struct_conversion(regular) with need_struct_conversion(type)
|
||||||
auto regular = efl::eina::get<attributes::regular_type_def>(&field.type.original_type);
|
auto regular = efl::eina::get<attributes::regular_type_def>(&field.type.original_type);
|
||||||
auto klass = efl::eina::get<attributes::klass_name>(&field.type.original_type);
|
auto klass = efl::eina::get<attributes::klass_name>(&field.type.original_type);
|
||||||
auto complex = efl::eina::get<attributes::complex_type_def>(&field.type.original_type);
|
auto complex = efl::eina::get<attributes::complex_type_def>(&field.type.original_type);
|
||||||
|
@ -496,10 +497,9 @@ struct struct_entities_generator
|
||||||
template <typename OutputIterator, typename Context>
|
template <typename OutputIterator, typename Context>
|
||||||
bool generate(OutputIterator sink, attributes::struct_def const& struct_, Context const& context) const
|
bool generate(OutputIterator sink, attributes::struct_def const& struct_, Context const& context) const
|
||||||
{
|
{
|
||||||
if (blacklist::is_struct_blacklisted(struct_))
|
if (blacklist::is_struct_blacklisted(struct_, context))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
|
||||||
if (!name_helpers::open_namespaces(sink, struct_.namespaces, context))
|
if (!name_helpers::open_namespaces(sink, struct_.namespaces, context))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
|
@ -106,7 +106,9 @@ namespace Efl {
|
||||||
Efl.App app = Efl.App.AppMain;
|
Efl.App app = Efl.App.AppMain;
|
||||||
Eina.Array<String> command_line = new Eina.Array<String>();
|
Eina.Array<String> command_line = new Eina.Array<String>();
|
||||||
command_line.Append(Environment.GetCommandLineArgs());
|
command_line.Append(Environment.GetCommandLineArgs());
|
||||||
|
#if EFL_BETA
|
||||||
app.SetCommandArray(command_line);
|
app.SetCommandArray(command_line);
|
||||||
|
#endif
|
||||||
app.ArgumentsEvt += (object sender, LoopArgumentsEvt_Args evt) => {
|
app.ArgumentsEvt += (object sender, LoopArgumentsEvt_Args evt) => {
|
||||||
if (evt.arg.Initialization) {
|
if (evt.arg.Initialization) {
|
||||||
OnInitialize(evt.arg.Argv);
|
OnInitialize(evt.arg.Argv);
|
||||||
|
|
|
@ -85,7 +85,11 @@ blacklisted_files = [
|
||||||
'elm_view_list.eo',
|
'elm_view_list.eo',
|
||||||
'elm_genlist_item.eo',
|
'elm_genlist_item.eo',
|
||||||
'elm_gengrid.eo',
|
'elm_gengrid.eo',
|
||||||
'elm_glview_eo.cs'
|
'elm_glview_eo.cs',
|
||||||
|
'elm_code_widget.eo',
|
||||||
|
'elm_multibuttonentry_part.eo',
|
||||||
|
'elm_atspi_bridge.eo',
|
||||||
|
'elm_atspi_app_object.eo',
|
||||||
]
|
]
|
||||||
|
|
||||||
efl_mono_lib = library('eflcustomexportsmono',
|
efl_mono_lib = library('eflcustomexportsmono',
|
||||||
|
|
|
@ -4,6 +4,7 @@ using System.Runtime.CompilerServices;
|
||||||
|
|
||||||
class TestMain
|
class TestMain
|
||||||
{
|
{
|
||||||
|
#if EFL_BETA
|
||||||
private Efl.Loop loop;
|
private Efl.Loop loop;
|
||||||
private int count;
|
private int count;
|
||||||
|
|
||||||
|
@ -48,6 +49,11 @@ class TestMain
|
||||||
{
|
{
|
||||||
Console.WriteLine("Ooops. Should not have been called...");
|
Console.WriteLine("Ooops. Should not have been called...");
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
public static void Main()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,7 @@ using System;
|
||||||
|
|
||||||
public class Example
|
public class Example
|
||||||
{
|
{
|
||||||
|
#if EFL_BETA
|
||||||
public static Efl.Ui.Button CreateButton(Efl.Object parent,
|
public static Efl.Ui.Button CreateButton(Efl.Object parent,
|
||||||
string text,
|
string text,
|
||||||
int w, int h,
|
int w, int h,
|
||||||
|
@ -73,5 +74,10 @@ public class Example
|
||||||
|
|
||||||
Efl.All.Shutdown();
|
Efl.All.Shutdown();
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
public static void Main()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@ using System;
|
||||||
|
|
||||||
public class Example
|
public class Example
|
||||||
{
|
{
|
||||||
|
#if EFL_BETA
|
||||||
private static double KMS_PER_MILE = 1.609344;
|
private static double KMS_PER_MILE = 1.609344;
|
||||||
|
|
||||||
private static double KmsToMiles(double kms)
|
private static double KmsToMiles(double kms)
|
||||||
|
@ -146,5 +146,10 @@ public class Example
|
||||||
|
|
||||||
Efl.All.Shutdown();
|
Efl.All.Shutdown();
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
public static void Main()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -95,16 +95,16 @@ class TestEo
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class MyLoop : Efl.Loop
|
class MyObject : Efl.Object
|
||||||
{
|
{
|
||||||
public MyLoop() : base(null) { }
|
public MyObject() : base(null) { }
|
||||||
}
|
}
|
||||||
|
|
||||||
class TestEoInherit
|
class TestEoInherit
|
||||||
{
|
{
|
||||||
public static void instantiate_inherited()
|
public static void instantiate_inherited()
|
||||||
{
|
{
|
||||||
Efl.Loop loop = new MyLoop();
|
Efl.Object loop = new MyObject();
|
||||||
Test.Assert(loop.NativeHandle != System.IntPtr.Zero);
|
Test.Assert(loop.NativeHandle != System.IntPtr.Zero);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,17 +7,18 @@ using System.Diagnostics.CodeAnalysis;
|
||||||
|
|
||||||
namespace TestSuite {
|
namespace TestSuite {
|
||||||
|
|
||||||
|
#if EFL_BETA
|
||||||
|
|
||||||
[SuppressMessage("Gendarme.Rules.Portability", "DoNotHardcodePathsRule")]
|
[SuppressMessage("Gendarme.Rules.Portability", "DoNotHardcodePathsRule")]
|
||||||
public static class TestParts
|
public static class TestParts
|
||||||
{
|
{
|
||||||
public static void basic_part_test()
|
public static void basic_part_test()
|
||||||
{
|
{
|
||||||
var t = new Dummy.TestObject();
|
var t = new Dummy.PartHolder();
|
||||||
do_part_test(t);
|
do_part_test(t);
|
||||||
}
|
}
|
||||||
|
|
||||||
private class Child : Dummy.TestObject
|
private class Child : Dummy.PartHolder
|
||||||
{
|
{
|
||||||
public Child() : base(null) {}
|
public Child() : base(null) {}
|
||||||
}
|
}
|
||||||
|
@ -27,7 +28,7 @@ public static class TestParts
|
||||||
do_part_test(t);
|
do_part_test(t);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void do_part_test(Dummy.TestObject t)
|
private static void do_part_test(Dummy.PartHolder t)
|
||||||
{
|
{
|
||||||
var p1 = t.PartOne;
|
var p1 = t.PartOne;
|
||||||
var p2 = t.PartTwo;
|
var p2 = t.PartTwo;
|
||||||
|
@ -38,4 +39,6 @@ public static class TestParts
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
import eina_types;
|
||||||
|
|
||||||
|
class @beta Dummy.Part_Holder extends Dummy.Test_Object implements Efl.Part {
|
||||||
|
|
||||||
|
parts {
|
||||||
|
part_one: Dummy.Test_Object; [[ Part number one. ]]
|
||||||
|
part_two: Dummy.Test_Object; [[ Part number two. ]]
|
||||||
|
}
|
||||||
|
implements {
|
||||||
|
Efl.Part.part_get;
|
||||||
|
Efl.Object.constructor;
|
||||||
|
}
|
||||||
|
}
|
|
@ -101,12 +101,7 @@ function Dummy.FormatCb {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class Dummy.Test_Object extends Efl.Object implements Efl.Part, Dummy.Test_Iface, Dummy.Another_Iface {
|
class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface, Dummy.Another_Iface {
|
||||||
|
|
||||||
parts {
|
|
||||||
part_one: Dummy.Test_Object; [[ Part number one. ]]
|
|
||||||
part_two: Dummy.Test_Object; [[ Part number two. ]]
|
|
||||||
}
|
|
||||||
methods {
|
methods {
|
||||||
return_object {
|
return_object {
|
||||||
return: Dummy.Test_Object;
|
return: Dummy.Test_Object;
|
||||||
|
@ -1395,7 +1390,6 @@ class Dummy.Test_Object extends Efl.Object implements Efl.Part, Dummy.Test_Iface
|
||||||
class.constructor;
|
class.constructor;
|
||||||
class.destructor;
|
class.destructor;
|
||||||
Efl.Object.constructor;
|
Efl.Object.constructor;
|
||||||
Efl.Part.part_get;
|
|
||||||
Efl.Object.provider_find;
|
Efl.Object.provider_find;
|
||||||
Dummy.Test_Iface.emit_test_conflicted;
|
Dummy.Test_Iface.emit_test_conflicted;
|
||||||
Dummy.Test_Iface.emit_nonconflicted;
|
Dummy.Test_Iface.emit_nonconflicted;
|
||||||
|
|
|
@ -52,6 +52,7 @@
|
||||||
#include "dummy_another_iface.eo.h"
|
#include "dummy_another_iface.eo.h"
|
||||||
#include "dummy_inherit_iface.eo.h"
|
#include "dummy_inherit_iface.eo.h"
|
||||||
#include "dummy_inherit_helper.eo.h"
|
#include "dummy_inherit_helper.eo.h"
|
||||||
|
#include "dummy_part_holder.eo.h"
|
||||||
|
|
||||||
#include <interfaces/efl_part.eo.h>
|
#include <interfaces/efl_part.eo.h>
|
||||||
|
|
||||||
|
@ -67,8 +68,6 @@ typedef struct Dummy_Test_Object_Data
|
||||||
Eina_Value *stored_value;
|
Eina_Value *stored_value;
|
||||||
Dummy_StructSimple stored_struct;
|
Dummy_StructSimple stored_struct;
|
||||||
int stored_int;
|
int stored_int;
|
||||||
Eo *part_one;
|
|
||||||
Eo *part_two;
|
|
||||||
Eina_Promise *promise;
|
Eina_Promise *promise;
|
||||||
Eina_List *list_for_accessor;
|
Eina_List *list_for_accessor;
|
||||||
int setter_only;
|
int setter_only;
|
||||||
|
@ -91,6 +90,12 @@ typedef struct Dummy_Child_Data
|
||||||
Eina_Bool optional_beta_ctor_was_called;
|
Eina_Bool optional_beta_ctor_was_called;
|
||||||
} Dummy_Child_Data;
|
} Dummy_Child_Data;
|
||||||
|
|
||||||
|
typedef struct Dummy_Part_Holder_Data
|
||||||
|
{
|
||||||
|
Eo *part_one;
|
||||||
|
Eo *part_two;
|
||||||
|
} Dummy_Part_Holder_Data;
|
||||||
|
|
||||||
typedef struct Dummy_Inherit_Helper_Data
|
typedef struct Dummy_Inherit_Helper_Data
|
||||||
{
|
{
|
||||||
} Dummy_Inherit_Helper_Data;
|
} Dummy_Inherit_Helper_Data;
|
||||||
|
@ -145,14 +150,6 @@ static Efl_Object*
|
||||||
_dummy_test_object_efl_object_constructor(Eo *obj, Dummy_Test_Object_Data *pd)
|
_dummy_test_object_efl_object_constructor(Eo *obj, Dummy_Test_Object_Data *pd)
|
||||||
{
|
{
|
||||||
efl_constructor(efl_super(obj, DUMMY_TEST_OBJECT_CLASS));
|
efl_constructor(efl_super(obj, DUMMY_TEST_OBJECT_CLASS));
|
||||||
|
|
||||||
// To avoid an infinite loop calling the same constructor
|
|
||||||
if (!efl_parent_get(obj))
|
|
||||||
{
|
|
||||||
pd->part_one = efl_add(DUMMY_TEST_OBJECT_CLASS, obj, efl_name_set(efl_added, "part_one"));
|
|
||||||
pd->part_two = efl_add(DUMMY_TEST_OBJECT_CLASS, obj, efl_name_set(efl_added, "part_two"));
|
|
||||||
}
|
|
||||||
|
|
||||||
pd->provider = efl_add(DUMMY_NUMBERWRAPPER_CLASS, obj);
|
pd->provider = efl_add(DUMMY_NUMBERWRAPPER_CLASS, obj);
|
||||||
dummy_numberwrapper_number_set(pd->provider, 1999);
|
dummy_numberwrapper_number_set(pd->provider, 1999);
|
||||||
|
|
||||||
|
@ -3792,16 +3789,6 @@ void _dummy_test_object_emit_event_with_list(Eo *obj, EINA_UNUSED Dummy_Test_Obj
|
||||||
efl_event_callback_legacy_call(obj, DUMMY_TEST_OBJECT_EVENT_EVT_WITH_LIST, data);
|
efl_event_callback_legacy_call(obj, DUMMY_TEST_OBJECT_EVENT_EVT_WITH_LIST, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
Efl_Object *_dummy_test_object_efl_part_part_get(EINA_UNUSED const Eo *obj, Dummy_Test_Object_Data *pd, const char *name)
|
|
||||||
{
|
|
||||||
if (!strcmp(name, "part_one"))
|
|
||||||
return pd->part_one;
|
|
||||||
else if (!strcmp(name, "part_two"))
|
|
||||||
return pd->part_two;
|
|
||||||
else
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
void _dummy_test_object_append_to_strbuf(EINA_UNUSED Eo *obj, EINA_UNUSED Dummy_Test_Object_Data *pd, Eina_Strbuf *buf, const char *str)
|
void _dummy_test_object_append_to_strbuf(EINA_UNUSED Eo *obj, EINA_UNUSED Dummy_Test_Object_Data *pd, Eina_Strbuf *buf, const char *str)
|
||||||
{
|
{
|
||||||
eina_strbuf_append(buf, str);
|
eina_strbuf_append(buf, str);
|
||||||
|
@ -4024,6 +4011,34 @@ const char* _dummy_inherit_helper_receive_dummy_and_call_in_stringshare(Dummy_Te
|
||||||
return dummy_inherit_iface_stringshare_test (x, eina_stringshare_add("hello world"));
|
return dummy_inherit_iface_stringshare_test (x, eina_stringshare_add("hello world"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Part holder
|
||||||
|
static Efl_Object*
|
||||||
|
_dummy_part_holder_efl_object_constructor(Eo *obj, Dummy_Part_Holder_Data *pd)
|
||||||
|
{
|
||||||
|
efl_constructor(efl_super(obj, DUMMY_PART_HOLDER_CLASS));
|
||||||
|
|
||||||
|
// To avoid an infinite loop calling the same constructor
|
||||||
|
if (!efl_parent_get(obj))
|
||||||
|
{
|
||||||
|
pd->part_one = efl_add(DUMMY_TEST_OBJECT_CLASS, obj, efl_name_set(efl_added, "part_one"));
|
||||||
|
pd->part_two = efl_add(DUMMY_TEST_OBJECT_CLASS, obj, efl_name_set(efl_added, "part_two"));
|
||||||
|
}
|
||||||
|
|
||||||
|
return obj;
|
||||||
|
}
|
||||||
|
|
||||||
|
Efl_Object *_dummy_part_holder_efl_part_part_get(EINA_UNUSED const Eo *obj, Dummy_Part_Holder_Data *pd, const char *name)
|
||||||
|
{
|
||||||
|
if (!strcmp(name, "part_one"))
|
||||||
|
return pd->part_one;
|
||||||
|
else if (!strcmp(name, "part_two"))
|
||||||
|
return pd->part_two;
|
||||||
|
else
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include "dummy_test_object.eo.c"
|
#include "dummy_test_object.eo.c"
|
||||||
#include "dummy_numberwrapper.eo.c"
|
#include "dummy_numberwrapper.eo.c"
|
||||||
#include "dummy_child.eo.c"
|
#include "dummy_child.eo.c"
|
||||||
|
@ -4031,4 +4046,5 @@ const char* _dummy_inherit_helper_receive_dummy_and_call_in_stringshare(Dummy_Te
|
||||||
#include "dummy_another_iface.eo.c"
|
#include "dummy_another_iface.eo.c"
|
||||||
#include "dummy_inherit_helper.eo.c"
|
#include "dummy_inherit_helper.eo.c"
|
||||||
#include "dummy_inherit_iface.eo.c"
|
#include "dummy_inherit_iface.eo.c"
|
||||||
|
#include "dummy_part_holder.eo.c"
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
eo_files = ['dummy_child.eo', 'dummy_numberwrapper.eo', 'dummy_test_object.eo', 'dummy_test_iface.eo', 'dummy_another_iface.eo', 'dummy_inherit_helper.eo', 'dummy_inherit_iface.eo']
|
eo_files = ['dummy_child.eo', 'dummy_numberwrapper.eo', 'dummy_test_object.eo', 'dummy_test_iface.eo', 'dummy_another_iface.eo', 'dummy_inherit_helper.eo', 'dummy_inherit_iface.eo', 'dummy_part_holder.eo']
|
||||||
|
|
||||||
eo_file_targets = []
|
eo_file_targets = []
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue