vala r1089 - in trunk: . vapi vapi/packages/gio-2.0 vapigen



Author: juergbi
Date: Sun Mar  2 13:11:19 2008
New Revision: 1089
URL: http://svn.gnome.org/viewvc/vala?rev=1089&view=rev

Log:
2008-03-02  Juerg Billeter  <j bitron ch>

	* vapigen/valagidlparser.vala: support errordomain metadata attribute

	* vapi/packages/gio-2.0/: mark GIOError as errordomain,
	  update to glib 2.15.6

	* vapi/gio-2.0.vapi: regenerated


Modified:
   trunk/ChangeLog
   trunk/vapi/gio-2.0.vapi
   trunk/vapi/packages/gio-2.0/gio-2.0.gi
   trunk/vapi/packages/gio-2.0/gio-2.0.metadata
   trunk/vapigen/valagidlparser.vala

Modified: trunk/vapi/gio-2.0.vapi
==============================================================================
--- trunk/vapi/gio-2.0.vapi	(original)
+++ trunk/vapi/gio-2.0.vapi	Sun Mar  2 13:11:19 2008
@@ -53,39 +53,11 @@
 		SHORTCUT,
 		MOUNTABLE,
 	}
-	[CCode (cprefix = "G_IO_ERROR_", cheader_filename = "gio/gio.h")]
-	public enum IOError {
-		FAILED,
-		NOT_FOUND,
-		EXISTS,
-		IS_DIRECTORY,
-		NOT_DIRECTORY,
-		NOT_EMPTY,
-		NOT_REGULAR_FILE,
-		NOT_SYMBOLIC_LINK,
-		NOT_MOUNTABLE_FILE,
-		FILENAME_TOO_LONG,
-		INVALID_FILENAME,
-		TOO_MANY_LINKS,
-		NO_SPACE,
-		INVALID_ARGUMENT,
-		PERMISSION_DENIED,
-		NOT_SUPPORTED,
-		NOT_MOUNTED,
-		ALREADY_MOUNTED,
-		CLOSED,
-		CANCELLED,
-		PENDING,
-		READ_ONLY,
-		CANT_CREATE_BACKUP,
-		WRONG_ETAG,
-		TIMED_OUT,
-		WOULD_RECURSE,
-		BUSY,
-		WOULD_BLOCK,
-		HOST_NOT_FOUND,
-		WOULD_MERGE,
-		FAILED_HANDLED,
+	[CCode (cprefix = "G_FILESYSTEM_PREVIEW_TYPE_", cheader_filename = "gio/gio.h")]
+	public enum FilesystemPreviewType {
+		IF_ALWAYS,
+		IF_LOCAL,
+		NEVER,
 	}
 	[CCode (cprefix = "G_MOUNT_MOUNT_", cheader_filename = "gio/gio.h")]
 	public enum MountMountFlags {
@@ -167,6 +139,40 @@
 		CLOSE_SOURCE,
 		CLOSE_TARGET,
 	}
+	[CCode (cprefix = "G_IO_ERROR_", cheader_filename = "gio/gio.h")]
+	public errordomain IOError {
+		FAILED,
+		NOT_FOUND,
+		EXISTS,
+		IS_DIRECTORY,
+		NOT_DIRECTORY,
+		NOT_EMPTY,
+		NOT_REGULAR_FILE,
+		NOT_SYMBOLIC_LINK,
+		NOT_MOUNTABLE_FILE,
+		FILENAME_TOO_LONG,
+		INVALID_FILENAME,
+		TOO_MANY_LINKS,
+		NO_SPACE,
+		INVALID_ARGUMENT,
+		PERMISSION_DENIED,
+		NOT_SUPPORTED,
+		NOT_MOUNTED,
+		ALREADY_MOUNTED,
+		CLOSED,
+		CANCELLED,
+		PENDING,
+		READ_ONLY,
+		CANT_CREATE_BACKUP,
+		WRONG_ETAG,
+		TIMED_OUT,
+		WOULD_RECURSE,
+		BUSY,
+		WOULD_BLOCK,
+		HOST_NOT_FOUND,
+		WOULD_MERGE,
+		FAILED_HANDLED,
+	}
 	[CCode (cheader_filename = "gio/gio.h")]
 	public class FileAttributeInfo {
 		public weak string name;
@@ -564,6 +570,7 @@
 	}
 	[CCode (cheader_filename = "gio/gio.h")]
 	public class ThemedIcon : GLib.Object, GLib.Icon {
+		public void append_name (string iconname);
 		public weak string get_names ();
 		public ThemedIcon (string iconname);
 		public ThemedIcon.from_names (string[] iconnames, int len);
@@ -658,6 +665,7 @@
 		public bool copy_attributes (GLib.File destination, GLib.FileCopyFlags flags, GLib.Cancellable cancellable) throws GLib.Error;
 		public bool @delete (GLib.Cancellable cancellable) throws GLib.Error;
 		public weak GLib.File get_child (string name);
+		public bool has_prefix (GLib.File prefix);
 		public bool load_contents (GLib.Cancellable cancellable, out weak string contents, ulong length, out weak string etag_out) throws GLib.Error;
 		public void load_contents_async (GLib.Cancellable cancellable, GLib.AsyncReadyCallback callback);
 		public bool load_contents_finish (GLib.AsyncResult res, out weak string contents, ulong length, out weak string etag_out) throws GLib.Error;
@@ -682,7 +690,6 @@
 		public abstract weak GLib.FileOutputStream append_to (GLib.FileCreateFlags flags, GLib.Cancellable cancellable) throws GLib.Error;
 		public abstract void append_to_async (GLib.FileCreateFlags flags, int io_priority, GLib.Cancellable cancellable, GLib.AsyncReadyCallback callback);
 		public abstract weak GLib.FileOutputStream append_to_finish (GLib.AsyncResult res) throws GLib.Error;
-		public abstract bool contains_file (GLib.File descendant);
 		public abstract bool copy (GLib.File destination, GLib.FileCopyFlags flags, GLib.Cancellable cancellable, GLib.FileProgressCallback progress_callback, pointer progress_callback_data) throws GLib.Error;
 		public abstract void copy_async (GLib.File destination, GLib.FileCopyFlags flags, int io_priority, GLib.Cancellable cancellable, GLib.FileProgressCallback progress_callback, pointer progress_callback_data, GLib.AsyncReadyCallback callback);
 		public abstract bool copy_finish (GLib.AsyncResult res) throws GLib.Error;
@@ -723,7 +730,11 @@
 		public abstract void mount_mountable (GLib.MountMountFlags flags, GLib.MountOperation mount_operation, GLib.Cancellable cancellable, GLib.AsyncReadyCallback callback);
 		public abstract weak GLib.File mount_mountable_finish (GLib.AsyncResult _result) throws GLib.Error;
 		public abstract bool move (GLib.File destination, GLib.FileCopyFlags flags, GLib.Cancellable cancellable, GLib.FileProgressCallback progress_callback, pointer progress_callback_data) throws GLib.Error;
+		[NoWrapper]
+		public abstract bool prefix_matches (GLib.File file);
 		public abstract weak GLib.FileInfo query_filesystem_info (string attributes, GLib.Cancellable cancellable) throws GLib.Error;
+		public abstract void query_filesystem_info_async (string attributes, int io_priority, GLib.Cancellable cancellable, GLib.AsyncReadyCallback callback);
+		public abstract weak GLib.FileInfo query_filesystem_info_finish (GLib.AsyncResult res) throws GLib.Error;
 		public abstract weak GLib.FileInfo query_info (string attributes, GLib.FileQueryInfoFlags flags, GLib.Cancellable cancellable) throws GLib.Error;
 		public abstract void query_info_async (string attributes, GLib.FileQueryInfoFlags flags, int io_priority, GLib.Cancellable cancellable, GLib.AsyncReadyCallback callback);
 		public abstract weak GLib.FileInfo query_info_finish (GLib.AsyncResult res) throws GLib.Error;
@@ -834,6 +845,7 @@
 	public const string FILE_ATTRIBUTE_FILESYSTEM_READONLY;
 	public const string FILE_ATTRIBUTE_FILESYSTEM_SIZE;
 	public const string FILE_ATTRIBUTE_FILESYSTEM_TYPE;
+	public const string FILE_ATTRIBUTE_FILESYSTEM_USE_PREVIEW;
 	public const string FILE_ATTRIBUTE_GVFS_BACKEND;
 	public const string FILE_ATTRIBUTE_ID_FILE;
 	public const string FILE_ATTRIBUTE_ID_FILESYSTEM;
@@ -873,6 +885,7 @@
 	public const string FILE_ATTRIBUTE_TIME_CREATED_USEC;
 	public const string FILE_ATTRIBUTE_TIME_MODIFIED;
 	public const string FILE_ATTRIBUTE_TIME_MODIFIED_USEC;
+	public const string FILE_ATTRIBUTE_TRASH_ITEM_COUNT;
 	public const string FILE_ATTRIBUTE_UNIX_BLOCKS;
 	public const string FILE_ATTRIBUTE_UNIX_BLOCK_SIZE;
 	public const string FILE_ATTRIBUTE_UNIX_DEVICE;

Modified: trunk/vapi/packages/gio-2.0/gio-2.0.gi
==============================================================================
--- trunk/vapi/packages/gio-2.0/gio-2.0.gi	(original)
+++ trunk/vapi/packages/gio-2.0/gio-2.0.gi	Sun Mar  2 13:11:19 2008
@@ -389,6 +389,11 @@
 			<member name="G_FILE_TYPE_SHORTCUT" value="5"/>
 			<member name="G_FILE_TYPE_MOUNTABLE" value="6"/>
 		</enum>
+		<enum name="GFilesystemPreviewType">
+			<member name="G_FILESYSTEM_PREVIEW_TYPE_IF_ALWAYS" value="0"/>
+			<member name="G_FILESYSTEM_PREVIEW_TYPE_IF_LOCAL" value="1"/>
+			<member name="G_FILESYSTEM_PREVIEW_TYPE_NEVER" value="2"/>
+		</enum>
 		<enum name="GIOErrorEnum">
 			<member name="G_IO_ERROR_FAILED" value="0"/>
 			<member name="G_IO_ERROR_NOT_FOUND" value="1"/>
@@ -2611,6 +2616,13 @@
 			<implements>
 				<interface name="GIcon"/>
 			</implements>
+			<method name="append_name" symbol="g_themed_icon_append_name">
+				<return-type type="void"/>
+				<parameters>
+					<parameter name="icon" type="GThemedIcon*"/>
+					<parameter name="iconname" type="char*"/>
+				</parameters>
+			</method>
 			<method name="get_names" symbol="g_themed_icon_get_names">
 				<return-type type="char**"/>
 				<parameters>
@@ -3431,13 +3443,6 @@
 					<parameter name="error" type="GError**"/>
 				</parameters>
 			</method>
-			<method name="contains_file" symbol="g_file_contains_file">
-				<return-type type="gboolean"/>
-				<parameters>
-					<parameter name="parent" type="GFile*"/>
-					<parameter name="descendant" type="GFile*"/>
-				</parameters>
-			</method>
 			<method name="copy" symbol="g_file_copy">
 				<return-type type="gboolean"/>
 				<parameters>
@@ -3663,6 +3668,13 @@
 					<parameter name="file" type="GFile*"/>
 				</parameters>
 			</method>
+			<method name="has_prefix" symbol="g_file_has_prefix">
+				<return-type type="gboolean"/>
+				<parameters>
+					<parameter name="file" type="GFile*"/>
+					<parameter name="prefix" type="GFile*"/>
+				</parameters>
+			</method>
 			<method name="has_uri_scheme" symbol="g_file_has_uri_scheme">
 				<return-type type="gboolean"/>
 				<parameters>
@@ -3849,6 +3861,25 @@
 					<parameter name="error" type="GError**"/>
 				</parameters>
 			</method>
+			<method name="query_filesystem_info_async" symbol="g_file_query_filesystem_info_async">
+				<return-type type="void"/>
+				<parameters>
+					<parameter name="file" type="GFile*"/>
+					<parameter name="attributes" type="char*"/>
+					<parameter name="io_priority" type="int"/>
+					<parameter name="cancellable" type="GCancellable*"/>
+					<parameter name="callback" type="GAsyncReadyCallback"/>
+					<parameter name="user_data" type="gpointer"/>
+				</parameters>
+			</method>
+			<method name="query_filesystem_info_finish" symbol="g_file_query_filesystem_info_finish">
+				<return-type type="GFileInfo*"/>
+				<parameters>
+					<parameter name="file" type="GFile*"/>
+					<parameter name="res" type="GAsyncResult*"/>
+					<parameter name="error" type="GError**"/>
+				</parameters>
+			</method>
 			<method name="query_info" symbol="g_file_query_info">
 				<return-type type="GFileInfo*"/>
 				<parameters>
@@ -4188,13 +4219,6 @@
 					<parameter name="error" type="GError**"/>
 				</parameters>
 			</vfunc>
-			<vfunc name="contains_file">
-				<return-type type="gboolean"/>
-				<parameters>
-					<parameter name="parent" type="GFile*"/>
-					<parameter name="descendant" type="GFile*"/>
-				</parameters>
-			</vfunc>
 			<vfunc name="copy">
 				<return-type type="gboolean"/>
 				<parameters>
@@ -4507,6 +4531,13 @@
 					<parameter name="error" type="GError**"/>
 				</parameters>
 			</vfunc>
+			<vfunc name="prefix_matches">
+				<return-type type="gboolean"/>
+				<parameters>
+					<parameter name="prefix" type="GFile*"/>
+					<parameter name="file" type="GFile*"/>
+				</parameters>
+			</vfunc>
 			<vfunc name="query_filesystem_info">
 				<return-type type="GFileInfo*"/>
 				<parameters>
@@ -4516,6 +4547,25 @@
 					<parameter name="error" type="GError**"/>
 				</parameters>
 			</vfunc>
+			<vfunc name="query_filesystem_info_async">
+				<return-type type="void"/>
+				<parameters>
+					<parameter name="file" type="GFile*"/>
+					<parameter name="attributes" type="char*"/>
+					<parameter name="io_priority" type="int"/>
+					<parameter name="cancellable" type="GCancellable*"/>
+					<parameter name="callback" type="GAsyncReadyCallback"/>
+					<parameter name="user_data" type="gpointer"/>
+				</parameters>
+			</vfunc>
+			<vfunc name="query_filesystem_info_finish">
+				<return-type type="GFileInfo*"/>
+				<parameters>
+					<parameter name="file" type="GFile*"/>
+					<parameter name="res" type="GAsyncResult*"/>
+					<parameter name="error" type="GError**"/>
+				</parameters>
+			</vfunc>
 			<vfunc name="query_info">
 				<return-type type="GFileInfo*"/>
 				<parameters>
@@ -5348,6 +5398,7 @@
 		<constant name="G_FILE_ATTRIBUTE_FILESYSTEM_READONLY" type="char*" value="filesystem::readonly"/>
 		<constant name="G_FILE_ATTRIBUTE_FILESYSTEM_SIZE" type="char*" value="filesystem::size"/>
 		<constant name="G_FILE_ATTRIBUTE_FILESYSTEM_TYPE" type="char*" value="filesystem::type"/>
+		<constant name="G_FILE_ATTRIBUTE_FILESYSTEM_USE_PREVIEW" type="char*" value="filesystem::use-preview"/>
 		<constant name="G_FILE_ATTRIBUTE_GVFS_BACKEND" type="char*" value="gvfs::backend"/>
 		<constant name="G_FILE_ATTRIBUTE_ID_FILE" type="char*" value="id::file"/>
 		<constant name="G_FILE_ATTRIBUTE_ID_FILESYSTEM" type="char*" value="id::filesystem"/>
@@ -5387,6 +5438,7 @@
 		<constant name="G_FILE_ATTRIBUTE_TIME_CREATED_USEC" type="char*" value="time::created-usec"/>
 		<constant name="G_FILE_ATTRIBUTE_TIME_MODIFIED" type="char*" value="time::modified"/>
 		<constant name="G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC" type="char*" value="time::modified-usec"/>
+		<constant name="G_FILE_ATTRIBUTE_TRASH_ITEM_COUNT" type="char*" value="trash::item-count"/>
 		<constant name="G_FILE_ATTRIBUTE_UNIX_BLOCKS" type="char*" value="unix::blocks"/>
 		<constant name="G_FILE_ATTRIBUTE_UNIX_BLOCK_SIZE" type="char*" value="unix::block-size"/>
 		<constant name="G_FILE_ATTRIBUTE_UNIX_DEVICE" type="char*" value="unix::device"/>

Modified: trunk/vapi/packages/gio-2.0/gio-2.0.metadata
==============================================================================
--- trunk/vapi/packages/gio-2.0/gio-2.0.metadata	(original)
+++ trunk/vapi/packages/gio-2.0/gio-2.0.metadata	Sun Mar  2 13:11:19 2008
@@ -9,4 +9,4 @@
 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"
+GIOErrorEnum rename_to="IOError" errordomain="1"

Modified: trunk/vapigen/valagidlparser.vala
==============================================================================
--- trunk/vapigen/valagidlparser.vala	(original)
+++ trunk/vapigen/valagidlparser.vala	Sun Mar  2 13:11:19 2008
@@ -238,10 +238,14 @@
 					continue;
 				}
 				en.name = fix_type_name (en.name, ns);
-				ns.add_enum (en);
+				if (en is ErrorDomain) {
+					ns.add_error_domain (en as ErrorDomain);
+				} else {
+					ns.add_enum (en as Enum);
+				}
 				current_source_file.add_node (en);
 			} else if (node.type == IdlNodeTypeId.FLAGS) {
-				var en = parse_enum ((IdlNodeEnum) node);
+				var en = parse_enum ((IdlNodeEnum) node) as Enum;
 				if (en == null) {
 					continue;
 				}
@@ -703,7 +707,7 @@
 		}
 	}
 	
