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

This commit is contained in:
akir 2004-09-10 16:48:15 +00:00
parent df0c942aa2
commit c8f9cf1177
2 changed files with 47 additions and 60 deletions

View file

@ -19,7 +19,7 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
// $Id: MenuItem.cc,v 1.8 2004/09/01 08:00:24 akir Exp $
// $Id: MenuItem.cc,v 1.9 2004/09/10 16:48:15 akir Exp $
#include "MenuItem.hh"
#include "Command.hh"
@ -42,6 +42,8 @@ void MenuItem::draw(FbDrawable &draw,
bool highlight,
int x, int y,
unsigned int width, unsigned int height) const {
Display *disp = App::instance()->display();
//
// Icon
//
@ -58,11 +60,8 @@ void MenuItem::draw(FbDrawable &draw,
int icon_x = x + theme.bevelWidth();
int icon_y = y + theme.bevelWidth();
// enable clip mask
XSetClipMask(FbTk::App::instance()->display(),
gc,
m_icon->pixmap->mask().drawable());
XSetClipOrigin(FbTk::App::instance()->display(),
gc, icon_x, icon_y);
XSetClipMask(disp, gc, m_icon->pixmap->mask().drawable());
XSetClipOrigin(disp, gc, icon_x, icon_y);
draw.copyArea(m_icon->pixmap->pixmap().drawable(),
gc,
@ -71,9 +70,7 @@ void MenuItem::draw(FbDrawable &draw,
m_icon->pixmap->width(), m_icon->pixmap->height());
// restore clip mask
XSetClipMask(FbTk::App::instance()->display(),
gc,
None);
XSetClipMask(disp, gc, None);
}
}
@ -127,11 +124,8 @@ void MenuItem::draw(FbDrawable &draw,
// ToggleItem
//
if (isToggleItem() && theme.unselectedPixmap().pixmap().drawable() != 0) {
XSetClipMask(FbTk::App::instance()->display(),
gc,
theme.unselectedPixmap().mask().drawable());
XSetClipOrigin(FbTk::App::instance()->display(),
gc, sel_x, y);
XSetClipMask(disp, gc, theme.unselectedPixmap().mask().drawable());
XSetClipOrigin(disp, gc, sel_x, y);
// copy bullet pixmap to drawable
draw.copyArea(theme.unselectedPixmap().pixmap().drawable(),
gc,
@ -140,9 +134,7 @@ void MenuItem::draw(FbDrawable &draw,
theme.unselectedPixmap().width(),
theme.unselectedPixmap().height());
// disable clip mask
XSetClipMask(FbTk::App::instance()->display(),
gc,
None);
XSetClipMask(disp, gc, None);
}
//
@ -151,11 +143,8 @@ void MenuItem::draw(FbDrawable &draw,
if (submenu()) {
if (theme.bulletPixmap().pixmap().drawable() != 0) {
// enable clip mask
XSetClipMask(FbTk::App::instance()->display(),
gc,
theme.bulletPixmap().mask().drawable());
XSetClipOrigin(FbTk::App::instance()->display(),
gc, sel_x, y);
XSetClipMask(disp, gc, theme.bulletPixmap().mask().drawable());
XSetClipOrigin(disp, gc, sel_x, y);
// copy bullet pixmap to frame
draw.copyArea(theme.bulletPixmap().pixmap().drawable(),
gc,
@ -164,9 +153,7 @@ void MenuItem::draw(FbDrawable &draw,
theme.bulletPixmap().width(),
theme.bulletPixmap().height());
// disable clip mask
XSetClipMask(FbTk::App::instance()->display(),
gc,
None);
XSetClipMask(disp, gc, None);
} else {
unsigned int half_w = height / 2, quarter_w = height / 4;
int sel_y = y + height/4;

View file

@ -19,7 +19,7 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
// $Id: Transparent.cc,v 1.6 2004/06/07 11:46:05 rathnor Exp $
// $Id: Transparent.cc,v 1.7 2004/09/10 16:48:15 akir Exp $
#include "Transparent.hh"
#include "App.hh"