From: Raffaele Sandrini Date: Tue, 19 Feb 2008 15:40:07 +0000 (+0000) Subject: regenerated fix some methods and rename IOErrorEnum to IOError support X-Git-Tag: VALA_0_1_7~71 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9173312b36fe0319074ebc80eef5b1f41dd59c85;p=platform%2Fupstream%2Fvala.git regenerated fix some methods and rename IOErrorEnum to IOError support 2008-02-19 Raffaele Sandrini * vapi/gio-2.0.vapi: regenerated * vapi/packages/gio-2.0/gio-2.0.metadata: fix some methods and rename IOErrorEnum to IOError * vapigen/valagidlparser.vala: support renaming of enums, check more carefully whether an error formal parameter of a function is meant as exception svn path=/trunk/; revision=1020 --- diff --git a/ChangeLog b/ChangeLog index 44b4095..5f1b46f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2008-02-19 Raffaele Sandrini + + reviewed by: + + * gobject/valaccodegenerator.vala: + * vapi/gio-2.0.vapi: + * vapi/glib-2.0.vapi: + * vapi/packages/gio-2.0/gio-2.0.metadata: + * vapigen/valagidlparser.vala: + 2008-02-18 Jürg Billeter * vapi/Makefile.am, vapi/libusb.vapi: add libusb bindings, diff --git a/vapi/gio-2.0.vapi b/vapi/gio-2.0.vapi index f97a085..cb342a3 100644 --- a/vapi/gio-2.0.vapi +++ b/vapi/gio-2.0.vapi @@ -54,7 +54,7 @@ namespace GLib { MOUNTABLE, } [CCode (cprefix = "G_IO_ERROR_", cheader_filename = "gio/gio.h")] - public enum IOErrorEnum { + public enum IOError { FAILED, NOT_FOUND, EXISTS, @@ -276,11 +276,11 @@ namespace GLib { public short read_int16 (GLib.Cancellable cancellable) throws GLib.Error; public int read_int32 (GLib.Cancellable cancellable) throws GLib.Error; public int64 read_int64 (GLib.Cancellable cancellable) throws GLib.Error; - public weak string read_line (ulong length, GLib.Cancellable cancellable) throws GLib.Error; + public weak string read_line (out ulong length, GLib.Cancellable cancellable) throws GLib.Error; public ushort read_uint16 (GLib.Cancellable cancellable) throws GLib.Error; public uint read_uint32 (GLib.Cancellable cancellable) throws GLib.Error; public uint64 read_uint64 (GLib.Cancellable cancellable) throws GLib.Error; - public weak string read_until (string stop_chars, ulong length, GLib.Cancellable cancellable) throws GLib.Error; + public weak string read_until (string stop_chars, out ulong length, GLib.Cancellable cancellable) throws GLib.Error; public void set_byte_order (GLib.DataStreamByteOrder order); public void set_newline_type (GLib.DataStreamNewlineType type); public weak GLib.DataStreamByteOrder byte_order { get; set; } @@ -455,7 +455,7 @@ namespace GLib { public bool has_pending (); public bool is_closed (); public long read (pointer buffer, ulong count, GLib.Cancellable cancellable) throws GLib.Error; - public bool read_all (pointer buffer, ulong count, ulong bytes_read, GLib.Cancellable cancellable) throws GLib.Error; + public bool read_all (pointer buffer, ulong count, out ulong bytes_read, GLib.Cancellable cancellable) throws GLib.Error; public bool set_pending () throws GLib.Error; public virtual void close_async (int io_priority, GLib.Cancellable cancellable, GLib.AsyncReadyCallback callback, pointer user_data); public virtual bool close_finish (GLib.AsyncResult _result) throws GLib.Error; @@ -546,12 +546,12 @@ namespace GLib { public pointer get_source_tag (); public SimpleAsyncResult (GLib.Object source_object, GLib.AsyncReadyCallback callback, pointer user_data, pointer source_tag); public SimpleAsyncResult.error (GLib.Object source_object, GLib.AsyncReadyCallback callback, pointer user_data, GLib.Quark domain, int code, string format); - public SimpleAsyncResult.from_error (GLib.Object source_object, GLib.AsyncReadyCallback callback, pointer user_data) throws GLib.Error; + public SimpleAsyncResult.from_error (GLib.Object source_object, GLib.AsyncReadyCallback callback, pointer user_data, GLib.Error error); public bool propagate_error () throws GLib.Error; public void run_in_thread (GLib.SimpleAsyncThreadFunc func, int io_priority, GLib.Cancellable cancellable); public void set_error (GLib.Quark domain, int code, string format); public void set_error_va (GLib.Quark domain, int code, string format, pointer args); - public void set_from_error () throws GLib.Error; + public void set_from_error (GLib.Error error); public void set_handle_cancellation (bool handle_cancellation); public void set_op_res_gboolean (bool op_res); public void set_op_res_gpointer (pointer op_res, GLib.DestroyNotify destroy_op_res); @@ -895,7 +895,7 @@ namespace GLib { [CCode (cname = "g_content_types_get_registered", cheader_filename = "gio/gio.h")] public static weak GLib.List g_content_types_get_registered (); [CCode (cname = "g_io_error_from_errno", cheader_filename = "gio/gio.h")] - public static GLib.IOErrorEnum g_io_error_from_errno (int err_no); + public static GLib.IOError g_io_error_from_errno (int err_no); [CCode (cname = "g_io_error_quark", cheader_filename = "gio/gio.h")] public static GLib.Quark g_io_error_quark (); [CCode (cname = "g_io_modules_load_all_in_directory", cheader_filename = "gio/gio.h")] @@ -907,5 +907,5 @@ namespace GLib { [CCode (cname = "g_simple_async_report_error_in_idle", cheader_filename = "gio/gio.h")] public static void g_simple_async_report_error_in_idle (GLib.Object object, GLib.AsyncReadyCallback callback, pointer user_data, GLib.Quark domain, int code, string format); [CCode (cname = "g_simple_async_report_gerror_in_idle", cheader_filename = "gio/gio.h")] - public static void g_simple_async_report_gerror_in_idle (GLib.Object object, GLib.AsyncReadyCallback callback, pointer user_data) throws GLib.Error; + public static void g_simple_async_report_gerror_in_idle (GLib.Object object, GLib.AsyncReadyCallback callback, pointer user_data, GLib.Error error); } diff --git a/vapi/packages/gio-2.0/gio-2.0.metadata b/vapi/packages/gio-2.0/gio-2.0.metadata index eb4376d..1ac91ad 100644 --- a/vapi/packages/gio-2.0/gio-2.0.metadata +++ b/vapi/packages/gio-2.0/gio-2.0.metadata @@ -6,4 +6,7 @@ g_file_new_for_path transfer_ownership="1" g_file_new_for_uri transfer_ownership="1" GMountOperation::reply has_emitter="1" g_themed_icon_new_from_names.iconnames is_array="1" - +g_input_stream_read_all.bytes_read is_out="1" +g_data_input_stream_read_line.length is_out="1" +g_data_input_stream_read_until.length is_out="1" +GIOErrorEnum rename_to="IOError" diff --git a/vapigen/valagidlparser.vala b/vapigen/valagidlparser.vala index 49ff146..cbc1bd3 100644 --- a/vapigen/valagidlparser.vala +++ b/vapigen/valagidlparser.vala @@ -731,6 +731,8 @@ public class Vala.GIdlParser : CodeVisitor { if (eval (nv[1]) == "1") { return null; } + } else if (nv[0] == "rename_to") { + en.name = eval (nv[1]); } } } @@ -1105,6 +1107,8 @@ public class Vala.GIdlParser : CodeVisitor { type.type_name = eval (nv[1]); } else if (nv[0] == "namespace") { type.namespace_name = eval (nv[1]); + } else if (nv[0] == "rename_to") { + type.type_name = eval (nv[1]); } } } @@ -1241,7 +1245,7 @@ public class Vala.GIdlParser : CodeVisitor { } } - if (suppress_throws == false && param.type.is_error) { + if (suppress_throws == false && param_is_exception (param)) { m.add_error_domain (parse_type (param.type)); continue; } @@ -1322,6 +1326,17 @@ public class Vala.GIdlParser : CodeVisitor { return m; } + private bool param_is_exception (IdlNodeParam param) { + if (!param.type.is_error) { + return false; + } + var s = param.type.unparsed.chomp (); + if (s.has_suffix ("**")) { + return true; + } + return false; + } + private Method parse_function (IdlNodeFunction! f, bool is_interface = false) { weak IdlNode node = (IdlNode) f;