-	private Enum parse_enum (IdlNodeEnum! en_node) {
+	private Typesymbol parse_enum (IdlNodeEnum! en_node) {
 		weak IdlNode node = (IdlNode) en_node;
 	
 		var en = new Enum (node.name, current_source_reference);
@@ -730,6 +734,8 @@
 			}
 		}
 
+		bool is_errordomain = false;
+
 		var en_attributes = get_attributes (node.name);
 		if (en_attributes != null) {
 			foreach (string attr in en_attributes) {
@@ -744,6 +750,10 @@
 					}
 				} else if (nv[0] == "rename_to") {
 					en.name = eval (nv[1]);
+				} else if (nv[0] == "errordomain") {
+					if (eval (nv[1]) == "1") {
+						is_errordomain = true;
+					}
 				}
 			}
 		}
@@ -754,7 +764,19 @@
 			var ev = new EnumValue (value2.name.offset (common_prefix.len ()));
 			en.add_value (ev);
 		}
-		
+
+		if (is_errordomain) {
+			var ed = new ErrorDomain (en.name);
+			ed.access = SymbolAccessibility.PUBLIC;
+			ed.set_cprefix (common_prefix);
+
+			foreach (EnumValue ev in en.get_values ()) {
+				ed.add_code (new ErrorCode (ev.name));
+			}
+
+			return ed;
+		}
+
 		return en;
 	}
 	



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]