mirror of
https://github.com/genodelabs/genode.git
synced 2025-03-11 15:04:20 +00:00
backdrop: make width and height customizable
This commit is contained in:
parent
60edfa4d77
commit
c25de5dba3
@ -68,6 +68,14 @@ covering the whole screen or as a single image. The supported attributes are
|
|||||||
viewport can be defined via the 'anchor', 'xpos', and 'ypos' attributes.
|
viewport can be defined via the 'anchor', 'xpos', and 'ypos' attributes.
|
||||||
|
|
||||||
|
|
||||||
|
Customized size
|
||||||
|
---------------
|
||||||
|
|
||||||
|
By default, the backdrop adjusts itself to the physical screen size as
|
||||||
|
reported by the nitpicker GUI server. This default size can be overridden by
|
||||||
|
specifying a fixed size as '<config>' attributes 'width' and 'height'.
|
||||||
|
|
||||||
|
|
||||||
Example
|
Example
|
||||||
~~~~~~~
|
~~~~~~~
|
||||||
|
|
||||||
|
@ -53,8 +53,7 @@ struct Backdrop::Main
|
|||||||
{
|
{
|
||||||
Nitpicker::Connection &nitpicker;
|
Nitpicker::Connection &nitpicker;
|
||||||
|
|
||||||
/* physical screen size */
|
Framebuffer::Mode const mode;
|
||||||
Framebuffer::Mode const mode = nitpicker.mode();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return dataspace capability for virtual framebuffer
|
* Return dataspace capability for virtual framebuffer
|
||||||
@ -84,8 +83,8 @@ struct Backdrop::Main
|
|||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*/
|
*/
|
||||||
Buffer(Genode::Env &env, Nitpicker::Connection &nitpicker)
|
Buffer(Genode::Env &env, Nitpicker::Connection &nitpicker, Framebuffer::Mode mode)
|
||||||
: nitpicker(nitpicker),
|
: nitpicker(nitpicker), mode(mode),
|
||||||
fb_ds(env.rm(), _ds_cap(nitpicker)),
|
fb_ds(env.rm(), _ds_cap(nitpicker)),
|
||||||
surface_ds(env.ram(), env.rm(), surface_num_bytes())
|
surface_ds(env.ram(), env.rm(), surface_num_bytes())
|
||||||
{ }
|
{ }
|
||||||
@ -325,7 +324,13 @@ void Backdrop::Main::_handle_config()
|
|||||||
{
|
{
|
||||||
_config.update();
|
_config.update();
|
||||||
|
|
||||||
_buffer.construct(_env, _nitpicker);
|
Framebuffer::Mode const phys_mode = _nitpicker.mode();
|
||||||
|
Framebuffer::Mode const
|
||||||
|
mode(_config.xml().attribute_value("width", (unsigned)phys_mode.width()),
|
||||||
|
_config.xml().attribute_value("height", (unsigned)phys_mode.height()),
|
||||||
|
phys_mode.format());
|
||||||
|
|
||||||
|
_buffer.construct(_env, _nitpicker, mode);
|
||||||
|
|
||||||
/* clear surface */
|
/* clear surface */
|
||||||
_apply_fill(Xml_node("<fill color=\"#000000\"/>"));
|
_apply_fill(Xml_node("<fill color=\"#000000\"/>"));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user