disable broken tests on net_4_0
[mcs.git] / class / Managed.Windows.Forms / Design
blobc9fa450d553d2d0c85bf5a67f5e4d02bd0e470ed
1       Design of new implementation of SWF
2       ===================================
4 0. About SWF:
5 =============
7 SWF stands for System.Windows.Forms. This is a class library that
8 provides a set of controls for designing application UI.
11 1. Architecture:
12 ================
14 The new implementation of SWF is based on drivers providing access to
15 the native windowing system of the host OS. The old implementation was
16 based on Wine library. The motivation for new implementation comes from
17 the problems faced with the Wine approach:
18 - Wine was missing features that .NET provided over Win32; to add those
19   features we would have had to write the controls managed anyway
20 - Installation became much more difficult due to the Wine dependencies
21   and the relatively akward way we had to initialize Wine.
23 The new implementation takes advantage of Win32 APIs on Windows and
24 emulates the same on Linux using X11 for window management and events.
25 Following gives a high level idea of the new implementation of SWF.
27          -------------------------------------
28          |             Managed SWF           |
29          -------------------------------------
30          |      XplatUI Driver Interface     |
31          -------------------------------------
32          | X11 Driver|Win32 Driver|OSX Driver|
33          |           |            |          |
34          |  Mono on  |  Mono on   | Mono on  |
35          | Linux/Mac |  Windows   | Mac OS/X |
36          -------------------------------------
38 The above picture explains how the window management is done in the new
39 implementation. For drawing the controls System.Drawing library is used.
40 To handle some special needs for different platforms, there are a few 
41 limited patches to System.Drawing to deal with calls from System.Windows.Forms
44 2. Design:
45 ==========
47 The new design of SWF makes porting of the library to Linux/Windows/Mac
48 very easy.
49 All the controls in SWF inherit from Control class and most of the painting
50 operations are done using ControlPaint class. At the low level, XplatUI class
51 provides the abstraction over the underlying window management system. It
52 contains a XplatUIDriver for providing the window management. XplatUIDriver
53 is an abstract class which is implemented by XplatX11 and XplatWin32 classes
54 respectively for Linux/Mac and Windows platforms. Support for any new platform
55 can be added simply by implementing XplatUIDriver for the new platform.
58 2b. Themes:
59 ===========
61 The look of any control is supposed to be controlled by the chosen theme.
62 All control drawing needs to be done by the currently selected theme class.
63 The ThemeEngine class manages the themes. All the themes implement 
64 Theme abstract class. The Theme class provides the drawing primitives for 
65 all controls. The current implementation supports the Windows Classic theme 
66 through the ThemeWin32Classic class and the Gnome theme through the ThemeGtk
67 class. Gnome support is still very incomplete (even more incomplete than SWF
68 itself)
71 2c. Multi-threading:
72 ====================
74    As of this writing, multi-threading was fully supported, provided the 
75    standard Microsoft implementation guidelines involving Invoke() are
76    followed.
80 2d. Issues:
81 ===========
83    - To be added when MWF reaches completion