27#include <l4/re/util/env_ns>
28#include <l4/re/util/video/goos_fb>
29#include <l4/re/video/goos>
31namespace L4Re {
namespace Util {
namespace Video {
48 unsigned _buffer_index;
53 using namespace L4Re::Video;
58 chksys(_goos->info(&gi),
"requesting goos info");
62 chksys(_goos->create_view(&_view),
"creating dynamic goos view");
66 _view = _goos->view(0);
69 chksys(_view.
info(&vi),
"requesting goos view information");
72 "allocating goos buffer cap");
76 "requesting static goos buffer");
81 _buffer_index =
chksys(_goos->create_buffer(buffer_sz, _buffer),
82 "allocating goos buffer");
83 _flags |= F_dyn_buffer;
102 Goos_fb(Goos_fb
const &);
103 void operator = (Goos_fb
const &);
114 explicit Goos_fb(
char const *name)
124 void setup(
char const *name)
129 _flags |= F_dyn_goos;
140 if (_flags & F_dyn_view)
141 _goos->delete_view(_view);
143 if (_flags & F_dyn_buffer)
144 _goos->delete_buffer(_buffer_index);
149 if (_flags & F_dyn_goos)
154 {
return _view.
info(info); }
160 void *attach_buffer()
165 ->attach(&fb_addr, _buffer->size(),
171 int refresh(
int x,
int y,
int w,
int h)
172 {
return _view.
refresh(x, y, w, h); }
Interface for memory-like objects.
static Env const * env() noexcept
Returns the initial environment for the current task.
Class that abstracts framebuffers.
unsigned char bytes_per_pixel() const
Query size of pixel in bytes.
int set_info(Info const &info) const noexcept
Set the information structure for this view.
int info(Info *info) const noexcept
Return the view information of the view.
int push_top() const noexcept
Make this view the top-most view.
int refresh(int x, int y, int w, int h) const noexcept
Refresh/Redraw the view.
bool is_valid() const noexcept
Test whether the capability is a valid capability index (i.e., not L4_INVALID_CAP).
C++ interface for capabilities.
@ L4_INVALID_CAP
Invalid capability selector.
#define L4_SUPERPAGESHIFT
Size of a large page, log2-based.
_Cap_alloc & cap_alloc
Capability allocator.
long chksys(long err, char const *extra="", long ret=0)
Generate C++ exception on error.
T chkcap(T &&cap, char const *extra="", long err=-L4_ENOMEM)
Check for valid capability or raise C++ exception.
@ RW
Readable and writable region.
@ Search_addr
Search for a suitable address range.
Information structure of a Goos.
unsigned long height
Height.
unsigned long width
Width.
Pixel_info pixel_info
Pixel information.
bool has_dynamic_views() const
Return whether dynamic view are supported.
Information structure of a view.
Pixel_info pixel_info
Pixel information.
unsigned long height
Height of the view in pixels.
unsigned long width
Width of the view in pixels.
unsigned buffer_index
Number of the buffer used for this view.
unsigned long xpos
X position in pixels of the view in the Goos.
unsigned long buffer_offset
Offset in the memory buffer in bytes.
unsigned long bytes_per_line
Bytes per line.
bool has_static_buffer() const
Return whether the view has a static buffer.
unsigned long ypos
Y position in pixels of the view in the Goos.