f-spot r4656 - in trunk: . GKeyFile GKeyFile/generated



Author: sdelcroix
Date: Sat Dec  6 14:04:34 2008
New Revision: 4656
URL: http://svn.gnome.org/viewvc/f-spot?rev=4656&view=rev

Log:
api fixup in GKeyFile

2008-12-06  Stephane Delcroix  <sdelcroix novell com>

	* GKeyFile/*: fix the Set*List in the metadata, not in .custom. Hide
	broken methods.

Modified:
   trunk/ChangeLog
   trunk/GKeyFile/GKeyFile.custom
   trunk/GKeyFile/GKeyFile.metadata
   trunk/GKeyFile/generated/GKeyFile.cs
   trunk/GKeyFile/gkeyfile-api.xml

Modified: trunk/GKeyFile/GKeyFile.custom
==============================================================================
--- trunk/GKeyFile/GKeyFile.custom	(original)
+++ trunk/GKeyFile/GKeyFile.custom	Sat Dec  6 14:04:34 2008
@@ -51,22 +51,6 @@
 		stream.Close ();
 	}
 	
-	public void SetStringList(string group_name, string key, string[] list) {
-		SetStringList (group_name, key, list, (ulong)list.Length);
-	}
-
-	public void SetBooleanList(string group_name, string key, bool[] list) {
-		SetBooleanList(group_name, key, list, (ulong)list.Length);
-	}
-	
-	public void SetIntegerList(string group_name, string key, int[] list) {
-		SetIntegerList (group_name, key, list, (ulong)list.Length);
-	}
-
-	public void SetDoubleList(string group_name, string key, double[] list) {
-		SetDoubleList (group_name, key, list, (ulong)list.Length);
-	}
-
 	public string [] GetKeys (string group_name) {
 		ulong length;
 		return GetKeys (group_name, out length);
@@ -82,17 +66,55 @@
 		return GetStringList (group_name, key, out length);
 	}
 
-//	public bool[] GetBooleanList(string group_name, string key) {
-//		ulong length;
-//		return GetBooleanList (group_anme, key, out length);
+//	[DllImport("libglib-2.0.dll")]
+//	static extern unsafe bool g_key_file_get_boolean_list(IntPtr raw, IntPtr group_name, IntPtr key, out UIntPtr length, out IntPtr error);
+//
+//	public unsafe bool GetBooleanList(string group_name, string key, out ulong length) {
+//		IntPtr native_group_name = GLib.Marshaller.StringToPtrGStrdup (group_name);
+//		IntPtr native_key = GLib.Marshaller.StringToPtrGStrdup (key);
+//		UIntPtr native_length;
+//		IntPtr error = IntPtr.Zero;
+//		bool raw_ret = g_key_file_get_boolean_list(Handle, native_group_name, native_key, out native_length, out error);
+//		bool ret = raw_ret;
+//		GLib.Marshaller.Free (native_group_name);
+//		GLib.Marshaller.Free (native_key);
+//		length = (ulong) native_length;
+//		if (error != IntPtr.Zero) throw new GLib.GException (error);
+//		return ret;
 //	}
-//	
-//	public int[] GetIntegerList(string group_name, string key) {
-//		ulong length;
-//		return GetIntegerList (group_name, key, out length);
+//
+//	[DllImport("libglib-2.0.dll")]
+//	static extern unsafe int g_key_file_get_integer_list(IntPtr raw, IntPtr group_name, IntPtr key, out UIntPtr length, out IntPtr error);
+//
+//	public unsafe int GetIntegerList(string group_name, string key, out ulong length) {
+//		IntPtr native_group_name = GLib.Marshaller.StringToPtrGStrdup (group_name);
+//		IntPtr native_key = GLib.Marshaller.StringToPtrGStrdup (key);
+//		UIntPtr native_length;
+//		IntPtr error = IntPtr.Zero;
+//		int raw_ret = g_key_file_get_integer_list(Handle, native_group_name, native_key, out native_length, out error);
+//		int ret = raw_ret;
+//		GLib.Marshaller.Free (native_group_name);
+//		GLib.Marshaller.Free (native_key);
+//		length = (ulong) native_length;
+//		if (error != IntPtr.Zero) throw new GLib.GException (error);
+//		return ret;
 //	}
 //
-//	public double[] GetDoubleList(string group_name, string key) {
-//		ulong length;
-//		return GetDoubleList (group_name, key, out length);
+//	[DllImport("libglib-2.0.dll")]
+//	static extern unsafe double g_key_file_get_double_list(IntPtr raw, IntPtr group_name, IntPtr key, out UIntPtr length, out IntPtr error);
+//
+//	public unsafe double GetDoubleList(string group_name, string key, out ulong length) {
+//		IntPtr native_group_name = GLib.Marshaller.StringToPtrGStrdup (group_name);
+//		IntPtr native_key = GLib.Marshaller.StringToPtrGStrdup (key);
+//		UIntPtr native_length;
+//		IntPtr error = IntPtr.Zero;
+//		double raw_ret = g_key_file_get_double_list(Handle, native_group_name, native_key, out native_length, out error);
+//		double ret = raw_ret;
+//		GLib.Marshaller.Free (native_group_name);
+//		GLib.Marshaller.Free (native_key);
+//		length = (ulong) native_length;
+//		if (error != IntPtr.Zero) throw new GLib.GException (error);
+//		return ret;
 //	}
+
+

Modified: trunk/GKeyFile/GKeyFile.metadata
==============================================================================
--- trunk/GKeyFile/GKeyFile.metadata	(original)
+++ trunk/GKeyFile/GKeyFile.metadata	Sat Dec  6 14:04:34 2008
@@ -1,10 +1,10 @@
 <?xml version="1.0"?>
 <metadata>
   <attr		path="/api/namespace/struct[ cname='GKeyFile']/method[ cname='g_key_file_to_data']" name="accessibility">private</attr>
-  <attr		path="/api/namespace/struct[ cname='GKeyFile']/method[ cname='g_key_file_set_string_list']" name="accessibility">private</attr>
-  <attr		path="/api/namespace/struct[ cname='GKeyFile']/method[ cname='g_key_file_set_integer_list']" name="accessibility">private</attr>
-  <attr		path="/api/namespace/struct[ cname='GKeyFile']/method[ cname='g_key_file_set_double_list']" name="accessibility">private</attr>
-  <attr		path="/api/namespace/struct[ cname='GKeyFile']/method[ cname='g_key_file_set_boolean_list']" name="accessibility">private</attr>
+  <attr		path="/api/namespace/struct[ cname='GKeyFile']/method[ cname='g_key_file_set_string_list']/parameters/parameter[ name='length']" name="name">n_list</attr>
+  <attr		path="/api/namespace/struct[ cname='GKeyFile']/method[ cname='g_key_file_set_integer_list']/parameters/parameter[ name='length']" name="name">n_list</attr>
+  <attr		path="/api/namespace/struct[ cname='GKeyFile']/method[ cname='g_key_file_set_double_list']/parameters/parameter[ name='length']" name="name">n_list</attr>
+  <attr		path="/api/namespace/struct[ cname='GKeyFile']/method[ cname='g_key_file_set_boolean_list']/parameters/parameter[ name='length']" name="name">n_list</attr>
   <attr 	path="/api/namespace/struct[ cname='GKeyFile']/method[ cname='g_key_file_get_keys']" name="accessibility">private</attr> 
   <attr 	path="/api/namespace/struct[ cname='GKeyFile']/method[ cname='g_key_file_get_keys']/return-type" name="null_term_array">1</attr> 
   <attr 	path="/api/namespace/struct[ cname='GKeyFile']/method[ cname='g_key_file_get_groups']" name="accessibility">private</attr> 
@@ -12,12 +12,8 @@
   <attr 	path="/api/namespace/struct[ cname='GKeyFile']/method[ cname='g_key_file_get_string_list']" name="accessibility">private</attr> 
   <attr 	path="/api/namespace/struct[ cname='GKeyFile']/method[ cname='g_key_file_get_string_list']/return-type" name="null_term_array">1</attr> 
   <attr 	path="/api/namespace/struct[ cname='GKeyFile']/method[ cname='g_key_file_get_locale_string_list']/return-type" name="null_term_array">1</attr> 
-<!--
-  <attr 	path="/api/namespace/struct[ cname='GKeyFile']/method[ cname='g_key_file_get_boolean_list']" name="accessibility">private</attr> 
-  <attr 	path="/api/namespace/struct[ cname='GKeyFile']/method[ cname='g_key_file_get_boolean_list']/return-type" name="element_type">gboolean</attr> 
-  <attr 	path="/api/namespace/struct[ cname='GKeyFile']/method[ cname='g_key_file_get_integer_list']" name="accessibility">private</attr> 
-  <attr 	path="/api/namespace/struct[ cname='GKeyFile']/method[ cname='g_key_file_get_integer_list']/return-type" name="null_term_array">1</attr> 
-  <attr 	path="/api/namespace/struct[ cname='GKeyFile']/method[ cname='g_key_file_get_double_list']" name="accessibility">private</attr> 
-  <attr 	path="/api/namespace/struct[ cname='GKeyFile']/method[ cname='g_key_file_get_double_list']/return-type" name="null_term_array">1</attr>
--->
+  <attr 	path="/api/namespace/struct[ cname='GKeyFile']/method[ cname='g_key_file_get_boolean_list']" name="hidden">1</attr> 
+  <attr 	path="/api/namespace/struct[ cname='GKeyFile']/method[ cname='g_key_file_get_integer_list']" name="hidden">1</attr> 
+  <attr 	path="/api/namespace/struct[ cname='GKeyFile']/method[ cname='g_key_file_get_double_list']" name="hidden">1</attr> 
+
 </metadata>

Modified: trunk/GKeyFile/generated/GKeyFile.cs
==============================================================================
--- trunk/GKeyFile/generated/GKeyFile.cs	(original)
+++ trunk/GKeyFile/generated/GKeyFile.cs	Sat Dec  6 14:04:34 2008
@@ -50,17 +50,6 @@
 		}
 
 		[DllImport("libglib-2.0.dll")]
-		static extern void g_key_file_set_double(IntPtr raw, IntPtr group_name, IntPtr key, double value);
-
-		public void SetDouble(string group_name, string key, double value) {
-			IntPtr native_group_name = GLib.Marshaller.StringToPtrGStrdup (group_name);
-			IntPtr native_key = GLib.Marshaller.StringToPtrGStrdup (key);
-			g_key_file_set_double(Handle, native_group_name, native_key, value);
-			GLib.Marshaller.Free (native_group_name);
-			GLib.Marshaller.Free (native_key);
-		}
-
-		[DllImport("libglib-2.0.dll")]
 		static extern unsafe bool g_key_file_remove_key(IntPtr raw, IntPtr group_name, IntPtr key, out IntPtr error);
 
 		public unsafe bool RemoveKey(string group_name, string key) {
@@ -102,23 +91,6 @@
 		}
 
 		[DllImport("libglib-2.0.dll")]
-		static extern unsafe double g_key_file_get_double_list(IntPtr raw, IntPtr group_name, IntPtr key, out UIntPtr length, out IntPtr error);
-
-		public unsafe double GetDoubleList(string group_name, string key, out ulong length) {
-			IntPtr native_group_name = GLib.Marshaller.StringToPtrGStrdup (group_name);
-			IntPtr native_key = GLib.Marshaller.StringToPtrGStrdup (key);
-			UIntPtr native_length;
-			IntPtr error = IntPtr.Zero;
-			double raw_ret = g_key_file_get_double_list(Handle, native_group_name, native_key, out native_length, out error);
-			double ret = raw_ret;
-			GLib.Marshaller.Free (native_group_name);
-			GLib.Marshaller.Free (native_key);
-			length = (ulong) native_length;
-			if (error != IntPtr.Zero) throw new GLib.GException (error);
-			return ret;
-		}
-
-		[DllImport("libglib-2.0.dll")]
 		static extern unsafe bool g_key_file_remove_comment(IntPtr raw, IntPtr group_name, IntPtr key, out IntPtr error);
 
 		public unsafe bool RemoveComment(string group_name, string key) {
@@ -143,23 +115,6 @@
 		}
 
 		[DllImport("libglib-2.0.dll")]
-		static extern unsafe bool g_key_file_get_boolean_list(IntPtr raw, IntPtr group_name, IntPtr key, out UIntPtr length, out IntPtr error);
-
-		public unsafe bool GetBooleanList(string group_name, string key, out ulong length) {
-			IntPtr native_group_name = GLib.Marshaller.StringToPtrGStrdup (group_name);
-			IntPtr native_key = GLib.Marshaller.StringToPtrGStrdup (key);
-			UIntPtr native_length;
-			IntPtr error = IntPtr.Zero;
-			bool raw_ret = g_key_file_get_boolean_list(Handle, native_group_name, native_key, out native_length, out error);
-			bool ret = raw_ret;
-			GLib.Marshaller.Free (native_group_name);
-			GLib.Marshaller.Free (native_key);
-			length = (ulong) native_length;
-			if (error != IntPtr.Zero) throw new GLib.GException (error);
-			return ret;
-		}
-
-		[DllImport("libglib-2.0.dll")]
 		static extern bool g_key_file_has_group(IntPtr raw, IntPtr group_name);
 
 		public bool HasGroup(string group_name) {
@@ -203,12 +158,12 @@
 		}
 
 		[DllImport("libglib-2.0.dll")]
-		static extern void g_key_file_set_double_list(IntPtr raw, IntPtr group_name, IntPtr key, double[] list, UIntPtr length);
+		static extern void g_key_file_set_double_list(IntPtr raw, IntPtr group_name, IntPtr key, double[] list, UIntPtr n_list);
 
-		private void SetDoubleList(string group_name, string key, double[] list, ulong length) {
+		public void SetDoubleList(string group_name, string key, double[] list) {
 			IntPtr native_group_name = GLib.Marshaller.StringToPtrGStrdup (group_name);
 			IntPtr native_key = GLib.Marshaller.StringToPtrGStrdup (key);
-			g_key_file_set_double_list(Handle, native_group_name, native_key, list, new UIntPtr (length));
+			g_key_file_set_double_list(Handle, native_group_name, native_key, list, new UIntPtr ((ulong) (list == null ? 0 : list.Length)));
 			GLib.Marshaller.Free (native_group_name);
 			GLib.Marshaller.Free (native_key);
 		}
@@ -233,6 +188,21 @@
 		}
 
 		[DllImport("libglib-2.0.dll")]
+		static extern unsafe IntPtr g_key_file_get_keys(IntPtr raw, IntPtr group_name, out UIntPtr length, out IntPtr error);
+
+		private unsafe string[] GetKeys(string group_name, out ulong length) {
+			IntPtr native_group_name = GLib.Marshaller.StringToPtrGStrdup (group_name);
+			UIntPtr native_length;
+			IntPtr error = IntPtr.Zero;
+			IntPtr raw_ret = g_key_file_get_keys(Handle, native_group_name, out native_length, out error);
+			string[] ret = GLib.Marshaller.NullTermPtrToStringArray (raw_ret, false);
+			GLib.Marshaller.Free (native_group_name);
+			length = (ulong) native_length;
+			if (error != IntPtr.Zero) throw new GLib.GException (error);
+			return ret;
+		}
+
+		[DllImport("libglib-2.0.dll")]
 		static extern unsafe bool g_key_file_get_boolean(IntPtr raw, IntPtr group_name, IntPtr key, out IntPtr error);
 
 		public unsafe bool GetBoolean(string group_name, string key) {
@@ -286,18 +256,14 @@
 		}
 
 		[DllImport("libglib-2.0.dll")]
-		static extern unsafe IntPtr g_key_file_get_keys(IntPtr raw, IntPtr group_name, out UIntPtr length, out IntPtr error);
+		static extern void g_key_file_set_boolean_list(IntPtr raw, IntPtr group_name, IntPtr key, bool[] list, UIntPtr n_list);
 
-		private unsafe string[] GetKeys(string group_name, out ulong length) {
+		public void SetBooleanList(string group_name, string key, bool[] list) {
 			IntPtr native_group_name = GLib.Marshaller.StringToPtrGStrdup (group_name);
-			UIntPtr native_length;
-			IntPtr error = IntPtr.Zero;
-			IntPtr raw_ret = g_key_file_get_keys(Handle, native_group_name, out native_length, out error);
-			string[] ret = GLib.Marshaller.NullTermPtrToStringArray (raw_ret, false);
+			IntPtr native_key = GLib.Marshaller.StringToPtrGStrdup (key);
+			g_key_file_set_boolean_list(Handle, native_group_name, native_key, list, new UIntPtr ((ulong) (list == null ? 0 : list.Length)));
 			GLib.Marshaller.Free (native_group_name);
-			length = (ulong) native_length;
-			if (error != IntPtr.Zero) throw new GLib.GException (error);
-			return ret;
+			GLib.Marshaller.Free (native_key);
 		}
 
 		[DllImport("libglib-2.0.dll")]
@@ -342,23 +308,12 @@
 		}
 
 		[DllImport("libglib-2.0.dll")]
-		static extern void g_key_file_set_integer_list(IntPtr raw, IntPtr group_name, IntPtr key, int[] list, UIntPtr length);
-
-		private void SetIntegerList(string group_name, string key, int[] list, ulong length) {
-			IntPtr native_group_name = GLib.Marshaller.StringToPtrGStrdup (group_name);
-			IntPtr native_key = GLib.Marshaller.StringToPtrGStrdup (key);
-			g_key_file_set_integer_list(Handle, native_group_name, native_key, list, new UIntPtr (length));
-			GLib.Marshaller.Free (native_group_name);
-			GLib.Marshaller.Free (native_key);
-		}
-
-		[DllImport("libglib-2.0.dll")]
-		static extern void g_key_file_set_boolean_list(IntPtr raw, IntPtr group_name, IntPtr key, bool[] list, UIntPtr length);
+		static extern void g_key_file_set_integer_list(IntPtr raw, IntPtr group_name, IntPtr key, int[] list, UIntPtr n_list);
 
-		private void SetBooleanList(string group_name, string key, bool[] list, ulong length) {
+		public void SetIntegerList(string group_name, string key, int[] list) {
 			IntPtr native_group_name = GLib.Marshaller.StringToPtrGStrdup (group_name);
 			IntPtr native_key = GLib.Marshaller.StringToPtrGStrdup (key);
-			g_key_file_set_boolean_list(Handle, native_group_name, native_key, list, new UIntPtr (length));
+			g_key_file_set_integer_list(Handle, native_group_name, native_key, list, new UIntPtr ((ulong) (list == null ? 0 : list.Length)));
 			GLib.Marshaller.Free (native_group_name);
 			GLib.Marshaller.Free (native_key);
 		}
@@ -377,16 +332,16 @@
 		}
 
 		[DllImport("libglib-2.0.dll")]
-		static extern void g_key_file_set_string_list(IntPtr raw, IntPtr group_name, IntPtr key, IntPtr[] list, UIntPtr length);
+		static extern void g_key_file_set_string_list(IntPtr raw, IntPtr group_name, IntPtr key, IntPtr[] list, UIntPtr n_list);
 
-		private void SetStringList(string group_name, string key, string[] list, ulong length) {
+		public void SetStringList(string group_name, string key, string[] list) {
 			IntPtr native_group_name = GLib.Marshaller.StringToPtrGStrdup (group_name);
 			IntPtr native_key = GLib.Marshaller.StringToPtrGStrdup (key);
 			int cnt_list = list == null ? 0 : list.Length;
 			IntPtr[] native_list = new IntPtr [cnt_list];
 			for (int i = 0; i < cnt_list; i++)
 				native_list [i] = GLib.Marshaller.StringToPtrGStrdup (list[i]);
-			g_key_file_set_string_list(Handle, native_group_name, native_key, native_list, new UIntPtr (length));
+			g_key_file_set_string_list(Handle, native_group_name, native_key, native_list, new UIntPtr ((ulong) (list == null ? 0 : list.Length)));
 			GLib.Marshaller.Free (native_group_name);
 			GLib.Marshaller.Free (native_key);
 			for (int i = 0; i < native_list.Length; i++) {
@@ -409,31 +364,29 @@
 		}
 
 		[DllImport("libglib-2.0.dll")]
-		static extern void g_key_file_set_string(IntPtr raw, IntPtr group_name, IntPtr key, IntPtr str1ng);
+		static extern unsafe IntPtr g_key_file_get_string(IntPtr raw, IntPtr group_name, IntPtr key, out IntPtr error);
 
-		public void SetString(string group_name, string key, string str1ng) {
+		public unsafe string GetString(string group_name, string key) {
 			IntPtr native_group_name = GLib.Marshaller.StringToPtrGStrdup (group_name);
 			IntPtr native_key = GLib.Marshaller.StringToPtrGStrdup (key);
-			IntPtr native_str1ng = GLib.Marshaller.StringToPtrGStrdup (str1ng);
-			g_key_file_set_string(Handle, native_group_name, native_key, native_str1ng);
+			IntPtr error = IntPtr.Zero;
+			IntPtr raw_ret = g_key_file_get_string(Handle, native_group_name, native_key, out error);
+			string ret = GLib.Marshaller.PtrToStringGFree(raw_ret);
 			GLib.Marshaller.Free (native_group_name);
 			GLib.Marshaller.Free (native_key);
-			GLib.Marshaller.Free (native_str1ng);
+			if (error != IntPtr.Zero) throw new GLib.GException (error);
+			return ret;
 		}
 
 		[DllImport("libglib-2.0.dll")]
-		static extern unsafe double g_key_file_get_double(IntPtr raw, IntPtr group_name, IntPtr key, out IntPtr error);
+		static extern void g_key_file_set_double(IntPtr raw, IntPtr group_name, IntPtr key, double value);
 
-		public unsafe double GetDouble(string group_name, string key) {
+		public void SetDouble(string group_name, string key, double value) {
 			IntPtr native_group_name = GLib.Marshaller.StringToPtrGStrdup (group_name);
 			IntPtr native_key = GLib.Marshaller.StringToPtrGStrdup (key);
-			IntPtr error = IntPtr.Zero;
-			double raw_ret = g_key_file_get_double(Handle, native_group_name, native_key, out error);
-			double ret = raw_ret;
+			g_key_file_set_double(Handle, native_group_name, native_key, value);
 			GLib.Marshaller.Free (native_group_name);
 			GLib.Marshaller.Free (native_key);
-			if (error != IntPtr.Zero) throw new GLib.GException (error);
-			return ret;
 		}
 
 		[DllImport("libglib-2.0.dll")]
@@ -506,20 +459,16 @@
 		}
 
 		[DllImport("libglib-2.0.dll")]
-		static extern unsafe int g_key_file_get_integer_list(IntPtr raw, IntPtr group_name, IntPtr key, out UIntPtr length, out IntPtr error);
+		static extern void g_key_file_set_string(IntPtr raw, IntPtr group_name, IntPtr key, IntPtr str1ng);
 
-		public unsafe int GetIntegerList(string group_name, string key, out ulong length) {
+		public void SetString(string group_name, string key, string str1ng) {
 			IntPtr native_group_name = GLib.Marshaller.StringToPtrGStrdup (group_name);
 			IntPtr native_key = GLib.Marshaller.StringToPtrGStrdup (key);
-			UIntPtr native_length;
-			IntPtr error = IntPtr.Zero;
-			int raw_ret = g_key_file_get_integer_list(Handle, native_group_name, native_key, out native_length, out error);
-			int ret = raw_ret;
+			IntPtr native_str1ng = GLib.Marshaller.StringToPtrGStrdup (str1ng);
+			g_key_file_set_string(Handle, native_group_name, native_key, native_str1ng);
 			GLib.Marshaller.Free (native_group_name);
 			GLib.Marshaller.Free (native_key);
-			length = (ulong) native_length;
-			if (error != IntPtr.Zero) throw new GLib.GException (error);
-			return ret;
+			GLib.Marshaller.Free (native_str1ng);
 		}
 
 		[DllImport("libglib-2.0.dll")]
@@ -545,14 +494,14 @@
 		}
 
 		[DllImport("libglib-2.0.dll")]
-		static extern unsafe IntPtr g_key_file_get_string(IntPtr raw, IntPtr group_name, IntPtr key, out IntPtr error);
+		static extern unsafe double g_key_file_get_double(IntPtr raw, IntPtr group_name, IntPtr key, out IntPtr error);
 
-		public unsafe string GetString(string group_name, string key) {
+		public unsafe double GetDouble(string group_name, string key) {
 			IntPtr native_group_name = GLib.Marshaller.StringToPtrGStrdup (group_name);
 			IntPtr native_key = GLib.Marshaller.StringToPtrGStrdup (key);
 			IntPtr error = IntPtr.Zero;
-			IntPtr raw_ret = g_key_file_get_string(Handle, native_group_name, native_key, out error);
-			string ret = GLib.Marshaller.PtrToStringGFree(raw_ret);
+			double raw_ret = g_key_file_get_double(Handle, native_group_name, native_key, out error);
+			double ret = raw_ret;
 			GLib.Marshaller.Free (native_group_name);
 			GLib.Marshaller.Free (native_key);
 			if (error != IntPtr.Zero) throw new GLib.GException (error);
@@ -633,22 +582,6 @@
 		stream.Close ();
 	}
 	
-	public void SetStringList(string group_name, string key, string[] list) {
-		SetStringList (group_name, key, list, (ulong)list.Length);
-	}
-
-	public void SetBooleanList(string group_name, string key, bool[] list) {
-		SetBooleanList(group_name, key, list, (ulong)list.Length);
-	}
-	
-	public void SetIntegerList(string group_name, string key, int[] list) {
-		SetIntegerList (group_name, key, list, (ulong)list.Length);
-	}
-
-	public void SetDoubleList(string group_name, string key, double[] list) {
-		SetDoubleList (group_name, key, list, (ulong)list.Length);
-	}
-
 	public string [] GetKeys (string group_name) {
 		ulong length;
 		return GetKeys (group_name, out length);
@@ -664,21 +597,59 @@
 		return GetStringList (group_name, key, out length);
 	}
 
-//	public bool[] GetBooleanList(string group_name, string key) {
-//		ulong length;
-//		return GetBooleanList (group_anme, key, out length);
+//	[DllImport("libglib-2.0.dll")]
+//	static extern unsafe bool g_key_file_get_boolean_list(IntPtr raw, IntPtr group_name, IntPtr key, out UIntPtr length, out IntPtr error);
+//
+//	public unsafe bool GetBooleanList(string group_name, string key, out ulong length) {
+//		IntPtr native_group_name = GLib.Marshaller.StringToPtrGStrdup (group_name);
+//		IntPtr native_key = GLib.Marshaller.StringToPtrGStrdup (key);
+//		UIntPtr native_length;
+//		IntPtr error = IntPtr.Zero;
+//		bool raw_ret = g_key_file_get_boolean_list(Handle, native_group_name, native_key, out native_length, out error);
+//		bool ret = raw_ret;
+//		GLib.Marshaller.Free (native_group_name);
+//		GLib.Marshaller.Free (native_key);
+//		length = (ulong) native_length;
+//		if (error != IntPtr.Zero) throw new GLib.GException (error);
+//		return ret;
 //	}
-//	
-//	public int[] GetIntegerList(string group_name, string key) {
-//		ulong length;
-//		return GetIntegerList (group_name, key, out length);
+//
+//	[DllImport("libglib-2.0.dll")]
+//	static extern unsafe int g_key_file_get_integer_list(IntPtr raw, IntPtr group_name, IntPtr key, out UIntPtr length, out IntPtr error);
+//
+//	public unsafe int GetIntegerList(string group_name, string key, out ulong length) {
+//		IntPtr native_group_name = GLib.Marshaller.StringToPtrGStrdup (group_name);
+//		IntPtr native_key = GLib.Marshaller.StringToPtrGStrdup (key);
+//		UIntPtr native_length;
+//		IntPtr error = IntPtr.Zero;
+//		int raw_ret = g_key_file_get_integer_list(Handle, native_group_name, native_key, out native_length, out error);
+//		int ret = raw_ret;
+//		GLib.Marshaller.Free (native_group_name);
+//		GLib.Marshaller.Free (native_key);
+//		length = (ulong) native_length;
+//		if (error != IntPtr.Zero) throw new GLib.GException (error);
+//		return ret;
 //	}
 //
-//	public double[] GetDoubleList(string group_name, string key) {
-//		ulong length;
-//		return GetDoubleList (group_name, key, out length);
+//	[DllImport("libglib-2.0.dll")]
+//	static extern unsafe double g_key_file_get_double_list(IntPtr raw, IntPtr group_name, IntPtr key, out UIntPtr length, out IntPtr error);
+//
+//	public unsafe double GetDoubleList(string group_name, string key, out ulong length) {
+//		IntPtr native_group_name = GLib.Marshaller.StringToPtrGStrdup (group_name);
+//		IntPtr native_key = GLib.Marshaller.StringToPtrGStrdup (key);
+//		UIntPtr native_length;
+//		IntPtr error = IntPtr.Zero;
+//		double raw_ret = g_key_file_get_double_list(Handle, native_group_name, native_key, out native_length, out error);
+//		double ret = raw_ret;
+//		GLib.Marshaller.Free (native_group_name);
+//		GLib.Marshaller.Free (native_key);
+//		length = (ulong) native_length;
+//		if (error != IntPtr.Zero) throw new GLib.GException (error);
+//		return ret;
 //	}
 
+
+
 #endregion
 	}
 }

Modified: trunk/GKeyFile/gkeyfile-api.xml
==============================================================================
--- trunk/GKeyFile/gkeyfile-api.xml	(original)
+++ trunk/GKeyFile/gkeyfile-api.xml	Sat Dec  6 14:04:34 2008
@@ -35,7 +35,7 @@
           <parameter type="GError**" name="error" />
         </parameters>
       </method>
-      <method name="GetBooleanList" cname="g_key_file_get_boolean_list">
+      <method name="GetBooleanList" cname="g_key_file_get_boolean_list" hidden="1">
         <return-type type="gboolean*" />
         <parameters>
           <parameter type="const-gchar*" name="group_name" />
@@ -60,7 +60,7 @@
           <parameter type="GError**" name="error" />
         </parameters>
       </method>
-      <method name="GetDoubleList" cname="g_key_file_get_double_list">
+      <method name="GetDoubleList" cname="g_key_file_get_double_list" hidden="1">
         <return-type type="gdouble*" />
         <parameters>
           <parameter type="const-gchar*" name="group_name" />
@@ -83,7 +83,7 @@
           <parameter type="GError**" name="error" />
         </parameters>
       </method>
-      <method name="GetIntegerList" cname="g_key_file_get_integer_list">
+      <method name="GetIntegerList" cname="g_key_file_get_integer_list" hidden="1">
         <return-type type="gint*" />
         <parameters>
           <parameter type="const-gchar*" name="group_name" />
@@ -229,13 +229,13 @@
           <parameter type="gboolean" name="value" />
         </parameters>
       </method>
-      <method name="SetBooleanList" cname="g_key_file_set_boolean_list" accessibility="private">
+      <method name="SetBooleanList" cname="g_key_file_set_boolean_list">
         <return-type type="void" />
         <parameters>
           <parameter type="const-gchar*" name="group_name" />
           <parameter type="const-gchar*" name="key" />
           <parameter type="gboolean" array="true" name="list" />
-          <parameter type="gsize" name="length" />
+          <parameter type="gsize" name="n_list" />
         </parameters>
       </method>
       <method name="SetComment" cname="g_key_file_set_comment">
@@ -255,13 +255,13 @@
           <parameter type="gdouble" name="value" />
         </parameters>
       </method>
-      <method name="SetDoubleList" cname="g_key_file_set_double_list" accessibility="private">
+      <method name="SetDoubleList" cname="g_key_file_set_double_list">
         <return-type type="void" />
         <parameters>
           <parameter type="const-gchar*" name="group_name" />
           <parameter type="const-gchar*" name="key" />
           <parameter type="gdouble" array="true" name="list" />
-          <parameter type="gsize" name="length" />
+          <parameter type="gsize" name="n_list" />
         </parameters>
       </method>
       <method name="SetInteger" cname="g_key_file_set_integer">
@@ -272,13 +272,13 @@
           <parameter type="gint" name="value" />
         </parameters>
       </method>
-      <method name="SetIntegerList" cname="g_key_file_set_integer_list" accessibility="private">
+      <method name="SetIntegerList" cname="g_key_file_set_integer_list">
         <return-type type="void" />
         <parameters>
           <parameter type="const-gchar*" name="group_name" />
           <parameter type="const-gchar*" name="key" />
           <parameter type="gint" array="true" name="list" />
-          <parameter type="gsize" name="length" />
+          <parameter type="gsize" name="n_list" />
         </parameters>
       </method>
       <method name="SetListSeparator" cname="g_key_file_set_list_separator">
@@ -314,13 +314,13 @@
           <parameter type="const-gchar*" name="string" />
         </parameters>
       </method>
-      <method name="SetStringList" cname="g_key_file_set_string_list" accessibility="private">
+      <method name="SetStringList" cname="g_key_file_set_string_list">
         <return-type type="void" />
         <parameters>
           <parameter type="const-gchar*" name="group_name" />
           <parameter type="const-gchar*" name="key" />
           <parameter type="const-gchar*" array="true" name="list" />
-          <parameter type="gsize" name="length" />
+          <parameter type="gsize" name="n_list" />
         </parameters>
       </method>
       <method name="SetValue" cname="g_key_file_set_value">



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