Integration: complete GTK-GUI loaded from main Lumiera App. !Yay!

This commit is contained in:
Fischlurch 2009-01-03 16:57:51 +01:00
parent edb01ec8c6
commit e8229623bc
3 changed files with 47 additions and 25 deletions

View file

@ -46,20 +46,14 @@ using namespace gui::model;
GtkLumiera the_application;
int
main (int argc, char *argv[])
{
return the_application.main(argc, argv);
}
namespace gui {
int
void
GtkLumiera::main(int argc, char *argv[])
{
NOBUG_INIT;
Main kit(argc, argv);
@ -92,3 +86,14 @@ application()
} // namespace gui
/**
* Run the Lumiera GTK GUI as standalone application without backend.
*/
int
main (int argc, char *argv[])
{
NOBUG_INIT;
gui::application().main(argc, argv);
return 0;
}

View file

@ -98,7 +98,7 @@ static const gchar* AppAuthors[] = {
class GtkLumiera : private boost::noncopyable
{
public:
int main(int argc, char *argv[]);
void main(int argc, char *argv[]);
static Glib::ustring get_home_data_path();

View file

@ -31,18 +31,24 @@
**
** After successfully loading this module, a call to #kickOff is expected to be
** issued, passing a termination signal (callback) to be executed when the GUI
** terminates. This call returns immediately, after spawning off the main thread
** and setting up the termination callback accordingly. Additionally, it cares
** for opening the primary "business" interface of the GUI, i.e. the interface
** gui::GuiNotification.
** terminates. This call remains blocked within the main GTK event loop; thus
** typically this should already run within a separate dedicated GUI thread.
** Especially, the gui::GuiRunner will ensure this to happen.
**
** Prior to entering the GTK event loop, all primary "business" interface of the GUI
** will be opened (currently as of 1/09 this is the interface gui::GuiNotification.)
** @todo implement this!
**
** @see lumiera::AppState
** @see gui::GuiFacade
** @see guifacade.cpp
** @see ///////////////////////////////////TODO: add link to the gui main routine here!
** @see gui::GtkLumiera#main the GTK GUI main
*/
#include "gui/gtk-lumiera.hpp"
#include "include/nobugcfg.h"
#include "lib/error.hpp"
#include "gui/guifacade.hpp"
#include "common/subsys.hpp"
#include "lib/singleton.hpp"
@ -52,12 +58,7 @@ extern "C" {
#include "common/interfacedescriptor.h"
}
#include <string>
using std::string;
#include <iostream> /////////////TODO
using std::cout; //////////////TODO
using lumiera::Subsys;
@ -75,14 +76,30 @@ namespace gui {
: public GuiFacade
{
void kickOff (Subsys::SigTerm& terminationHandle)
void kickOff (Subsys::SigTerm& reportTermination)
{
cout << " *** Ha Ha Ha\n"
<< " this is the GuiStarterPlugin speaking!\n"
<< " now, the Lumiera GUI should be spawned....\n"
<< " but actually nothing happens!!!!!!!!!!!!!!\n\n";
terminationHandle(0); // signal immediate shutdown without error
try
{
int argc =0; /////////////////////////////////////////////////////////////////////////////TODO pass arguments from core
char *argv[] = {};
gui::application().main(argc, argv); // execute the GTK Event Loop
if (!lumiera_error_peek())
{
reportTermination(0); // report GUI shutdown without error
return;
}
}
catch (lumiera::Error& problem)
{
reportTermination(&problem); // signal shutdown reporting the error
return;
}
catch (...){ }
lumiera::error::Fatal problemIndicator("unexpected error terminated the GUI.", lumiera_error());
reportTermination (&problemIndicator);
return;
}
};