initial commit, lordsawar source, slightly modified
[lordsawar] / src / gui / city-window.h
1 //  Copyright (C) 2007 Ole Laursen
2 //  Copyright (C) 2007, 2008, 2009 Ben Asselstine
3 //
4 //  This program is free software; you can redistribute it and/or modify
5 //  it under the terms of the GNU General Public License as published by
6 //  the Free Software Foundation; either version 3 of the License, or
7 //  (at your option) any later version.
8 //
9 //  This program is distributed in the hope that it will be useful,
10 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
11 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 //  GNU Library General Public License for more details.
13 //
14 //  You should have received a copy of the GNU General Public License
15 //  along with this program; if not, write to the Free Software
16 //  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 
17 //  02110-1301, USA.
18
19 #ifndef CITY_WINDOW_H
20 #define CITY_WINDOW_H
21
22 #include <memory>
23 #include <vector>
24 #include <sigc++/trackable.h>
25 #include <gtkmm.h>
26 #include "vectormap.h"
27 #include "army-info-tip.h"
28
29 class City;
30
31 #include "decorated.h"
32 // dialog for displaying a friendly city
33 class CityWindow: public Decorated
34 {
35  public:
36     CityWindow(City *city, bool razing_possible, bool see_opponents_production);
37
38     ~CityWindow();
39
40     void set_parent_window(Gtk::Window &parent);
41
42     void run();
43     void hide();
44     
45     static bool on_raze_clicked (City *city, Gtk::Dialog *parent);
46     
47  private:
48     Gtk::Dialog* dialog;
49     VectorMap* prodmap;
50     ArmyInfoTip* army_info_tip;
51     Gtk::Image *map_image;
52     Gtk::Label *city_label;
53     Gtk::Label *status_label;
54     Gtk::Label *production_info_label1;
55     Gtk::Label *production_info_label2;
56     Gtk::Button *buy_button;
57     Gtk::Button *on_hold_button;
58     Gtk::Button *rename_button;
59     Gtk::Button *destination_button;
60     Gtk::Button *raze_button;
61     Gtk::Label *turns_left_label;
62     Gtk::Image *current_image;
63     Gtk::Label *current_label;
64
65     City *city;
66
67     bool d_razing_possible;
68     bool d_see_all;
69
70
71     Gtk::Box *production_toggles_hbox;
72     std::vector<Gtk::ToggleButton *> production_toggles;
73     bool ignore_toggles;
74
75     void fill_in_city_info();
76     void fill_in_production_toggles();
77     void fill_in_production_info();
78
79     void on_production_toggled(Gtk::ToggleButton *toggle);
80     bool on_production_button_event(GdkEventButton *e, Gtk::ToggleButton *toggle);
81     void on_on_hold_clicked();
82     void on_buy_clicked();
83     void on_destination_clicked();
84     void on_map_changed(Glib::RefPtr<Gdk::Pixmap> map);
85     bool on_map_mouse_button_event(GdkEventButton *e);
86     void on_rename_clicked ();
87     void on_raze_clicked ();
88 };
89
90 #endif