/*
 * Automatically generated, do not edit this file directly
 */

using System;
using System.Windows;
using System.Runtime.InteropServices;

namespace Mono {
	internal static partial class NativeMethods
	{
		/* moonplugin methods */
	
		[DllImport ("moonplugin")]
		// void *plugin_instance_evaluate (PluginInstance *instance, const char *code);
		public extern static IntPtr plugin_instance_evaluate (IntPtr instance, string code);

		[DllImport ("moonplugin")]
		// gint32 plugin_instance_get_actual_height (PluginInstance *instance);
		public extern static int plugin_instance_get_actual_height (IntPtr instance);

		[DllImport ("moonplugin")]
		// gint32 plugin_instance_get_actual_width (PluginInstance *instance);
		public extern static int plugin_instance_get_actual_width (IntPtr instance);

		[DllImport ("moonplugin")]
		[return: MarshalAs (UnmanagedType.U1)]
		// bool plugin_instance_get_allow_html_popup_window (PluginInstance *instance);
		public extern static bool plugin_instance_get_allow_html_popup_window (IntPtr instance);

		[DllImport ("moonplugin")]
		// void *plugin_instance_get_browser_host (PluginInstance *instance);
		public extern static IntPtr plugin_instance_get_browser_host (IntPtr instance);

		[DllImport ("moonplugin")]
		[return: MarshalAs (UnmanagedType.U1)]
		// bool plugin_instance_get_enable_html_access (PluginInstance *instance);
		public extern static bool plugin_instance_get_enable_html_access (IntPtr instance);

		[DllImport ("moonplugin", EntryPoint="plugin_instance_get_init_params")]
		// const char *plugin_instance_get_init_params (PluginInstance *instance);
		private extern static IntPtr plugin_instance_get_init_params_ (IntPtr instance);
		public static string plugin_instance_get_init_params (IntPtr instance)
		{
			IntPtr result;
			result = plugin_instance_get_init_params_ (instance);
			if (result == IntPtr.Zero)
				return null;
			string s = Marshal.PtrToStringAnsi (result);	// *copy* unmanaged string
			return s;
		}

		[DllImport ("moonplugin", EntryPoint="plugin_instance_get_source")]
		// const char *plugin_instance_get_source (PluginInstance *instance);
		private extern static IntPtr plugin_instance_get_source_ (IntPtr instance);
		public static string plugin_instance_get_source (IntPtr instance)
		{
			IntPtr result;
			result = plugin_instance_get_source_ (instance);
			if (result == IntPtr.Zero)
				return null;
			string s = Marshal.PtrToStringAnsi (result);	// *copy* unmanaged string
			return s;
		}

		[DllImport ("moonplugin", EntryPoint="plugin_instance_get_source_location")]
		// const char *plugin_instance_get_source_location (PluginInstance *instance);
		private extern static IntPtr plugin_instance_get_source_location_ (IntPtr instance);
		public static string plugin_instance_get_source_location (IntPtr instance)
		{
			IntPtr result;
			result = plugin_instance_get_source_location_ (instance);
			if (result == IntPtr.Zero)
				return null;
			string s = Marshal.PtrToStringAnsi (result);	// *copy* unmanaged string
			return s;
		}

		[DllImport ("moonplugin", EntryPoint="plugin_instance_get_source_location_original")]
		// const char *plugin_instance_get_source_location_original (PluginInstance *instance);
		private extern static IntPtr plugin_instance_get_source_location_original_ (IntPtr instance);
		public static string plugin_instance_get_source_location_original (IntPtr instance)
		{
			IntPtr result;
			result = plugin_instance_get_source_location_original_ (instance);
			if (result == IntPtr.Zero)
				return null;
			string s = Marshal.PtrToStringAnsi (result);	// *copy* unmanaged string
			return s;
		}

		[DllImport ("moonplugin", EntryPoint="plugin_instance_get_source_original")]
		// const char *plugin_instance_get_source_original (PluginInstance *instance);
		private extern static IntPtr plugin_instance_get_source_original_ (IntPtr instance);
		public static string plugin_instance_get_source_original (IntPtr instance)
		{
			IntPtr result;
			result = plugin_instance_get_source_original_ (instance);
			if (result == IntPtr.Zero)
				return null;
			string s = Marshal.PtrToStringAnsi (result);	// *copy* unmanaged string
			return s;
		}

		[DllImport ("moonplugin")]
		// Surface *plugin_instance_get_surface (PluginInstance *instance);
		public extern static IntPtr plugin_instance_get_surface (IntPtr instance);

		[DllImport ("moonplugin")]
		[return: MarshalAs (UnmanagedType.U1)]
		// bool plugin_instance_get_windowless (PluginInstance *instance);
		public extern static bool plugin_instance_get_windowless (IntPtr instance);

		[DllImport ("moonplugin")]
		// void plugin_instance_report_exception (PluginInstance *instance, char *msg, char *details, char* *stack_trace, int num_frames);
		public extern static void plugin_instance_report_exception (IntPtr instance, string msg, string details, string[] stack_trace, int num_frames);

		[DllImport ("moonplugin")]
		// NPObject *moonlight_object_to_npobject (MoonlightObject *obj);
		public extern static IntPtr moonlight_object_to_npobject (IntPtr obj);

		[DllImport ("moonplugin")]
		// MoonlightScriptableObjectObject *moonlight_scriptable_object_wrapper_create_root (PluginInstance *plugin, gpointer scriptable, InvokeDelegate invoke, SetPropertyDelegate setprop, GetPropertyDelegate getprop, EventHandlerDelegate addevent, EventHandlerDelegate removeevent);
		public extern static IntPtr moonlight_scriptable_object_wrapper_create_root (IntPtr plugin, IntPtr scriptable, InvokeDelegate invoke, SetPropertyDelegate setprop, GetPropertyDelegate getprop, EventHandlerDelegate addevent, EventHandlerDelegate removeevent);

		[DllImport ("moonplugin")]
		// MoonlightScriptableObjectObject *moonlight_scriptable_object_wrapper_create (NPObject *parent, gpointer scriptable, InvokeDelegate invoke, SetPropertyDelegate setprop, GetPropertyDelegate getprop, EventHandlerDelegate addevent, EventHandlerDelegate removeevent);
		public extern static IntPtr moonlight_scriptable_object_wrapper_create (IntPtr parent, IntPtr scriptable, InvokeDelegate invoke, SetPropertyDelegate setprop, GetPropertyDelegate getprop, EventHandlerDelegate addevent, EventHandlerDelegate removeevent);

		[DllImport ("moonplugin")]
		// void moonlight_scriptable_object_add_property (PluginInstance *plugin, MoonlightScriptableObjectObject *obj, gpointer property_handle, char *property_name, int property_type, bool can_read, bool can_write);
		public extern static void moonlight_scriptable_object_add_property (IntPtr plugin, IntPtr obj, IntPtr property_handle, string property_name, TypeCode property_type, [MarshalAs (UnmanagedType.U1)] bool can_read, [MarshalAs (UnmanagedType.U1)] bool can_write);

		[DllImport ("moonplugin")]
		// void moonlight_scriptable_object_add_event (PluginInstance *plugin, MoonlightScriptableObjectObject *obj, gpointer event_handle, char *event_name);
		public extern static void moonlight_scriptable_object_add_event (IntPtr plugin, IntPtr obj, IntPtr event_handle, string event_name);

		[DllImport ("moonplugin")]
		// void moonlight_scriptable_object_add_method (PluginInstance *plugin, MoonlightScriptableObjectObject *obj, gpointer method_handle, char *method_name, int method_return_type, int *method_parameter_types, int parameter_count);
		public extern static void moonlight_scriptable_object_add_method (IntPtr plugin, IntPtr obj, IntPtr method_handle, string method_name, TypeCode method_return_type, TypeCode[] method_parameter_types, int parameter_count);

		[DllImport ("moonplugin")]
		// void moonlight_scriptable_object_register (PluginInstance *plugin, char *name, MoonlightScriptableObjectObject *obj);
		public extern static void moonlight_scriptable_object_register (IntPtr plugin, string name, IntPtr obj);

		[DllImport ("moonplugin")]
		// void moonlight_scriptable_object_emit_event (PluginInstance *plugin, MoonlightScriptableObjectObject *obj, MoonlightScriptableObjectObject *event_args, NPObject *cb_obj);
		public extern static void moonlight_scriptable_object_emit_event (IntPtr plugin, IntPtr obj, IntPtr event_args, IntPtr cb_obj);

		[DllImport ("moonplugin")]
		[return: MarshalAs (UnmanagedType.U1)]
		// bool html_object_has_property (PluginInstance *plugin, NPObject *npobj, char *name);
		public extern static bool html_object_has_property (IntPtr plugin, IntPtr npobj, string name);

		[DllImport ("moonplugin")]
		// void html_object_get_property (PluginInstance *plugin, NPObject *npobj, char *name, Value *result);
		public extern static void html_object_get_property (IntPtr plugin, IntPtr npobj, string name, out Mono.Value result);

		[DllImport ("moonplugin")]
		// void html_object_set_property (PluginInstance *plugin, NPObject *npobj, char *name, Value *value);
		public extern static void html_object_set_property (IntPtr plugin, IntPtr npobj, string name, ref Value value);

		[DllImport ("moonplugin")]
		[return: MarshalAs (UnmanagedType.U1)]
		// bool html_object_invoke (PluginInstance *plugin, NPObject *npobj, char *name, Value *args, guint32 arg_count, Value *result);
		public extern static bool html_object_invoke (IntPtr plugin, IntPtr npobj, string name, Mono.Value[] args, uint arg_count, out Mono.Value result);

		[DllImport ("moonplugin")]
		[return: MarshalAs (UnmanagedType.U1)]
		// bool html_object_invoke_self (PluginInstance *plugin, NPObject *npobj, Value *args, guint32 arg_count, Value *result);
		public extern static bool html_object_invoke_self (IntPtr plugin, IntPtr npobj, Mono.Value[] args, uint arg_count, out Mono.Value result);

		[DllImport ("moonplugin")]
		// gpointer html_object_attach_event (PluginInstance *plugin, NPObject *npobj, char *name, callback_dom_event *cb, gpointer context);
		public extern static IntPtr html_object_attach_event (IntPtr plugin, IntPtr npobj, string name, DomEventCallback cb, IntPtr context);

		[DllImport ("moonplugin")]
		// void html_object_detach_event (PluginInstance *plugin, const char *name, gpointer listener);
		public extern static void html_object_detach_event (IntPtr plugin, string name, IntPtr listener);

		[DllImport ("moonplugin")]
		// void html_object_release (PluginInstance *plugin, NPObject *npobj);
		public extern static void html_object_release (IntPtr plugin, IntPtr npobj);

		[DllImport ("moonplugin")]
		// void html_object_retain (PluginInstance *plugin, NPObject *npobj);
		public extern static void html_object_retain (IntPtr plugin, IntPtr npobj);

	
		/* libmoon methods */
	
		[DllImport ("moon")]
		// Application *application_new ();
		public extern static IntPtr application_new ();

		[DllImport ("moon")]
		// Application *application_get_current ();
		public extern static IntPtr application_get_current ();

		[DllImport ("moon")]
		// void application_register_callbacks (Application *instance, ApplyDefaultStyleCallback apply_default_style_cb, ApplyStyleCallback apply_style_cb, GetResourceCallback get_resource_cb, ConvertKeyframeValueCallback convert_keyframe_callback);
		public extern static void application_register_callbacks (IntPtr instance, Mono.ApplyDefaultStyleCallback apply_default_style_cb, Mono.ApplyStyleCallback apply_style_cb, Mono.GetResourceCallback get_resource_cb, Mono.ConvertKeyframeValueCallback convert_keyframe_callback);

		[DllImport ("moon")]
		// void application_set_current (Application *current);
		public extern static void application_set_current (IntPtr current);

		[DllImport ("moon")]
		// ArcSegment *arc_segment_new ();
		public extern static IntPtr arc_segment_new ();

		[DllImport ("moon")]
		// AssemblyPart *assembly_part_new ();
		public extern static IntPtr assembly_part_new ();

		[DllImport ("moon")]
		// AssemblyPartCollection *assembly_part_collection_new ();
		public extern static IntPtr assembly_part_collection_new ();

		[DllImport ("moon")]
		// AudioStream *audio_stream_new (Media *media, int codec_id, int bits_per_sample, int block_align, int sample_rate, int channels, int bit_rate, gpointer extra_data, guint32 extra_data_size);
		public extern static IntPtr audio_stream_new (IntPtr media, int codec_id, int bits_per_sample, int block_align, int sample_rate, int channels, int bit_rate, IntPtr extra_data, uint extra_data_size);

		[DllImport ("moon")]
		// BackEase *back_ease_new ();
		public extern static IntPtr back_ease_new ();

		[DllImport ("moon")]
		// double back_ease_ease_in_core (BackEase *instance, double normalizedTime);
		public extern static double back_ease_ease_in_core (IntPtr instance, double normalizedTime);

		[DllImport ("moon")]
		// BeginStoryboard *begin_storyboard_new ();
		public extern static IntPtr begin_storyboard_new ();

		[DllImport ("moon")]
		// BezierSegment *bezier_segment_new ();
		public extern static IntPtr bezier_segment_new ();

		[DllImport ("moon")]
		// BitmapCache *bitmap_cache_new ();
		public extern static IntPtr bitmap_cache_new ();

		[DllImport ("moon")]
		// BitmapImage *bitmap_image_new ();
		public extern static IntPtr bitmap_image_new ();

		[DllImport ("moon")]
		// void bitmap_image_pixbuf_write (BitmapImage *instance, gpointer buffer, gint32 offset, gint32 n);
		public extern static void bitmap_image_pixbuf_write (IntPtr instance, IntPtr buffer, int offset, int n);

		[DllImport ("moon")]
		// void bitmap_image_pixmap_complete (BitmapImage *instance);
		public extern static void bitmap_image_pixmap_complete (IntPtr instance);

		[DllImport ("moon")]
		// BitmapSource *bitmap_source_new ();
		public extern static IntPtr bitmap_source_new ();

		[DllImport ("moon")]
		// gpointer bitmap_source_get_bitmap_data (BitmapSource *instance);
		public extern static IntPtr bitmap_source_get_bitmap_data (IntPtr instance);

		[DllImport ("moon")]
		// void bitmap_source_invalidate (BitmapSource *instance);
		public extern static void bitmap_source_invalidate (IntPtr instance);

		[DllImport ("moon")]
		// void bitmap_source_set_bitmap_data (BitmapSource *instance, gpointer data, bool own);
		public extern static void bitmap_source_set_bitmap_data (IntPtr instance, IntPtr data, [MarshalAs (UnmanagedType.U1)] bool own);

		[DllImport ("moon")]
		// BlurEffect *blur_effect_new ();
		public extern static IntPtr blur_effect_new ();

		[DllImport ("moon")]
		// Border *border_new ();
		public extern static IntPtr border_new ();

		[DllImport ("moon")]
		// BounceEase *bounce_ease_new ();
		public extern static IntPtr bounce_ease_new ();

		[DllImport ("moon")]
		// double bounce_ease_ease_in_core (BounceEase *instance, double normalizedTime);
		public extern static double bounce_ease_ease_in_core (IntPtr instance, double normalizedTime);

		[DllImport ("moon")]
		// Brush *brush_new ();
		public extern static IntPtr brush_new ();

		[DllImport ("moon")]
		// CacheMode *cache_mode_new ();
		public extern static IntPtr cache_mode_new ();

		[DllImport ("moon")]
		// Canvas *canvas_new ();
		public extern static IntPtr canvas_new ();

		[DllImport ("moon")]
		// CircleEase *circle_ease_new ();
		public extern static IntPtr circle_ease_new ();

		[DllImport ("moon")]
		// double circle_ease_ease_in_core (CircleEase *instance, double normalizedTime);
		public extern static double circle_ease_ease_in_core (IntPtr instance, double normalizedTime);

		[DllImport ("moon", EntryPoint="collection_add_with_error")]
		// int collection_add_with_error (Collection *instance, Value *value, MoonError *error);
		private extern static int collection_add_with_error_ (IntPtr instance, ref Value value, out MoonError error);
		public static int collection_add (IntPtr instance, ref Value value)
		{
			int result;
			MoonError error;
			result = collection_add_with_error_ (instance, ref value, out error);
			if (error.Number != 0)
				throw CreateManagedException (error);
			return result;
		}

		[DllImport ("moon")]
		[return: MarshalAs (UnmanagedType.U1)]
		// bool collection_clear (Collection *instance);
		public extern static bool collection_clear (IntPtr instance);

		[DllImport ("moon")]
		[return: MarshalAs (UnmanagedType.U1)]
		// bool collection_contains (Collection *instance, Value *value);
		public extern static bool collection_contains (IntPtr instance, ref Value value);

		[DllImport ("moon")]
		// int collection_get_count (Collection *instance);
		public extern static int collection_get_count (IntPtr instance);

		[DllImport ("moon")]
		// Type::Kind collection_get_element_type (Collection *instance);
		public extern static Kind collection_get_element_type (IntPtr instance);

		[DllImport ("moon")]
		// CollectionIterator *collection_get_iterator (Collection *instance);
		public extern static IntPtr collection_get_iterator (IntPtr instance);

		[DllImport ("moon", EntryPoint="collection_get_value_at_with_error")]
		// Value *collection_get_value_at_with_error (Collection *instance, int index, MoonError *error);
		private extern static IntPtr collection_get_value_at_with_error_ (IntPtr instance, int index, out MoonError error);
		public static IntPtr collection_get_value_at (IntPtr instance, int index)
		{
			IntPtr result;
			MoonError error;
			result = collection_get_value_at_with_error_ (instance, index, out error);
			if (error.Number != 0)
				throw CreateManagedException (error);
			return result;
		}

		[DllImport ("moon")]
		// int collection_index_of (Collection *instance, Value *value);
		public extern static int collection_index_of (IntPtr instance, ref Value value);

		[DllImport ("moon", EntryPoint="collection_insert_with_error")]
		[return: MarshalAs (UnmanagedType.U1)]
		// bool collection_insert_with_error (Collection *instance, int index, Value *value, MoonError *error);
		private extern static bool collection_insert_with_error_ (IntPtr instance, int index, ref Value value, out MoonError error);
		public static bool collection_insert (IntPtr instance, int index, ref Value value)
		{
			bool result;
			MoonError error;
			result = collection_insert_with_error_ (instance, index, ref value, out error);
			if (error.Number != 0)
				throw CreateManagedException (error);
			return result;
		}

		[DllImport ("moon")]
		[return: MarshalAs (UnmanagedType.U1)]
		// bool collection_remove (Collection *instance, Value *value);
		public extern static bool collection_remove (IntPtr instance, ref Value value);

		[DllImport ("moon", EntryPoint="collection_remove_at_with_error")]
		[return: MarshalAs (UnmanagedType.U1)]
		// bool collection_remove_at_with_error (Collection *instance, int index, MoonError *error);
		private extern static bool collection_remove_at_with_error_ (IntPtr instance, int index, out MoonError error);
		public static bool collection_remove_at (IntPtr instance, int index)
		{
			bool result;
			MoonError error;
			result = collection_remove_at_with_error_ (instance, index, out error);
			if (error.Number != 0)
				throw CreateManagedException (error);
			return result;
		}

		[DllImport ("moon", EntryPoint="collection_set_value_at_with_error")]
		[return: MarshalAs (UnmanagedType.U1)]
		// bool collection_set_value_at_with_error (Collection *instance, int index, Value *value, MoonError *error);
		private extern static bool collection_set_value_at_with_error_ (IntPtr instance, int index, ref Value value, out MoonError error);
		public static bool collection_set_value_at (IntPtr instance, int index, ref Value value)
		{
			bool result;
			MoonError error;
			result = collection_set_value_at_with_error_ (instance, index, ref value, out error);
			if (error.Number != 0)
				throw CreateManagedException (error);
			return result;
		}

		[DllImport ("moon")]
		// CollectionChangedEventArgs *collection_changed_event_args_new ();
		public extern static IntPtr collection_changed_event_args_new ();

		// This method contains types the generator didn't know about. Fix the generator (find the method 'GetManagedType' in TypeReference.cs and add the missing case) and try again.
		// [DllImport ("moon")]
		// CollectionChangedAction collection_changed_event_args_get_changed_action (CollectionChangedEventArgs *instance);
		// public extern static /* Unknown: 'CollectionChangedAction' */ collection_changed_event_args_get_changed_action (IntPtr instance);

		[DllImport ("moon")]
		// int collection_changed_event_args_get_index (CollectionChangedEventArgs *instance);
		public extern static int collection_changed_event_args_get_index (IntPtr instance);

		[DllImport ("moon")]
		// Value *collection_changed_event_args_get_new_item (CollectionChangedEventArgs *instance);
		public extern static IntPtr collection_changed_event_args_get_new_item (IntPtr instance);

		[DllImport ("moon")]
		// Value *collection_changed_event_args_get_old_item (CollectionChangedEventArgs *instance);
		public extern static IntPtr collection_changed_event_args_get_old_item (IntPtr instance);

		// This method contains types the generator didn't know about. Fix the generator (find the method 'GetManagedType' in TypeReference.cs and add the missing case) and try again.
		// [DllImport ("moon")]
		// void collection_changed_event_args_set_changed_action (CollectionChangedEventArgs *instance, CollectionChangedAction action);
		// public extern static void collection_changed_event_args_set_changed_action (IntPtr instance, /* Unknown: 'CollectionChangedAction' */ action);

		[DllImport ("moon")]
		// void collection_changed_event_args_set_index (CollectionChangedEventArgs *instance, int index);
		public extern static void collection_changed_event_args_set_index (IntPtr instance, int index);

		[DllImport ("moon")]
		// void collection_changed_event_args_set_new_item (CollectionChangedEventArgs *instance, Value *item);
		public extern static void collection_changed_event_args_set_new_item (IntPtr instance, ref Value item);

		[DllImport ("moon")]
		// void collection_changed_event_args_set_old_item (CollectionChangedEventArgs *instance, Value *item);
		public extern static void collection_changed_event_args_set_old_item (IntPtr instance, ref Value item);

		[DllImport ("moon")]
		// void collection_iterator_destroy (CollectionIterator *iterator);
		public extern static void collection_iterator_destroy (IntPtr iterator);

		[DllImport ("moon", EntryPoint="collection_iterator_get_current")]
		// Value *collection_iterator_get_current (CollectionIterator *instance, MoonError *error);
		private extern static IntPtr collection_iterator_get_current_ (IntPtr instance, out MoonError error);
		public static IntPtr collection_iterator_get_current (IntPtr instance)
		{
			IntPtr result;
			MoonError error;
			result = collection_iterator_get_current_ (instance, out error);
			if (error.Number != 0)
				throw CreateManagedException (error);
			return result;
		}

		[DllImport ("moon", EntryPoint="collection_iterator_next")]
		[return: MarshalAs (UnmanagedType.U1)]
		// bool collection_iterator_next (CollectionIterator *instance, MoonError *error);
		private extern static bool collection_iterator_next_ (IntPtr instance, out MoonError error);
		public static bool collection_iterator_next (IntPtr instance)
		{
			bool result;
			MoonError error;
			result = collection_iterator_next_ (instance, out error);
			if (error.Number != 0)
				throw CreateManagedException (error);
			return result;
		}

		[DllImport ("moon")]
		[return: MarshalAs (UnmanagedType.U1)]
		// bool collection_iterator_reset (CollectionIterator *instance);
		public extern static bool collection_iterator_reset (IntPtr instance);

		[DllImport ("moon")]
		// ColorAnimation *color_animation_new ();
		public extern static IntPtr color_animation_new ();

		[DllImport ("moon")]
		// ColorAnimationUsingKeyFrames *color_animation_using_key_frames_new ();
		public extern static IntPtr color_animation_using_key_frames_new ();

		[DllImport ("moon")]
		// ColorKeyFrame *color_key_frame_new ();
		public extern static IntPtr color_key_frame_new ();

		[DllImport ("moon")]
		// ColorKeyFrameCollection *color_key_frame_collection_new ();
		public extern static IntPtr color_key_frame_collection_new ();

		[DllImport ("moon")]
		// ColumnDefinition *column_definition_new ();
		public extern static IntPtr column_definition_new ();

		[DllImport ("moon")]
		// ColumnDefinitionCollection *column_definition_collection_new ();
		public extern static IntPtr column_definition_collection_new ();

		[DllImport ("moon")]
		// Value *content_changed_event_args_get_new_content (ContentChangedEventArgs *instance);
		public extern static IntPtr content_changed_event_args_get_new_content (IntPtr instance);

		[DllImport ("moon")]
		// Value *content_changed_event_args_get_old_content (ContentChangedEventArgs *instance);
		public extern static IntPtr content_changed_event_args_get_old_content (IntPtr instance);

		[DllImport ("moon")]
		// ContentControl *content_control_new ();
		public extern static IntPtr content_control_new ();

		[DllImport ("moon")]
		[return: MarshalAs (UnmanagedType.U1)]
		// bool content_control_get_content_sets_parent (ContentControl *instance);
		public extern static bool content_control_get_content_sets_parent (IntPtr instance);

		[DllImport ("moon")]
		// void content_control_set_content_sets_parent (ContentControl *instance, bool value);
		public extern static void content_control_set_content_sets_parent (IntPtr instance, [MarshalAs (UnmanagedType.U1)] bool value);

		[DllImport ("moon")]
		// Control *control_new ();
		public extern static IntPtr control_new ();

		[DllImport ("moon")]
		// DependencyObject *control_get_template_child (Control *instance, const char *name);
		public extern static IntPtr control_get_template_child (IntPtr instance, string name);

		[DllImport ("moon")]
		// ControlTemplate *control_template_new ();
		public extern static IntPtr control_template_new ();

		[DllImport ("moon")]
		// CubicEase *cubic_ease_new ();
		public extern static IntPtr cubic_ease_new ();

		[DllImport ("moon")]
		// double cubic_ease_ease_in_core (CubicEase *instance, double normalizedTime);
		public extern static double cubic_ease_ease_in_core (IntPtr instance, double normalizedTime);

		[DllImport ("moon")]
		// CursorPositionChangedEventArgs *cursor_position_changed_event_args_new ();
		public extern static IntPtr cursor_position_changed_event_args_new ();

		[DllImport ("moon")]
		// double cursor_position_changed_event_args_get_cursor_height (CursorPositionChangedEventArgs *instance);
		public extern static double cursor_position_changed_event_args_get_cursor_height (IntPtr instance);

		[DllImport ("moon")]
		// double cursor_position_changed_event_args_get_cursor_x (CursorPositionChangedEventArgs *instance);
		public extern static double cursor_position_changed_event_args_get_cursor_x (IntPtr instance);

		[DllImport ("moon")]
		// double cursor_position_changed_event_args_get_cursor_y (CursorPositionChangedEventArgs *instance);
		public extern static double cursor_position_changed_event_args_get_cursor_y (IntPtr instance);

		[DllImport ("moon")]
		// DataTemplate *data_template_new ();
		public extern static IntPtr data_template_new ();

		[DllImport ("moon")]
		// DeepZoomImageTileSource *deep_zoom_image_tile_source_new ();
		public extern static IntPtr deep_zoom_image_tile_source_new ();

		[DllImport ("moon")]
		// void dependency_object_add_property_change_handler (DependencyObject *instance, DependencyProperty *property, PropertyChangeHandler cb, gpointer closure);
		public extern static void dependency_object_add_property_change_handler (IntPtr instance, IntPtr property, Mono.UnmanagedPropertyChangeHandler cb, IntPtr closure);

		[DllImport ("moon", EntryPoint="dependency_object_clear_value")]
		// void dependency_object_clear_value (DependencyObject *instance, DependencyProperty *property, bool notify_listeners, MoonError *error);
		private extern static void dependency_object_clear_value_ (IntPtr instance, IntPtr property, [MarshalAs (UnmanagedType.U1)] bool notify_listeners, out MoonError error);
		public static void dependency_object_clear_value (IntPtr instance, IntPtr property, bool notify_listeners)
		{
					MoonError error;
			dependency_object_clear_value_ (instance, property, notify_listeners, out error);
			if (error.Number != 0)
				throw CreateManagedException (error);
		}

		[DllImport ("moon")]
		// DependencyObject *dependency_object_new ();
		public extern static IntPtr dependency_object_new ();

		[DllImport ("moon")]
		// DependencyObject *dependency_object_find_name (DependencyObject *instance, const char *name, Type::Kind *element_kind);
		public extern static IntPtr dependency_object_find_name (IntPtr instance, string name, out Kind element_kind);

		[DllImport ("moon", EntryPoint="dependency_object_get_name")]
		// const char *dependency_object_get_name (DependencyObject *instance);
		private extern static IntPtr dependency_object_get_name_ (IntPtr instance);
		public static string dependency_object_get_name (IntPtr instance)
		{
			IntPtr result;
			result = dependency_object_get_name_ (instance);
			if (result == IntPtr.Zero)
				return null;
			string s = Marshal.PtrToStringAnsi (result);	// *copy* unmanaged string
			return s;
		}

		[DllImport ("moon")]
		// DependencyObject *dependency_object_get_template_owner (DependencyObject *instance);
		public extern static IntPtr dependency_object_get_template_owner (IntPtr instance);

		[DllImport ("moon", EntryPoint="dependency_object_get_value_no_default_with_error")]
		// Value *dependency_object_get_value_no_default_with_error (DependencyObject *instance, DependencyProperty *property, MoonError *error);
		private extern static IntPtr dependency_object_get_value_no_default_with_error_ (IntPtr instance, IntPtr property, out MoonError error);
		public static IntPtr dependency_object_get_value_no_default (IntPtr instance, IntPtr property)
		{
			IntPtr result;
			MoonError error;
			result = dependency_object_get_value_no_default_with_error_ (instance, property, out error);
			if (error.Number != 0)
				throw CreateManagedException (error);
			return result;
		}

		[DllImport ("moon", EntryPoint="dependency_object_get_value_with_error")]
		// Value *dependency_object_get_value_with_error (DependencyObject *instance, Type::Kind whatami, DependencyProperty *property, MoonError *error);
		private extern static IntPtr dependency_object_get_value_with_error_ (IntPtr instance, Kind whatami, IntPtr property, out MoonError error);
		public static IntPtr dependency_object_get_value (IntPtr instance, Kind whatami, IntPtr property)
		{
			IntPtr result;
			MoonError error;
			result = dependency_object_get_value_with_error_ (instance, whatami, property, out error);
			if (error.Number != 0)
				throw CreateManagedException (error);
			return result;
		}

