Loading...
Searching...
No Matches
goos_svr
// vi:set ft=cpp: -*- Mode: C++ -*-
/*
* (c) 2008-2009 Adam Lackorzynski <adam@os.inf.tu-dresden.de>,
* Alexander Warg <warg@os.inf.tu-dresden.de>
* economic rights: Technische Universität Dresden (Germany)
*
* License: see LICENSE.spdx (in this directory or the directories above)
*/
#pragma once
#include <l4/re/dataspace>
#include <l4/re/video/goos>
#include <l4/re/video/goos-sys.h>
#include <l4/sys/capability>
#include <l4/sys/cxx/ipc_legacy>
namespace L4Re { namespace Util { namespace Video {
class Goos_svr
{
typedef L4Re::Video::Goos::Rights Rights;
protected:
L4::Cap<L4Re::Dataspace> _fb_ds;
L4Re::Video::Goos::Info _screen_info;
L4Re::Video::View::Info _view_info;
public:
L4_RPC_LEGACY_DISPATCH(L4Re::Video::Goos);
L4::Cap<L4Re::Dataspace> get_fb() const { return _fb_ds; }
L4Re::Video::Goos::Info const *screen_info() const { return &_screen_info; }
L4Re::Video::View::Info const *view_info() const { return &_view_info; }
virtual int refresh(int x, int y, int w, int h)
{ (void)x; (void)y; (void)w; (void)h; return -L4_ENOSYS; }
void init_infos()
{
using L4Re::Video::View;
_view_info.flags = View::F_none;
_view_info.view_index = 0;
_view_info.xpos = 0;
_view_info.ypos = 0;
_view_info.width = _screen_info.width;
_view_info.height = _screen_info.height;
_view_info.pixel_info = _screen_info.pixel_info;
_view_info.buffer_index = 0;
}
virtual ~Goos_svr() {}
long op_view_info(Rights, unsigned idx, L4Re::Video::View::Info &info)
{
if (idx != 0)
return -L4_ERANGE;
info = _view_info;
return L4_EOK;
}
long op_info(Rights, L4Re::Video::Goos::Info &info)
{
info = _screen_info;
return L4_EOK;
}
long op_get_static_buffer(Rights, unsigned idx,
L4::Ipc::Cap<L4Re::Dataspace> &ds)
{
if (idx != 0)
return -L4_ERANGE;
ds = L4::Ipc::Cap<L4Re::Dataspace>(_fb_ds, L4_CAP_FPAGE_RW);
return L4_EOK;
}
long op_refresh(Rights, int x, int y, int w, int h)
{ return refresh(x, y, w, h); }
long op_view_refresh(Rights, unsigned idx, int x, int y, int w, int h)
{
if (idx != 0)
return -L4_ERANGE;
return refresh(x, y, w, h);
}
long op_set_view_info(Rights, unsigned, L4Re::Video::View::Info)
{ return -L4_ENOSYS; }
long op_view_stack(Rights, unsigned, unsigned, bool)
{ return -L4_ENOSYS; }
long op_delete_view(Rights, unsigned)
{ return -L4_ENOSYS; }
long op_create_view(Rights)
{ return -L4_ENOSYS; }
long op_create_buffer(Rights, unsigned long,
L4::Ipc::Cap<L4Re::Dataspace> &)
{ return -L4_ENOSYS; }
long op_delete_buffer(Rights, unsigned)
{ return -L4_ENOSYS; }
};
}}}
capability
L4::Cap related definitions.
L4Re::Util::Video::Goos_svr
Goos server class.
Definition goos_svr:26
L4Re::Util::Video::Goos_svr::~Goos_svr
virtual ~Goos_svr()
Destructor.
Definition goos_svr:96
L4Re::Util::Video::Goos_svr::_screen_info
L4Re::Video::Goos::Info _screen_info
Goos information.
Definition goos_svr:32
L4Re::Util::Video::Goos_svr::_view_info
L4Re::Video::View::Info _view_info
View information.
Definition goos_svr:34
L4Re::Util::Video::Goos_svr::get_fb
L4::Cap< L4Re::Dataspace > get_fb() const
Return framebuffer memory dataspace.
Definition goos_svr:42
L4Re::Util::Video::Goos_svr::_fb_ds
L4::Cap< L4Re::Dataspace > _fb_ds
Goos memory dataspace.
Definition goos_svr:30
L4Re::Util::Video::Goos_svr::refresh
virtual int refresh(int x, int y, int w, int h)
Refresh area of the framebuffer.
Definition goos_svr:66
L4Re::Util::Video::Goos_svr::init_infos
void init_infos()
Initialize the view information structure of this object.
Definition goos_svr:78
L4Re::Util::Video::Goos_svr::view_info
L4Re::Video::View::Info const * view_info() const
View information structure.
Definition goos_svr:54
L4Re::Util::Video::Goos_svr::screen_info
L4Re::Video::Goos::Info const * screen_info() const
Goos information structure.
Definition goos_svr:48
L4Re::Video::Goos
Class that abstracts framebuffers.
Definition goos:225
L4Re::Video::View
View of a framebuffer.
Definition goos:40
L4::Cap
C++ interface for capabilities.
Definition capability.h:224
L4::Ipc::Cap
Capability type for RPC interfaces (see L4::Cap<T>).
Definition ipc_types:699
dataspace
Dataspace interface.
goos-sys.h
Goos protocol definition.
L4_ERANGE
@ L4_ERANGE
Range error.
Definition err.h:48
L4_ENOSYS
@ L4_ENOSYS
No sys.
Definition err.h:50
L4_EOK
@ L4_EOK
Ok.
Definition err.h:32
L4_CAP_FPAGE_RW
@ L4_CAP_FPAGE_RW
Read and interface specific 'W' right for capability flexpages.
Definition __l4_fpage.h:192
L4Re::Util
Documentation of the L4 Runtime Environment utility functionality in C++.
Definition l4re.dox:21
L4Re
L4Re C++ Interfaces.
Definition cmd_control:14
L4Re::Video::Goos::Info
Information structure of a Goos.
Definition goos:238
L4Re::Video::View::Info
Information structure of a view.
Definition goos:92