Btk
canvas.hpp
1 #if !defined(_BTK_CANVAS_HPP_)
2 #define _BTK_CANVAS_HPP_
3 #include "defs.hpp"
4 #include "render.hpp"
5 #include "widget.hpp"
6 #include "signal/function.hpp"
7 
8 namespace Btk{
9  class BTKAPI Canvas:public Widget{
10  public:
11  //Renderer function
14  public:
15  Canvas(Container&);
16  Canvas(Container&,int x,int y,int w,int h);
17  Canvas(const Canvas &) = delete;
18  ~Canvas();
19 
20  void draw(Renderer&);
21  bool handle(Event &);
22 
23  EventFn &handle(){
24  return event_fn;
25  }
26  DrawFn &draw(){
27  return draw_fn;
28  }
29  using Widget::redraw;
30  private:
31  EventFn event_fn;
32  DrawFn draw_fn;
33  };
34 }
35 
36 #endif // _BTK_CANVAS_HPP_
Definition: widget.hpp:219
This header include many useful containers.
Definition: async.hpp:7
A base event of all events.
Definition: event.hpp:17
void redraw()
Send a redraw request to the window.
Definition: widget.cpp:29
A Container of Widget.
Definition: widget.hpp:108
Definition: canvas.hpp:9