2 * (c) 2010 Alexander Warg <warg@os.inf.tu-dresden.de>
3 * economic rights: Technische Universität Dresden (Germany)
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.
11 #include <l4/mag-gfx/mem_factory>
12 #include "mouse_cursor.h"
14 namespace Mag_server {
16 using namespace Mag_gfx;
19 template< typename PT >
20 class Csf : public Screen_factory, public Mem::Factory<PT>
24 View *create_cursor(Texture const *cursor)
26 typedef typename PT::Pixel Pixel;
27 if (cursor->type() == PT::type())
28 return new Mouse_cursor<PT>(cursor);
31 void *m = malloc(cursor->size().pixels() * sizeof(Pixel));
32 Texture *c = new Mem::Texture<PT>((Pixel*)m, cursor->size());
34 return new Mouse_cursor<PT>(c);
41 static Csf<Rgb15> _csf_rgb15;
42 static Csf<Bgr15> _csf_bgr15;
43 static Csf<Rgb16> _csf_rgb16;
44 static Csf<Bgr16> _csf_bgr16;
45 static Csf<Rgb24> _csf_rgb24;
46 static Csf<Rgb32> _csf_rgb32;
47 static Csf<Bgr32> _csf_bgr32;
48 static Csf<Rgba32> _csf_rgba32;