- Move to libglademm to handle GUI creation. This is experimental,
but should greatly help in reducing development times git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@727 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
parent
3dd8403f0a
commit
41d20ba6eb
13
Makefile.am
13
Makefile.am
|
@ -36,11 +36,11 @@ SUBDIRS += \
|
||||||
plugins/pyloader \
|
plugins/pyloader \
|
||||||
plugins/xmlsave
|
plugins/xmlsave
|
||||||
|
|
||||||
# directories definition
|
datarootdir = @datarootdir@
|
||||||
sharedir = $(pkgdatadir)
|
sharedir = $(pkgdatadir)
|
||||||
policiesdir = $(sharedir)/policies
|
policiesdir = $(sharedir)/policies
|
||||||
plugindir = $(sharedir)/plugins
|
plugindir = $(sharedir)/plugins
|
||||||
datarootdir = @datarootdir@
|
gladedir = $(sharedir)/glade
|
||||||
localedir = @datadir@/locale
|
localedir = @datadir@/locale
|
||||||
aclocaldir = @datadir@/aclocal
|
aclocaldir = @datadir@/aclocal
|
||||||
|
|
||||||
|
@ -245,8 +245,11 @@ sgpemv2_CPPFLAGS = \
|
||||||
-I@top_srcdir@ \
|
-I@top_srcdir@ \
|
||||||
-I@top_srcdir@/src/templates \
|
-I@top_srcdir@/src/templates \
|
||||||
-DLOCALEDIR="\"$(localedir)\"" \
|
-DLOCALEDIR="\"$(localedir)\"" \
|
||||||
|
-DSHAREDIR="\"$(sharedir)\"" \
|
||||||
|
-DGLADEDIR="\"$(gladedir)\"" \
|
||||||
$(CAIRO_CFLAGS) \
|
$(CAIRO_CFLAGS) \
|
||||||
$(GTKMM_CFLAGS) \
|
$(GTKMM_CFLAGS) \
|
||||||
|
$(LIBGLADEMM_CFLAGS) \
|
||||||
$(PYTHON_CPPFLAGS) \
|
$(PYTHON_CPPFLAGS) \
|
||||||
$(GTHREAD_CFLAGS)
|
$(GTHREAD_CFLAGS)
|
||||||
sgpemv2_CXXFLAGS = $(VISIB_HIDDEN)
|
sgpemv2_CXXFLAGS = $(VISIB_HIDDEN)
|
||||||
|
@ -255,6 +258,7 @@ sgpemv2_LDADD = \
|
||||||
src/backend/libbackend.la \
|
src/backend/libbackend.la \
|
||||||
$(CAIRO_LIBS) \
|
$(CAIRO_LIBS) \
|
||||||
$(GTKMM_LIBS) \
|
$(GTKMM_LIBS) \
|
||||||
|
$(LIBGLADEMM_LIBS) \
|
||||||
$(GTHREAD_LIBS)
|
$(GTHREAD_LIBS)
|
||||||
|
|
||||||
# Please keep this in sorted order:
|
# Please keep this in sorted order:
|
||||||
|
@ -282,6 +286,11 @@ noinst_HEADERS += \
|
||||||
src/start_gui.hh \
|
src/start_gui.hh \
|
||||||
src/text_simulation.hh
|
src/text_simulation.hh
|
||||||
|
|
||||||
|
# ---------- glade files -----------
|
||||||
|
|
||||||
|
glade_DATA = \
|
||||||
|
glade/main-window.glade
|
||||||
|
|
||||||
# ############################################################
|
# ############################################################
|
||||||
#
|
#
|
||||||
# source : templates
|
# source : templates
|
||||||
|
|
|
@ -56,6 +56,7 @@ AM_GNU_GETTEXT_VERSION([0.14.1])
|
||||||
dnl various requisites
|
dnl various requisites
|
||||||
SIGCPP_VERSION=2.0.10
|
SIGCPP_VERSION=2.0.10
|
||||||
GTKMM_VERSION=2.8.0
|
GTKMM_VERSION=2.8.0
|
||||||
|
LIBGLADEMM_VERSION=2.6.2
|
||||||
CAIRO_VERSION=1.0.0
|
CAIRO_VERSION=1.0.0
|
||||||
|
|
||||||
dnl c++ compiler and flags
|
dnl c++ compiler and flags
|
||||||
|
@ -92,6 +93,9 @@ PKG_CHECK_MODULES([GLIBMM],
|
||||||
PKG_CHECK_MODULES([GTKMM],
|
PKG_CHECK_MODULES([GTKMM],
|
||||||
[gtkmm-2.4 >= $GTKMM_VERSION],
|
[gtkmm-2.4 >= $GTKMM_VERSION],
|
||||||
:, AC_MSG_ERROR([$GTKMM_PKG_ERRORS]))
|
:, AC_MSG_ERROR([$GTKMM_PKG_ERRORS]))
|
||||||
|
PKG_CHECK_MODULES([LIBGLADEMM],
|
||||||
|
[libglademm-2.4 >= $LIBGLADEMM_VERSION],
|
||||||
|
:, AC_MSG_ERROR([$LIBGLADEMM_PKG_ERRORS]))
|
||||||
|
|
||||||
dnl use DSO visibility tags for systems that supports it correctly
|
dnl use DSO visibility tags for systems that supports it correctly
|
||||||
SGPEMV2_VISIBILITY_SUPPORT
|
SGPEMV2_VISIBILITY_SUPPORT
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
#include "main.hh"
|
#include "main.hh"
|
||||||
|
|
||||||
#include "parse_opts.hh"
|
#include "parse_opts.hh"
|
||||||
// #include "start_gui.hh"
|
#include "start_gui.hh"
|
||||||
|
|
||||||
#include "backend/plugin_manager.hh"
|
#include "backend/plugin_manager.hh"
|
||||||
|
|
||||||
|
@ -66,5 +66,7 @@ main(int argc, char* argv[])
|
||||||
// Initializes plugin system
|
// Initializes plugin system
|
||||||
PluginManager::get_instance();
|
PluginManager::get_instance();
|
||||||
|
|
||||||
|
start_gui(argc, argv);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,24 +21,39 @@
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "gettext.h"
|
#include "gettext.h"
|
||||||
|
|
||||||
#include "graphical_terminal_io.hh"
|
|
||||||
#include "start_gui.hh"
|
#include "start_gui.hh"
|
||||||
#include "smartp.tcc"
|
|
||||||
|
|
||||||
|
#include <libglademm/xml.h>
|
||||||
#include <gtkmm/main.h>
|
#include <gtkmm/main.h>
|
||||||
|
#include <gtkmm/menuitem.h>
|
||||||
|
#include <gtkmm/window.h>
|
||||||
|
|
||||||
|
#include <cassert>
|
||||||
|
|
||||||
void
|
void
|
||||||
start_gui(int argc, char** argv, TextSimulation& txt)
|
start_gui(int argc, char** argv)
|
||||||
{
|
{
|
||||||
Gtk::Main gtk_main(argc, argv);
|
using namespace Gnome;
|
||||||
|
using namespace Gtk;
|
||||||
|
|
||||||
GraphicalTerminalIO* gt = new sgpem::GraphicalTerminalIO(&txt);
|
Main gtk_main(argc, argv);
|
||||||
memory::smart_ptr<sgpem::IOManager> main_window(gt);
|
|
||||||
txt.add_io_device(main_window);
|
|
||||||
|
|
||||||
//print the initial status on each iomanager
|
Glib::RefPtr<Glade::Xml> refXml =
|
||||||
//txt.update();
|
Glade::Xml::create(GLADEDIR "/main-window.glade");
|
||||||
|
|
||||||
Gtk::Main::run(*gt);
|
Window* main_window = NULL;
|
||||||
|
refXml->get_widget("MainWindow", main_window);
|
||||||
|
assert(main_window != NULL);
|
||||||
|
|
||||||
|
// Connect extra signals (decide where to do this...
|
||||||
|
// here -- ugly -- derive widgets and then use
|
||||||
|
// Glade::Xml::get_widget_derived -- better --)
|
||||||
|
MenuItem* file_quit = NULL;
|
||||||
|
refXml->get_widget("Menu.File.Quit", file_quit);
|
||||||
|
file_quit->signal_activate().connect(sigc::ptr_fun(&Main::quit));
|
||||||
|
|
||||||
|
main_window->show_all_children();
|
||||||
|
|
||||||
|
Main::run(*main_window);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,13 +23,10 @@
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#include "text_simulation.hh"
|
|
||||||
|
|
||||||
|
|
||||||
/** \brief This function initialize and starts the whole GUI
|
/** \brief This function initialize and starts the whole GUI
|
||||||
|
|
||||||
*/
|
*/
|
||||||
void SG_DLLEXPORT start_gui(int argc, char** argv, TextSimulation& txt);
|
void SG_DLLEXPORT start_gui(int argc, char** argv);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue