Merge branch 'master' of github.com:mono/mono into masterwork
[mono.git] / mcs / class / System.Drawing / System.Drawing / gdipFunctions.cs
index 835a1d20a403bab16f8891b679aff3ce87d32da0..cf48ecd6ec821f2215a8582868eec23b668c0c8f 100644 (file)
@@ -61,6 +61,7 @@ namespace System.Drawing
                public static IntPtr Display = IntPtr.Zero;
                public static bool UseX11Drawable = false;
                public static bool UseCarbonDrawable = false;
+               public static bool UseCocoaDrawable = false;
 
                #region gdiplus.dll functions
 
@@ -99,7 +100,7 @@ namespace System.Drawing
                static GDIPlus ()
                {
                        int platform = (int) Environment.OSVersion.Platform;
-                       if ((platform == 4) || (platform == 128)) {
+                       if ((platform == 4) || (platform == 6) || (platform == 128)) {
                                if (Environment.GetEnvironmentVariable ("not_supported_MONO_MWF_USE_NEW_X11_BACKEND") != null || Environment.GetEnvironmentVariable ("MONO_MWF_MAC_FORCE_X11") != null) {
                                        UseX11Drawable = true;
                                } else {
@@ -138,12 +139,12 @@ namespace System.Drawing
 
                static public bool RunningOnWindows ()
                {
-                       return !UseX11Drawable && !UseCarbonDrawable;
+                       return !UseX11Drawable && !UseCarbonDrawable && !UseCocoaDrawable;
                }
 
                static public bool RunningOnUnix ()
                {
-                       return UseX11Drawable || UseCarbonDrawable;
+                       return UseX11Drawable || UseCarbonDrawable || UseCocoaDrawable;
                }
                
                // Copies a Ptr to an array of Points and releases the memory
@@ -1429,8 +1430,8 @@ namespace System.Drawing
                internal static extern Status GdipCloneImageAttributes(IntPtr imageattr, out IntPtr cloneImageattr);
 
                [DllImport ("gdiplus.dll")]     
-               internal static extern Status GdipGetImageAttributesAdjustedPalette(IntPtr imageattr,
-                       out IntPtr colorPalette,  ColorAdjustType colorAdjustType);
+               internal static extern Status GdipGetImageAttributesAdjustedPalette (IntPtr imageattr, IntPtr colorPalette,
+                       ColorAdjustType colorAdjustType);
                        
                [DllImport ("gdiplus.dll")]     
                internal static extern Status GdipSetImageAttributesWrapMode(IntPtr imageattr,  WrapMode wrap,
@@ -1515,7 +1516,7 @@ namespace System.Drawing
                internal extern static IntPtr XGetVisualInfo (IntPtr display, int vinfo_mask, ref XVisualInfo vinfo_template, ref int nitems);
 
                [DllImport ("libX11", EntryPoint="XVisualIDFromVisual")]
-               internal extern static int XVisualIDFromVisual(IntPtr visual);
+               internal extern static IntPtr XVisualIDFromVisual (IntPtr visual);
 
                [DllImport ("libX11", EntryPoint="XFree")]
                internal extern static void XFree (IntPtr data);