Since my last blog post about MonoDevelop on Windows, things have improved a lot. I focused my work in making MD good enough to be used for everyday MD hacking. We are still not there, but close. Here are some improvements done in the past week:
  • Fixed the GTK# designer add-in. It is now fully working.
  • Implemented a new backend for the Subversion add-in. I tried using the add-in we have for Linux, but the libraries I could find for Win32 have some differences in the API and the bindings doesn't work. I finally decided to refactor a bit the SVN add-in to support different backends, and implemented a new one based on SharpSvn. So the SVN add-in is also fully working.
  • Added support for debugging, based on the debugger that comes with .NET. This is still work in progress, although most of features already work: stepping, breakpoints, inspecting variables with drill down and evaluation of expressions.
  • Support for .NET 4.0. This new version can now be selected in the project properties.
  • Improved the look of the main window. Reduced some spacing, improved the rendering of the tabs when docking several pads together, and other cosmetic fixes.
  • Improved the performance of the text editor. It now feels more responsive.
  • ... and many other fixes.
There are still some stability issues, and are several add-ins are still untested, but MD is starting to look great on Windows. GTK+ with the Vista theme looks really nice. Here are some screenshots of the GTK# designer and the debugger:





Now, here is what you've been waiting for: a MonoDevelop installer for Windows. You can get it from the Windows Preview page in the MD site. Read carefully the instructions in that page. You'll have to install the latest GTK# package, also linked in that page. Also, beware that this is a preview built from trunk, so you can expect to find stability issues. In any case, bug reports are always welcome. Enjoy!
30

