Author: jpobst
Date: 2007-02-26 17:57:06 -0500 (Mon, 26 Feb 2007)
New Revision: 73450

Modified:
   
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.VisualStyles/ChangeLog
   
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.VisualStyles/UXTheme.cs
   
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.VisualStyles/VisualStyleRenderer.cs
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextRenderer.cs
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIStructs.cs
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIWin32.cs
Log:
2007-02-26  Jonathan Pobst  <[EMAIL PROTECTED]>

        * XplatUIStructs.cs: Add some convenience methods for POINT structure.
        * XplatUIWin32.cs: Add some convenience methods for RECT structure,
        delete POINT structure, duplicate of one in XplatUIStructs.
        * TextRenderer.cs: Use XplatUIWin32.RECT instead of UXTheme.RECT.

2007-02-26  Jonathan Pobst  <[EMAIL PROTECTED]>

        * UXTheme.cs: Remove RECT, POINT, and TEXTMETRICS structures,
        use ones from Xplat instead.
        * VisualStyleRenderer.cs: Use Xplat structs instead of UXTheme ones.

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2007-02-26 22:37:48 UTC (rev 73449)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2007-02-26 22:57:06 UTC (rev 73450)
@@ -1,3 +1,10 @@
+2007-02-26  Jonathan Pobst  <[EMAIL PROTECTED]>
+
+       * XplatUIStructs.cs: Add some convenience methods for POINT structure.
+       * XplatUIWin32.cs: Add some convenience methods for RECT structure,
+       delete POINT structure, duplicate of one in XplatUIStructs.
+       * TextRenderer.cs: Use XplatUIWin32.RECT instead of UXTheme.RECT.
+
 2007-02-26  Gert Driesen  <[EMAIL PROTECTED]>
 
        * ListView.cs: Initialize LabelEditEventArgs after setting Text of

Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextRenderer.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextRenderer.cs  
2007-02-26 22:37:48 UTC (rev 73449)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextRenderer.cs  
2007-02-26 22:57:06 UTC (rev 73450)
@@ -166,7 +166,7 @@
                                        SetBkMode (hdc, 1);     
//1-Transparent, 2-Opaque
                                }
 
-                               UXTheme.RECT r = UXTheme.RECT.FromRectangle 
(new_bounds);
+                               XplatUIWin32.RECT r = 
XplatUIWin32.RECT.FromRectangle (new_bounds);
 
                                IntPtr prevobj;
 
@@ -216,7 +216,7 @@
 
                                IntPtr hdc = dc.GetHdc ();
 
-                               UXTheme.RECT r = UXTheme.RECT.FromRectangle 
(new Rectangle (Point.Empty, proposedSize));
+                               XplatUIWin32.RECT r = 
XplatUIWin32.RECT.FromRectangle (new Rectangle (Point.Empty, proposedSize));
 
                                IntPtr prevobj;
 
@@ -256,7 +256,7 @@
                }
                #endregion
 
-               #region Internal Methods That Are Just Overloads
+#region Internal Methods That Are Just Overloads
                internal static void DrawTextInternal (IDeviceContext dc, 
string text, Font font, Point pt, Color foreColor, bool useDrawString)
                {
                        DrawTextInternal (dc, text, font, pt, foreColor, 
Color.Transparent, TextFormatFlags.Default, useDrawString);
@@ -317,9 +317,9 @@
                {
                        return MeasureTextInternal (Graphics.FromImage 
(measure_bitmap), text, font, proposedSize, flags, useMeasureString);
                }
-               #endregion
+#endregion
 
-               #region Private Methods
+#region Private Methods
                private static StringFormat FlagsToStringFormat 
(TextFormatFlags flags)
                {
                        StringFormat sf = new StringFormat ();
@@ -434,11 +434,11 @@
 
                        return r;
                }
-               #endregion
+#endregion
 
-               #region DllImports (Windows)
+#region DllImports (Windows)
                [DllImport ("user32", CharSet = CharSet.Unicode, EntryPoint = 
"DrawText")]
-               static extern int Win32DrawText (IntPtr hdc, string lpStr, int 
nCount, ref UXTheme.RECT lpRect, int wFormat);
+               static extern int Win32DrawText (IntPtr hdc, string lpStr, int 
nCount, ref XplatUIWin32.RECT lpRect, int wFormat);
 
                [DllImport ("gdi32")]
                static extern int SetTextColor (IntPtr hdc, int crColor);
@@ -457,7 +457,7 @@
 
                [DllImport("gdi32")]
                static extern bool SelectClipRgn(IntPtr hdc, IntPtr hrgn);
-               #endregion
+#endregion
        }
 }
 #endif

Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIStructs.cs
===================================================================
--- 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIStructs.cs    
    2007-02-26 22:37:48 UTC (rev 73449)