		[DllImport ("moon", EntryPoint="dependency_object_read_local_value_with_error")]
		// Value *dependency_object_read_local_value_with_error (DependencyObject *instance, DependencyProperty *property, MoonError *error);
		private extern static IntPtr dependency_object_read_local_value_with_error_ (IntPtr instance, IntPtr property, out MoonError error);
		public static IntPtr dependency_object_read_local_value (IntPtr instance, IntPtr property)
		{
			IntPtr result;
			MoonError error;
			result = dependency_object_read_local_value_with_error_ (instance, property, out error);
			if (error.Number != 0)
				throw CreateManagedException (error);
			return result;
		}

		[DllImport ("moon")]
		// void dependency_object_remove_property_change_handler (DependencyObject *instance, DependencyProperty *property, PropertyChangeHandler cb);
		public extern static void dependency_object_remove_property_change_handler (IntPtr instance, IntPtr property, Mono.UnmanagedPropertyChangeHandler cb);

		[DllImport ("moon")]
		// void dependency_object_set_name (DependencyObject *instance, const char *name);
		public extern static void dependency_object_set_name (IntPtr instance, string name);

		[DllImport ("moon", EntryPoint="dependency_object_set_parent")]
		// void dependency_object_set_parent (DependencyObject *instance, DependencyObject *parent, MoonError *error);
		private extern static void dependency_object_set_parent_ (IntPtr instance, IntPtr parent, out MoonError error);
		public static void dependency_object_set_parent (IntPtr instance, IntPtr parent)
		{
					MoonError error;
			dependency_object_set_parent_ (instance, parent, out error);
			if (error.Number != 0)
				throw CreateManagedException (error);
		}

		[DllImport ("moon")]
		// void dependency_object_set_template_owner (DependencyObject *instance, DependencyObject *value);
		public extern static void dependency_object_set_template_owner (IntPtr instance, IntPtr value);

		[DllImport ("moon", EntryPoint="dependency_object_set_value_with_error")]
		[return: MarshalAs (UnmanagedType.U1)]
		// bool dependency_object_set_value_with_error (DependencyObject *instance, DependencyProperty *property, Value *value, MoonError *error);
		private extern static bool dependency_object_set_value_with_error_ (IntPtr instance, IntPtr property, ref Value value, out MoonError error);
		public static bool dependency_object_set_value (IntPtr instance, IntPtr property, ref Value value)
		{
			bool result;
			MoonError error;
			result = dependency_object_set_value_with_error_ (instance, property, ref value, out error);
			if (error.Number != 0)
				throw CreateManagedException (error);
			return result;
		}

		[DllImport ("moon")]
		// DependencyObjectCollection *dependency_object_collection_new ();
		public extern static IntPtr dependency_object_collection_new ();

		[DllImport ("moon")]
		// Value *dependency_property_get_default_value (DependencyProperty *instance);
		public extern static IntPtr dependency_property_get_default_value (IntPtr instance);

		[DllImport ("moon")]
		// DependencyProperty *dependency_property_get_dependency_property (Type::Kind type, const char *name);
		public extern static IntPtr dependency_property_get_dependency_property (Kind type, string name);

		[DllImport ("moon")]
		// DependencyProperty *dependency_property_get_dependency_property_full (Type::Kind type, const char *name, bool inherits);
		public extern static IntPtr dependency_property_get_dependency_property_full (Kind type, string name, [MarshalAs (UnmanagedType.U1)] bool inherits);

		[DllImport ("moon", EntryPoint="dependency_property_get_name")]
		// const char *dependency_property_get_name (DependencyProperty *instance);
		private extern static IntPtr dependency_property_get_name_ (IntPtr instance);
		public static string dependency_property_get_name (IntPtr instance)
		{
			IntPtr result;
			result = dependency_property_get_name_ (instance);
			if (result == IntPtr.Zero)
				return null;
			string s = Marshal.PtrToStringAnsi (result);	// *copy* unmanaged string
			return s;
		}

		[DllImport ("moon")]
		// Type::Kind dependency_property_get_property_type (DependencyProperty *instance);
		public extern static Kind dependency_property_get_property_type (IntPtr instance);

		[DllImport ("moon")]
		[return: MarshalAs (UnmanagedType.U1)]
		// bool dependency_property_is_attached (DependencyProperty *instance);
		public extern static bool dependency_property_is_attached (IntPtr instance);

		[DllImport ("moon")]
		[return: MarshalAs (UnmanagedType.U1)]
		// bool dependency_property_is_nullable (DependencyProperty *instance);
		public extern static bool dependency_property_is_nullable (IntPtr instance);

		[DllImport ("moon")]
		[return: MarshalAs (UnmanagedType.U1)]
		// bool dependency_property_is_read_only (DependencyProperty *instance);
		public extern static bool dependency_property_is_read_only (IntPtr instance);

		[DllImport ("moon")]
		// DependencyProperty *dependency_property_register_core_property (const char *name, Type::Kind property_type, Type::Kind owner_type, Value *defaultValue, bool attached, bool read_only, PropertyChangeHandler callback);
		public extern static IntPtr dependency_property_register_core_property (string name, Kind property_type, Kind owner_type, ref Value defaultValue, [MarshalAs (UnmanagedType.U1)] bool attached, [MarshalAs (UnmanagedType.U1)] bool read_only, Mono.UnmanagedPropertyChangeHandler callback);

		[DllImport ("moon")]
		// DependencyProperty *dependency_property_register_custom_property (const char *name, Type::Kind property_type, Type::Kind owner_type, Value *defaultValue, bool attached, bool read_only, PropertyChangeHandler callback);
		public extern static IntPtr dependency_property_register_custom_property (string name, Kind property_type, Kind owner_type, ref Value defaultValue, [MarshalAs (UnmanagedType.U1)] bool attached, [MarshalAs (UnmanagedType.U1)] bool read_only, Mono.UnmanagedPropertyChangeHandler callback);

		[DllImport ("moon")]
		// void dependency_property_set_is_nullable (DependencyProperty *instance, bool value);
		public extern static void dependency_property_set_is_nullable (IntPtr instance, [MarshalAs (UnmanagedType.U1)] bool value);

		[DllImport ("moon")]
		// void dependency_property_set_property_changed_callback (DependencyProperty *instance, PropertyChangeHandler changed_callback);
		public extern static void dependency_property_set_property_changed_callback (IntPtr instance, Mono.UnmanagedPropertyChangeHandler changed_callback);

		[DllImport ("moon")]
		// Deployment *deployment_new ();
		public extern static IntPtr deployment_new ();

		[DllImport ("moon")]
		// Deployment *deployment_get_current ();
		public extern static IntPtr deployment_get_current ();

		[DllImport ("moon")]
		// Types *deployment_get_types (Deployment *instance);
		public extern static IntPtr deployment_get_types (IntPtr instance);

		[DllImport ("moon")]
		// void deployment_set_current (Deployment *value);
		public extern static void deployment_set_current (IntPtr value);

		[DllImport ("moon")]
		// void deployment_set_current_application (Deployment *instance, Application *value);
		public extern static void deployment_set_current_application (IntPtr instance, IntPtr value);

		[DllImport ("moon")]
		// void deployment_set_is_loaded_from_xap (Deployment *instance, bool flag);
		public extern static void deployment_set_is_loaded_from_xap (IntPtr instance, [MarshalAs (UnmanagedType.U1)] bool flag);

		[DllImport ("moon")]
		// DiscreteColorKeyFrame *discrete_color_key_frame_new ();
		public extern static IntPtr discrete_color_key_frame_new ();

		[DllImport ("moon")]
		// DiscreteDoubleKeyFrame *discrete_double_key_frame_new ();
		public extern static IntPtr discrete_double_key_frame_new ();

		[DllImport ("moon")]
		// DiscreteObjectKeyFrame *discrete_object_key_frame_new ();
		public extern static IntPtr discrete_object_key_frame_new ();

		[DllImport ("moon")]
		// DiscretePointKeyFrame *discrete_point_key_frame_new ();
		public extern static IntPtr discrete_point_key_frame_new ();

		[DllImport ("moon")]
		// DispatcherTimer *dispatcher_timer_new ();
		public extern static IntPtr dispatcher_timer_new ();

		[DllImport ("moon")]
		// void dispatcher_timer_start (DispatcherTimer *instance);
		public extern static void dispatcher_timer_start (IntPtr instance);

		[DllImport ("moon")]
		// void dispatcher_timer_stop (DispatcherTimer *instance);
		public extern static void dispatcher_timer_stop (IntPtr instance);

		[DllImport ("moon")]
		// DoubleAnimation *double_animation_new ();
		public extern static IntPtr double_animation_new ();

		[DllImport ("moon")]
		// DoubleAnimationUsingKeyFrames *double_animation_using_key_frames_new ();
		public extern static IntPtr double_animation_using_key_frames_new ();

		[DllImport ("moon")]
		// DoubleCollection *double_collection_new ();
		public extern static IntPtr double_collection_new ();

		[DllImport ("moon")]
		// DoubleKeyFrame *double_key_frame_new ();
		public extern static IntPtr double_key_frame_new ();

		[DllImport ("moon")]
		// DoubleKeyFrameCollection *double_key_frame_collection_new ();
		public extern static IntPtr double_key_frame_collection_new ();

		[DllImport ("moon")]
		// void *downloader_create_web_request (Downloader *instance, const char *method, const char *uri);
		public extern static IntPtr downloader_create_web_request (IntPtr instance, string method, string uri);

		[DllImport ("moon")]
		// Downloader *downloader_new ();
		public extern static IntPtr downloader_new ();

		[DllImport ("moon")]
		// void downloader_notify_failed (Downloader *instance, const char *msg);
		public extern static void downloader_notify_failed (IntPtr instance, string msg);

		[DllImport ("moon")]
		// void downloader_notify_finished (Downloader *instance, const char *final_uri);
		public extern static void downloader_notify_finished (IntPtr instance, string final_uri);

		[DllImport ("moon")]
		// void downloader_notify_size (Downloader *instance, gint64 size);
		public extern static void downloader_notify_size (IntPtr instance, long size);

		[DllImport ("moon")]
		// void downloader_set_functions (DownloaderCreateStateFunc create_state, DownloaderDestroyStateFunc destroy_state, DownloaderOpenFunc open, DownloaderSendFunc send, DownloaderAbortFunc abort, DownloaderHeaderFunc header, DownloaderBodyFunc body, DownloaderCreateWebRequestFunc request, DownloaderSetResponseHeaderCallbackFunc response_header_callback, DownloaderGetResponseFunc get_response);
		public extern static void downloader_set_functions (Mono.DownloaderCreateStateFunc create_state, Mono.DownloaderDestroyStateFunc destroy_state, Mono.DownloaderOpenFunc open, Mono.DownloaderSendFunc send, Mono.DownloaderAbortFunc abort, Mono.DownloaderHeaderFunc header, Mono.DownloaderBodyFunc body, Mono.DownloaderCreateWebRequestFunc request, Mono.DownloaderSetResponseHeaderCallbackFunc response_header_callback, Mono.DownloaderGetResponseFunc get_response);

		[DllImport ("moon")]
		// void downloader_write (Downloader *instance, void *buf, gint32 offset, gint32 n);
		public extern static void downloader_write (IntPtr instance, IntPtr buf, int offset, int n);

		[DllImport ("moon")]
		// void downloader_request_free (DownloaderRequest *instance);
		public extern static void downloader_request_free (IntPtr instance);

		[DllImport ("moon")]
		// void downloader_request_abort (DownloaderRequest *instance);
		public extern static void downloader_request_abort (IntPtr instance);

		[DllImport ("moon")]
		// DownloaderResponse *downloader_request_get_downloader_response (DownloaderRequest *instance);
		public extern static IntPtr downloader_request_get_downloader_response (IntPtr instance);

		[DllImport ("moon")]
		[return: MarshalAs (UnmanagedType.U1)]
		// bool downloader_request_get_response (DownloaderRequest *instance, DownloaderResponseStartedHandler started, DownloaderResponseDataAvailableHandler available, DownloaderResponseFinishedHandler finished, gpointer context);
		public extern static bool downloader_request_get_response (IntPtr instance, DownloaderResponseStartedDelegate started, DownloaderResponseAvailableDelegate available, DownloaderResponseFinishedDelegate finished, IntPtr context);

		[DllImport ("moon")]
		[return: MarshalAs (UnmanagedType.U1)]
		// const bool downloader_request_is_aborted (DownloaderRequest *instance);
		public extern static bool downloader_request_is_aborted (IntPtr instance);

		[DllImport ("moon")]
		// void downloader_request_set_body (DownloaderRequest *instance, void *body, int size);
		public extern static void downloader_request_set_body (IntPtr instance, byte[] body, int size);

		[DllImport ("moon")]
		// void downloader_request_set_http_header (DownloaderRequest *instance, const char *name, const char *value);
		public extern static void downloader_request_set_http_header (IntPtr instance, string name, string value);

		[DllImport ("moon")]
		// void downloader_response_free (DownloaderResponse *instance);
		public extern static void downloader_response_free (IntPtr instance);

		[DllImport ("moon")]
		// void downloader_response_abort (DownloaderResponse *instance);
		public extern static void downloader_response_abort (IntPtr instance);

		[DllImport ("moon")]
		// int downloader_response_get_response_status (DownloaderResponse *instance);
		public extern static int downloader_response_get_response_status (IntPtr instance);

		[DllImport ("moon", EntryPoint="downloader_response_get_response_status_text")]
		// const char *downloader_response_get_response_status_text (DownloaderResponse *instance);
		private extern static IntPtr downloader_response_get_response_status_text_ (IntPtr instance);
		public static string downloader_response_get_response_status_text (IntPtr instance)
		{
			IntPtr result;
			result = downloader_response_get_response_status_text_ (instance);
			if (result == IntPtr.Zero)
				return null;
			string s = Marshal.PtrToStringAnsi (result);	// *copy* unmanaged string
			return s;
		}

		[DllImport ("moon")]
		// void downloader_response_set_header_visitor (DownloaderResponse *instance, DownloaderResponseHeaderCallback visitor, gpointer context);
		public extern static void downloader_response_set_header_visitor (IntPtr instance, HeaderVisitor visitor, IntPtr context);

		[DllImport ("moon")]
		// double download_progress_event_args_get_progress (DownloadProgressEventArgs *instance);
		public extern static double download_progress_event_args_get_progress (IntPtr instance);

		[DllImport ("moon")]
		// DrawingAttributes *drawing_attributes_new ();
		public extern static IntPtr drawing_attributes_new ();

		[DllImport ("moon")]
		// DropShadowEffect *drop_shadow_effect_new ();
		public extern static IntPtr drop_shadow_effect_new ();

		[DllImport ("moon")]
		// EasingColorKeyFrame *easing_color_key_frame_new ();
		public extern static IntPtr easing_color_key_frame_new ();

		[DllImport ("moon")]
		// EasingDoubleKeyFrame *easing_double_key_frame_new ();
		public extern static IntPtr easing_double_key_frame_new ();

		[DllImport ("moon")]
		// EasingFunctionBase *easing_function_base_new ();
		public extern static IntPtr easing_function_base_new ();

		[DllImport ("moon")]
		// void easing_function_base_set_easing_function (EasingFunctionBase *instance, EasingFunction value);
		public extern static void easing_function_base_set_easing_function (IntPtr instance, Mono.EasingFunctionCallback value);

		[DllImport ("moon")]
		// EasingPointKeyFrame *easing_point_key_frame_new ();
		public extern static IntPtr easing_point_key_frame_new ();

		[DllImport ("moon")]
		// Effect *effect_new ();
		public extern static IntPtr effect_new ();

		[DllImport ("moon")]
		// double elastic_ease_ease_in_core (ElasticEase *instance, double normalizedTime);
		public extern static double elastic_ease_ease_in_core (IntPtr instance, double normalizedTime);

