GTK+ IOStream
Beta
<< GTK+ >> add C++ IOStream operators to GTK+. Now with extra abilities ... like network serialisation
|
Copyright 2001 to 2013 Matt Flax flatm ax@f latma x.or g
This software is governed by the GPL license.
This software is for building GUIs, Object Request Broking (ORB) classes over networks and the interfaceing of C++ to Octave.org using Eigen3 matrices.
The GUI related classes are intended to be light weight GTK wrappers for use in C++.
The ORB (object request brokering) classes ORBOriginator and ORBReplicator utilise Zeroc Ice to implement the actual ORB application layer. When the term ORB is used, it implies the following :
Octave is interfaced using Eigen3 which is a hardware optimised matrix computation library.
As far as the GUI software is concerned, it is all contanined in the class header files, this means that you can simply include the headers and code away without having to worry about compiling any source code files other then your own.
The general paradigm is that you can very easily construct GTK object and in some cases use the C++ IOStream paradigm to build graphical user interfaces (GUIs).
For example, I will create labels in a Vertical box like so :
Similar things can be done with buttons (label buttons, toggle buttons, XPM and transparent XPM buttons are also supported)
This example runs gtk as normal and loads an HBox into the GTK top window. The HBox is loaded with a quit label button.
The Labels and Buttons are actually based on the LinkList datatype - which is a templated lightweight doubly linked list.
If you want to get compact, you can write like so :
If you want access to the GTK+ widgets, it is easy
Plotting is easy and is similar to Octave.org (Matlab) style plotting commands.
For example the following code :
Produces this :
Octave is simplistically instantiated and run like so :
A more detailed description can be found in the Octave class detailed description.
To utilise the Octave code, the Octave.C file must be linked with your code. The reason for separating the Octave source from the header is that octave uses libfftw.so, where as you may want to use libfftwf.so in your own code. By separating the Octave code out from the Octave header file, you are able to link against the Octave header and utilise octave without having to link against its shared libraries directly.
ORB is desigend to be trivial.
On the originating side of the network, the following is executed
On the replication side of the network, the following is executed
A more detailed example is in the ORBTest.C class. There is also other documentation in the ORBOriginator and ORBReplicator class documentation.
To utilise the ORB (ORBOriginator and ORBReplicator) code, you must specify your network protocol in a .ice file. This .ice file specifies in object oriented code what objects you will be sending over the network (simple types are int, float, vector<TYPE> and many others). The slice2cpp application is run at compile time to machine generate .C code from the .ice files. These then are linked into your application.