Author: jpobst
Date: 2007-07-12 16:57:20 -0400 (Thu, 12 Jul 2007)
New Revision: 81902

Modified:
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
   
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/SystemInformation.cs
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Theme.cs
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUI.cs
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIDriver.cs
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIWin32.cs
Log:
2007-07-12  Jonathan Pobst  <[EMAIL PROTECTED]>

        * SystemInformation.cs, Theme.cs, XplatUI.cs, XplatUIDriver.cs,
        XplatUIWin32.cs: Implement SystemInformation 2.0 properties.

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2007-07-12 20:38:04 UTC (rev 81901)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2007-07-12 20:57:20 UTC (rev 81902)
@@ -1,3 +1,8 @@
+2007-07-12  Jonathan Pobst  <[EMAIL PROTECTED]>
+
+       * SystemInformation.cs, Theme.cs, XplatUI.cs, XplatUIDriver.cs,
+       XplatUIWin32.cs: Implement SystemInformation 2.0 properties.
+
 2007-07-12  Rolf Bjarne Kvinge <[EMAIL PROTECTED]> 
 
        * DateTimePicker.cs: If there's no part format specifier, return an

Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/SystemInformation.cs
===================================================================
--- 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/SystemInformation.cs 
    2007-07-12 20:38:04 UTC (rev 81901)
+++ 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/SystemInformation.cs 
    2007-07-12 20:57:20 UTC (rev 81902)
@@ -38,6 +38,11 @@
                {
                }
 
