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