README 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. System.Windows.Forms README
  2. by John Sohn ([email protected]) and Miguel de Icaza ([email protected])
  3. The maintainers:
  4. Dennis Hayes ([email protected])
  5. Backup: Miguel de Icaza ([email protected])
  6. Mailing list:
  7. http://lists.ximian.com/mailman/listinfo/mono-winforms-list
  8. The address is:
  9. [email protected].
  10. * Introduction
  11. Welcome to the System.Windows.Forms implementation for Mono.
  12. This is still an early version of the class library. The
  13. plans for this library have changed, the plans to use multiple
  14. backends is no longer being pursued.
  15. We are now implementing this using the Wine library (because
  16. Windows.Forms applications require the message handling to be
  17. compatible with Windows, look up the Control.Wndproc method
  18. for details).
  19. Currently it is possible to use the Visual Studio solution in
  20. this directory to build the class libraries, and test the
  21. sample programs against our implementation.
  22. To run and execute with the Mono runtime on linux, the story
  23. is more complicated as we need to use the "WineLib" support in
  24. Wine.
  25. * The Layout
  26. The layout in this directory has some historical files that you can
  27. safely ignore, the following are just historical directories:
  28. Gtk/
  29. WINElib/
  30. All of the real code is being done in the same was as it is being done
  31. in the rest of the Mono assemblies.
  32. * Building System.Windows.Forms for Unix using Wine.
  33. Since a WineLib application is a Windows application that is compiled under
  34. Unix/Linux as a shared library it needs to be started differently than other
  35. applications. The WineLib application is started as any other Windows
  36. application running under Wine using the wine command. You cannot simply link
  37. in libwine (gcc myapp.c -lwine) to use Win32 functions.
  38. In order to use WineLib/Win32 functions under Mono I have created a small
  39. "stub" application that embeds the Mono engine inside the WineLib application.
  40. This is basically a replacement for the "mono" command that can be used
  41. to call the Win32 API (using WineLib) within an application written for Mono.
  42. To get started I suggest installing Wine and Mono first if they are not
  43. already installed. I am usually using the latest Wine snapshots built from
  44. source and installed under /usr/local. Also be sure to build/use a version of
  45. Mono with garbage collection disabled as there is a problem using WineLib with
  46. garbage collection enabled (check the mono-list archives for this discussion).
  47. You can disable garbage collection when building mono by adding --with-gc=none
  48. to the configure command. In the mono directory I build mono as:
  49. ./configure --with-gc=none
  50. In the WINELib makefile you may have set these to the appropriate files and/or
  51. paths on your PC:
  52. X11R6_INCLUDE=/usr/X11R6/include
  53. WINE_INCLUDE=/usr/local/include/wine
  54. WINE_LIB=/usr/local/lib/wine
  55. LIBMONO=/usr/local/lib/libmono.a
  56. If you type make from the mcs/class/System.Windows.Forms/WINELib
  57. directory it should build:
  58. System.Windows.Forms.dll -
  59. The current (if largely incomplete) Windows Forms package.
  60. FormTest.exe, NativeWindowTest.exe, Test.exe -
  61. Test applications which link to and tests the System.Windows.Forms.dll
  62. monostub.exe.so -
  63. The WineLib application that starts the Mono/WineLib application. This
  64. small WineLib application embeds the Mono JIT engine allowing any Mono
  65. application running in it access to WineLib/Win32 function calls.
  66. Before starting any of the applications set the LD_LIBRARY_PATH to the
  67. current directory (so DllImport can find the monostub.exe.so library):
  68. export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:.
  69. To start any of the applications you type (from the WINELib directory):
  70. wine monostub.exe.so mono-winelibapp.exe