+++ 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIStructs.cs    
    2007-02-26 22:57:06 UTC (rev 73450)
@@ -424,6 +424,17 @@
        internal struct POINT {
                internal int x;
                internal int y;
+
+               internal POINT (int x, int y)
+               {
+                       this.x = x;
+                       this.y = y;
+               }
+
+               internal Point ToPoint ()
+               {
+                       return new Point (x, y);
+               }
        }
        
        [StructLayout(LayoutKind.Sequential)] 

Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIWin32.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIWin32.cs  
2007-02-26 22:37:48 UTC (rev 73449)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIWin32.cs  
2007-02-26 22:57:06 UTC (rev 73450)
@@ -89,16 +89,57 @@
                        internal int            top;
                        internal int            right;
                        internal int            bottom;
-                       public override string ToString() {
+
+                       public RECT (int left, int top, int right, int bottom)
+                       {
+                               this.left = left;
+                               this.top = top;
+                               this.right = right;
+                               this.bottom = bottom;
+                       }
+
+                       #region Instance Properties
+                       public int Height { get { return bottom - top + 1; } }
+                       public int Width { get { return right - left + 1; } }
+                       public Size Size { get { return new Size (Width, 
Height); } }
+                       public Point Location { get { return new Point (left, 
top); } }
+                       #endregion
+
+                       #region Instance Methods
+                       public Rectangle ToRectangle ()
+                       {
+                               return Rectangle.FromLTRB (left, top, right, 
bottom);
+                       }
+
+                       public static RECT FromRectangle (Rectangle rectangle)
+                       {
+                               return new RECT (rectangle.Left, rectangle.Top, 
rectangle.Right, rectangle.Bottom);
+                       }
+
+                       public override int GetHashCode ()
+                       {
+                               return left ^ ((top << 13) | (top >> 0x13))
+                                 ^ ((Width << 0x1a) | (Width >> 6))
+                                 ^ ((Height << 7) | (Height >> 0x19));
+                       }
+                       
+                       public override string ToString ()
+                       {
                                return String.Format("RECT left={0}, top={1}, 
right={2}, bottom={3}, width={4}, height={5}", left, top, right, bottom, 
right-left, bottom-top);
                        }
+                       #endregion
 
-               }
+                       #region Operator overloads
+                       public static implicit operator Rectangle (RECT rect)
+                       {
+                               return Rectangle.FromLTRB (rect.left, rect.top, 
rect.right, rect.bottom);
+                       }
 
