EditorWindow.h

Go to the documentation of this file.
00001 
00005 /* Copyright © 2009, 2010 James Legg.
00006     This program is free software: you can redistribute it and/or modify
00007     it under the terms of the GNU General Public License as published by
00008     the Free Software Foundation, either version 3 of the License, or
00009     (at your option) any later version.
00010 */
00011 #ifndef EDITORWINDOW_H_
00012 #define EDITORWINDOW_H_
00013 
00014 #include <boost/shared_ptr.hpp>
00015 
00016 #include <gtkmm/window.h>
00017 #include <gtkmm/box.h>
00018 #include <glibmm/refptr.h>
00019 #include <gtkmm/actiongroup.h>
00020 #include <gtkmm/uimanager.h>
00021 #include <gtkmm/statusbar.h>
00022 #include <gtkmm/paned.h>
00023 #include <gtkmm/frame.h>
00024 #include <gtkmm/toggleaction.h>
00025 
00026 #include "NewForm.h"
00027 #include "Viewport.h"
00028 #include "EditorGuide.h"
00029 #include "LightingWindow.h"
00030 #include <libtrack/document/Document.h>
00031 
00037 class EditorWindow : public Gtk::Window
00038 {
00039 public:
00045     EditorWindow(bool show_guide, std::string filename = std::string());
00046     virtual ~EditorWindow();
00052     EditorWindow (EditorWindow & source);
00053 protected:
00055     void assemble_ui();
00056     
00058     Gtk::VBox m_box;
00060     Gtk::Statusbar m_status_bar;
00061     // action stuff
00062     Glib::RefPtr<Gtk::ActionGroup> m_ref_action_group; 
00063     Glib::RefPtr<Gtk::UIManager> m_ref_ui_manager;
00064     Glib::RefPtr<Gtk::ToggleAction> m_ref_action_guide;
00065     
00067     NewForm m_new_form;
00068     
00070     EditorGuide m_guide;
00071     
00073     LightingWindow m_lighting_window;
00074     
00075     Viewport m_viewport_top;
00076     
00077     // do commands when activated (through toolbar, menu, or keyboard shortcut).
00078     // file menu commands
00079     void on_action_file_new();
00080     void on_action_file_open();
00081     void on_action_file_save();
00082     void on_action_file_save_as();
00083     void on_action_file_test();
00084     void on_action_file_quit();
00085     // edit menu commands
00086     void on_action_edit_undo();
00087     void on_action_edit_redo();
00088     void on_action_edit_cut();
00089     void on_action_edit_copy();
00090     void on_action_edit_paste();
00091     void on_action_edit_select_all();
00092     void on_action_edit_delete();
00093     void on_action_edit_lighting();
00094     // view commands
00095     void on_action_view_zoom_in();
00096     void on_action_view_zoom_out();
00097     void on_action_view_zoom_to_fit();
00098     void on_action_view_top();
00099     void on_action_view_front();
00100     void on_action_view_side();
00101     void on_action_view_new_window();
00102     
00103     // help commands
00104     void on_action_help_guide();
00105     void on_action_help_wiki();
00106     void on_action_help_about();
00107     
00109     void on_theme_picked(std::string filename);
00110     
00112     void on_lighting_changed();
00113     
00115     void on_command_run();
00116     
00118     void on_view_command(boost::shared_ptr<Document::DocumentDelta> delta);
00119     
00121     void on_view_preview_command(boost::shared_ptr<Document::DocumentDelta> delta);
00122     
00124     void on_view_preview_cancel();
00125     
00127     virtual bool on_delete_event(GdkEventAny* event);
00128 
00129     
00136     bool check_clear_document();
00137     
00139     void load_theme(std::string filename);
00140     
00142     void show_editor();
00143     
00145     void open_file(std::string filename);
00146     
00147     boost::shared_ptr<Track::Theme>  m_theme;
00148     boost::shared_ptr<Document::Document> m_document;
00149     
00151     bool filename_set;
00152     
00154     std::string filename;
00155     
00157     std::string theme_filename;
00158     
00160     std::string accel_filename;
00161     
00162     bool m_guide_preference;
00163 };
00164 
00165 #endif /*EDITORWINDOW_H_*/

Get Racer at SourceForge.net. Fast, secure and Free Open Source software downloads

Generated at Mon Sep 6 00:41:13 2010 by Doxygen version 1.4.7 for Racer version svn335.