]> icculus.org git repositories - mikachu/openbox.git/blob - otk/focuswidget.hh
added otkapplication and event stuff, changed other files to accomodate for this...
[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(OtkWidget *parent, Direction = Horizontal);
14   OtkFocusWidget(OtkApplication *app, Direction direction = Horizontal,
15                  Cursor cursor = 0, int bevel_width = 1);
16   OtkFocusWidget(Style *style, Direction direction = Horizontal,
17                  Cursor cursor = 0, int bevel_width = 1);
18   virtual ~OtkFocusWidget();
19
20   virtual void focus(void);
21   virtual void unfocus(void);
22
23   void setTexture(BTexture *texture);
24
25   inline void setUnfocusTexture(BTexture *texture)
26   { _unfocus_texture = texture; }
27   inline BTexture *getUnfocusTexture(void) const
28   { return _unfocus_texture; }
29
30   inline bool isFocused(void) const { return _focused; }
31   inline bool isUnfocused(void) const { return !_focused; }
32
33 private:
34
35   BTexture *_unfocus_texture;
36   BTexture *_focus_texture;
37
38   bool _focused;
39 };
40
41 }
42
43 #endif // __focuswidget_hh