- 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
This commit is contained in:
tchernobog 2006-01-27 15:04:06 +00:00
parent 9b8a4a725d
commit 042549c290
4 changed files with 158 additions and 2 deletions

View File

@ -43,10 +43,12 @@ libgtkgui_la_LIBADD = \
# Please keep this in sorted order: # Please keep this in sorted order:
libgtkgui_la_SOURCES = \ libgtkgui_la_SOURCES = \
graphicalterminalio.cc \
mainwindow.cc \ mainwindow.cc \
startgui.cc startgui.cc
noinst_HEADERS = \ noinst_HEADERS = \
iomanager.hh \
mainwindow.hh \ mainwindow.hh \
startgui.hh startgui.hh \
graphicalterminalio.hh

View File

@ -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 <gtkmm/button.h>
#include <gtkmm/textview.h>
#include <glibmm/ustring.h>
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;
}

View File

@ -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 <gtkmm/box.h>
#include <gtkmm/textview.h>
#include <glibmm/ustring.h>
#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

47
src/gtkgui/iomanager.hh Normal file
View File

@ -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 <glibmm/ustring.h>
// ---------------------------------------------
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