From 042549c2905bd8ae3d05f5bb092896dbbd4f66f5 Mon Sep 17 00:00:00 2001 From: tchernobog Date: Fri, 27 Jan 2006 15:04:06 +0000 Subject: [PATCH] - Start adding interface for the frontend IO section. Should we use namespaces? git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@236 3ecf2c5c-341e-0410-92b4-d18e462d057c --- src/gtkgui/Makefile.am | 6 ++-- src/gtkgui/graphicalterminalio.cc | 52 +++++++++++++++++++++++++++++ src/gtkgui/graphicalterminalio.hh | 55 +++++++++++++++++++++++++++++++ src/gtkgui/iomanager.hh | 47 ++++++++++++++++++++++++++ 4 files changed, 158 insertions(+), 2 deletions(-) create mode 100644 src/gtkgui/graphicalterminalio.cc create mode 100644 src/gtkgui/graphicalterminalio.hh create mode 100644 src/gtkgui/iomanager.hh diff --git a/src/gtkgui/Makefile.am b/src/gtkgui/Makefile.am index 92453f2..cf0ee1f 100644 --- a/src/gtkgui/Makefile.am +++ b/src/gtkgui/Makefile.am @@ -43,10 +43,12 @@ libgtkgui_la_LIBADD = \ # Please keep this in sorted order: libgtkgui_la_SOURCES = \ + graphicalterminalio.cc \ mainwindow.cc \ startgui.cc noinst_HEADERS = \ + iomanager.hh \ mainwindow.hh \ - startgui.hh - + startgui.hh \ + graphicalterminalio.hh diff --git a/src/gtkgui/graphicalterminalio.cc b/src/gtkgui/graphicalterminalio.cc new file mode 100644 index 0000000..0e2f1a0 --- /dev/null +++ b/src/gtkgui/graphicalterminalio.cc @@ -0,0 +1,52 @@ +// src/gtkgui/graphicalterminalio.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 "graphicalterminalio.hh" + +#include +#include +#include + +GraphicalTerminalIO::GraphicalTerminalIO() +{ + +} + +GraphicalTerminalIO::~GraphicalTerminalIO() +{ + +} + +GraphicalTerminalIO::size_type +GraphicalTerminalIO::write_buffer(const Glib::ustring& buffer) +{ + // FIXME + return 0; +} + +GraphicalTerminalIO::size_type +GraphicalTerminalIO::read_command(Glib::ustring& buffer) const +{ + // FIXME + return 0; +} diff --git a/src/gtkgui/graphicalterminalio.hh b/src/gtkgui/graphicalterminalio.hh new file mode 100644 index 0000000..ca3184d --- /dev/null +++ b/src/gtkgui/graphicalterminalio.hh @@ -0,0 +1,55 @@ +// src/gtkgui/graphicalterminalio.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_GRAPHICALTERMINALIO_HH +#define GTKGUI_GRAPHICALTERMINALIO_HH 1 + +#include "config.h" +#include "gettext.h" + +#include +#include +#include + +#include "iomanager.hh" + +// --------------------------------------------- + +class GraphicalTerminalIO; + +// --------------------------------------------- + +/** \brief + * + * ... long desc ... */ +class GraphicalTerminalIO : public IOManager, public Gtk::VBox { + typedef unsigned int size_type; +public: + GraphicalTerminalIO(); + virtual ~GraphicalTerminalIO(); + + virtual size_type write_buffer(const Glib::ustring& buffer); + virtual size_type read_command(Glib::ustring& buffer) const; +private: + Gtk::TextView text_output; + Gtk::TextView text_input; +}; + +#endif diff --git a/src/gtkgui/iomanager.hh b/src/gtkgui/iomanager.hh new file mode 100644 index 0000000..69ed865 --- /dev/null +++ b/src/gtkgui/iomanager.hh @@ -0,0 +1,47 @@ +// src/gtkgui/iomanager.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_IOMANAGER_HH +#define GTKGUI_IOMANAGER_HH 1 + +#include "config.h" +#include "gettext.h" + +#include + +// --------------------------------------------- + +class IOManager; + +// --------------------------------------------- + +/** \brief + * + * ... long desc ... */ +class IOManager { + typedef unsigned int size_type; +public: + virtual ~IOManager() {} + + virtual size_type write_buffer(const Glib::ustring& buffer) = 0; + virtual size_type read_command(Glib::ustring& buffer) const = 0; +}; + +#endif