15#include <l4/re/util/env_ns>
16#include <l4/re/util/video/goos_fb>
17#include <l4/re/video/goos>
19namespace L4Re {
namespace Util {
namespace Video {
36 unsigned _buffer_index;
41 using namespace L4Re::Video;
44 long ret = _goos->info(&gi);
50 ret = _goos->create_view(&_view);
57 _view = _goos->view(0);
60 ret = _view.
info(&vi);
70 ret = _goos->get_static_buffer(vi.
buffer_index, _buffer);
78 ret = _goos->create_buffer(buffer_sz, _buffer);
82 _buffer_index =
static_cast<unsigned>(ret);
83 _flags |= F_dyn_buffer;
109 Goos_fb(Goos_fb
const &);
110 void operator = (Goos_fb
const &);
123 long init(
char const *name)
130 _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()
167 ->attach(&fb_addr, _buffer->size(),
176 int refresh(
int x,
int y,
int w,
int h)
177 {
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.
L4::Cap< Rm > rm() const noexcept
Object-capability to the region map.
L4::Cap< void > alloc() noexcept override
Allocate a capability.
void free(L4::Cap< void > cap, l4_cap_idx_t task=L4_INVALID_CAP, unsigned unmap_flags=L4_FP_ALL_SPACES) noexcept override
Free a capability.
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.
l4_cap_idx_t cap() const noexcept
Return capability selector.
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.
@ 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.