2 * (c) 2010 Adam Lackorzynski <adam@os.inf.tu-dresden.de>,
3 * Alexander Warg <warg@os.inf.tu-dresden.de>
4 * economic rights: Technische Universität Dresden (Germany)
6 * This file is part of TUD:OS and distributed under the terms of the
7 * GNU General Public License 2.
8 * Please see the COPYING-GPL-2 file for details.
10 #include <l4/cxx/ipc_server>
11 #include <l4/re/util/object_registry>
13 #include <l4/re/protocols>
14 #include <l4/re/console>
15 #include <l4/re/util/cap_alloc>
16 #include <l4/re/error_helper>
18 #include <l4/re/dataspace>
19 #include <l4/re/mem_alloc>
20 #include <l4/re/util/meta>
26 #include "client_fb.h"
27 #include <l4/mag-gfx/canvas>
28 #include <l4/mag/server/user_state>
29 #include <l4/mag/server/factory>
32 #include <l4/sys/kdebug.h>
34 namespace Mag_server {
36 using L4Re::Util::Auto_cap;
38 void Service::start(Core_api *core)
41 if (!reg()->register_obj(cxx::Ref_ptr<Service>(this), "svc").is_valid())
42 printf("Service registration failed.\n");
44 printf("Plugin: Frame-buffer service started\n");
49 Session::Property_handler const _client_fb_opts[] =
50 { { "g", true, &Client_fb::set_geometry_prop },
51 { "geometry", true, &Client_fb::set_geometry_prop },
52 { "focus", false, &Client_fb::set_flags_prop },
53 { "shaded", false, &Client_fb::set_flags_prop },
54 { "fixed", false, &Client_fb::set_flags_prop },
55 { "barheight", true, &Client_fb::set_bar_height_prop },
61 Service::dispatch(l4_umword_t, L4::Ipc_iostream &ios)
68 case L4::Meta::Protocol:
69 return L4Re::Util::handle_meta_request<L4::Factory>(ios);
70 case L4::Factory::Protocol:
71 if (L4::kobject_typeid<L4Re::Console>()->
72 has_proto(L4::Ipc::read<L4::Factory::Proto>(ios)))
74 L4::Ipc::Istream_copy cp_is = ios;
75 cxx::Ref_ptr<Client_fb> x(new Client_fb(_core));
76 _core->set_session_options(x.get(), cp_is, _client_fb_opts);
79 _core->register_session(x.get());
80 reg()->register_obj(x);
81 x->obj_cap()->dec_refcnt(1);
82 ust()->vstack()->push_top(x.ptr());
95 printf("MAG: destroying the fb_client_service, holla\n");
100 printf("MAG: destroy FB svc\n");
103 static Service _fb_service("frame-buffer");