[gobject-introspection] How should name collisions be resolved
- From: Alan <alan mcgovern gmail com>
- To: gtk-devel-list gnome org
- Subject: [gobject-introspection] How should name collisions be resolved
- Date: Thu, 10 Feb 2011 17:14:39 +0000
In .NET it is invalid to generate a property or a method which is the
same name as an event as it is ambiguous as to whether you're invoking
the event or calling the method. The issue I have in particular is
GtkButton. It has the following (reduced) gir:
<glib:signal name="clicked">
<method name="clicked" c:identifier="gtk_button_clicked">
<virtual-method name="clicked" invoker="clicked">
Using our current generation techniques, this would result in the
following code:
public event Clicked;
protected virtual void OnClicked () { }
public Clicked () { }
Virtual methods are renamed to have "On" to comply with the standard
.NET pattern. However the non-virtual method now clashes. We currently
work around this by handwriting a big xml file of manual overrides and
in this case we override the non-virtual "Clicked" method to be called
"Click". The python generator does a similar thing, but renames it to
"do_clicked".
What are peoples opinions on taking care of this in the gir format and
using the "renameto" feature to avoid the collision in all languages?
Is this feasible? Are there any better ways of handling this kind of
case?
Thanks,
Alan.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]