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.
23 // Peter Bartok pbartok@novell.com
27 // define to log API calls to stdout
29 #undef DriverDebugPaint
30 #undef DriverDebugCreate
31 #undef DriverDebugDestroy
32 #undef DriverDebugState
36 using System.ComponentModel;
37 using System.Collections;
38 using System.Diagnostics;
39 using System.Runtime.InteropServices;
40 using System.Threading;
42 namespace System.Windows.Forms {
43 internal class XplatUI {
44 #region Local Variables
45 static XplatUIDriver driver;
46 static String default_class_name;
47 #endregion // Local Variables
49 #region Private Methods
50 internal static string Window(IntPtr handle) {
51 return String.Format("'{0}' ({1:X})", Control.FromHandle(handle), handle.ToInt32());
53 #endregion // Private Methods
57 static public Keys ModifierKeys {
59 return driver.ModifierKeys;
63 static public MouseButtons MouseButtons {
65 return driver.MouseButtons;
69 static public Point MousePosition {
71 return driver.MousePosition;
76 #endregion // Subclasses
78 #region Constructor & Destructor
80 // Compose name with current domain id because on Win32 we register class name
81 // and name must be unique to process. If we load MWF into multiple appdomains
82 // and try to register same class name we fail.
83 default_class_name = "SWFClass" + System.Threading.Thread.GetDomainID().ToString();
85 // check for Unix platforms - see FAQ for more details
86 // http://www.mono-project.com/FAQ:_Technical#How_to_detect_the_execution_platform_.3F
87 int platform = (int) Environment.OSVersion.Platform;
88 if ((platform == 4) || (platform == 128)) {
89 if (Environment.GetEnvironmentVariable ("not_supported_MONO_MWF_USE_QUARTZ_BACKEND") != null)
90 driver=XplatUIOSX.GetInstance();
92 driver=XplatUIX11.GetInstance();
94 driver=XplatUIWin32.GetInstance();
97 driver.InitializeDriver();
99 // Initialize things that need to be done after the driver is ready
100 DataFormats.GetFormat(0);
102 #endregion // Constructor & Destructor
104 #region Public Static Properties
105 internal static string DefaultClassName {
107 return default_class_name;
111 default_class_name=value;
115 static public int CaptionHeight {
117 return driver.Caption;
121 static public Size CursorSize {
123 return driver.CursorSize;
127 static public bool DragFullWindows {
129 return driver.DragFullWindows;
133 static public Size DragSize {
135 return driver.DragSize;
139 public static Size FrameBorderSize {
141 return driver.FrameBorderSize;
145 static public int HorizontalScrollBarHeight {
147 return driver.HorizontalScrollBarHeight;
151 static public Size IconSize {
153 return driver.IconSize;
157 static public int KeyboardSpeed {
159 return driver.KeyboardSpeed;
163 static public int KeyboardDelay {
165 return driver.KeyboardSpeed;
169 static public Size MaxWindowTrackSize {
171 return driver.MaxWindowTrackSize;
175 static public Size MinimizedWindowSize {
177 return driver.MinimizedWindowSize;
181 static public Size MinimizedWindowSpacingSize {
183 return driver.MinimizedWindowSpacingSize;
187 static public Size MinimumWindowSize {
189 return driver.MinimumWindowSize;
193 static public Size MinWindowTrackSize {
195 return driver.MinWindowTrackSize;
199 static public Size SmallIconSize {
201 return driver.SmallIconSize;
205 static public int MenuHeight {
207 return driver.MenuHeight;
211 static public int MouseButtonCount {
213 return driver.MouseButtonCount;
217 static public bool MouseButtonsSwapped {
219 return driver.MouseButtonsSwapped;
223 static public Size MouseHoverSize {
225 return driver.MouseHoverSize;
229 static public int MouseHoverTime {
231 return driver.MouseHoverTime;
235 static public bool MouseWheelPresent {
237 return driver.MouseWheelPresent;
241 static public bool UserClipWontExposeParent {
243 return driver.UserClipWontExposeParent;
247 static public int VerticalScrollBarWidth {
249 return driver.VerticalScrollBarWidth;
253 static public Rectangle VirtualScreen {
255 return driver.VirtualScreen;
259 static public Rectangle WorkingArea {
261 return driver.WorkingArea;
265 public static bool ThemesEnabled {
267 return XplatUI.driver.ThemesEnabled;
272 #endregion // Public Static Properties
275 internal static event EventHandler Idle {
277 driver.Idle += value;
280 driver.Idle -= value;
286 #region Public Static Methods
287 internal static void Activate(IntPtr handle) {
289 Console.WriteLine("Activate({0}): Called", Window(handle));
291 driver.Activate(handle);
294 internal static void AudibleAlert() {
296 Console.WriteLine("AudibleAlert(): Called");
298 driver.AudibleAlert();
301 internal static bool CalculateWindowRect(ref Rectangle ClientRect, int Style, int ExStyle, Menu menu, out Rectangle WindowRect) {
303 Console.WriteLine("CalculateWindowRect({0}, {1}, {2}, {3}): Called", ClientRect, Style, ExStyle, menu);
305 return driver.CalculateWindowRect(ref ClientRect, Style, ExStyle, menu, out WindowRect);
308 internal static void CaretVisible(IntPtr handle, bool visible) {
310 Console.WriteLine("CaretVisible({0:X}, {1}): Called", handle.ToInt32(), visible);
312 driver.CaretVisible(handle, visible);
315 internal static void CreateCaret(IntPtr handle, int width, int height) {
317 Console.WriteLine("CreateCaret({0:X}), {1}, {2}: Called", handle.ToInt32(), width, height);
319 driver.CreateCaret(handle, width, height);
322 internal static IntPtr CreateWindow(CreateParams cp) {
323 #if DriverDebug || DriverDebugCreate
326 handle = driver.CreateWindow(cp);
328 Console.WriteLine("CreateWindow(): Called, returning {0:X}", handle.ToInt32());
331 return driver.CreateWindow(cp);
335 internal static IntPtr CreateWindow(IntPtr Parent, int X, int Y, int Width, int Height) {
336 #if DriverDebug || DriverDebugCreate
337 Console.WriteLine("CreateWindow(): Called");
339 return driver.CreateWindow(Parent, X, Y, Width, Height);
342 internal static void ClientToScreen(IntPtr handle, ref int x, ref int y) {
344 Console.WriteLine("ClientToScreen({0}, {1}, {2}): Called", Window(handle), x, y);
346 driver.ClientToScreen(handle, ref x, ref y);
349 internal static int[] ClipboardAvailableFormats(IntPtr handle) {
351 Console.WriteLine("ClipboardAvailableTypes({0:X}): Called", handle.ToInt32());
353 return driver.ClipboardAvailableFormats(handle);
356 internal static void ClipboardClose(IntPtr handle) {
358 Console.WriteLine("ClipboardClose({0:X}): Called", handle.ToInt32());
360 driver.ClipboardClose(handle);
363 internal static int ClipboardGetID(IntPtr handle, string format) {
365 Console.WriteLine("ClipboardGetID({0:X}, {1}): Called", handle.ToInt32(), format);
367 return driver.ClipboardGetID(handle, format);
370 internal static IntPtr ClipboardOpen(bool primary_selection) {
372 Console.WriteLine("ClipboardOpen(): Called");
374 return driver.ClipboardOpen (primary_selection);
377 internal static void ClipboardStore(IntPtr handle, object obj, int type, XplatUI.ObjectToClipboard converter) {
379 Console.WriteLine("ClipboardStore({0:X}, {1}, {2}): Called", handle.ToInt32(), obj, type, converter);
381 driver.ClipboardStore(handle, obj, type, converter);
384 internal static object ClipboardRetrieve(IntPtr handle, int type, XplatUI.ClipboardToObject converter) {
386 Console.WriteLine("ClipboardRetrieve({0:X}, type, {1}): Called", handle.ToInt32(), converter);
388 return driver.ClipboardRetrieve(handle, type, converter);
391 internal static IntPtr DefineCursor(Bitmap bitmap, Bitmap mask, Color cursor_pixel, Color mask_pixel, int xHotSpot, int yHotSpot) {
393 Console.WriteLine("DefineCursor(...): Called");
395 return driver.DefineCursor(bitmap, mask, cursor_pixel, mask_pixel, xHotSpot, yHotSpot);
398 internal static IntPtr DefineStdCursor(StdCursor id) {
399 return driver.DefineStdCursor(id);
402 internal static IntPtr DefWndProc(ref Message msg) {
403 return driver.DefWndProc(ref msg);
406 internal static void DestroyCaret(IntPtr handle) {
408 Console.WriteLine("DestroyCaret({0:X}): Called", handle.ToInt32());
410 driver.DestroyCaret(handle);
413 internal static void DestroyCursor(IntPtr cursor) {
415 Console.WriteLine("DestroyCursor({0:X}): Called", cursor.ToInt32());
417 driver.DestroyCursor(cursor);
420 internal static void DestroyWindow(IntPtr handle) {
421 #if DriverDebug || DriverDebugDestroy
422 Console.WriteLine("DestroyWindow({0}): Called", Window(handle));
424 driver.DestroyWindow(handle);
427 internal static IntPtr DispatchMessage(ref MSG msg) {
428 return driver.DispatchMessage(ref msg);
431 internal static void DoEvents() {
435 internal static void DrawReversibleRectangle(IntPtr handle, Rectangle rect, int line_width) {
437 Console.WriteLine("DrawReversibleRectangle({0}, {1}, {2}): Called", Window(handle), rect, line_width);
439 driver.DrawReversibleRectangle(handle, rect, line_width);
442 internal static void EnableThemes() {
443 driver.EnableThemes();
446 internal static void EnableWindow(IntPtr handle, bool Enable) {
447 #if DriverDebug || DriverDebugState
448 Console.WriteLine("EnableWindow({0}, {1}): Called", Window(handle), Enable);
450 driver.EnableWindow(handle, Enable);
453 internal static void EndLoop(Thread thread) {
455 Console.WriteLine("EndLoop({0:X}): Called", thread.GetHashCode());
457 driver.EndLoop(thread);
460 internal static IntPtr GetActive() {
462 Console.WriteLine("GetActive(): Called");
464 return driver.GetActive();
467 internal static SizeF GetAutoScaleSize(Font font) {
469 Console.WriteLine("GetAutoScaleSize({0}): Called", font);
471 return driver.GetAutoScaleSize(font);
474 internal static Region GetClipRegion(IntPtr handle) {
476 Console.WriteLine("GetClipRegion({0}): Called", Window(handle));
478 return driver.GetClipRegion(handle);
481 internal static void GetCursorInfo(IntPtr cursor, out int width, out int height, out int hotspot_x, out int hotspot_y) {
483 Console.WriteLine("GetCursorInfo({0}): Called", cursor.ToInt32());
485 driver.GetCursorInfo(cursor, out width, out height, out hotspot_x, out hotspot_y);
488 internal static void GetCursorPos(IntPtr handle, out int x, out int y) {
490 Console.WriteLine("GetCursorPos({0}): Called", Window(handle));
492 driver.GetCursorPos(handle, out x, out y);
495 internal static void GetDisplaySize(out Size size) {
497 Console.WriteLine("GetDisplaySize(): Called");
499 driver.GetDisplaySize(out size);
502 internal static IntPtr GetFocus() {
504 Console.WriteLine("GetFocus(): Called, Result:{0}", Window(driver.GetFocus()));
506 return driver.GetFocus();
509 internal static bool GetFontMetrics(Graphics g, Font font, out int ascent, out int descent) {
511 Console.WriteLine("GetFontMetrics(): Called");
513 return driver.GetFontMetrics(g, font, out ascent, out descent);
516 internal static Point GetMenuOrigin(IntPtr handle) {
518 Console.WriteLine("GetMenuOrigin({0}): Called", Window(handle));
520 return driver.GetMenuOrigin(handle);
523 internal static bool GetMessage(object queue_id, ref MSG msg, IntPtr hWnd, int wFilterMin, int wFilterMax) {
524 return driver.GetMessage(queue_id, ref msg, hWnd, wFilterMin, wFilterMax);
527 internal static IntPtr GetParent(IntPtr handle) {
529 Console.WriteLine("GetParent({0}): Called", Window(handle));
531 return driver.GetParent(handle);
534 internal static bool GetText(IntPtr handle, out string text) {
536 Console.WriteLine("GetText({0}): Called", Window(handle));
538 return driver.GetText(handle, out text);
541 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) {
543 Console.WriteLine("GetWindowPos({0}): Called", Window(handle));
545 driver.GetWindowPos(handle, is_toplevel, out x, out y, out width, out height, out client_width, out client_height);
548 internal static FormWindowState GetWindowState(IntPtr handle) {
550 Console.WriteLine("GetWindowState({0}): Called", Window(handle));
552 return driver.GetWindowState(handle);
555 internal static void GrabInfo(out IntPtr handle, out bool GrabConfined, out Rectangle GrabArea) {
557 Console.WriteLine("GrabInfo(): Called");
559 driver.GrabInfo(out handle, out GrabConfined, out GrabArea);
562 internal static void GrabWindow(IntPtr handle, IntPtr ConfineToHwnd) {
564 Console.WriteLine("GrabWindow({0}, {1}): Called", Window(handle), Window(ConfineToHwnd));
566 driver.GrabWindow(handle, ConfineToHwnd);
569 internal static void HandleException(Exception e) {
570 driver.HandleException(e);
573 internal static void Invalidate(IntPtr handle, Rectangle rc, bool clear) {
575 Console.WriteLine("Invalidate({0}, {1}, {2}): Called", Window(handle), rc, clear);
577 driver.Invalidate(handle, rc, clear);
580 internal static bool IsEnabled(IntPtr handle) {
581 #if DriverDebug || DriverDebugState
582 Console.WriteLine("IsEnabled({0}): Called, Result={1}", Window(handle), driver.IsEnabled(handle));
584 return driver.IsEnabled(handle);
587 internal static bool IsVisible(IntPtr handle) {
588 #if DriverDebug || DriverDebugState
589 Console.WriteLine("IsVisible({0}): Called, Result={1}", Window(handle), driver.IsVisible(handle));
591 return driver.IsVisible(handle);
594 internal static void KillTimer (Timer timer)
597 Console.WriteLine("KillTimer({0}): Called", timer);
599 driver.KillTimer (timer);
602 internal static void MenuToScreen(IntPtr handle, ref int x, ref int y) {
604 Console.WriteLine("MenuToScreen({0}, {1}, {2}): Called", Window(handle), x, y);
606 driver.MenuToScreen(handle, ref x, ref y);
609 internal static void OverrideCursor(IntPtr cursor) {
611 Console.WriteLine("OverrideCursor({0:X}): Called", cursor.ToInt32());
613 driver.OverrideCursor(cursor);
616 internal static void PaintEventEnd(IntPtr handle, bool client) {
617 #if DriverDebug || DriverDebugPaint
618 Console.WriteLine("PaintEventEnd({0}, {1}): Called from thread {2}", Window(handle), client, Thread.CurrentThread.GetHashCode());
620 driver.PaintEventEnd(handle, client);
623 internal static PaintEventArgs PaintEventStart(IntPtr handle, bool client) {
624 #if DriverDebug || DriverDebugPaint
625 Console.WriteLine("PaintEventStart({0}, {1}): Called from thread {2}", Window(handle), client, Thread.CurrentThread.GetHashCode());
627 return driver.PaintEventStart(handle, client);
630 internal static bool PeekMessage(Object queue_id, ref MSG msg, IntPtr hWnd, int wFilterMin, int wFilterMax, uint flags) {
631 return driver.PeekMessage(queue_id, ref msg, hWnd, wFilterMin, wFilterMax, flags);
634 internal static bool PostMessage(IntPtr hwnd, Msg message, IntPtr wParam, IntPtr lParam) {
636 Console.WriteLine("PostMessage({0}, {1}, {2:X}, {3:X}): Called", Window(hwnd), message, wParam.ToInt32(), lParam.ToInt32());
638 return driver.PostMessage(hwnd, message, wParam, lParam);
641 internal static bool PostMessage(ref MSG msg) {
643 Console.WriteLine("PostMessage({0}): Called", msg);
645 return driver.PostMessage(msg.hwnd, msg.message, msg.wParam, msg.lParam);
648 internal static void PostQuitMessage(int exitCode) {
650 Console.WriteLine("PostQuitMessage({0}): Called", exitCode);
652 driver.PostQuitMessage(exitCode);
655 internal static void RequestNCRecalc(IntPtr handle) {
657 Console.WriteLine("RequestNCRecalc({0}): Called", Window(handle));
659 driver.RequestNCRecalc(handle);
662 internal static void ResetMouseHover(IntPtr handle) {
664 Console.WriteLine("ResetMouseHover({0}): Called", Window(handle));
666 driver.ResetMouseHover(handle);
669 internal static void ScreenToClient(IntPtr handle, ref int x, ref int y) {
671 Console.WriteLine("ScreenToClient({0}, {1}, {2}): Called", Window(handle), x, y);
673 driver.ScreenToClient (handle, ref x, ref y);
676 internal static void ScreenToMenu(IntPtr handle, ref int x, ref int y) {
678 Console.WriteLine("ScreenToMenu({0}, {1}, {2}): Called", Window(handle), x, y);
680 driver.ScreenToMenu(handle, ref x, ref y);
683 internal static void ScrollWindow(IntPtr handle, Rectangle rectangle, int XAmount, int YAmount, bool with_children) {
685 Console.WriteLine("ScrollWindow({0}, {1}, {2}, {3}, {4}): Called", Window(handle), rectangle, XAmount, YAmount, with_children);
687 driver.ScrollWindow(handle, rectangle, XAmount, YAmount, with_children);
690 internal static void ScrollWindow(IntPtr handle, int XAmount, int YAmount, bool with_children) {
692 Console.WriteLine("ScrollWindow({0}, {2}, {3}, {4}): Called", Window(handle), XAmount, YAmount, with_children);
694 driver.ScrollWindow(handle, XAmount, YAmount, with_children);
697 internal static void SendAsyncMethod (AsyncMethodData data) {
699 Console.WriteLine("SendAsyncMethod({0}): Called", data);
701 driver.SendAsyncMethod (data);
704 internal static IntPtr SendMessage (IntPtr handle, Msg message, IntPtr wParam, IntPtr lParam) {
706 Console.WriteLine("SendMessage ({0}, {1}, {2:X}, {3:X}): Called", Window(handle), message, wParam.ToInt32(), lParam.ToInt32());
708 return driver.SendMessage (handle, message, wParam, lParam);
711 internal static void SendMessage (ref Message m) {
713 Console.WriteLine("SendMessage ({0}): Called", m);
715 m.Result = driver.SendMessage(m.HWnd, (Msg)m.Msg, m.WParam, m.LParam);
718 internal static void SetAllowDrop (IntPtr handle, bool value)
721 Console.WriteLine ("SetAllowDrop({0}, {1}): Called", handle, value);
723 driver.SetAllowDrop (handle, value);
726 internal static void SetBorderStyle(IntPtr handle, FormBorderStyle border_style) {
728 Console.WriteLine("SetBorderStyle({0}, {1}): Called", Window(handle), border_style);
730 driver.SetBorderStyle(handle, border_style);
733 internal static void SetCaretPos(IntPtr handle, int x, int y) {
735 Console.WriteLine("SetCaretPos({0}, {1}, {2}): Called", Window(handle), x, y);
737 driver.SetCaretPos(handle, x, y);
740 internal static void SetClipRegion(IntPtr handle, Region region) {
742 Console.WriteLine("SetClipRegion({0}, {1}): Called", Window(handle), region);
744 driver.SetClipRegion(handle, region);
747 internal static void SetCursor(IntPtr handle, IntPtr cursor) {
749 Console.WriteLine("SetCursor({0}, {1:X}): Called", Window(handle), cursor.ToInt32());
751 driver.SetCursor(handle, cursor);
754 internal static void SetCursorPos(IntPtr handle, int x, int y) {
756 Console.WriteLine("SetCursorPos({0}, {1}, {2}): Called", Window(handle), x, y);
758 driver.SetCursorPos(handle, x, y);
761 internal static void SetFocus(IntPtr handle) {
763 Console.WriteLine("SetFocus({0}): Called", Window(handle));
765 driver.SetFocus(handle);
768 internal static void SetIcon(IntPtr handle, Icon icon) {
770 Console.WriteLine("SetIcon({0}, {1}): Called", Window(handle), icon);
772 driver.SetIcon(handle, icon);
775 internal static void SetMenu(IntPtr handle, Menu menu) {
777 Console.WriteLine("SetMenu({0}, {1}): Called", Window(handle), menu);
779 driver.SetMenu(handle, menu);
782 internal static void SetModal(IntPtr handle, bool Modal) {
783 #if DriverDebug || DriverDebugState
784 Console.WriteLine("SetModal({0}, {1}): Called", Window(handle), Modal);
786 driver.SetModal(handle, Modal);
789 internal static IntPtr SetParent(IntPtr handle, IntPtr hParent) {
791 Console.WriteLine("SetParent({0}, {1:X}): Called", Window(handle), Window(hParent));
793 return driver.SetParent(handle, hParent);
796 internal static void SetTimer (Timer timer)
799 Console.WriteLine("SetTimer({0}): Called", timer);
801 driver.SetTimer (timer);
804 internal static bool SetTopmost(IntPtr handle, IntPtr hWndOwner, bool Enabled) {
806 Console.WriteLine("SetTopMost({0}, {1}, {2}): Called", Window(handle), Window(hWndOwner), Enabled);
808 return driver.SetTopmost(handle, hWndOwner, Enabled);
811 internal static bool SetVisible(IntPtr handle, bool visible) {
812 #if DriverDebug || DriverDebugState
813 Console.WriteLine("SetVisible({0}, {1}): Called", Window(handle), visible);
815 return driver.SetVisible(handle, visible);
818 internal static void SetWindowMinMax(IntPtr handle, Rectangle maximized, Size min, Size max) {
819 #if DriverDebug || DriverDebugState
820 Console.WriteLine("SetWindowMinMax({0}, {1}, {2}, {3}): Called", Window(handle), maximized, min, max);
822 driver.SetWindowMinMax(handle, maximized, min, max);
825 internal static void SetWindowPos(IntPtr handle, int x, int y, int width, int height) {
827 Console.WriteLine("SetWindowPos({0}, {1}, {2}, {3}, {4}): Called", Window(handle), x, y, width, height);
829 driver.SetWindowPos(handle, x, y, width, height);
832 internal static void SetWindowState(IntPtr handle, FormWindowState state) {
833 #if DriverDebug || DriverDebugState
834 Console.WriteLine("SetWindowState({0} {1}): Called", Window(handle), state);
836 driver.SetWindowState(handle, state);
839 internal static void SetWindowStyle(IntPtr handle, CreateParams cp) {
841 Console.WriteLine("SetWindowStyle({0}): Called", Window(handle));
843 driver.SetWindowStyle(handle, cp);
846 internal static void SetWindowTransparency(IntPtr handle, double transparency, Color key)
849 Console.WriteLine("SetWindowTransparency({0}): Called", Window(handle));
851 driver.SetWindowTransparency(handle, transparency, key);
854 internal static bool SetZOrder(IntPtr handle, IntPtr AfterhWnd, bool Top, bool Bottom) {
856 Console.WriteLine("SetZOrder({0}, {1:X}, {2}, {3}): Called", Window(handle), Window(AfterhWnd), Top, Bottom);
858 return driver.SetZOrder(handle, AfterhWnd, Top, Bottom);
861 internal static void ShowCursor(bool show) {
863 Console.WriteLine("ShowCursor({0}): Called", show);
865 driver.ShowCursor(show);
868 internal static DragDropEffects StartDrag(IntPtr handle, object data, DragDropEffects allowedEffects) {
870 Console.WriteLine ("StartDrag({0}, {1}, {2}): Called", Window(handle), data, allowedEffects);
872 return driver.StartDrag (handle, data, allowedEffects);
875 internal static object StartLoop(Thread thread) {
877 Console.WriteLine("StartLoop({0:X}): Called", thread.GetHashCode());
879 return driver.StartLoop(thread);
882 internal static bool SupportsTransparency() {
884 Console.WriteLine("SupportsTransparency(): Called, result={0}", driver.SupportsTransparency());
886 return driver.SupportsTransparency();
889 internal static bool SystrayAdd(IntPtr handle, string tip, Icon icon, out ToolTip tt) {
891 Console.WriteLine("SystrayAdd({0}, {1}): Called", Window(handle), tip);
893 return driver.SystrayAdd(handle, tip, icon, out tt);
896 internal static void SystrayChange(IntPtr handle, string tip, Icon icon, ref ToolTip tt) {
898 Console.WriteLine("SystrayChange({0}, {1}): Called", Window(handle), tip);
900 driver.SystrayChange(handle, tip, icon, ref tt);
903 internal static void SystrayRemove(IntPtr handle, ref ToolTip tt) {
905 Console.WriteLine("SystrayRemove({0}): Called", Window(handle));
907 driver.SystrayRemove(handle, ref tt);
910 internal static bool Text(IntPtr handle, string text) {
912 Console.WriteLine("Text({0}, {1}): Called", Window(handle), text);
914 return driver.Text(handle, text);
917 internal static bool TranslateMessage(ref MSG msg) {
918 return driver.TranslateMessage(ref msg);
921 internal static void UngrabWindow(IntPtr handle) {
923 Console.WriteLine("UngrabWindow({0}): Called", Window(handle));
925 driver.UngrabWindow(handle);
928 internal static void UpdateWindow(IntPtr handle) {
930 Console.WriteLine("UpdateWindow({0}): Called", Window(handle));
932 driver.UpdateWindow(handle);
935 // Santa's little helper
936 internal static void Version() {
937 Console.WriteLine("Xplat version $Revision: $");
940 internal static void Where() {
943 #endregion // Public Static Methods
946 public delegate bool ClipboardToObject(int type, IntPtr data, out object obj);
947 public delegate bool ObjectToClipboard(ref int type, object obj, out byte[] data);
948 #endregion // Delegates