00001 //$Id: mimaChildWindow.h,v 1.1 2006/10/22 10:45:14 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 MIMACHILDWINDOW_H 00023 #define MIMACHILDWINDOW_H 00024 00025 #ifdef HAVE_CONFIG_H 00026 #include <config.h> 00027 #endif 00028 00029 #include <gtkmm/window.h> 00030 #include <sigc++/sigc++.h> 00031 00032 #include <mima.h> 00033 00035 namespace MimaGtk { 00036 00037 enum ChildWindowType { 00038 MAIN, 00039 CLI, 00040 MEM, 00041 EDIT 00042 }; 00043 00045 00047 class MimaChildWindow : public Gtk::Window 00048 { 00049 private: 00050 /* 00051 * private typedefs 00052 * ================ 00053 */ 00054 typedef sigc::signal<void> type_signal_void; 00055 00056 protected: 00057 MimaSim::Mima *m_mima; 00058 00060 bool m_unsaved_changes; 00061 00062 /* 00063 * signals 00064 * ======= 00065 */ 00066 type_signal_void m_signal_destroy; 00067 00069 virtual bool ask_to_save() = 0; 00070 00072 virtual void on_hide(); 00073 00075 virtual bool on_delete_event(GdkEventAny* event); 00076 00077 public: 00078 MimaChildWindow(MimaSim::Mima *_mima); 00079 virtual ~MimaChildWindow(); 00080 00081 virtual ChildWindowType type() = 0; 00082 00083 /* 00084 * Signal accessors 00085 * ================ 00086 */ 00088 type_signal_void signal_destroy() { return m_signal_destroy; }; 00089 }; 00090 00091 } 00092 00093 #endif // MIMACHILDWINDOW_H
1.4.7