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 Console.WriteLine("Mono System.Windows.Forms Assembly [$auto_build_revision$]");
82 default_class_name="SWFClass";
84 // check for Unix platforms - see FAQ for more details
85 // http://www.mono-project.com/FAQ:_Technical#How_to_detect_the_execution_platform_.3F
86 int platform = (int) Environment.OSVersion.Platform;
87 if ((platform == 4) || (platform == 128)) {
88 if (Environment.GetEnvironmentVariable ("MONO_MWF_USE_QUARTZ_BACKEND") != null)
89 driver=XplatUIOSX.GetInstance();
91 driver=XplatUIX11.GetInstance();
93 driver=XplatUIWin32.GetInstance();
96 driver.InitializeDriver();
98 // Initialize things that need to be done after the driver is ready
99 DataFormats.GetFormat(0);
101 #endregion // Constructor & Destructor
103 #region Public Static Properties
104 internal static string DefaultClassName {
106 return default_class_name;
110 default_class_name=value;
114 static public int CaptionHeight {
116 return driver.Caption;
120 static public Size CursorSize {
122 return driver.CursorSize;
126 static public bool DragFullWindows {
128 return driver.DragFullWindows;
132 static public Size DragSize {
134 return driver.DragSize;
138 public static Size FrameBorderSize {
140 return driver.FrameBorderSize;
144 static public int HorizontalScrollBarHeight {
146 return driver.HorizontalScrollBarHeight;
150 static public Size IconSize {
152 return driver.IconSize;
156 static public int KeyboardSpeed {
158 return driver.KeyboardSpeed;
162 static public int KeyboardDelay {
164 return driver.KeyboardSpeed;
168 static public Size MaxWindowTrackSize {
170 return driver.MaxWindowTrackSize;
174 static public Size MinimizedWindowSize {
176 return driver.MinimizedWindowSize;
180 static public Size MinimizedWindowSpacingSize {
182 return driver.MinimizedWindowSpacingSize;
186 static public Size MinimumWindowSize {
188 return driver.MinimumWindowSize;
192 static public Size MinWindowTrackSize {
194 return driver.MinWindowTrackSize;
198 static public Size SmallIconSize {
200 return driver.SmallIconSize;
204 static public int MenuHeight {
206 return driver.MenuHeight;
210 static public int MouseButtonCount {
212 return driver.MouseButtonCount;
216 static public bool MouseButtonsSwapped {
218 return driver.MouseButtonsSwapped;
222 static public Size MouseHoverSize {
224 return driver.MouseHoverSize;
228 static public int MouseHoverTime {
230 return driver.MouseHoverTime;
234 static public bool MouseWheelPresent {
236 return driver.MouseWheelPresent;
240 static public bool UserClipWontExposeParent {
242 return driver.UserClipWontExposeParent;
246 static public int VerticalScrollBarWidth {
248 return driver.VerticalScrollBarWidth;
252 static public Rectangle VirtualScreen {
254 return driver.VirtualScreen;
258 static public Rectangle WorkingArea {
260 return driver.WorkingArea;
263 #endregion // Public Static Properties
266 internal static event EventHandler Idle {
268 driver.Idle += value;
271 driver.Idle -= value;
277 #region Public Static Methods
278 internal static void Activate(IntPtr handle) {
280 Console.WriteLine("Activate({0}): Called", Window(handle));
282 driver.Activate(handle);
285 internal static void AudibleAlert() {
287 Console.WriteLine("AudibleAlert(): Called");
289 driver.AudibleAlert();
292 internal static bool CalculateWindowRect(ref Rectangle ClientRect, int Style, int ExStyle, Menu menu, out Rectangle WindowRect) {
294 Console.WriteLine("CalculateWindowRect({0}, {1}, {2}, {3}): Called", ClientRect, Style, ExStyle, menu);
296 return driver.CalculateWindowRect(ref ClientRect, Style, ExStyle, menu, out WindowRect);
299 internal static void CaretVisible(IntPtr handle, bool visible) {
301 Console.WriteLine("CaretVisible({0:X}, {1}): Called", handle.ToInt32(), visible);
303 driver.CaretVisible(handle, visible);
306 internal static void CreateCaret(IntPtr handle, int width, int height) {
308 Console.WriteLine("CreateCaret({0:X}), {1}, {2}: Called", handle.ToInt32(), width, height);
310 driver.CreateCaret(handle, width, height);
313 internal static IntPtr CreateWindow(CreateParams cp) {
314 #if DriverDebug || DriverDebugCreate
317 handle = driver.CreateWindow(cp);
319 Console.WriteLine("CreateWindow(): Called, returning {0:X}", handle.ToInt32());
322 return driver.CreateWindow(cp);
326 internal static IntPtr CreateWindow(IntPtr Parent, int X, int Y, int Width, int Height) {
327 #if DriverDebug || DriverDebugCreate
328 Console.WriteLine("CreateWindow(): Called");
330 return driver.CreateWindow(Parent, X, Y, Width, Height);
333 internal static void ClientToScreen(IntPtr handle, ref int x, ref int y) {
335 Console.WriteLine("ClientToScreen({0}, {1}, {2}): Called", Window(handle), x, y);
337 driver.ClientToScreen(handle, ref x, ref y);
340 internal static int[] ClipboardAvailableFormats(IntPtr handle) {
342 Console.WriteLine("ClipboardAvailableTypes({0:X}): Called", handle.ToInt32());
344 return driver.ClipboardAvailableFormats(handle);
347 internal static void ClipboardClose(IntPtr handle) {
349 Console.WriteLine("ClipboardClose({0:X}): Called", handle.ToInt32());
351 driver.ClipboardClose(handle);
354 internal static int ClipboardGetID(IntPtr handle, string format) {
356 Console.WriteLine("ClipboardGetID({0:X}, {1}): Called", handle.ToInt32(), format);
358 return driver.ClipboardGetID(handle, format);
361 internal static IntPtr ClipboardOpen() {
363 Console.WriteLine("ClipboardOpen(): Called");
365 return driver.ClipboardOpen();
368 internal static void ClipboardStore(IntPtr handle, object obj, int type, XplatUI.ObjectToClipboard converter) {
370 Console.WriteLine("ClipboardStore({0:X}, {1}, {2}): Called", handle.ToInt32(), obj, type, converter);
372 driver.ClipboardStore(handle, obj, type, converter);
375 internal static object ClipboardRetrieve(IntPtr handle, int type, XplatUI.ClipboardToObject converter) {
377 Console.WriteLine("ClipboardRetrieve({0:X}, type, {1}): Called", handle.ToInt32(), converter);
379 return driver.ClipboardRetrieve(handle, type, converter);
382 internal static IntPtr DefineCursor(Bitmap bitmap, Bitmap mask, Color cursor_pixel, Color mask_pixel, int xHotSpot, int yHotSpot) {
384 Console.WriteLine("DefineCursor(...): Called");
386 return driver.DefineCursor(bitmap, mask, cursor_pixel, mask_pixel, xHotSpot, yHotSpot);
389 internal static IntPtr DefineStdCursor(StdCursor id) {
390 return driver.DefineStdCursor(id);
393 internal static IntPtr DefWndProc(ref Message msg) {
394 return driver.DefWndProc(ref msg);
397 internal static void DestroyCaret(IntPtr handle) {
399 Console.WriteLine("DestroyCaret({0:X}): Called", handle.ToInt32());
401 driver.DestroyCaret(handle);
404 internal static void DestroyCursor(IntPtr cursor) {
406 Console.WriteLine("DestroyCursor({0:X}): Called", cursor.ToInt32());
408 driver.DestroyCursor(cursor);
411 internal static void DestroyWindow(IntPtr handle) {
412 #if DriverDebug || DriverDebugDestroy
413 Console.WriteLine("DestroyWindow({0}): Called", Window(handle));
415 driver.DestroyWindow(handle);
418 internal static IntPtr DispatchMessage(ref MSG msg) {
419 return driver.DispatchMessage(ref msg);
422 internal static void DoEvents() {
426 internal static void DrawReversibleRectangle(IntPtr handle, Rectangle rect, int line_width) {
428 Console.WriteLine("DrawReversibleRectangle({0}, {1}, {2}): Called", Window(handle), rect, line_width);
430 driver.DrawReversibleRectangle(handle, rect, line_width);
433 internal static void EnableThemes() {
434 driver.EnableThemes();
437 internal static void EnableWindow(IntPtr handle, bool Enable) {
438 #if DriverDebug || DriverDebugState
439 Console.WriteLine("EnableWindow({0}, {1}): Called", Window(handle), Enable);
441 driver.EnableWindow(handle, Enable);
444 internal static void EndLoop(Thread thread) {
446 Console.WriteLine("EndLoop({0:X}): Called", thread.GetHashCode());
448 driver.EndLoop(thread);
451 internal static IntPtr GetActive() {
453 Console.WriteLine("GetActive(): Called");
455 return driver.GetActive();
458 internal static SizeF GetAutoScaleSize(Font font) {
460 Console.WriteLine("GetAutoScaleSize({0}): Called", font);
462 return driver.GetAutoScaleSize(font);
465 internal static Region GetClipRegion(IntPtr handle) {
467 Console.WriteLine("GetClipRegion({0}): Called", Window(handle));
469 return driver.GetClipRegion(handle);
472 internal static void GetCursorInfo(IntPtr cursor, out int width, out int height, out int hotspot_x, out int hotspot_y) {
474 Console.WriteLine("GetCursorInfo({0}): Called", cursor.ToInt32());
476 driver.GetCursorInfo(cursor, out width, out height, out hotspot_x, out hotspot_y);
479 internal static void GetCursorPos(IntPtr handle, out int x, out int y) {
481 Console.WriteLine("GetCursorPos({0}): Called", Window(handle));
483 driver.GetCursorPos(handle, out x, out y);
486 internal static void GetDisplaySize(out Size size) {
488 Console.WriteLine("GetDisplaySize(): Called");
490 driver.GetDisplaySize(out size);
493 internal static bool GetFontMetrics(Graphics g, Font font, out int ascent, out int descent) {
495 Console.WriteLine("GetFontMetrics(): Called");
497 return driver.GetFontMetrics(g, font, out ascent, out descent);
500 internal static Point GetMenuOrigin(IntPtr handle) {
502 Console.WriteLine("GetMenuOrigin({0}): Called", Window(handle));
504 return driver.GetMenuOrigin(handle);
507 internal static bool GetMessage(object queue_id, ref MSG msg, IntPtr hWnd, int wFilterMin, int wFilterMax) {
508 return driver.GetMessage(queue_id, ref msg, hWnd, wFilterMin, wFilterMax);
511 internal static IntPtr GetParent(IntPtr handle) {
513 Console.WriteLine("GetParent({0}): Called", Window(handle));
515 return driver.GetParent(handle);
518 internal static bool GetText(IntPtr handle, out string text) {
520 Console.WriteLine("GetText({0}): Called", Window(handle));
522 return driver.GetText(handle, out text);
525 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) {
527 Console.WriteLine("GetWindowPos({0}): Called", Window(handle));
529 driver.GetWindowPos(handle, is_toplevel, out x, out y, out width, out height, out client_width, out client_height);
532 internal static FormWindowState GetWindowState(IntPtr handle) {
534 Console.WriteLine("GetWindowState({0}): Called", Window(handle));
536 return driver.GetWindowState(handle);
539 internal static void GrabInfo(out IntPtr handle, out bool GrabConfined, out Rectangle GrabArea) {
541 Console.WriteLine("GrabInfo(): Called");
543 driver.GrabInfo(out handle, out GrabConfined, out GrabArea);
546 internal static void GrabWindow(IntPtr handle, IntPtr ConfineToHwnd) {
548 Console.WriteLine("GrabWindow({0}, {1}): Called", Window(handle), Window(ConfineToHwnd));
550 driver.GrabWindow(handle, ConfineToHwnd);
553 internal static void HandleException(Exception e) {
554 driver.HandleException(e);
557 internal static void Invalidate(IntPtr handle, Rectangle rc, bool clear) {
559 Console.WriteLine("Invalidate({0}, {1}, {2}): Called", Window(handle), rc, clear);
561 driver.Invalidate(handle, rc, clear);
564 internal static bool IsEnabled(IntPtr handle) {
565 #if DriverDebug || DriverDebugState
566 Console.WriteLine("IsEnabled({0}): Called, Result={1}", Window(handle), driver.IsEnabled(handle));
568 return driver.IsEnabled(handle);
571 internal static bool IsVisible(IntPtr handle) {
572 #if DriverDebug || DriverDebugState
573 Console.WriteLine("IsVisible({0}): Called, Result={1}", Window(handle), driver.IsVisible(handle));
575 return driver.IsVisible(handle);
578 internal static void KillTimer (Timer timer)
581 Console.WriteLine("KillTimer({0}): Called", timer);
583 driver.KillTimer (timer);
586 internal static void MenuToScreen(IntPtr handle, ref int x, ref int y) {
588 Console.WriteLine("MenuToScreen({0}, {1}, {2}): Called", Window(handle), x, y);
590 driver.MenuToScreen(handle, ref x, ref y);
593 internal static void OverrideCursor(IntPtr cursor) {
595 Console.WriteLine("OverrideCursor({0:X}): Called", cursor.ToInt32());
597 driver.OverrideCursor(cursor);
600 internal static void PaintEventEnd(IntPtr handle, bool client) {
601 #if DriverDebug || DriverDebugPaint
602 Console.WriteLine("PaintEventEnd({0}, {1}): Called from thread {2}", Window(handle), client, Thread.CurrentThread.GetHashCode());
604 driver.PaintEventEnd(handle, client);
607 internal static PaintEventArgs PaintEventStart(IntPtr handle, bool client) {
608 #if DriverDebug || DriverDebugPaint
609 Console.WriteLine("PaintEventStart({0}, {1}): Called from thread {2}", Window(handle), client, Thread.CurrentThread.GetHashCode());
611 return driver.PaintEventStart(handle, client);
614 internal static bool PeekMessage(Object queue_id, ref MSG msg, IntPtr hWnd, int wFilterMin, int wFilterMax, uint flags) {
615 return driver.PeekMessage(queue_id, ref msg, hWnd, wFilterMin, wFilterMax, flags);
618 internal static bool PostMessage(IntPtr hwnd, Msg message, IntPtr wParam, IntPtr lParam) {
620 Console.WriteLine("PostMessage({0}, {1}, {2:X}, {3:X}): Called", Window(hwnd), message, wParam.ToInt32(), lParam.ToInt32());
622 return driver.PostMessage(hwnd, message, wParam, lParam);
625 internal static bool PostMessage(ref MSG msg) {
627 Console.WriteLine("PostMessage({0}): Called", msg);
629 return driver.PostMessage(msg.hwnd, msg.message, msg.wParam, msg.lParam);
632 internal static void PostQuitMessage(int exitCode) {
634 Console.WriteLine("PostQuitMessage({0}): Called", exitCode);
636 driver.PostQuitMessage(exitCode);
639 internal static void RequestNCRecalc(IntPtr handle) {
641 Console.WriteLine("RequestNCRecalc({0}): Called", Window(handle));
643 driver.RequestNCRecalc(handle);
646 internal static void ResetMouseHover(IntPtr handle) {
648 Console.WriteLine("ResetMouseHover({0}): Called", Window(handle));
650 driver.ResetMouseHover(handle);
653 internal static void ScreenToClient(IntPtr handle, ref int x, ref int y) {
655 Console.WriteLine("ScreenToClient({0}, {1}, {2}): Called", Window(handle), x, y);
657 driver.ScreenToClient (handle, ref x, ref y);
660 internal static void ScreenToMenu(IntPtr handle, ref int x, ref int y) {
662 Console.WriteLine("ScreenToMenu({0}, {1}, {2}): Called", Window(handle), x, y);
664 driver.ScreenToMenu(handle, ref x, ref y);
667 internal static void ScrollWindow(IntPtr handle, Rectangle rectangle, int XAmount, int YAmount, bool with_children) {
669 Console.WriteLine("ScrollWindow({0}, {1}, {2}, {3}, {4}): Called", Window(handle), rectangle, XAmount, YAmount, with_children);
671 driver.ScrollWindow(handle, rectangle, XAmount, YAmount, with_children);
674 internal static void ScrollWindow(IntPtr handle, int XAmount, int YAmount, bool with_children) {
676 Console.WriteLine("ScrollWindow({0}, {2}, {3}, {4}): Called", Window(handle), XAmount, YAmount, with_children);
678 driver.ScrollWindow(handle, XAmount, YAmount, with_children);
681 internal static void SendAsyncMethod (AsyncMethodData data) {
683 Console.WriteLine("SendAsyncMethod({0}): Called", data);
685 driver.SendAsyncMethod (data);
688 internal static IntPtr SendMessage (IntPtr handle, Msg message, IntPtr wParam, IntPtr lParam) {
690 Console.WriteLine("SendMessage ({0}, {1}, {2:X}, {3:X}): Called", Window(handle), message, wParam.ToInt32(), lParam.ToInt32());
692 return driver.SendMessage (handle, message, wParam, lParam);
695 internal static void SendMessage (ref Message m) {
697 Console.WriteLine("SendMessage ({0}): Called", m);
699 m.Result = driver.SendMessage(m.HWnd, (Msg)m.Msg, m.WParam, m.LParam);
702 internal static void SetAllowDrop (IntPtr handle, bool value)
705 Console.WriteLine ("SetAllowDrop({0}, {1}): Called", handle, value);
707 driver.SetAllowDrop (handle, value);
710 internal static void SetBorderStyle(IntPtr handle, FormBorderStyle border_style) {
712 Console.WriteLine("SetBorderStyle({0}, {1}): Called", Window(handle), border_style);
714 driver.SetBorderStyle(handle, border_style);
717 internal static void SetCaretPos(IntPtr handle, int x, int y) {
719 Console.WriteLine("SetCaretPos({0}, {1}, {2}): Called", Window(handle), x, y);
721 driver.SetCaretPos(handle, x, y);
724 internal static void SetClipRegion(IntPtr handle, Region region) {
726 Console.WriteLine("SetClipRegion({0}, {1}): Called", Window(handle), region);
728 driver.SetClipRegion(handle, region);
731 internal static void SetCursor(IntPtr handle, IntPtr cursor) {
733 Console.WriteLine("SetCursor({0}, {1:X}): Called", Window(handle), cursor.ToInt32());
735 driver.SetCursor(handle, cursor);
738 internal static void SetCursorPos(IntPtr handle, int x, int y) {
740 Console.WriteLine("SetCursorPos({0}, {1}, {2}): Called", Window(handle), x, y);
742 driver.SetCursorPos(handle, x, y);
745 internal static void SetFocus(IntPtr handle) {
747 Console.WriteLine("SetFocus({0}): Called", Window(handle));
749 driver.SetFocus(handle);
752 internal static void SetIcon(IntPtr handle, Icon icon) {
754 Console.WriteLine("SetIcon({0}, {1}): Called", Window(handle), icon);
756 driver.SetIcon(handle, icon);
759 internal static void SetMenu(IntPtr handle, Menu menu) {
761 Console.WriteLine("SetMenu({0}, {1}): Called", Window(handle), menu);
763 driver.SetMenu(handle, menu);
766 internal static void SetModal(IntPtr handle, bool Modal) {
767 #if DriverDebug || DriverDebugState
768 Console.WriteLine("SetModal({0}, {1}): Called", Window(handle), Modal);
770 driver.SetModal(handle, Modal);
773 internal static IntPtr SetParent(IntPtr handle, IntPtr hParent) {
775 Console.WriteLine("SetParent({0}, {1:X}): Called", Window(handle), Window(hParent));
777 return driver.SetParent(handle, hParent);
780 internal static void SetTimer (Timer timer)
783 Console.WriteLine("SetTimer({0}): Called", timer);
785 driver.SetTimer (timer);
788 internal static bool SetTopmost(IntPtr handle, IntPtr hWndOwner, bool Enabled) {
790 Console.WriteLine("SetTopMost({0}, {1}, {2}): Called", Window(handle), Window(hWndOwner), Enabled);
792 return driver.SetTopmost(handle, hWndOwner, Enabled);
795 internal static bool SetVisible(IntPtr handle, bool visible) {
796 #if DriverDebug || DriverDebugState
797 Console.WriteLine("SetVisible({0}, {1}): Called", Window(handle), visible);
799 return driver.SetVisible(handle, visible);
802 internal static void SetWindowMinMax(IntPtr handle, Rectangle maximized, Size min, Size max) {
803 #if DriverDebug || DriverDebugState
804 Console.WriteLine("SetWindowMinMax({0}, {1}, {2}, {3}): Called", Window(handle), maximized, min, max);
806 driver.SetWindowMinMax(handle, maximized, min, max);
809 internal static void SetWindowPos(IntPtr handle, int x, int y, int width, int height) {
811 Console.WriteLine("SetWindowPos({0}, {1}, {2}, {3}, {4}): Called", Window(handle), x, y, width, height);
813 driver.SetWindowPos(handle, x, y, width, height);
816 internal static void SetWindowState(IntPtr handle, FormWindowState state) {
817 #if DriverDebug || DriverDebugState
818 Console.WriteLine("SetWindowState({0} {1}): Called", Window(handle), state);
820 driver.SetWindowState(handle, state);
823 internal static void SetWindowStyle(IntPtr handle, CreateParams cp) {
825 Console.WriteLine("SetWindowStyle({0}): Called", Window(handle));
827 driver.SetWindowStyle(handle, cp);
830 internal static void SetWindowTransparency(IntPtr handle, double transparency, Color key)
833 Console.WriteLine("SetWindowTransparency({0}): Called", Window(handle));
835 driver.SetWindowTransparency(handle, transparency, key);
838 internal static bool SetZOrder(IntPtr handle, IntPtr AfterhWnd, bool Top, bool Bottom) {
840 Console.WriteLine("SetZOrder({0}, {1:X}, {2}, {3}): Called", Window(handle), Window(AfterhWnd), Top, Bottom);
842 return driver.SetZOrder(handle, AfterhWnd, Top, Bottom);
845 internal static void ShowCursor(bool show) {
847 Console.WriteLine("ShowCursor({0}): Called", show);
849 driver.ShowCursor(show);
852 internal static DragDropEffects StartDrag(IntPtr handle, object data, DragDropEffects allowedEffects) {
854 Console.WriteLine ("StartDrag({0}, {1}, {2}): Called", Window(handle), data, allowedEffects);
856 return driver.StartDrag (handle, data, allowedEffects);
859 internal static object StartLoop(Thread thread) {
861 Console.WriteLine("StartLoop({0:X}): Called", thread.GetHashCode());
863 return driver.StartLoop(thread);
866 internal static bool SupportsTransparency() {
868 Console.WriteLine("SupportsTransparency(): Called, result={1}", driver.SupportsTransparency());
870 return driver.SupportsTransparency();
873 internal static bool SystrayAdd(IntPtr handle, string tip, Icon icon, out ToolTip tt) {
875 Console.WriteLine("SystrayAdd({0}, {1}): Called", Window(handle), tip);
877 return driver.SystrayAdd(handle, tip, icon, out tt);
880 internal static void SystrayChange(IntPtr handle, string tip, Icon icon, ref ToolTip tt) {
882 Console.WriteLine("SystrayChange({0}, {1}): Called", Window(handle), tip);
884 driver.SystrayChange(handle, tip, icon, ref tt);
887 internal static void SystrayRemove(IntPtr handle, ref ToolTip tt) {
889 Console.WriteLine("SystrayRemove({0}): Called", Window(handle));
891 driver.SystrayRemove(handle, ref tt);
894 internal static bool Text(IntPtr handle, string text) {
896 Console.WriteLine("Text({0}, {1}): Called", Window(handle), text);
898 return driver.Text(handle, text);
901 internal static bool TranslateMessage(ref MSG msg) {
902 return driver.TranslateMessage(ref msg);
905 internal static void UngrabWindow(IntPtr handle) {
907 Console.WriteLine("UngrabWindow({0}): Called", Window(handle));
909 driver.UngrabWindow(handle);
912 internal static void UpdateWindow(IntPtr handle) {
914 Console.WriteLine("UpdateWindow({0}): Called", Window(handle));
916 driver.UpdateWindow(handle);
919 // Santa's little helper
920 internal static void Version() {
921 Console.WriteLine("Xplat version $Revision: $");
924 internal static void Where() {
927 #endregion // Public Static Methods
930 public delegate bool ClipboardToObject(int type, IntPtr data, out object obj);
931 public delegate bool ObjectToClipboard(ref int type, object obj, out byte[] data);
932 #endregion // Delegates