00001 /*************************************************************************** 00002 * Copyright (C) 2007 by Mike Polan * 00003 * kanadakid@gmail.com * 00004 * * 00005 * This program is free software; you can redistribute it and/or modify * 00006 * it under the terms of the GNU General Public License as published by * 00007 * the Free Software Foundation; either version 2 of the License, or * 00008 * (at your option) any later version. * 00009 * * 00010 * This program is distributed in the hope that it will be useful, * 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00013 * GNU General Public License for more details. * 00014 * * 00015 * You should have received a copy of the GNU General Public License * 00016 * along with this program; if not, write to the * 00017 * Free Software Foundation, Inc., * 00018 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 00019 ***************************************************************************/ 00020 // mainwindow.h: the MainWindow class 00021 00022 #ifndef MAINWINDOW_H 00023 #define MAINWINDOW_H 00024 00025 #include <gtkmm/actiongroup.h> 00026 #include <gtkmm/menu.h> 00027 #include <gtkmm/recentfilter.h> 00028 #include <gtkmm/recentmanager.h> 00029 #include <gtkmm/statusbar.h> 00030 #include <gtkmm/window.h> 00031 #include <gtkmm/uimanager.h> 00032 00033 #include "case.h" 00034 #include "iconmanager.h" 00035 #include "scriptwidget.h" 00036 #include "spriteeditor.h" 00037 00043 class MainWindow: public Gtk::Window { 00044 public: 00046 MainWindow(); 00047 00051 Case::Case* get_case() { return &m_Case; } 00052 00056 BufferMap get_case_buffers() const { return m_ScriptWidget->get_buffers(); } 00057 00058 private: 00060 void construct(); 00061 00071 bool check_case_element(const Glib::ustring &element, int amount); 00072 00077 void create_trigger_submenu(Gtk::Menu *menu); 00078 00083 void set_menuitem_icon(const Glib::ustring &path, const Gtk::StockID &id); 00084 00089 bool process_load_case(const Glib::ustring &path); 00090 00095 bool process_export(const Glib::ustring &path); 00096 00098 void on_new(); 00099 00101 void on_save(); 00102 00104 void on_save_as(); 00105 00107 void on_export(); 00108 00112 void on_quick_export(const Glib::ustring &path); 00113 00115 void on_open(); 00116 00120 void on_open_recent(const Glib::ustring &path); 00121 00123 void on_quit(); 00124 00126 void on_edit_find_in_blocks(); 00127 00129 void on_script_insert_dialogue(); 00130 00132 void on_script_insert_trigger(const Glib::ustring &trigger); 00133 00135 void on_script_change_text_color(); 00136 00138 void on_script_change_text_speed(); 00139 00141 void on_case_add_char(); 00142 00144 void on_case_browse_chars(); 00145 00147 void on_case_manage_testimonies(); 00148 00150 void on_case_edit_locations(); 00151 00153 void on_case_edit_overview(); 00154 00156 void on_case_change_initial_block(); 00157 00159 void on_case_customize(); 00160 00162 void on_assets_manage_audio(); 00163 00165 void on_assets_manage_bg(); 00166 00168 void on_assets_manage_evidence(); 00169 00171 void on_assets_manage_images(); 00172 00174 void on_tools_sprite_editor(); 00175 00177 void on_help_about(); 00178 00179 // menu stuff 00180 Glib::RefPtr<Gtk::ActionGroup> m_ActionGroup; 00181 Glib::RefPtr<Gtk::UIManager> m_UIManager; 00182 Gtk::Menu *m_RecentMenu; 00183 00185 Gtk::Statusbar *m_Statusbar; 00186 00188 ScriptWidget *m_ScriptWidget; 00189 00191 IconManager m_IconMgr; 00192 00194 Gtk::Menu *m_QExportMenu; 00195 00197 SpriteEditor m_SprEditor; 00198 00200 Case::Case m_Case; 00201 00203 bool m_Saved; 00204 00206 Glib::ustring m_SavePath; 00207 00209 std::vector<StringPair> m_RecentFiles; 00210 }; 00211 00213 extern MainWindow *g_MainWnd; 00214 00215 #endif