]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/mag/server/src/mouse_cursor.h
update
[l4.git] / l4 / pkg / mag / server / src / mouse_cursor.h
1 /*
2  * (c) 2010 Alexander Warg <warg@os.inf.tu-dresden.de>
3  *     economic rights: Technische Universität Dresden (Germany)
4  *
5  * This file is part of TUD:OS and distributed under the terms of the
6  * GNU General Public License 2.
7  * Please see the COPYING-GPL-2 file for details.
8  */
9 #pragma once
10
11 #include <l4/mag-gfx/clip_guard>
12 #include <l4/mag-gfx/mem_texture>
13
14 #include "view_stack"
15 #include "view"
16
17 namespace Mag_server {
18
19 using namespace Mag_gfx;
20
21 template< typename PT >
22 class Mouse_cursor : public View
23 {
24 private:
25   Mem::Texture<PT> const *_t;
26
27 public:
28   Mouse_cursor(Texture const *t)
29   : View(Rect(Point(0,0), t->size()), F_transparent),
30     _t(static_cast<Mem::Texture<PT> const *>(t))
31   {}
32
33   void draw(Canvas *canvas, View_stack const *, Mode) const
34   {
35     Clip_guard g(canvas, *this);
36     canvas->draw_texture(_t, Rgb32::Black, p1(), Canvas::Masked);
37   }
38
39 };
40
41 }