24#include <l4/re/video/colors>
27namespace L4Re {
namespace Video {
51 : _goos(goos), _view_idx(_goos.
is_valid() ? idx : ~0U) {}
53 unsigned view_index()
const noexcept
54 {
return _goos.
is_valid() ? _view_idx : ~0U; }
66 F_set_buffer_offset = 0x02,
67 F_set_bytes_per_line = 0x04,
69 F_set_position = 0x10,
70 F_dyn_allocated = 0x20,
71 F_set_background = 0x40,
75 F_fully_dynamic = F_set_buffer | F_set_buffer_offset | F_set_bytes_per_line
76 | F_set_pixel | F_set_position | F_dyn_allocated,
88 F_flags_mask = 0xff000,
97 unsigned view_index = 0;
99 unsigned long xpos = 0;
100 unsigned long ypos = 0;
101 unsigned long width = 0;
102 unsigned long height = 0;
103 unsigned long buffer_offset = 0;
104 unsigned long bytes_per_line = 0;
106 unsigned buffer_index = 0;
125 template<
typename OUT >
128 s.printf(
"View::Info:\n"
132 " bytes_per_line: %ld\n"
133 " buffer_offset: %lx\n"
135 flags, width, height, xpos, ypos,
136 bytes_per_line, buffer_offset);
149 int info(Info *info)
const noexcept;
161 int set_info(Info
const &info)
const noexcept;
174 int set_viewport(
int scr_x,
int scr_y,
int w,
int h,
unsigned long buf_offset)
const noexcept;
185 int stack(
View const &pivot,
bool behind =
true) const noexcept;
188 int push_top() const noexcept
189 {
return stack(
View(),
true); }
193 {
return stack(
View(),
false); }
205 int refresh(
int x,
int y,
int w,
int h)
const noexcept;
233 F_auto_refresh = 0x01,
235 F_dynamic_views = 0x04,
236 F_dynamic_buffers = 0x08,
260 : width(0), height(0), flags(0), num_static_views(0),
261 num_static_buffers(0) {}
281 L4_RPC(
long, get_static_buffer, (
unsigned idx,
292 L4_RPC(
long, create_buffer, (
unsigned long size,
317 long r = create_view_t::call(c(), utcb);
320 *view =
View(cap(), r);
337 return delete_view_t::call(c(), v._view_idx, utcb);
345 View view(
unsigned index)
const noexcept;
355 L4_INLINE_RPC(
long, view_stack, (
unsigned index,
unsigned pivit,
bool behind));
356 L4_INLINE_RPC(
long, view_refresh, (
unsigned index,
int x,
int y,
int w,
int h));
359 info_t, get_static_buffer_t, create_buffer_t, create_view_t, delete_buffer_t,
360 delete_view_t, view_info_t, set_view_info_t, view_stack_t, view_refresh_t,
367{
return View(cap(), index); }
371{
return _goos->view_info(_view_idx, info); }
375{
return _goos->set_view_info(_view_idx, info); }
379{
return _goos->view_stack(_view_idx, pivot._view_idx, behind); }
383{
return _goos->view_refresh(_view_idx, x, y, w, h); }
387 unsigned long buf_offset)
const noexcept
390 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.