XplatUIDriver.cs 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  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 Novell, Inc.
  21. //
  22. // Authors:
  23. // Peter Bartok [email protected]
  24. //
  25. //
  26. // $Revision: 1.1 $
  27. // $Modtime: $
  28. // $Log: XplatUIDriver.cs,v $
  29. // Revision 1.1 2004/07/09 05:21:25 pbartok
  30. // - Initial check-in
  31. //
  32. //
  33. // COMPLETE
  34. using System.Drawing;
  35. namespace System.Windows.Forms {
  36. public abstract class XplatUIDriver {
  37. internal abstract IntPtr InitializeDriver();
  38. internal abstract void ShutdownDriver(IntPtr token);
  39. internal delegate IntPtr WndProc(IntPtr hwnd, Msg msg, IntPtr wParam, IntPtr lParam);
  40. #region XplatUI Driver Properties
  41. internal virtual Color ForeColor {
  42. get {
  43. return Color.Empty;
  44. }
  45. }
  46. internal virtual Color BackColor {
  47. get {
  48. return Color.Empty;
  49. }
  50. }
  51. internal virtual Font Font {
  52. get {
  53. return new Font("Arual", 12);
  54. }
  55. }
  56. internal virtual Keys ModifierKeys {
  57. get {
  58. return Keys.None;
  59. }
  60. }
  61. internal virtual MouseButtons MouseButtons {
  62. get {
  63. return MouseButtons.None;
  64. }
  65. }
  66. internal virtual Point MousePosition {
  67. get {
  68. return Point.Empty;
  69. }
  70. }
  71. internal virtual bool DropTarget {
  72. get {
  73. return false;
  74. }
  75. set {
  76. }
  77. }
  78. #endregion // XplatUI Driver Properties
  79. #region XplatUI Driver Methods
  80. internal abstract void Exit();
  81. internal abstract IntPtr CreateWindow(CreateParams cp);
  82. internal abstract IntPtr CreateWindow(IntPtr Parent, int X, int Y, int Width, int Height);
  83. internal abstract void DestroyWindow(IntPtr handle);
  84. internal abstract bool Text(IntPtr handle, string text);
  85. internal abstract bool SetVisible(IntPtr handle, bool visible);
  86. internal abstract bool IsVisible(IntPtr handle);
  87. internal abstract IntPtr SetParent(IntPtr handle, IntPtr parent);
  88. internal abstract IntPtr GetParent(IntPtr handle);
  89. internal abstract void RefreshWindow(IntPtr handle);
  90. internal abstract PaintEventArgs PaintEventStart(IntPtr handle);
  91. internal abstract void PaintEventEnd(IntPtr handle);
  92. internal abstract void SetWindowPos(IntPtr handle, Rectangle rc);
  93. internal abstract void SetWindowPos(IntPtr handle, int x, int y, int width, int height);
  94. internal abstract void Activate(IntPtr handle);
  95. internal abstract void Invalidate(IntPtr handle, Rectangle rc);
  96. internal abstract IntPtr DefWndProc(ref Message msg);
  97. internal abstract void HandleException(Exception e);
  98. internal abstract void DoEvents();
  99. internal abstract bool PeekMessage(ref MSG msg, IntPtr hWnd, int wFilterMin, int wFilterMax, uint flags);
  100. internal abstract bool GetMessage(ref MSG msg, IntPtr hWnd, int wFilterMin, int wFilterMax);
  101. internal abstract bool TranslateMessage(ref MSG msg);
  102. internal abstract bool MoveWindow(IntPtr hWnd, int x, int y, int width, int height);
  103. internal abstract bool DispatchMessage(ref MSG msg);
  104. internal abstract void Run();
  105. #endregion // XplatUI Driver Methods
  106. }
  107. }