[Kde-bindings] Adding an mf_attribute flag to MethodFlags in smoke.h
Arno Rehn
arno at arnorehn.de
Mon Oct 12 20:37:58 UTC 2009
On Wednesday 09 September 2009 18:39:28 Richard Dale wrote:
> I think it would be useful if we could add a 'mf_attribute' flag to
> MethodFlags to denote a setter or getter method that was generated to
> access C++ static/member variables:
>
> enum MethodFlags {
> mf_static = 0x01,
> mf_const = 0x02,
> mf_copyctor = 0x04, // Copy constructor
> mf_internal = 0x08, // For internal use only
> mf_enum = 0x10, // An enum value
> mf_ctor = 0x20,
> mf_dtor = 0x40,
> mf_protected = 0x80,
> mf_attribute = 0x100 // Variable getter/setter method
> };
>
> I think calling it an 'mf_attribute' instead of 'mf_property' will make it
> less likely to get it confusesd with a Q_PROPERTY. This would be useful for
> languages like python where we want them to be able to make these methods
> map onto attribute accessors instead of ordinary method calls.
I thought about creating a new C# sources generator that is directly based on
existing smoke libs. Your proposal would be needed for such a thing anyway, so
I don't have any objections :). I'd then also flag methods that are accessors
for Q_PROPERTYs, so we don't have to duplicate them in the C# sources.
A generator based on smoke would simplify things by some extent. We wouldn't
have to duplicate the configuration files and would make the bindings a bit
more dynamic (we could load and even create new bindings on demand, without
prior knowledge of the library to bind (using the System.Emit namespace)).
Anyway, I think it's a good idea to add mf_attribute.
--
Arno Rehn
arno at arnorehn.de
More information about the Kde-bindings
mailing list