Merge branch 'bugfix-main-thread-root'
[mono.git] / mcs / class / Managed.Windows.Forms / System.Windows.Forms / SystemInformation.cs
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:
8 // 
9 // The above copyright notice and this permission notice shall be
10 // included in all copies or substantial portions of the Software.
11 // 
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.
19 //
20 // Copyright (c) 2004,2006 Novell, Inc. (http://www.novell.com)
21 //
22 // Authors:
23 //      Miguel de Icaza (miguel@novell.com).
24 //      Peter Bartok    (pbartok@novell.com)
25 //
26
27 // NOT COMPLETE
28
29 using System;
30 using System.Drawing;
31 using System.ComponentModel;
32
33 namespace System.Windows.Forms
34 {
35         public class SystemInformation
36         {
37                 private SystemInformation ()
38                 {
39                 }
40
41                 [MonoInternalNote ("Determine if we need an X11 implementation or if defaults are good.")]
42                 public static int ActiveWindowTrackingDelay { get { return XplatUI.ActiveWindowTrackingDelay; } }
43
44                 public static ArrangeDirection ArrangeDirection {
45                         get {
46                                 return ThemeEngine.Current.ArrangeDirection;
47                         }
48                 }
49
50                 public static ArrangeStartingPosition ArrangeStartingPosition {
51                         get {
52                                 return ThemeEngine.Current.ArrangeStartingPosition;
53                         }
54                 }
55
56                 public static BootMode BootMode {
57                         get {
58                                 return BootMode.Normal;
59                         }
60                 }
61
62                 public static Size Border3DSize {
63                         get {
64                                 return ThemeEngine.Current.Border3DSize;
65                         }
66                 }
67                 
68                 [MonoInternalNote ("Determine if we need an X11 implementation or if defaults are good.")]
69                 public static int BorderMultiplierFactor { get { return ThemeEngine.Current.BorderMultiplierFactor; } }
70
71                 public static Size BorderSize {
72                         get {
73                                 return ThemeEngine.Current.BorderSize;
74                         }
75                 }
76
77                 public static Size CaptionButtonSize {
78                         get {
79                                 return ThemeEngine.Current.CaptionButtonSize;
80                         }
81                 }
82
83                 public static int CaptionHeight {
84                         get {
85                                 return ThemeEngine.Current.CaptionHeight;
86                         }
87                 }
88
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; } }
93
94                 public static string ComputerName {
95                         get {
96                                 return Environment.MachineName;
97                         }
98                 }
99
100                 public static Size CursorSize {
101                         get {
102                                 return XplatUI.CursorSize;
103                         }
104                 }
105
106                 public static bool DbcsEnabled {
107                         get {
108                                 return false;
109                         }
110                 }
111
112                 public static bool DebugOS {
113                         get {
114                                 return false;
115                         }
116                 }
117
118                 public static Size DoubleClickSize {
119                         get {
120                                 return ThemeEngine.Current.DoubleClickSize;
121                         }
122                 }
123
124                 public static int DoubleClickTime {
125                         get {
126                                 return ThemeEngine.Current.DoubleClickTime;
127                         }
128                 }
129
130                 public static bool DragFullWindows {
131                         get {
132                                 return XplatUI.DragFullWindows;
133                         }
134                 }
135
136                 public static Size DragSize {
137                         get {
138                                 return XplatUI.DragSize;
139                         }
140                 }
141
142                 public static Size FixedFrameBorderSize {
143                         get {
144                                 return ThemeEngine.Current.FixedFrameBorderSize;
145                         }
146                 }
147
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; } }
152
153                 public static Size FrameBorderSize {
154                         get {
155                                 return ThemeEngine.Current.FrameBorderSize;
156                         }
157                 }
158
159                 public static bool HighContrast {
160                         get {
161                                 return false;
162                         }
163                 }
164
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; } }
169
170                 public static int HorizontalScrollBarArrowWidth {
171                         get {
172                                 return ThemeEngine.Current.HorizontalScrollBarArrowWidth;
173                         }
174                 }
175
176                 public static int HorizontalScrollBarHeight {
177                         get {
178                                 return ThemeEngine.Current.HorizontalScrollBarHeight;
179                         }
180                 }
181
182                 public static int HorizontalScrollBarThumbWidth {
183                         get {
184                                 return ThemeEngine.Current.HorizontalScrollBarThumbWidth;
185                         }
186                 }
187
188                 public static Size IconSize {
189                         get {
190                                 return XplatUI.IconSize;
191                         }
192                 }
193
194                 public static int IconHorizontalSpacing {
195                         get {
196                                 return IconSpacingSize.Width;
197                         }
198                 }
199
200                 public static int IconVerticalSpacing {
201                         get {
202                                 return IconSpacingSize.Height;
203                         }
204                 }
205
206                 public static Size IconSpacingSize {
207                         get {
208                                 return ThemeEngine.Current.IconSpacingSize;
209                         }
210                 }
211
212                 [MonoInternalNote ("Determine if we need an X11 implementation or if defaults are good.")]
213                 public static bool IsActiveWindowTrackingEnabled {
214                         get { return XplatUI.IsActiveWindowTrackingEnabled; }
215                 }
216
217                 [MonoInternalNote ("Determine if we need an X11 implementation or if defaults are good.")]
218                 public static bool IsComboBoxAnimationEnabled {
219                         get { return XplatUI.IsComboBoxAnimationEnabled; }
220                 }
221
222                 [MonoInternalNote ("Determine if we need an X11 implementation or if defaults are good.")]
223                 public static bool IsDropShadowEnabled {
224                         get { return XplatUI.IsDropShadowEnabled; }
225                 }
226
227                 public static bool IsFlatMenuEnabled {
228                         get { return false; }
229                 }
230
231                 [MonoInternalNote ("Determine if we need an X11 implementation or if defaults are good.")]
232                 public static bool IsFontSmoothingEnabled {
233                         get { return XplatUI.IsFontSmoothingEnabled; }
234                 }
235
236                 [MonoInternalNote ("Determine if we need an X11 implementation or if defaults are good.")]
237                 public static bool IsHotTrackingEnabled {
238                         get { return XplatUI.IsHotTrackingEnabled; }
239                 }
240
241                 [MonoInternalNote ("Determine if we need an X11 implementation or if defaults are good.")]
242                 public static bool IsIconTitleWrappingEnabled {
243                         get { return XplatUI.IsIconTitleWrappingEnabled; }
244                 }
245
246                 [MonoInternalNote ("Determine if we need an X11 implementation or if defaults are good.")]
247                 public static bool IsKeyboardPreferred {
248                         get { return XplatUI.IsKeyboardPreferred; }
249                 }
250
251                 [MonoInternalNote ("Determine if we need an X11 implementation or if defaults are good.")]
252                 public static bool IsListBoxSmoothScrollingEnabled {
253                         get { return XplatUI.IsListBoxSmoothScrollingEnabled; }
254                 }
255
256                 [MonoInternalNote ("Determine if we need an X11 implementation or if defaults are good.")]
257                 public static bool IsMenuAnimationEnabled {
258                         get { return XplatUI.IsMenuAnimationEnabled; }
259                 }
260
261                 [MonoInternalNote ("Determine if we need an X11 implementation or if defaults are good.")]
262                 public static bool IsMenuFadeEnabled {
263                         get { return XplatUI.IsMenuFadeEnabled; }
264                 }
265
266                 [MonoInternalNote ("Determine if we need an X11 implementation or if defaults are good.")]
267                 public static bool IsMinimizeRestoreAnimationEnabled {
268                         get { return XplatUI.IsMinimizeRestoreAnimationEnabled; }
269                 }
270
271                 [MonoInternalNote ("Determine if we need an X11 implementation or if defaults are good.")]
272                 public static bool IsSelectionFadeEnabled {
273                         get { return XplatUI.IsSelectionFadeEnabled; }
274                 }
275
276                 [MonoInternalNote ("Determine if we need an X11 implementation or if defaults are good.")]
277                 public static bool IsSnapToDefaultEnabled {
278                         get { return XplatUI.IsSnapToDefaultEnabled; }
279                 }
280
281                 [MonoInternalNote ("Determine if we need an X11 implementation or if defaults are good.")]
282                 public static bool IsTitleBarGradientEnabled {
283                         get { return XplatUI.IsTitleBarGradientEnabled; }
284                 }
285
286                 [MonoInternalNote ("Determine if we need an X11 implementation or if defaults are good.")]
287                 public static bool IsToolTipAnimationEnabled {
288                         get { return XplatUI.IsToolTipAnimationEnabled; }
289                 }
290
291                 public static int KanjiWindowHeight {
292                         get {
293                                 return 0;
294                         }
295                 }
296
297                 public static int KeyboardDelay {
298                         get {
299                                 return XplatUI.KeyboardDelay;
300                         }
301                 }
302
303                 public static int KeyboardSpeed {
304                         get {
305                                 return XplatUI.KeyboardSpeed;
306                         }
307                 }
308
309                 public static Size MaxWindowTrackSize {
310                         get {
311                                 return XplatUI.MaxWindowTrackSize;
312                         }
313                 }
314
315                 public static bool MenuAccessKeysUnderlined {
316                         get {
317                                 return ThemeEngine.Current.MenuAccessKeysUnderlined;
318                         }
319                 }
320
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; }
324                 }
325
326                 public static Size MenuButtonSize {
327                         get {
328                                 return ThemeEngine.Current.MenuButtonSize;
329                         }
330                 }
331
332                 public static Size MenuCheckSize {
333                         get {
334                                 return ThemeEngine.Current.MenuCheckSize;
335                         }
336                 }
337
338                 public static Font MenuFont {
339                         get {
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 ();
344                         }
345                 }
346
347                 public static int MenuHeight {
348                         get {
349                                 return ThemeEngine.Current.MenuHeight;
350                         }
351                 }
352
353                 [MonoInternalNote ("Determine if we need an X11 implementation or if defaults are good.")]
354                 public static int MenuShowDelay { get { return XplatUI.MenuShowDelay; } }
355
356                 public static bool MidEastEnabled {
357                         get {
358                                 return false; // ??? how do we decide?
359                         }
360                 }
361
362                 public static Size MinimizedWindowSize {
363                         get {
364                                 return XplatUI.MinimizedWindowSize;
365                         }
366                 }
367
368                 public static Size MinimizedWindowSpacingSize {
369                         get {
370                                 return XplatUI.MinimizedWindowSpacingSize;
371                         }
372                 }
373
374                 public static Size MinimumWindowSize {
375                         get {
376                                 return XplatUI.MinimumWindowSize;
377                         }
378                 }
379
380                 public static Size MinWindowTrackSize {
381                         get {
382                                 return XplatUI.MinWindowTrackSize;
383                         }
384                 }
385
386                 public static int MonitorCount {
387                         get {
388                                 return 1;               // Why bother...
389                         }
390                 }
391
392                 public static bool MonitorsSameDisplayFormat {
393                         get {
394                                 return true;
395                         }
396                 }
397
398                 public static int MouseButtons {
399                         get {
400                                 return XplatUI.MouseButtonCount;
401                         }
402                 }
403
404                 public static bool MouseButtonsSwapped {
405                         get {
406                                 return XplatUI.MouseButtonsSwapped;
407                         }
408                 }
409
410                 public static Size MouseHoverSize {
411                         get {
412                                 return XplatUI.MouseHoverSize;
413                         }
414                 }
415
416                 public static int MouseHoverTime {
417                         get {
418                                 return XplatUI.MouseHoverTime;
419                         }
420                 }
421
422                 [MonoInternalNote ("Determine if we need an X11 implementation or if defaults are good.")]
423                 public static int MouseSpeed {
424                         get { return XplatUI.MouseSpeed; }
425                 }
426                 
427                 public static int MouseWheelScrollDelta {
428                         get {
429                                 return XplatUI.MouseWheelScrollDelta;
430                         }
431                 }
432
433                 [EditorBrowsable (EditorBrowsableState.Never)]
434                 public static bool MousePresent {
435                         get {
436                                 return true;
437                         }
438                 }
439
440                 public static bool MouseWheelPresent {
441                         get {
442                                 return XplatUI.MouseWheelPresent;
443                         }
444                 }
445
446                 public static int MouseWheelScrollLines {
447                         get {
448                                 return ThemeEngine.Current.MouseWheelScrollLines;
449                         }
450                 }
451
452                 public static bool NativeMouseWheelSupport {
453                         get {
454                                 return MouseWheelPresent;
455                         }
456                 }
457
458                 public static bool Network {
459                         get {
460                                 return true;
461                         }
462                 }
463
464                 public static bool PenWindows {
465                         get {
466                                 return false;
467                         }
468                 }
469
470                 [MonoInternalNote ("Determine if we need an X11 implementation or if defaults are good.")]
471                 public static LeftRightAlignment PopupMenuAlignment {
472                         get { return XplatUI.PopupMenuAlignment; }
473                 }
474                 
475                 [MonoTODO ("Only implemented for Win32.")]
476                 public static PowerStatus PowerStatus {
477                         get { return XplatUI.PowerStatus; }
478                 }
479
480                 public static Size PrimaryMonitorMaximizedWindowSize {
481                         get {
482                                 return new Size(WorkingArea.Width, WorkingArea.Height);
483                         }
484                 }
485
486                 public static Size PrimaryMonitorSize {
487                         get {
488                                 return new Size(WorkingArea.Width, WorkingArea.Height);
489                         }
490                 }
491
492                 public static bool RightAlignedMenus {
493                         get {
494                                 return ThemeEngine.Current.RightAlignedMenus;
495                         }
496                 }
497
498                 public static ScreenOrientation ScreenOrientation {
499                         get { return ScreenOrientation.Angle0; }
500                 }
501
502                 public static bool Secure {
503                         get {
504                                 return true;
505                         }
506                 }
507
508                 public static bool ShowSounds {
509                         get {
510                                 return false;
511                         }
512                 }
513
514                 [MonoInternalNote ("Determine if we need an X11 implementation or if defaults are good.")]
515                 public static int SizingBorderWidth {
516                         get { return XplatUI.SizingBorderWidth; }
517                 }
518
519                 [MonoInternalNote ("Determine if we need an X11 implementation or if defaults are good.")]
520                 public static Size SmallCaptionButtonSize {
521                         get { return XplatUI.SmallCaptionButtonSize; }
522                 }
523
524                 public static Size SmallIconSize {
525                         get {
526                                 return XplatUI.SmallIconSize;
527                         }
528                 }
529
530                 public static bool TerminalServerSession {
531                         get {
532                                 return false;
533                         }
534                 }
535
536                 public static Size ToolWindowCaptionButtonSize {
537                         get {
538                                 return ThemeEngine.Current.ToolWindowCaptionButtonSize;
539                         }
540                 }
541
542                 public static int ToolWindowCaptionHeight {
543                         get {
544                                 return ThemeEngine.Current.ToolWindowCaptionHeight;
545                         }
546                 }
547
548                 [MonoInternalNote ("Determine if we need an X11 implementation or if defaults are good.")]
549                 public static bool UIEffectsEnabled {
550                         get { return XplatUI.UIEffectsEnabled; }
551                 }
552
553                 public static string UserDomainName {
554                         get {
555                                 return Environment.UserDomainName;
556                         }
557                 }
558
559                 public static bool UserInteractive {
560                         get {
561                                 return Environment.UserInteractive;
562                         }
563                 }
564
565                 public static string UserName {
566                         get {
567                                 return Environment.UserName;
568                         }
569                 }
570
571                 [MonoInternalNote ("Determine if we need an X11 implementation or if defaults are good.")]
572                 public static int VerticalFocusThickness { get { return ThemeEngine.Current.VerticalFocusThickness; } }
573                 [MonoInternalNote ("Determine if we need an X11 implementation or if defaults are good.")]
574                 public static int VerticalResizeBorderThickness { get { return XplatUI.VerticalResizeBorderThickness; } }
575
576                 public static int VerticalScrollBarArrowHeight {
577                         get {
578                                 return ThemeEngine.Current.VerticalScrollBarArrowHeight;
579                         }
580                 }
581
582                 public static int VerticalScrollBarThumbHeight {
583                         get {
584                                 return ThemeEngine.Current.VerticalScrollBarThumbHeight;
585                         }
586                 }
587
588                 public static int VerticalScrollBarWidth {
589                         get {
590                                 return ThemeEngine.Current.VerticalScrollBarWidth;
591                         }
592                 }
593
594                 public static Rectangle VirtualScreen {
595                         get {
596                                 return XplatUI.VirtualScreen;
597                         }
598                 }
599
600                 public static Rectangle WorkingArea {
601                         get {
602                                 return XplatUI.WorkingArea;
603                         }
604                 }
605         }
606 }