// This file was generated by the Gtk# code generator.
// Any changes made will be lost if regenerated.

namespace Gnome {

	using System;
	using System.Runtime.InteropServices;

#region Autogenerated code
	public class GdkHelper {

		[DllImport("gnomeui-2", CallingConvention = CallingConvention.Cdecl)]
		static extern void gnome_gdk_pixbuf_new_from_uri_cancel(IntPtr handle);

		public static void PixbufNewFromUriCancel(Gnome.GdkPixbufAsyncHandle handle) {
			gnome_gdk_pixbuf_new_from_uri_cancel(handle == null ? IntPtr.Zero : handle.Handle);
		}

		[DllImport("gnomeui-2", CallingConvention = CallingConvention.Cdecl)]
		static extern IntPtr gnome_gdk_pixbuf_new_from_uri(IntPtr uri);

		public static Gdk.Pixbuf PixbufNewFromUri(string uri) {
			IntPtr native_uri = GLib.Marshaller.StringToPtrGStrdup (uri);
			IntPtr raw_ret = gnome_gdk_pixbuf_new_from_uri(native_uri);
			Gdk.Pixbuf ret = GLib.Object.GetObject(raw_ret) as Gdk.Pixbuf;
			GLib.Marshaller.Free (native_uri);
			return ret;
		}

		[DllImport("gnomeui-2", CallingConvention = CallingConvention.Cdecl)]
		static extern IntPtr gnome_gdk_pixbuf_new_from_uri_at_scale(IntPtr uri, int width, int height, bool preserve_aspect_ratio);

		public static Gdk.Pixbuf PixbufNewFromUriAtScale(string uri, int width, int height, bool preserve_aspect_ratio) {
			IntPtr native_uri = GLib.Marshaller.StringToPtrGStrdup (uri);
			IntPtr raw_ret = gnome_gdk_pixbuf_new_from_uri_at_scale(native_uri, width, height, preserve_aspect_ratio);
			Gdk.Pixbuf ret = GLib.Object.GetObject(raw_ret) as Gdk.Pixbuf;
			GLib.Marshaller.Free (native_uri);
			return ret;
		}

		[DllImport("gnomeui-2", CallingConvention = CallingConvention.Cdecl)]
		static extern IntPtr gnome_gdk_pixbuf_new_from_uri_async(IntPtr uri, GnomeSharp.GdkPixbufLoadCallbackNative load_callback, GnomeSharp.GdkPixbufDoneCallbackNative done_callback, IntPtr callback_data);

		public static Gnome.GdkPixbufAsyncHandle PixbufNewFromUriAsync(string uri, Gnome.GdkPixbufLoadCallback load_callback, Gnome.GdkPixbufDoneCallback done_callback) {
			IntPtr native_uri = GLib.Marshaller.StringToPtrGStrdup (uri);
			GnomeSharp.GdkPixbufLoadCallbackWrapper load_callback_wrapper = new GnomeSharp.GdkPixbufLoadCallbackWrapper (load_callback);
			GnomeSharp.GdkPixbufDoneCallbackWrapper done_callback_wrapper = new GnomeSharp.GdkPixbufDoneCallbackWrapper (done_callback);
			IntPtr raw_ret = gnome_gdk_pixbuf_new_from_uri_async(native_uri, load_callback_wrapper.NativeDelegate, done_callback_wrapper.NativeDelegate, IntPtr.Zero);
			Gnome.GdkPixbufAsyncHandle ret = raw_ret == IntPtr.Zero ? null : (Gnome.GdkPixbufAsyncHandle) GLib.Opaque.GetOpaque (raw_ret, typeof (Gnome.GdkPixbufAsyncHandle), false);
			GLib.Marshaller.Free (native_uri);
			return ret;
		}

#endregion
	}
}
