winforms 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. * System.Windows.Forms
  2. Currently Windows.Forms support is not finished.
  3. The System.Windows.Forms effort is taking two paths:
  4. <ul>
  5. <li>Win32/Wine-based: This effort will use the Win32
  6. API, and use a stub program to run the with Wine.
  7. This allows applications that use P/Invoke to
  8. function, and event delivery through the Wndproc
  9. method to work for the most advanced and custom
  10. applications. This is the path of best compatibility.
  11. Also, work on a Gtk-based rendered for Wine will be
  12. done, to make the user interface integrate with your
  13. desktop look.
  14. <li>Gtk# based: This effort will build a subset of
  15. Windows.Forms that uses Gtk#. This gives a better
  16. integration with the desktop, but will not be
  17. completely compatible with the Windows edition. In
  18. particular code that uses P/Invoke to call into Win32
  19. or overwrite the Wndproc method to achieve special
  20. effects will not work.
  21. </ul>
  22. * Win32/Wine edition.
  23. Currently (May 21st, 2003) to get the Windows.Forms support
  24. working, you need a Mono installation from CVS, and you need
  25. to install Wine plus the <a
  26. href="http://www.openlinksw.com">OpenLink patch</a>, and
  27. define the environment variable "SWF" (export SWF=1 from your
  28. shell).
  29. <table>
  30. <tr>
  31. <td>
  32. System.Windows.Forms is currently being implemented using the
  33. Win32 API, we will be using <a
  34. href="http://www.winehq.com">WineLib</a> on Unix systems to
  35. emulate the Win32 API.
  36. This means that those who want to contribute to the effort can
  37. develop and test classes today using Windows and P/Invoke
  38. calls to Win32 and we will then just run the result on Unix.
  39. In terms of integrating visually with the desktop, we are
  40. hoping to contribute to the Wine project an mechanism to make
  41. it use the Gtk+ themes on X11 and Cocoa on MacOS to render the
  42. widgets, and get the native look and feel on each of these
  43. platforms.
  44. </td>
  45. <td>
  46. <a href="images/WINESWF.JPG"><img src="images/WINESWF-mini.JPG"></a>
  47. </td>
  48. </table>
  49. * Gtk# based
  50. The code is contained in CVS.
  51. There are no current plans to support embedded devices, but
  52. Gtk/FrameBuffer is an option. If you have suggestions or
  53. recommendations, please let us <a
  54. href="mailto:[email protected]">let us know</a>
  55. * Contributing
  56. The Winforms effort is being coordinated in the <a
  57. href="mailto:[email protected]:.com">[email protected]</a>.
  58. If you are interested in helping out with this effort,
  59. subscribe to it by sending an email message to <a
  60. href="mailto:[email protected]:.com">[email protected]</a>.
  61. If you want to help, you can start by writing a control and
  62. testing it with Windows today (or you can also try to build
  63. the existing library on Linux, but this is a bit more
  64. complicated).
  65. See the file mcs/class/System.Windows.Forms/CheckOutList for
  66. details on who is working on which class.
  67. Please read the README document in the
  68. System.Windows.Forms/WINElib directory for details about how
  69. to build the Windows.Forms support for Mono.
  70. * System.Drawing
  71. Using existing libraries to implement some of the
  72. functionality required:
  73. <ul>
  74. * gdk-pixbuf is a generic image loader that loads an image
  75. and leaves it into an RGB buffer. It hides all the details
  76. about what image file format is being loaded.
  77. * Libart is a general framework for rendering RGB/RGBA
  78. buffers into RGB buffers and rendering postscript-like paths into
  79. RGB/RGBA buffers.
  80. </ul>
  81. We want to use gdk-pixbuf as the image loader for the image
  82. classes, and then we need operations to render that into the
  83. windowing system (Gtk+, MacOS, etc). But notice how there is
  84. very little dependnecies in Gdk-pixbuf on gtk, and libart has
  85. none.
  86. They are pretty independent from a windowing system
  87. (gdk-pixbuf comes with some "helper" routines for rendering
  88. data into a pixmap and to load pixmaps into RGB buffers).
  89. A few things to keep in mind:
  90. <ul>
  91. * gdk-pixbuf can be used to load images for Gtk+,
  92. MacOS X and Windows, it should be pretty portable,
  93. although we might need in the future to back-port
  94. some new features from Gtk head.
  95. * Libart is probably only going to be used with X11,
  96. as the MacOS X provides the same features in Quartz,
  97. and Win32 *probably* has that in GDI+. If not, we
  98. should use libart in Win32 as well (or for older
  99. Windows systems).
  100. </ul>
  101. * Directory Layout
  102. <pre>
  103. System.Drawing (assembly directory)
  104. System.Drawing.Blah
  105. Common code for "Blah"
  106. Stubs for "Blah" to ease ports.
  107. Gtk
  108. System.Drawing.Blah.
  109. Gtk ports of "System.Drawing.Blah"
  110. MacOS
  111. System.Drawing.Blah
  112. MacOS ports of "System.Drawing.Blah"
  113. WineLIB
  114. System.Drawing.Blah
  115. Win32 ports of "System.Drawing.Blah"
  116. </pre>
  117. Notice that there is a proof of concept Gtk-backend for
  118. Windows.Forms, but nobody is working on it, and for the
  119. reasons stated before it is not a long term strategy.
  120. * Open questions:
  121. I believe that the graphics contexts that are used to render
  122. can accept either libart-like rendering operations and
  123. X11-like rendering operations. This complicates matters, but
  124. I am not sure. Someone needs to investigate this.
  125. * Historical
  126. Although the original plans were to use Gtk on X and Cocoa on
  127. MacOS X, it would be very hard to emulate the event model in
  128. which some Winforms applications depend, and it would be very
  129. hard to implement the Wndproc method.