-               [StructLayout(LayoutKind.Sequential)]
-               internal struct POINT {
-                       internal int            x;
-                       internal int            y;
+                       public static implicit operator RECT (Rectangle rect)
+                       {
+                               return new RECT (rect.Left, rect.Top, 
rect.Right, rect.Bottom);
+                       }
+                       #endregion
                }
 
                internal enum SPIAction {

Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.VisualStyles/ChangeLog
===================================================================
--- 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.VisualStyles/ChangeLog
   2007-02-26 22:37:48 UTC (rev 73449)
+++ 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.VisualStyles/ChangeLog
   2007-02-26 22:57:06 UTC (rev 73450)
@@ -1,3 +1,9 @@
+2007-02-26  Jonathan Pobst  <[EMAIL PROTECTED]>
+
+       * UXTheme.cs: Remove RECT, POINT, and TEXTMETRICS structures,
+       use ones from Xplat instead.
+       * VisualStyleRenderer.cs: Use Xplat structs instead of UXTheme ones.
+
 2007-01-19  Chris Toshok  <[EMAIL PROTECTED]>
 
        * VisualStyleElement.cs: rename TaskBar to Taskbar, and

Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.VisualStyles/UXTheme.cs
===================================================================
--- 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.VisualStyles/UXTheme.cs
  2007-02-26 22:37:48 UTC (rev 73449)
+++ 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.VisualStyles/UXTheme.cs
  2007-02-26 22:57:06 UTC (rev 73450)
@@ -31,6 +31,7 @@
 using System.Runtime.InteropServices;
 using System.Drawing;
 using System.Text;
+using System.Windows.Forms;
 
 namespace System.Windows.Forms.VisualStyles
 {
@@ -42,29 +43,29 @@
 
                [DllImport ("uxtheme", ExactSpelling = true, CharSet = 
CharSet.Unicode)]
                public extern static Int32 DrawThemeBackground (IntPtr hTheme, 
IntPtr hdc, int iPartId,
-                  int iStateId, ref RECT pRect, ref RECT pClipRect);
+                  int iStateId, ref XplatUIWin32.RECT pRect, ref 
XplatUIWin32.RECT pClipRect);
 
                [DllImport ("uxtheme", ExactSpelling = true, CharSet = 
CharSet.Unicode)]
                public extern static Int32 DrawThemeBackground (IntPtr hTheme, 
IntPtr hdc, int iPartId,
-                  int iStateId, ref RECT pRect, IntPtr pClipRect);
+                  int iStateId, ref XplatUIWin32.RECT pRect, IntPtr pClipRect);
 
                [DllImport ("uxtheme", ExactSpelling = true, CharSet = 
CharSet.Unicode)]
-               public extern static Int32 DrawThemeEdge (IntPtr hTheme, IntPtr 
hdc, int iPartId, int iStateId, ref RECT pDestRect, uint egde, uint flags, out 
RECT pRect);
+               public extern static Int32 DrawThemeEdge (IntPtr hTheme, IntPtr 
hdc, int iPartId, int iStateId, ref XplatUIWin32.RECT pDestRect, uint egde, 
uint flags, out XplatUIWin32.RECT pRect);
 
                [DllImport ("uxtheme", ExactSpelling = true, CharSet = 
CharSet.Unicode)]
-               public extern static Int32 DrawThemeEdge (IntPtr hTheme, IntPtr 
hdc, int iPartId, int iStateId, ref RECT pDestRect, uint edge, uint flags, int 
pRect);
+               public extern static Int32 DrawThemeEdge (IntPtr hTheme, IntPtr 
hdc, int iPartId, int iStateId, ref XplatUIWin32.RECT pDestRect, uint edge, 
uint flags, int pRect);
 
                [DllImport ("uxtheme", ExactSpelling = true, CharSet = 
CharSet.Unicode)]
-               public extern static Int32 DrawThemeIcon (IntPtr hTheme, IntPtr 
hdc, int iPartId, int iStateId, ref RECT pRect, IntPtr himl, int iImageIndex);
+               public extern static Int32 DrawThemeIcon (IntPtr hTheme, IntPtr 
hdc, int iPartId, int iStateId, ref XplatUIWin32.RECT pRect, IntPtr himl, int 
iImageIndex);
 
                [DllImport ("uxtheme", ExactSpelling = true, CharSet = 
CharSet.Unicode)]
-               public extern static Int32 DrawThemeParentBackground (IntPtr 
hWnd, IntPtr hdc, ref RECT pRect);
+               public extern static Int32 DrawThemeParentBackground (IntPtr 
hWnd, IntPtr hdc, ref XplatUIWin32.RECT pRect);
 
                [DllImport ("uxtheme", ExactSpelling = true, CharSet = 
CharSet.Unicode)]
                public extern static Int32 DrawThemeParentBackground (IntPtr 
hWnd, IntPtr hdc, int pRect);
 
                [DllImport ("uxtheme", ExactSpelling = true, CharSet = 
CharSet.Unicode)]
-               public extern static Int32 DrawThemeText (IntPtr hTheme, IntPtr 
hdc, int iPartId, int iStateId, String text, int textLength, UInt32 textFlags, 
UInt32 textFlags2, ref RECT pRect);
+               public extern static Int32 DrawThemeText (IntPtr hTheme, IntPtr 
hdc, int iPartId, int iStateId, String text, int textLength, UInt32 textFlags, 
UInt32 textFlags2, ref XplatUIWin32.RECT pRect);
 
                [DllImport ("uxtheme", ExactSpelling = true, CharSet = 
CharSet.Unicode)]
                public extern static Int32 EnableTheming (int fEnable);
