00001 //$Id: mimaWnd.h,v 1.16 2006/11/04 17:09:02 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 MIMAWND_H 00023 #define MIMAWND_H 00024 00025 #ifdef HAVE_CONFIG_H 00026 #include <config.h> 00027 #endif 00028 00029 #include <string> 00030 #include <vector> 00031 00032 #include <gtkmm/window.h> 00033 #include <gtkmm/box.h> 00034 00035 #include <sigc++/sigc++.h> 00036 00037 #include <mima.h> 00038 00039 #include "mimaChildWindow.h" 00040 #include "mimaMenu.h" 00041 #include "mimaCLI.h" 00042 #include "mimaMon.h" 00043 #include "mimaMem.h" 00044 #include "mimaEdit.h" 00045 #include "mimaTerm.h" 00046 00048 namespace MimaGtk { 00049 00051 class MimaWnd : public Gtk::Window 00052 { 00053 protected: 00054 MimaSim::Mima m_mima; 00055 00057 unsigned int m_stepspeed; 00058 sigc::connection m_timeout_connection; 00059 00061 std::string m_filename; 00062 00063 /* 00064 * child widgets 00065 * ============= 00066 */ 00067 MimaMenu m_mimaMenu; 00068 MimaMon m_mimaMon; 00069 MimaEdit m_mimaEdit; 00070 00071 Gtk::VBox m_vbox; 00072 00073 /* 00074 * child windows 00075 * ============= 00076 */ 00077 std::vector<MimaChildWindow*> m_childWindows; 00078 00079 /* 00080 * protected members 00081 * ================= 00082 */ 00083 virtual bool on_delete_event(GdkEventAny* event); 00084 bool hide_all_child_windows(); 00085 void destroy_child(MimaChildWindow *child); 00086 void set_filename(std::string name); 00087 00089 MimaChildWindow *get_last_child(ChildWindowType type); 00090 00091 /* 00092 * signal handlers 00093 * =============== 00094 */ 00095 void on_quit(); 00096 void on_delay_changed(int delay); 00097 void on_file_open(); 00098 void on_file_save(); 00099 void on_file_save_as(); 00100 void on_windows_new_terminal(); 00101 void on_windows_new(ChildWindowType type); 00102 void on_terminal_hide(MimaTerm *_term); 00103 00105 bool on_timeout(); 00106 00107 public: 00108 MimaWnd(); 00109 virtual ~MimaWnd(); 00110 }; 00111 00112 } 00113 00114 #endif // MIMAWND_H
1.4.7