2 * (c) 2010 Technische Universität Dresden
3 * This file is part of TUD:OS and distributed under the terms of the
4 * GNU General Public License 2.
5 * Please see the COPYING-GPL-2 file for details.
9 #include <l4/mag-gfx/mem_factory>
10 #include "mouse_cursor.h"
12 namespace Mag_server {
14 using namespace Mag_gfx;
17 template< typename PT >
18 class Csf : public Screen_factory, public Mem::Factory<PT>
22 View *create_cursor(Texture const *cursor)
24 typedef typename PT::Pixel Pixel;
25 if (cursor->type() == PT::type())
26 return new Mouse_cursor<PT>(cursor);
29 void *m = malloc(cursor->size().pixels() * sizeof(Pixel));
30 Texture *c = new Mem::Texture<PT>((Pixel*)m, cursor->size());
32 return new Mouse_cursor<PT>(c);
39 static Csf<Rgb15> _csf_rgb15;
40 static Csf<Bgr15> _csf_bgr15;
41 static Csf<Rgb16> _csf_rgb16;
42 static Csf<Bgr16> _csf_bgr16;
43 static Csf<Rgb24> _csf_rgb24;
44 static Csf<Rgb32> _csf_rgb32;