mirror of
				https://github.com/Ryujinx/GtkSharp.git
				synced 2025-11-04 08:24:56 +00:00 
			
		
		
		
	Variant: Add wrapper for g_variant_new_tuple()
This commit is contained in:
		
							parent
							
								
									b5062a8c7d
								
							
						
					
					
						commit
						24f8cede19
					
				| 
						 | 
				
			
			@ -131,6 +131,21 @@ namespace GLib {
 | 
			
		|||
			Marshaller.Free (native);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		[DllImport (Global.GLibNativeDll, CallingConvention = CallingConvention.Cdecl)]
 | 
			
		||||
		static extern IntPtr g_variant_new_tuple (IntPtr[] children, UIntPtr n_children);
 | 
			
		||||
 | 
			
		||||
		public static Variant NewTuple (Variant[] children)
 | 
			
		||||
		{
 | 
			
		||||
			if (children == null)
 | 
			
		||||
				return new Variant (g_variant_new_tuple (null, new UIntPtr (0ul)));
 | 
			
		||||
 | 
			
		||||
			IntPtr[] native = new IntPtr[children.Length];
 | 
			
		||||
			for (int i = 0; i < children.Length; i++)
 | 
			
		||||
				native[i] = children[i].Handle;
 | 
			
		||||
 | 
			
		||||
			return new Variant (g_variant_new_tuple (native, new UIntPtr ((ulong) children.Length)));
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		[DllImport (Global.GLibNativeDll, CallingConvention = CallingConvention.Cdecl)]
 | 
			
		||||
		static extern bool g_variant_get_boolean (IntPtr handle);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue