Author: spouliot
Date: 2007-04-02 13:51:43 -0400 (Mon, 02 Apr 2007)
New Revision: 75292

Modified:
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIOSX.cs
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11GTK.cs
Log:
2007-04-02  Sebastien Pouliot  <[EMAIL PROTECTED]>

        * XplatUIOSX.cs, XplatUIX11.cs, XplatUIX11GTK.cs: Remove dependency
        on an internal libgdiplus call when the information is already 
        available via the public API.



Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2007-04-02 17:28:50 UTC (rev 75291)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2007-04-02 17:51:43 UTC (rev 75292)
@@ -1,3 +1,9 @@
+2007-04-02  Sebastien Pouliot  <[EMAIL PROTECTED]>
+
+       * XplatUIOSX.cs, XplatUIX11.cs, XplatUIX11GTK.cs: Remove dependency
+       on an internal libgdiplus call when the information is already 
+       available via the public API.
+
 2007-04-02  Rolf Bjarne Kvinge <[EMAIL PROTECTED]> 
 
        * Control.cs: Call ContainerControl.ChildControlRemoved whenever a

Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIOSX.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIOSX.cs    
2007-04-02 17:28:50 UTC (rev 75291)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIOSX.cs    
2007-04-02 17:51:43 UTC (rev 75292)
@@ -1193,7 +1193,10 @@
 
                
                internal override bool GetFontMetrics(Graphics g, Font font, 
out int ascent, out int descent) {
-                       return GetFontMetrics(g.GetHdc(), font.ToHfont(), out 
ascent, out descent);
+                       FontFamily ff = font.FontFamily;
+                       ascent = ff.GetCellAscent (font.Style);
+                       descent = ff.GetCellDescent (font.Style);
+                       return true;
                }
                
                [MonoTODO]
@@ -2136,9 +2139,6 @@
                
[DllImport("/System/Library/Frameworks/Carbon.framework/Versions/Current/Carbon")]
                internal extern static void SetThemeCursor (uint inCursor);
                #endregion
-
-               [DllImport ("gdiplus", EntryPoint="GetFontMetrics")]
-               internal extern static bool GetFontMetrics(IntPtr 
graphicsObject, IntPtr nativeObject, out int ascent, out int descent);
        }
 
 }

Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs    
2007-04-02 17:28:50 UTC (rev 75291)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11.cs    
2007-04-02 17:51:43 UTC (rev 75292)
@@ -3362,7 +3362,10 @@
 
 
                internal override bool GetFontMetrics(Graphics g, Font font, 
out int ascent, out int descent) {
-                       return GetFontMetrics(g.GetHdc(), font.ToHfont(), out 
ascent, out descent);
+                       FontFamily ff = font.FontFamily;
+                       ascent = ff.GetCellAscent (font.Style);
+                       descent = ff.GetCellDescent (font.Style);
+                       return true;
                }
 
                internal override Point GetMenuOrigin(IntPtr handle) {
@@ -5679,9 +5682,6 @@
                [DllImport ("libX11", EntryPoint="XDeleteProperty")]
                internal extern static int XDeleteProperty(IntPtr display, 
IntPtr window, IntPtr property);
 
-               [DllImport ("gdiplus", EntryPoint="GetFontMetrics")]
-               internal extern static bool GetFontMetrics(IntPtr 
graphicsObject, IntPtr nativeObject, out int ascent, out int descent);
-
                // Drawing
                [DllImport ("libX11", EntryPoint="XCreateGC")]
                internal extern static IntPtr XCreateGC(IntPtr display, IntPtr 
window, IntPtr valuemask, ref XGCValues values);

Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11GTK.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11GTK.cs 
2007-04-02 17:28:50 UTC (rev 75291)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIX11GTK.cs 
2007-04-02 17:51:43 UTC (rev 75292)
@@ -4503,9 +4503,6 @@
                [DllImport ("libX11", EntryPoint="XDeleteProperty")]
                internal extern static int XDeleteProperty (IntPtr display, 
IntPtr window, int property);
                
-               [DllImport ("gdiplus", EntryPoint="GetFontMetrics")]
-               internal extern static bool GetFontMetrics (IntPtr 
graphicsObject, IntPtr nativeObject, out int ascent, out int descent);
-               
                // Drawing
                [DllImport ("libX11", EntryPoint="XCreateGC")]
                internal extern static IntPtr XCreateGC (IntPtr display, IntPtr 
window, GCFunction valuemask, ref XGCValues values);

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to