+#if NET_2_0
+               [MonoInternalNote ("Determine if we need an X11 implementation 
or if defaults are good.")]
+               public static int ActiveWindowTrackingDelay { get { return 
XplatUI.ActiveWindowTrackingDelay; } }
+#endif
+
                public static ArrangeDirection ArrangeDirection {
                        get {
                                return ThemeEngine.Current.ArrangeDirection;
@@ -61,6 +66,11 @@
                                return ThemeEngine.Current.Border3DSize;
                        }
                }
+               
+#if NET_2_0
+               [MonoInternalNote ("Determine if we need an X11 implementation 
or if defaults are good.")]
+               public static int BorderMultiplierFactor { get { return 
ThemeEngine.Current.BorderMultiplierFactor; } }
+#endif
 
                public static Size BorderSize {
                        get {
@@ -80,6 +90,13 @@
                        }
                }
 
+#if NET_2_0
+               [MonoInternalNote ("Determine if we need an X11 implementation 
or if defaults are good.")]
+               public static int CaretBlinkTime { get { return 
XplatUI.CaretBlinkTime; } }
+               [MonoInternalNote ("Determine if we need an X11 implementation 
or if defaults are good.")]
+               public static int CaretWidth { get { return XplatUI.CaretWidth; 
} }
+#endif
+
                public static string ComputerName {
                        get {
                                return Environment.MachineName;
@@ -134,6 +151,13 @@
                        }
                }
 
+#if NET_2_0
+               [MonoInternalNote ("Determine if we need an X11 implementation 
or if defaults are good.")]
+               public static int FontSmoothingContrast { get { return 
XplatUI.FontSmoothingContrast; } }
+               [MonoInternalNote ("Determine if we need an X11 implementation 
or if defaults are good.")]
+               public static int FontSmoothingType { get { return 
XplatUI.FontSmoothingType; } }
+#endif
+
                public static Size FrameBorderSize {
                        get {
                                return ThemeEngine.Current.FrameBorderSize;
@@ -146,6 +170,13 @@
                        }
                }
 
+#if NET_2_0
+               [MonoInternalNote ("Determine if we need an X11 implementation 
or if defaults are good.")]
+               public static int HorizontalFocusThickness { get { return 
ThemeEngine.Current.HorizontalFocusThickness; } }
+               [MonoInternalNote ("Determine if we need an X11 implementation 
or if defaults are good.")]
+               public static int HorizontalResizeBorderThickness { get { 
return XplatUI.HorizontalResizeBorderThickness; } }
+#endif
+
                public static int HorizontalScrollBarArrowWidth {
                        get {
                                return 
ThemeEngine.Current.HorizontalScrollBarArrowWidth;
@@ -190,6 +221,87 @@
                        }
                }
 
+#if NET_2_0
+               [MonoInternalNote ("Determine if we need an X11 implementation 
or if defaults are good.")]
+               public static bool IsActiveWindowTrackingEnabled {
+                       get { return XplatUI.IsActiveWindowTrackingEnabled; }
+               }
+
+               [MonoInternalNote ("Determine if we need an X11 implementation 
or if defaults are good.")]
+               public static bool IsComboBoxAnimationEnabled {
+                       get { return XplatUI.IsComboBoxAnimationEnabled; }
+               }
+
+               [MonoInternalNote ("Determine if we need an X11 implementation 
or if defaults are good.")]
+               public static bool IsDropShadowEnabled {
+                       get { return XplatUI.IsDropShadowEnabled; }
+               }
+
+               public static bool IsFlatMenuEnabled {
+                       get { return false; }
+               }
+
+               [MonoInternalNote ("Determine if we need an X11 implementation 
or if defaults are good.")]
+               public static bool IsFontSmoothingEnabled {
+                       get { return XplatUI.IsFontSmoothingEnabled; }
+               }
+
+               [MonoInternalNote ("Determine if we need an X11 implementation 
or if defaults are good.")]
+               public static bool IsHotTrackingEnabled {
+                       get { return XplatUI.IsHotTrackingEnabled; }
+               }
+
+               [MonoInternalNote ("Determine if we need an X11 implementation 
or if defaults are good.")]
+               public static bool IsIconTitleWrappingEnabled {
+                       get { return XplatUI.IsIconTitleWrappingEnabled; }
+               }
+
+               [MonoInternalNote ("Determine if we need an X11 implementation 
or if defaults are good.")]
+               public static bool IsKeyboardPreferred {
+                       get { return XplatUI.IsKeyboardPreferred; }
+               }
+
+               [MonoInternalNote ("Determine if we need an X11 implementation 
or if defaults are good.")]
+               public static bool IsListBoxSmoothScrollingEnabled {
+                       get { return XplatUI.IsListBoxSmoothScrollingEnabled; }
+               }
+
+               [MonoInternalNote ("Determine if we need an X11 implementation 
or if defaults are good.")]
+               public static bool IsMenuAnimationEnabled {
+                       get { return XplatUI.IsMenuAnimationEnabled; }
+               }
+
+               [MonoInternalNote ("Determine if we need an X11 implementation 
or if defaults are good.")]
+               public static bool IsMenuFadeEnabled {
+                       get { return XplatUI.IsMenuFadeEnabled; }
+               }
+
+               [MonoInternalNote ("Determine if we need an X11 implementation 
or if defaults are good.")]
+               public static bool IsMinimizeRestoreAnimationEnabled {
+                       get { return XplatUI.IsMinimizeRestoreAnimationEnabled; 
}
+               }
+
+               [MonoInternalNote ("Determine if we need an X11 implementation 
or if defaults are good.")]
+               public static bool IsSelectionFadeEnabled {
+                       get { return XplatUI.IsSelectionFadeEnabled; }
+               }
+
+               [MonoInternalNote ("Determine if we need an X11 implementation 
or if defaults are good.")]
+               public static bool IsSnapToDefaultEnabled {
+                       get { return XplatUI.IsSnapToDefaultEnabled; }
+               }
+
+               [MonoInternalNote ("Determine if we need an X11 implementation 
or if defaults are good.")]
+               public static bool IsTitleBarGradientEnabled {
+                       get { return XplatUI.IsTitleBarGradientEnabled; }
+               }
+
+               [MonoInternalNote ("Determine if we need an X11 implementation 
or if defaults are good.")]
+               public static bool IsToolTipAnimationEnabled {
+                       get { return XplatUI.IsToolTipAnimationEnabled; }
+               }
+#endif
+
                public static int KanjiWindowHeight {
                        get {
                                return 0;
@@ -235,6 +347,13 @@
                        }
                }
 
+#if NET_2_0
+               [MonoInternalNote ("Determine if we need an X11 implementation 
or if defaults are good.")]
+               public static Size MenuBarButtonSize {
+                       get { return ThemeEngine.Current.MenuBarButtonSize; }
+               }
+#endif
+
                public static Size MenuButtonSize {
                        get {
                                return ThemeEngine.Current.MenuButtonSize;
@@ -262,6 +381,11 @@
                        }
                }
 
+#if NET_2_0
+               [MonoInternalNote ("Determine if we need an X11 implementation 
or if defaults are good.")]
+               public static int MenuShowDelay { get { return 
XplatUI.MenuShowDelay; } }
+#endif
+
                public static bool MidEastEnabled {
                        get {
                                return false; // ??? how do we decide?
@@ -329,6 +453,11 @@
                        }
                }
 
+               [MonoInternalNote ("Determine if we need an X11 implementation 
or if defaults are good.")]
+               public static int MouseSpeed {
+                       get { return XplatUI.MouseSpeed; }
+               }
+               
                public static int MouseWheelScrollDelta {
                        get {
                                return XplatUI.MouseWheelScrollDelta;
@@ -373,6 +502,18 @@
                        }
                }
 
+#if NET_2_0
+               [MonoInternalNote ("Determine if we need an X11 implementation 
or if defaults are good.")]
+               public static LeftRightAlignment PopupMenuAlignment {
+                       get { return XplatUI.PopupMenuAlignment; }
+               }
+               
+               [MonoTODO ("Only implemented for Win32.")]
+               public static PowerStatus PowerStatus {
+                       get { return XplatUI.PowerStatus; }
+               }
+#endif
+
                public static Size PrimaryMonitorMaximizedWindowSize {
                        get {
                                return new Size(WorkingArea.Width, 
WorkingArea.Height);
@@ -391,6 +532,12 @@
                        }
                }
 
+#if NET_2_0
+               public static ScreenOrientation ScreenOrientation {
+                       get { return ScreenOrientation.Angle0; }
+               }
+#endif
+
                public static bool Secure {
                        get {
                                return true;
@@ -403,6 +550,18 @@
                        }
                }
 
+#if NET_2_0
+               [MonoInternalNote ("Determine if we need an X11 implementation 
or if defaults are good.")]
+               public static int SizingBorderWidth {
+                       get { return XplatUI.SizingBorderWidth; }
+               }
+
+               [MonoInternalNote ("Determine if we need an X11 implementation 
or if defaults are good.")]
+               public static Size SmallCaptionButtonSize {
+                       get { return XplatUI.SmallCaptionButtonSize; }
+               }
+#endif
+
                public static Size SmallIconSize {
                        get {
                                return XplatUI.SmallIconSize;
@@ -429,6 +588,13 @@
                        }
                }
 
+#if NET_2_0
+               [MonoInternalNote ("Determine if we need an X11 implementation 
or if defaults are good.")]
+               public static bool UIEffectsEnabled {
+                       get { return XplatUI.UIEffectsEnabled; }
+               }
+#endif
+
                public static string UserDomainName {
                        get {
                                return Environment.UserDomainName;
@@ -447,6 +613,13 @@
                        }
                }
 
+#if NET_2_0
+               [MonoInternalNote ("Determine if we need an X11 implementation 
or if defaults are good.")]
+               public static int VerticalFocusThickness { get { return 
ThemeEngine.Current.VerticalFocusThickness; } }
+               [MonoInternalNote ("Determine if we need an X11 implementation 
or if defaults are good.")]
+               public static int VerticalResizeBorderThickness { get { return 
XplatUI.VerticalResizeBorderThickness; } }
+#endif
+
                public static int VerticalScrollBarArrowHeight {
                        get {
                                return 
ThemeEngine.Current.VerticalScrollBarArrowHeight;

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Theme.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Theme.cs 
2007-07-12 20:38:04 UTC (rev 81901)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Theme.cs 
2007-07-12 20:57:20 UTC (rev 81902)
@@ -396,6 +396,8 @@
                        }
                }
 
+               public virtual int BorderMultiplierFactor { get { return 1; } }
+               
                public virtual Size BorderSizableSize {
                        get {
                                return new Size (3, 3);
@@ -456,6 +458,8 @@
                        }
                }
 
+               public virtual int HorizontalFocusThickness { get { return 1; } 
}
+               
                public virtual int HorizontalScrollBarArrowWidth {
                        get {
                                return 16;
@@ -486,6 +490,10 @@
                        }
                }
                
+               public virtual Size MenuBarButtonSize {
+                       get { return XplatUI.MenuBarButtonSize; }
+               }
+               
                public virtual Size MenuButtonSize {
                        get {
                                return new Size(18, 18);
@@ -534,6 +542,8 @@
                        }
                }
 
+               public virtual int VerticalFocusThickness { get { return 1; } }
+
                public virtual int VerticalScrollBarArrowHeight {
                        get {
                                return 16;

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUI.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUI.cs       
2007-07-12 20:38:04 UTC (rev 81901)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUI.cs       
2007-07-12 20:57:20 UTC (rev 81902)
@@ -105,6 +105,8 @@
                #endregion      // Constructor & Destructor
 
                #region Public Static Properties
+               public static int ActiveWindowTrackingDelay { get { return 
driver.ActiveWindowTrackingDelay; } }
+
                internal static string DefaultClassName {
                        get {
                                return default_class_name;
@@ -139,6 +141,9 @@
                        }
                }
 
+               public static int CaretBlinkTime { get { return 
driver.CaretBlinkTime; } }
+               public static int CaretWidth { get { return driver.CaretWidth; 
} }
+               
                static public Size CursorSize {
                        get {
                                return driver.CursorSize;
@@ -175,12 +180,17 @@
                        }
                }
 
+               public static int FontSmoothingContrast { get { return 
driver.FontSmoothingContrast; } }
+               public static int FontSmoothingType { get { return 
driver.FontSmoothingType; } }
+
                public static Size FrameBorderSize {
                        get {
                                return driver.FrameBorderSize;
                        }
                }
 
+               public static int HorizontalResizeBorderThickness { get { 
return driver.HorizontalResizeBorderThickness; } }
+               
                static public int HorizontalScrollBarHeight {
                        get {
                                return driver.HorizontalScrollBarHeight;
@@ -193,6 +203,22 @@
                        }
                }
 
+               public static bool IsActiveWindowTrackingEnabled { get { return 
driver.IsActiveWindowTrackingEnabled; } }
+               public static bool IsComboBoxAnimationEnabled { get { return 
driver.IsComboBoxAnimationEnabled; } }
+               public static bool IsDropShadowEnabled { get { return 
driver.IsDropShadowEnabled; } }
+               public static bool IsFontSmoothingEnabled { get { return 
driver.IsFontSmoothingEnabled; } }
+               public static bool IsHotTrackingEnabled { get { return 
driver.IsHotTrackingEnabled; } }
+               public static bool IsIconTitleWrappingEnabled { get { return 
driver.IsIconTitleWrappingEnabled; } }
+               public static bool IsKeyboardPreferred { get { return 
driver.IsKeyboardPreferred; } }
+               public static bool IsListBoxSmoothScrollingEnabled { get { 
return driver.IsListBoxSmoothScrollingEnabled; } }
+               public static bool IsMenuAnimationEnabled { get { return 
driver.IsMenuAnimationEnabled; } }
+               public static bool IsMenuFadeEnabled { get { return 
driver.IsMenuFadeEnabled; } }
+               public static bool IsMinimizeRestoreAnimationEnabled { get { 
return driver.IsMinimizeRestoreAnimationEnabled; } }
+               public static bool IsSelectionFadeEnabled { get { return 
driver.IsSelectionFadeEnabled; } }
+               public static bool IsSnapToDefaultEnabled { get { return 
driver.IsSnapToDefaultEnabled; } }
+               public static bool IsTitleBarGradientEnabled { get { return 
driver.IsTitleBarGradientEnabled; } }
+               public static bool IsToolTipAnimationEnabled { get { return 
driver.IsToolTipAnimationEnabled; } }
+               
                static public int KeyboardSpeed {
                        get {
                                return driver.KeyboardSpeed;
@@ -217,6 +243,9 @@
                        }
                }
 
+               static public Size MenuBarButtonSize { get { return 
driver.MenuBarButtonSize; } }
+               static public int MenuShowDelay { get { return 
driver.MenuShowDelay; } }
+               
                static public Size MinimizedWindowSize {
                        get {
                                return driver.MinimizedWindowSize;
@@ -241,6 +270,10 @@
                        }
                }
 
+               public static int MouseSpeed {
+                       get { return driver.MouseSpeed; }
+               }
+               
                static public Size SmallIconSize {
                        get {
                                return driver.SmallIconSize;
@@ -289,12 +322,36 @@
                        }
                }
 
+               public static LeftRightAlignment PopupMenuAlignment {
+                       get { return driver.PopupMenuAlignment; }
+               }
+               
+#if NET_2_0
+               public static PowerStatus PowerStatus {
+                       get { return driver.PowerStatus; }
+               }
+#endif
+
+               public static int SizingBorderWidth {
+                       get { return driver.SizingBorderWidth; }
+               }
+               
+               public static Size SmallCaptionButtonSize {
+                       get { return driver.SmallCaptionButtonSize; }
+               }
+               
+               public static bool UIEffectsEnabled {
+                       get { return driver.UIEffectsEnabled; }
+               }
+               
                static public bool UserClipWontExposeParent {
                        get {
                                return driver.UserClipWontExposeParent;
                        }
                }
 
+               public static int VerticalResizeBorderThickness { get { return 
driver.VerticalResizeBorderThickness; } }
+
                static public int VerticalScrollBarWidth {
                        get {
                                return driver.VerticalScrollBarWidth;

Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIDriver.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIDriver.cs 
2007-07-12 20:38:04 UTC (rev 81901)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIDriver.cs 
2007-07-12 20:57:20 UTC (rev 81902)
@@ -38,6 +38,8 @@
 
 
                #region XplatUI Driver Properties
+               internal virtual int ActiveWindowTrackingDelay { get { return 
0; } }
+
                internal virtual Color ForeColor {
                        get {
                                return 
ThemeEngine.Current.DefaultWindowForeColor;
@@ -68,6 +70,9 @@
                        }
                }
 
+               internal virtual int CaretBlinkTime { get { return 530; } }
+               internal virtual int CaretWidth { get { return 10; } }
+               
                internal virtual Size DoubleClickSize {
                        get {
                                return new Size (4, 4);
@@ -92,6 +97,27 @@
                        }
                }
 
+               internal virtual int FontSmoothingContrast { get { return 1400; 
} }
+               internal virtual int FontSmoothingType { get { return 1; } }
+               internal virtual int HorizontalResizeBorderThickness { get { 
return 8; } }
+               internal virtual bool IsActiveWindowTrackingEnabled { get { 
return false; } }
+               internal virtual bool IsComboBoxAnimationEnabled { get { return 
false; } }
+               internal virtual bool IsDropShadowEnabled { get { return false; 
} }
+               internal virtual bool IsFontSmoothingEnabled { get { return 
true; } }
+               internal virtual bool IsHotTrackingEnabled { get { return 
false; } }
+               internal virtual bool IsIconTitleWrappingEnabled { get { return 
true; } }
+               internal virtual bool IsKeyboardPreferred { get { return false; 
} }
+               internal virtual bool IsListBoxSmoothScrollingEnabled { get { 
return true; } }
+               internal virtual bool IsMenuAnimationEnabled { get { return 
false; } }
+               internal virtual bool IsMenuFadeEnabled { get { return true; } }
+               internal virtual bool IsMinimizeRestoreAnimationEnabled { get { 
return false; } }
+               internal virtual bool IsSelectionFadeEnabled { get { return 
false; } }
+               internal virtual bool IsSnapToDefaultEnabled { get { return 
false; } }
+               internal virtual bool IsTitleBarGradientEnabled { get { return 
false; } }
+               internal virtual bool IsToolTipAnimationEnabled { get { return 
false; } }
+               internal virtual Size MenuBarButtonSize { get { return new Size 
(19, 19); } }
+               internal virtual int MenuShowDelay { get { return 0; } }
+               
                internal virtual Keys ModifierKeys {
                        get {
                                return Keys.None;
@@ -116,6 +142,10 @@
                        }
                }
 
+               internal virtual int MouseSpeed {
+                       get { return 10; }
+               }
+               
                internal virtual int MouseWheelScrollDelta {
                        get {
                                return 120;
@@ -134,6 +164,28 @@
                        }
                }
 
+               internal virtual LeftRightAlignment PopupMenuAlignment {
+                       get { return LeftRightAlignment.Left; }
+               }
+               
+#if NET_2_0
+               internal virtual PowerStatus PowerStatus {
+                       get { throw new NotImplementedException ("Has not been 
implemented yet for this platform."); }
+               }
+#endif
+
+               internal virtual int SizingBorderWidth {
+                       get { return 4; }
+               }
+               
+               internal virtual Size SmallCaptionButtonSize {
+                       get { return new Size (17, 17); }
+               }
+               
+               internal virtual bool UIEffectsEnabled {
+                       get { return false; }
+               }
+               
                internal virtual bool DropTarget {
                        get {
                                return false;
@@ -155,6 +207,8 @@
                        }
                }
 
+               internal virtual int VerticalResizeBorderThickness { get { 
return 8; } }
+
                internal virtual int VerticalScrollBarWidth {
                        get {
                                return 16;

Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIWin32.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIWin32.cs  
2007-07-12 20:38:04 UTC (rev 81901)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/XplatUIWin32.cs  
2007-07-12 20:57:20 UTC (rev 81902)
@@ -145,14 +145,37 @@
                }
 
                internal enum SPIAction {
+                       SPI_GETACTIVEWINDOWTRACKING = 0x1000,
+                       SPI_GETACTIVEWNDTRKTIMEOUT = 0x2002,
+                       SPI_GETANIMATION = 0x0048,
+                       SPI_GETCARETWIDTH = 0x2006,
+                       SPI_GETCOMBOBOXANIMATION = 0x1004,
                        SPI_GETDRAGFULLWINDOWS  = 0x0026,
-                       SPI_GETKEYBOARDSPEED    = 0x000A,
+                       SPI_GETDROPSHADOW = 0x1024,
+                       SPI_GETFONTSMOOTHING = 0x004A,
+                       SPI_GETFONTSMOOTHINGCONTRAST = 0x200C,
+                       SPI_GETFONTSMOOTHINGTYPE = 0x200A,
+                       SPI_GETGRADIENTCAPTIONS = 0x1008,
+                       SPI_GETHOTTRACKING = 0x100E,
+                       SPI_GETICONTITLEWRAP = 0x0019,
+                       SPI_GETKEYBOARDSPEED = 0x000A,
                        SPI_GETKEYBOARDDELAY    = 0x0016,
                        SPI_GETKEYBOARDCUES             = 0x100A,
-                       SPI_GETWORKAREA         = 0x0030,
+                       SPI_GETKEYBOARDPREF = 0x0044,
+                       SPI_GETLISTBOXSMOOTHSCROLLING = 0x1006,
+                       SPI_GETMENUANIMATION = 0x1002,
+                       SPI_GETMENUDROPALIGNMENT = 0x001B,
+                       SPI_GETMENUFADE = 0x1012,
+                       SPI_GETMENUSHOWDELAY = 0x006A,
+                       SPI_GETMOUSESPEED = 0x0070,
+                       SPI_GETSELECTIONFADE = 0x1014,
+                       SPI_GETSNAPTODEFBUTTON = 0x005F,
+                       SPI_GETTOOLTIPANIMATION = 0x1016,
+                       SPI_GETWORKAREA = 0x0030,
                        SPI_GETMOUSEHOVERWIDTH  = 0x0062,
                        SPI_GETMOUSEHOVERHEIGHT = 0x0064,
                        SPI_GETMOUSEHOVERTIME   = 0x0066,
+                       SPI_GETUIEFFECTS = 0x103E,
                        SPI_GETWHEELSCROLLLINES = 0x0068
                }
 
@@ -267,7 +290,12 @@
                        internal HARDWAREINPUT hi;
                }
 
-
+               [StructLayout (LayoutKind.Sequential)]
+               public struct ANIMATIONINFO {
+                       internal uint cbSize;
+                       internal int iMinAnimate;
+               }
+               
                internal enum InputFlags {
                        KEYEVENTF_EXTENDEDKEY   = 0x0001,
                        KEYEVENTF_KEYUP                 = 0x0002,
@@ -765,7 +793,30 @@
                        LWA_ALPHA                       = 0x2,
                }
 
-               
+               public enum ACLineStatus : byte {
+                       Offline = 0,
+                       Online = 1,
+                       Unknown = 255
+               }
+
+               public enum BatteryFlag : byte {
+                       High = 1,
+                       Low = 2,
+                       Critical = 4,
+                       Charging = 8,
+                       NoSystemBattery = 128,
+                       Unknown = 255
+               }
+
+               [StructLayout (LayoutKind.Sequential)]
+               public class SYSTEMPOWERSTATUS {
+                       public ACLineStatus _ACLineStatus;
+                       public BatteryFlag _BatteryFlag;
+                       public Byte _BatteryLifePercent;
+                       public Byte _Reserved1;
+                       public Int32 _BatteryLifeTime;
+                       public Int32 _BatteryFullLifeTime;
+               }
                #endregion
 
                #region Constructor & Destructor
@@ -984,9 +1035,189 @@
 
                        return dup;
                }
+               
+               private int GetSystemParametersInfoInt (SPIAction spi)
+               {
+                       int value = 0;
+                       
+                       Win32SystemParametersInfo (spi, 0, ref value, 0);
+                       
+                       return value;
+               }
+
+               private bool GetSystemParametersInfoBool (SPIAction spi)
+               {
+                       bool value = false;
+                       
+                       Win32SystemParametersInfo (spi, 0, ref value, 0);
+
+                       return value;
+               }
                #endregion      // Private Support Methods
 
                #region Static Properties
+               internal override int ActiveWindowTrackingDelay {
+                       get { return GetSystemParametersInfoInt 
(SPIAction.SPI_GETACTIVEWNDTRKTIMEOUT); }
+               }
+
+               internal override int CaretWidth {
+                       get { 
+                               // Supported on 2k, XP, 2k3 +
+                               if (Environment.OSVersion.Version.Major < 5)
+                                       throw new NotSupportedException ();
+                                       
+                               return GetSystemParametersInfoInt 
(SPIAction.SPI_GETCARETWIDTH);
+                       }
+               }
+
+               internal override int FontSmoothingContrast {
+                       get {
+                               // Supported on XP, 2k3 +
+                               if (Environment.OSVersion.Version.Major < 5 || 
(Environment.OSVersion.Version.Major == 5 && 
Environment.OSVersion.Version.Minor == 0))
+                                       throw new NotSupportedException ();
+                                       
+                               return GetSystemParametersInfoInt 
(SPIAction.SPI_GETFONTSMOOTHINGCONTRAST);
+                       }
+               }
+
+               internal override int FontSmoothingType {
+                       get {
+                               // Supported on XP, 2k3 +
+                               if (Environment.OSVersion.Version.Major < 5 || 
(Environment.OSVersion.Version.Major == 5 && 
Environment.OSVersion.Version.Minor == 0))
+                                       throw new NotSupportedException ();
+
+                               return GetSystemParametersInfoInt 
(SPIAction.SPI_GETFONTSMOOTHINGTYPE);
+                       }
+               }
+
+               internal override int HorizontalResizeBorderThickness {
+                       get { return Win32GetSystemMetrics 
(SystemMetrics.SM_CXSIZEFRAME); }
+               }
+
+               internal override bool IsActiveWindowTrackingEnabled {
+                       get { return GetSystemParametersInfoBool 
(SPIAction.SPI_GETACTIVEWINDOWTRACKING); }
+               }
+
+               internal override bool IsComboBoxAnimationEnabled {
+                       get { return GetSystemParametersInfoBool 
(SPIAction.SPI_GETCOMBOBOXANIMATION); }
+               }
+
+               internal override bool IsDropShadowEnabled {
+                       get {
+                               // Supported on XP, 2k3 +
+                               if (Environment.OSVersion.Version.Major < 5 || 
(Environment.OSVersion.Version.Major == 5 && 
Environment.OSVersion.Version.Minor == 0))
+                                       throw new NotSupportedException ();
+
+                               return GetSystemParametersInfoBool 
(SPIAction.SPI_GETDROPSHADOW);
+                       }
+               }
+
+               internal override bool IsFontSmoothingEnabled {
+                       get { return GetSystemParametersInfoBool 
(SPIAction.SPI_GETFONTSMOOTHING); }
+               }
+
+               internal override bool IsHotTrackingEnabled {
+                       get { return GetSystemParametersInfoBool 
(SPIAction.SPI_GETHOTTRACKING); }
+               }
+
+               internal override bool IsIconTitleWrappingEnabled {
+                       get { return GetSystemParametersInfoBool 
(SPIAction.SPI_GETICONTITLEWRAP); }
+               }
+
+               internal override bool IsKeyboardPreferred {
+                       get { return GetSystemParametersInfoBool 
(SPIAction.SPI_GETKEYBOARDPREF); }
+               }
+
+               internal override bool IsListBoxSmoothScrollingEnabled {
+                       get { return GetSystemParametersInfoBool 
(SPIAction.SPI_GETLISTBOXSMOOTHSCROLLING); }
+               }
+
+               internal override bool IsMenuAnimationEnabled {
+                       get { return GetSystemParametersInfoBool 
(SPIAction.SPI_GETMENUANIMATION); }
+               }
+
+               internal override bool IsMenuFadeEnabled {
+                       get { return GetSystemParametersInfoBool 
(SPIAction.SPI_GETMENUFADE); }
+               }
+
+               internal override bool IsMinimizeRestoreAnimationEnabled {
+                       get {
+                               ANIMATIONINFO ai = new ANIMATIONINFO ();
+                               ai.cbSize = (uint)Marshal.SizeOf (ai);
+                               
+                               Win32SystemParametersInfo 
(SPIAction.SPI_GETANIMATION, 0, ref ai, 0);
+                               return ai.iMinAnimate == 0 ? false : true;
+                       }
+               }
+
+               internal override bool IsSelectionFadeEnabled {
+                       get { return GetSystemParametersInfoBool 
(SPIAction.SPI_GETSELECTIONFADE); }
+               }
+
+               internal override bool IsSnapToDefaultEnabled {
+                       get { return GetSystemParametersInfoBool 
(SPIAction.SPI_GETSNAPTODEFBUTTON); }
+               }
+
+               internal override bool IsTitleBarGradientEnabled {
+                       get { return GetSystemParametersInfoBool 
(SPIAction.SPI_GETGRADIENTCAPTIONS); }
+               }
+
+               internal override bool IsToolTipAnimationEnabled {
+                       get { return GetSystemParametersInfoBool 
(SPIAction.SPI_GETTOOLTIPANIMATION); }
+               }
+
+               internal override Size MenuBarButtonSize {
+                       get {
+                               return new Size (Win32GetSystemMetrics 
(SystemMetrics.SM_CXMENUSIZE),
+                                       Win32GetSystemMetrics 
(SystemMetrics.SM_CYMENUSIZE));
+                       }
+               }
+
+               internal override int MenuShowDelay {
+                       get { return GetSystemParametersInfoInt 
(SPIAction.SPI_GETMENUSHOWDELAY); }
+               }
+
+               internal override int MouseSpeed {
+                       get { return GetSystemParametersInfoInt 
(SPIAction.SPI_GETMOUSESPEED); }
+               }
+
+               internal override LeftRightAlignment PopupMenuAlignment {
+                       get { return GetSystemParametersInfoBool 
(SPIAction.SPI_GETMENUDROPALIGNMENT) == true ? LeftRightAlignment.Left : 
LeftRightAlignment.Right; }
+               }
+
+#if NET_2_0
+               internal override PowerStatus PowerStatus {
+                       get {
+                               SYSTEMPOWERSTATUS p = new SYSTEMPOWERSTATUS ();
+                               
+                               Win32GetSystemPowerStatus (p);
+                               
+                               PowerStatus ps = new PowerStatus 
((BatteryChargeStatus)p._BatteryFlag, p._BatteryFullLifeTime, 
(float)p._BatteryLifePercent / 255f, p._BatteryLifeTime, 
(PowerLineStatus)p._ACLineStatus);
+                               
+                               return ps;
+                       }
+               }
+#endif
+
+               internal override int SizingBorderWidth {
+                       get { return Win32GetSystemMetrics 
(SystemMetrics.SM_CXSIZEFRAME); }
+               }
+
+               internal override Size SmallCaptionButtonSize {
+                       get {
+                               return new Size (Win32GetSystemMetrics 
(SystemMetrics.SM_CXSMSIZE),
+                                       Win32GetSystemMetrics 
(SystemMetrics.SM_CYSMSIZE));
+                       }
+               }
+
+               internal override bool UIEffectsEnabled {
+                       get { return GetSystemParametersInfoBool 
(SPIAction.SPI_GETUIEFFECTS); }
+               }
+
+               internal override int VerticalResizeBorderThickness {
+                       get { return Win32GetSystemMetrics 
(SystemMetrics.SM_CYSIZEFRAME); }
+               }
+
                internal override void RaiseIdle (EventArgs e)
                {
                        if (Idle != null)
@@ -3191,9 +3422,15 @@
                //[DllImport ("user32.dll", EntryPoint="SystemParametersInfoW", 
CharSet=CharSet.Unicode, CallingConvention=CallingConvention.StdCall)]
                //private extern static bool 
Win32SystemParametersInfo(SPIAction uiAction, uint uiParam, ref uint value, 
uint fWinIni);
 
-               [DllImport ("user32.dll", EntryPoint="SystemParametersInfoW", 
CharSet=CharSet.Unicode, CallingConvention=CallingConvention.StdCall)]
-               private extern static bool Win32SystemParametersInfo(SPIAction 
uiAction, uint uiParam, ref int value, uint fWinIni);
+               [DllImport ("user32.dll", EntryPoint = "SystemParametersInfoW", 
CharSet = CharSet.Unicode, CallingConvention = CallingConvention.StdCall)]
+               private extern static bool Win32SystemParametersInfo (SPIAction 
uiAction, uint uiParam, ref int value, uint fWinIni);
 
+               [DllImport ("user32.dll", EntryPoint = "SystemParametersInfoW", 
CharSet = CharSet.Unicode, CallingConvention = CallingConvention.StdCall)]
+               private extern static bool Win32SystemParametersInfo (SPIAction 
uiAction, uint uiParam, ref bool value, uint fWinIni);
+
+               [DllImport ("user32.dll", EntryPoint = "SystemParametersInfoW", 
CharSet = CharSet.Unicode, CallingConvention = CallingConvention.StdCall)]
+               private extern static bool Win32SystemParametersInfo (SPIAction 
uiAction, uint uiParam, ref ANIMATIONINFO value, uint fWinIni);
+
                [DllImport ("user32.dll", EntryPoint="OpenClipboard", 
CallingConvention=CallingConvention.StdCall)]
                private extern static bool Win32OpenClipboard(IntPtr hwnd);
 
@@ -3296,6 +3533,9 @@
 
                [DllImport ("gdi32.dll", EntryPoint="CreateCompatibleBitmap", 
CallingConvention=CallingConvention.StdCall)]
                internal static extern IntPtr Win32CreateCompatibleBitmap 
(IntPtr hdc, int nWidth, int nHeight);
+
+               [DllImport ("kernel32.dll", EntryPoint = 
"GetSystemPowerStatus", CallingConvention = CallingConvention.StdCall)]
+               internal static extern Boolean Win32GetSystemPowerStatus 
(SYSTEMPOWERSTATUS sps);
                #endregion
        }
 }

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

Reply via email to