		[DllImport ("moon")]
		// ElasticEase *elastic_ease_new ();
		public extern static IntPtr elastic_ease_new ();

		[DllImport ("moon")]
		// Ellipse *ellipse_new ();
		public extern static IntPtr ellipse_new ();

		[DllImport ("moon")]
		// EllipseGeometry *ellipse_geometry_new ();
		public extern static IntPtr ellipse_geometry_new ();

		[DllImport ("moon")]
		// int error_event_args_get_error_code (ErrorEventArgs *instance);
		public extern static int error_event_args_get_error_code (IntPtr instance);

		[DllImport ("moon", EntryPoint="error_event_args_get_error_message")]
		// const char *error_event_args_get_error_message (ErrorEventArgs *instance);
		private extern static IntPtr error_event_args_get_error_message_ (IntPtr instance);
		public static string error_event_args_get_error_message (IntPtr instance)
		{
			IntPtr result;
			result = error_event_args_get_error_message_ (instance);
			if (result == IntPtr.Zero)
				return null;
			string s = Marshal.PtrToStringAnsi (result);	// *copy* unmanaged string
			return s;
		}

		[DllImport ("moon")]
		// int error_event_args_get_error_type (ErrorEventArgs *instance);
		public extern static int error_event_args_get_error_type (IntPtr instance);

		[DllImport ("moon")]
		// gpointer error_event_args_get_moon_error (ErrorEventArgs *instance);
		public extern static IntPtr error_event_args_get_moon_error (IntPtr instance);

		[DllImport ("moon")]
		// int event_object_add_handler (EventObject *instance, int event_id, EventHandler handler, gpointer data, GDestroyNotify data_dtor);
		public extern static int event_object_add_handler (IntPtr instance, int event_id, UnmanagedEventHandler handler, IntPtr data, IntPtr data_dtor);

		[DllImport ("moon")]
		// void event_object_add_on_event_handler (EventObject *instance, int event_id, EventHandler handler, gpointer data, GDestroyNotify data_dtor);
		public extern static void event_object_add_on_event_handler (IntPtr instance, int event_id, UnmanagedEventHandler handler, IntPtr data, IntPtr data_dtor);

		[DllImport ("moon")]
		// void event_object_add_toggle_ref_notifier (EventObject *instance, ToggleNotifyHandler tr);
		public extern static void event_object_add_toggle_ref_notifier (IntPtr instance, Mono.ToggleRef.ToggleNotifyHandler tr);

		[DllImport ("moon")]
		// int event_object_add_xaml_handler (EventObject *instance, int event_id, EventHandler handler, gpointer data, GDestroyNotify data_dtor);
		public extern static int event_object_add_xaml_handler (IntPtr instance, int event_id, UnmanagedEventHandler handler, IntPtr data, IntPtr data_dtor);

		[DllImport ("moon")]
		// void event_object_do_emit_current_context (EventObject *instance, int event_id, EventArgs *calldata);
		public extern static void event_object_do_emit_current_context (IntPtr instance, int event_id, IntPtr calldata);

		[DllImport ("moon")]
		// Type::Kind event_object_get_object_type (EventObject *instance);
		public extern static Kind event_object_get_object_type (IntPtr instance);

		[DllImport ("moon")]
		// Surface *event_object_get_surface (EventObject *instance);
		public extern static IntPtr event_object_get_surface (IntPtr instance);

		[DllImport ("moon", EntryPoint="event_object_get_type_name")]
		// const char *event_object_get_type_name (EventObject *instance);
		private extern static IntPtr event_object_get_type_name_ (IntPtr instance);
		public static string event_object_get_type_name (IntPtr instance)
		{
			IntPtr result;
			result = event_object_get_type_name_ (instance);
			if (result == IntPtr.Zero)
				return null;
			string s = Marshal.PtrToStringAnsi (result);	// *copy* unmanaged string
			return s;
		}

		[DllImport ("moon")]
		// void event_object_ref (EventObject *instance);
		public extern static void event_object_ref (IntPtr instance);

		[DllImport ("moon")]
		// int event_object_remove_handler (EventObject *instance, int event_id, EventHandler handler, gpointer data);
		public extern static int event_object_remove_handler (IntPtr instance, int event_id, UnmanagedEventHandler handler, IntPtr data);

		[DllImport ("moon")]
		// void event_object_remove_on_event_handler (EventObject *instance, int event_id, EventHandler handler, gpointer data);
		public extern static void event_object_remove_on_event_handler (IntPtr instance, int event_id, UnmanagedEventHandler handler, IntPtr data);

		[DllImport ("moon")]
		// void event_object_remove_toggle_ref_notifier (EventObject *instance);
		public extern static void event_object_remove_toggle_ref_notifier (IntPtr instance);

		[DllImport ("moon")]
		// void event_object_set_object_type (EventObject *instance, Type::Kind value);
		public extern static void event_object_set_object_type (IntPtr instance, Kind value);

		[DllImport ("moon")]
		// void event_object_unref (EventObject *instance);
		public extern static void event_object_unref (IntPtr instance);

		[DllImport ("moon")]
		// EventTrigger *event_trigger_new ();
		public extern static IntPtr event_trigger_new ();

		[DllImport ("moon")]
		// double exponential_ease_ease_in_core (ExponentialEase *instance, double normalizedTime);
		public extern static double exponential_ease_ease_in_core (IntPtr instance, double normalizedTime);

		[DllImport ("moon")]
		// ExponentialEase *exponential_ease_new ();
		public extern static IntPtr exponential_ease_new ();

		[DllImport ("moon")]
		// ExtensionPart *extension_part_new ();
		public extern static IntPtr extension_part_new ();

		[DllImport ("moon")]
		// gint32 external_demuxer_add_stream (ExternalDemuxer *instance, IMediaStream *stream);
		public extern static int external_demuxer_add_stream (IntPtr instance, IntPtr stream);

		[DllImport ("moon")]
		// void external_demuxer_clear_callbacks (ExternalDemuxer *instance);
		public extern static void external_demuxer_clear_callbacks (IntPtr instance);

		[DllImport ("moon")]
		// void external_demuxer_set_can_seek (ExternalDemuxer *instance, bool value);
		public extern static void external_demuxer_set_can_seek (IntPtr instance, [MarshalAs (UnmanagedType.U1)] bool value);

		[DllImport ("moon")]
		// ExternalPart *external_part_new ();
		public extern static IntPtr external_part_new ();

		[DllImport ("moon")]
		// ExternalPartCollection *external_part_collection_new ();
		public extern static IntPtr external_part_collection_new ();

		[DllImport ("moon")]
		[return: MarshalAs (UnmanagedType.U1)]
		// bool framework_element_apply_template (FrameworkElement *instance);
		public extern static bool framework_element_apply_template (IntPtr instance);

		[DllImport ("moon")]
		// Size framework_element_arrange_override (FrameworkElement *instance, Size finalSize);
		public extern static Size framework_element_arrange_override (IntPtr instance, Size finalSize);

		[DllImport ("moon")]
		// FrameworkElement *framework_element_new ();
		public extern static IntPtr framework_element_new ();

		[DllImport ("moon")]
		// DependencyObject *framework_element_get_logical_parent (FrameworkElement *instance);
		public extern static IntPtr framework_element_get_logical_parent (IntPtr instance);

		[DllImport ("moon")]
		// Size framework_element_measure_override (FrameworkElement *instance, Size availableSize);
		public extern static Size framework_element_measure_override (IntPtr instance, Size availableSize);

		[DllImport ("moon")]
		// void framework_element_register_managed_overrides (FrameworkElement *instance, MeasureOverrideCallback measure_cb, ArrangeOverrideCallback arrange_cb, GetDefaultTemplateCallback get_default_template_cb, LoadedCallback loaded_cb);
		public extern static void framework_element_register_managed_overrides (IntPtr instance, Mono.MeasureOverrideCallback measure_cb, Mono.ArrangeOverrideCallback arrange_cb, Mono.GetDefaultTemplateCallback get_default_template_cb, Mono.LoadedCallback loaded_cb);

		[DllImport ("moon")]
		// void framework_element_set_default_style (FrameworkElement *instance, Style *value);
		public extern static void framework_element_set_default_style (IntPtr instance, IntPtr value);

		[DllImport ("moon", EntryPoint="framework_element_set_logical_parent")]
		// void framework_element_set_logical_parent (FrameworkElement *instance, DependencyObject *logical_parent, MoonError *error);
		private extern static void framework_element_set_logical_parent_ (IntPtr instance, IntPtr logical_parent, out MoonError error);
		public static void framework_element_set_logical_parent (IntPtr instance, IntPtr logical_parent)
		{
					MoonError error;
			framework_element_set_logical_parent_ (instance, logical_parent, out error);
			if (error.Number != 0)
				throw CreateManagedException (error);
		}

		[DllImport ("moon")]
		// FrameworkTemplate *framework_template_new ();
		public extern static IntPtr framework_template_new ();

		[DllImport ("moon")]
		// DependencyObject *framework_template_get_visual_tree (FrameworkTemplate *instance, FrameworkElement *templateBindingSource);
		public extern static IntPtr framework_template_get_visual_tree (IntPtr instance, IntPtr templateBindingSource);

		[DllImport ("moon")]
		// GeneralTransform *general_transform_new ();
		public extern static IntPtr general_transform_new ();

		[DllImport ("moon")]
		// Matrix *general_transform_get_matrix (GeneralTransform *instance);
		public extern static IntPtr general_transform_get_matrix (IntPtr instance);

		[DllImport ("moon")]
		// Geometry *geometry_new ();
		public extern static IntPtr geometry_new ();

		[DllImport ("moon")]
		// Rect geometry_get_bounds (Geometry *instance);
		public extern static Rect geometry_get_bounds (IntPtr instance);

		[DllImport ("moon")]
		// GeometryCollection *geometry_collection_new ();
		public extern static IntPtr geometry_collection_new ();

		[DllImport ("moon")]
		// GeometryGroup *geometry_group_new ();
		public extern static IntPtr geometry_group_new ();

		[DllImport ("moon")]
		// Glyphs *glyphs_new ();
		public extern static IntPtr glyphs_new ();

		[DllImport ("moon")]
		// GradientBrush *gradient_brush_new ();
		public extern static IntPtr gradient_brush_new ();

		[DllImport ("moon")]
		// GradientStop *gradient_stop_new ();
		public extern static IntPtr gradient_stop_new ();

		[DllImport ("moon")]
		// GradientStopCollection *gradient_stop_collection_new ();
		public extern static IntPtr gradient_stop_collection_new ();

		[DllImport ("moon")]
		// Grid *grid_new ();
		public extern static IntPtr grid_new ();

		[DllImport ("moon")]
		// HitTestCollection *hit_test_collection_new ();
		public extern static IntPtr hit_test_collection_new ();

		[DllImport ("moon")]
		// Icon *icon_new ();
		public extern static IntPtr icon_new ();

		[DllImport ("moon")]
		// IconCollection *icon_collection_new ();
		public extern static IntPtr icon_collection_new ();

		[DllImport ("moon")]
		// Image *image_new ();
		public extern static IntPtr image_new ();

		[DllImport ("moon")]
		// void image_set_source (Image *instance, ImageSource *source);
		public extern static void image_set_source (IntPtr instance, IntPtr source);

		[DllImport ("moon")]
		// ImageBrush *image_brush_new ();
		public extern static IntPtr image_brush_new ();

		[DllImport ("moon")]
		// ImageSource *image_source_new ();
		public extern static IntPtr image_source_new ();

		// This method contains types the generator didn't know about. Fix the generator (find the method 'GetManagedType' in TypeReference.cs and add the missing case) and try again.
		// [DllImport ("moon")]
		// void imedia_demuxer_report_get_diagnostic_completed (IMediaDemuxer *instance, MediaStreamSourceDiagnosticKind diagnosticKind, gint64 diagnosticValue);
		// public extern static void imedia_demuxer_report_get_diagnostic_completed (IntPtr instance, /* Unknown: 'MediaStreamSourceDiagnosticKind' */ diagnosticKind, long diagnosticValue);

		[DllImport ("moon")]
		// void imedia_demuxer_report_get_frame_completed (IMediaDemuxer *instance, MediaFrame *frame);
		public extern static void imedia_demuxer_report_get_frame_completed (IntPtr instance, IntPtr frame);

		[DllImport ("moon")]
		// void imedia_demuxer_report_get_frame_progress (IMediaDemuxer *instance, double bufferingProgress);
		public extern static void imedia_demuxer_report_get_frame_progress (IntPtr instance, double bufferingProgress);

		[DllImport ("moon")]
		// void imedia_demuxer_report_open_demuxer_completed (IMediaDemuxer *instance);
		public extern static void imedia_demuxer_report_open_demuxer_completed (IntPtr instance);

		[DllImport ("moon")]
		// void imedia_demuxer_report_seek_completed (IMediaDemuxer *instance, guint64 pts);
		public extern static void imedia_demuxer_report_seek_completed (IntPtr instance, ulong pts);

		[DllImport ("moon")]
		// void imedia_demuxer_report_switch_media_stream_completed (IMediaDemuxer *instance, IMediaStream *stream);
		public extern static void imedia_demuxer_report_switch_media_stream_completed (IntPtr instance, IntPtr stream);

		[DllImport ("moon")]
		// void imedia_demuxer_set_is_drm (IMediaDemuxer *instance, bool value);
		public extern static void imedia_demuxer_set_is_drm (IntPtr instance, [MarshalAs (UnmanagedType.U1)] bool value);

		[DllImport ("moon")]
		// Media *imedia_object_get_media_reffed (IMediaObject *instance);
		public extern static IntPtr imedia_object_get_media_reffed (IntPtr instance);

		[DllImport ("moon")]
		// InkPresenter *ink_presenter_new ();
		public extern static IntPtr ink_presenter_new ();

		[DllImport ("moon")]
		// Inline *inline_new ();
		public extern static IntPtr inline_new ();

		[DllImport ("moon")]
		// InlineCollection *inline_collection_new ();
		public extern static IntPtr inline_collection_new ();

		[DllImport ("moon")]
		// InputMethod *input_method_new ();
		public extern static IntPtr input_method_new ();

		[DllImport ("moon")]
		// ItemCollection *item_collection_new ();
		public extern static IntPtr item_collection_new ();

		[DllImport ("moon")]
		// ModifierKeys keyboard_get_modifiers ();
		public extern static int keyboard_get_modifiers ();

		[DllImport ("moon")]
		// int key_event_args_get_key (KeyEventArgs *instance);
		public extern static int key_event_args_get_key (IntPtr instance);

		[DllImport ("moon")]
		// int key_event_args_get_platform_key_code (KeyEventArgs *instance);
		public extern static int key_event_args_get_platform_key_code (IntPtr instance);

		[DllImport ("moon")]
		// KeyEventArgs *key_event_args_new ();
		public extern static IntPtr key_event_args_new ();

		[DllImport ("moon")]
		// KeyFrameCollection *key_frame_collection_new ();
		public extern static IntPtr key_frame_collection_new ();

		[DllImport ("moon")]
		// KeySpline *key_spline_new ();
		public extern static IntPtr key_spline_new ();

		[DllImport ("moon")]
		// Line *line_new ();
		public extern static IntPtr line_new ();

		[DllImport ("moon")]
		// LinearColorKeyFrame *linear_color_key_frame_new ();
		public extern static IntPtr linear_color_key_frame_new ();

		[DllImport ("moon")]
		// LinearDoubleKeyFrame *linear_double_key_frame_new ();
		public extern static IntPtr linear_double_key_frame_new ();

