diff options
author | Mathias Gumz <akira at fluxbox dot org> | 2008-01-14 22:27:00 (GMT) |
---|---|---|
committer | Mathias Gumz <akira at fluxbox dot org> | 2008-01-14 22:27:00 (GMT) |
commit | e1db89e2d7d56afca5335550ee1c9ff87fd54ba4 (patch) | |
tree | 779b52814dedd08eb56d1875cb2f97bbcdd39e8b /src/FbTk/ImageControl.cc | |
parent | c6099d777d844699fb8a4243921159898bc4f45c (diff) | |
download | fluxbox-e1db89e2d7d56afca5335550ee1c9ff87fd54ba4.zip fluxbox-e1db89e2d7d56afca5335550ee1c9ff87fd54ba4.tar.bz2 |
moved code a bit around, cleaned up some classes
Diffstat (limited to 'src/FbTk/ImageControl.cc')
-rw-r--r-- | src/FbTk/ImageControl.cc | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/src/FbTk/ImageControl.cc b/src/FbTk/ImageControl.cc index 1281b56..1fa2f65 100644 --- a/src/FbTk/ImageControl.cc +++ b/src/FbTk/ImageControl.cc | |||
@@ -25,6 +25,7 @@ | |||
25 | #include "ImageControl.hh" | 25 | #include "ImageControl.hh" |
26 | 26 | ||
27 | #include "TextureRender.hh" | 27 | #include "TextureRender.hh" |
28 | #include "Texture.hh" | ||
28 | #include "App.hh" | 29 | #include "App.hh" |
29 | #include "SimpleCommand.hh" | 30 | #include "SimpleCommand.hh" |
30 | #include "I18n.hh" | 31 | #include "I18n.hh" |
@@ -67,15 +68,17 @@ using std::list; | |||
67 | 68 | ||
68 | namespace FbTk { | 69 | namespace FbTk { |
69 | 70 | ||
70 | // lookup table for texture | 71 | namespace { // anonymous |
71 | unsigned long *ImageControl::sqrt_table = 0; | 72 | |
73 | static unsigned long *sqrt_table = 0; /// lookup table | ||
74 | |||
72 | #ifdef TIMEDCACHE | 75 | #ifdef TIMEDCACHE |
73 | bool ImageControl::s_timed_cache = true; | 76 | bool s_timed_cache = true; |
74 | #else | 77 | #else |
75 | bool ImageControl::s_timed_cache = false; | 78 | bool s_timed_cache = false; |
76 | #endif // TIMEDCACHE | 79 | #endif // TIMEDCACHE |
77 | 80 | ||
78 | namespace { // anonymous | 81 | |
79 | 82 | ||
80 | inline unsigned long bsqrt(unsigned long x) { | 83 | inline unsigned long bsqrt(unsigned long x) { |
81 | if (x <= 0) return 0; | 84 | if (x <= 0) return 0; |
@@ -93,6 +96,14 @@ inline unsigned long bsqrt(unsigned long x) { | |||
93 | 96 | ||
94 | }; // end anonymous namespace | 97 | }; // end anonymous namespace |
95 | 98 | ||
99 | struct ImageControl::Cache { | ||
100 | Pixmap pixmap; | ||
101 | Pixmap texture_pixmap; | ||
102 | Orientation orient; | ||
103 | unsigned int count, width, height; | ||
104 | unsigned long pixel1, pixel2, texture; | ||
105 | }; | ||
106 | |||
96 | ImageControl::ImageControl(int screen_num, bool dither, | 107 | ImageControl::ImageControl(int screen_num, bool dither, |
97 | int cpc, unsigned long cache_timeout, unsigned long cmax): | 108 | int cpc, unsigned long cache_timeout, unsigned long cmax): |
98 | m_dither(dither), | 109 | m_dither(dither), |
@@ -148,7 +159,7 @@ ImageControl::~ImageControl() { | |||
148 | delete [] m_colors; | 159 | delete [] m_colors; |
149 | } | 160 | } |
150 | 161 | ||
151 | if (cache.size() > 0) { | 162 | if (!cache.empty()) { |
152 | CacheList::iterator it = cache.begin(); | 163 | CacheList::iterator it = cache.begin(); |
153 | CacheList::iterator it_end = cache.end(); | 164 | CacheList::iterator it_end = cache.end(); |
154 | for (; it != it_end; ++it) { | 165 | for (; it != it_end; ++it) { |