From: Jürg Billeter Date: Thu, 15 Jan 2009 15:58:56 +0000 (+0000) Subject: Fix accessor detection for properties X-Git-Tag: VALA_0_5_6~42 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=11a0b4638e7f06ab185ea18abae3ce1d12860dad;p=thirdparty%2Fvala.git Fix accessor detection for properties 2009-01-15 Jürg Billeter * vapigen/valagidlparser.vala: Fix accessor detection for properties * vapi/: regenerated svn path=/trunk/; revision=2345 --- diff --git a/ChangeLog b/ChangeLog index 164fe5070..62f89508c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2009-01-15 Jürg Billeter + + * vapigen/valagidlparser.vala: + + Fix accessor detection for properties + + * vapi/: regenerated + 2009-01-15 Jürg Billeter * vapi/sdl-mixer.vapi: diff --git a/vapi/atk.vapi b/vapi/atk.vapi index 222d958be..79ca15f9e 100644 --- a/vapi/atk.vapi +++ b/vapi/atk.vapi @@ -170,7 +170,7 @@ namespace Atk { [NoAccessorMethod] public Atk.RelationType relation_type { get; set; } [NoAccessorMethod] - public GLib.ValueArray target { get; set; } + public GLib.ValueArray target { owned get; set; } } [CCode (cheader_filename = "atk/atk.h")] public class RelationSet : GLib.Object { diff --git a/vapi/gdk-pixbuf-2.0.vapi b/vapi/gdk-pixbuf-2.0.vapi index ca40e871e..37232519e 100644 --- a/vapi/gdk-pixbuf-2.0.vapi +++ b/vapi/gdk-pixbuf-2.0.vapi @@ -58,21 +58,13 @@ namespace Gdk { public unowned Gdk.Pixbuf scale_simple (int dest_width, int dest_height, Gdk.InterpType interp_type); [CCode (has_construct_function = false)] public Pixbuf.subpixbuf (Gdk.Pixbuf src_pixbuf, int src_x, int src_y, int width, int height); - [NoAccessorMethod] public int bits_per_sample { get; construct; } - [NoAccessorMethod] public Gdk.Colorspace colorspace { get; construct; } - [NoAccessorMethod] public bool has_alpha { get; construct; } - [NoAccessorMethod] public int height { get; construct; } - [NoAccessorMethod] public int n_channels { get; construct; } - [NoAccessorMethod] public void* pixels { get; construct; } - [NoAccessorMethod] public int rowstride { get; construct; } - [NoAccessorMethod] public int width { get; construct; } } [CCode (cheader_filename = "gdk-pixbuf/gdk-pixdata.h")] diff --git a/vapi/gio-2.0.vapi b/vapi/gio-2.0.vapi index ed525f91f..faa0a84a0 100644 --- a/vapi/gio-2.0.vapi +++ b/vapi/gio-2.0.vapi @@ -1,4 +1,4 @@ -/* gio-2.0.vapi generated by lt-vapigen, do not modify. */ +/* gio-2.0.vapi generated by vapigen, do not modify. */ [CCode (cprefix = "G", lower_case_cprefix = "g_")] namespace GLib { @@ -261,13 +261,11 @@ namespace GLib { [CCode (cheader_filename = "gio/gio.h")] public class FilterInputStream : GLib.InputStream { public unowned GLib.InputStream get_base_stream (); - [NoAccessorMethod] public GLib.InputStream base_stream { get; construct; } } [CCode (cheader_filename = "gio/gio.h")] public class FilterOutputStream : GLib.OutputStream { public unowned GLib.OutputStream get_base_stream (); - [NoAccessorMethod] public GLib.OutputStream base_stream { get; construct; } } [Compact] @@ -439,11 +437,8 @@ namespace GLib { public void prepend_name (string iconname); [CCode (type = "GIcon*", has_construct_function = false)] public ThemedIcon.with_default_fallbacks (string iconname); - [NoAccessorMethod] public string name { construct; } - [NoAccessorMethod] public string[] names { get; construct; } - [NoAccessorMethod] public bool use_default_fallbacks { construct; } } [Compact] diff --git a/vapi/gstreamer-0.10.vapi b/vapi/gstreamer-0.10.vapi index be3d5606b..f5373f79f 100644 --- a/vapi/gstreamer-0.10.vapi +++ b/vapi/gstreamer-0.10.vapi @@ -824,7 +824,6 @@ namespace Gst { public bool unlink (Gst.Pad sinkpad); public void use_fixed_caps (); public Gst.Caps caps { get; } - [NoAccessorMethod] public Gst.PadDirection direction { get; construct; } [NoAccessorMethod] public Gst.PadTemplate template { owned get; set; } diff --git a/vapi/gtk+-2.0.vapi b/vapi/gtk+-2.0.vapi index 2f78f455e..f76e8302e 100644 --- a/vapi/gtk+-2.0.vapi +++ b/vapi/gtk+-2.0.vapi @@ -166,7 +166,6 @@ namespace Gtk { public bool is_important { get; set; } [NoAccessorMethod] public string label { owned get; set; } - [NoAccessorMethod] public string name { get; construct; } public bool sensitive { get; set; } [NoAccessorMethod] @@ -207,7 +206,6 @@ namespace Gtk { public void set_translation_domain (string domain); public void set_visible (bool visible); public unowned string translate_string (string str); - [NoAccessorMethod] public string name { get; construct; } public bool sensitive { get; set; } public bool visible { get; set; } @@ -1312,7 +1310,6 @@ namespace Gtk { public FileChooserButton.with_backend (string title, Gtk.FileChooserAction action, string backend); [CCode (type = "GtkWidget*", has_construct_function = false)] public FileChooserButton.with_dialog (Gtk.Widget dialog); - [NoAccessorMethod] public Gtk.FileChooser dialog { construct; } public bool focus_on_click { get; set; } public string title { get; set; } @@ -1811,26 +1808,26 @@ namespace Gtk { [NoAccessorMethod] public string file { owned get; set; } [NoAccessorMethod] - public GLib.Icon gicon { get; set; } + public GLib.Icon gicon { owned get; set; } [NoAccessorMethod] - public string icon_name { get; set; } + public string icon_name { owned get; set; } [NoAccessorMethod] - public Gtk.IconSet icon_set { get; set; } + public Gtk.IconSet icon_set { owned get; set; } [NoAccessorMethod] public int icon_size { get; set; } [NoAccessorMethod] - public Gdk.Image image { get; set; } + public Gdk.Image image { owned get; set; } [NoAccessorMethod] public Gdk.Pixmap mask { owned get; set; } [NoAccessorMethod] - public Gdk.Pixbuf pixbuf { get; set; } + public Gdk.Pixbuf pixbuf { owned get; set; } [NoAccessorMethod] public Gdk.PixbufAnimation pixbuf_animation { owned get; set; } public int pixel_size { get; set; } [NoAccessorMethod] - public Gdk.Pixmap pixmap { get; set; } + public Gdk.Pixmap pixmap { owned get; set; } [NoAccessorMethod] - public string stock { get; set; } + public string stock { owned get; set; } public Gtk.ImageType storage_type { get; } } [Compact] @@ -2253,7 +2250,6 @@ namespace Gtk { public void set_markup (string str); [CCode (type = "GtkWidget*", has_construct_function = false)] public MessageDialog.with_markup (Gtk.Window? parent, Gtk.DialogFlags flags, Gtk.MessageType type, Gtk.ButtonsType buttons, string message_format, ...); - [NoAccessorMethod] public Gtk.ButtonsType buttons { construct; } [NoAccessorMethod] public Gtk.Widget image { owned get; set; } @@ -3422,15 +3418,15 @@ namespace Gtk { [NoAccessorMethod] public string file { set; } [NoAccessorMethod] - public string icon_name { get; set; } + public string icon_name { owned get; set; } [NoAccessorMethod] public Gtk.Orientation orientation { get; } [NoAccessorMethod] - public Gdk.Pixbuf pixbuf { get; set; } + public Gdk.Pixbuf pixbuf { owned get; set; } public Gdk.Screen screen { get; set; } public int size { get; } [NoAccessorMethod] - public string stock { get; set; } + public string stock { owned get; set; } public Gtk.ImageType storage_type { get; } public bool visible { get; set; } public virtual signal void activate (); @@ -3792,7 +3788,6 @@ namespace Gtk { public int cursor_position { get; } public bool has_selection { get; } public Gtk.TargetList paste_target_list { get; } - [NoAccessorMethod] public Gtk.TextTagTable tag_table { get; construct; } public string text { get; set; } [HasEmitter] @@ -3837,9 +3832,7 @@ namespace Gtk { [CCode (has_construct_function = false)] public TextMark (string name, bool left_gravity); public void set_visible (bool setting); - [NoAccessorMethod] public bool left_gravity { get; construct; } - [NoAccessorMethod] public string name { get; construct; } } [Compact] @@ -4346,7 +4339,6 @@ namespace Gtk { public void reset_default_sort_func (); [CCode (type = "GtkTreeModel*", has_construct_function = false)] public TreeModelSort.with_model (Gtk.TreeModel child_model); - [NoAccessorMethod] public Gtk.TreeModel model { get; construct; } } [Compact] diff --git a/vapi/gtksourceview-2.0.vapi b/vapi/gtksourceview-2.0.vapi index c4e055ce1..f9c8902fb 100644 --- a/vapi/gtksourceview-2.0.vapi +++ b/vapi/gtksourceview-2.0.vapi @@ -75,7 +75,6 @@ namespace Gtk { public SourceMark (string name, string category); public unowned Gtk.SourceMark next (string category); public unowned Gtk.SourceMark prev (string category); - [NoAccessorMethod] public string category { get; construct; } } [CCode (cheader_filename = "gtksourceview/gtksourceview.h")] @@ -120,7 +119,6 @@ namespace Gtk { public void set_top_margin (double margin, Gtk.Unit unit); public void set_wrap_mode (Gtk.WrapMode wrap_mode); public string body_font_name { get; set; } - [NoAccessorMethod] public Gtk.SourceBuffer buffer { get; construct; } public string footer_font_name { get; set; } public string header_font_name { get; set; } @@ -175,7 +173,6 @@ namespace Gtk { public unowned Gtk.SourceStyle get_style (string style_id); public string description { get; } public string filename { get; } - [NoAccessorMethod] public string id { get; construct; } public string name { get; } } diff --git a/vapi/hildon-1.vapi b/vapi/hildon-1.vapi index 39554ba5f..f17bc706f 100644 --- a/vapi/hildon-1.vapi +++ b/vapi/hildon-1.vapi @@ -315,7 +315,7 @@ namespace Hildon { [NoAccessorMethod] public bool numbers_only { get; set; } [NoAccessorMethod] - public string password { get; set; } + public string password { owned get; set; } } [CCode (cheader_filename = "hildon/hildon.h")] public class HVolumebar : Hildon.Volumebar, Atk.Implementor, Gtk.Buildable { @@ -334,9 +334,9 @@ namespace Hildon { [NoAccessorMethod] public string message { owned get; set; } [NoAccessorMethod] - public string password { get; set; } + public string password { owned get; set; } [NoAccessorMethod] - public string username { get; set; } + public string username { owned get; set; } } [CCode (cheader_filename = "hildon/hildon.h")] public class Note : Gtk.Dialog, Atk.Implementor, Gtk.Buildable { @@ -441,7 +441,7 @@ namespace Hildon { [NoAccessorMethod] public bool modify_protection { get; construct; } [NoAccessorMethod] - public string password { get; set; } + public string password { owned get; set; } } [CCode (cheader_filename = "hildon/hildon.h")] public class SortDialog : Gtk.Dialog, Atk.Implementor, Gtk.Buildable { diff --git a/vapi/libgnome-2.0.vapi b/vapi/libgnome-2.0.vapi index 62ebc9b98..65c226892 100644 --- a/vapi/libgnome-2.0.vapi +++ b/vapi/libgnome-2.0.vapi @@ -65,13 +65,10 @@ namespace Gnome { public string gnome_sysconfdir { owned get; construct; } [NoAccessorMethod] public void* goption_context { get; construct; } - [NoAccessorMethod] public string human_readable_name { get; construct; } [NoAccessorMethod] public void* popt_context { get; } - [NoAccessorMethod] public int popt_flags { construct; } - [NoAccessorMethod] public void* popt_table { construct; } } [Compact] diff --git a/vapi/liboobs-1.vapi b/vapi/liboobs-1.vapi index daae5d537..a2c4b2bc0 100644 --- a/vapi/liboobs-1.vapi +++ b/vapi/liboobs-1.vapi @@ -18,7 +18,6 @@ namespace Oobs { [NoAccessorMethod] public string crypted_password { owned get; set; } public int gid { get; set; } - [NoAccessorMethod] public string name { get; construct; } public string password { set; } } @@ -177,7 +176,6 @@ namespace Oobs { public void prepend (Oobs.ListIter iter); public bool remove (Oobs.ListIter iter); public void set (Oobs.ListIter iter, void* data); - [NoAccessorMethod] public void* contained_type { construct; } } [Compact] @@ -216,7 +214,6 @@ namespace Oobs { public void process_requests (); public virtual void update (); public Oobs.Result update_async (Oobs.ObjectAsyncFunc func, void* data); - [NoAccessorMethod] public string remote_object { construct; } public virtual signal void changed (); public virtual signal void committed (); @@ -260,7 +257,6 @@ namespace Oobs { public unowned string get_name (); public void get_runlevel_configuration (Oobs.ServicesRunlevel runlevel, Oobs.ServiceStatus status, int priority); public void set_runlevel_configuration (Oobs.ServicesRunlevel runlevel, Oobs.ServiceStatus status, int priority); - [NoAccessorMethod] public string name { get; construct; } } [CCode (cheader_filename = "oobs/oobs.h")] diff --git a/vapi/libsoup-2.2.vapi b/vapi/libsoup-2.2.vapi index 2eb51b56c..0aa953b39 100644 --- a/vapi/libsoup-2.2.vapi +++ b/vapi/libsoup-2.2.vapi @@ -151,11 +151,9 @@ namespace Soup { public void remove_handler (string path); public void run (); public void run_async (); - [NoAccessorMethod] public void* async_context { get; construct; } [NoAccessorMethod] public Soup.Address @interface { owned get; construct; } - [NoAccessorMethod] public uint port { get; construct; } [NoAccessorMethod] public string ssl_cert_file { owned get; construct; } @@ -252,7 +250,6 @@ namespace Soup { public virtual void requeue_message (Soup.Message msg); public virtual uint send_message (Soup.Message msg); public bool try_prune_connection (); - [NoAccessorMethod] public void* async_context { get; construct; } [NoAccessorMethod] public int max_conns { get; set; } diff --git a/vapi/libsoup-2.4.vapi b/vapi/libsoup-2.4.vapi index 49af2ec0d..f015002ce 100644 --- a/vapi/libsoup-2.4.vapi +++ b/vapi/libsoup-2.4.vapi @@ -23,12 +23,9 @@ namespace Soup { public uint resolve_sync (GLib.Cancellable cancellable); [NoAccessorMethod] public Soup.AddressFamily family { get; construct; } - [NoAccessorMethod] public string name { get; construct; } public string physical { get; } - [NoAccessorMethod] public int port { get; construct; } - [NoAccessorMethod] public void* sockaddr { get; construct; } } [CCode (cheader_filename = "libsoup/soup.h")] @@ -44,13 +41,11 @@ namespace Soup { [CCode (has_construct_function = false)] public Auth (GLib.Type type, Soup.Message msg, string auth_header); public virtual bool update (Soup.Message msg, string auth_header); - [NoAccessorMethod] public string host { get; construct; } [NoAccessorMethod] public bool is_authenticated { get; } [NoAccessorMethod] public bool is_for_proxy { get; construct; } - [NoAccessorMethod] public string realm { get; construct; } public string scheme_name { get; } } @@ -76,7 +71,6 @@ namespace Soup { public void* generic_auth_data { get; set; } [NoAccessorMethod] public bool proxy { get; construct; } - [NoAccessorMethod] public string realm { get; construct; } } [CCode (cheader_filename = "libsoup/soup.h")] @@ -357,11 +351,9 @@ namespace Soup { public void run (); public void run_async (); public void unpause_message (Soup.Message msg); - [NoAccessorMethod] public void* async_context { get; construct; } [NoAccessorMethod] public Soup.Address @interface { owned get; construct; } - [NoAccessorMethod] public uint port { get; construct; } [NoAccessorMethod] public bool raw_paths { get; construct; } @@ -391,7 +383,6 @@ namespace Soup { public Soup.SessionFeature add_feature { owned get; set; } [NoAccessorMethod] public GLib.Type add_feature_by_type { get; set; } - [NoAccessorMethod] public void* async_context { get; construct; } [NoAccessorMethod] public uint idle_timeout { get; set; } @@ -451,11 +442,9 @@ namespace Soup { public void* async_context { get; construct; } [NoAccessorMethod] public bool is_server { get; } - [NoAccessorMethod] public Soup.Address local_address { get; construct; } [NoAccessorMethod] public bool non_blocking { get; set; } - [NoAccessorMethod] public Soup.Address remote_address { get; construct; } [NoAccessorMethod] public void* ssl_creds { get; set; } diff --git a/vapigen/valagidlparser.vala b/vapigen/valagidlparser.vala index 160bc9fa3..508f119a3 100644 --- a/vapigen/valagidlparser.vala +++ b/vapigen/valagidlparser.vala @@ -967,14 +967,18 @@ public class Vala.GIdlParser : CodeVisitor { if (prop.get_accessor != null && !current_type_symbol_set.contains (getter)) { prop.no_accessor_method = true; - prop.get_accessor.value_type.value_owned = true; } var setter = "set_%s".printf (prop.name); - if (prop.set_accessor != null && !current_type_symbol_set.contains (setter)) { + if (prop.set_accessor != null && prop.set_accessor.writable + && !current_type_symbol_set.contains (setter)) { prop.no_accessor_method = true; } + + if (prop.no_accessor_method && prop.get_accessor != null) { + prop.get_accessor.value_type.value_owned = true; + } } current_data_type = null;