One of the major benefits of OpenVista CIS is that it empowers users to choose the platform to run on. At the core, we use Microsoft .NET on Windows platforms and Mono on others. The user interface is developed using GTK+, which is portable across Windows, Linux (and other Unix variants such as OpenSolaris and FreeBSD), and MacOS X. This is one of the major reasons that it was chosen as the development platform for Medsphere OpenVista client applications. I'll try to give a brief introduction to the platform stack here, as many new CIS developers may be coming from a different development background.
GTK+ is written entirely in C, and has binding layers to other languages such as C++, Ruby, and Perl. Medsphere uses the Gtk# binding to develop OpenVista CIS using GTK in C#. The Gtk# binding layer gives us the cross-platform user interface toolkit but with the power and ease of C#; it connects the Mono/.NET garbage collector with GTK's reference counting system for memory management, maps GLib containers that are used by GTK+ to System.Collections (the container class library used by .NET and Mono), maps between the events and delegates in Mono/.NET and the signal slots and C function callbacks used in unmanaged land, and generally allows us to almost[1] seamlessly work with the GObject memory space as though it were part of the .NET object system.
The GTK+ stack is split into various components:
- GLib provides general utility functions and cross-platform suppport. It provides the mainloop that GTK+'s event processing is built on top of, and it provides GObject. GObject is the basis for the object system on which GTK+ is written. Yes, GTK+ is written in C and is also object-oriented.
- ATK is the accessibility toolkit. Essentially, this provides the groundwork for alternate input and interface methods, which allowed the application to be more easily accessible for impaired users (such as vision-impaired users, for example). It is also the basis for how Medsphere's automated testing framework, Strongwind, is able to automate actions on the user interface.
- Pango is the font and text rendering library. It supports a lot of fairly advanced things that you may never need, but they're available. For example, Pango supports bidirectional text layout for languages such as Hebrew and Arabic.
- Cairo is the vector graphic renderer that GTK uses for a lot of its graphics. We also use this directly for things such as the Graph widget. It allows us to render really beautiful scalable vector graphics with high-quality antialiasing.
- Gdk is the low-level windowing side of GTK+, and is the place that abstracts between the different windowing systems of Win32, MacOSX, and the X-Window System that is used by Linux. This deals with the basic input and output of the whole user interface.
- Gtk is the main widget library that handles such things as buttons, labels, and treeviews. Note that Gtk typically does not use platform native controls (the one exception is the print dialog on Win32). It implements all the controls using its own widget system and then optionally uses a theme engine to make them look like native controls. This has a distinct advantage for us over using native controls in that we get the same behavior across different platforms, and we get a consistent API to develop with across them all.
- The theme engine is what styles the widgets to look the way they do. For example, on Win32 platforms the theme engine uses the native parts and states Win32 APIs to draw the GTK widgets to look like native Windows controls.
Medsphere adds a few more open-source components to the CIS stack, on top of GTK+ itself:
- libglade allows us to design dialogs that are saved in XML files and loaded at runtime.
- poppler# is a C# binding for the poppler PDF renderer
- Mono.Addins is used for loading plugins at runtime
[1]. Note that the one thing we can't yet treat seamlessly between the GObject system and the .NET object model are interfaces. Like .NET, GObject supports single inheritance and interfaces, but the glue between them is not yet in a place where we can use it.