]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/mag/plugins/client_fb/client_fb.h
Inital import
[l4.git] / l4 / pkg / mag / plugins / client_fb / client_fb.h
1 /*
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.
6  */
7 #include <l4/mag-gfx/canvas>
8
9 #include <l4/mag/server/view>
10
11 #include <l4/re/util/video/goos_svr>
12 #include <l4/re/util/event_svr>
13 #include <l4/cxx/ipc_server>
14 #include <l4/re/util/cap_alloc>
15 #include <l4/re/rm>
16 #include <l4/re/util/icu_svr>
17 #include <l4/mag/server/plugin>
18
19 namespace Mag_server {
20
21 class Client_fb
22 : public View, public Object,
23   private L4Re::Util::Video::Goos_svr,
24   public L4Re::Util::Icu_cap_array_svr<Client_fb>
25 {
26 private:
27   typedef L4Re::Util::Icu_cap_array_svr<Client_fb> Icu_svr;
28   Core_api const *_core;
29   Point _offs;
30   Texture *_fb;
31   Area _bar_size;
32
33   L4Re::Util::Auto_cap<L4Re::Dataspace>::Cap _ev_ds;
34   L4Re::Rm::Auto_region<void*> _ev_ds_m;
35   L4Re::Event_buffer _events;
36   Irq _ev_irq;
37
38 public:
39   Client_fb(Core_api const *core, Rect const &pos, Point const &offs,
40             Texture *fb, L4::Cap<L4Re::Dataspace> const &fb_ds);
41
42   L4::Cap<void> rcv_cap() const { return _core->rcv_cap(); }
43
44   void set_offs(Point const &offs)
45   { _offs = offs; }
46
47   void draw(Canvas *, View_stack const *, Mode, bool) const;
48   void handle_event(L4Re::Event_buffer::Event const &e,
49                     Point const &mouse);
50
51   int dispatch(l4_umword_t obj, L4::Ipc_iostream &s);
52   int refresh(int x, int y, int w, int h);
53
54   void destroy();
55 };
56
57 }