]> icculus.org git repositories - mikachu/openbox.git/blob - otk/focuswidget.hh
better focus passing around for now
[mikachu/openbox.git] / otk / focuswidget.hh
1 #ifndef __focuswidget_hh
2 #define __focuswidget_hh
3
4 #include "widget.hh"
5 #include "application.hh"
6
7 namespace otk {
8
9 class OtkFocusWidget : public OtkWidget {
10
11 public:
12
13   OtkFocusWidget(otk::OtkWidget *parent, Direction = Horizontal);
14   virtual ~OtkFocusWidget();
15
16   virtual void focus(void);
17   virtual void unfocus(void);
18
19   virtual void setTexture(otk::BTexture *texture);
20   virtual void setBorderColor(const otk::BColor *color);
21
22   inline void setUnfocusTexture(otk::BTexture *texture)
23   { _unfocus_texture = texture; }
24   inline otk::BTexture *getUnfocusTexture(void) const
25   { return _unfocus_texture; }
26
27   inline void setUnfocusBorderColor(const otk::BColor *color)
28   { _unfocus_bcolor = color; }
29   inline const otk::BColor *getUnfocusBorderColor(void) const
30   { return _unfocus_bcolor; }
31
32   inline bool isFocused(void) const { return _focused; }
33   inline bool isUnfocused(void) const { return !_focused; }
34
35 private:
36
37   BTexture *_unfocus_texture;
38   BTexture *_focus_texture;
39
40   const BColor *_unfocus_bcolor;
41   const BColor *_focus_bcolor;
42 };
43
44 }
45
46 #endif // __focuswidget_hh