00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef FBTK_IMAGE_HH
00025 #define FBTK_IMAGE_HH
00026
00027 #include <string>
00028 #include <list>
00029 #include <map>
00030
00031 namespace FbTk {
00032
00033 class ImageBase;
00034 class PixmapWithMask;
00035
00037 class Image {
00038 public:
00040 static PixmapWithMask *load(const std::string &filename, int screen_num);
00043 static bool registerType(const std::string &type, ImageBase &base);
00046 static void remove(ImageBase &base);
00048 static void addSearchPath(const std::string &search_path);
00050 static void removeSearchPath(const std::string &search_path);
00052 static void removeAllSearchPaths();
00053 private:
00054 typedef std::map<std::string, ImageBase *> ImageMap;
00055 typedef std::list<std::string> StringList;
00056
00057 static ImageMap s_image_map;
00058 static StringList s_search_paths;
00059 };
00060
00062 class ImageBase {
00063 public:
00064 virtual ~ImageBase() { Image::remove(*this); }
00065 virtual PixmapWithMask *load(const std::string &name, int screen_num) const = 0;
00066 };
00067
00068 }
00069
00070 #endif // IMAGE_HH
00071
00072