@@ -73,13 +74,13 @@
                public static extern IntPtr OpenThemeData (IntPtr hWnd, String 
classList);
 
                [DllImport ("uxtheme", ExactSpelling = true, CharSet = 
CharSet.Unicode)]
-               public extern static Int32 GetThemeBackgroundContentRect 
(IntPtr hTheme, IntPtr hdc, int iPartId, int iStateId, ref RECT pBoundingRect, 
out RECT pContentRect);
+               public extern static Int32 GetThemeBackgroundContentRect 
(IntPtr hTheme, IntPtr hdc, int iPartId, int iStateId, ref XplatUIWin32.RECT 
pBoundingRect, out XplatUIWin32.RECT pContentRect);
 
                [DllImport ("uxtheme", ExactSpelling = true, CharSet = 
CharSet.Unicode)]
-               public extern static Int32 GetThemeBackgroundExtent (IntPtr 
hTheme, IntPtr hdc, int iPartId, int iStateId, ref RECT pRect, ref RECT 
pClipRect);
+               public extern static Int32 GetThemeBackgroundExtent (IntPtr 
hTheme, IntPtr hdc, int iPartId, int iStateId, ref XplatUIWin32.RECT pRect, ref 
XplatUIWin32.RECT pClipRect);
 
                [DllImport ("uxtheme", ExactSpelling = true, CharSet = 
CharSet.Unicode)]
-               public extern static Int32 GetThemeBackgroundRegion (IntPtr 
hTheme, IntPtr hdc, int iPartId, int iStateId, ref RECT pRect, out IntPtr 
pRegion);
+               public extern static Int32 GetThemeBackgroundRegion (IntPtr 
hTheme, IntPtr hdc, int iPartId, int iStateId, ref XplatUIWin32.RECT pRect, out 
IntPtr pRegion);
 
                [DllImport ("uxtheme", ExactSpelling = true, CharSet = 
CharSet.Unicode)]
                public extern static Int32 GetThemeBool (IntPtr hTheme, int 
iPartId, int iStateId, int iPropId, out int pfVal);
@@ -103,10 +104,10 @@
                public extern static Int32 GetThemeInt (IntPtr hTheme, int 
iPartId, int iStateId, int iPropId, out int piVal);
 
                [DllImport ("uxtheme", ExactSpelling = true, CharSet = 
CharSet.Unicode)]
-               public extern static Int32 GetThemeMargins (IntPtr hTheme, 
IntPtr hdc, int iPartId, int iStateId, int iPropId, out RECT prc, out MARGINS 
pMargins);
+               public extern static Int32 GetThemeMargins (IntPtr hTheme, 
IntPtr hdc, int iPartId, int iStateId, int iPropId, out XplatUIWin32.RECT prc, 
out MARGINS pMargins);
 
                [DllImport ("uxtheme", ExactSpelling = true, CharSet = 
CharSet.Unicode)]
-               public extern static Int32 GetThemePartSize (IntPtr hTheme, 
IntPtr hdc, int iPartId, int iStateId, ref RECT pRect, int eSize, out SIZE 
size);
+               public extern static Int32 GetThemePartSize (IntPtr hTheme, 
IntPtr hdc, int iPartId, int iStateId, ref XplatUIWin32.RECT pRect, int eSize, 
out SIZE size);
 
                [DllImport ("uxtheme", ExactSpelling = true, CharSet = 
CharSet.Unicode)]
                public extern static Int32 GetThemePartSize (IntPtr hTheme, 
IntPtr hdc, int iPartId, int iStateId, int pRect, int eSize, out SIZE size);
@@ -118,16 +119,16 @@
                public extern static Int32 GetThemeString (IntPtr hTheme, int 
iPartId, int iStateId, int iPropId, [MarshalAs (UnmanagedType.LPWStr)] 
Text.StringBuilder themeString, int themeStringLength);
 
                [DllImport ("uxtheme", ExactSpelling = true, CharSet = 
CharSet.Unicode)]
-               public extern static Int32 GetThemeTextExtent (IntPtr hTheme, 
IntPtr hdc, int iPartId, int iStateId, String text, int textLength, int 
textFlags, ref RECT boundingRect, out RECT extentRect);
+               public extern static Int32 GetThemeTextExtent (IntPtr hTheme, 
IntPtr hdc, int iPartId, int iStateId, String text, int textLength, int 
textFlags, ref XplatUIWin32.RECT boundingRect, out XplatUIWin32.RECT 
extentRect);
 
                [DllImport ("uxtheme", ExactSpelling = true, CharSet = 
CharSet.Unicode)]
-               public extern static Int32 GetThemeTextExtent (IntPtr hTheme, 
IntPtr hdc, int iPartId, int iStateId, String text, int textLength, int 
textFlags, int boundingRect, out RECT extentRect);
+               public extern static Int32 GetThemeTextExtent (IntPtr hTheme, 
IntPtr hdc, int iPartId, int iStateId, String text, int textLength, int 
textFlags, int boundingRect, out XplatUIWin32.RECT extentRect);
 
                [DllImport ("uxtheme", ExactSpelling = true, CharSet = 
CharSet.Unicode)]
-               public extern static Int32 GetThemeTextMetrics (IntPtr hTheme, 
IntPtr hdc, int iPartId, int iStateId, out TEXTMETRIC textMetric);
+               public extern static Int32 GetThemeTextMetrics (IntPtr hTheme, 
IntPtr hdc, int iPartId, int iStateId, out XplatUIWin32.TEXTMETRIC textMetric);
 
                [DllImport ("uxtheme", ExactSpelling = true, CharSet = 
CharSet.Unicode)]
-               public extern static Int32 HitTestThemeBackground (IntPtr 
hTheme, IntPtr hdc, int iPartId, int iStateId, UInt32 dwOptions, ref RECT 
pRect, IntPtr hrgn, POINT ptTest, out HitTestCode code);
+               public extern static Int32 HitTestThemeBackground (IntPtr 
hTheme, IntPtr hdc, int iPartId, int iStateId, UInt32 dwOptions, ref 
XplatUIWin32.RECT pRect, IntPtr hrgn, POINT ptTest, out HitTestCode code);
 
                [DllImport ("uxtheme", ExactSpelling = true, CharSet = 
CharSet.Unicode)]
                public extern static int IsThemeBackgroundPartiallyTransparent 
