- Separate work in a main program and two libraries. This is experimental, and

ideally it should be a target to work towards decoupling
- Still more experimental, added support for visibility exports from DSOs. Need
testing from someone with GCC 4.0


git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@206 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
tchernobog 2006-01-26 18:31:23 +00:00
parent 1515b2065f
commit 26f88aa4cf
11 changed files with 368 additions and 17 deletions

View file

@ -18,7 +18,7 @@
# along with SGPEMv2; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
SUBDIRS = testsuite builtin-policies
SUBDIRS = builtin-policies gtkgui pyloader testsuite
#additional rules:
%_wrap.cc : %.i
@ -26,7 +26,6 @@ SUBDIRS = testsuite builtin-policies
# Program & library names
bin_PROGRAMS = sgpemv2
# lib_LTLIBRARIES =
# Other directories
sharedir = @datadir@/sgpemv2
@ -37,15 +36,9 @@ localedir = @datadir@/locale
sgpemv2_CPPFLAGS = -I@top_srcdir@ \
-DPYCDIR="\"$(pycdir)\"" \
-DMODDIR="\"$(moddir)\"" \
-DLOCALEDIR="\"$(localedir)\"" \
$(PYTHON_CPPFLAGS)
sgpemv2_CXXFLAGS = $(CAIRO_CFLAGS) \
$(GTKMM_CFLAGS)
sgpemv2_LDADD = $(PYTHON_LDFLAGS) \
$(PYTHON_EXTRA_LIBS) \
$(CAIRO_LIBS) \
$(GTKMM_LIBS)
sgpemv2_LDFLAGS = $(PYTHON_EXTRA_LDFLAGS)
-DLOCALEDIR="\"$(localedir)\""
sgpemv2_LDFLAGS = -L@builddir@/gtkgui -L@builddir@/pyloader
sgpemv2_LDADD = -lgtkgui -lpyloader
# Please keep this in sorted order:
sgpemv2_SOURCES = \
@ -56,6 +49,3 @@ noinst_HEADERS = \
main.hh \
parseopts.hh
# loadable python modules
mod_PYTHON = # policy.py

52
src/gtkgui/Makefile.am Normal file
View file

@ -0,0 +1,52 @@
# src/gtkgui/Makefile.am - Copyright 2005, 2006, University
# of Padova, dept. of Pure and Applied
# Mathematics
#
# This file is part of SGPEMv2.
#
# This is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# SGPEMv2 is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with SGPEMv2; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# If needed, setup testsuite for this component
# SUBDIRS = testsuite
# Program & library names
pkglib_LTLIBRARIES = libgtkgui.la
# Other directories
sharedir = @datadir@/sgpemv2
pycdir = $(sharedir)/policies
moddir = $(sharedir)/modules
localedir = @datadir@/locale
libgtkgui_la_CPPFLAGS = -I@top_srcdir@ \
-DPYCDIR="\"$(pycdir)\"" \
-DMODDIR="\"$(moddir)\"" \
-DLOCALEDIR="\"$(localedir)\""
libgtkgui_la_CXXFLAGS = \
$(CAIRO_CFLAGS) \
$(GTKMM_CFLAGS)
libgtkgui_la_LIBADD = \
$(CAIRO_LIBS) \
$(GTKMM_LIBS)
# Please keep this in sorted order:
libgtkgui_la_SOURCES = \
mainwindow.cc \
startgui.cc
noinst_HEADERS = \
mainwindow.hh \
startgui.hh

31
src/gtkgui/mainwindow.cc Normal file
View file

@ -0,0 +1,31 @@
// src/gtkgui/mainwindow.cc - Copyright 2005, 2006, University
// of Padova, dept. of Pure and Applied
// Mathematics
//
// This file is part of SGPEMv2.
//
// This is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// SGPEMv2 is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with SGPEMv2; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include "config.h"
#include "gettext.h"
#include "mainwindow.hh"
#include <gtkmm/main.h>
#include <gtkmm/window.h>
MainWindow::MainWindow() {}
MainWindow::~MainWindow() {}

49
src/gtkgui/mainwindow.hh Normal file
View file

