Integration: complete GTK-GUI loaded from main Lumiera App. !Yay!
This commit is contained in:
parent
edb01ec8c6
commit
e8229623bc
3 changed files with 47 additions and 25 deletions
|
|
@ -46,20 +46,14 @@ using namespace gui::model;
|
||||||
|
|
||||||
GtkLumiera the_application;
|
GtkLumiera the_application;
|
||||||
|
|
||||||
int
|
|
||||||
main (int argc, char *argv[])
|
|
||||||
{
|
|
||||||
return the_application.main(argc, argv);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
namespace gui {
|
namespace gui {
|
||||||
|
|
||||||
int
|
void
|
||||||
GtkLumiera::main(int argc, char *argv[])
|
GtkLumiera::main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
NOBUG_INIT;
|
|
||||||
|
|
||||||
Main kit(argc, argv);
|
Main kit(argc, argv);
|
||||||
|
|
||||||
|
|
@ -92,3 +86,14 @@ application()
|
||||||
} // namespace gui
|
} // 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;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -98,7 +98,7 @@ static const gchar* AppAuthors[] = {
|
||||||
class GtkLumiera : private boost::noncopyable
|
class GtkLumiera : private boost::noncopyable
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
int main(int argc, char *argv[]);
|
void main(int argc, char *argv[]);
|
||||||
|
|
||||||
static Glib::ustring get_home_data_path();
|
static Glib::ustring get_home_data_path();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -31,18 +31,24 @@
|
||||||
**
|
**
|
||||||
** After successfully loading this module, a call to #kickOff is expected to be
|
** 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
|
** issued, passing a termination signal (callback) to be executed when the GUI
|
||||||
** terminates. This call returns immediately, after spawning off the main thread
|
** terminates. This call remains blocked within the main GTK event loop; thus
|
||||||
** and setting up the termination callback accordingly. Additionally, it cares
|
** typically this should already run within a separate dedicated GUI thread.
|
||||||
** for opening the primary "business" interface of the GUI, i.e. the interface
|
** Especially, the gui::GuiRunner will ensure this to happen.
|
||||||
** gui::GuiNotification.
|
**
|
||||||
|
** 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 lumiera::AppState
|
||||||
** @see gui::GuiFacade
|
** @see gui::GuiFacade
|
||||||
** @see guifacade.cpp
|
** @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 "gui/guifacade.hpp"
|
||||||
#include "common/subsys.hpp"
|
#include "common/subsys.hpp"
|
||||||
#include "lib/singleton.hpp"
|
#include "lib/singleton.hpp"
|
||||||
|
|
@ -52,12 +58,7 @@ extern "C" {
|
||||||
#include "common/interfacedescriptor.h"
|
#include "common/interfacedescriptor.h"
|
||||||
}
|
}
|
||||||
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
using std::string;
|
|
||||||
|
|
||||||
#include <iostream> /////////////TODO
|
|
||||||
using std::cout; //////////////TODO
|
|
||||||
|
|
||||||
|
|
||||||
using lumiera::Subsys;
|
using lumiera::Subsys;
|
||||||
|
|
@ -75,14 +76,30 @@ namespace gui {
|
||||||
: public GuiFacade
|
: public GuiFacade
|
||||||
{
|
{
|
||||||
|
|
||||||
void kickOff (Subsys::SigTerm& terminationHandle)
|
void kickOff (Subsys::SigTerm& reportTermination)
|
||||||
{
|
{
|
||||||
cout << " *** Ha Ha Ha\n"
|
try
|
||||||
<< " this is the GuiStarterPlugin speaking!\n"
|
{
|
||||||
<< " now, the Lumiera GUI should be spawned....\n"
|
int argc =0; /////////////////////////////////////////////////////////////////////////////TODO pass arguments from core
|
||||||
<< " but actually nothing happens!!!!!!!!!!!!!!\n\n";
|
char *argv[] = {};
|
||||||
|
|
||||||
terminationHandle(0); // signal immediate shutdown without error
|
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;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue