2005-01-31 Zoltan Varga <vargaz@freemail.hu>
[mono.git] / mcs / class / Managed.Windows.Forms / System.Windows.Forms / XplatUI.cs
index ab9592bf894fa91217237bdc4aa0c2fd81a1c1fb..903f7d9a21be41dc1d88ac3070442b895d43b661 100644 (file)
@@ -32,23 +32,10 @@ using System.Collections;
 using System.Diagnostics;
 using System.Runtime.InteropServices;
 
-//
-// Random architecture notes
-// We need
-// * windows
-//   - create
-//   - set location/size
-//   - define cursor
-//   - destroy
-//   - reparent?
-//   - show/hide
-// * Keyboard
-// * Mouse
-//
 
 /// X11 Version
 namespace System.Windows.Forms {
-       public class XplatUI {
+       internal class XplatUI {
                #region Local Variables
                static XplatUIDriver            driver;
                static String                   default_class_name;
@@ -84,6 +71,7 @@ namespace System.Windows.Forms {
                                        driver.DropTarget=value;
                                }
                        }
+
                }
                #endregion      // Subclasses
 
@@ -119,6 +107,96 @@ namespace System.Windows.Forms {
                                default_class_name=value;
                        }
                }
+
+               static public Size CursorSize {
+                       get {
+                               return driver.CursorSize;
+                       }
+               }
+
+               static public bool DragFullWindows {
+                       get {
+                               return driver.DragFullWindows;
+                       }
+               }
+
+               static public Size DragSize {
+                       get {
+                               return driver.DragSize;
+                       }
+               }
+
+               static public Size IconSize {
+                       get {
+                               return driver.IconSize;
+                       }
+               }
+
+               static public Size MaxWindowTrackSize {
+                       get {
+                               return driver.MaxWindowTrackSize;
+                       }
+               }
+
+               static public Size MinimizedWindowSize {
+                       get {
+                               return driver.MinimizedWindowSize;
+                       }
+               }
+
+               static public Size MinimizedWindowSpacingSize {
+                       get {
+                               return driver.MinimizedWindowSpacingSize;
+                       }
+               }
+
+               static public Size MinimumWindowSize {
+                       get {
+                               return driver.MinimumWindowSize;
+                       }
+               }
+
+               static public Size MinWindowTrackSize {
+                       get {
+                               return driver.MinWindowTrackSize;
+                       }
+               }
+
+               static public Size SmallIconSize {
+                       get {
+                               return driver.SmallIconSize;
+                       }
+               }
+
+               static public int MouseButtonCount {
+                       get {
+                               return driver.MouseButtonCount;
+                       }
+               }
+
+               static public bool MouseButtonsSwapped {
+                       get {
+                               return driver.MouseButtonsSwapped;
+                       }
+               }
+
+               static public bool MouseWheelPresent {
+                       get {
+                               return driver.MouseWheelPresent;
+                       }
+               }
+
+               static public Rectangle VirtualScreen {
+                       get {
+                               return driver.VirtualScreen;
+                       }
+               }
+
+               static public Rectangle WorkingArea {
+                       get {
+                               return driver.WorkingArea;
+                       }
+               }
                #endregion      // Public Static Properties
 
                 internal static event EventHandler Idle {
@@ -195,8 +273,8 @@ namespace System.Windows.Forms {
                        driver.SetWindowStyle(handle, cp);
                }
 
-               internal static void RefreshWindow(IntPtr handle) {
-                       driver.RefreshWindow(handle);
+               internal static void UpdateWindow(IntPtr handle) {
+                       driver.UpdateWindow(handle);
                }
 
                internal static void SetWindowBackground(IntPtr handle, Color color) {
@@ -215,8 +293,8 @@ namespace System.Windows.Forms {
                        driver.SetWindowPos(handle, x, y, width, height);
                }
 
-               internal static void GetWindowPos(IntPtr handle, out int x, out int y, out int width, out int height, out int client_width, out int client_height) {
-                       driver.GetWindowPos(handle, out x, out y, out width, out height, out client_width, out client_height);
+               internal static void GetWindowPos(IntPtr handle, bool is_toplevel, out int x, out int y, out int width, out int height, out int client_width, out int client_height) {
+                       driver.GetWindowPos(handle, is_toplevel, out x, out y, out width, out height, out client_width, out client_height);
                }
 
                internal static void Invalidate(IntPtr handle, Rectangle rc, bool clear) {
@@ -287,6 +365,34 @@ namespace System.Windows.Forms {
                        return driver.CalculateWindowRect(hWnd, ref ClientRect, Style, HasMenu, out WindowRect);
                }
 
+               internal static void SetCursor(IntPtr hwnd, IntPtr cursor) {
+                       driver.SetCursor(hwnd, cursor);
+               }
+
+               internal static void ShowCursor(bool show) {
+                       driver.ShowCursor(show);
+               }
+
+               internal static void OverrideCursor(IntPtr cursor) {
+                       driver.OverrideCursor(cursor);
+               }
+
+               internal static IntPtr DefineCursor(Bitmap bitmap, Bitmap mask, Color cursor_pixel, Color mask_pixel, int xHotSpot, int yHotSpot) {
+                       return driver.DefineCursor(bitmap, mask, cursor_pixel, mask_pixel, xHotSpot, yHotSpot);
+               }
+
+               internal static IntPtr DefineStdCursor(StdCursor id) {
+                       return driver.DefineStdCursor(id);
+               }
+
+               internal static void DestroyCursor(IntPtr cursor) {
+                       driver.DestroyCursor(cursor);
+               }
+
+               internal static void GetCursorInfo(IntPtr cursor, out int width, out int height, out int hotspot_x, out int hotspot_y) {
+                       driver.GetCursorInfo(cursor, out width, out height, out hotspot_x, out hotspot_y);
+               }
+
                internal static void SetCursorPos(IntPtr handle, int x, int y) {
                        driver.SetCursorPos(handle, x, y);
                }
@@ -357,14 +463,27 @@ namespace System.Windows.Forms {
                        }
                }
 
-               public static void ScrollWindow(IntPtr hwnd, Rectangle rectangle, int XAmount, int YAmount, bool clear) {
+               internal static void ScrollWindow(IntPtr hwnd, Rectangle rectangle, int XAmount, int YAmount, bool clear) {
                        driver.ScrollWindow(hwnd, rectangle, XAmount, YAmount, clear);
                }
 
-               public static void ScrollWindow(IntPtr hwnd, int XAmount, int YAmount, bool clear) {
+               internal static void ScrollWindow(IntPtr hwnd, int XAmount, int YAmount, bool clear) {
                        driver.ScrollWindow(hwnd, XAmount, YAmount, clear);
                }
-               
+
+               internal static bool SystrayAdd(IntPtr hwnd, string tip, Icon icon, out ToolTip tt) {
+                       return driver.SystrayAdd(hwnd, tip, icon, out tt);
+               }
+
+               internal static void SystrayChange(IntPtr hwnd, string tip, Icon icon, ref ToolTip tt) {
+                       driver.SystrayChange(hwnd, tip, icon, ref tt);
+               }
+
+               internal static void SystrayRemove(IntPtr hwnd, ref ToolTip tt) {
+                       driver.SystrayRemove(hwnd, ref tt);
+               }
+
+
                // Santa's little helper
                internal static void Where() {
                        Console.WriteLine("Here: {0}", new StackTrace().ToString());