		[DllImport ("moon")]
		// LinearGradientBrush *linear_gradient_brush_new ();
		public extern static IntPtr linear_gradient_brush_new ();

		[DllImport ("moon")]
		// LinearPointKeyFrame *linear_point_key_frame_new ();
		public extern static IntPtr linear_point_key_frame_new ();

		[DllImport ("moon")]
		// LineBreak *line_break_new ();
		public extern static IntPtr line_break_new ();

		[DllImport ("moon")]
		// LineGeometry *line_geometry_new ();
		public extern static IntPtr line_geometry_new ();

		[DllImport ("moon")]
		// LineSegment *line_segment_new ();
		public extern static IntPtr line_segment_new ();

		[DllImport ("moon")]
		// LogReadyRoutedEventArgs *log_ready_routed_event_args_new ();
		public extern static IntPtr log_ready_routed_event_args_new ();

		[DllImport ("moon")]
		// cairo_matrix_t *matrix_get_matrix_values (Matrix *instance);
		public extern static IntPtr matrix_get_matrix_values (IntPtr instance);

		[DllImport ("moon")]
		// Matrix *matrix_new ();
		public extern static IntPtr matrix_new ();

		[DllImport ("moon")]
		// gpointer matrix3_d_get_matrix_values (Matrix3D *instance);
		public extern static IntPtr matrix3_d_get_matrix_values (IntPtr instance);

		[DllImport ("moon")]
		// Matrix3D *matrix3_d_new ();
		public extern static IntPtr matrix3_d_new ();

		[DllImport ("moon")]
		// Matrix3DProjection *matrix3_dprojection_new ();
		public extern static IntPtr matrix3_dprojection_new ();

		[DllImport ("moon")]
		// MatrixTransform *matrix_transform_new ();
		public extern static IntPtr matrix_transform_new ();

		[DllImport ("moon")]
		// MediaAttribute *media_attribute_new ();
		public extern static IntPtr media_attribute_new ();

		[DllImport ("moon")]
		// MediaAttribute *media_attribute_collection_get_item_by_name (MediaAttributeCollection *instance, const char *name);
		public extern static IntPtr media_attribute_collection_get_item_by_name (IntPtr instance, string name);

		[DllImport ("moon")]
		// MediaAttributeCollection *media_attribute_collection_new ();
		public extern static IntPtr media_attribute_collection_new ();

		[DllImport ("moon")]
		// MediaBase *media_base_new ();
		public extern static IntPtr media_base_new ();

		[DllImport ("moon")]
		// void media_base_set_source (MediaBase *instance, const char *uri);
		public extern static void media_base_set_source (IntPtr instance, string uri);

		[DllImport ("moon")]
		// MediaElement *media_element_new ();
		public extern static IntPtr media_element_new ();

		[DllImport ("moon")]
		// void media_element_pause (MediaElement *instance);
		public extern static void media_element_pause (IntPtr instance);

		[DllImport ("moon")]
		// void media_element_play (MediaElement *instance);
		public extern static void media_element_play (IntPtr instance);

		[DllImport ("moon")]
		// void media_element_report_error_occurred (MediaElement *instance, const char *args);
		public extern static void media_element_report_error_occurred (IntPtr instance, string args);

		[DllImport ("moon")]
		// IMediaDemuxer *media_element_set_demuxer_source (MediaElement *instance, void *context, CloseDemuxerCallback close_demuxer, GetDiagnosticAsyncCallback get_diagnostic, GetFrameAsyncCallback get_sample, OpenDemuxerAsyncCallback open_demuxer, SeekAsyncCallback seek, SwitchMediaStreamAsyncCallback switch_media_stream);
		public extern static IntPtr media_element_set_demuxer_source (IntPtr instance, IntPtr context, System.Windows.Media.MediaStreamSource.CloseDemuxerDelegate close_demuxer, System.Windows.Media.MediaStreamSource.GetDiagnosticAsyncDelegate get_diagnostic, System.Windows.Media.MediaStreamSource.GetFrameAsyncDelegate get_sample, System.Windows.Media.MediaStreamSource.OpenDemuxerAsyncDelegate open_demuxer, System.Windows.Media.MediaStreamSource.SeekAsyncDelegate seek, System.Windows.Media.MediaStreamSource.SwitchMediaStreamAsyncDelegate switch_media_stream);

		[DllImport ("moon")]
		// void media_element_set_stream_source (MediaElement *instance, ManagedStreamCallbacks *stream);
		public extern static void media_element_set_stream_source (IntPtr instance, ref ManagedStreamCallbacks stream);

		[DllImport ("moon")]
		// void media_element_stop (MediaElement *instance);
		public extern static void media_element_stop (IntPtr instance);

		[DllImport ("moon")]
		// MediaFrame *media_frame_new (IMediaStream *stream, guint8 *buffer, guint32 buflen, guint64 pts, bool keyframe);
		public extern static IntPtr media_frame_new (IntPtr stream, IntPtr buffer, uint buflen, ulong pts, [MarshalAs (UnmanagedType.U1)] bool keyframe);

		[DllImport ("moon")]
		[return: MarshalAs (UnmanagedType.U1)]
		// bool moon_window_get_transparent (MoonWindow *instance);
		public extern static bool moon_window_get_transparent (IntPtr instance);

		[DllImport ("moon")]
		// void moon_window_set_transparent (MoonWindow *instance, bool flag);
		public extern static void moon_window_set_transparent (IntPtr instance, [MarshalAs (UnmanagedType.U1)] bool flag);

		[DllImport ("moon")]
		// void *moon_window_gtk_get_native_widget (MoonWindowGtk *instance);
		public extern static IntPtr moon_window_gtk_get_native_widget (IntPtr instance);

		[DllImport ("moon")]
		// MoonWindowGtk *moon_window_gtk_new (bool fullscreen, int w, int h, MoonWindow *parent, Surface *surface);
		public extern static IntPtr moon_window_gtk_new ([MarshalAs (UnmanagedType.U1)] bool fullscreen, int w, int h, IntPtr parent, IntPtr surface);

		[DllImport ("moon")]
		// MouseButtonEventArgs *mouse_button_event_args_new ();
		public extern static IntPtr mouse_button_event_args_new ();

		[DllImport ("moon")]
		// void mouse_event_args_get_position (MouseEventArgs *instance, UIElement *relative_to, double *x, double *y);
		public extern static void mouse_event_args_get_position (IntPtr instance, IntPtr relative_to, out double x, out double y);

		[DllImport ("moon")]
		// StylusInfo *mouse_event_args_get_stylus_info (MouseEventArgs *instance);
		public extern static IntPtr mouse_event_args_get_stylus_info (IntPtr instance);

		[DllImport ("moon")]
		// StylusPointCollection *mouse_event_args_get_stylus_points (MouseEventArgs *instance, UIElement *ink_presenter);
		public extern static IntPtr mouse_event_args_get_stylus_points (IntPtr instance, IntPtr ink_presenter);

		[DllImport ("moon")]
		// MouseEventArgs *mouse_event_args_new ();
		public extern static IntPtr mouse_event_args_new ();

		[DllImport ("moon")]
		// int mouse_wheel_event_args_get_wheel_delta (MouseWheelEventArgs *instance);
		public extern static int mouse_wheel_event_args_get_wheel_delta (IntPtr instance);

		[DllImport ("moon")]
		// MouseWheelEventArgs *mouse_wheel_event_args_new ();
		public extern static IntPtr mouse_wheel_event_args_new ();

		[DllImport ("moon")]
		// Point multi_scale_image_element_to_logical_point (MultiScaleImage *instance, Point elementPoint);
		public extern static Point multi_scale_image_element_to_logical_point (IntPtr instance, Point elementPoint);

		[DllImport ("moon")]
		// Point multi_scale_image_logical_to_element_point (MultiScaleImage *instance, Point logicalPoint);
		public extern static Point multi_scale_image_logical_to_element_point (IntPtr instance, Point logicalPoint);

		[DllImport ("moon")]
		// MultiScaleImage *multi_scale_image_new ();
		public extern static IntPtr multi_scale_image_new ();

		[DllImport ("moon")]
		// void multi_scale_image_zoom_about_logical_point (MultiScaleImage *instance, double zoomIncrementFactor, double zoomCenterLogicalX, double zoomCenterLogicalY);
		public extern static void multi_scale_image_zoom_about_logical_point (IntPtr instance, double zoomIncrementFactor, double zoomCenterLogicalX, double zoomCenterLogicalY);

		[DllImport ("moon")]
		// MultiScaleSubImage *multi_scale_sub_image_new ();
		public extern static IntPtr multi_scale_sub_image_new ();

		[DllImport ("moon")]
		// MultiScaleSubImageCollection *multi_scale_sub_image_collection_new ();
		public extern static IntPtr multi_scale_sub_image_collection_new ();

		[DllImport ("moon")]
		// void multi_scale_tile_source_invalidate_tile_layer (MultiScaleTileSource *instance, int level, int tilePositionX, int tilePositionY, int tileLayer);
		public extern static void multi_scale_tile_source_invalidate_tile_layer (IntPtr instance, int level, int tilePositionX, int tilePositionY, int tileLayer);

		[DllImport ("moon")]
		// MultiScaleTileSource *multi_scale_tile_source_new ();
		public extern static IntPtr multi_scale_tile_source_new ();

		[DllImport ("moon")]
		// void multi_scale_tile_source_set_image_uri_func (MultiScaleTileSource *instance, get_image_uri_func func);
		public extern static void multi_scale_tile_source_set_image_uri_func (IntPtr instance, Mono.ImageUriFunc func);

		[DllImport ("moon")]
		// ObjectAnimationUsingKeyFrames *object_animation_using_key_frames_new ();
		public extern static IntPtr object_animation_using_key_frames_new ();

		[DllImport ("moon")]
		// ObjectKeyFrame *object_key_frame_new ();
		public extern static IntPtr object_key_frame_new ();

		[DllImport ("moon")]
		// ObjectKeyFrameCollection *object_key_frame_collection_new ();
		public extern static IntPtr object_key_frame_collection_new ();

		[DllImport ("moon")]
		// OutOfBrowserSettings *out_of_browser_settings_new ();
		public extern static IntPtr out_of_browser_settings_new ();

		[DllImport ("moon")]
		// Panel *panel_new ();
		public extern static IntPtr panel_new ();

		[DllImport ("moon")]
		// ParallelTimeline *parallel_timeline_new ();
		public extern static IntPtr parallel_timeline_new ();

		[DllImport ("moon")]
		// PasswordBox *password_box_new ();
		public extern static IntPtr password_box_new ();

		[DllImport ("moon")]
		// Path *path_new ();
		public extern static IntPtr path_new ();

		[DllImport ("moon")]
		// PathFigure *path_figure_new ();
		public extern static IntPtr path_figure_new ();

		[DllImport ("moon")]
		// PathFigureCollection *path_figure_collection_new ();
		public extern static IntPtr path_figure_collection_new ();

		[DllImport ("moon")]
		// PathGeometry *path_geometry_new ();
		public extern static IntPtr path_geometry_new ();

		[DllImport ("moon")]
		// PathSegment *path_segment_new ();
		public extern static IntPtr path_segment_new ();

		[DllImport ("moon")]
		// PathSegmentCollection *path_segment_collection_new ();
		public extern static IntPtr path_segment_collection_new ();

		[DllImport ("moon")]
		// PixelShader *pixel_shader_new ();
		public extern static IntPtr pixel_shader_new ();

		[DllImport ("moon")]
		// PlaneProjection *plane_projection_new ();
		public extern static IntPtr plane_projection_new ();

		[DllImport ("moon")]
		// PointAnimation *point_animation_new ();
		public extern static IntPtr point_animation_new ();

		[DllImport ("moon")]
		// PointAnimationUsingKeyFrames *point_animation_using_key_frames_new ();
		public extern static IntPtr point_animation_using_key_frames_new ();

		[DllImport ("moon")]
		// PointCollection *point_collection_new ();
		public extern static IntPtr point_collection_new ();

		[DllImport ("moon")]
		// PointKeyFrame *point_key_frame_new ();
		public extern static IntPtr point_key_frame_new ();

		[DllImport ("moon")]
		// PointKeyFrameCollection *point_key_frame_collection_new ();
		public extern static IntPtr point_key_frame_collection_new ();

		[DllImport ("moon")]
		// PolyBezierSegment *poly_bezier_segment_new ();
		public extern static IntPtr poly_bezier_segment_new ();

		[DllImport ("moon")]
		// Polygon *polygon_new ();
		public extern static IntPtr polygon_new ();

		[DllImport ("moon")]
		// Polyline *polyline_new ();
		public extern static IntPtr polyline_new ();

		[DllImport ("moon")]
		// PolyLineSegment *poly_line_segment_new ();
		public extern static IntPtr poly_line_segment_new ();

		[DllImport ("moon")]
		// PolyQuadraticBezierSegment *poly_quadratic_bezier_segment_new ();
		public extern static IntPtr poly_quadratic_bezier_segment_new ();

		[DllImport ("moon")]
		// Popup *popup_new ();
		public extern static IntPtr popup_new ();

		[DllImport ("moon")]
		// double power_ease_ease_in_core (PowerEase *instance, double normalizedTime);
		public extern static double power_ease_ease_in_core (IntPtr instance, double normalizedTime);

		[DllImport ("moon")]
		// PowerEase *power_ease_new ();
		public extern static IntPtr power_ease_new ();

		[DllImport ("moon")]
		// Projection *projection_new ();
		public extern static IntPtr projection_new ();

		[DllImport ("moon")]
		// int property_changed_event_args_get_id (PropertyChangedEventArgs *instance);
		public extern static int property_changed_event_args_get_id (IntPtr instance);

		[DllImport ("moon")]
		// Value *property_changed_event_args_get_new_value (PropertyChangedEventArgs *instance);
		public extern static IntPtr property_changed_event_args_get_new_value (IntPtr instance);

		[DllImport ("moon")]
		// Value *property_changed_event_args_get_old_value (PropertyChangedEventArgs *instance);
		public extern static IntPtr property_changed_event_args_get_old_value (IntPtr instance);

		[DllImport ("moon")]
		// DependencyProperty *property_changed_event_args_get_property (PropertyChangedEventArgs *instance);
		public extern static IntPtr property_changed_event_args_get_property (IntPtr instance);

		[DllImport ("moon")]
		// QuadraticBezierSegment *quadratic_bezier_segment_new ();
		public extern static IntPtr quadratic_bezier_segment_new ();

		[DllImport ("moon")]
		// double quadratic_ease_ease_in_core (QuadraticEase *instance, double normalizedTime);
		public extern static double quadratic_ease_ease_in_core (IntPtr instance, double normalizedTime);

		[DllImport ("moon")]
		// QuadraticEase *quadratic_ease_new ();
		public extern static IntPtr quadratic_ease_new ();

		[DllImport ("moon")]
		// double quartic_ease_ease_in_core (QuarticEase *instance, double normalizedTime);
		public extern static double quartic_ease_ease_in_core (IntPtr instance, double normalizedTime);

		[DllImport ("moon")]
		// QuarticEase *quartic_ease_new ();
		public extern static IntPtr quartic_ease_new ();

		[DllImport ("moon")]
		// double quintic_ease_ease_in_core (QuinticEase *instance, double normalizedTime);
		public extern static double quintic_ease_ease_in_core (IntPtr instance, double normalizedTime);

		[DllImport ("moon")]
		// QuinticEase *quintic_ease_new ();
		public extern static IntPtr quintic_ease_new ();

