tests/efl_mono/dummy_test_iface.eo \
tests/efl_mono/dummy_another_iface.eo \
tests/efl_mono/dummy_child.eo \
+ tests/efl_mono/dummy_part_holder.eo \
tests/efl_mono/dummy_numberwrapper.eo \
tests/efl_mono/mono_test_driver.sh
lib/elementary/elm_view_list_eo.cs \
lib/elementary/elm_genlist_item_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
efl_mono_blacklisted_files = \
tests/efl_mono/dummy_another_iface.eo.c \
tests/efl_mono/dummy_child.eo.h \
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.c \
tests/efl_mono/dummy_inherit_iface.eo.h \
tests/efl_mono/dummy_test_iface.eo.cs \
tests/efl_mono/dummy_another_iface.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_inherit_iface.eo.cs \
tests/efl_mono/dummy_inherit_helper.eo.cs
$(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) $<
-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
// Blacklist structs that require some kind of manual binding.
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"
|| full_name == "Eina.Binbuf"
|| full_name == "Eina.Strbuf"
|| 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_));
}
+// 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_)
{
return is_struct_blacklisted(name_helpers::type_full_eolian_name(struct_));
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;
+}
+
}
}
if (!etype.is_engaged())
return true;
+ if (blacklist::is_event_blacklisted(evt, context))
+ return true;
+
std::string evt_name = name_helpers::managed_event_name(evt.name);
return as_generator("///<summary>Event argument wrapper for event <see cref=\""
std::string wrapper_args_type;
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())
wrapper_args_type = "<" + name_helpers::managed_event_args_name(evt) + ">";
{
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))
wrapper_event_name = name_helpers::translate_inherited_event_name(evt, klass);
else
template<typename OutputIterator, typename Context>
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);
bool is_unique = helpers::is_unique_event(evt, leaf_klass);
#include "function_helpers.hh"
#include "documentation.hh"
#include "generation_contexts.hh"
+#include "blacklist.hh"
namespace eolian_mono {
// 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);
- return false;
+ return blacklist::is_function_blacklisted(func, context);
}
struct function_pointer {
// FIXME export Typedecl in eolian_cxx API
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;
if(!as_generator(eolian_mono::type(true)).generate(std::back_inserter(return_type), f.return_type, context))
return false;
- if (is_function_ptr_blacklisted(f))
- return true;
-
if (!name_helpers::open_namespaces(sink, f.namespaces, funcptr_ctx))
return false;
// Returns the set of interfaces implemented by this type that haven't been implemented
// 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> interfaces;
attributes::klass_def c(get_klass(klass, cls.unit), cls.unit);
for(auto&& inherit : c.immediate_inherits)
{
+ if (inherit.is_beta && !options.want_beta)
+ continue;
+
switch(inherit.type)
{
case attributes::class_type::mixin:
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;
+
+ 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;
switch(cls.type)
{
return false;
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::copy_if(cls.immediate_inherits.begin(), cls.immediate_inherits.end()
, std::back_inserter(inherit_classes)
if (!as_generator(*(property_wrapper_definition)).generate(sink, cls.properties, concrete_cxt))
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);
if (!as_generator(*(property_wrapper_definition)).generate(sink, c.properties, concrete_cxt))
if (!as_generator(*(property_wrapper_definition)).generate(sink, cls.properties, inherit_cxt))
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);
if (!as_generator(*(property_wrapper_definition)).generate(sink, c.properties, inherit_cxt))
if (!as_generator(*(event_registration(cls, cls))).generate(sink, cls.events, context))
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.
if (c.type == attributes::class_type::regular)
// 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)
{
attributes::klass_def klass(get_klass(c, cls.unit), cls.unit);
template <typename OutputIterator, typename Context>
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);
return as_generator(scope_tab << documentation
<< scope_tab << "public " << part_klass_name << " " << name_helpers::managed_part_name(part) << "\n"
bool generate(OutputIterator sink, attributes::struct_field_def const& field, Context const& context) const
{
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 klass = efl::eina::get<attributes::klass_name>(&field.type.original_type);
auto complex = efl::eina::get<attributes::complex_type_def>(&field.type.original_type);
template <typename OutputIterator, typename Context>
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;
-
if (!name_helpers::open_namespaces(sink, struct_.namespaces, context))
return false;
Efl.App app = Efl.App.AppMain;
Eina.Array<String> command_line = new Eina.Array<String>();
command_line.Append(Environment.GetCommandLineArgs());
+#if EFL_BETA
app.SetCommandArray(command_line);
+#endif
app.ArgumentsEvt += (object sender, LoopArgumentsEvt_Args evt) => {
if (evt.arg.Initialization) {
OnInitialize(evt.arg.Argv);
'elm_view_list.eo',
'elm_genlist_item.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',
class TestMain
{
+#if EFL_BETA
private Efl.Loop loop;
private int count;
{
Console.WriteLine("Ooops. Should not have been called...");
}
+#else
+ public static void Main()
+ {
+ }
+#endif
}
public class Example
{
+#if EFL_BETA
public static Efl.Ui.Button CreateButton(Efl.Object parent,
string text,
int w, int h,
Efl.All.Shutdown();
}
+#else
+ public static void Main()
+ {
+ }
+#endif
}
public class Example
{
-
+#if EFL_BETA
private static double KMS_PER_MILE = 1.609344;
private static double KmsToMiles(double kms)
Efl.All.Shutdown();
}
+#else
+ public static void Main()
+ {
+ }
+#endif
}
}
-class MyLoop : Efl.Loop
+class MyObject : Efl.Object
{
- public MyLoop() : base(null) { }
+ public MyObject() : base(null) { }
}
class TestEoInherit
{
public static void instantiate_inherited()
{
- Efl.Loop loop = new MyLoop();
+ Efl.Object loop = new MyObject();
Test.Assert(loop.NativeHandle != System.IntPtr.Zero);
}
}
namespace TestSuite {
+#if EFL_BETA
[SuppressMessage("Gendarme.Rules.Portability", "DoNotHardcodePathsRule")]
public static class TestParts
{
public static void basic_part_test()
{
- var t = new Dummy.TestObject();
+ var t = new Dummy.PartHolder();
do_part_test(t);
}
- private class Child : Dummy.TestObject
+ private class Child : Dummy.PartHolder
{
public Child() : base(null) {}
}
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 p2 = t.PartTwo;
}
}
+#endif
+
}
--- /dev/null
+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;
+ }
+}
}
};
-class Dummy.Test_Object extends Efl.Object implements Efl.Part, Dummy.Test_Iface, Dummy.Another_Iface {
-
- parts {
- part_one: Dummy.Test_Object; [[ Part number one. ]]
- part_two: Dummy.Test_Object; [[ Part number two. ]]
- }
+class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface, Dummy.Another_Iface {
methods {
return_object {
return: Dummy.Test_Object;
class.constructor;
class.destructor;
Efl.Object.constructor;
- Efl.Part.part_get;
Efl.Object.provider_find;
Dummy.Test_Iface.emit_test_conflicted;
Dummy.Test_Iface.emit_nonconflicted;
#include "dummy_another_iface.eo.h"
#include "dummy_inherit_iface.eo.h"
#include "dummy_inherit_helper.eo.h"
+#include "dummy_part_holder.eo.h"
#include <interfaces/efl_part.eo.h>
Eina_Value *stored_value;
Dummy_StructSimple stored_struct;
int stored_int;
- Eo *part_one;
- Eo *part_two;
Eina_Promise *promise;
Eina_List *list_for_accessor;
int setter_only;
Eina_Bool optional_beta_ctor_was_called;
} 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
{
} Dummy_Inherit_Helper_Data;
_dummy_test_object_efl_object_constructor(Eo *obj, Dummy_Test_Object_Data *pd)
{
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);
dummy_numberwrapper_number_set(pd->provider, 1999);
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)
{
eina_strbuf_append(buf, str);
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_numberwrapper.eo.c"
#include "dummy_child.eo.c"
#include "dummy_another_iface.eo.c"
#include "dummy_inherit_helper.eo.c"
#include "dummy_inherit_iface.eo.c"
+#include "dummy_part_holder.eo.c"
-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 = []