6 * (c) 2008-2009 Technische Universität Dresden
7 * This file is part of TUD:OS and distributed under the terms of the
8 * GNU General Public License 2.
9 * Please see the COPYING-GPL-2 file for details.
11 #include <l4/l4con/l4con.h>
12 #include <l4/cxx/exceptions>
13 #include <l4/cxx/ipc_helper>
14 #include <l4/cxx/ipc_stream>
16 #include <l4/sys/err.h>
19 L4con::close() const throw()
21 L4::Ipc_iostream io(l4_utcb());
22 io << L4::Opcode(L4con_::Close);
23 return l4_error(io.call(Framebuffer::cap(), L4con::Protocol::Vc));
27 L4con::pslim_fill(int x, int y, int w, int h, unsigned int color) const throw()
29 L4::Ipc_iostream io(l4_utcb());
30 io << L4::Opcode(L4con_::Pslim_fill);
31 io << x << y << w << h << color;
32 return l4_error(io.call(Framebuffer::cap(), L4con::Protocol::Vc));
36 L4con::pslim_copy(int x, int y, int w, int h, l4_int16_t dx, l4_int16_t dy) const throw()
38 L4::Ipc_iostream io(l4_utcb());
39 io << L4::Opcode(L4con_::Pslim_copy);
40 io << x << y << w << h << dx << dy;
41 return l4_error(io.call(Framebuffer::cap(), L4con::Protocol::Vc));
45 L4con::puts(const char *s, unsigned long len, short x, short y,
46 unsigned int fg_color, unsigned int bg_color) const throw()
48 L4::Ipc_iostream io(l4_utcb());
49 io << L4::Opcode(L4con_::Puts);
50 io << x << y << fg_color << bg_color
51 << L4::ipc_buf_cp_out(s, len);
52 return l4_error(io.call(Framebuffer::cap(), L4con::Protocol::Vc));
56 L4con::puts_scale(const char *s, unsigned long len,
58 unsigned int fg_color, unsigned int bg_color,
59 short scale_x, short scale_y) const throw()
61 L4::Ipc_iostream io(l4_utcb());
62 io << L4::Opcode(L4con_::Puts_scale);
63 io << x << y << fg_color << bg_color << scale_x << scale_y
64 << L4::ipc_buf_cp_out(s, len);
65 return l4_error(io.call(Framebuffer::cap(), L4con::Protocol::Vc));
69 L4con::get_font_size(unsigned int *fn_w, unsigned int *fn_h) const throw()
71 L4::Ipc_iostream io(l4_utcb());
72 io << L4::Opcode(L4con_::Get_font_size);
73 long r = l4_error(io.call(Framebuffer::cap(), L4con::Protocol::Vc));
74 if (EXPECT_FALSE(r < 0))
90 l4con_close(l4re_fb_t fb) L4_NOTHROW
97 l4con_pslim_fill(l4re_fb_t fb, int x, int y, int w, int h, unsigned int color) L4_NOTHROW
100 return f->pslim_fill(x, y, w, h, color);
104 l4con_puts(l4re_fb_t fb, const char *s, unsigned long len, short x, short y,
105 unsigned int fg_color, unsigned int bg_color) L4_NOTHROW
107 L4::Cap<L4con> f(fb);
108 return f->puts(s, len, x, y, fg_color, bg_color);
112 l4con_puts_scale(l4re_fb_t fb, const char *s, unsigned long len,
114 unsigned int fg_color, unsigned int bg_color,
115 short scale_x, short scale_y) L4_NOTHROW
117 L4::Cap<L4con> f(fb);
118 return f->puts_scale(s, len, x, y, fg_color, bg_color, scale_x, scale_y);
122 l4con_get_font_size(l4re_fb_t fb, unsigned int *fn_w, unsigned int *fn_h) L4_NOTHROW
124 L4::Cap<L4con> f(fb);
125 return f->get_font_size(fn_w, fn_h);