		[DllImport ("moon")]
		// RadialGradientBrush *radial_gradient_brush_new ();
		public extern static IntPtr radial_gradient_brush_new ();

		[DllImport ("moon")]
		// Rectangle *rectangle_new ();
		public extern static IntPtr rectangle_new ();

		[DllImport ("moon")]
		// RectangleGeometry *rectangle_geometry_new ();
		public extern static IntPtr rectangle_geometry_new ();

		[DllImport ("moon")]
		// TimeSpan rendering_event_args_get_rendering_time (RenderingEventArgs *instance);
		public extern static long rendering_event_args_get_rendering_time (IntPtr instance);

		[DllImport ("moon", EntryPoint="resource_dictionary_add_with_error")]
		[return: MarshalAs (UnmanagedType.U1)]
		// bool resource_dictionary_add_with_error (ResourceDictionary *instance, const char *key, Value *value, MoonError *error);
		private extern static bool resource_dictionary_add_with_error_ (IntPtr instance, string key, ref Value value, out MoonError error);
		public static bool resource_dictionary_add (IntPtr instance, string key, ref Value value)
		{
			bool result;
			MoonError error;
			result = resource_dictionary_add_with_error_ (instance, key, ref value, out error);
			if (error.Number != 0)
				throw CreateManagedException (error);
			return result;
		}

		[DllImport ("moon")]
		[return: MarshalAs (UnmanagedType.U1)]
		// bool resource_dictionary_clear (ResourceDictionary *instance);
		public extern static bool resource_dictionary_clear (IntPtr instance);

		[DllImport ("moon")]
		[return: MarshalAs (UnmanagedType.U1)]
		// bool resource_dictionary_contains_key (ResourceDictionary *instance, const char *key);
		public extern static bool resource_dictionary_contains_key (IntPtr instance, string key);

		[DllImport ("moon")]
		// Value *resource_dictionary_get (ResourceDictionary *instance, const char *key, bool *exists);
		public extern static IntPtr resource_dictionary_get (IntPtr instance, string key, [MarshalAs (UnmanagedType.U1)] out bool exists);

		[DllImport ("moon")]
		[return: MarshalAs (UnmanagedType.U1)]
		// bool resource_dictionary_remove (ResourceDictionary *instance, const char *key);
		public extern static bool resource_dictionary_remove (IntPtr instance, string key);

		[DllImport ("moon")]
		// ResourceDictionary *resource_dictionary_new ();
		public extern static IntPtr resource_dictionary_new ();

		[DllImport ("moon")]
		[return: MarshalAs (UnmanagedType.U1)]
		// bool resource_dictionary_set (ResourceDictionary *instance, const char *key, Value *value);
		public extern static bool resource_dictionary_set (IntPtr instance, string key, ref Value value);

		[DllImport ("moon")]
		// ResourceDictionaryCollection *resource_dictionary_collection_new ();
		public extern static IntPtr resource_dictionary_collection_new ();

		[DllImport ("moon", EntryPoint="resource_dictionary_iterator_get_current_key")]
		// const char *resource_dictionary_iterator_get_current_key (ResourceDictionaryIterator *instance, MoonError *error);
		private extern static IntPtr resource_dictionary_iterator_get_current_key_ (IntPtr instance, out MoonError error);
		public static string resource_dictionary_iterator_get_current_key (IntPtr instance)
		{
			IntPtr result;
			MoonError error;
			result = resource_dictionary_iterator_get_current_key_ (instance, out error);
			if (error.Number != 0)
				throw CreateManagedException (error);
			if (result == IntPtr.Zero)
				return null;
			string s = Marshal.PtrToStringAnsi (result);	// *copy* unmanaged string
			return s;
		}

		[DllImport ("moon")]
		// RotateTransform *rotate_transform_new ();
		public extern static IntPtr rotate_transform_new ();

		[DllImport ("moon")]
		[return: MarshalAs (UnmanagedType.U1)]
		// bool routed_event_args_get_handled (RoutedEventArgs *instance);
		public extern static bool routed_event_args_get_handled (IntPtr instance);

		[DllImport ("moon")]
		// DependencyObject *routed_event_args_get_source (RoutedEventArgs *instance);
		public extern static IntPtr routed_event_args_get_source (IntPtr instance);

		[DllImport ("moon")]
		// RoutedEventArgs *routed_event_args_new ();
		public extern static IntPtr routed_event_args_new ();

		[DllImport ("moon")]
		// void routed_event_args_set_handled (RoutedEventArgs *instance, bool handled);
		public extern static void routed_event_args_set_handled (IntPtr instance, [MarshalAs (UnmanagedType.U1)] bool handled);

		[DllImport ("moon")]
		// void routed_event_args_set_source (RoutedEventArgs *instance, DependencyObject *el);
		public extern static void routed_event_args_set_source (IntPtr instance, IntPtr el);

		[DllImport ("moon")]
		// RowDefinition *row_definition_new ();
		public extern static IntPtr row_definition_new ();

		[DllImport ("moon")]
		// RowDefinitionCollection *row_definition_collection_new ();
		public extern static IntPtr row_definition_collection_new ();

		[DllImport ("moon")]
		// Run *run_new ();
		public extern static IntPtr run_new ();

		[DllImport ("moon")]
		// ScaleTransform *scale_transform_new ();
		public extern static IntPtr scale_transform_new ();

		[DllImport ("moon")]
		// Setter *setter_new ();
		public extern static IntPtr setter_new ();

		[DllImport ("moon")]
		// SetterBase *setter_base_new ();
		public extern static IntPtr setter_base_new ();

		[DllImport ("moon")]
		// SetterBaseCollection *setter_base_collection_new ();
		public extern static IntPtr setter_base_collection_new ();

		[DllImport ("moon")]
		// ShaderEffect *shader_effect_new ();
		public extern static IntPtr shader_effect_new ();

		[DllImport ("moon")]
		// Transform *shape_get_geometry_transform (Shape *instance);
		public extern static IntPtr shape_get_geometry_transform (IntPtr instance);

		[DllImport ("moon")]
		// Shape *shape_new ();
		public extern static IntPtr shape_new ();

		[DllImport ("moon")]
		// double sine_ease_ease_in_core (SineEase *instance, double normalizedTime);
		public extern static double sine_ease_ease_in_core (IntPtr instance, double normalizedTime);

		[DllImport ("moon")]
		// SineEase *sine_ease_new ();
		public extern static IntPtr sine_ease_new ();

		[DllImport ("moon")]
		// SizeChangedEventArgs *size_changed_event_args_new ();
		public extern static IntPtr size_changed_event_args_new ();

		[DllImport ("moon")]
		// SkewTransform *skew_transform_new ();
		public extern static IntPtr skew_transform_new ();

		[DllImport ("moon")]
		// SolidColorBrush *solid_color_brush_new ();
		public extern static IntPtr solid_color_brush_new ();

		[DllImport ("moon")]
		// SplineColorKeyFrame *spline_color_key_frame_new ();
		public extern static IntPtr spline_color_key_frame_new ();

		[DllImport ("moon")]
		// SplineDoubleKeyFrame *spline_double_key_frame_new ();
		public extern static IntPtr spline_double_key_frame_new ();

		[DllImport ("moon")]
		// SplinePointKeyFrame *spline_point_key_frame_new ();
		public extern static IntPtr spline_point_key_frame_new ();

		[DllImport ("moon", EntryPoint="storyboard_begin_with_error")]
		[return: MarshalAs (UnmanagedType.U1)]
		// bool storyboard_begin_with_error (Storyboard *instance, MoonError *error);
		private extern static bool storyboard_begin_with_error_ (IntPtr instance, out MoonError error);
		public static bool storyboard_begin (IntPtr instance)
		{
			bool result;
			MoonError error;
			result = storyboard_begin_with_error_ (instance, out error);
			if (error.Number != 0)
				throw CreateManagedException (error);
			return result;
		}

		[DllImport ("moon")]
		// int storyboard_get_current_state (Storyboard *instance);
		public extern static int storyboard_get_current_state (IntPtr instance);

		[DllImport ("moon")]
		// TimeSpan storyboard_get_current_time (Storyboard *instance);
		public extern static long storyboard_get_current_time (IntPtr instance);

		[DllImport ("moon")]
		// DependencyProperty *storyboard_get_target_dependency_property (Storyboard *instance);
		public extern static IntPtr storyboard_get_target_dependency_property (IntPtr instance);

		[DllImport ("moon", EntryPoint="storyboard_pause_with_error")]
		// void storyboard_pause_with_error (Storyboard *instance, MoonError *error);
		private extern static void storyboard_pause_with_error_ (IntPtr instance, out MoonError error);
		public static void storyboard_pause (IntPtr instance)
		{
					MoonError error;
			storyboard_pause_with_error_ (instance, out error);
			if (error.Number != 0)
				throw CreateManagedException (error);
		}

		[DllImport ("moon", EntryPoint="storyboard_resume_with_error")]
		// void storyboard_resume_with_error (Storyboard *instance, MoonError *error);
		private extern static void storyboard_resume_with_error_ (IntPtr instance, out MoonError error);
		public static void storyboard_resume (IntPtr instance)
		{
					MoonError error;
			storyboard_resume_with_error_ (instance, out error);
			if (error.Number != 0)
				throw CreateManagedException (error);
		}

		[DllImport ("moon", EntryPoint="storyboard_seek_aligned_to_last_tick_with_error")]
		// void storyboard_seek_aligned_to_last_tick_with_error (Storyboard *instance, TimeSpan timespan, MoonError *error);
		private extern static void storyboard_seek_aligned_to_last_tick_with_error_ (IntPtr instance, long timespan, out MoonError error);
		public static void storyboard_seek_aligned_to_last_tick (IntPtr instance, long timespan)
		{
					MoonError error;
			storyboard_seek_aligned_to_last_tick_with_error_ (instance, timespan, out error);
			if (error.Number != 0)
				throw CreateManagedException (error);
		}

		[DllImport ("moon", EntryPoint="storyboard_seek_with_error")]
		// void storyboard_seek_with_error (Storyboard *instance, TimeSpan timespan, MoonError *error);
		private extern static void storyboard_seek_with_error_ (IntPtr instance, long timespan, out MoonError error);
		public static void storyboard_seek (IntPtr instance, long timespan)
		{
					MoonError error;
			storyboard_seek_with_error_ (instance, timespan, out error);
			if (error.Number != 0)
				throw CreateManagedException (error);
		}

		[DllImport ("moon", EntryPoint="storyboard_skip_to_fill_with_error")]
		// void storyboard_skip_to_fill_with_error (Storyboard *instance, MoonError *error);
		private extern static void storyboard_skip_to_fill_with_error_ (IntPtr instance, out MoonError error);
		public static void storyboard_skip_to_fill (IntPtr instance)
		{
					MoonError error;
			storyboard_skip_to_fill_with_error_ (instance, out error);
			if (error.Number != 0)
				throw CreateManagedException (error);
		}

		[DllImport ("moon", EntryPoint="storyboard_stop_with_error")]
		// void storyboard_stop_with_error (Storyboard *instance, MoonError *error);
		private extern static void storyboard_stop_with_error_ (IntPtr instance, out MoonError error);
		public static void storyboard_stop (IntPtr instance)
		{
					MoonError error;
			storyboard_stop_with_error_ (instance, out error);
			if (error.Number != 0)
				throw CreateManagedException (error);
		}

		[DllImport ("moon")]
		// Storyboard *storyboard_new ();
		public extern static IntPtr storyboard_new ();

		[DllImport ("moon")]
		[return: MarshalAs (UnmanagedType.U1)]
		// bool stroke_hit_test (Stroke *instance, StylusPointCollection *stylusPoints);
		public extern static bool stroke_hit_test (IntPtr instance, IntPtr stylusPoints);

		[DllImport ("moon")]
		// Stroke *stroke_new ();
		public extern static IntPtr stroke_new ();

		[DllImport ("moon")]
		// StrokeCollection *stroke_collection_hit_test (StrokeCollection *instance, StylusPointCollection *stylusPoints);
		public extern static IntPtr stroke_collection_hit_test (IntPtr instance, IntPtr stylusPoints);

		[DllImport ("moon")]
		// StrokeCollection *stroke_collection_new ();
		public extern static IntPtr stroke_collection_new ();

		[DllImport ("moon")]
		// void style_seal (Style *instance);
		public extern static void style_seal (IntPtr instance);

		[DllImport ("moon")]
		// Style *style_new ();
		public extern static IntPtr style_new ();

		[DllImport ("moon")]
		// StylusInfo *stylus_info_new ();
		public extern static IntPtr stylus_info_new ();

		[DllImport ("moon")]
		// double stylus_point_get_pressure_factor (StylusPoint *instance);
		public extern static double stylus_point_get_pressure_factor (IntPtr instance);

		[DllImport ("moon")]
		// double stylus_point_get_x (StylusPoint *instance);
		public extern static double stylus_point_get_x (IntPtr instance);

		[DllImport ("moon")]
		// double stylus_point_get_y (StylusPoint *instance);
		public extern static double stylus_point_get_y (IntPtr instance);

		[DllImport ("moon")]
		// void stylus_point_set_pressure_factor (StylusPoint *instance, double factor);
		public extern static void stylus_point_set_pressure_factor (IntPtr instance, double factor);

		[DllImport ("moon")]
		// void stylus_point_set_x (StylusPoint *instance, double x);
		public extern static void stylus_point_set_x (IntPtr instance, double x);

		[DllImport ("moon")]
		// void stylus_point_set_y (StylusPoint *instance, double y);
		public extern static void stylus_point_set_y (IntPtr instance, double y);

		[DllImport ("moon")]
		// StylusPoint *stylus_point_new ();
		public extern static IntPtr stylus_point_new ();

		[DllImport ("moon")]
		// double stylus_point_collection_add_stylus_points (StylusPointCollection *instance, StylusPointCollection *stylusPointCollection);
		public extern static double stylus_point_collection_add_stylus_points (IntPtr instance, IntPtr stylusPointCollection);

		[DllImport ("moon")]
		// StylusPointCollection *stylus_point_collection_new ();
		public extern static IntPtr stylus_point_collection_new ();

		[DllImport ("moon")]
		// void surface_attach (Surface *instance, UIElement *toplevel);
		public extern static void surface_attach (IntPtr instance, IntPtr toplevel);

		[DllImport ("moon")]
		// Downloader *surface_create_downloader (Surface *instance);
		public extern static IntPtr surface_create_downloader (IntPtr instance);

		[DllImport ("moon")]
		// void surface_emit_error (Surface *instance, int number, int code, const char *message);
		public extern static void surface_emit_error (IntPtr instance, int number, int code, string message);

		[DllImport ("moon")]
		// Color *surface_get_background_color (Surface *instance);
		public extern static IntPtr surface_get_background_color (IntPtr instance);

		[DllImport ("moon")]
		// UIElement *surface_get_focused_element (Surface *instance);
		public extern static IntPtr surface_get_focused_element (IntPtr instance);

		[DllImport ("moon")]
		[return: MarshalAs (UnmanagedType.U1)]
		// bool surface_get_full_screen (Surface *instance);
		public extern static bool surface_get_full_screen (IntPtr instance);

		[DllImport ("moon")]
		// TimeManager *surface_get_time_manager (Surface *instance);
		public extern static IntPtr surface_get_time_manager (IntPtr instance);

		[DllImport ("moon")]
		// UIElement *surface_get_toplevel (Surface *instance);
		public extern static IntPtr surface_get_toplevel (IntPtr instance);

