]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
gidlparser: Guess NoAccessorMethod for interface properties
authorLuca Bruno <lucabru@src.gnome.org>
Sat, 6 Aug 2011 12:20:48 +0000 (14:20 +0200)
committerLuca Bruno <lucabru@src.gnome.org>
Sat, 6 Aug 2011 12:45:24 +0000 (14:45 +0200)
Fixes bug 656072.

vapi/gio-2.0.vapi
vapi/goocanvas.vapi
vapi/gtk+-2.0.vapi
vapi/gtk+-3.0.vapi
vapi/mx-1.0.vapi
vapigen/valagidlparser.vala

index 558e834baf2a99dfeddc3666a50d182ac9dc2eca..543ea62b5ad38b6d1a3d145485ed5d6bb399b4ce 100644 (file)
@@ -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")]
index 999a81a641bfe6e4f99c8e7459efc5135cef9328..c7cf06d797099cfa2ca2bcd47f06299ad3565a3c 100644 (file)
@@ -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);
index 225dadef174ef7c9abfdf542b9f8f824c495c2fa..75d6c8d98d627e396ff3d15769f4c44c7067776e 100644 (file)
@@ -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 ();
index 7b14177935a9ef0cd1b1d7207b879d2503bb4c18..937ed40cb268c1c952871e81db91d67814cb4f46 100644 (file)
@@ -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 ();
index 151f15b60c14859ca377c2db728cce9382b9853f..7ecb93404a982a64cdb54594dd2e18b4184db6a2 100644 (file)
@@ -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);
index e3d072855b03916203c5d84116574207ef19b448..d3525b1527563025d130e6e275ebb9b97db96a5c 100644 (file)
@@ -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;