initial commit, lordsawar source, slightly modified
[lordsawar] / src / editor / tile-preview-scene.h
1 //  Copyright (C) 2008 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 #ifndef TILE_PREVIEW_SCENE_H
18 #define TILE_PREVIEW_SCENE_H
19
20 #include <memory>
21 #include <sigc++/trackable.h>
22 #include <gtkmm.h>
23 #include "Tile.h"
24 #include "tilestyle.h"
25 #include <list>
26 #include <vector>
27 #include <string>
28
29 class TilePreviewScene: public sigc::trackable
30 {
31 public:
32   TilePreviewScene (Tile *tile, 
33                     std::vector<PixMask*> standard_images, 
34                     guint32 height, guint32 width, 
35                     std::string scene);
36   void regenerate();
37   Glib::RefPtr<Gdk::Pixbuf> getTileStylePixbuf(int x, int y);
38   TileStyle* getTileStyle(int x, int y);
39   int getWidth() {return d_width;}
40   int getHeight() {return d_height;}
41   Tile *getTile() {return d_tile;}
42   Glib::RefPtr<Gdk::Pixbuf> renderScene(guint32 tilesize);
43 private:
44   //data:
45     std::list<TileStyle::Type> d_model;
46     std::vector<Glib::RefPtr<Gdk::Pixbuf> > d_view;
47     std::vector<TileStyle*> d_tilestyles;
48     guint32 d_height;
49     guint32 d_width;
50     Tile *d_tile;
51     std::vector<PixMask*> d_standard_images;
52 };
53
54 #endif