{
}
-Style::Style(unsigned int screen, otk::BImageControl *ctrl)
+Style::Style(unsigned int screen, BImageControl *ctrl)
: image_control(ctrl), font(NULL), screen_number(screen)
{
}
delete font;
if (close_button.mask != None)
- XFreePixmap(otk::OBDisplay::display, close_button.mask);
+ XFreePixmap(OBDisplay::display, close_button.mask);
if (max_button.mask != None)
- XFreePixmap(otk::OBDisplay::display, max_button.mask);
+ XFreePixmap(OBDisplay::display, max_button.mask);
if (icon_button.mask != None)
- XFreePixmap(otk::OBDisplay::display, icon_button.mask);
+ XFreePixmap(OBDisplay::display, icon_button.mask);
if (stick_button.mask != None)
- XFreePixmap(otk::OBDisplay::display, stick_button.mask);
+ XFreePixmap(OBDisplay::display, stick_button.mask);
max_button.mask = None;
close_button.mask = None;
stick_button.mask = None;
}
-void Style::load(otk::Configuration &style) {
+void Style::load(Configuration &style) {
std::string s;
// load fonts/fontsets
"black", style, true);
if (close_button.mask != None)
- XFreePixmap(otk::OBDisplay::display, close_button.mask);
+ XFreePixmap(OBDisplay::display, close_button.mask);
if (max_button.mask != None)
- XFreePixmap(otk::OBDisplay::display, max_button.mask);
+ XFreePixmap(OBDisplay::display, max_button.mask);
if (icon_button.mask != None)
- XFreePixmap(otk::OBDisplay::display, icon_button.mask);
+ XFreePixmap(OBDisplay::display, icon_button.mask);
if (stick_button.mask != None)
- XFreePixmap(otk::OBDisplay::display, stick_button.mask);
+ XFreePixmap(OBDisplay::display, stick_button.mask);
close_button.mask = max_button.mask = icon_button.mask
= icon_button.mask = None;
// we create the window.frame texture by hand because it exists only to
// make the code cleaner and is not actually used for display
- otk::BColor color = readDatabaseColor("window.frame.focusColor", "white",
+ BColor color = readDatabaseColor("window.frame.focusColor", "white",
style);
- f_focus = otk::BTexture("solid flat", screen_number, image_control);
+ f_focus = BTexture("solid flat", screen_number, image_control);
f_focus.setColor(color);
color = readDatabaseColor("window.frame.unfocusColor", "white", style);
- f_unfocus = otk::BTexture("solid flat", screen_number, image_control);
+ f_unfocus = BTexture("solid flat", screen_number, image_control);
f_unfocus.setColor(color);
l_text_focus = readDatabaseColor("window.label.focus.textColor",
}
// sanity checks
- if (t_focus.texture() == otk::BTexture::Parent_Relative)
+ if (t_focus.texture() == BTexture::Parent_Relative)
t_focus = f_focus;
- if (t_unfocus.texture() == otk::BTexture::Parent_Relative)
+ if (t_unfocus.texture() == BTexture::Parent_Relative)
t_unfocus = f_unfocus;
- if (h_focus.texture() == otk::BTexture::Parent_Relative)
+ if (h_focus.texture() == BTexture::Parent_Relative)
h_focus = f_focus;
- if (h_unfocus.texture() == otk::BTexture::Parent_Relative)
+ if (h_unfocus.texture() == BTexture::Parent_Relative)
h_unfocus = f_unfocus;
border_color = readDatabaseColor("borderColor", "black", style);
// load bevel, border and handle widths
- const otk::ScreenInfo *s_info = otk::OBDisplay::screenInfo(screen_number);
+ const ScreenInfo *s_info = OBDisplay::screenInfo(screen_number);
unsigned int width = s_info->getRect().width();
if (! style.getValue("handleWidth", handle_width) ||
void Style::readDatabaseMask(const std::string &rname, PixmapMask &pixmapMask,
- const otk::Configuration &style) {
- Window root_window = otk::OBDisplay::screenInfo(screen_number)->getRootWindow();
+ const Configuration &style) {
+ Window root_window = OBDisplay::screenInfo(screen_number)->getRootWindow();
std::string s;
int hx, hy; //ignored
int ret = BitmapOpenFailed; //default to failure.
if (s[0] != '/' && s[0] != '~')
{
std::string xbmFile = std::string("~/.openbox/buttons/") + s;
- ret = XReadBitmapFile(otk::OBDisplay::display, root_window,
+ ret = XReadBitmapFile(OBDisplay::display, root_window,
expandTilde(xbmFile).c_str(), &pixmapMask.w,
&pixmapMask.h, &pixmapMask.mask, &hx, &hy);
} else
- ret = XReadBitmapFile(otk::OBDisplay::display, root_window,
+ ret = XReadBitmapFile(OBDisplay::display, root_window,
expandTilde(s).c_str(), &pixmapMask.w,
&pixmapMask.h, &pixmapMask.mask, &hx, &hy);
}
-otk::BTexture Style::readDatabaseTexture(const std::string &rname,
+BTexture Style::readDatabaseTexture(const std::string &rname,
const std::string &default_color,
- const otk::Configuration &style,
+ const Configuration &style,
bool allowNoTexture)
{
- otk::BTexture texture;
+ BTexture texture;
std::string s;
if (style.getValue(rname, s))
- texture = otk::BTexture(s);
+ texture = BTexture(s);
else if (allowNoTexture) //no default
- texture.setTexture(otk::BTexture::NoTexture);
+ texture.setTexture(BTexture::NoTexture);
else
- texture.setTexture(otk::BTexture::Solid | otk::BTexture::Flat);
+ texture.setTexture(BTexture::Solid | BTexture::Flat);
// associate this texture with this screen
texture.setScreen(screen_number);
texture.setImageControl(image_control);
- if (texture.texture() != otk::BTexture::NoTexture) {
+ if (texture.texture() != BTexture::NoTexture) {
texture.setColor(readDatabaseColor(rname + ".color", default_color,
style));
texture.setColorTo(readDatabaseColor(rname + ".colorTo", default_color,
}
-otk::BColor Style::readDatabaseColor(const std::string &rname,
+BColor Style::readDatabaseColor(const std::string &rname,
const std::string &default_color,
- const otk::Configuration &style) {
- otk::BColor color;
+ const Configuration &style) {
+ BColor color;
std::string s;
if (style.getValue(rname, s))
- color = otk::BColor(s, screen_number);
+ color = BColor(s, screen_number);
else
- color = otk::BColor(default_color, screen_number);
+ color = BColor(default_color, screen_number);
return color;
}
-otk::BFont *Style::readDatabaseFont(const std::string &rbasename,
- const otk::Configuration &style) {
+BFont *Style::readDatabaseFont(const std::string &rbasename,
+ const Configuration &style) {
std::string fontname;
std::string s;
}
- otk::BFont *b = new otk::BFont(screen_number, family, i, bold, italic,
- dropShadow && shadow_fonts,
- offset, tint, aa_fonts);
+ BFont *b = new BFont(screen_number, family, i, bold, italic,
+ dropShadow && shadow_fonts,
+ offset, tint, aa_fonts);
if (b->valid())
return b;
delete b;
// private:
- otk::BImageControl *image_control;
+ BImageControl *image_control;
- otk::BColor
+ BColor
l_text_focus, l_text_unfocus,
b_pic_focus, b_pic_unfocus;
- otk::BColor border_color;
+ BColor border_color;
- otk::BFont *font;
+ BFont *font;
- otk::BTexture
+ BTexture
f_focus, f_unfocus,
t_focus, t_unfocus,
l_focus, l_unfocus,
Style();
Style(unsigned int);
- Style(unsigned int, otk::BImageControl *);
+ Style(unsigned int, BImageControl *);
~Style();
void doJustify(const std::string &text, int &start_pos,
void readDatabaseMask(const std::string &rname,
PixmapMask &pixmapMask,
- const otk::Configuration &style);
+ const Configuration &style);
- otk::BTexture readDatabaseTexture(const std::string &rname,
+ BTexture readDatabaseTexture(const std::string &rname,
const std::string &default_color,
- const otk::Configuration &style,
+ const Configuration &style,
bool allowNoTexture = false);
- otk::BColor readDatabaseColor(const std::string &rname,
+ BColor readDatabaseColor(const std::string &rname,
const std::string &default_color,
- const otk::Configuration &style);
+ const Configuration &style);
- otk::BFont *readDatabaseFont(const std::string &rbasename,
- const otk::Configuration &style);
+ BFont *readDatabaseFont(const std::string &rbasename,
+ const Configuration &style);
- void load(otk::Configuration &);
+ void load(Configuration &);
inline unsigned int getHandleWidth(void) const { return handle_width; }
inline unsigned int getBevelWidth(void) const { return bevel_width; }
inline unsigned int getFrameWidth(void) const { return frame_width; }
inline unsigned int getBorderWidth(void) const { return border_width; }
- inline void setImageControl(otk::BImageControl *c) { image_control = c; }
+ inline void setImageControl(BImageControl *c) { image_control = c; }
inline void setScreenNumber(unsigned int scr) { screen_number = scr; }
// XXX add inline accessors for the rest of the bummy