/* Copyright 2005 Nicholas Bishop This file is part of SharpConstruct. SharpConstruct is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. SharpConstruct is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with SharpConstruct; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef MAINWINDOW_HH #define MAINWINDOW_HH #include "Deformations.hh" #include "Editor.hh" #include "InputDialog.hh" #include #include #include #include #include namespace Gtk { class Main; } namespace SharpConstruct { namespace GInterface { class MainWindow { public: MainWindow(); void Run( Gtk::Main& ); private: void add_stock_item_( const std::string&, const Glib::ustring&, const Glib::ustring&, const Gdk::ModifierType, const unsigned ); void add_stock_item_( const std::string&, const Glib::ustring&, const Glib::ustring& ); void init_actions_(); void connect_handlers_(); void init_brushes_(); void initialize_(); void update_model_info_(); // Handlers void create_model_(); bool is_mesh_data_safe_(); void new_model_(); void on_background_color_set_(); void on_brush_add_(); void on_brush_sub_(); void on_brush_shape_add_clicked_(); void on_brush_shape_remove_clicked_(); void on_decrease_size_clicked_(); bool on_delete_event_( GdkEventAny* ); void on_history_changed_(); void on_increase_size_clicked_(); void on_undo_clicked_(); void on_quit_(); void on_redo_clicked_(); void on_sidebar_toggled_(); void on_speed_test_clicked_(); void on_undo_steps_value_changed_(); void open_model_(); void save_model_(); void save_model_as_(); void update_brush_(); void update_brush_preview_(); void update_brush_sensitivities_(); void update_brush_shape_(); void update_graphics_mode_settings_(); void update_input_settings_(); Glib::RefPtr< Gnome::Glade::Xml > glade_; // Non-Glade controls Glib::RefPtr< Gtk::IconFactory > icon_factory_; Glib::RefPtr< Gtk::UIManager > ui_manager_; Glib::RefPtr< Gtk::ActionGroup > action_group_; Deformations deformations_; Editor editor_; InputDialog input_dialog_; // For the shape selector Glib::RefPtr< Gdk::Pixbuf > brush_shape_; class BrushShapeColumns : public Gtk::TreeModelColumnRecord { public: Gtk::TreeModelColumn< Glib::ustring > Name; Gtk::TreeModelColumn< Glib::RefPtr< Gdk::Pixbuf > > Icon; Gtk::TreeModelColumn< Glib::RefPtr< Gdk::Pixbuf > > Shape; BrushShapeColumns() { add( Name ); add( Icon ); add( Shape ); } }; const BrushShapeColumns brush_shape_columns_; Glib::RefPtr brush_shape_model_; }; } } #endif