/home/martin/src/mimasim/src/mima_gtk/mimaCLI.h

Go to the documentation of this file.
00001 //$Id: mimaCLI.h,v 1.6 2006/10/22 10:43:33 der_martin Exp $
00002 /*
00003  * mimasim -- a simulator of a minimal microprocessor system
00004  * Copyright (C) 2006 Martin Grandrath <gr@ndrath.de>
00005  *
00006  * This program is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU General Public License as
00008  * published by the Free Software Foundation; either version 2 of the
00009  * License, or (at your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful, but
00012  * WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  * General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software
00018  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00019  * 02110-1301, USA.
00020  */
00021 
00022 #ifndef MIMACLI_H
00023 #define MIMACLI_H
00024 
00025 #ifdef HAVE_CONFIG_H
00026 #include <config.h>
00027 #endif
00028 
00029 #include <gtkmm/frame.h>
00030 #include <gtkmm/box.h>
00031 #include <gtkmm/scrolledwindow.h>
00032 #include <gtkmm/textview.h>
00033 #include <gtkmm/entry.h>
00034 #include <gtkmm/button.h>
00035 
00036 #include <glibmm.h>
00037 #include <sigc++/sigc++.h>
00038 
00039 #include <mima.h>
00040 #include "mimaChildWindow.h"
00041 
00043 namespace MimaGtk {
00044 
00046 
00052      class MimaCLI : public Gtk::Frame
00053           {
00054           private:
00055                class Command
00056                     {
00057                     public:
00058                          Command(char *cmd_str);
00059                          ~Command();
00060                          char cmd;
00061                          int arg1, arg2;
00062                     };
00063 
00064                /*
00065                 * private typedefs
00066                 * ================
00067                 */
00068                typedef sigc::signal<const char*, char*> type_signal_pchar_pchar;
00069 
00070           protected:
00071                /*
00072                 * signals
00073                 * =======
00074                 */
00075                type_signal_pchar_pchar m_signal_execute;
00076 
00077                /*
00078                 * Signal handlers
00079                 * ===============
00080                 */
00082                virtual void on_execute();
00083 
00085                virtual void on_changed();
00086 
00087                /*
00088                 * Member widgets
00089                 * ==============
00090                 */
00091                Gtk::HBox m_hbox;
00092                Gtk::VBox m_vbox;
00093                Gtk::ScrolledWindow m_scrolledwindow;
00094 
00096                Gtk::TextView m_textview;
00097 
00099                Gtk::Entry m_entry;
00100 
00102                Gtk::Button m_button_exec;
00103 
00104           public:
00105                MimaCLI();
00106                virtual ~MimaCLI();
00107 
00108                /*
00109                 * Signal accessors
00110                 * ================
00111                 */
00112                type_signal_pchar_pchar signal_execute() { return m_signal_execute; };
00113 
00114           };
00115 
00116 
00118 
00120      class MimaCLIWnd : public MimaChildWindow
00121           {
00122           private:
00123 
00124                /*
00125                 * signal connections
00126                 * ==================
00127                 */
00128                sigc::connection
00129                     /* MimaCLI -> Mima */
00130                     m_connection_execute;
00131 
00132           protected:
00133                virtual bool ask_to_save();
00134 
00136                static int m_count;
00137 
00138                MimaCLI m_mimaCLIframe;
00139 
00140           public:
00141                MimaCLIWnd(MimaSim::Mima *_mima);
00142                ~MimaCLIWnd();
00143 
00144                virtual ChildWindowType type()
00145                     { return CLI; }
00146 
00147           };
00148 
00149 }
00150 
00151 #endif // MIMACLI_H

Generated on Sat Nov 4 19:40:56 2006 for mimasim by  doxygen 1.4.7