1 #ifndef AWFUL_GUI_WIDGET_H_
2 #define AWFUL_GUI_WIDGET_H_
4 #include "EventHandler.h"
5 #include "renderer/Context.h"
9 namespace awful
{ namespace gui
11 class ContainerWidget
;
14 class Widget
: public EventHandler
17 Widget( Pointer
< Theme
> pTheme_
);
18 Widget( Pointer
< ContainerWidget
> pParent_
);
23 Signal
< Pointer
< renderer::Context
> > m_Render
;
25 virtual void reLayout()
30 void doRender( Pointer
< renderer::Context
> pContext
)
35 const float& getLeft() const { return m_Left
; }
36 void setLeft( const float& x
) { m_Left
= x
; }
38 const float& getTop() const { return m_Top
; }
39 void setTop( const float& x
) { m_Top
= x
; }
41 const float& getWidth() const { return m_Width
; }
42 void setWidth( const float& x
) { m_Width
= x
; }
44 const float& getHeight() const { return m_Height
; }
45 void setHeight( const float& x
) { m_Height
= x
; }
47 const Pointer
< Theme
>& getTheme() const { return m_Theme
; }
48 void setTheme( const Pointer
< Theme
>& x
) { m_Theme
= x
; }
50 bool isInside( float x
, float y
) const
52 float right
= m_Left
+ m_Width
- 1.f
;
53 float bottom
= m_Top
+ m_Height
- 1.f
;
54 return x
>= m_Left
&& x
< right
55 && y
>= m_Top
&& y
< bottom
;
65 Pointer
< Theme
> m_Theme
;