24 #include <l4/re/video/colors> 27 namespace L4Re {
namespace Video {
43 : _goos(goos), _view_idx(_goos.
is_valid() ? idx : ~0U) {}
45 unsigned view_index()
const throw()
46 {
return _goos.
is_valid() ? _view_idx : ~0U; }
58 F_set_buffer_offset = 0x02,
59 F_set_bytes_per_line = 0x04,
61 F_set_position = 0x10,
62 F_dyn_allocated = 0x20,
63 F_set_background = 0x40,
67 F_fully_dynamic = F_set_buffer | F_set_buffer_offset | F_set_bytes_per_line
68 | F_set_pixel | F_set_position | F_dyn_allocated,
80 F_flags_mask = 0xff000,
117 template<
typename OUT >
120 s.printf(
"View::Info:\n" 124 " bytes_per_line: %ld\n" 125 " buffer_offset: %lx\n" 127 flags, width, height, xpos, ypos,
128 bytes_per_line, buffer_offset);
141 int info(
Info *info)
const throw();
153 int set_info(
Info const &info)
const throw();
166 int set_viewport(
int scr_x,
int scr_y,
int w,
int h,
unsigned long buf_offset)
const throw();
177 int stack(
View const &pivot,
bool behind =
true)
const throw();
181 {
return stack(
View(),
true); }
185 {
return stack(
View(),
false); }
197 int refresh(
int x,
int y,
int w,
int h)
const throw();
214 F_auto_refresh = 0x01,
216 F_dynamic_views = 0x04,
217 F_dynamic_buffers = 0x08,
241 : width(0), height(0), flags(0), num_static_views(0),
242 num_static_buffers(0) {}
262 L4_RPC(
long, get_static_buffer, (
unsigned idx,
273 L4_RPC(
long, create_buffer, (
unsigned long size,
298 long r = create_view_t::call(c(), utcb);
301 *view =
View(cap(), r);
318 return delete_view_t::call(c(), v._view_idx, utcb);
326 View view(
unsigned index)
const throw();
336 L4_INLINE_RPC(
long, view_stack, (
unsigned index,
unsigned pivit,
bool behind));
337 L4_INLINE_RPC(
long, view_refresh, (
unsigned index,
int x,
int y,
int w,
int h));
340 info_t, get_static_buffer_t, create_buffer_t, create_view_t, delete_buffer_t,
341 delete_view_t, view_info_t, set_view_info_t, view_stack_t, view_refresh_t,
348 {
return View(cap(), index); }
352 {
return _goos->view_info(_view_idx, info); }
356 {
return _goos->set_view_info(_view_idx, info); }
360 {
return _goos->view_stack(_view_idx, pivot._view_idx, behind); }
364 {
return _goos->view_refresh(_view_idx, x, y, w, h); }
368 unsigned long buf_offset)
const throw()
371 i.
flags = F_set_buffer_offset | F_set_position;
unsigned long width
Width of the view in pixels.
unsigned view_index
Index of the view.
bool valid() const
Return whether this view is valid.
unsigned long ypos
Y position in pixels of the view in the goos.
V_flags
Property flags of a view.
Information structure of a view.
unsigned flags
Flags, see Flags and V_flags.
int push_top() const
Make this view the top-most view.
Standard list of RPCs of an interface.
bool has_dynamic_views() const
Return whether dynamic view are supported.
unsigned num_static_buffers
Number of static buffers.
int info(Info *info) const
Return the view information of the view.
bool has_set_pixel() const
Return whether the given pixel information is valid.
int set_viewport(int scr_x, int scr_y, int w, int h, unsigned long buf_offset) const
Set the position of the view in the goos.
unsigned long l4_cap_idx_t
L4 Capability selector Type.
bool has_static_buffer() const
Return whether the view has a static buffer.
struct l4_utcb_t l4_utcb_t
Opaque type for the UTCB.
int set_info(Info const &info) const
Set the information structure for this view.
unsigned flags
Flags, see Flags.
int delete_view(View const &v, l4_utcb_t *utcb=l4_utcb()) const
Delete a view.
Mark an argument as a output value in an RPC signature.
L4::Cap related definitions.
Pixel_info pixel_info
Pixel information.
unsigned long height
Height.
View view(unsigned index) const
Return a view.
unsigned long buffer_offset
Offset in the memory buffer in bytes.
int push_bottom() const
Push this view the back.
bool auto_refresh() const
Return whether this goos does auto refreshing or the view refresh functions must be used to make chan...
bool has_set_bytes_per_line() const
Return whether the given bytes-per-line value is valid.
#define L4_INLINE_RPC(res, name, args, attr...)
Define an inline RPC call (type and callable).
Information structure of a goos.
bool has_set_buffer() const
Return whether a buffer is set.
void dump(OUT &s) const
Dump information on the pixel to a stream.
void dump(OUT &s) const
Dump information on the view information to a stream.
unsigned buffer_index
Number of the buffer used for this view.
unsigned num_static_views
Number of static view.
bool has_static_buffer_offset() const
Return whether the static buffer offset is available.
Interface Definition Language.
unsigned long bytes_per_line
Bytes per line.
bool has_set_position() const
Return whether the position information given is valid.
int create_view(View *view, l4_utcb_t *utcb=l4_utcb()) const
Create a view.
bool has_pointer() const
Return whether a pointer is used by the provider of the goos.
l4_utcb_t * l4_utcb(void) L4_NOTHROW L4_PURE
Get the UTCB address.
unsigned long width
Width.
unsigned long xpos
X position in pixels of the view in the goos.
Pixel_info pixel_info
Pixel information.
int refresh(int x, int y, int w, int h) const
Refresh/Redraw the view.
bool is_valid() const
Test whether the capability is a valid capability index (i.e., not L4_INVALID_CAP).
Helper class to create an L4Re interface class that is derived from a single base class...
unsigned long height
Height of the view in pixels.
bool has_dynamic_buffers() const
Return whether dynamic buffers are supported.
C++ interface for capabilities.
bool has_set_buffer_offset() const
Return whether the given buffer offset is valid.
int stack(View const &pivot, bool behind=true) const
Move this view in the view stack.
#define L4_INLINE_RPC_NF(res, name, args...)
Define an inline RPC call type (the type only, no callable).
#define L4_RPC(res, name, args, attr...)
Define an RPC call (type and callable).