@ -0,0 +1,49 @@
// src/gtkgui/mainwindow.hh - Copyright 2005, 2006, University
// of Padova, dept. of Pure and Applied
// Mathematics
//
// This file is part of SGPEMv2.
//
// This is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// SGPEMv2 is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with SGPEMv2; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#ifndef GTKGUI_MAINWINDOW_HH
#define GTKGUI_MAINWINDOW_HH 1
#include "config.h"
#include "gettext.h"
#include <gtkmm/window.h>
// ---------------------------------------------
//! The main program window
class MainWindow;
// ---------------------------------------------
/** This is the main simulation window displayed
* when the program is run with a GUI */
class MainWindow : public Gtk::Window {
public:
MainWindow();
virtual ~MainWindow();
private:
};
#endif

36
src/gtkgui/startgui.cc Normal file
View file

@ -0,0 +1,36 @@
// src/gtkgui/startgui.cc - Copyright 2005, 2006, University
// of Padova, dept. of Pure and Applied
// Mathematics
//
// This file is part of SGPEMv2.
//
// This is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// SGPEMv2 is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with SGPEMv2; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include "config.h"
#include "gettext.h"
#include "mainwindow.hh"
#include "startgui.hh"
#include <gtkmm/main.h>
#include <gtkmm/window.h>
void DLLEXPORT
start_gui(int argc, char** argv) {
Gtk::Main gtk_main(argc,argv);
Gtk::Window main_window;
Gtk::Main::run(main_window);
}

29
src/gtkgui/startgui.hh Normal file
View file

@ -0,0 +1,29 @@
// src/gtkgui/startgui.hh - Copyright 2005, 2006, University
// of Padova, dept. of Pure and Applied
// Mathematics
//
// This file is part of SGPEMv2.
//
// This is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// SGPEMv2 is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with SGPEMv2; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#ifndef GTKGUI_STARTGUI_HH
#define GTKGUI_STARTGUI_HH 1
#include "config.h"
//! This function starts the whole GUI
void DLLEXPORT start_gui(int argc, char** argv);
#endif

View file

@ -21,7 +21,9 @@
#include "config.h"
#include "gettext.h"
#include "main.hh"
#include "parseopts.hh"
#include "gtkgui/startgui.hh"
#include <algorithm>
#include <functional>
@ -63,5 +65,7 @@ main(int argc, char* argv[])
for_each(a_ptr, a_ptr+a_count, create_fnames_vect(filenames));
}
start_gui(argc, argv);
return 0;
}

27
src/main.hh Normal file
View file

@ -0,0 +1,27 @@
// src/main.cc - Copyright 2005, 2006, University
// of Padova, dept. of Pure and Applied
// Mathematics
//
// This file is part of SGPEMv2.
//
// This is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// SGPEMv2 is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with SGPEMv2; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#ifndef MAIN_HH
#define MAIN_HH 1
// found in gtkgui/mainwindow.hh
extern void build_gui(int argc, char** argv);
#endif

55
src/pyloader/Makefile.am Normal file
View file

@ -0,0 +1,55 @@
# src/pyloader/Makefile.am - Copyright 2005, 2006, University
# of Padova, dept. of Pure and Applied
# Mathematics
#
# This file is part of SGPEMv2.
#
# This is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# SGPEMv2 is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with SGPEMv2; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# you'll want to setup a testsuite for this component, sooner or later.
#SUBDIRS = testsuite
#additional rules:
%_wrap.cc : %.i
$(SWIG) $(SWIG_PYTHON_OPT) -o $@ $<
# Program & library names
pkglib_LTLIBRARIES = libpyloader.la
# Other directories
sharedir = @datadir@/sgpemv2
pycdir = $(sharedir)/policies
moddir = $(sharedir)/modules
localedir = @datadir@/locale
libpyloader_la_CPPFLAGS = -I@top_srcdir@ \
-DPYCDIR="\"$(pycdir)\"" \
-DMODDIR="\"$(moddir)\"" \
-DLOCALEDIR="\"$(localedir)\"" \
$(PYTHON_CPPFLAGS)
libpyloader_la_LIBADD = $(PYTHON_LDFLAGS) \
$(PYTHON_EXTRA_LIBS)
libpyloader_la_LDFLAGS = $(PYTHON_EXTRA_LDFLAGS)
# Please keep this in sorted order:
libpyloader_la_SOURCES = empty.cc
noinst_HEADERS =
# !! temp file for debug, will be deleted as soon as
# !! source's in place
empty.cc :
echo "int main() {}" > @builddir@/$@