13#include <l4/re/video/colors>
16namespace L4Re {
namespace Video {
48 : _goos(goos), _view_idx(_goos.
is_valid() ? idx : ~0U) {}
50 unsigned view_index()
const noexcept
51 {
return _goos.
is_valid() ? _view_idx : ~0U; }
63 F_set_buffer_offset = 0x02,
64 F_set_bytes_per_line = 0x04,
66 F_set_position = 0x10,
67 F_dyn_allocated = 0x20,
68 F_set_background = 0x40,
72 F_fully_dynamic = F_set_buffer | F_set_buffer_offset | F_set_bytes_per_line
73 | F_set_pixel | F_set_position | F_dyn_allocated,
85 F_flags_mask = 0xff000,
94 unsigned view_index = 0;
96 unsigned long xpos = 0;
97 unsigned long ypos = 0;
98 unsigned long width = 0;
99 unsigned long height = 0;
100 unsigned long buffer_offset = 0;
101 unsigned long bytes_per_line = 0;
103 unsigned buffer_index = 0;
122 template<
typename OUT >
125 s.printf(
"View::Info:\n"
129 " bytes_per_line: %ld\n"
130 " buffer_offset: %lx\n"
132 flags, width, height, xpos, ypos,
133 bytes_per_line, buffer_offset);
146 int info(Info *info)
const noexcept;
158 int set_info(Info
const &info)
const noexcept;
171 int set_viewport(
int scr_x,
int scr_y,
int w,
int h,
unsigned long buf_offset)
const noexcept;
182 int stack(
View const &pivot,
bool behind =
true) const noexcept;
185 int push_top() const noexcept
186 {
return stack(
View(),
true); }
185 int push_top() const noexcept {
…}
190 {
return stack(
View(),
false); }
202 int refresh(
int x,
int y,
int w,
int h)
const noexcept;
230 F_auto_refresh = 0x01,
232 F_dynamic_views = 0x04,
233 F_dynamic_buffers = 0x08,
257 : width(0), height(0), flags(0), num_static_views(0),
258 num_static_buffers(0) {}
278 L4_RPC(
long, get_static_buffer, (
unsigned idx,
289 L4_RPC(
long, create_buffer, (
unsigned long size,
314 long r = create_view_t::call(c(), utcb);
317 *view =
View(cap(), r);
334 return delete_view_t::call(c(), v._view_idx, utcb);
342 View view(
unsigned index)
const noexcept;
352 L4_INLINE_RPC(
long, view_stack, (
unsigned index,
unsigned pivit,
bool behind));
353 L4_INLINE_RPC(
long, view_refresh, (
unsigned index,
int x,
int y,
int w,
int h));
356 info_t, get_static_buffer_t, create_buffer_t, create_view_t, delete_buffer_t,
357 delete_view_t, view_info_t, set_view_info_t, view_stack_t, view_refresh_t,
364{
return View(cap(), index); }
368{
return _goos->view_info(_view_idx, info); }
372{
return _goos->set_view_info(_view_idx, info); }
376{
return _goos->view_stack(_view_idx, pivot._view_idx, behind); }
380{
return _goos->view_refresh(_view_idx, x, y, w, h); }
384 unsigned long buf_offset)
const noexcept
387 i.
flags = F_set_buffer_offset | F_set_position;
L4::Cap related definitions.
Class that abstracts framebuffers.
int create_view(View *view, l4_utcb_t *utcb=l4_utcb()) const noexcept
Create a view.
View view(unsigned index) const noexcept
Return a view.
int delete_view(View const &v, l4_utcb_t *utcb=l4_utcb()) const noexcept
Delete a view.
void dump(OUT &s) const
Dump information on the pixel to a stream.
int set_info(Info const &info) const noexcept
Set the information structure for this view.
V_flags
Property flags of a view.
int push_bottom() const noexcept
Push this view the back.
int info(Info *info) const noexcept
Return the view information of the view.
bool valid() const
Return whether this view is valid.
int set_viewport(int scr_x, int scr_y, int w, int h, unsigned long buf_offset) const noexcept
Set the position of the view in the Goos.
int refresh(int x, int y, int w, int h) const noexcept
Refresh/Redraw the view.
int stack(View const &pivot, bool behind=true) const noexcept
Move this view in the view stack.
bool is_valid() const noexcept
Test whether the capability is a valid capability index (i.e., not L4_INVALID_CAP).
C++ interface for capabilities.
Helper class to create an L4Re interface class that is derived from a single base class.
unsigned long l4_cap_idx_t
Capability selector type.
struct l4_utcb_t l4_utcb_t
Opaque type for the UTCB.
l4_utcb_t * l4_utcb(void) L4_NOTHROW L4_PURE
Get the UTCB address.
#define L4_EXPORT
Attribute to mark functions, variables, and data types as being exported from a library.
Interface Definition Language.
#define L4_INLINE_RPC(res, name, args, attr...)
Define an inline RPC call (type and callable).
#define L4_RPC(res, name, args, attr...)
Define an RPC call (type and callable).
#define L4_INLINE_RPC_NF(res, name, args...)
Define an inline RPC call type (the type only, no callable).
Information structure of a Goos.
bool auto_refresh() const
Return whether this Goos does auto refreshing or the view refresh functions must be used to make chan...
unsigned long height
Height.
unsigned long width
Width.
Pixel_info pixel_info
Pixel information.
bool has_dynamic_buffers() const
Return whether dynamic buffers are supported.
bool has_pointer() const
Return whether a pointer is used by the provider of the Goos.
bool has_dynamic_views() const
Return whether dynamic view are supported.
unsigned flags
Flags, see Flags.
unsigned num_static_buffers
Number of static buffers.
unsigned num_static_views
Number of static view.
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.
bool has_set_buffer() const
Return whether a buffer is set.
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 view_index
Index of the view.
unsigned long buffer_offset
Offset in the memory buffer in bytes.
bool has_set_pixel() const
Return whether the given pixel information is valid.
unsigned long bytes_per_line
Bytes per line.
bool has_static_buffer() const
Return whether the view has a static buffer.
void dump(OUT &s) const
Dump information on the view information to a stream.
bool has_set_buffer_offset() const
Return whether the given buffer offset is valid.
unsigned long ypos
Y position in pixels of the view in the Goos.
bool has_set_bytes_per_line() const
Return whether the given bytes-per-line value is valid.
unsigned flags
Flags, see Flags and V_flags.
bool has_static_buffer_offset() const
Return whether the static buffer offset is available.
bool has_set_position() const
Return whether the position information given is valid.
Mark an argument as a output value in an RPC signature.
Standard list of RPCs of an interface.