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

Go to the documentation of this file.
00001 //$Id: mimaMon.h,v 1.5 2006/07/01 21:36:23 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 MIMAMON_H
00023 #define MIMAMON_H
00024 
00025 #ifdef HAVE_CONFIG_H
00026 #include <config.h>
00027 #endif
00028 
00029 #include <gtkmm/frame.h>
00030 #include <gtkmm/table.h>
00031 #include <gtkmm/alignment.h>
00032 #include <gtkmm/label.h>
00033 #include <gtkmm/button.h>
00034 #include <gtkmm/scale.h>
00035 #include <gtkmm/adjustment.h>
00036 
00037 #include <glibmm.h>
00038 #include <sigc++/sigc++.h>
00039 
00040 #include <mima.h> // for MimaSim::State
00041 #include "mimaWidgets.h" // for EntryInt
00042 
00044 namespace MimaGtk {
00045 
00047 
00054      class MimaMon : public Gtk::Frame
00055           {
00056           private:
00057                /*
00058                 * private typedefs
00059                 * ================
00060                 */
00061                typedef sigc::signal<void>      type_signal_void;
00062                typedef sigc::signal<int>       type_signal_int;
00063                typedef sigc::signal<int, int>  type_signal_int_int;
00064                typedef sigc::signal<void, int> type_signal_void_int;
00065 
00066                /*
00067                 * private attributes
00068                 * ==================
00069                 */
00070                int  m_register_acc,
00071                     m_register_iar,
00072                     m_register_ir,
00073                     m_instruction_count;
00074 
00075           protected:
00076                /*
00077                 * signals
00078                 * =======
00079                 */
00080                type_signal_void     m_signal_reset_counter;
00081                type_signal_int      m_signal_get_acc;
00082                type_signal_int      m_signal_get_iar;
00083                type_signal_int      m_signal_get_counter;
00084                type_signal_int_int  m_signal_get_memory;
00085                type_signal_void_int m_signal_set_acc;
00086                type_signal_void_int m_signal_set_iar;
00087                type_signal_void_int m_signal_delay_changed;
00088 
00089                /*
00090                 * Member widgets
00091                 * ==============
00092                 */
00093                Gtk::Table m_table;
00094                Gtk::Alignment m_align_acc,
00095                     m_align_iar,
00096                     m_align_ir,
00097                     m_align_counter,
00098                     m_align_speed;
00099                Gtk::Label m_label_acc,
00100                     m_label_iar,
00101                     m_label_ir,
00102                     m_label_counter,
00103                     m_label_speed;
00104                EntryInt
00105                     m_entry_acc,
00106                     m_entry_iar,
00107                     m_entry_ir,
00108                     m_entry_counter;
00109                Gtk::Button m_button_reset;
00110                Gtk::HScale m_scale_speed;
00111 
00112           public:
00113                MimaMon();
00114                virtual ~MimaMon();
00115 
00116                /*
00117                 * signal accessors
00118                 * ================
00119                 */
00121                type_signal_void     signal_reset_counter() { return m_signal_reset_counter; };
00123                type_signal_int      signal_get_acc()       { return m_signal_get_acc;       };
00125                type_signal_int      signal_get_iar()       { return m_signal_get_iar;       };
00127                type_signal_int      signal_get_counter()   { return m_signal_get_counter;   };
00129                type_signal_int_int  signal_get_memory()    { return m_signal_get_memory;    };
00131                type_signal_void_int signal_set_acc()       { return m_signal_set_acc;       };
00133                type_signal_void_int signal_set_iar()       { return m_signal_set_iar;       };
00134 
00135                type_signal_void_int signal_delay_changed() { return m_signal_delay_changed; };
00136 
00137                /*
00138                 * Signal handlers (intern)
00139                 * ========================
00140                 */
00142                void on_entry_acc_activate();
00143 
00145                void on_entry_iar_activate();
00146 
00148                void on_button_reset_pressed();
00149 
00150                void on_speed_changed();
00151 
00152                /*
00153                 * Signal handlers (extern)
00154                 * ========================
00155                 */
00157                void on_state_changed(MimaSim::State state);
00159                void on_acc_changed(int value);
00161                void on_iar_changed(int value);
00163                void on_counter_changed(int value);
00165                void on_memory_changed(int addr, int value);
00167                void on_memory_clear();
00168 
00169           };
00170 
00171 }
00172 
00173 #endif // MIMAMON_H

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