[vala] gidlparser: Guess NoAccessorMethod for interface properties
- From: Luca Bruno <lucabru src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala] gidlparser: Guess NoAccessorMethod for interface properties
- Date: Sat, 6 Aug 2011 12:45:56 +0000 (UTC)
commit bb445ce10b07f0c1f5b3debdf4463500ab32ba3d
Author: Luca Bruno <lucabru src gnome org>
Date: Sat Aug 6 14:20:48 2011 +0200
gidlparser: Guess NoAccessorMethod for interface properties
Fixes bug 656072.
vapi/gio-2.0.vapi | 1 +
vapi/goocanvas.vapi | 26 ++++++++++++++++++++------
vapi/gtk+-2.0.vapi | 1 +
vapi/gtk+-3.0.vapi | 1 +
vapi/mx-1.0.vapi | 2 ++
vapigen/valagidlparser.vala | 20 ++++++++++++++++++++
6 files changed, 45 insertions(+), 6 deletions(-)
---
diff --git a/vapi/gio-2.0.vapi b/vapi/gio-2.0.vapi
index 558e834..543ea62 100644
--- a/vapi/gio-2.0.vapi
+++ b/vapi/gio-2.0.vapi
@@ -2066,6 +2066,7 @@ namespace GLib {
[CCode (cheader_filename = "gio/gio.h")]
public interface TlsServerConnection : GLib.TlsConnection {
public static unowned GLib.IOStream @new (GLib.IOStream base_io_stream, GLib.TlsCertificate certificate) throws GLib.Error;
+ [NoAccessorMethod]
public GLib.TlsAuthenticationMode authentication_mode { get; set; }
}
[CCode (cheader_filename = "gio/gio.h")]
diff --git a/vapi/goocanvas.vapi b/vapi/goocanvas.vapi
index 999a81a..c7cf06d 100644
--- a/vapi/goocanvas.vapi
+++ b/vapi/goocanvas.vapi
@@ -811,14 +811,21 @@ namespace Goo {
public void stop_animation ();
public void translate (double tx, double ty);
public abstract void update (bool entire_tree, Cairo.Context cr, Goo.CanvasBounds bounds);
+ [NoAccessorMethod]
public bool can_focus { get; set; }
- public string description { get; set; }
+ [NoAccessorMethod]
+ public string description { owned get; set; }
public Goo.CanvasItem parent { get; set; }
+ [NoAccessorMethod]
public Goo.CanvasPointerEvents pointer_events { get; set; }
- public string title { get; set; }
- public string tooltip { get; set; }
+ [NoAccessorMethod]
+ public string title { owned get; set; }
+ [NoAccessorMethod]
+ public string tooltip { owned get; set; }
public Goo.CairoMatrix transform { get; set; }
+ [NoAccessorMethod]
public Goo.CanvasItemVisibility visibility { get; set; }
+ [NoAccessorMethod]
public double visibility_threshold { get; set; }
public signal void animation_finished (bool stopped);
public signal bool button_press_event (Goo.CanvasItem target, Gdk.EventButton event);
@@ -871,14 +878,21 @@ namespace Goo {
public void skew_y (double degrees, double cx, double cy);
public void stop_animation ();
public void translate (double tx, double ty);
+ [NoAccessorMethod]
public bool can_focus { get; set; }
- public string description { get; set; }
+ [NoAccessorMethod]
+ public string description { owned get; set; }
public Goo.CanvasItemModel parent { get; set; }
+ [NoAccessorMethod]
public Goo.CanvasPointerEvents pointer_events { get; set; }
- public string title { get; set; }
- public string tooltip { get; set; }
+ [NoAccessorMethod]
+ public string title { owned get; set; }
+ [NoAccessorMethod]
+ public string tooltip { owned get; set; }
public Goo.CairoMatrix transform { get; set; }
+ [NoAccessorMethod]
public Goo.CanvasItemVisibility visibility { get; set; }
+ [NoAccessorMethod]
public double visibility_threshold { get; set; }
public signal void animation_finished (bool stopped);
public signal void changed (bool recompute_bounds);
diff --git a/vapi/gtk+-2.0.vapi b/vapi/gtk+-2.0.vapi
index 225dade..75d6c8d 100644
--- a/vapi/gtk+-2.0.vapi
+++ b/vapi/gtk+-2.0.vapi
@@ -5987,6 +5987,7 @@ namespace Gtk {
[CCode (cheader_filename = "gtk/gtk.h")]
public interface CellEditable : Gtk.Widget {
public abstract void start_editing (Gdk.Event event);
+ [NoAccessorMethod]
public bool editing_canceled { get; set; }
[HasEmitter]
public signal void editing_done ();
diff --git a/vapi/gtk+-3.0.vapi b/vapi/gtk+-3.0.vapi
index 7b14177..937ed40 100644
--- a/vapi/gtk+-3.0.vapi
+++ b/vapi/gtk+-3.0.vapi
@@ -5857,6 +5857,7 @@ namespace Gtk {
[CCode (cheader_filename = "gtk/gtk.h")]
public interface CellEditable : Gtk.Widget {
public abstract void start_editing (Gdk.Event event);
+ [NoAccessorMethod]
public bool editing_canceled { get; set; }
[HasEmitter]
public signal void editing_done ();
diff --git a/vapi/mx-1.0.vapi b/vapi/mx-1.0.vapi
index 151f15b..7ecb934 100644
--- a/vapi/mx-1.0.vapi
+++ b/vapi/mx-1.0.vapi
@@ -747,6 +747,7 @@ namespace Mx {
public void set_drag_threshold (uint threshold);
public Mx.DragAxis axis { get; set; }
public Clutter.Actor drag_actor { get; set; }
+ [NoAccessorMethod]
public bool drag_enabled { get; set; }
public uint drag_threshold { get; set; }
public signal void drag_begin (float event_x, float event_y, int event_button, Clutter.ModifierType modifiers);
@@ -759,6 +760,7 @@ namespace Mx {
public void disable ();
public void enable ();
public bool is_enabled ();
+ [NoAccessorMethod]
public bool drop_enabled { get; set; }
public signal void drop (Clutter.Actor draggable, float event_x, float event_y, int button, Clutter.ModifierType modifiers);
public signal void over_in (Clutter.Actor draggable);
diff --git a/vapigen/valagidlparser.vala b/vapigen/valagidlparser.vala
index e3d0728..d3525b1 100644
--- a/vapigen/valagidlparser.vala
+++ b/vapigen/valagidlparser.vala
@@ -1668,6 +1668,7 @@ public class Vala.GIdlParser : CodeVisitor {
current_data_type = iface;
+ current_type_symbol_set = new HashSet<string> (str_hash, str_equal);
var current_type_func_map = new HashMap<string,weak IdlNodeFunction> (str_hash, str_equal);
var current_type_vfunc_map = new HashMap<string,string> (str_hash, str_equal);
@@ -1708,6 +1709,25 @@ public class Vala.GIdlParser : CodeVisitor {
}
}
+ foreach (Property prop in iface.get_properties ()) {
+ var getter = "get_%s".printf (prop.name);
+
+ if (prop.get_accessor != null && !current_type_symbol_set.contains (getter)) {
+ prop.set_attribute ("NoAccessorMethod", true);
+ }
+
+ var setter = "set_%s".printf (prop.name);
+
+ if (prop.set_accessor != null && prop.set_accessor.writable
+ && !current_type_symbol_set.contains (setter)) {
+ prop.set_attribute ("NoAccessorMethod", true);
+ }
+
+ if (prop.get_attribute ("NoAccessorMethod") != null && prop.get_accessor != null) {
+ prop.get_accessor.value_type.value_owned = true;
+ }
+ }
+
handle_async_methods (iface);
current_data_type = null;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]