		[DllImport ("moon")]
		// int surface_get_user_initiated_counter (Surface *instance);
		public extern static int surface_get_user_initiated_counter (IntPtr instance);

		[DllImport ("moon")]
		// double surface_get_zoom_factor (Surface *instance);
		public extern static double surface_get_zoom_factor (IntPtr instance);

		[DllImport ("moon")]
		[return: MarshalAs (UnmanagedType.U1)]
		// bool surface_in_main_thread ();
		public extern static bool surface_in_main_thread ();

		[DllImport ("moon")]
		[return: MarshalAs (UnmanagedType.U1)]
		// bool surface_is_loaded (Surface *instance);
		public extern static bool surface_is_loaded (IntPtr instance);

		[DllImport ("moon")]
		[return: MarshalAs (UnmanagedType.U1)]
		// bool surface_is_user_initiated_event (Surface *instance);
		public extern static bool surface_is_user_initiated_event (IntPtr instance);

		[DllImport ("moon")]
		[return: MarshalAs (UnmanagedType.U1)]
		// bool surface_is_version_supported (const char *version);
		public extern static bool surface_is_version_supported (string version);

		[DllImport ("moon")]
		// void surface_paint (Surface *instance, cairo_t *ctx, int x, int y, int width, int height);
		public extern static void surface_paint (IntPtr instance, IntPtr ctx, int x, int y, int width, int height);

		[DllImport ("moon")]
		// void surface_resize (Surface *instance, int width, int height);
		public extern static void surface_resize (IntPtr instance, int width, int height);

		[DllImport ("moon")]
		// void surface_set_full_screen (Surface *instance, bool value);
		public extern static void surface_set_full_screen (IntPtr instance, [MarshalAs (UnmanagedType.U1)] bool value);

		[DllImport ("moon")]
		// Surface *surface_new (MoonWindow *window);
		public extern static IntPtr surface_new (IntPtr window);

		[DllImport ("moon")]
		[return: MarshalAs (UnmanagedType.U1)]
		// bool tab_navigation_walker_focus (UIElement *element, bool forwards);
		public extern static bool tab_navigation_walker_focus (IntPtr element, [MarshalAs (UnmanagedType.U1)] bool forwards);

		[DllImport ("moon")]
		// TextBlock *text_block_new ();
		public extern static IntPtr text_block_new ();

		[DllImport ("moon")]
		// TextBox *text_box_new ();
		public extern static IntPtr text_box_new ();

		[DllImport ("moon")]
		// void text_box_base_on_got_focus (TextBoxBase *instance, RoutedEventArgs *args);
		public extern static void text_box_base_on_got_focus (IntPtr instance, IntPtr args);

		[DllImport ("moon")]
		// void text_box_base_on_key_down (TextBoxBase *instance, KeyEventArgs *args);
		public extern static void text_box_base_on_key_down (IntPtr instance, IntPtr args);

		[DllImport ("moon")]
		// void text_box_base_on_key_up (TextBoxBase *instance, KeyEventArgs *args);
		public extern static void text_box_base_on_key_up (IntPtr instance, IntPtr args);

		[DllImport ("moon")]
		// void text_box_base_on_lost_focus (TextBoxBase *instance, RoutedEventArgs *args);
		public extern static void text_box_base_on_lost_focus (IntPtr instance, IntPtr args);

		[DllImport ("moon")]
		// void text_box_base_on_mouse_left_button_down (TextBoxBase *instance, MouseButtonEventArgs *args);
		public extern static void text_box_base_on_mouse_left_button_down (IntPtr instance, IntPtr args);

		[DllImport ("moon")]
		// void text_box_base_on_mouse_left_button_up (TextBoxBase *instance, MouseButtonEventArgs *args);
		public extern static void text_box_base_on_mouse_left_button_up (IntPtr instance, IntPtr args);

		[DllImport ("moon")]
		// void text_box_base_on_mouse_move (TextBoxBase *instance, MouseEventArgs *args);
		public extern static void text_box_base_on_mouse_move (IntPtr instance, IntPtr args);

		[DllImport ("moon")]
		// void text_box_base_post_on_key_down (TextBoxBase *instance, KeyEventArgs *args);
		public extern static void text_box_base_post_on_key_down (IntPtr instance, IntPtr args);

		[DllImport ("moon")]
		// void text_box_base_select_all (TextBoxBase *instance);
		public extern static void text_box_base_select_all (IntPtr instance);

		[DllImport ("moon", EntryPoint="text_box_base_select_with_error")]
		[return: MarshalAs (UnmanagedType.U1)]
		// bool text_box_base_select_with_error (TextBoxBase *instance, int start, int length, MoonError *error);
		private extern static bool text_box_base_select_with_error_ (IntPtr instance, int start, int length, out MoonError error);
		public static bool text_box_base_select (IntPtr instance, int start, int length)
		{
			bool result;
			MoonError error;
			result = text_box_base_select_with_error_ (instance, start, length, out error);
			if (error.Number != 0)
				throw CreateManagedException (error);
			return result;
		}

		[DllImport ("moon")]
		// TextBoxView *text_box_view_new ();
		public extern static IntPtr text_box_view_new ();

		[DllImport ("moon")]
		// TextChangedEventArgs *text_changed_event_args_new ();
		public extern static IntPtr text_changed_event_args_new ();

		[DllImport ("moon")]
		// TileBrush *tile_brush_new ();
		public extern static IntPtr tile_brush_new ();

		[DllImport ("moon")]
		// DependencyObject *timeline_get_manual_target (Timeline *instance);
		public extern static IntPtr timeline_get_manual_target (IntPtr instance);

		[DllImport ("moon")]
		// void timeline_set_manual_target (Timeline *instance, DependencyObject *o);
		public extern static void timeline_set_manual_target (IntPtr instance, IntPtr o);

		[DllImport ("moon")]
		// Timeline *timeline_new ();
		public extern static IntPtr timeline_new ();

		[DllImport ("moon")]
		// TimelineCollection *timeline_collection_new ();
		public extern static IntPtr timeline_collection_new ();

		[DllImport ("moon")]
		// TimelineGroup *timeline_group_new ();
		public extern static IntPtr timeline_group_new ();

		[DllImport ("moon")]
		// TimelineMarker *timeline_marker_new ();
		public extern static IntPtr timeline_marker_new ();

		[DllImport ("moon")]
		// TimelineMarkerCollection *timeline_marker_collection_new ();
		public extern static IntPtr timeline_marker_collection_new ();

		[DllImport ("moon")]
		// TimelineMarker *timeline_marker_routed_event_args_get_marker (TimelineMarkerRoutedEventArgs *instance);
		public extern static IntPtr timeline_marker_routed_event_args_get_marker (IntPtr instance);

		[DllImport ("moon")]
		// TimelineMarkerRoutedEventArgs *timeline_marker_routed_event_args_new (TimelineMarker *marker);
		public extern static IntPtr timeline_marker_routed_event_args_new (IntPtr marker);

		[DllImport ("moon")]
		// void time_manager_add_dispatcher_call (TimeManager *instance, TickCallHandler handler, EventObject *tick_data);
		public extern static void time_manager_add_dispatcher_call (IntPtr instance, TickCallHandler handler, IntPtr tick_data);

		[DllImport ("moon")]
		// void time_manager_add_tick_call (TimeManager *instance, TickCallHandler handler, EventObject *tick_data);
		public extern static void time_manager_add_tick_call (IntPtr instance, TickCallHandler handler, IntPtr tick_data);

		[DllImport ("moon")]
		// int time_manager_get_maximum_refresh_rate (TimeManager *instance);
		public extern static int time_manager_get_maximum_refresh_rate (IntPtr instance);

		[DllImport ("moon")]
		// void time_manager_remove_tick_call (TimeManager *instance, TickCallHandler handler, EventObject *tick_data);
		public extern static void time_manager_remove_tick_call (IntPtr instance, TickCallHandler handler, IntPtr tick_data);

		[DllImport ("moon")]
		// void time_manager_set_maximum_refresh_rate (TimeManager *instance, int hz);
		public extern static void time_manager_set_maximum_refresh_rate (IntPtr instance, int hz);

		[DllImport ("moon")]
		// UIElement *touch_device_get_directly_over (TouchDevice *instance);
		public extern static IntPtr touch_device_get_directly_over (IntPtr instance);

		[DllImport ("moon")]
		// int touch_device_get_id (TouchDevice *instance);
		public extern static int touch_device_get_id (IntPtr instance);

		[DllImport ("moon")]
		// void touch_device_set_directly_over (TouchDevice *instance, UIElement *element);
		public extern static void touch_device_set_directly_over (IntPtr instance, IntPtr element);

		[DllImport ("moon")]
		// void touch_device_set_id (TouchDevice *instance, int id);
		public extern static void touch_device_set_id (IntPtr instance, int id);

		[DllImport ("moon")]
		// TouchDevice *touch_device_new ();
		public extern static IntPtr touch_device_new ();

		// This method contains types the generator didn't know about. Fix the generator (find the method 'GetManagedType' in TypeReference.cs and add the missing case) and try again.
		// [DllImport ("moon")]
		// TouchAction touch_point_get_action (TouchPoint *instance);
		// public extern static /* Unknown: 'TouchAction' */ touch_point_get_action (IntPtr instance);

		[DllImport ("moon")]
		// Point *touch_point_get_position (TouchPoint *instance);
		public extern static IntPtr touch_point_get_position (IntPtr instance);

		[DllImport ("moon")]
		// Size *touch_point_get_size (TouchPoint *instance);
		public extern static IntPtr touch_point_get_size (IntPtr instance);

		[DllImport ("moon")]
		// TouchDevice *touch_point_get_touch_device (TouchPoint *instance);
		public extern static IntPtr touch_point_get_touch_device (IntPtr instance);

		// This method contains types the generator didn't know about. Fix the generator (find the method 'GetManagedType' in TypeReference.cs and add the missing case) and try again.
		// [DllImport ("moon")]
		// void touch_point_set_action (TouchPoint *instance, TouchAction action);
		// public extern static void touch_point_set_action (IntPtr instance, /* Unknown: 'TouchAction' */ action);

		[DllImport ("moon")]
		// void touch_point_set_position (TouchPoint *instance, Point *position);
		public extern static void touch_point_set_position (IntPtr instance, IntPtr position);

		[DllImport ("moon")]
		// void touch_point_set_size (TouchPoint *instance, Size *size);
		public extern static void touch_point_set_size (IntPtr instance, IntPtr size);

		[DllImport ("moon")]
		// void touch_point_set_touch_device (TouchPoint *instance, TouchDevice *device);
		public extern static void touch_point_set_touch_device (IntPtr instance, IntPtr device);

		[DllImport ("moon")]
		// TouchPoint *touch_point_new ();
		public extern static IntPtr touch_point_new ();

		[DllImport ("moon")]
		// TouchPointCollection *touch_point_collection_new ();
		public extern static IntPtr touch_point_collection_new ();

		[DllImport ("moon")]
		// Transform *transform_new ();
		public extern static IntPtr transform_new ();

		[DllImport ("moon")]
		// TransformCollection *transform_collection_new ();
		public extern static IntPtr transform_collection_new ();

		[DllImport ("moon")]
		// TransformGroup *transform_group_new ();
		public extern static IntPtr transform_group_new ();

		[DllImport ("moon")]
		// TranslateTransform *translate_transform_new ();
		public extern static IntPtr translate_transform_new ();

		[DllImport ("moon")]
		// TriggerAction *trigger_action_new ();
		public extern static IntPtr trigger_action_new ();

		[DllImport ("moon")]
		// TriggerActionCollection *trigger_action_collection_new ();
		public extern static IntPtr trigger_action_collection_new ();

		[DllImport ("moon")]
		// TriggerBase *trigger_base_new ();
		public extern static IntPtr trigger_base_new ();

		[DllImport ("moon")]
		// TriggerCollection *trigger_collection_new ();
		public extern static IntPtr trigger_collection_new ();

		[DllImport ("moon")]
		// Type *types_find (Types *instance, Type::Kind type);
		public extern static IntPtr types_find (IntPtr instance, Kind type);

		[DllImport ("moon")]
		// Type::Kind types_register_type (Types *instance, const char *name, void *gc_handle, Type::Kind parent, bool is_interface, bool ctor_visible, Type::Kind *interfaces, int interface_count);
		public extern static Kind types_register_type (IntPtr instance, string name, IntPtr gc_handle, Kind parent, [MarshalAs (UnmanagedType.U1)] bool is_interface, [MarshalAs (UnmanagedType.U1)] bool ctor_visible, Kind[] interfaces, int interface_count);

		[DllImport ("moon")]
		// Types *types_new ();
		public extern static IntPtr types_new ();

		[DllImport ("moon")]
		// void uielement_arrange (UIElement *instance, Rect finalRect);
		public extern static void uielement_arrange (IntPtr instance, Rect finalRect);

		[DllImport ("moon")]
		[return: MarshalAs (UnmanagedType.U1)]
		// bool uielement_capture_mouse (UIElement *instance);
		public extern static bool uielement_capture_mouse (IntPtr instance);

		[DllImport ("moon")]
		// void uielement_element_added (UIElement *instance, UIElement *obj);
		public extern static void uielement_element_added (IntPtr instance, IntPtr obj);

		[DllImport ("moon")]
		// void uielement_element_removed (UIElement *instance, UIElement *obj);
		public extern static void uielement_element_removed (IntPtr instance, IntPtr obj);

		[DllImport ("moon")]
		// void uielement_find_elements_in_host_coordinates_p (UIElement *instance, Point p, HitTestCollection *uielement_list);
		public extern static void uielement_find_elements_in_host_coordinates_p (IntPtr instance, Point p, IntPtr uielement_list);

		[DllImport ("moon")]
		// void uielement_find_elements_in_host_coordinates_r (UIElement *instance, Rect p, HitTestCollection *uielement_list);
		public extern static void uielement_find_elements_in_host_coordinates_r (IntPtr instance, Rect p, IntPtr uielement_list);

		[DllImport ("moon")]
		[return: MarshalAs (UnmanagedType.U1)]
		// bool uielement_focus (UIElement *instance, bool recurse);
		public extern static bool uielement_focus (IntPtr instance, [MarshalAs (UnmanagedType.U1)] bool recurse);

		[DllImport ("moon")]
		// Size uielement_get_desired_size (UIElement *instance);
		public extern static Size uielement_get_desired_size (IntPtr instance);

		[DllImport ("moon")]
		// Size uielement_get_render_size (UIElement *instance);
		public extern static Size uielement_get_render_size (IntPtr instance);

		[DllImport ("moon")]
		// DependencyObject *uielement_get_subtree_object (UIElement *instance);
		public extern static IntPtr uielement_get_subtree_object (IntPtr instance);

		[DllImport ("moon", EntryPoint="uielement_get_transform_to_uielement_with_error")]
		// GeneralTransform *uielement_get_transform_to_uielement_with_error (UIElement *instance, UIElement *to_element, MoonError *error);
		private extern static IntPtr uielement_get_transform_to_uielement_with_error_ (IntPtr instance, IntPtr to_element, out MoonError error);
		public static IntPtr uielement_get_transform_to_uielement (IntPtr instance, IntPtr to_element)
		{
			IntPtr result;
			MoonError error;
			result = uielement_get_transform_to_uielement_with_error_ (instance, to_element, out error);
			if (error.Number != 0)
				throw CreateManagedException (error);
			return result;
		}

		[DllImport ("moon")]
		// UIElement *uielement_get_visual_parent (UIElement *instance);
		public extern static IntPtr uielement_get_visual_parent (IntPtr instance);

