[MWF] Implement multi-display support on Linux (Fixes #325669)
[mono.git] / mcs / class / Managed.Windows.Forms / System.Windows.Forms / SystemInformation.cs
index 06ccbea1ba6650fd96a43f544ede7e6d3bc01457..6a10a9173584dc7f02507d75bfcc03013662c1c0 100644 (file)
 
 using System;
 using System.Drawing;
+using System.ComponentModel;
 
-namespace System.Windows.Forms {
-       public class SystemInformation {
-               #region Constructor
-               internal SystemInformation() {
+namespace System.Windows.Forms
+{
+       public class SystemInformation
+       {
+               private SystemInformation ()
+               {
                }
-               #endregion
 
-               #region Public Static Properties
+               [MonoInternalNote ("Determine if we need an X11 implementation or if defaults are good.")]
+               public static int ActiveWindowTrackingDelay { get { return XplatUI.ActiveWindowTrackingDelay; } }
+
                public static ArrangeDirection ArrangeDirection {
                        get {
                                return ThemeEngine.Current.ArrangeDirection;
@@ -60,10 +64,13 @@ namespace System.Windows.Forms {
                                return ThemeEngine.Current.Border3DSize;
                        }
                }
+               
+               [MonoInternalNote ("Determine if we need an X11 implementation or if defaults are good.")]
+               public static int BorderMultiplierFactor { get { return ThemeEngine.Current.BorderMultiplierFactor; } }
 
                public static Size BorderSize {
                        get {
-                               return ThemeEngine.Current.Border3DSize;
+                               return ThemeEngine.Current.BorderSize;
                        }
                }
 
@@ -79,6 +86,11 @@ namespace System.Windows.Forms {
                        }
                }
 
+               [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; } }
+
                public static string ComputerName {
                        get {
                                return Environment.MachineName;
@@ -133,6 +145,11 @@ namespace System.Windows.Forms {
                        }
                }
 
+               [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; } }
+
                public static Size FrameBorderSize {
                        get {
                                return ThemeEngine.Current.FrameBorderSize;
@@ -145,6 +162,11 @@ namespace System.Windows.Forms {
                        }
                }
 
+               [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; } }
+
                public static int HorizontalScrollBarArrowWidth {
                        get {
                                return ThemeEngine.Current.HorizontalScrollBarArrowWidth;
@@ -169,24 +191,138 @@ namespace System.Windows.Forms {
                        }
                }
 
+               public static int IconHorizontalSpacing {
+                       get {
+                               return IconSpacingSize.Width;
+                       }
+               }
+
+               public static int IconVerticalSpacing {
+                       get {
+                               return IconSpacingSize.Height;
+                       }
+               }
+
                public static Size IconSpacingSize {
                        get {
                                return ThemeEngine.Current.IconSpacingSize;
                        }
                }
 
+               [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; }
+               }
+
                public static int KanjiWindowHeight {
                        get {
                                return 0;
                        }
                }
 
+               public static int KeyboardDelay {
+                       get {
+                               return XplatUI.KeyboardDelay;
+                       }
+               }
+
+               public static int KeyboardSpeed {
+                       get {
+                               return XplatUI.KeyboardSpeed;
+                       }
+               }
+
                public static Size MaxWindowTrackSize {
                        get {
                                return XplatUI.MaxWindowTrackSize;
                        }
                }
 
+               public static bool MenuAccessKeysUnderlined {
+                       get {
+                               return ThemeEngine.Current.MenuAccessKeysUnderlined;
+                       }
+               }
+
+               [MonoInternalNote ("Determine if we need an X11 implementation or if defaults are good.")]
+               public static Size MenuBarButtonSize {
+                       get { return ThemeEngine.Current.MenuBarButtonSize; }
+               }
+
                public static Size MenuButtonSize {
                        get {
                                return ThemeEngine.Current.MenuButtonSize;
@@ -214,6 +350,9 @@ namespace System.Windows.Forms {
                        }
                }
 
+               [MonoInternalNote ("Determine if we need an X11 implementation or if defaults are good.")]
+               public static int MenuShowDelay { get { return XplatUI.MenuShowDelay; } }
+
                public static bool MidEastEnabled {
                        get {
                                return false; // ??? how do we decide?
@@ -246,7 +385,7 @@ namespace System.Windows.Forms {
 
                public static int MonitorCount {
                        get {
-                               return 1;               // Why bother...
+                               return Screen.AllScreens.Length;
                        }
                }
 
@@ -268,7 +407,6 @@ namespace System.Windows.Forms {
                        }
                }
 
-#if NET_2_0
                public static Size MouseHoverSize {
                        get {
                                return XplatUI.MouseHoverSize;
@@ -280,8 +418,19 @@ namespace System.Windows.Forms {
                                return XplatUI.MouseHoverTime;
                        }
                }
-#endif
 
+               [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;
+                       }
+               }
+
+               [EditorBrowsable (EditorBrowsableState.Never)]
                public static bool MousePresent {
                        get {
                                return true;
@@ -318,15 +467,27 @@ namespace System.Windows.Forms {
                        }
                }
 
+               [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; }
+               }
+
                public static Size PrimaryMonitorMaximizedWindowSize {
                        get {
-                               return new Size(WorkingArea.Width, WorkingArea.Height);
+                               var workingArea = Screen.PrimaryScreen.WorkingArea;
+                               return new Size (workingArea.Width, workingArea.Height);
                        }
                }
 
                public static Size PrimaryMonitorSize {
                        get {
-                               return new Size(WorkingArea.Width, WorkingArea.Height);
+                               var bounds = Screen.PrimaryScreen.Bounds;
+                               return new Size (bounds.Width, bounds.Height);
                        }
                }
 
@@ -336,9 +497,13 @@ namespace System.Windows.Forms {
                        }
                }
 
+               public static ScreenOrientation ScreenOrientation {
+                       get { return ScreenOrientation.Angle0; }
+               }
+
                public static bool Secure {
                        get {
-                               return true;            // FIXME - figure out if we're running 98/Me and return false
+                               return true;
                        }
                }
 
@@ -348,12 +513,28 @@ namespace System.Windows.Forms {
                        }
                }
 
+               [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; }
+               }
+
                public static Size SmallIconSize {
                        get {
                                return XplatUI.SmallIconSize;
                        }
                }
 
+               public static bool TerminalServerSession {
+                       get {
+                               return false;
+                       }
+               }
+
                public static Size ToolWindowCaptionButtonSize {
                        get {
                                return ThemeEngine.Current.ToolWindowCaptionButtonSize;
@@ -366,6 +547,11 @@ namespace System.Windows.Forms {
                        }
                }
 
+               [MonoInternalNote ("Determine if we need an X11 implementation or if defaults are good.")]
+               public static bool UIEffectsEnabled {
+                       get { return XplatUI.UIEffectsEnabled; }
+               }
+
                public static string UserDomainName {
                        get {
                                return Environment.UserDomainName;
@@ -384,6 +570,11 @@ namespace System.Windows.Forms {
                        }
                }
 
+               [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; } }
+
                public static int VerticalScrollBarArrowHeight {
                        get {
                                return ThemeEngine.Current.VerticalScrollBarArrowHeight;
@@ -404,29 +595,17 @@ namespace System.Windows.Forms {
 
                public static Rectangle VirtualScreen {
                        get {
-                               return XplatUI.VirtualScreen;
+                               var rect = new Rectangle ();
+                               foreach (var screen in Screen.AllScreens)
+                                       rect = Rectangle.Union (rect, screen.Bounds);
+                               return rect;
                        }
                }
 
                public static Rectangle WorkingArea {
                        get {
-                               return XplatUI.WorkingArea;
-                       }
-               }
-               #endregion      // Public Static Properties
-
-               #region Internal Static Properties
-               internal static int KeyboardSpeed {
-                       get {
-                               return XplatUI.KeyboardSpeed;
-                       }
-               }
-       
-               internal static int KeyboardDelay {
-                       get {
-                               return XplatUI.KeyboardDelay;
+                               return Screen.PrimaryScreen.WorkingArea;
                        }
                }
-               #endregion      // Internal Static Properties
        }
 }