2006-01-27 18:57:53 +01:00
|
|
|
// src/graphicalterminalio.hh - Copyright 2005, 2006, University
|
2006-01-27 16:04:06 +01:00
|
|
|
// 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
|
|
|
|
|
2006-01-27 18:57:53 +01:00
|
|
|
#ifndef GRAPHICALTERMINALIO_HH
|
|
|
|
#define GRAPHICALTERMINALIO_HH 1
|
2006-01-27 16:04:06 +01:00
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
#include "gettext.h"
|
|
|
|
|
|
|
|
#include <gtkmm/box.h>
|
2006-02-01 23:56:29 +01:00
|
|
|
#include <gtkmm/entry.h>
|
2006-01-27 16:04:06 +01:00
|
|
|
#include <gtkmm/textview.h>
|
2006-02-10 21:44:48 +01:00
|
|
|
#include <gtkmm/window.h>
|
2006-01-27 16:04:06 +01:00
|
|
|
#include <glibmm/ustring.h>
|
|
|
|
|
2006-02-22 23:45:06 +01:00
|
|
|
#include "text_simulation.hh"
|
|
|
|
|
2006-02-09 20:43:24 +01:00
|
|
|
#include "io_manager.hh"
|
2006-01-27 16:04:06 +01:00
|
|
|
|
2006-02-09 20:33:35 +01:00
|
|
|
namespace sgpem {
|
2006-01-27 16:04:06 +01:00
|
|
|
|
2006-02-09 20:33:35 +01:00
|
|
|
// ---------------------------------------------
|
|
|
|
|
|
|
|
class GraphicalTerminalIO;
|
|
|
|
|
|
|
|
// ---------------------------------------------
|
|
|
|
|
|
|
|
/** \brief
|
|
|
|
*
|
|
|
|
* ... long desc ... */
|
2006-02-10 21:44:48 +01:00
|
|
|
class GraphicalTerminalIO : public IOManager, public Gtk::Window
|
2006-02-09 20:33:35 +01:00
|
|
|
{
|
2006-02-15 23:58:18 +01:00
|
|
|
|
2006-02-09 20:33:35 +01:00
|
|
|
public:
|
2006-02-22 23:45:06 +01:00
|
|
|
GraphicalTerminalIO(TextSimulation* sim);
|
|
|
|
virtual ~GraphicalTerminalIO();
|
2006-02-09 20:33:35 +01:00
|
|
|
|
2006-02-15 23:58:18 +01:00
|
|
|
virtual uint write_buffer(const Glib::ustring& buffer);
|
|
|
|
virtual Glib::ustring read_command();
|
2006-02-17 23:19:25 +01:00
|
|
|
virtual bool is_full_duplex();
|
2006-02-22 23:45:06 +01:00
|
|
|
void onSend();
|
2006-02-17 23:19:25 +01:00
|
|
|
|
2006-02-09 20:33:35 +01:00
|
|
|
private:
|
2006-02-22 23:45:06 +01:00
|
|
|
TextSimulation* _sim;
|
2006-02-10 21:44:48 +01:00
|
|
|
Gtk::TextView _text_output;
|
|
|
|
mutable Gtk::Entry _text_input;
|
2006-02-22 23:45:06 +01:00
|
|
|
Gtk::Button* _send;
|
2006-02-09 20:33:35 +01:00
|
|
|
};
|
2006-01-27 16:04:06 +01:00
|
|
|
|
2006-02-09 20:33:35 +01:00
|
|
|
}
|
2006-01-27 16:04:06 +01:00
|
|
|
|
|
|
|
#endif
|
2006-02-19 23:36:24 +01:00
|
|
|
|