1 // Permission is hereby granted, free of charge, to any person obtaining
2 // a copy of this software and associated documentation files (the
3 // "Software"), to deal in the Software without restriction, including
4 // without limitation the rights to use, copy, modify, merge, publish,
5 // distribute, sublicense, and/or sell copies of the Software, and to
6 // permit persons to whom the Software is furnished to do so, subject to
7 // the following conditions:
9 // The above copyright notice and this permission notice shall be
10 // included in all copies or substantial portions of the Software.
12 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
13 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
14 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
15 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
16 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
17 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
18 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20 // Copyright (c) 2004,2006 Novell, Inc. (http://www.novell.com)
23 // Miguel de Icaza (miguel@novell.com).
24 // Peter Bartok (pbartok@novell.com)
31 using System.ComponentModel;
33 namespace System.Windows.Forms
35 public class SystemInformation
37 private SystemInformation ()
41 [MonoInternalNote ("Determine if we need an X11 implementation or if defaults are good.")]
42 public static int ActiveWindowTrackingDelay { get { return XplatUI.ActiveWindowTrackingDelay; } }
44 public static ArrangeDirection ArrangeDirection {
46 return ThemeEngine.Current.ArrangeDirection;
50 public static ArrangeStartingPosition ArrangeStartingPosition {
52 return ThemeEngine.Current.ArrangeStartingPosition;
56 public static BootMode BootMode {
58 return BootMode.Normal;
62 public static Size Border3DSize {
64 return ThemeEngine.Current.Border3DSize;
68 [MonoInternalNote ("Determine if we need an X11 implementation or if defaults are good.")]
69 public static int BorderMultiplierFactor { get { return ThemeEngine.Current.BorderMultiplierFactor; } }
71 public static Size BorderSize {
73 return ThemeEngine.Current.BorderSize;
77 public static Size CaptionButtonSize {
79 return ThemeEngine.Current.CaptionButtonSize;
83 public static int CaptionHeight {
85 return ThemeEngine.Current.CaptionHeight;
89 [MonoInternalNote ("Determine if we need an X11 implementation or if defaults are good.")]
90 public static int CaretBlinkTime { get { return XplatUI.CaretBlinkTime; } }
91 [MonoInternalNote ("Determine if we need an X11 implementation or if defaults are good.")]
92 public static int CaretWidth { get { return XplatUI.CaretWidth; } }
94 public static string ComputerName {
96 return Environment.MachineName;
100 public static Size CursorSize {
102 return XplatUI.CursorSize;
106 public static bool DbcsEnabled {
112 public static bool DebugOS {
118 public static Size DoubleClickSize {
120 return ThemeEngine.Current.DoubleClickSize;
124 public static int DoubleClickTime {
126 return ThemeEngine.Current.DoubleClickTime;
130 public static bool DragFullWindows {
132 return XplatUI.DragFullWindows;
136 public static Size DragSize {
138 return XplatUI.DragSize;
142 public static Size FixedFrameBorderSize {
144 return ThemeEngine.Current.FixedFrameBorderSize;
148 [MonoInternalNote ("Determine if we need an X11 implementation or if defaults are good.")]
149 public static int FontSmoothingContrast { get { return XplatUI.FontSmoothingContrast; } }
150 [MonoInternalNote ("Determine if we need an X11 implementation or if defaults are good.")]
151 public static int FontSmoothingType { get { return XplatUI.FontSmoothingType; } }
153 public static Size FrameBorderSize {
155 return ThemeEngine.Current.FrameBorderSize;
159 public static bool HighContrast {
165 [MonoInternalNote ("Determine if we need an X11 implementation or if defaults are good.")]
166 public static int HorizontalFocusThickness { get { return ThemeEngine.Current.HorizontalFocusThickness; } }
167 [MonoInternalNote ("Determine if we need an X11 implementation or if defaults are good.")]
168 public static int HorizontalResizeBorderThickness { get { return XplatUI.HorizontalResizeBorderThickness; } }
170 public static int HorizontalScrollBarArrowWidth {
172 return ThemeEngine.Current.HorizontalScrollBarArrowWidth;
176 public static int HorizontalScrollBarHeight {
178 return ThemeEngine.Current.HorizontalScrollBarHeight;
182 public static int HorizontalScrollBarThumbWidth {
184 return ThemeEngine.Current.HorizontalScrollBarThumbWidth;
188 public static Size IconSize {
190 return XplatUI.IconSize;
194 public static int IconHorizontalSpacing {
196 return IconSpacingSize.Width;
200 public static int IconVerticalSpacing {
202 return IconSpacingSize.Height;
206 public static Size IconSpacingSize {
208 return ThemeEngine.Current.IconSpacingSize;
212 [MonoInternalNote ("Determine if we need an X11 implementation or if defaults are good.")]
213 public static bool IsActiveWindowTrackingEnabled {
214 get { return XplatUI.IsActiveWindowTrackingEnabled; }
217 [MonoInternalNote ("Determine if we need an X11 implementation or if defaults are good.")]
218 public static bool IsComboBoxAnimationEnabled {
219 get { return XplatUI.IsComboBoxAnimationEnabled; }
222 [MonoInternalNote ("Determine if we need an X11 implementation or if defaults are good.")]
223 public static bool IsDropShadowEnabled {
224 get { return XplatUI.IsDropShadowEnabled; }
227 public static bool IsFlatMenuEnabled {
228 get { return false; }
231 [MonoInternalNote ("Determine if we need an X11 implementation or if defaults are good.")]
232 public static bool IsFontSmoothingEnabled {
233 get { return XplatUI.IsFontSmoothingEnabled; }
236 [MonoInternalNote ("Determine if we need an X11 implementation or if defaults are good.")]
237 public static bool IsHotTrackingEnabled {
238 get { return XplatUI.IsHotTrackingEnabled; }
241 [MonoInternalNote ("Determine if we need an X11 implementation or if defaults are good.")]
242 public static bool IsIconTitleWrappingEnabled {
243 get { return XplatUI.IsIconTitleWrappingEnabled; }
246 [MonoInternalNote ("Determine if we need an X11 implementation or if defaults are good.")]
247 public static bool IsKeyboardPreferred {
248 get { return XplatUI.IsKeyboardPreferred; }
251 [MonoInternalNote ("Determine if we need an X11 implementation or if defaults are good.")]
252 public static bool IsListBoxSmoothScrollingEnabled {
253 get { return XplatUI.IsListBoxSmoothScrollingEnabled; }
256 [MonoInternalNote ("Determine if we need an X11 implementation or if defaults are good.")]
257 public static bool IsMenuAnimationEnabled {
258 get { return XplatUI.IsMenuAnimationEnabled; }
261 [MonoInternalNote ("Determine if we need an X11 implementation or if defaults are good.")]
262 public static bool IsMenuFadeEnabled {
263 get { return XplatUI.IsMenuFadeEnabled; }
266 [MonoInternalNote ("Determine if we need an X11 implementation or if defaults are good.")]
267 public static bool IsMinimizeRestoreAnimationEnabled {
268 get { return XplatUI.IsMinimizeRestoreAnimationEnabled; }
271 [MonoInternalNote ("Determine if we need an X11 implementation or if defaults are good.")]
272 public static bool IsSelectionFadeEnabled {
273 get { return XplatUI.IsSelectionFadeEnabled; }
276 [MonoInternalNote ("Determine if we need an X11 implementation or if defaults are good.")]
277 public static bool IsSnapToDefaultEnabled {
278 get { return XplatUI.IsSnapToDefaultEnabled; }
281 [MonoInternalNote ("Determine if we need an X11 implementation or if defaults are good.")]
282 public static bool IsTitleBarGradientEnabled {
283 get { return XplatUI.IsTitleBarGradientEnabled; }
286 [MonoInternalNote ("Determine if we need an X11 implementation or if defaults are good.")]
287 public static bool IsToolTipAnimationEnabled {
288 get { return XplatUI.IsToolTipAnimationEnabled; }
291 public static int KanjiWindowHeight {
297 public static int KeyboardDelay {
299 return XplatUI.KeyboardDelay;
303 public static int KeyboardSpeed {
305 return XplatUI.KeyboardSpeed;
309 public static Size MaxWindowTrackSize {
311 return XplatUI.MaxWindowTrackSize;
315 public static bool MenuAccessKeysUnderlined {
317 return ThemeEngine.Current.MenuAccessKeysUnderlined;
321 [MonoInternalNote ("Determine if we need an X11 implementation or if defaults are good.")]
322 public static Size MenuBarButtonSize {
323 get { return ThemeEngine.Current.MenuBarButtonSize; }
326 public static Size MenuButtonSize {
328 return ThemeEngine.Current.MenuButtonSize;
332 public static Size MenuCheckSize {
334 return ThemeEngine.Current.MenuCheckSize;
338 public static Font MenuFont {
340 // note: we MUST return a clone of the Font instance as anyone
341 // can dispose it. However we shouldn't expect the theme to do
342 // the cloning for performance reason
343 return (Font) ThemeEngine.Current.MenuFont.Clone ();
347 public static int MenuHeight {
349 return ThemeEngine.Current.MenuHeight;
353 [MonoInternalNote ("Determine if we need an X11 implementation or if defaults are good.")]
354 public static int MenuShowDelay { get { return XplatUI.MenuShowDelay; } }
356 public static bool MidEastEnabled {
358 return false; // ??? how do we decide?
362 public static Size MinimizedWindowSize {
364 return XplatUI.MinimizedWindowSize;
368 public static Size MinimizedWindowSpacingSize {
370 return XplatUI.MinimizedWindowSpacingSize;
374 public static Size MinimumWindowSize {
376 return XplatUI.MinimumWindowSize;
380 public static Size MinWindowTrackSize {
382 return XplatUI.MinWindowTrackSize;
386 public static int MonitorCount {
388 return Screen.AllScreens.Length;
392 public static bool MonitorsSameDisplayFormat {
398 public static int MouseButtons {
400 return XplatUI.MouseButtonCount;
404 public static bool MouseButtonsSwapped {
406 return XplatUI.MouseButtonsSwapped;
410 public static Size MouseHoverSize {
412 return XplatUI.MouseHoverSize;
416 public static int MouseHoverTime {
418 return XplatUI.MouseHoverTime;
422 [MonoInternalNote ("Determine if we need an X11 implementation or if defaults are good.")]
423 public static int MouseSpeed {
424 get { return XplatUI.MouseSpeed; }
427 public static int MouseWheelScrollDelta {
429 return XplatUI.MouseWheelScrollDelta;
433 [EditorBrowsable (EditorBrowsableState.Never)]
434 public static bool MousePresent {
440 public static bool MouseWheelPresent {
442 return XplatUI.MouseWheelPresent;
446 public static int MouseWheelScrollLines {
448 return ThemeEngine.Current.MouseWheelScrollLines;
452 public static bool NativeMouseWheelSupport {
454 return MouseWheelPresent;
458 public static bool Network {
464 public static bool PenWindows {
470 [MonoInternalNote ("Determine if we need an X11 implementation or if defaults are good.")]
471 public static LeftRightAlignment PopupMenuAlignment {
472 get { return XplatUI.PopupMenuAlignment; }
475 [MonoTODO ("Only implemented for Win32.")]
476 public static PowerStatus PowerStatus {
477 get { return XplatUI.PowerStatus; }
480 public static Size PrimaryMonitorMaximizedWindowSize {
482 var workingArea = Screen.PrimaryScreen.WorkingArea;
483 return new Size (workingArea.Width, workingArea.Height);
487 public static Size PrimaryMonitorSize {
489 var bounds = Screen.PrimaryScreen.Bounds;
490 return new Size (bounds.Width, bounds.Height);
494 public static bool RightAlignedMenus {
496 return ThemeEngine.Current.RightAlignedMenus;
500 public static ScreenOrientation ScreenOrientation {
501 get { return ScreenOrientation.Angle0; }
504 public static bool Secure {
510 public static bool ShowSounds {
516 [MonoInternalNote ("Determine if we need an X11 implementation or if defaults are good.")]
517 public static int SizingBorderWidth {
518 get { return XplatUI.SizingBorderWidth; }
521 [MonoInternalNote ("Determine if we need an X11 implementation or if defaults are good.")]
522 public static Size SmallCaptionButtonSize {
523 get { return XplatUI.SmallCaptionButtonSize; }
526 public static Size SmallIconSize {
528 return XplatUI.SmallIconSize;
532 public static bool TerminalServerSession {
538 public static Size ToolWindowCaptionButtonSize {
540 return ThemeEngine.Current.ToolWindowCaptionButtonSize;
544 public static int ToolWindowCaptionHeight {
546 return ThemeEngine.Current.ToolWindowCaptionHeight;
550 [MonoInternalNote ("Determine if we need an X11 implementation or if defaults are good.")]
551 public static bool UIEffectsEnabled {
552 get { return XplatUI.UIEffectsEnabled; }
555 public static string UserDomainName {
557 return Environment.UserDomainName;
561 public static bool UserInteractive {
563 return Environment.UserInteractive;
567 public static string UserName {
569 return Environment.UserName;
573 [MonoInternalNote ("Determine if we need an X11 implementation or if defaults are good.")]
574 public static int VerticalFocusThickness { get { return ThemeEngine.Current.VerticalFocusThickness; } }
575 [MonoInternalNote ("Determine if we need an X11 implementation or if defaults are good.")]
576 public static int VerticalResizeBorderThickness { get { return XplatUI.VerticalResizeBorderThickness; } }
578 public static int VerticalScrollBarArrowHeight {
580 return ThemeEngine.Current.VerticalScrollBarArrowHeight;
584 public static int VerticalScrollBarThumbHeight {
586 return ThemeEngine.Current.VerticalScrollBarThumbHeight;
590 public static int VerticalScrollBarWidth {
592 return ThemeEngine.Current.VerticalScrollBarWidth;
596 public static Rectangle VirtualScreen {
598 var rect = new Rectangle ();
599 foreach (var screen in Screen.AllScreens)
600 rect = Rectangle.Union (rect, screen.Bounds);
605 public static Rectangle WorkingArea {
607 return Screen.PrimaryScreen.WorkingArea;