openbox/otk/focuswidget.hh

48 lines
1.1 KiB
C++
Raw Normal View History

// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
2002-11-13 10:19:28 +00:00
#ifndef __focuswidget_hh
#define __focuswidget_hh
#include "widget.hh"
#include "application.hh"
2002-11-13 10:19:28 +00:00
namespace otk {
class FocusWidget : public Widget {
2002-11-13 10:19:28 +00:00
public:
FocusWidget(Widget *parent, Direction = Horizontal);
virtual ~FocusWidget();
2002-11-13 10:19:28 +00:00
virtual void focus(void);
virtual void unfocus(void);
2003-01-20 06:11:12 +00:00
virtual void setTexture(RenderTexture *texture);
2003-01-22 22:46:16 +00:00
virtual void setBorderColor(const RenderColor *color);
2002-11-13 10:19:28 +00:00
2003-01-20 06:11:12 +00:00
inline void setUnfocusTexture(RenderTexture *texture)
2002-11-13 10:19:28 +00:00
{ _unfocus_texture = texture; }
2003-01-20 06:11:12 +00:00
inline RenderTexture *getUnfocusTexture(void) const
2002-11-13 10:19:28 +00:00
{ return _unfocus_texture; }
2003-01-22 22:46:16 +00:00
inline void setUnfocusBorderColor(const RenderColor *color)
{ _unfocus_bcolor = color; }
2003-01-22 22:46:16 +00:00
inline const RenderColor *getUnfocusBorderColor(void) const
{ return _unfocus_bcolor; }
2002-11-13 10:19:28 +00:00
inline bool isFocused(void) const { return _focused; }
inline bool isUnfocused(void) const { return !_focused; }
private:
2003-01-20 06:11:12 +00:00
RenderTexture *_unfocus_texture;
RenderTexture *_focus_texture;
2002-11-13 10:19:28 +00:00
2003-01-22 22:46:16 +00:00
const RenderColor *_unfocus_bcolor;
const RenderColor *_focus_bcolor;
2002-11-13 10:19:28 +00:00
};
}
#endif // __focuswidget_hh