cosmetic + avoid unneeded App::instance()->display() calls

This commit is contained in:
akir 2004-09-10 16:41:30 +00:00
parent a90fe37f9a
commit df0c942aa2
2 changed files with 41 additions and 45 deletions

View file

@ -22,7 +22,7 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// $Id: ImageControl.cc,v 1.15 2004/09/09 21:13:10 akir Exp $ // $Id: ImageControl.cc,v 1.16 2004/09/10 16:41:30 akir Exp $
#include "ImageControl.hh" #include "ImageControl.hh"
@ -343,10 +343,10 @@ void ImageControl::getGradientBuffers(unsigned int w,
void ImageControl::installRootColormap() { void ImageControl::installRootColormap() {
XGrabServer(FbTk::App::instance()->display());
Display *disp = FbTk::App::instance()->display(); Display *disp = FbTk::App::instance()->display();
XGrabServer(disp);
bool install = true; bool install = true;
int i = 0, ncmap = 0; int i = 0, ncmap = 0;
Colormap *cmaps = Colormap *cmaps =
@ -364,7 +364,7 @@ void ImageControl::installRootColormap() {
XFree(cmaps); XFree(cmaps);
} }
XUngrabServer(FbTk::App::instance()->display()); XUngrabServer(disp);
} }

View file

@ -20,7 +20,7 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// $Id: MenuIcon.cc,v 1.1 2004/06/07 22:28:39 fluxgen Exp $ // $Id: MenuIcon.cc,v 1.2 2004/09/10 16:37:54 akir Exp $
#include "MenuIcon.hh" #include "MenuIcon.hh"
@ -57,6 +57,7 @@ void MenuIcon::draw(FbDrawable &drawable,
int x, int y, int x, int y,
unsigned int width, unsigned int height) const { unsigned int width, unsigned int height) const {
Display *disp = FbTk::App::instance()->display();
if (height - 2*theme.bevelWidth() != m_pixmap.height() && if (height - 2*theme.bevelWidth() != m_pixmap.height() &&
!m_filename.empty()) { !m_filename.empty()) {
unsigned int scale_size = height - 2*theme.bevelWidth(); unsigned int scale_size = height - 2*theme.bevelWidth();
@ -68,11 +69,8 @@ void MenuIcon::draw(FbDrawable &drawable,
GC gc = theme.frameTextGC().gc(); GC gc = theme.frameTextGC().gc();
// enable clip mask // enable clip mask
XSetClipMask(FbTk::App::instance()->display(), XSetClipMask(disp, gc, m_mask.drawable());
gc, XSetClipOrigin(disp, gc, x + theme.bevelWidth(), y + theme.bevelWidth());
m_mask.drawable());
XSetClipOrigin(FbTk::App::instance()->display(),
gc, x + theme.bevelWidth(), y + theme.bevelWidth());
drawable.copyArea(m_pixmap.drawable(), drawable.copyArea(m_pixmap.drawable(),
gc, gc,
@ -81,9 +79,7 @@ void MenuIcon::draw(FbDrawable &drawable,
m_pixmap.width(), m_pixmap.height()); m_pixmap.width(), m_pixmap.height());
// restore clip mask // restore clip mask
XSetClipMask(FbTk::App::instance()->display(), XSetClipMask(disp, gc, None);
gc,
None);
} }
FbTk::MenuItem::draw(drawable, theme, highlight, x, y, width, height); FbTk::MenuItem::draw(drawable, theme, highlight, x, y, width, height);
} }