(IntPtr hTheme, int iPartId, int iStateId);
@@ -142,7 +143,7 @@
                public extern static bool IsAppThemed ();
 
                [DllImport ("uxtheme", ExactSpelling = true, CharSet = 
CharSet.Unicode)]
-               public extern static Int32 HitTestThemeBackground (IntPtr 
hTheme, IntPtr hdc, int iPartId, int iStateId, UInt32 dwOptions, ref RECT 
pRect, IntPtr hrgn, POINT ptTest, out int code);
+               public extern static Int32 HitTestThemeBackground (IntPtr 
hTheme, IntPtr hdc, int iPartId, int iStateId, UInt32 dwOptions, ref 
XplatUIWin32.RECT pRect, IntPtr hrgn, POINT ptTest, out int code);
 
                [DllImport ("uxtheme", ExactSpelling = true, CharSet = 
CharSet.Unicode)]
                public extern static Int32 GetThemeDocumentationProperty 
(String stringThemeName, String stringPropertyName, StringBuilder stringValue, 
int lengthValue);
@@ -159,64 +160,7 @@
                [DllImport ("uxtheme", ExactSpelling = true, CharSet = 
CharSet.Unicode)]
                public extern static int GetThemeSysBool (IntPtr hTheme, int 
iBoolId);
                #endregion
-               
-               #region RECT Type
-               [Serializable, StructLayout (LayoutKind.Sequential)]
-               public struct RECT
-               {
-                       public int Left;
-                       public int Top;
-                       public int Right;
-                       public int Bottom;
 
-                       public RECT (int left, int top, int right, int bottom)
-                       {
-                               this.Left = left;
-                               this.Top = top;
-                               this.Right = right;
-                               this.Bottom = bottom;
-                       }
-
-                       #region Instance Properties
-                       public int Height { get { return Bottom - Top + 1; } }
-                       public int Width { get { return Right - Left + 1; } }
-                       public Size Size { get { return new Size (Width, 
Height); } }
-                       public Point Location { get { return new Point (Left, 
Top); } }
-                       #endregion
-
-                       #region Instance Methods
-                       public Rectangle ToRectangle ()
-                       {
-                               return Rectangle.FromLTRB (Left, Top, Right, 
Bottom);
-                       }
-
-                       public static RECT FromRectangle (Rectangle rectangle)
-                       {
-                               return new RECT (rectangle.Left, rectangle.Top, 
rectangle.Right, rectangle.Bottom);
-                       }
-
-                       public override int GetHashCode ()
-                       {
-                               return Left ^ ((Top << 13) | (Top >> 0x13))
-                                 ^ ((Width << 0x1a) | (Width >> 6))
-                                 ^ ((Height << 7) | (Height >> 0x19));
-                       }
-                       #endregion
-
-                       #region Operator overloads
-                       public static implicit operator Rectangle (RECT rect)
-                       {
-                               return Rectangle.FromLTRB (rect.Left, rect.Top, 
rect.Right, rect.Bottom);
-                       }
-
-                       public static implicit operator RECT (Rectangle rect)
-                       {
-                               return new RECT (rect.Left, rect.Top, 
rect.Right, rect.Bottom);
-                       }
-                       #endregion
-               }
-               #endregion
-
                #region LOGFONT Type
                [StructLayout (LayoutKind.Sequential, CharSet = CharSet.Auto)]
                public class LOGFONT
