aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk/ImageControl.cc
diff options
context:
space:
mode:
authorakir <akir>2004-09-09 21:13:10 (GMT)
committerakir <akir>2004-09-09 21:13:10 (GMT)
commitc75a7035867ca51dd425589d801add281b823267 (patch)
treebf33fce152f74c0049e6cc1e0438b7308d702d97 /src/FbTk/ImageControl.cc
parentdca2a55d7e554f79c4466c3098910e947aea0d1c (diff)
downloadfluxbox-c75a7035867ca51dd425589d801add281b823267.zip
fluxbox-c75a7035867ca51dd425589d801add281b823267.tar.bz2
tiny cleanup to avoid calling unnecessary FbTk::App::instance()
Diffstat (limited to 'src/FbTk/ImageControl.cc')
-rw-r--r--src/FbTk/ImageControl.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/FbTk/ImageControl.cc b/src/FbTk/ImageControl.cc
index b06b623..e89b2cb 100644
--- a/src/FbTk/ImageControl.cc
+++ b/src/FbTk/ImageControl.cc
@@ -22,7 +22,7 @@
22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23// DEALINGS IN THE SOFTWARE. 23// DEALINGS IN THE SOFTWARE.
24 24
25// $Id: ImageControl.cc,v 1.14 2004/08/31 15:26:39 rathnor Exp $ 25// $Id: ImageControl.cc,v 1.15 2004/09/09 21:13:10 akir Exp $
26 26
27#include "ImageControl.hh" 27#include "ImageControl.hh"
28 28
@@ -139,13 +139,15 @@ ImageControl::~ImageControl() {
139 delete [] grad_ybuffer; 139 delete [] grad_ybuffer;
140 } 140 }
141 141
142 Display *disp = FbTk::App::instance()->display();
143
142 if (m_colors) { 144 if (m_colors) {
143 unsigned long *pixels = new unsigned long [m_num_colors]; 145 unsigned long *pixels = new unsigned long [m_num_colors];
144 146
145 for (unsigned int color = 0; color < m_num_colors; color++) 147 for (unsigned int color = 0; color < m_num_colors; color++)
146 *(pixels + color) = (*(m_colors + color)).pixel; 148 *(pixels + color) = (*(m_colors + color)).pixel;
147 149
148 XFreeColors(FbTk::App::instance()->display(), m_colormap, pixels, m_num_colors, 0); 150 XFreeColors(disp, m_colormap, pixels, m_num_colors, 0);
149 151
150 delete [] m_colors; 152 delete [] m_colors;
151 } 153 }
@@ -153,7 +155,6 @@ ImageControl::~ImageControl() {
153 if (cache.size() > 0) { 155 if (cache.size() > 0) {
154 CacheList::iterator it = cache.begin(); 156 CacheList::iterator it = cache.begin();
155 CacheList::iterator it_end = cache.end(); 157 CacheList::iterator it_end = cache.end();
156 Display *disp = FbTk::App::instance()->display();
157 for (; it != it_end; ++it) { 158 for (; it != it_end; ++it) {
158 XFreePixmap(disp, (*it)->pixmap); 159 XFreePixmap(disp, (*it)->pixmap);
159 delete (*it); 160 delete (*it);
@@ -190,6 +191,7 @@ Pixmap ImageControl::searchCache(unsigned int width, unsigned int height,
190 tmp.pixel1 = text.color().pixel(); 191 tmp.pixel1 = text.color().pixel();
191 tmp.pixel2 = text.colorTo().pixel(); 192 tmp.pixel2 = text.colorTo().pixel();
192 */ 193 */
194
193 CacheList::iterator it = cache.begin(); 195 CacheList::iterator it = cache.begin();
194 CacheList::iterator it_end = cache.end(); 196 CacheList::iterator it_end = cache.end();
195 for (; it != it_end; ++it) { 197 for (; it != it_end; ++it) {