		[DllImport ("moon")]
		// void uielement_invalidate_arrange (UIElement *instance);
		public extern static void uielement_invalidate_arrange (IntPtr instance);

		[DllImport ("moon")]
		// void uielement_invalidate_measure (UIElement *instance);
		public extern static void uielement_invalidate_measure (IntPtr instance);

		[DllImport ("moon")]
		// void uielement_measure (UIElement *instance, Size availableSize);
		public extern static void uielement_measure (IntPtr instance, Size availableSize);

		[DllImport ("moon")]
		// void uielement_release_mouse_capture (UIElement *instance);
		public extern static void uielement_release_mouse_capture (IntPtr instance);

		[DllImport ("moon")]
		// void uielement_set_subtree_object (UIElement *instance, DependencyObject *value);
		public extern static void uielement_set_subtree_object (IntPtr instance, IntPtr value);

		[DllImport ("moon")]
		// void uielement_update_layout (UIElement *instance);
		public extern static void uielement_update_layout (IntPtr instance);

		[DllImport ("moon")]
		// UIElementCollection *uielement_collection_new ();
		public extern static IntPtr uielement_collection_new ();

		[DllImport ("moon")]
		// UnmanagedMatrix *unmanaged_matrix_new ();
		public extern static IntPtr unmanaged_matrix_new ();

		[DllImport ("moon")]
		// UnmanagedMatrix3D *unmanaged_matrix3_d_new ();
		public extern static IntPtr unmanaged_matrix3_d_new ();

		[DllImport ("moon")]
		// void uri_free (Uri *instance);
		public extern static void uri_free (IntPtr instance);

		[DllImport ("moon")]
		[return: MarshalAs (UnmanagedType.U1)]
		// bool uri_parse (Uri *instance, const char *uri, bool allow_trailing_sep);
		public extern static bool uri_parse (IntPtr instance, string uri, [MarshalAs (UnmanagedType.U1)] bool allow_trailing_sep);

		[DllImport ("moon")]
		// UserControl *user_control_new ();
		public extern static IntPtr user_control_new ();

		[DllImport ("moon")]
		// void video_brush_set_source (VideoBrush *instance, MediaElement *source);
		public extern static void video_brush_set_source (IntPtr instance, IntPtr source);

		[DllImport ("moon")]
		// VideoBrush *video_brush_new ();
		public extern static IntPtr video_brush_new ();

		[DllImport ("moon")]
		// VideoStream *video_stream_new (Media *media, int codec_id, guint32 width, guint32 height, guint64 duration, gpointer extra_data, guint32 extra_data_size);
		public extern static IntPtr video_stream_new (IntPtr media, int codec_id, uint width, uint height, ulong duration, IntPtr extra_data, uint extra_data_size);

		[DllImport ("moon")]
		// VisualBrush *visual_brush_new ();
		public extern static IntPtr visual_brush_new ();

		[DllImport ("moon")]
		// WindowSettings *window_settings_new ();
		public extern static IntPtr window_settings_new ();

		[DllImport ("moon")]
		// gpointer writeable_bitmap_initialize_from_bitmap_source (WriteableBitmap *instance, BitmapSource *source);
		public extern static IntPtr writeable_bitmap_initialize_from_bitmap_source (IntPtr instance, IntPtr source);

		[DllImport ("moon")]
		// void writeable_bitmap_lock (WriteableBitmap *instance);
		public extern static void writeable_bitmap_lock (IntPtr instance);

		[DllImport ("moon")]
		// void writeable_bitmap_render (WriteableBitmap *instance, UIElement *element, Transform *transform);
		public extern static void writeable_bitmap_render (IntPtr instance, IntPtr element, IntPtr transform);

		[DllImport ("moon")]
		// void writeable_bitmap_unlock (WriteableBitmap *instance);
		public extern static void writeable_bitmap_unlock (IntPtr instance);

		[DllImport ("moon")]
		// WriteableBitmap *writeable_bitmap_new ();
		public extern static IntPtr writeable_bitmap_new ();

		[DllImport ("moon")]
		// DependencyObject *xaml_context_get_template_binding_source (XamlContext *instance);
		public extern static IntPtr xaml_context_get_template_binding_source (IntPtr instance);

		[DllImport ("moon", EntryPoint="xaml_loader_create_from_file_with_error")]
		// Value *xaml_loader_create_from_file_with_error (XamlLoader *instance, const char *xaml, bool create_namescope, Type::Kind *element_type, MoonError *error);
		private extern static IntPtr xaml_loader_create_from_file_with_error_ (IntPtr instance, string xaml, [MarshalAs (UnmanagedType.U1)] bool create_namescope, out Kind element_type, out MoonError error);
		public static IntPtr xaml_loader_create_from_file (IntPtr instance, string xaml, bool create_namescope, out Kind element_type)
		{
			IntPtr result;
			MoonError error;
			result = xaml_loader_create_from_file_with_error_ (instance, xaml, create_namescope, out element_type, out error);
			if (error.Number != 0)
				throw CreateManagedException (error);
			return result;
		}

		[DllImport ("moon", EntryPoint="xaml_loader_create_from_string_with_error")]
		// Value *xaml_loader_create_from_string_with_error (XamlLoader *instance, const char *xaml, bool create_namescope, Type::Kind *element_type, int flags, MoonError *error);
		private extern static IntPtr xaml_loader_create_from_string_with_error_ (IntPtr instance, string xaml, [MarshalAs (UnmanagedType.U1)] bool create_namescope, out Kind element_type, int flags, out MoonError error);
		public static IntPtr xaml_loader_create_from_string (IntPtr instance, string xaml, bool create_namescope, out Kind element_type, int flags)
		{
			IntPtr result;
			MoonError error;
			result = xaml_loader_create_from_string_with_error_ (instance, xaml, create_namescope, out element_type, flags, out error);
			if (error.Number != 0)
				throw CreateManagedException (error);
			return result;
		}

		[DllImport ("moon")]
		// XamlContext *xaml_loader_get_context (XamlLoader *instance);
		public extern static IntPtr xaml_loader_get_context (IntPtr instance);

		[DllImport ("moon", EntryPoint="xaml_loader_hydrate_from_string_with_error")]
		// Value *xaml_loader_hydrate_from_string_with_error (XamlLoader *instance, const char *xaml, Value *obj, bool create_namescope, Type::Kind *element_type, int flags, MoonError *error);
		private extern static IntPtr xaml_loader_hydrate_from_string_with_error_ (IntPtr instance, string xaml, ref Value obj, [MarshalAs (UnmanagedType.U1)] bool create_namescope, out Kind element_type, int flags, out MoonError error);
		public static IntPtr xaml_loader_hydrate_from_string (IntPtr instance, string xaml, ref Value obj, bool create_namescope, out Kind element_type, int flags)
		{
			IntPtr result;
			MoonError error;
			result = xaml_loader_hydrate_from_string_with_error_ (instance, xaml, ref obj, create_namescope, out element_type, flags, out error);
			if (error.Number != 0)
				throw CreateManagedException (error);
			return result;
		}

		[DllImport ("moon", EntryPoint="xap_unpack")]
		// char *xap_unpack (const char *fname);
		private extern static IntPtr xap_unpack_ (string fname);
		public static string xap_unpack (string fname)
		{
			IntPtr result;
			result = xap_unpack_ (fname);
			if (result == IntPtr.Zero)
				return null;
			string s = Marshal.PtrToStringAnsi (result);	// *copy* unmanaged string
			Marshal.FreeHGlobal (result);			// g_free the unmanaged string
			return s;
		}

		[DllImport ("moon")]
		// int message_box_show (const char *caption, const char *text, int buttons);
		public extern static int message_box_show (string caption, string text, int buttons);

		[DllImport ("moon")]
		// char* *open_file_dialog_show (const char *title, bool multsel, const char *filter, int idx);
		public extern static IntPtr open_file_dialog_show (string title, [MarshalAs (UnmanagedType.U1)] bool multsel, string filter, int idx);

		[DllImport ("moon", EntryPoint="save_file_dialog_show")]
		// char *save_file_dialog_show (const char *title, const char *filter, int idx);
		private extern static IntPtr save_file_dialog_show_ (string title, string filter, int idx);
		public static string save_file_dialog_show (string title, string filter, int idx)
		{
			IntPtr result;
			result = save_file_dialog_show_ (title, filter, idx);
			if (result == IntPtr.Zero)
				return null;
			string s = Marshal.PtrToStringAnsi (result);	// *copy* unmanaged string
			Marshal.FreeHGlobal (result);			// g_free the unmanaged string
			return s;
		}

		[DllImport ("moon")]
		// void runtime_init_desktop ();
		public extern static void runtime_init_desktop ();

		[DllImport ("moon")]
		[return: MarshalAs (UnmanagedType.U1)]
		// bool runtime_is_running_out_of_browser ();
		public extern static bool runtime_is_running_out_of_browser ();

		[DllImport ("moon")]
		// void size_changed_event_args_get_prev_size (SizeChangedEventArgs *args, Size *prev_size);
		public extern static void size_changed_event_args_get_prev_size (IntPtr args, ref Size prev_size);

		[DllImport ("moon")]
		// void size_changed_event_args_get_new_size (SizeChangedEventArgs *args, Size *new_size);
		public extern static void size_changed_event_args_get_new_size (IntPtr args, ref Size new_size);

		[DllImport ("moon")]
		// void stroke_get_bounds (Stroke *stroke, Rect *bounds);
		public extern static void stroke_get_bounds (IntPtr stroke, ref Rect bounds);

		[DllImport ("moon")]
		// void stroke_collection_get_bounds (StrokeCollection *collection, Rect *bounds);
		public extern static void stroke_collection_get_bounds (IntPtr collection, ref Rect bounds);

		[DllImport ("moon")]
		// void general_transform_transform_point (GeneralTransform *t, Point *p, Point *r);
		public extern static void general_transform_transform_point (IntPtr t, ref Point p, ref Point r);

		[DllImport ("moon")]
		[return: MarshalAs (UnmanagedType.U1)]
		// bool type_get_value_type (Type::Kind type);
		public extern static bool type_get_value_type (Kind type);

		[DllImport ("moon")]
		[return: MarshalAs (UnmanagedType.U1)]
		// bool type_is_dependency_object (Type::Kind type);
		public extern static bool type_is_dependency_object (Kind type);

		[DllImport ("moon")]
		[return: MarshalAs (UnmanagedType.Bool)]
		// gboolean managed_unzip_stream_to_stream (ManagedStreamCallbacks *source, ManagedStreamCallbacks *dest, const char *partname);
		public extern static bool managed_unzip_stream_to_stream (ref ManagedStreamCallbacks source, ref ManagedStreamCallbacks dest, string partname);

		[DllImport ("moon")]
		[return: MarshalAs (UnmanagedType.Bool)]
		// gboolean managed_unzip_stream_to_stream_first_file (ManagedStreamCallbacks *source, ManagedStreamCallbacks *dest);
		public extern static bool managed_unzip_stream_to_stream_first_file (ref ManagedStreamCallbacks source, ref ManagedStreamCallbacks dest);

		[DllImport ("moon")]
		// void value_free_value (Value *value);
		public extern static void value_free_value (ref Value value);

		[DllImport ("moon")]
		// void value_free_value2 (Value *value);
		public extern static void value_free_value2 (IntPtr value);

		[DllImport ("moon")]
		[return: MarshalAs (UnmanagedType.U1)]
		// bool value_from_str_with_typename (const char *type_name, const char *prop_name, const char *str, Value* *v);
		public extern static bool value_from_str_with_typename (string type_name, string prop_name, string str, out IntPtr v);

		[DllImport ("moon")]
		[return: MarshalAs (UnmanagedType.U1)]
		// bool value_from_str (Type::Kind type, const char *prop_name, const char *str, Value* *v);
		public extern static bool value_from_str (Kind type, string prop_name, string str, out IntPtr v);

		[DllImport ("moon")]
		// XamlLoader *xaml_loader_new (const char *resourceBase, const char *filename, const char *str, Surface *surface);
		public extern static IntPtr xaml_loader_new (string resourceBase, string filename, string str, IntPtr surface);

		[DllImport ("moon")]
		// void xaml_loader_free (XamlLoader *loader);
		public extern static void xaml_loader_free (IntPtr loader);

		[DllImport ("moon")]
		// void xaml_loader_set_callbacks (XamlLoader *loader, XamlLoaderCallbacks callbacks);
		public extern static void xaml_loader_set_callbacks (IntPtr loader, Xaml.XamlLoaderCallbacks callbacks);

		[DllImport ("moon", EntryPoint="xaml_uri_for_prefix")]
		// char *xaml_uri_for_prefix (void *parser, char *prefix);
		private extern static IntPtr xaml_uri_for_prefix_ (IntPtr parser, string prefix);
		public static string xaml_uri_for_prefix (IntPtr parser, string prefix)
		{
			IntPtr result;
			result = xaml_uri_for_prefix_ (parser, prefix);
			if (result == IntPtr.Zero)
				return null;
			string s = Marshal.PtrToStringAnsi (result);	// *copy* unmanaged string
			Marshal.FreeHGlobal (result);			// g_free the unmanaged string
			return s;
		}

		[DllImport ("moon")]
		// Value *xaml_lookup_named_item (void *parser, void *element_instance, const char *name);
		public extern static IntPtr xaml_lookup_named_item (IntPtr parser, IntPtr element_instance, string name);

		[DllImport ("moon")]
		// void *xaml_get_template_parent (void *parser, void *element_instance);
		public extern static IntPtr xaml_get_template_parent (IntPtr parser, IntPtr element_instance);

		[DllImport ("moon", EntryPoint="xaml_get_element_key")]
		// char *xaml_get_element_key (void *parser, void *element_instance);
		private extern static IntPtr xaml_get_element_key_ (IntPtr parser, IntPtr element_instance);
		public static string xaml_get_element_key (IntPtr parser, IntPtr element_instance)
		{
			IntPtr result;
			result = xaml_get_element_key_ (parser, element_instance);
			if (result == IntPtr.Zero)
				return null;
			string s = Marshal.PtrToStringAnsi (result);	// *copy* unmanaged string
			Marshal.FreeHGlobal (result);			// g_free the unmanaged string
			return s;
		}

		[DllImport ("moon", EntryPoint="xaml_get_element_name")]
		// char *xaml_get_element_name (void *parser, void *element_instance);
		private extern static IntPtr xaml_get_element_name_ (IntPtr parser, IntPtr element_instance);
		public static string xaml_get_element_name (IntPtr parser, IntPtr element_instance)
		{
			IntPtr result;
			result = xaml_get_element_name_ (parser, element_instance);
			if (result == IntPtr.Zero)
				return null;
			string s = Marshal.PtrToStringAnsi (result);	// *copy* unmanaged string
			Marshal.FreeHGlobal (result);			// g_free the unmanaged string
			return s;
		}

		[DllImport ("moon")]
		[return: MarshalAs (UnmanagedType.U1)]
		// bool xaml_is_property_set (void *parser, void *element_instance, char *name);
		public extern static bool xaml_is_property_set (IntPtr parser, IntPtr element_instance, string name);

		[DllImport ("moon")]
		// void xaml_mark_property_as_set (void *parser, void *element_instance, char *name);
		public extern static void xaml_mark_property_as_set (IntPtr parser, IntPtr element_instance, string name);

		[DllImport ("moon")]
		// void xaml_delay_set_property (void *parser, void *element_instance, const char *xmlns, const char *name, const Value *value);
		public extern static void xaml_delay_set_property (IntPtr parser, IntPtr element_instance, string xmlns, string name, ref Value value);

	}
}
