X-Git-Url: http://git.maemo.org/git/?p=lordsawar;a=blobdiff_plain;f=src%2Feditor%2Fshieldset-window.h;fp=src%2Feditor%2Fshieldset-window.h;h=98e0551645154153e267a83d31e0a234cdb842c1;hp=0000000000000000000000000000000000000000;hb=9eda00ff73353c55ecef6f82131166d5d4a85e29;hpb=3d34d4aa85a929f912464f71158396a388274f27;ds=sidebyside diff --git a/src/editor/shieldset-window.h b/src/editor/shieldset-window.h new file mode 100644 index 0000000..98e0551 --- /dev/null +++ b/src/editor/shieldset-window.h @@ -0,0 +1,99 @@ +// Copyright (C) 2007, 2008, 2009 Ben Asselstine +// +// This program 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 3 of the License, or +// (at your option) any later version. +// +// This program 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 Library General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +// 02110-1301, USA. + +#ifndef GUI_SHIELDSET_WINDOW_H +#define GUI_SHIELDSET_WINDOW_H + +#include +#include +#include +#include +#include + +#include "shield.h" +#include "shieldset.h" +#include "shield.h" + +//! Shieldset Editor. Edit an Shieldset. +class ShieldSetWindow: public sigc::trackable +{ + public: + ShieldSetWindow(std::string load_filename = ""); + ~ShieldSetWindow(); + + void show(); + void hide(); + + Gtk::Window &get_window() { return *window; } + + private: + Gtk::Window* window; + std::string current_save_filename; + Shieldset *d_shieldset; //current shieldset + Shield *d_shield; //current shield + bool needs_saving; + Gtk::TreeView *shields_treeview; + Gtk::MenuItem *new_shieldset_menuitem; + Gtk::MenuItem *load_shieldset_menuitem; + Gtk::MenuItem *save_shieldset_menuitem; + Gtk::MenuItem *validate_shieldset_menuitem; + Gtk::MenuItem *edit_shieldset_info_menuitem; + Gtk::MenuItem *quit_menuitem; + Gtk::MenuItem *help_about_menuitem; + Gtk::Frame *shield_frame; + Gtk::Button *change_smallpic_button; + Gtk::Button *change_mediumpic_button; + Gtk::Button *change_largepic_button; + Gtk::ColorButton *player_colorbutton; + + class ShieldsColumns: public Gtk::TreeModelColumnRecord { + public: + ShieldsColumns() + { add(name); add(shield);} + + Gtk::TreeModelColumn name; + Gtk::TreeModelColumn shield; + }; + const ShieldsColumns shields_columns; + Glib::RefPtr shields_list; + + void on_new_shieldset_activated(); + void on_load_shieldset_activated(); + void on_save_shieldset_activated(); + void on_validate_shieldset_activated(); + void on_quit_activated(); + bool on_delete_event(GdkEventAny *e); + bool on_window_closed(GdkEventAny*); + void on_edit_shieldset_info_activated(); + void on_help_about_activated(); + void on_shield_selected(); + void on_change_smallpic_clicked(); + void on_change_mediumpic_clicked(); + void on_change_largepic_clicked(); + void on_player_color_changed(); + + void fill_shield_info(Shield *shield); + void load_shieldset(std::string filename); + void update_shield_panel(); + void update_shieldset_menuitems(); + bool quit(); + + void addNewShield(Shield::Colour owner, Gdk::Color colour); + void loadShield(Shield *shield); +}; + +#endif