From: Dana Jansens Date: Wed, 6 Nov 2002 18:25:48 +0000 (+0000) Subject: dont need to specify otk:: when already in the namespace X-Git-Url: https://git.brokenzipper.com/gitweb?a=commitdiff_plain;h=196996230c7a3ac409c317a8a3be3970917bdd9a;p=chaz%2Fopenbox dont need to specify otk:: when already in the namespace --- diff --git a/otk/style.cc b/otk/style.cc index 860edc14..d98c926b 100644 --- a/otk/style.cc +++ b/otk/style.cc @@ -19,7 +19,7 @@ Style::Style(unsigned int screen) { } -Style::Style(unsigned int screen, otk::BImageControl *ctrl) +Style::Style(unsigned int screen, BImageControl *ctrl) : image_control(ctrl), font(NULL), screen_number(screen) { } @@ -29,13 +29,13 @@ Style::~Style() { 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; @@ -43,7 +43,7 @@ Style::~Style() { stick_button.mask = None; } -void Style::load(otk::Configuration &style) { +void Style::load(Configuration &style) { std::string s; // load fonts/fontsets @@ -76,13 +76,13 @@ void Style::load(otk::Configuration &style) { "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; @@ -94,13 +94,13 @@ void Style::load(otk::Configuration &style) { // 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", @@ -123,20 +123,20 @@ void Style::load(otk::Configuration &style) { } // 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) || @@ -186,8 +186,8 @@ void Style::doJustify(const std::string &text, int &start_pos, 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. @@ -197,11 +197,11 @@ void Style::readDatabaseMask(const std::string &rname, PixmapMask &pixmapMask, 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); @@ -214,26 +214,26 @@ void Style::readDatabaseMask(const std::string &rname, PixmapMask &pixmapMask, } -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, @@ -246,21 +246,21 @@ otk::BTexture Style::readDatabaseTexture(const std::string &rname, } -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; @@ -295,9 +295,9 @@ otk::BFont *Style::readDatabaseFont(const std::string &rbasename, } - 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; diff --git a/otk/style.hh b/otk/style.hh index 6b0fefaf..ac22559c 100644 --- a/otk/style.hh +++ b/otk/style.hh @@ -26,17 +26,17 @@ public: // 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, @@ -58,7 +58,7 @@ public: Style(); Style(unsigned int); - Style(unsigned int, otk::BImageControl *); + Style(unsigned int, BImageControl *); ~Style(); void doJustify(const std::string &text, int &start_pos, @@ -66,28 +66,28 @@ public: 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