@@ -268,63 +212,6 @@
                        }
                }
                #endregion
-               
-               #region POINT Type
-               [StructLayout (LayoutKind.Sequential)]
-               public struct POINT
-               {
-                       public int X;
-                       public int Y;
-
-                       public POINT (int x, int y)
-                       {
-                               this.X = x;
-                               this.Y = y;
-                       }
-
-                       public Point ToPoint ()
-                       {
-                               return new Point (X, Y);
-                       }
-
-                       public static implicit operator System.Drawing.Point 
(POINT p)
-                       {
-                               return new System.Drawing.Point (p.X, p.Y);
-                       }
-
-                       public static implicit operator POINT 
(System.Drawing.Point p)
-                       {
-                               return new POINT (p.X, p.Y);
-                       }
-               }
-               #endregion
-               
-               #region TEXTMETRIC Type
-               [Serializable, StructLayout (LayoutKind.Sequential, CharSet = 
CharSet.Auto)]
-               public struct TEXTMETRIC
-               {
-                       public int tmHeight;
-                       public int tmAscent;
-                       public int tmDescent;
-                       public int tmInternalLeading;
-                       public int tmExternalLeading;
-                       public int tmAveCharWidth;
-                       public int tmMaxCharWidth;
-                       public int tmWeight;
-                       public int tmOverhang;
-                       public int tmDigitizedAspectX;
-                       public int tmDigitizedAspectY;
-                       public char tmFirstChar;
-                       public char tmLastChar;
-                       public char tmDefaultChar;
-                       public char tmBreakChar;
-                       public byte tmItalic;
-                       public byte tmUnderlined;
-                       public byte tmStruckOut;
-                       public byte tmPitchAndFamily;
-                       public byte tmCharSet;
-               }
-               #endregion
        }
 }
 #endif
\ No newline at end of file

Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.VisualStyles/VisualStyleRenderer.cs
===================================================================
--- 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.VisualStyles/VisualStyleRenderer.cs
      2007-02-26 22:37:48 UTC (rev 73449)
+++ 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms.VisualStyles/VisualStyleRenderer.cs
      2007-02-26 22:57:06 UTC (rev 73450)
@@ -92,7 +92,7 @@
                        if (dc == null)
                                throw new ArgumentNullException ("dc");
 
-                       UXTheme.RECT BoundsRect = UXTheme.RECT.FromRectangle 
(bounds);
+                       XplatUIWin32.RECT BoundsRect = 
XplatUIWin32.RECT.FromRectangle (bounds);
 
                        last_hresult = UXTheme.DrawThemeBackground (theme, 
dc.GetHdc (), this.part, this.state, ref BoundsRect, IntPtr.Zero);
                        dc.ReleaseHdc ();
@@ -103,8 +103,8 @@
                        if (dc == null)
                                throw new ArgumentNullException ("dc");
 
-                       UXTheme.RECT BoundsRect = UXTheme.RECT.FromRectangle 
(bounds);
-                       UXTheme.RECT ClipRect = UXTheme.RECT.FromRectangle 
(clipRectangle);
+                       XplatUIWin32.RECT BoundsRect = 
XplatUIWin32.RECT.FromRectangle (bounds);
+                       XplatUIWin32.RECT ClipRect = 
XplatUIWin32.RECT.FromRectangle (clipRectangle);
 
                        last_hresult = UXTheme.DrawThemeBackground (theme, 
dc.GetHdc (), this.part, this.state, ref BoundsRect, ref ClipRect);
                        dc.ReleaseHdc ();
@@ -115,8 +115,8 @@
                        if (dc == null)
                                throw new ArgumentNullException ("dc");
 
-                       UXTheme.RECT BoundsRect = UXTheme.RECT.FromRectangle 
(bounds);
-                       UXTheme.RECT retval;
+                       XplatUIWin32.RECT BoundsRect = 
XplatUIWin32.RECT.FromRectangle (bounds);
+                       XplatUIWin32.RECT retval;
 
                        last_hresult = UXTheme.DrawThemeEdge (theme, dc.GetHdc 
(), this.part, this.state, ref BoundsRect, (uint)style, (uint)edges + 
(uint)effects, out retval);
                        dc.ReleaseHdc ();