View comments

  1. I started the XWT project almost one year ago and athough I talked about it at FOSDEM, I never found the time to formally present it. Those are busy days at Xamarin! Anyway, let’s go ahead.

    XWT is an open-source cross-platform UI toolkit for Mono and .NET. What’s special about XWT is that it is built on top of the native widget toolkit of each supported platform. So rather than a new widget toolkit implemented from scratch it is an abstraction that wraps the native toolkits using a common API. The end goal of XWT is to allow building applications which look and feel native in each platform. Here are some screenshots of a sample application running with the GTK and Cocoa backends:

    GTK backend
    Cocoa backend


    I initially created XWT with the idea of building MonoDevelop on top of it. Around this time last year we had a discussion about how we could improve the look & feel of MonoDevelop in Mac and Windows. MonoDevelop is built with GTK# 2, which worked very well on Linux, but which had (and still has) some issues on other platforms. Although GTK is a cross platform toolkit, not all backends have the same quality, and not all features are completely implemented. So XWT would allow us to have a native look and still reuse most of the code. However, rebuilding MonoDevelop with XWT is a lot of work and we needed to fix the Mac and Windows issues as soon as possible, so we decided to invest our efforts in fixing the most annoying GTK bugs instead of going the XWT route.

    Even though we are not going to immediately migrate all of MonoDevelop to XWT, at Xamarin we have started using it for some UI code that needs run in MonoDevelop and Visual Studio. An example of this is the Android designer. The designer is implemented in XWT, and we use the GTK backend when running MonoDevelop and a WPF backend when running on Visual Studio:
    The designer running on GTK in MonoDevelop

    The designer running on WPF in Visual Studio

    XWT vs Native Toolkits

    At Xamarin we have always advocated for using the native toolkit of each platform in order to take advantage of all features offered by the platform and be able to build the most visually rich and performant applications. How does XWT fit on this idea?

    XWT has three important design features:
    • User interfaces implemented using XWT can be embedded inside a native UI. It means you can build your application using the native toolkit when you need advanced platform features, and you can use XWT for more simple UI that can be shared.
    • XWT backends are built on top of native toolkits, so XWT widgets really look and behave like native widgets.
    • XWT is a UI toolkit abstraction, so it’s about abstracting common UI idioms as widgets. XWT will have support for the most common widgets such as entries or buttons, but it will also provide higher level widgets which are more “semantic”. It means that XWT applications will be constrained to use those higher level UI idioms, but each of those idioms can have a platform-specific implementation which takes full advantage of the native toolkit features, and which can abide for the platform UI guidelines. 
    There is a tradeoff between portability and functionality. XWT is not for everybody. It wont have the richness and the low level features of a native toolkit, so it will not be suitable for applications which require advanced UI features.

    Design Principles

    XWT looks like GTK#. It uses a similar layout model and class names. That’s basically to make it easier to migrate GTK# code to XWT, not because GTK# is superior to everything else (although maybe it is). However, there are notable differences. The API design has an important focus on simplicity and usability. Here are some important differences with respect to GTK:
    • The widget hierarchy is mostly flat. There is a Widget class and most of other classes directly subclass it. There are no unnecessary infrastructure classes. For example, there is no Container class, any widget can have children if they need to.
    • Widgets are visible by default (I still haven’t figured out the reason why they are hidden by default in GTK).
    • No concept of GdkWindow. You have a widget, that’s all.
    I’m a firm believer of usability-oriented API design. Many libraries are designed using complex class hierarchies and abstractions whose purpose is to make the library code easier to reuse and maintain. That is, the code is designed to facilitate the work of the library developer, not the work of the library consumer. That’s a bad approach since the library will be implemented by only few developers, but potentially consumed by thousands of developers.

    Features

    Here are some details about what’s currently supported by XWT:
    • XWT currently supports 3 backends with different level of development: GTK, Cocoa (Mac) and WPF (Windows).
    • XWT can instantiate more than one backend at a time, and run those side by side (with some limitations). For example, you can have XWT use Gtk and Cocoa in the same application, depending on what is hosting your code.
    • The basic widget library is mostly complete.
    • It has a drawing API, very similar to Cairo.
    • There is no visual designer yet, nor any markup language for representing windows. My plan is to use XAML or a simplified version of it.
    • XWT can be extended in different ways.
    • Applications can create subclasses of XWT widgets, or create new widgets.
    • New backends can be plugged into XWT
    • Existing backends can be extended
    • The API is not yet stable and can change at any time.

    Future

    The work on XWT will continue, there is still a lot to do. XWT is already already included in the MonoDevelop core. Although we don’t plan to do a big migration effort, we plan to gradually use XWT in the implementation of new features.

    If you are interested in XWT, you can get the source code from here:
    https://github.com/mono/xwt

    There is also a mailing list:
    http://groups.google.com/group/xwt-list

    And an IRC channel:
    irc://irc.gimp.org/xwt

    Contributions are welcome!

    4

    View comments

  2. MonoDevelop 2.6 beta 1 was released yesterday. Like every major release, it has many new features. Here is a summary of what have we done.

    The first new big feature is support for GIT. This was long time due, especially since Mono and MonoDevelop itself moved to GIT. I already blogged about it a few months ago, but basically we are using NGit, a C# port of JGit, as the core for the GIT add-in. It hasn't been easy to make this port fully operational, but we now have a GIT core that can be easily updated and which is fully portable.

    We have also spent some time improving all the version control views. I like especially the new changes view integrated in the source editor, and the log view (which btw can show gravatar icons of committers). We plan to keep improving those views to make them even more functional.


    Another big change in this release is the new MCS based parser and formatting engine. Mike Krueger (in charge of the C# support) and Marek Safar (maintainer of the MCS compiler) have been collaborating to make the MCS parser usable in MonoDevelop. By using MCS, we'll be able to quickly have support for the latest C# features, and we'll be able to report syntactic errors on-the-fly that exactly match those reported by the compiler. Also thanks to MCS, the C# formatter is more reliable and will allow to properly implement on-the-fly formatting on all contexts.

    We also added in this release support for user defined policies. The concept of "Policies" was introduced in MonoDevelop 2.4. Policies are settings which can be applied per-solution and per-project. Policies include settings like code formatting rules, standard header for files or naming policies. Until now, we supported setting the default values for those policies, which would be used when creating new projects. Beside this, we now also support creating named sets of policies. So for example, an user could define a "Company" policy set with formatting rules and file headers specific for company projects. It could also define a "Open Source" policy set with different rules. When creating a project, the user can then chose which policies to use.


    Another feature we added is support for IL disassembly in the debugger. This will be very useful for developers that need to debug dynamically generated methods and assemblies.


    Finally, we also have a brand new add-in manager, which is more functional and looks much better. MonoDevelop is now subscribed to the public repository available in addins.monodevelop.com, which is open to everybody for publishing add-ins and making them available to all MonoDevelop users.


    Update: forgot to mention one important improvement that has been requested by Mac users for long time: support for native OSX dialogs. Message and file dialogs on Mac now use the native UI toolkit.

    There are many other improvements and new features in this release. Take a look at What's new in MonoDevelop 2.6 if you want to know more.



    6

    View comments

  3. MonoDevelop often makes use of threads to run operations on the background. Although we make sure to invoke all GUI update methods through the main GUI thread, sometimes there is a bug and an update is done in the secondary thread, which causes all sort of random locks and crashes.

    To make it easier to track down those bugs, I created a simple profiler module for Mono which can detect invocations to GTK# methods from a thread other than the main GUI thread. This module is available here:

    https://github.com/slluis/gui-thread-check

    To use it, build and install the module, and then run your application with
    the command:

    mono --profile=gui-thread-check yourapp.exe

    If the profiler is properly installed, you'll see an output like this:

    *** Running with gui-thread-check ***
    *** GUI THREAD INITIALIZED: 2861676352

    While the application is running, if the profiler detects a non-gui thread
    invoking gtk methods, it will print a warning message together with a
    stack trace. For example:

    *** GTK CALL NOT IN GUI THREAD: Widget.gtk_widget_get_parent
    Widget.get_Parent
    SourceEditorWidget.get_TextEditor
    SourceEditorWidget.get_Document
    SourceEditorWidget.HandleParseInformationUpdaterWorkerThreadDoWork
    BackgroundWorker.OnDoWork
    BackgroundWorker.ProcessWorker
    2

    View comments

  4. I'm flying to Brussels in a few minutes, heading to Fosdem. I'm not giving a talk this year, but if you are interested in knowing more about Mono and MonoDevelop don't miss the Mono track on Saturday afternoon. Many nice talks, and a good chance to meet Mono developers and contributors.

    I'm going to FOSDEM, the Free and Open Source Software Developers' European Meeting
    1

    View comments

  5. One of the features we want to include in the next MonoDevelop release is integrated support of Git. I committed a first version of a git add-in some months ago which works by invoking the git command and parsing the results. This solution satisfied some basic needs (Mono was moving to git at that time), but it was done as a short term solution, since parsing git output is not very reliable, and has portability issues.

    The next obvious step was to use GitSharp, a fully managed .NET library which implements most of git commands. This library is basically a port of JGit, a Java library for doing the same. I started replacing the git invocations by calls to GitSharp classes, and I could implement the basic functionality, but I found some limitations that were not easy to overcome. On one hand, GitSharp was a bit outdated, lacking some of the recent features and bug fixes done in JGit. Bringing GitSharp up to date with JGit would be a lot of work, since every JGit commit had to be manually translated from Java to C#. On the other hand, GitSharp depends on a set of cryptographic libraries (required for the ssh protocol support) which we can't easily include in MonoDevelop due to export regulations.

    I then decided to try a different approach: the idea was to use Sharpen, a free Java to C# translator implemented by db4o, to automatically convert the JGit code to C#.

    After some weeks of work, I have been able to generate a C# library (which I call NGit) with all the JGit code. Most of the work went into tunning and fixing Sharpen, and into implementing in C# some core Java classes which didn't have direct replacement in Mono. This was more complex and took more time than I expected, but I think the effort is worth it. The generation of the library is automatic, although not perfect since it requires some patches in the java code and some patches in the generated code, but the patches are small and easy to maintain. Keeping NGit in sync with JGit is very easy, since it is just a matter of pulling the java code and running the conversion (I already have the conversion process automated in a makefile).

    I've also been able to convert and run the JGit unit tests, and got 90% of tests working. The failures of the remaining 10% are in general due to different behavior of Java vs C#, or JUnit vs NUnit, and are not real NGit bugs (although I still have to review some of them).

    In the process, I also converted Jsch, which is the library used by JGit for the ssh communication. The new NSch library only has Mono.Security as external dependency, so it will be much easier to distribute for us.

    So, we now have a fully managed git library with ssh support without any dependency external to Mono. The library has around 56000 lines of generated C# code (including the unit tests). I recently published the source code in github.

    I'm now implementing the git add-in using NGit. Most of the commands are already implemented, although I'll have to do some testing before I push it to master. There are still some performance issues I'm tracking down, but things are looking good. I intend to submit my fixes to JGit. My fist patch has already been accepted and pushed, and conveniently ported to NGit.

    Update: I'd like to clarify the relation of NGit with GitSharp. GitSharp is composed by two libraries: GitSharp.Core.dll and GitSharp.dll. GitSharp.Core.dll is a manual port of JGit. GitSharp.dll is a more high level and .NET friendly API that wraps GitSharp.Core.dll. NGit can be a replacement for GitSharp.Core.dll, but GitSharp.dll is still useful, since NGit may be a bit too low level and java-ish for some use cases.
    26

    View comments

  6. I just published the source code of Cydin in github. Cydin is an add-in repository for applications based on Mono.Addins. The latest version is currently running the MonoDevelop add-in repo. I have many ideas to keep improving Cydin. Here are a few:
    • Add support for multiple applications. That's almost done, but there are still some issues to be fixed. The idea is that a single Cydin installation could be used as add-in repository for many applications (for example, MonoDevelop, F-Spot, Tomboy, etc). The add-in repo for each application would be independent, but they would share some services, such as user authentication and the build service. It would be nice to have in the future a single web server which can be used by all Mono.Addins based applications to host add-ins.
    • Add support for multiple add-ins per project. Right now, a project can only generate one add-in. In some cases it may be useful to be able to generate several related add-ins without having to create a project for each of them.
    • Add a search and browse views, so users can look for add-ins.
    • Add support for 1-click install. This would allow users to install add-ins by clicking on them in the web site, instead of having to do it through the add-in manager in the application. That's partially implemented, but requires changes in the application (that is, MonoDevelop).
    So, quite a lot of work to do. I'm open to contributions :)

    2

    View comments

  7. Yesterday I published a beta version of what is going to be a Community add-in repository for MonoDevelop. This web site is based on the Cydin project, developed during the last hack-week at Novell.

    The functionality it has is basically what explained in my last blog post:
    • The add-in developer creates a new project in the web site by specifying a name, description and version control urls to the source code. It currently supports Subversion, Git and Bazaar.
    • A build service pulls the code from the version control repositories and builds it.
    • The built add-ins are published in an standard Mono.Addins add-in repository in the web site.
    • Users can subscribe that repository and install the add-ins.
    This site is still under development and needs testing, so I'd like people to start publishing add-ins to see how it works. I intend to publish the source code of Cydin so that other Mono.Addins based application can create their own add-in repositories. However, before doing it I want to polish a bit the code and add some documentation (and that requires time).

    The long term goal is to have a kind of add-in marketplace site, where developers can publish add-ins and users can browse, download, rate and comment them.

    For now, I'm happy with having a place where contributors can make add-ins easily available to all users. So if you have developed an add-in for MonoDevelop, please register it!

    0

    Add a comment

  8. Last week was a Hack Week at Novell, so I spent some time working on a new idea I've been cooking in the past weeks: a Community Add-in Repository for MonoDevelop, which I'm calling Cydin.

    The idea is to have a web site where add-in developers can publish their MonoDevelop add-ins and make them available to all users. The site works like a build bot: it pulls the source code of add-ins from version control repositories, builds and packages them, and then publishes them in an add-in repository, to which MonoDevelop will be subscribed.

    In one week I've been able to implement the basic functionality, although it still needs some polish before I can make it publicly available. I implemented the site using ASP.NET MVC. I didn't know much about MVC in ASP.NET, so it has been also great to learn something new.

    Beware: I put zero effort to the visual design.

    So, how does it work? This is the home page:


    The first thing you have to do is to log in. Authentication will be based on OpenID, but this is not yet fully functional (I'm using the DotNetOpenAuth library but I'm having trouble making it work on Linux).

    The home page is very simple. It shows a list of the projects owned by the user and a list of recent releases. I planed to include add-in browse and search options, but I had no time for this.

    The Create Project link allows creating a new add-in project:


    This page allows entering the add-in name, the identifier and a description. When clicking on Create, the source definition page is shown:


    This page allows specifying the location of the source code of the add-in. Right now it only supports Subversion, but I plan to add support for GIT soon.

    When specifying the URL of the subversion repo, there is a twist: if the URL ends with "/*" the build service will pull all directories bellow that URL, and each directory will be considered a
    different release. So for example, if you specify:
    https://test.googlecode.com/svn/trunk/tags/test-project/*
    then all tags of test-project will be pulled as independent releases.

    If the auto-publish checkbox is set, the build service will automatically publish new versions of the add-in at every commit.

    After saving the changes, the project home page is shown:


    The page will be empty because pulling and building the source code may take some time.

    Source code is pulled and built by a Build Service. The build service is independent from the web site and can run in a different host. Communication between the two is done through a web service.

    So after a bit we'll see:


    This shows that the build service found six directories below the specified svn url, and pulled all of them. Then it started building.

    Notice that the build service extracts some information from the add-ins: the add-in version, the MonoDevelop version that the add-in is targeting, and the target platforms.

    Sources with the 'Ready' status are already built and packaged, but not yet available in the add-in repository. To make them available, you have to click on the 'Publish' link. This is not necessary if the auto-publish option is set for this SVN source (in this case the release would be automatically published after building).

    This is how the page looks like after publishing some releases:


    The site administrator has some control over which releases are published. By default, new projects releases have to be validated by an administrator.

    Published add-ins can be installed using the MonoDevelop add-in manager:


    There is still some work to do, but I hope I can publish the site as a beta soon so you can start experimenting with it.
    5

    View comments

  9. In the past weeks (actually, months) I've been doing some changes in the MonoDevelop GUI to make it more functional and better looking. Here is the result:

    Before


    After


    Changes in the Status Bar

    Everything started with the idea of removing the status bar, in order to save space in the main window. The plan was to use something similar to Chrome's status popups, which are visible only when there is actual information to show to the user. However, after playing with the idea and thinking about how would it fit in MonoDevelop, I decided to try something else. Instead of removing the status bar, we would make a better use of the space it takes. So in the new GUI I merged the status bar and the bottom dock bar. The dock bar is the area where the title of pads in auto-hide mode are shown (for example, the Test Results pad in the above screenshots). When you hover over the title, the pad is shown in a popup window, with a nice sliding effect. The bottom dock bar is now shown next to the status bar, growing as more space is required.


    I also added support for custom pad labels. So for example, the Errors List pad now shows the error and warning count, instead of just the "Errors List" label. In this way pads can show some status information while they are minimized.

    Less intrusive output pads

    Temporary output pads such as logs for Version Control or Find in Files operations are now shown in autohide mode by default. Until now, those pads were shown docked at the bottom, taking space from the text editor. I also removed the standalone Build Output pad. The build output is now available in the Errors List pad, by clicking on the Build Oputput button:


    Visual improvements

    A noticeable visual change is that the main window new has a darker background, with some subtle shading effects. The pads look more "physical" and better delimited. The pad toolbars are now integrated in the docking system, improving the overall visual consistency.


    Configurable GUI compactness

    One thing I learned while working in MonoDevelop is that it is hard to find the right balance in the use of padding between the gui components (specifically, between the components shown in the main window). Using more padding makes the GUI more visually pleasant, and the components are better delimited. On the other hand, padding may be a waste of space when working on small resolutions.

    I added a configuration option for selecting the level of compactness of the GUI. There are five levels, from Very Compact to Very Spacious. So for example, the screenshots shown above are using the 'Spacious' level. In that level, there is some padding always visible between the pads, the window borders and the main menu. There is no such padding in 'Normal' mode.


    Zoomable tree views

    MonoDevelop has an option which allows choosing the font to use for the tree view pads such as the Solution pad or the Class pad. Those trees may be large for big projects, so users find it convenient to use a small font, which allows seeing more information at once.

    To make font reduction easier and more handy, I added a Zoom capability to the tree pads. So to zoom, all you have to do is hold the Control key and move the mouse wheel up and down (the standard zoom shortcuts can also be used for this, including Control+0 to reset the zoom). This screenshot shows the solution and class pads with different levels of zoom:


    Conclusion

    The changes I described are part of an ongoing effort to make MonoDevelop easier to use. There is more to come. It would be great to have feedback on the changes we are doing, so that we can further fine tune the interface for the 2.4 release.
    24

    View comments

  10. Miguel recently blogged about a trick for loading an executable assembly as a project inside MonoDevelop. I have now added native support for this feature, which means that it is now possible to directly open a .exe or .dll as a project, or add it to an existing solution. Also, MonoDevelop will get the list of source code files from the debug info of the assembly (when available). For example, this is what you get when you open gmcs.exe:



    The code just landed in SVN.
    1

    View comments

Blog Archive
About Me
About Me
My complete name is Lluis Sanchez Gual, and I work as a developer for Novell. I'm part of the Mono team, and I'm leading the MonoDevelop project, a very exciting open source IDE for GNOME.
Loading