!XT (BREAK-16) (Sandbox) Remove double-newlines at the end of files.
[CRYENGINE.git] / Code / Sandbox / Plugins / EditorCommon / Serialization / QPropertyTree / IconXPMCache.h
blob0093965887a1d4e9a05f8b98a7ae91235c13802f
1 /**
2 * yasli - Serialization Library.
3 * Copyright (C) 2007-2013 Evgeny Andreeshchev <eugene.andreeshchev@gmail.com>
4 * Alexander Kotliar <alexander.kotliar@gmail.com>
5 *
6 * This code is distributed under the MIT License:
7 * http://www.opensource.org/licenses/MIT
8 */
10 #pragma once
12 #include <map>
13 #include <vector>
14 #include "Serialization/PropertyTree/Color.h"
15 #include "Serialization/PropertyTree/IDrawContext.h"
16 #include "Serialization/PropertyTree/Rect.h"
18 class QPainter;
19 class QImage;
20 class QBrush;
21 class QRect;
22 class QColor;
23 class QFont;
24 namespace yasli { struct IconXPM; }
26 namespace property_tree {
27 struct RGBAImage;
28 struct Color;
30 struct IconXPMCache
32 void initialize();
33 void finalize();
34 void flush();
36 ~IconXPMCache();
38 QImage* getImageForIcon(const Icon& icon);
39 private:
40 struct BitmapCache {
41 std::vector<Color> pixels;
42 QImage* bitmap;
45 static bool parseXPM(RGBAImage* out, const yasli::IconXPM& xpm);
46 typedef std::map<const char* const*, BitmapCache> XPMToBitmap;
47 XPMToBitmap xpmToImageMap_;
48 typedef std::map<yasli::string, BitmapCache> FilenameToBitmap;
49 FilenameToBitmap filenameToImageMap_;