@@ -150,7 +150,7 @@
                        if (dc == null)
                                throw new ArgumentNullException ("dc");
 
-                       UXTheme.RECT BoundsRect = UXTheme.RECT.FromRectangle 
(bounds);
+                       XplatUIWin32.RECT BoundsRect = 
XplatUIWin32.RECT.FromRectangle (bounds);
 
                        using (Graphics g = Graphics.FromHwnd 
(childControl.Handle)) {
                                last_hresult = 
UXTheme.DrawThemeParentBackground (childControl.Handle, g.GetHdc (), ref 
BoundsRect);
@@ -163,7 +163,7 @@
                        if (dc == null)
                                throw new ArgumentNullException ("dc");
 
-                       UXTheme.RECT BoundsRect = UXTheme.RECT.FromRectangle 
(bounds);
+                       XplatUIWin32.RECT BoundsRect = 
XplatUIWin32.RECT.FromRectangle (bounds);
 
                        last_hresult = UXTheme.DrawThemeText (theme, dc.GetHdc 
(), this.part, this.state, textToDraw, textToDraw.Length, (uint)flags, 0, ref 
BoundsRect);
                        dc.ReleaseHdc ();
@@ -184,8 +184,8 @@
                        if (dc == null)
                                throw new ArgumentNullException ("dc");
 
-                       UXTheme.RECT BoundsRect = UXTheme.RECT.FromRectangle 
(bounds);
-                       UXTheme.RECT retval;
+                       XplatUIWin32.RECT BoundsRect = 
XplatUIWin32.RECT.FromRectangle (bounds);
+                       XplatUIWin32.RECT retval;
 
                        last_hresult = UXTheme.GetThemeBackgroundContentRect 
(theme, dc.GetHdc (), this.part, this.state, ref BoundsRect, out retval);
                        dc.ReleaseHdc ();
@@ -198,8 +198,8 @@
                        if (dc == null)
                                throw new ArgumentNullException ("dc");
 
-                       UXTheme.RECT BoundsRect = UXTheme.RECT.FromRectangle 
(contentBounds);
-                       UXTheme.RECT retval = new UXTheme.RECT ();
+                       XplatUIWin32.RECT BoundsRect = 
XplatUIWin32.RECT.FromRectangle (contentBounds);
+                       XplatUIWin32.RECT retval = new XplatUIWin32.RECT ();
 
                        last_hresult = UXTheme.GetThemeBackgroundExtent (theme, 
dc.GetHdc (), this.part, this.state, ref BoundsRect, ref retval);
                        dc.ReleaseHdc ();
@@ -213,7 +213,7 @@
                        if (dc == null)
                                throw new ArgumentNullException ("dc");
 
-                       UXTheme.RECT BoundsRect = UXTheme.RECT.FromRectangle 
(contentBounds);
+                       XplatUIWin32.RECT BoundsRect = 
XplatUIWin32.RECT.FromRectangle (contentBounds);
                        IntPtr retval;
 
                        last_hresult = UXTheme.GetThemeBackgroundRegion (theme, 
dc.GetHdc (), this.part, this.state, ref BoundsRect, out retval);
@@ -307,7 +307,7 @@
 
 
                        UXTheme.MARGINS retval = new UXTheme.MARGINS ();
-                       UXTheme.RECT BoundsRect;
+                       XplatUIWin32.RECT BoundsRect;
 
                        last_hresult = UXTheme.GetThemeMargins (theme, 
dc.GetHdc (), this.part, this.state, (int)prop, out BoundsRect, out retval);
                        dc.ReleaseHdc ();
@@ -322,7 +322,7 @@
                        if (!Enum.IsDefined (typeof (ThemeSizeType), type))
                                throw new 
System.ComponentModel.InvalidEnumArgumentException ("prop", (int)type, typeof 
(ThemeSizeType));
 
-                       UXTheme.RECT BoundsRect = UXTheme.RECT.FromRectangle 
(bounds);
+                       XplatUIWin32.RECT BoundsRect = 
XplatUIWin32.RECT.FromRectangle (bounds);
                        UXTheme.SIZE retval;
 
                        last_hresult = UXTheme.GetThemePartSize (theme, 
dc.GetHdc (), this.part, this.state, ref BoundsRect, (int)type, out retval);
@@ -351,7 +351,7 @@
                        if (!Enum.IsDefined (typeof (PointProperty), prop))
                                throw new 
System.ComponentModel.InvalidEnumArgumentException ("prop", (int)prop, typeof 
(PointProperty));
 
-                       UXTheme.POINT retval;
+                       POINT retval;
                        last_hresult = UXTheme.GetThemePosition (theme, 
this.part, this.state, (int)prop, out retval);
 
                        return retval.ToPoint();
@@ -374,8 +374,8 @@
                        if (dc == null)
                                throw new ArgumentNullException ("dc");
 
-                       UXTheme.RECT BoundsRect = UXTheme.RECT.FromRectangle 
(bounds);
-                       UXTheme.RECT retval;
+                       XplatUIWin32.RECT BoundsRect = 
XplatUIWin32.RECT.FromRectangle (bounds);
+                       XplatUIWin32.RECT retval;
                        
                        last_hresult = UXTheme.GetThemeTextExtent (theme, 
dc.GetHdc (), this.part, this.state, textToDraw, textToDraw.Length, (int)flags, 
ref BoundsRect, out retval);
                        dc.ReleaseHdc ();
@@ -388,7 +388,7 @@
                        if (dc == null)
                                throw new ArgumentNullException ("dc");
 
-                       UXTheme.RECT retval;
+                       XplatUIWin32.RECT retval;
                        
                        last_hresult = UXTheme.GetThemeTextExtent (theme, 
dc.GetHdc (), this.part, this.state, textToDraw, textToDraw.Length, (int)flags, 
0, out retval);
                        dc.ReleaseHdc ();
@@ -401,7 +401,7 @@
                        if (dc == null)
                                throw new ArgumentNullException ("dc", "dc 
cannot be null.");
 
-                       UXTheme.TEXTMETRIC metrics;
+                       XplatUIWin32.TEXTMETRIC metrics;
                        
                        last_hresult = UXTheme.GetThemeTextMetrics (theme, 
dc.GetHdc (), this.part, this.state, out metrics);
                        dc.ReleaseHdc ();
@@ -409,18 +409,18 @@
                        TextMetrics retval = new TextMetrics ();
                        retval.Ascent = metrics.tmAscent;
                        retval.AverageCharWidth = metrics.tmAveCharWidth;
-                       retval.BreakChar = metrics.tmBreakChar;
+                       retval.BreakChar =(char)metrics.tmBreakChar;
                        retval.CharSet = 
(TextMetricsCharacterSet)metrics.tmCharSet;
-                       retval.DefaultChar = metrics.tmDefaultChar;
+                       retval.DefaultChar = (char)metrics.tmDefaultChar;
                        retval.Descent = metrics.tmDescent;
                        retval.DigitizedAspectX = metrics.tmDigitizedAspectX;
                        retval.DigitizedAspectY = metrics.tmDigitizedAspectY;
                        retval.ExternalLeading = metrics.tmExternalLeading;
-                       retval.FirstChar = metrics.tmFirstChar;
+                       retval.FirstChar = (char)metrics.tmFirstChar;
                        retval.Height = metrics.tmHeight;
                        retval.InternalLeading = metrics.tmInternalLeading;
                        retval.Italic = metrics.tmItalic == 0 ? false : true;
-                       retval.LastChar = metrics.tmLastChar;
+                       retval.LastChar = (char)metrics.tmLastChar;
                        retval.MaxCharWidth = metrics.tmMaxCharWidth;
                        retval.Overhang = metrics.tmOverhang;
                        retval.PitchAndFamily = 
(TextMetricsPitchAndFamilyValues)metrics.tmPitchAndFamily;
@@ -436,10 +436,10 @@
                        if (dc == null)
                                throw new ArgumentNullException ("dc");
 
-                       UXTheme.RECT BoundsRect = UXTheme.RECT.FromRectangle 
(backgroundRectangle);
+                       XplatUIWin32.RECT BoundsRect = 
XplatUIWin32.RECT.FromRectangle (backgroundRectangle);
                        int retval;
 
-                       last_hresult = UXTheme.HitTestThemeBackground (theme, 
dc.GetHdc (), this.part, this.state, (uint)options, ref BoundsRect, hRgn, new 
UXTheme.POINT(pt.X, pt.Y), out retval);
+                       last_hresult = UXTheme.HitTestThemeBackground (theme, 
dc.GetHdc (), this.part, this.state, (uint)options, ref BoundsRect, hRgn, new 
POINT(pt.X, pt.Y), out retval);
                        dc.ReleaseHdc ();
 
                        return (HitTestCode)retval;

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

Reply via email to