initial commit, lordsawar source, slightly modified
[lordsawar] / src / editor / tile-preview-dialog.h
1 //  Copyright (C) 2008, 2009 Ben Asselstine
2 //
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.
7 //
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.
12 //
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 
16 //  02110-1301, USA.
17
18 #ifndef TILE_PREVIEW_DIALOG_H
19 #define TILE_PREVIEW_DIALOG_H
20
21 #include <memory>
22 #include <sigc++/trackable.h>
23 #include <gtkmm.h>
24 #include "Tile.h"
25 #include "tile-preview-scene.h"
26
27
28 //! Tile Preview Dialog.  Shows completeness and correctness of tilesets.
29 class TilePreviewDialog: public sigc::trackable
30 {
31  public:
32     TilePreviewDialog(Tile *tile, guint32 tileSize);
33     ~TilePreviewDialog();
34
35     void set_parent_window(Gtk::Window &parent);
36
37     void run();
38     
39  private:
40     Tile *d_tile;
41     Gtk::Dialog* dialog;
42     Gtk::Button *next_button;
43     Gtk::Button *previous_button;
44     Gtk::Button *refresh_button;
45     Gtk::Image *preview_image;
46
47     std::vector<PixMask* > tilestyle_images;
48
49     void on_next_clicked();
50     void on_previous_clicked();
51     void on_refresh_clicked();
52     void update_buttons();
53     void update_scene(TilePreviewScene *scene);
54     std::list<TilePreviewScene*> scenes;
55     std::list<TilePreviewScene*>::iterator current_scene;
56     guint32 d_tileSize;
57 };
58
59 #endif