api cleanups
Dana Jansens danakj@orodu.net
7 files changed,
42 insertions(+),
42 deletions(-)
M
otk/appwidget.cc
→
otk/appwidget.cc
@@ -27,7 +27,7 @@ // set WM Protocols on the window
Atom protocols[2]; protocols[0] = _wm_protocols; protocols[1] = _wm_delete; - XSetWMProtocols(OBDisplay::display, getWindow(), protocols, 2); + XSetWMProtocols(OBDisplay::display, window(), protocols, 2); } OtkAppWidget::~OtkAppWidget()
M
otk/focuslabel.cc
→
otk/focuslabel.cc
@@ -13,8 +13,8 @@
OtkFocusLabel::OtkFocusLabel(OtkWidget *parent) : OtkFocusWidget(parent), _text("") { - const ScreenInfo *info = OBDisplay::screenInfo(getScreen()); - _xftdraw = XftDrawCreate(OBDisplay::display, getWindow(), info->getVisual(), + const ScreenInfo *info = OBDisplay::screenInfo(screen()); + _xftdraw = XftDrawCreate(OBDisplay::display, window(), info->getVisual(), info->getColormap()); }@@ -28,18 +28,18 @@ void OtkFocusLabel::setStyle(Style *style)
{ OtkFocusWidget::setStyle(style); - setTexture(getStyle()->getLabelFocus()); - setUnfocusTexture(getStyle()->getLabelUnfocus()); + setTexture(style->getLabelFocus()); + setUnfocusTexture(style->getLabelUnfocus()); } void OtkFocusLabel::update(void) { if (_dirty) { - const BFont &ft = getStyle()->getFont(); - BColor *text_color = (isFocused() ? getStyle()->getTextFocus() - : getStyle()->getTextUnfocus()); - unsigned int sidemargin = getStyle()->getBevelWidth() * 2; + const BFont &ft = style()->getFont(); + BColor *text_color = (isFocused() ? style()->getTextFocus() + : style()->getTextUnfocus()); + unsigned int sidemargin = style()->getBevelWidth() * 2; std::string t = _text; // the actual text to draw int x = sidemargin; // x coord for the text@@ -58,7 +58,7 @@ length = ft.measureString(t);
} while (length > max_length && text_len-- > 0); // justify the text - switch (getStyle()->textJustify()) { + switch (style()->textJustify()) { case Style::RightJustify: x += max_length - length; break;
M
otk/focuswidget.cc
→
otk/focuswidget.cc
@@ -12,8 +12,8 @@ OtkFocusWidget::OtkFocusWidget(OtkWidget *parent, Direction direction)
: OtkWidget(parent, direction), _unfocus_texture(0), _unfocus_bcolor(0) { _focused = true; - _focus_texture = parent->getTexture(); - _focus_bcolor = parent->getBorderColor(); + _focus_texture = parent->texture(); + _focus_bcolor = parent->borderColor(); } OtkFocusWidget::~OtkFocusWidget()@@ -50,7 +50,7 @@
OtkWidget::setTexture(_unfocus_texture); OtkWidget::update(); - OtkWidget::OtkWidgetList children = OtkWidget::getChildren(); + OtkWidget::OtkWidgetList children = OtkWidget::children(); OtkWidget::OtkWidgetList::iterator it = children.begin(), end = children.end();
M
otk/label.cc
→
otk/label.cc
@@ -11,8 +11,8 @@
OtkLabel::OtkLabel(OtkWidget *parent) : OtkWidget(parent), _text("") { - const ScreenInfo *info = OBDisplay::screenInfo(getScreen()); - _xftdraw = XftDrawCreate(OBDisplay::display, getWindow(), info->getVisual(), + const ScreenInfo *info = OBDisplay::screenInfo(screen()); + _xftdraw = XftDrawCreate(OBDisplay::display, window(), info->getVisual(), info->getColormap()); }@@ -25,15 +25,15 @@ void OtkLabel::setStyle(Style *style)
{ OtkWidget::setStyle(style); - setTexture(getStyle()->getLabelUnfocus()); + setTexture(style->getLabelUnfocus()); } void OtkLabel::update(void) { if (_dirty) { - const BFont &ft = getStyle()->getFont(); - unsigned int sidemargin = getStyle()->getBevelWidth() * 2; + const BFont &ft = style()->getFont(); + unsigned int sidemargin = style()->getBevelWidth() * 2; std::string t = _text; // the actual text to draw int x = sidemargin; // x coord for the text@@ -52,7 +52,7 @@ length = ft.measureString(t);
} while (length > max_length && text_len-- > 0); // justify the text - switch (getStyle()->textJustify()) { + switch (style()->textJustify()) { case Style::RightJustify: x += max_length - length; break;@@ -66,7 +66,7 @@ }
OtkWidget::update(); - ft.drawString(_xftdraw, x, 0, *getStyle()->getTextUnfocus(), t); + ft.drawString(_xftdraw, x, 0, *style()->getTextUnfocus(), t); } else OtkWidget::update(); }
M
otk/widget.cc
→
otk/widget.cc
@@ -17,14 +17,14 @@
OtkWidget::OtkWidget(OtkWidget *parent, Direction direction) : OtkEventHandler(), _dirty(false), _focused(false), - _parent(parent), _style(parent->getStyle()), _direction(direction), - _cursor(parent->getCursor()), _bevel_width(parent->getBevelWidth()), + _parent(parent), _style(parent->style()), _direction(direction), + _cursor(parent->cursor()), _bevel_width(parent->bevelWidth()), _ignore_config(0), _visible(false), _grabbed_mouse(false), _grabbed_keyboard(false), _stretchable_vert(false), _stretchable_horz(false), _texture(0), _bg_pixmap(0), _bg_pixel(0), - _bcolor(0), _bwidth(0), _screen(parent->getScreen()), _fixed_width(false), - _fixed_height(false), _event_dispatcher(parent->getEventDispatcher()) + _bcolor(0), _bwidth(0), _screen(parent->screen()), _fixed_width(false), + _fixed_height(false), _event_dispatcher(parent->eventDispatcher()) { assert(parent); parent->addChild(this);@@ -70,7 +70,7 @@
void OtkWidget::create(void) { const ScreenInfo *scr_info = otk::OBDisplay::screenInfo(_screen); - Window p_window = _parent ? _parent->getWindow() : scr_info->getRootWindow(); + Window p_window = _parent ? _parent->window() : scr_info->getRootWindow(); _rect.setRect(0, 0, 1, 1); // just some initial values
M
otk/widget.hh
→
otk/widget.hh
@@ -37,11 +37,11 @@
void exposeHandler(const XExposeEvent &e); void configureHandler(const XConfigureEvent &e); - inline Window getWindow(void) const { return _window; } - inline const OtkWidget *getParent(void) const { return _parent; } - inline const OtkWidgetList &getChildren(void) const { return _children; } - inline unsigned int getScreen(void) const { return _screen; } - inline const Rect &getRect(void) const { return _rect; } + inline Window window(void) const { return _window; } + inline const OtkWidget *parent(void) const { return _parent; } + inline const OtkWidgetList &children(void) const { return _children; } + inline unsigned int screen(void) const { return _screen; } + inline const Rect &rect(void) const { return _rect; } void move(const Point &to); void move(int x, int y);@@ -75,17 +75,17 @@ inline bool hasGrabbedKeyboard(void) const { return _grabbed_keyboard; }
bool grabKeyboard(void); void ungrabKeyboard(void); - inline BTexture *getTexture(void) const { return _texture; } + inline BTexture *texture(void) const { return _texture; } virtual void setTexture(BTexture *texture) { _texture = texture; _dirty = true; } - inline const BColor *getBorderColor(void) const { return _bcolor; } + inline const BColor *borderColor(void) const { return _bcolor; } virtual void setBorderColor(const BColor *color) { assert(color); _bcolor = color; XSetWindowBorder(OBDisplay::display, _window, color->pixel()); } - inline int getBorderWidth(void) const { return _bwidth; } + inline int borderWidth(void) const { return _bwidth; } void setBorderWidth(int width) { _bwidth = width; XSetWindowBorderWidth(OBDisplay::display, _window, width);@@ -100,23 +100,23 @@
inline bool isStretchableVert(void) const { return _stretchable_vert; } void setStretchableVert(bool s_vert = true) { _stretchable_vert = s_vert; } - inline Cursor getCursor(void) const { return _cursor; } + inline Cursor cursor(void) const { return _cursor; } void setCursor(Cursor cursor) { _cursor = cursor; XDefineCursor(OBDisplay::display, _window, _cursor); } - inline int getBevelWidth(void) const { return _bevel_width; } + inline int bevelWidth(void) const { return _bevel_width; } void setBevelWidth(int bevel_width) { assert(bevel_width > 0); _bevel_width = bevel_width; } - inline Direction getDirection(void) const { return _direction; } + inline Direction direction(void) const { return _direction; } void setDirection(Direction dir) { _direction = dir; } - inline Style *getStyle(void) const { return _style; } + inline Style *style(void) const { return _style; } virtual void setStyle(Style *style); - inline OtkEventDispatcher *getEventDispatcher(void) + inline OtkEventDispatcher *eventDispatcher(void) { return _event_dispatcher; } void setEventDispatcher(OtkEventDispatcher *disp);