aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin/eolian_mono/eolian/mono/blacklist.hh
diff options
context:
space:
mode:
authorLauro Moura <lauromoura@expertisesolutions.com.br>2019-01-17 21:43:57 +0900
committerFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2019-01-17 21:45:49 +0900
commit586bc5207e63bd8f622f466749781e397fc5e921 (patch)
tree41cea82422433821ecd6a2ab55f15fbf20c7aec8 /src/bin/eolian_mono/eolian/mono/blacklist.hh
parenteolian-mono: Add interface registration to inherited classes (diff)
downloadefl-586bc5207e63bd8f622f466749781e397fc5e921.tar.gz
efl-mono: Enable selecting to build @beta items
Summary: For autotools, use --enable-csharp-beta to enable the generation of beta methods and properties, for meson use -Dmono-beta=true. By default, no beta method or property is generated. Reviewers: woohyun, segfaultxavi, bu5hm4n, lauromoura Reviewed By: woohyun Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D7637
Diffstat (limited to 'src/bin/eolian_mono/eolian/mono/blacklist.hh')
-rw-r--r--src/bin/eolian_mono/eolian/mono/blacklist.hh25
1 files changed, 24 insertions, 1 deletions
diff --git a/src/bin/eolian_mono/eolian/mono/blacklist.hh b/src/bin/eolian_mono/eolian/mono/blacklist.hh
index fff61c7231..c11437b2df 100644
--- a/src/bin/eolian_mono/eolian/mono/blacklist.hh
+++ b/src/bin/eolian_mono/eolian/mono/blacklist.hh
@@ -2,7 +2,9 @@
#define EOLIAN_MONO_BLACKLIST_HH
#include "grammar/klass_def.hpp"
+#include "grammar/context.hpp"
#include "name_helpers.hh"
+#include "generation_contexts.hh"
namespace eolian_mono {
@@ -49,6 +51,19 @@ inline bool is_function_blacklisted(std::string const& c_name)
;
}
+template<typename Context>
+inline bool is_function_blacklisted(attributes::function_def const& func, Context context)
+{
+ auto options = efl::eolian::grammar::context_find_tag<options_context>(context);
+ auto c_name = func.c_name;
+
+ if (func.is_beta && !options.want_beta)
+ return true;
+
+ return is_function_blacklisted(c_name);
+}
+
+
// Blacklist structs that require some kind of manual binding.
inline bool is_struct_blacklisted(std::string const& full_name)
{
@@ -85,9 +100,17 @@ inline bool is_property_blacklisted(std::string const& name)
|| name == "Efl.Text.Text";
}
-inline bool is_property_blacklisted(attributes::property_def const& property)
+template<typename Context>
+inline bool is_property_blacklisted(attributes::property_def const& property, Context context)
{
auto name = name_helpers::klass_full_concrete_or_interface_name(property.klass) + "." + name_helpers::property_managed_name(property);
+
+ if (property.getter.is_engaged())
+ if (is_function_blacklisted(*property.getter, context))
+ return true;
+ if (property.setter.is_engaged())
+ if (is_function_blacklisted(*property.setter, context))
+ return true;
return is_property_blacklisted(name);
}