1 // Copyright (C) 2007, 2008, 2009 Ben Asselstine
3 // This program is free software; you can redistribute it and/or modify
4 // it under the terms of the GNU General Public License as published by
5 // the Free Software Foundation; either version 3 of the License, or
6 // (at your option) any later version.
8 // This program is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 // GNU Library General Public License for more details.
13 // You should have received a copy of the GNU General Public License
14 // along with this program; if not, write to the Free Software
15 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21 #include <sigc++/signal.h>
23 #include "overviewmap.h"
24 #include "input-events.h"
25 #include "NamedLocation.h"
29 //! Draw the ruins and temples onto a miniature map graphic.
31 * This method draws Ruin and Temple objects onto a miniature map graphic.
32 * The ruins and temples are depicted with icons instead of little white dots.
34 * The RuinMap is interactive. Each Ruin and Temple is selectable with the
37 class RuinMap : public OverviewMap
40 //! Default constructor. Make a new RuinMap.
42 * @param ruin The Ruin or Temple object that is selected initially when
43 * the miniature map graphic is created.
45 RuinMap(NamedLocation *ruin);
49 //! Change the Ruin or Temple object that is currently selected.
50 void setNamedLocation (NamedLocation *r) {ruin = r;}
55 //! Return the Ruin or Temple object that is currently selected.
56 NamedLocation * getNamedLocation () const {return ruin;}
59 // Methods that operate on the class data and modify the class.
61 //! Realize the given mouse button event.
62 void mouse_button_event(MouseButtonEvent e);
67 //! Emitted when a new Ruin or Temple object has been clicked.
68 sigc::signal<void, NamedLocation *> location_changed;
70 //! Emitted when the objects are finished being drawn on the map surface.
72 * Classes that use RuinMap must catch this signal to display the map.
74 sigc::signal<void, Glib::RefPtr<Gdk::Pixmap> > map_changed;
77 //! Draw the Ruin objects on the map.
79 * @param show_selected Whether or not to draw a box around a Ruin object
80 * that is the selected object (RuinMap::ruin).
82 void draw_ruins (bool show_selected);
84 //! Draw the Temple objects on the map.
86 * @param show_selected Whether or not to draw a box around a Temple object
87 * that is the selected object (RuinMap::ruin).
89 void draw_temples (bool show_selected);
91 //! Draw the Ruin and Temple objects objects onto the miniature map graphic.
93 * This method is automatically called by the RuinMap::draw method.
95 virtual void after_draw();
99 //! The currently selected Ruin or Temple object.