AC_DEFINE(TIMEDCACHE,1,Use timed pixmap cache)
fi
+dnl Check for bitmapped buttons
+BITMAPBUTTONS=""
+AC_MSG_CHECKING([whether to include bitmappable buttons])
+AC_ARG_ENABLE(
+ bitmap-buttons,
+[ --enable-bitmap-buttons include bitmappable buttons [default=yes]],
+ if test x$enableval = "xyes"; then
+ AC_MSG_RESULT([yes])
+ BITMAPBUTTONS="yes"
+ else
+ AC_MSG_RESULT([no])
+ fi,
+ AC_MSG_RESULT([yes])
+ BITMAPBUTTONS="yes"
+)
+if test x$BITMAPBUTTONS = "xyes"; then
+ AC_DEFINE(BITMAPBUTTONS,1,Include bitmappable buttons)
+fi
+
dnl Determine the return type of signal handlers
AC_TYPE_SIGNAL
}
if (dooppsel && item->isSelected()) {
+#ifdef BITMAPBUTTONS
if ( style->tick_image.mask != None) {
XSetClipOrigin(blackbox->getXDisplay(), pen.gc(),
oppsel_x, item_y + menu.item_h/2 - style->tick_image.h/2);
XSetClipOrigin(blackbox->getXDisplay(), pen.gc(),
0, 0);
} else {
+#endif // BITMAPBUTTONS
XPoint pts[6];
pts[0].x = oppsel_x + 0;
XFillPolygon(display, menu.frame, pen.gc(), pts, 6, Nonconvex,
CoordModePrevious);
+#ifdef BITMAPBUTTONS
}
+#endif // BITMAPBUTTONS
}
if (dotext && text) {
}
if (dosel && item->submenu()) {
+#ifdef BITMAPBUTTONS
if ( style->bullet_image.mask != None) {
XSetClipOrigin(blackbox->getXDisplay(), pen.gc(),
sel_x, item_y + menu.item_h/2 - style->bullet_image.h/2);
XSetClipOrigin(blackbox->getXDisplay(), pen.gc(),
0, 0);
} else {
+#endif // BITMAPBUTTONS
const int bullet_size = 3;
switch (screen->getMenuStyle()->bullet) {
CoordModePrevious);
break;
}
+#ifdef BITMAPBUTTONS
}
+#endif // BITMAPBUTTONS
}
}
if (resource.tstyle.font)
delete resource.tstyle.font;
+#ifdef BITMAPBUTTONS
if (resource.wstyle.close_button.mask != None)
XFreePixmap(blackbox->getXDisplay(), resource.wstyle.close_button.mask);
if (resource.wstyle.max_button.mask != None)
resource.wstyle.stick_button.mask = None;
resource.tstyle.left_button.mask = resource.tstyle.right_button.mask = None;
resource.mstyle.bullet_image.mask = resource.mstyle.tick_image.mask = None;
+#endif // BITMAPBUTTONS
XFreeGC(blackbox->getXDisplay(), opGC);
}
resource.wstyle.b_pressed =
readDatabaseTexture("window.button.pressed", "black", style);
+#ifdef BITMAPBUTTONS
if (resource.wstyle.close_button.mask != None)
XFreePixmap(blackbox->getXDisplay(), resource.wstyle.close_button.mask);
if (resource.wstyle.max_button.mask != None)
style);
readDatabaseMask("window.button.stick.mask", resource.wstyle.stick_button,
style);
+#endif // BITMAPBUTTONS
// we create the window.frame texture by hand because it exists only to
// make the code cleaner and is not actually used for display
resource.wstyle.h_unfocus = resource.wstyle.f_unfocus;
// load toolbar config
+#ifdef BITMAPBUTTONS
if (resource.tstyle.left_button.mask != None)
XFreePixmap(blackbox->getXDisplay(), resource.tstyle.left_button.mask);
if (resource.tstyle.right_button.mask != None)
XFreePixmap(blackbox->getXDisplay(), resource.tstyle.right_button.mask);
+#endif // BITMAPBUTTONS
resource.tstyle.toolbar =
readDatabaseTexture("toolbar", "black", style);
readDatabaseColor("toolbar.clock.textColor", "white", style);
resource.tstyle.b_pic =
readDatabaseColor("toolbar.button.picColor", "black", style);
+
+#ifdef BITMAPBUTTONS
readDatabaseMask("toolbar.button.left.mask", resource.tstyle.left_button,
style);
readDatabaseMask("toolbar.button.right.mask", resource.tstyle.right_button,
style);
+#endif // BITMAPBUTTONS
resource.tstyle.justify = LeftJustify;
if (style.getValue("toolbar.justify", s)) {
}
// load menu config
+#ifdef BITMAPBUTTONS
if (resource.mstyle.bullet_image.mask != None)
XFreePixmap(blackbox->getXDisplay(), resource.mstyle.bullet_image.mask);
if (resource.mstyle.tick_image.mask != None)
XFreePixmap(blackbox->getXDisplay(), resource.mstyle.tick_image.mask);
+#endif // BITMAPBUTTONS
resource.mstyle.title =
readDatabaseTexture("menu.title", "white", style);
readDatabaseColor("menu.frame.disableColor", "black", style);
resource.mstyle.h_text =
readDatabaseColor("menu.hilite.textColor", "black", style);
+
+#ifdef BITMAPBUTTONS
readDatabaseMask("menu.arrow.mask", resource.mstyle.bullet_image, style);
readDatabaseMask("menu.selected.mask", resource.mstyle.tick_image, style);
+#endif // BITMAPBUTTONS
resource.mstyle.t_justify = LeftJustify;
if (style.getValue("menu.title.justify", s)) {
std::mem_fun(&BlackboxWindow::grabButtons));
}
+#ifdef BITMAPBUTTONS
void BScreen::readDatabaseMask(const string &rname, PixmapMask &pixmapMask,
const Configuration &style) {
string s;
pixmapMask.mask = None;
pixmapMask.w = pixmapMask.h = 0;
}
+#endif // BITMAPSUCCESS
BTexture BScreen::readDatabaseTexture(const string &rname,
const string &default_color,
enum TextJustify { LeftJustify = 1, RightJustify, CenterJustify };
+#ifdef BITMAPBUTTONS
struct PixmapMask {
Pixmap mask;
unsigned int w, h;
};
+#endif // BITMAPBUTTONS
struct WindowStyle {
BColor l_text_focus, l_text_unfocus, b_pic_focus,
BTexture f_focus, f_unfocus, t_focus, t_unfocus, l_focus, l_unfocus,
h_focus, h_unfocus, b_focus, b_unfocus, b_pressed, g_focus, g_unfocus;
+#ifdef BITMAPBUTTONS
PixmapMask close_button, max_button, icon_button, stick_button;
-
+#endif // BITMAPBUTTONS
BFont *font;
TextJustify justify;
BColor l_text, w_text, c_text, b_pic;
BTexture toolbar, label, window, button, pressed, clock;
- PixmapMask left_button, right_button; //these should probably be the same
+#ifdef BITMAPBUTTONS
+ PixmapMask left_button, right_button;
+#endif // BITMAPBUTTONS
BFont *font;
struct MenuStyle {
BColor t_text, f_text, h_text, d_text;
BTexture title, frame, hilite;
-
+
+#ifdef BITMAPBUTTONS
PixmapMask bullet_image, tick_image;
+#endif // BITMAPBUTTONS
BFont *t_font, *f_font;
bool parseMenuFile(FILE *file, Rootmenu *menu);
+#ifdef BITMAPBUTTONS
void readDatabaseMask(const string &rname,
PixmapMask &pixmapMask,
const Configuration &style);
+#endif // BITMAPBUTTONS
+
BTexture readDatabaseTexture(const std::string &rname,
const std::string &default_color,
const Configuration &style);
if (left) {
- if (style->left_button.mask == None) {
- pts[0].x = hw - bullet_size;
- pts[0].y = hh;
- pts[1].x = 2 * bullet_size;
- pts[1].y = bullet_size;
- pts[2].x = 0;
- pts[2].y = -(2 * bullet_size);
- XFillPolygon(display, surface, pen.gc(), pts, 3, Convex,
- CoordModePrevious);
- } else {
+#ifdef BITMAPBUTTONS
+ if (style->left_button.mask != None) {
XSetClipMask(blackbox->getXDisplay(), pen.gc(), style->left_button.mask);
XSetClipOrigin(blackbox->getXDisplay(), pen.gc(),
(frame.button_w - style->left_button.w)/2,
XSetClipMask(blackbox->getXDisplay(), pen.gc(), None);
XSetClipOrigin(blackbox->getXDisplay(), pen.gc(), 0, 0);
- }
- } else {
- if (style->right_button.mask == None) {
+ } else {
+#endif // BITMAPBUTTONS
pts[0].x = hw - bullet_size;
- pts[0].y = hh - bullet_size;
- pts[1].x = (2 * bullet_size);
- pts[1].y = bullet_size;
- pts[2].x = -(2 * bullet_size);
- pts[2].y = bullet_size;
+ pts[0].y = hh;
+ pts[1].x = 2 * bullet_size;
+ pts[1].y = bullet_size;
+ pts[2].x = 0;
+ pts[2].y = -(2 * bullet_size);
XFillPolygon(display, surface, pen.gc(), pts, 3, Convex,
CoordModePrevious);
- } else {
+#ifdef BITMAPBUTTONS
+ }
+#endif // BITMAPBUTTONS
+ } else {
+#ifdef BITMAPBUTTONS
+ if (style->right_button.mask != None) {
XSetClipMask(blackbox->getXDisplay(), pen.gc(),
style->right_button.mask);
XSetClipOrigin(blackbox->getXDisplay(), pen.gc(),
XSetClipMask(blackbox->getXDisplay(), pen.gc(), None);
XSetClipOrigin(blackbox->getXDisplay(), pen.gc(), 0, 0);
+ } else {
+#endif // BITMAPBUTTONS
+ pts[0].x = hw - bullet_size;
+ pts[0].y = hh - bullet_size;
+ pts[1].x = (2 * bullet_size);
+ pts[1].y = bullet_size;
+ pts[2].x = -(2 * bullet_size);
+ pts[2].y = bullet_size;
+ XFillPolygon(display, surface, pen.gc(), pts, 3, Convex,
+ CoordModePrevious);
+#ifdef BITMAPBUTTONS
}
+#endif
}
}
XClearWindow(blackbox->getXDisplay(), frame.iconify_button);
BPen pen((flags.focused) ? screen->getWindowStyle()->b_pic_focus :
screen->getWindowStyle()->b_pic_unfocus);
-
+#ifdef BITMAPBUTTONS
PixmapMask pm = screen->getWindowStyle()->icon_button;
if (screen->getWindowStyle()->icon_button.mask != None) {
XSetClipMask(blackbox->getXDisplay(), pen.gc(), None);
XSetClipOrigin(blackbox->getXDisplay(), pen.gc(), 0, 0);
} else {
-
+#endif // BITMAPBUTTONS
XDrawRectangle(blackbox->getXDisplay(), frame.iconify_button, pen.gc(),
2, (frame.button_w - 5), (frame.button_w - 5), 2);
+#ifdef BITMAPBUTTONS
}
+#endif // BITMAPBUTTONS
}
BPen pen((flags.focused) ? screen->getWindowStyle()->b_pic_focus :
screen->getWindowStyle()->b_pic_unfocus);
-
+
+#ifdef BITMAPBUTTONS
PixmapMask pm = screen->getWindowStyle()->max_button;
if (pm.mask != None) {
XSetClipOrigin(blackbox->getXDisplay(), pen.gc(), 0, 0 );
XSetClipMask( blackbox->getXDisplay(), pen.gc(), None );
} else {
+#endif // BITMAPBUTTONS
XDrawRectangle(blackbox->getXDisplay(), frame.maximize_button, pen.gc(),
2, 2, (frame.button_w - 5), (frame.button_w - 5));
XDrawLine(blackbox->getXDisplay(), frame.maximize_button, pen.gc(),
2, 3, (frame.button_w - 3), 3);
+#ifdef BITMAPBUTTONS
}
+#endif // BITMAPBUTTONS
}
BPen pen((flags.focused) ? screen->getWindowStyle()->b_pic_focus :
screen->getWindowStyle()->b_pic_unfocus);
-
+
+#ifdef BITMAPBUTTONS
PixmapMask pm = screen->getWindowStyle()->close_button;
if (pm.mask != None) {
XSetClipOrigin(blackbox->getXDisplay(), pen.gc(), 0, 0 );
XSetClipMask( blackbox->getXDisplay(), pen.gc(), None );
} else {
+#endif // BITMAPBUTTONS
XDrawLine(blackbox->getXDisplay(), frame.close_button, pen.gc(),
2, 2, (frame.button_w - 3), (frame.button_w - 3));
XDrawLine(blackbox->getXDisplay(), frame.close_button, pen.gc(),
2, (frame.button_w - 3), (frame.button_w - 3), 2);
+#ifdef BITMAPBUTTONS
}
+#endif // BITMAPBUTTONS
}
void BlackboxWindow::redrawStickyButton(bool pressed) const {
BPen pen((flags.focused) ? screen->getWindowStyle()->b_pic_focus :
screen->getWindowStyle()->b_pic_unfocus);
-
+
+#ifdef BITMAPBUTTONS
PixmapMask pm = screen->getWindowStyle()->stick_button;
if (pm.mask != None) {
XSetClipOrigin(blackbox->getXDisplay(), pen.gc(), 0, 0 );
XSetClipMask( blackbox->getXDisplay(), pen.gc(), None );
} else {
+#endif // BITMAPBUTTONS
XFillRectangle(blackbox->getXDisplay(), frame.stick_button, pen.gc(),
frame.button_w/2 - 1, frame.button_w/2 -1, 2, 2 );
+#ifdef BITMAPBUTTONS
}
+#endif
}
void BlackboxWindow::mapRequestEvent(const XMapRequestEvent *re) {