aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk/ImageControl.cc
diff options
context:
space:
mode:
authorsimonb <simonb>2006-03-26 04:02:30 (GMT)
committersimonb <simonb>2006-03-26 04:02:30 (GMT)
commitaf74a2284551c8511b66d77112c7bf32831c1522 (patch)
tree35a8830352f5facc1fc9c58b82c0c6dce8fc921e /src/FbTk/ImageControl.cc
parent872f6a0e1e4230f702ad69fa2d7e10a2fa78b7a3 (diff)
downloadfluxbox_pavel-af74a2284551c8511b66d77112c7bf32831c1522.zip
fluxbox_pavel-af74a2284551c8511b66d77112c7bf32831c1522.tar.bz2
rotated fonts, buttons, containers. Used for tabs for now
Diffstat (limited to 'src/FbTk/ImageControl.cc')
-rw-r--r--src/FbTk/ImageControl.cc16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/FbTk/ImageControl.cc b/src/FbTk/ImageControl.cc
index 8f05c5d..902bd55 100644
--- a/src/FbTk/ImageControl.cc
+++ b/src/FbTk/ImageControl.cc
@@ -166,7 +166,7 @@ ImageControl::~ImageControl() {
166 166
167 167
168Pixmap ImageControl::searchCache(unsigned int width, unsigned int height, 168Pixmap ImageControl::searchCache(unsigned int width, unsigned int height,
169 const Texture &text) const { 169 const Texture &text, FbTk::Orientation orient) const {
170 170
171 if (text.pixmap().drawable() != None) { 171 if (text.pixmap().drawable() != None) {
172 // do comparsion with width/height and texture_pixmap 172 // do comparsion with width/height and texture_pixmap
@@ -174,7 +174,9 @@ Pixmap ImageControl::searchCache(unsigned int width, unsigned int height,
174 CacheList::iterator it_end = cache.end(); 174 CacheList::iterator it_end = cache.end();
175 for (; it != it_end; ++it) { 175 for (; it != it_end; ++it) {
176 if ((*it)->texture_pixmap == text.pixmap().drawable() && 176 if ((*it)->texture_pixmap == text.pixmap().drawable() &&
177 (*it)->width == width && (*it)->height == height && 177 (*it)->orient == orient &&
178 (*it)->width == width &&
179 (*it)->height == height &&
178 (*it)->texture == text.type()) { 180 (*it)->texture == text.type()) {
179 (*it)->count++; 181 (*it)->count++;
180 return (*it)->pixmap; 182 return (*it)->pixmap;
@@ -196,6 +198,7 @@ Pixmap ImageControl::searchCache(unsigned int width, unsigned int height,
196 CacheList::iterator it_end = cache.end(); 198 CacheList::iterator it_end = cache.end();
197 for (; it != it_end; ++it) { 199 for (; it != it_end; ++it) {
198 if (((*it)->width == width) && 200 if (((*it)->width == width) &&
201 ((*it)->orient == orient) &&
199 ((*it)->height == height) && 202 ((*it)->height == height) &&
200 ((*it)->texture == text.type()) && 203 ((*it)->texture == text.type()) &&
201 ((*it)->pixel1 == text.color().pixel())) { 204 ((*it)->pixel1 == text.color().pixel())) {
@@ -217,19 +220,21 @@ Pixmap ImageControl::searchCache(unsigned int width, unsigned int height,
217 220
218 221
219Pixmap ImageControl::renderImage(unsigned int width, unsigned int height, 222Pixmap ImageControl::renderImage(unsigned int width, unsigned int height,
220 const FbTk::Texture &texture) { 223 const FbTk::Texture &texture,
224 FbTk::Orientation orient) {
221 225
222 if (texture.type() & FbTk::Texture::PARENTRELATIVE) 226 if (texture.type() & FbTk::Texture::PARENTRELATIVE)
223 return ParentRelative; 227 return ParentRelative;
224 228
225 // search cache first 229 // search cache first
226 Pixmap pixmap = searchCache(width, height, texture); 230 Pixmap pixmap = searchCache(width, height, texture, orient);
227 if (pixmap) { 231 if (pixmap) {
228 return pixmap; // return cache item 232 return pixmap; // return cache item
229 } 233 }
230 234
231 // render new image 235 // render new image
232 TextureRender image(*this, width, height, m_colors, m_num_colors); 236
237 TextureRender image(*this, width, height, orient, m_colors, m_num_colors);
233 pixmap = image.render(texture); 238 pixmap = image.render(texture);
234 239
235 if (pixmap) { 240 if (pixmap) {
@@ -239,6 +244,7 @@ Pixmap ImageControl::renderImage(unsigned int width, unsigned int height,
239 244
240 tmp->pixmap = pixmap; 245 tmp->pixmap = pixmap;
241 tmp->texture_pixmap = texture.pixmap().drawable(); 246 tmp->texture_pixmap = texture.pixmap().drawable();
247 tmp->orient = orient;
242 tmp->width = width; 248 tmp->width = width;
243 tmp->height = height; 249 tmp->height = height;
244 tmp->count = 1; 250 tmp->count = 1;