diff options
Diffstat (limited to 'src/FbTk/Image.hh')
-rw-r--r-- | src/FbTk/Image.hh | 30 |
1 files changed, 8 insertions, 22 deletions
diff --git a/src/FbTk/Image.hh b/src/FbTk/Image.hh index acb5879..3c731ad 100644 --- a/src/FbTk/Image.hh +++ b/src/FbTk/Image.hh | |||
@@ -32,37 +32,24 @@ class ImageBase; | |||
32 | class PixmapWithMask; | 32 | class PixmapWithMask; |
33 | 33 | ||
34 | /// loads images | 34 | /// loads images |
35 | class Image { | 35 | namespace Image { |
36 | public: | ||
37 | |||
38 | /// called at FbTk::App creation time, init some internal stuff | ||
39 | static void init(); | ||
40 | |||
41 | /// called at FbTk:App destruction time, frees stuff allocated by init() | ||
42 | static void shutdown(); | ||
43 | 36 | ||
44 | /// @return an instance of PixmapWithMask on success, 0 on failure | 37 | /// @return an instance of PixmapWithMask on success, 0 on failure |
45 | static PixmapWithMask *load(const std::string &filename, int screen_num); | 38 | PixmapWithMask *load(const std::string &filename, int screen_num); |
46 | /// for register file type and imagebase | 39 | /// for register file type and imagebase |
47 | /// @return false on failure | 40 | /// @return false on failure |
48 | static bool registerType(const std::string &type, ImageBase &base); | 41 | bool registerType(const std::string &type, ImageBase &base); |
49 | /// removes a imagebase class from register | 42 | /// removes a imagebase class from register |
50 | /// @return false on failure | 43 | /// @return false on failure |
51 | static void remove(ImageBase &base); | 44 | void remove(ImageBase &base); |
52 | /// adds a path to search images from | 45 | /// adds a path to search images from |
53 | static void addSearchPath(const std::string &search_path); | 46 | void addSearchPath(const std::string &search_path); |
54 | /// removes a path to search images from | 47 | /// removes a path to search images from |
55 | static void removeSearchPath(const std::string &search_path); | 48 | void removeSearchPath(const std::string &search_path); |
56 | /// adds a path to search images from | 49 | /// adds a path to search images from |
57 | static void removeAllSearchPaths(); | 50 | void removeAllSearchPaths(); |
58 | /// locates an image in the search path | 51 | /// locates an image in the search path |
59 | static std::string locateFile(const std::string &filename); | 52 | std::string locateFile(const std::string &filename); |
60 | private: | ||
61 | typedef std::map<std::string, ImageBase *> ImageMap; | ||
62 | typedef std::list<std::string> StringList; | ||
63 | |||
64 | static ImageMap s_image_map; | ||
65 | static StringList s_search_paths; | ||
66 | }; | 53 | }; |
67 | 54 | ||
68 | /// common interface for all image classes | 55 | /// common interface for all image classes |
@@ -76,4 +63,3 @@ public: | |||
76 | 63 | ||
77 | #endif // IMAGE_HH | 64 | #endif // IMAGE_HH |
78 | 65 | ||
79 | |||