Rename 'Nitpicker' namespace to 'Gui'

Issue #3778
This commit is contained in:
Norman Feske
2020-06-12 11:23:57 +02:00
parent e8f5706382
commit 5d40c0c1ce
145 changed files with 1856 additions and 1869 deletions

View File

@ -1,5 +1,5 @@
/*
* \brief Fader for a nitpicker client
* \brief Fader for a GUI client
* \author Norman Feske
* \date 2014-09-08
*/
@ -29,13 +29,13 @@
/* local includes */
#include <alpha_dither_painter.h>
namespace Nit_fader {
namespace Gui_fader {
class Main;
class Src_buffer;
class Dst_buffer;
class Framebuffer_session_component;
class Nitpicker_session_component;
class Gui_session_component;
typedef Genode::Surface_base::Area Area;
typedef Genode::Surface_base::Point Point;
@ -58,7 +58,7 @@ namespace Nit_fader {
/**
* Buffer handed out to our client as virtual framebuffer
*/
class Nit_fader::Src_buffer
class Gui_fader::Src_buffer
{
private:
@ -96,7 +96,7 @@ class Nit_fader::Src_buffer
};
class Nit_fader::Dst_buffer
class Gui_fader::Dst_buffer
{
private:
@ -129,7 +129,7 @@ class Nit_fader::Dst_buffer
};
class Nit_fader::Framebuffer_session_component
class Gui_fader::Framebuffer_session_component
:
public Genode::Rpc_object<Framebuffer::Session>
{
@ -137,8 +137,8 @@ class Nit_fader::Framebuffer_session_component
Genode::Env &_env;
Nitpicker::Connection &_nitpicker;
Src_buffer &_src_buffer;
Gui::Connection &_gui;
Src_buffer &_src_buffer;
Constructible<Dst_buffer> _dst_buffer { };
@ -150,11 +150,11 @@ class Nit_fader::Framebuffer_session_component
/**
* Constructor
*/
Framebuffer_session_component(Genode::Env &env,
Nitpicker::Connection &nitpicker,
Src_buffer &src_buffer)
Framebuffer_session_component(Genode::Env &env,
Gui::Connection &gui,
Src_buffer &src_buffer)
:
_env(env), _nitpicker(nitpicker), _src_buffer(src_buffer)
_env(env), _gui(gui), _src_buffer(src_buffer)
{ }
void dst_buffer(Dataspace_capability ds_cap, Area size)
@ -207,7 +207,7 @@ class Nit_fader::Framebuffer_session_component
transfer_src_to_dst_alpha(rect);
_nitpicker.framebuffer()->refresh(rect.x1(), rect.y1(), rect.w(), rect.h());
_gui.framebuffer()->refresh(rect.x1(), rect.y1(), rect.w(), rect.h());
/* keep animating as long as the destination value is not reached */
return _fade != _fade.dst();
@ -230,12 +230,12 @@ class Nit_fader::Framebuffer_session_component
Framebuffer::Mode mode() const override
{
return _nitpicker.framebuffer()->mode();
return _gui.framebuffer()->mode();
}
void mode_sigh(Genode::Signal_context_capability sigh) override
{
_nitpicker.framebuffer()->mode_sigh(sigh);
_gui.framebuffer()->mode_sigh(sigh);
}
void refresh(int x, int y, int w, int h) override
@ -243,42 +243,42 @@ class Nit_fader::Framebuffer_session_component
transfer_src_to_dst_pixel(Rect(Point(x, y), Area(w, h)));
transfer_src_to_dst_alpha(Rect(Point(x, y), Area(w, h)));
_nitpicker.framebuffer()->refresh(x, y, w, h);
_gui.framebuffer()->refresh(x, y, w, h);
}
void sync_sigh(Genode::Signal_context_capability sigh) override
{
_nitpicker.framebuffer()->sync_sigh(sigh);
_gui.framebuffer()->sync_sigh(sigh);
}
};
class Nit_fader::Nitpicker_session_component
class Gui_fader::Gui_session_component
:
public Genode::Rpc_object<Nitpicker::Session>
public Genode::Rpc_object<Gui::Session>
{
private:
typedef Nitpicker::View_capability View_capability;
typedef Nitpicker::Session::View_handle View_handle;
typedef Gui::View_capability View_capability;
typedef Gui::Session::View_handle View_handle;
Genode::Env &_env;
Reconstructible<Src_buffer> _src_buffer { _env, Area(1, 1), false };
Nitpicker::Connection _nitpicker { _env };
Gui::Connection _gui { _env };
Genode::Attached_ram_dataspace _command_ds {
_env.ram(), _env.rm(), sizeof(Nitpicker::Session::Command_buffer) };
_env.ram(), _env.rm(), sizeof(Gui::Session::Command_buffer) };
Nitpicker::Session::Command_buffer &_commands =
*_command_ds.local_addr<Nitpicker::Session::Command_buffer>();
Gui::Session::Command_buffer &_commands =
*_command_ds.local_addr<Gui::Session::Command_buffer>();
Framebuffer_session_component _fb_session { _env, _nitpicker, *_src_buffer };
Framebuffer_session_component _fb_session { _env, _gui, *_src_buffer };
Framebuffer::Session_capability _fb_cap { _env.ep().manage(_fb_session) };
Nitpicker::Session::View_handle _view_handle { };
Gui::Session::View_handle _view_handle { };
bool _view_visible = false;
Rect _view_geometry { };
@ -288,14 +288,14 @@ class Nit_fader::Nitpicker_session_component
if (!_view_handle.valid() || (_view_visible == _fb_session.visible()))
return;
typedef Nitpicker::Session::Command Command;
typedef Gui::Session::Command Command;
if (_fb_session.visible())
_nitpicker.enqueue<Command::Geometry>(_view_handle, _view_geometry);
_gui.enqueue<Command::Geometry>(_view_handle, _view_geometry);
else
_nitpicker.enqueue<Command::Geometry>(_view_handle, Rect());
_gui.enqueue<Command::Geometry>(_view_handle, Rect());
_nitpicker.execute();
_gui.execute();
_view_visible = _fb_session.visible();
}
@ -305,13 +305,13 @@ class Nit_fader::Nitpicker_session_component
/**
* Constructor
*/
Nitpicker_session_component(Genode::Env &env) : _env(env)
Gui_session_component(Genode::Env &env) : _env(env)
{ }
/**
* Destructor
*/
~Nitpicker_session_component()
~Gui_session_component()
{
_env.ep().dissolve(_fb_session);
}
@ -331,9 +331,9 @@ class Nit_fader::Nitpicker_session_component
}
/**********************************
** Nitpicker::Session interface **
**********************************/
/****************************
** Gui::Session interface **
****************************/
Framebuffer::Session_capability framebuffer_session() override
{
@ -342,35 +342,35 @@ class Nit_fader::Nitpicker_session_component
Input::Session_capability input_session() override
{
return _nitpicker.input_session();
return _gui.input_session();
}
View_handle create_view(View_handle parent) override
{
_view_handle = _nitpicker.create_view(parent);
_view_handle = _gui.create_view(parent);
_update_view_visibility();
return _view_handle;
}
void destroy_view(View_handle handle) override
{
return _nitpicker.destroy_view(handle);
return _gui.destroy_view(handle);
}
View_handle view_handle(View_capability view_cap,
View_handle handle) override
{
return _nitpicker.view_handle(view_cap, handle);
return _gui.view_handle(view_cap, handle);
}
View_capability view_capability(View_handle handle) override
{
return _nitpicker.view_capability(handle);
return _gui.view_capability(handle);
}
void release_view_handle(View_handle handle) override
{
_nitpicker.release_view_handle(handle);
_gui.release_view_handle(handle);
}
Dataspace_capability command_dataspace() override
@ -382,11 +382,11 @@ class Nit_fader::Nitpicker_session_component
{
for (unsigned i = 0; i < _commands.num(); i++) {
Nitpicker::Session::Command command = _commands.get(i);
Gui::Session::Command command = _commands.get(i);
bool forward_command = true;
if (command.opcode == Nitpicker::Session::Command::OP_GEOMETRY) {
if (command.opcode == Gui::Session::Command::OP_GEOMETRY) {
/* remember view geometry as defined by the client */
_view_geometry = command.geometry.rect;
@ -396,21 +396,21 @@ class Nit_fader::Nitpicker_session_component
}
if (forward_command)
_nitpicker.enqueue(command);
_gui.enqueue(command);
}
_fb_session.transfer_src_to_dst_pixel(Rect(Point(0, 0), _fb_session.size()));
_fb_session.transfer_src_to_dst_alpha(Rect(Point(0, 0), _fb_session.size()));
return _nitpicker.execute();
return _gui.execute();
}
Framebuffer::Mode mode() override
{
return _nitpicker.mode();
return _gui.mode();
}
void mode_sigh(Genode::Signal_context_capability sigh) override
{
_nitpicker.mode_sigh(sigh);
_gui.mode_sigh(sigh);
}
void buffer(Framebuffer::Mode mode, bool use_alpha) override
@ -419,19 +419,19 @@ class Nit_fader::Nitpicker_session_component
_src_buffer.construct(_env, size, use_alpha);
_nitpicker.buffer(mode, true);
_gui.buffer(mode, true);
_fb_session.dst_buffer(_nitpicker.framebuffer()->dataspace(), size);
_fb_session.dst_buffer(_gui.framebuffer()->dataspace(), size);
}
void focus(Genode::Capability<Session> focused) override
{
_nitpicker.focus(focused);
_gui.focus(focused);
}
};
struct Nit_fader::Main
struct Gui_fader::Main
{
Genode::Env &env;
@ -461,17 +461,17 @@ struct Nit_fader::Main
env.ep(), *this, &Main::handle_config_update
};
Nitpicker_session_component nitpicker_session { env };
Gui_session_component gui_session { env };
Genode::Static_root<Nitpicker::Session> nitpicker_root
Genode::Static_root<Gui::Session> gui_root
{
env.ep().manage(nitpicker_session)
env.ep().manage(gui_session)
};
void handle_timer()
{
Genode::uint64_t frame = curr_frame();
if (nitpicker_session.animate(frame - last_frame))
if (gui_session.animate(frame - last_frame))
timer.trigger_once(PERIOD);
last_frame = frame;
@ -491,12 +491,12 @@ struct Nit_fader::Main
/* apply initial config */
handle_config_update();
env.parent().announce(env.ep().manage(nitpicker_root));
env.parent().announce(env.ep().manage(gui_root));
}
};
void Nit_fader::Main::handle_config_update()
void Gui_fader::Main::handle_config_update()
{
config.update();
@ -521,7 +521,7 @@ void Nit_fader::Main::handle_config_update()
initial_fade_in = false;
nitpicker_session.fade(280*new_alpha, steps);
gui_session.fade(280*new_alpha, steps);
alpha = new_alpha;
@ -537,4 +537,4 @@ void Nit_fader::Main::handle_config_update()
***************/
void Component::construct(Genode::Env &env) {
static Nit_fader::Main desktop(env); }
static Gui_fader::Main desktop(env); }

View File

@ -1,5 +1,5 @@
/*
* \brief Nitpicker service provided to decorator
* \brief GUI service provided to decorator
* \author Norman Feske
* \date 2014-02-14
*/
@ -11,8 +11,8 @@
* under the terms of the GNU Affero General Public License version 3.
*/
#ifndef _DECORATOR_NITPICKER_H_
#define _DECORATOR_NITPICKER_H_
#ifndef _DECORATOR_GUI_H_
#define _DECORATOR_GUI_H_
/* Genode includes */
#include <util/string.h>
@ -42,7 +42,7 @@ namespace Wm { class Main;
namespace Wm {
struct Decorator_nitpicker_session;
struct Decorator_gui_session;
struct Decorator_content_callback;
struct Decorator_content_registry;
}
@ -52,7 +52,7 @@ struct Wm::Decorator_content_callback : Interface
{
virtual void content_geometry(Window_registry::Id win_id, Rect rect) = 0;
virtual Nitpicker::View_capability content_view(Window_registry::Id win_id) = 0;
virtual Gui::View_capability content_view(Window_registry::Id win_id) = 0;
virtual void update_content_child_views(Window_registry::Id win_id) = 0;
};
@ -69,13 +69,14 @@ class Wm::Decorator_content_registry
private:
using View_handle = Gui::Session::View_handle;
struct Entry : List<Entry>::Element
{
Nitpicker::Session::View_handle const decorator_view_handle;
Window_registry::Id const win_id;
View_handle const decorator_view_handle;
Window_registry::Id const win_id;
Entry(Nitpicker::Session::View_handle decorator_view_handle,
Window_registry::Id win_id)
Entry(View_handle decorator_view_handle, Window_registry::Id win_id)
:
decorator_view_handle(decorator_view_handle),
win_id(win_id)
@ -85,7 +86,7 @@ class Wm::Decorator_content_registry
List<Entry> _list { };
Allocator &_entry_alloc;
Entry const &_lookup(Nitpicker::Session::View_handle view_handle) const
Entry const &_lookup(View_handle view_handle) const
{
for (Entry const *e = _list.first(); e; e = e->next()) {
if (e->decorator_view_handle == view_handle)
@ -114,8 +115,7 @@ class Wm::Decorator_content_registry
_remove(*e);
}
void insert(Nitpicker::Session::View_handle decorator_view_handle,
Window_registry::Id win_id)
void insert(View_handle decorator_view_handle, Window_registry::Id win_id)
{
Entry *e = new (_entry_alloc) Entry(decorator_view_handle, win_id);
_list.insert(e);
@ -126,12 +126,12 @@ class Wm::Decorator_content_registry
*
* \throw Lookup_failed
*/
Window_registry::Id lookup(Nitpicker::Session::View_handle view_handle) const
Window_registry::Id lookup(View_handle view_handle) const
{
return _lookup(view_handle).win_id;
}
bool registered(Nitpicker::Session::View_handle view_handle) const
bool registered(View_handle view_handle) const
{
try { lookup(view_handle); return true; } catch (...) { }
return false;
@ -142,21 +142,22 @@ class Wm::Decorator_content_registry
*
* \throw Lookup_failed
*/
void remove(Nitpicker::Session::View_handle view_handle)
void remove(View_handle view_handle)
{
_remove(_lookup(view_handle));
}
};
struct Wm::Decorator_nitpicker_session : Genode::Rpc_object<Nitpicker::Session>,
private List<Decorator_nitpicker_session>::Element
struct Wm::Decorator_gui_session : Genode::Rpc_object<Gui::Session>,
private List<Decorator_gui_session>::Element
{
friend class List<Decorator_nitpicker_session>;
using List<Decorator_nitpicker_session>::Element::next;
friend class List<Decorator_gui_session>;
using List<Decorator_gui_session>::Element::next;
typedef Nitpicker::View_capability View_capability;
typedef Nitpicker::Session::View_handle View_handle;
using View_capability = Gui::View_capability;
using View_handle = Gui::Session::View_handle;
using Command_buffer = Gui::Session::Command_buffer;
Genode::Env &_env;
@ -164,12 +165,10 @@ struct Wm::Decorator_nitpicker_session : Genode::Rpc_object<Nitpicker::Session>,
Genode::Ram_allocator &_ram;
Nitpicker::Connection _nitpicker_session { _env, "decorator" };
Gui::Connection _gui_session { _env, "decorator" };
Genode::Signal_context_capability _mode_sigh { };
typedef Nitpicker::Session::Command_buffer Command_buffer;
Attached_ram_dataspace _command_ds { _ram, _env.rm(), sizeof(Command_buffer) };
Command_buffer &_command_buffer = *_command_ds.local_addr<Command_buffer>();
@ -191,26 +190,26 @@ struct Wm::Decorator_nitpicker_session : Genode::Rpc_object<Nitpicker::Session>,
Allocator &_md_alloc;
/* Nitpicker::Connection requires a valid input session */
/* Gui::Connection requires a valid input session */
Input::Session_component _dummy_input_component { _env, _env.ram() };
Input::Session_capability _dummy_input_component_cap =
_env.ep().manage(_dummy_input_component);
Signal_handler<Decorator_nitpicker_session>
_input_handler { _env.ep(), *this, &Decorator_nitpicker_session::_handle_input };
Signal_handler<Decorator_gui_session>
_input_handler { _env.ep(), *this, &Decorator_gui_session::_handle_input };
/**
* Constructor
*
* \param ep entrypoint used for dispatching signals
*/
Decorator_nitpicker_session(Genode::Env &env,
Genode::Ram_allocator &ram,
Allocator &md_alloc,
Reporter &pointer_reporter,
Last_motion &last_motion,
Input::Session_component &window_layouter_input,
Decorator_content_callback &content_callback)
Decorator_gui_session(Genode::Env &env,
Genode::Ram_allocator &ram,
Allocator &md_alloc,
Reporter &pointer_reporter,
Last_motion &last_motion,
Input::Session_component &window_layouter_input,
Decorator_content_callback &content_callback)
:
_env(env),
_ram(ram),
@ -220,10 +219,10 @@ struct Wm::Decorator_nitpicker_session : Genode::Rpc_object<Nitpicker::Session>,
_content_callback(content_callback),
_md_alloc(md_alloc)
{
_nitpicker_session.input()->sigh(_input_handler);
_gui_session.input()->sigh(_input_handler);
}
~Decorator_nitpicker_session()
~Decorator_gui_session()
{
_env.ep().dissolve(_dummy_input_component);
}
@ -238,8 +237,8 @@ struct Wm::Decorator_nitpicker_session : Genode::Rpc_object<Nitpicker::Session>,
});
};
while (_nitpicker_session.input()->pending())
_nitpicker_session.input()->for_each_event([&] (Input::Event const &ev) {
while (_gui_session.input()->pending())
_gui_session.input()->for_each_event([&] (Input::Event const &ev) {
if (ev.press()) _key_cnt++;
@ -325,14 +324,13 @@ struct Wm::Decorator_nitpicker_session : Genode::Rpc_object<Nitpicker::Session>,
* Replace content view originally created by the decorator
* by view that shows the real window content.
*/
Nitpicker::View_capability view_cap =
_content_callback.content_view(win_id);
View_capability view_cap = _content_callback.content_view(win_id);
_nitpicker_session.destroy_view(view_handle);
_nitpicker_session.view_handle(view_cap, view_handle);
_gui_session.destroy_view(view_handle);
_gui_session.view_handle(view_cap, view_handle);
_nitpicker_session.enqueue(cmd);
_nitpicker_session.execute();
_gui_session.enqueue(cmd);
_gui_session.execute();
/*
* Now that the physical content view exists, it is time
@ -342,7 +340,7 @@ struct Wm::Decorator_nitpicker_session : Genode::Rpc_object<Nitpicker::Session>,
} catch (Decorator_content_registry::Lookup_failed) {
_nitpicker_session.enqueue(cmd);
_gui_session.enqueue(cmd);
}
return;
@ -353,8 +351,8 @@ struct Wm::Decorator_nitpicker_session : Genode::Rpc_object<Nitpicker::Session>,
/*
* If the content view changes position, propagate the new
* position to the nitpicker service to properly transform
* absolute input coordinates.
* position to the GUI service to properly transform absolute
* input coordinates.
*/
Window_registry::Id win_id = _content_registry.lookup(cmd.geometry.view);
@ -363,7 +361,7 @@ struct Wm::Decorator_nitpicker_session : Genode::Rpc_object<Nitpicker::Session>,
catch (Decorator_content_registry::Lookup_failed) { }
/* forward command */
_nitpicker_session.enqueue(cmd);
_gui_session.enqueue(cmd);
return;
case Command::OP_OFFSET:
@ -377,14 +375,14 @@ struct Wm::Decorator_nitpicker_session : Genode::Rpc_object<Nitpicker::Session>,
_content_registry.lookup(cmd.geometry.view);
}
catch (Decorator_content_registry::Lookup_failed) {
_nitpicker_session.enqueue(cmd);
_gui_session.enqueue(cmd);
}
return;
case Command::OP_BACKGROUND:
case Command::OP_NOP:
_nitpicker_session.enqueue(cmd);
_gui_session.enqueue(cmd);
return;
}
}
@ -392,17 +390,17 @@ struct Wm::Decorator_nitpicker_session : Genode::Rpc_object<Nitpicker::Session>,
void upgrade(const char *args)
{
size_t const ram_quota = Arg_string::find_arg(args, "ram_quota").ulong_value(0);
_nitpicker_session.upgrade_ram(ram_quota);
_gui_session.upgrade_ram(ram_quota);
}
/*********************************
** Nitpicker session interface **
*********************************/
/***************************
** GUI session interface **
***************************/
Framebuffer::Session_capability framebuffer_session() override
{
return _nitpicker_session.framebuffer_session();
return _gui_session.framebuffer_session();
}
Input::Session_capability input_session() override
@ -416,7 +414,7 @@ struct Wm::Decorator_nitpicker_session : Genode::Rpc_object<Nitpicker::Session>,
View_handle create_view(View_handle parent) override
{
return _nitpicker_session.create_view(parent);
return _gui_session.create_view(parent);
}
void destroy_view(View_handle view) override
@ -425,28 +423,28 @@ struct Wm::Decorator_nitpicker_session : Genode::Rpc_object<Nitpicker::Session>,
* Reset view geometry when destroying a content view
*/
if (_content_registry.registered(view)) {
Nitpicker::Rect rect(Nitpicker::Point(0, 0), Nitpicker::Area(0, 0));
_nitpicker_session.enqueue<Nitpicker::Session::Command::Geometry>(view, rect);
_nitpicker_session.execute();
Gui::Rect rect(Gui::Point(0, 0), Gui::Area(0, 0));
_gui_session.enqueue<Gui::Session::Command::Geometry>(view, rect);
_gui_session.execute();
}
_nitpicker_session.destroy_view(view);
_gui_session.destroy_view(view);
}
View_handle view_handle(View_capability view_cap, View_handle handle) override
{
return _nitpicker_session.view_handle(view_cap, handle);
return _gui_session.view_handle(view_cap, handle);
}
View_capability view_capability(View_handle view) override
{
return _nitpicker_session.view_capability(view);
return _gui_session.view_capability(view);
}
void release_view_handle(View_handle view) override
{
/* XXX dealloc View_ptr */
_nitpicker_session.release_view_handle(view);
_gui_session.release_view_handle(view);
}
Genode::Dataspace_capability command_dataspace() override
@ -464,12 +462,12 @@ struct Wm::Decorator_nitpicker_session : Genode::Rpc_object<Nitpicker::Session>,
Genode::warning("unhandled exception while processing command from decorator");
}
}
_nitpicker_session.execute();
_gui_session.execute();
}
Framebuffer::Mode mode() override
{
return _nitpicker_session.mode();
return _gui_session.mode();
}
void mode_sigh(Genode::Signal_context_capability sigh) override
@ -479,18 +477,18 @@ struct Wm::Decorator_nitpicker_session : Genode::Rpc_object<Nitpicker::Session>,
* transitive delegations of the capability.
*/
_mode_sigh = sigh;
_nitpicker_session.mode_sigh(sigh);
_gui_session.mode_sigh(sigh);
}
void buffer(Framebuffer::Mode mode, bool use_alpha) override
{
/*
* See comment in 'Wm::Nitpicker::Session_component::buffer'.
* See comment in 'Wm::Gui::Session_component::buffer'.
*/
Nitpicker::Session_client(_env.rm(), _nitpicker_session.cap()).buffer(mode, use_alpha);
Gui::Session_client(_env.rm(), _gui_session.cap()).buffer(mode, use_alpha);
}
void focus(Genode::Capability<Nitpicker::Session>) override { }
void focus(Genode::Capability<Gui::Session>) override { }
};
#endif /* _DECORATOR_NITPICKER_H_ */
#endif /* _DECORATOR_GUI_H_ */

View File

@ -1,5 +1,5 @@
/*
* \brief Pass-through nitpicker service announced to the outside world
* \brief Pass-through GUI service announced to the outside world
* \author Norman Feske
* \date 2015-09-29
*/
@ -11,29 +11,29 @@
* under the terms of the GNU Affero General Public License version 3.
*/
#ifndef _DIRECT_NITPICKER_H_
#define _DIRECT_NITPICKER_H_
#ifndef _DIRECT_GUI_H_
#define _DIRECT_GUI_H_
/* Genode includes */
#include <os/session_policy.h>
#include <gui_session/connection.h>
namespace Wm { class Direct_nitpicker_session; }
namespace Wm { class Direct_gui_session; }
class Wm::Direct_nitpicker_session : public Genode::Rpc_object<Nitpicker::Session>
class Wm::Direct_gui_session : public Genode::Rpc_object<Gui::Session>
{
private:
Genode::Session_label _session_label;
Nitpicker::Connection _session;
Gui::Connection _session;
public:
/**
* Constructor
*/
Direct_nitpicker_session(Genode::Env &env, Genode::Session_label const &session_label)
Direct_gui_session(Genode::Env &env, Genode::Session_label const &session_label)
:
_session_label(session_label),
_session(env, _session_label.string())
@ -46,9 +46,9 @@ class Wm::Direct_nitpicker_session : public Genode::Rpc_object<Nitpicker::Sessio
}
/*********************************
** Nitpicker session interface **
*********************************/
/***************************
** GUI session interface **
***************************/
Framebuffer::Session_capability framebuffer_session() override
{
@ -70,12 +70,12 @@ class Wm::Direct_nitpicker_session : public Genode::Rpc_object<Nitpicker::Sessio
_session.destroy_view(view);
}
View_handle view_handle(Nitpicker::View_capability view_cap, View_handle handle) override
View_handle view_handle(Gui::View_capability view_cap, View_handle handle) override
{
return _session.view_handle(view_cap, handle);
}
Nitpicker::View_capability view_capability(View_handle view) override
Gui::View_capability view_capability(View_handle view) override
{
return _session.view_capability(view);
}
@ -110,10 +110,10 @@ class Wm::Direct_nitpicker_session : public Genode::Rpc_object<Nitpicker::Sessio
_session.buffer(mode, use_alpha);
}
void focus(Genode::Capability<Nitpicker::Session> session) override
void focus(Genode::Capability<Gui::Session> session) override
{
_session.focus(session);
}
};
#endif /* _DIRECT_NITPICKER_H_ */
#endif /* _DIRECT_GUI_H_ */

View File

@ -1,5 +1,5 @@
/*
* \brief Virtualized nitpicker service announced to the outside world
* \brief Virtualized GUI service announced to the outside world
* \author Norman Feske
* \date 2014-02-14
*/
@ -11,8 +11,8 @@
* under the terms of the GNU Affero General Public License version 3.
*/
#ifndef _NITPICKER_H_
#define _NITPICKER_H_
#ifndef _GUI_H_
#define _GUI_H_
/* Genode includes */
#include <util/list.h>
@ -29,9 +29,9 @@
/* local includes */
#include <window_registry.h>
#include <decorator_nitpicker.h>
#include <layouter_nitpicker.h>
#include <direct_nitpicker.h>
#include <decorator_gui.h>
#include <layouter_gui.h>
#include <direct_gui.h>
namespace Wm {
@ -53,9 +53,9 @@ namespace Wm {
using Genode::Interface;
}
namespace Wm { namespace Nitpicker {
namespace Wm { namespace Gui {
using namespace ::Nitpicker;
using namespace ::Gui;
class Click_handler;
class Input_origin_changed_handler;
@ -82,7 +82,7 @@ namespace Wm { namespace Nitpicker {
* clicks into an already focused window should be of no interest to the
* layouter. So we hide them from the layouter.
*/
struct Wm::Nitpicker::Click_handler : Interface
struct Wm::Gui::Click_handler : Interface
{
virtual void handle_click(Point pos) = 0;
virtual void handle_enter(Point pos) = 0;
@ -93,17 +93,17 @@ struct Wm::Nitpicker::Click_handler : Interface
* Called by a top-level view to propagate the need to update the virtual
* pointer position of a client when the client's window moved.
*/
struct Wm::Nitpicker::Input_origin_changed_handler : Interface
struct Wm::Gui::Input_origin_changed_handler : Interface
{
virtual void input_origin_changed() = 0;
};
struct Nitpicker::View : Genode::Interface { GENODE_RPC_INTERFACE(); };
struct Gui::View : Genode::Interface { GENODE_RPC_INTERFACE(); };
class Wm::Nitpicker::View : private Genode::Weak_object<View>,
public Genode::Rpc_object< ::Nitpicker::View>
class Wm::Gui::View : private Genode::Weak_object<View>,
public Genode::Rpc_object< ::Gui::View>
{
private:
@ -112,35 +112,35 @@ class Wm::Nitpicker::View : private Genode::Weak_object<View>,
protected:
typedef Genode::String<100> Title;
typedef Nitpicker::Session::Command Command;
typedef Nitpicker::Session::View_handle View_handle;
using Title = Genode::String<100>;
using Command = Gui::Session::Command;
using View_handle = Gui::Session::View_handle;
Session_label _session_label;
Nitpicker::Session_client &_real_nitpicker;
View_handle _real_handle { };
Title _title { };
Rect _geometry { };
Point _buffer_offset { };
Weak_ptr<View> _neighbor_ptr { };
bool _neighbor_behind { };
bool _has_alpha;
Session_label _session_label;
Gui::Session_client &_real_gui;
View_handle _real_handle { };
Title _title { };
Rect _geometry { };
Point _buffer_offset { };
Weak_ptr<View> _neighbor_ptr { };
bool _neighbor_behind { };
bool _has_alpha;
View(Nitpicker::Session_client &real_nitpicker,
Session_label const &session_label,
bool has_alpha)
View(Gui::Session_client &real_gui,
Session_label const &session_label,
bool has_alpha)
:
_session_label(session_label), _real_nitpicker(real_nitpicker),
_session_label(session_label), _real_gui(real_gui),
_has_alpha(has_alpha)
{ }
/**
* Propagate cached view geometry to the physical nitpicker view
* Propagate cached view geometry to the physical GUI view
*/
virtual void _propagate_view_geometry() = 0;
/**
* Apply cached view state to the physical nitpicker view
* Apply cached view state to the physical GUI view
*/
void _unsynchronized_apply_view_config(Locked_ptr<View> &neighbor)
{
@ -148,23 +148,23 @@ class Wm::Nitpicker::View : private Genode::Weak_object<View>,
return;
_propagate_view_geometry();
_real_nitpicker.enqueue<Command::Offset>(_real_handle, _buffer_offset);
_real_nitpicker.enqueue<Command::Title> (_real_handle, _title.string());
_real_gui.enqueue<Command::Offset>(_real_handle, _buffer_offset);
_real_gui.enqueue<Command::Title> (_real_handle, _title.string());
View_handle real_neighbor_handle;
if (neighbor.valid())
real_neighbor_handle = _real_nitpicker.view_handle(neighbor->real_view_cap());
real_neighbor_handle = _real_gui.view_handle(neighbor->real_view_cap());
if (_neighbor_behind)
_real_nitpicker.enqueue<Command::To_front>(_real_handle, real_neighbor_handle);
_real_gui.enqueue<Command::To_front>(_real_handle, real_neighbor_handle);
else
_real_nitpicker.enqueue<Command::To_back>(_real_handle, real_neighbor_handle);
_real_gui.enqueue<Command::To_back>(_real_handle, real_neighbor_handle);
_real_nitpicker.execute();
_real_gui.execute();
if (real_neighbor_handle.valid())
_real_nitpicker.release_view_handle(real_neighbor_handle);
_real_gui.release_view_handle(real_neighbor_handle);
}
void _apply_view_config()
@ -178,7 +178,7 @@ class Wm::Nitpicker::View : private Genode::Weak_object<View>,
~View()
{
if (_real_handle.valid())
_real_nitpicker.destroy_view(_real_handle);
_real_gui.destroy_view(_real_handle);
}
using Genode::Weak_object<View>::weak_ptr;
@ -193,11 +193,11 @@ class Wm::Nitpicker::View : private Genode::Weak_object<View>,
_geometry = geometry;
/*
* Propagate new size to real nitpicker view but
* Propagate new size to real GUI view but
*/
if (_real_handle.valid()) {
_propagate_view_geometry();
_real_nitpicker.execute();
_real_gui.execute();
}
}
@ -206,8 +206,8 @@ class Wm::Nitpicker::View : private Genode::Weak_object<View>,
_title = Title(title);
if (_real_handle.valid()) {
_real_nitpicker.enqueue<Command::Title>(_real_handle, title);
_real_nitpicker.execute();
_real_gui.enqueue<Command::Title>(_real_handle, title);
_real_gui.execute();
}
}
@ -219,7 +219,7 @@ class Wm::Nitpicker::View : private Genode::Weak_object<View>,
View_capability real_view_cap()
{
return _real_nitpicker.view_capability(_real_handle);
return _real_gui.view_capability(_real_handle);
}
void buffer_offset(Point buffer_offset)
@ -227,8 +227,8 @@ class Wm::Nitpicker::View : private Genode::Weak_object<View>,
_buffer_offset = buffer_offset;
if (_real_handle.valid()) {
_real_nitpicker.enqueue<Command::Offset>(_real_handle, _buffer_offset);
_real_nitpicker.execute();
_real_gui.enqueue<Command::Offset>(_real_handle, _buffer_offset);
_real_gui.execute();
}
}
@ -236,8 +236,7 @@ class Wm::Nitpicker::View : private Genode::Weak_object<View>,
};
class Wm::Nitpicker::Top_level_view : public View,
private List<Top_level_view>::Element
class Wm::Gui::Top_level_view : public View, private List<Top_level_view>::Element
{
private:
@ -260,17 +259,17 @@ class Wm::Nitpicker::Top_level_view : public View,
Title _window_title { };
Session_label _session_label;
typedef Nitpicker::Session::Command Command;
using Command = Gui::Session::Command;
public:
Top_level_view(Nitpicker::Session_client &real_nitpicker,
Top_level_view(Gui::Session_client &real_gui,
Session_label const &session_label,
bool has_alpha,
Window_registry &window_registry,
Input_origin_changed_handler &input_origin_changed_handler)
:
View(real_nitpicker, session_label, has_alpha),
View(real_gui, session_label, has_alpha),
_window_registry(window_registry),
_input_origin_changed_handler(input_origin_changed_handler),
_session_label(session_label)
@ -347,16 +346,16 @@ class Wm::Nitpicker::Top_level_view : public View,
if (!_real_handle.valid()) {
/*
* Create and configure physical nitpicker view.
* Create and configure physical GUI view.
*/
_real_handle = _real_nitpicker.create_view();
_real_handle = _real_gui.create_view();
_real_nitpicker.enqueue<Command::Offset>(_real_handle, _buffer_offset);
_real_nitpicker.enqueue<Command::Title> (_real_handle, _title.string());
_real_nitpicker.execute();
_real_gui.enqueue<Command::Offset>(_real_handle, _buffer_offset);
_real_gui.enqueue<Command::Title> (_real_handle, _title.string());
_real_gui.execute();
}
return _real_nitpicker.view_capability(_real_handle);
return _real_gui.view_capability(_real_handle);
}
void hidden(bool hidden) { _window_registry.hidden(_win_id, hidden); }
@ -371,8 +370,7 @@ class Wm::Nitpicker::Top_level_view : public View,
};
class Wm::Nitpicker::Child_view : public View,
private List<Child_view>::Element
class Wm::Gui::Child_view : public View, private List<Child_view>::Element
{
private:
@ -382,12 +380,12 @@ class Wm::Nitpicker::Child_view : public View,
public:
Child_view(Nitpicker::Session_client &real_nitpicker,
Session_label const &session_label,
bool has_alpha,
Weak_ptr<View> parent)
Child_view(Gui::Session_client &real_gui,
Session_label const &session_label,
bool has_alpha,
Weak_ptr<View> parent)
:
View(real_nitpicker, session_label, has_alpha), _parent(parent)
View(real_gui, session_label, has_alpha), _parent(parent)
{
try_to_init_real_view();
}
@ -401,7 +399,7 @@ class Wm::Nitpicker::Child_view : public View,
void _propagate_view_geometry() override
{
_real_nitpicker.enqueue<Command::Geometry>(_real_handle, _geometry);
_real_gui.enqueue<Command::Geometry>(_real_handle, _geometry);
}
void stack(Weak_ptr<View> neighbor_ptr, bool behind) override
@ -436,13 +434,13 @@ class Wm::Nitpicker::Child_view : public View,
if (!parent.valid())
return;
View_handle parent_handle = _real_nitpicker.view_handle(parent->real_view_cap());
View_handle parent_handle = _real_gui.view_handle(parent->real_view_cap());
if (!parent_handle.valid())
return;
_real_handle = _real_nitpicker.create_view(parent_handle);
_real_handle = _real_gui.create_view(parent_handle);
_real_nitpicker.release_view_handle(parent_handle);
_real_gui.release_view_handle(parent_handle);
if (_neighbor_ptr == _parent)
_unsynchronized_apply_view_config(parent);
@ -457,28 +455,28 @@ class Wm::Nitpicker::Child_view : public View,
};
struct Wm::Nitpicker::Session_control_fn : Interface
struct Wm::Gui::Session_control_fn : Interface
{
virtual void session_control(char const *selector, Session::Session_control) = 0;
};
class Wm::Nitpicker::Session_component : public Rpc_object<Nitpicker::Session>,
private List<Session_component>::Element,
private Input_origin_changed_handler
class Wm::Gui::Session_component : public Rpc_object<Gui::Session>,
private List<Session_component>::Element,
private Input_origin_changed_handler
{
private:
friend class List<Session_component>;
typedef Nitpicker::Session::View_handle View_handle;
using View_handle = Gui::Session::View_handle;
Genode::Env &_env;
Session_label _session_label;
Genode::Ram_allocator &_ram;
Nitpicker::Connection _session { _env, _session_label.string() };
Gui::Connection _session { _env, _session_label.string() };
Window_registry &_window_registry;
Session_control_fn &_session_control_fn;
@ -501,7 +499,7 @@ class Wm::Nitpicker::Session_component : public Rpc_object<Nitpicker::Session>,
/*
* Command buffer
*/
typedef Nitpicker::Session::Command_buffer Command_buffer;
using Command_buffer = Gui::Session::Command_buffer;
Attached_ram_dataspace _command_ds { _ram, _env.rm(), sizeof(Command_buffer) };
@ -518,8 +516,8 @@ class Wm::Nitpicker::Session_component : public Rpc_object<Nitpicker::Session>,
/*
* Input
*/
Input::Session_client _nitpicker_input { _env.rm(), _session.input_session() };
Attached_dataspace _nitpicker_input_ds { _env.rm(), _nitpicker_input.dataspace() };
Input::Session_client _gui_input { _env.rm(), _session.input_session() };
Attached_dataspace _gui_input_ds { _env.rm(), _gui_input.dataspace() };
Signal_handler<Session_component> _input_handler {
_env.ep(), *this, &Session_component::_handle_input };
@ -569,13 +567,16 @@ class Wm::Nitpicker::Session_component : public Rpc_object<Nitpicker::Session>,
Point const input_origin = _input_origin();
Input::Event const * const events =
_nitpicker_input_ds.local_addr<Input::Event>();
_gui_input_ds.local_addr<Input::Event>();
while (_nitpicker_input.pending()) {
while (_gui_input.pending()) {
size_t const num_events = _nitpicker_input.flush();
size_t const num_events = _gui_input.flush();
/* we trust nitpicker to return a valid number of events */
/*
* We trust the nitpicker GUI server to return a valid number
* of events.
*/
for (size_t i = 0; i < num_events; i++) {
@ -788,7 +789,7 @@ class Wm::Nitpicker::Session_component : public Rpc_object<Nitpicker::Session>,
_click_handler(click_handler),
_view_handle_registry(session_alloc)
{
_nitpicker_input.sigh(_input_handler);
_gui_input.sigh(_input_handler);
_input_session.event_queue().enabled(true);
}
@ -886,14 +887,14 @@ class Wm::Nitpicker::Session_component : public Rpc_object<Nitpicker::Session>,
}
/**
* Return session capability to real nitpicker session
* Return session capability to real GUI session
*/
Capability<Session> session() { return _session.rpc_cap(); }
/*********************************
** Nitpicker session interface **
*********************************/
/***************************
** GUI session interface **
***************************/
Framebuffer::Session_capability framebuffer_session() override
{
@ -985,7 +986,7 @@ class Wm::Nitpicker::Session_component : public Rpc_object<Nitpicker::Session>,
/*
* If the first top-level view has a defined size, use it
* as the size of the virtualized nitpicker session.
* as the size of the virtualized GUI session.
*/
if (Top_level_view const *v = _top_level_views.first())
if (v->size().valid())
@ -1017,19 +1018,18 @@ class Wm::Nitpicker::Session_component : public Rpc_object<Nitpicker::Session>,
{
/*
* We must not perform the 'buffer' operation on the connection
* object because the 'Nitpicker::Connection::buffer'
* implementation implicitly performs upgrade operations.
* object because the 'Gui::Connection::buffer' implementation
* implicitly performs upgrade operations.
*
* Here, we merely want to forward the buffer RPC call to the
* wrapped nitpicker session. Otherwise, we would perform
* session upgrades initiated by the wm client's buffer
* operation twice.
* wrapped GUI session. Otherwise, we would perform session
* upgrades initiated by the wm client's buffer operation twice.
*/
Nitpicker::Session_client(_env.rm(), _session.cap()).buffer(mode, has_alpha);
Gui::Session_client(_env.rm(), _session.cap()).buffer(mode, has_alpha);
_has_alpha = has_alpha;
}
void focus(Genode::Capability<Nitpicker::Session>) override { }
void focus(Genode::Capability<Gui::Session>) override { }
void session_control(Label suffix, Session_control operation) override
{
@ -1040,9 +1040,9 @@ class Wm::Nitpicker::Session_component : public Rpc_object<Nitpicker::Session>,
};
class Wm::Nitpicker::Root : public Genode::Rpc_object<Genode::Typed_root<Session> >,
public Decorator_content_callback,
public Session_control_fn
class Wm::Gui::Root : public Genode::Rpc_object<Genode::Typed_root<Session> >,
public Decorator_content_callback,
public Session_control_fn
{
private:
@ -1077,13 +1077,13 @@ class Wm::Nitpicker::Root : public Genode::Rpc_object<Genode::Typed_root<Session
Input::Session_capability _window_layouter_input_cap { _env.ep().manage(_window_layouter_input) };
/* handler that forwards clicks into unfocused windows to the layouter */
struct Click_handler : Nitpicker::Click_handler
struct Click_handler : Gui::Click_handler
{
Input::Session_component &window_layouter_input;
Reporter &pointer_reporter;
Last_motion &last_motion;
void handle_enter(Nitpicker::Point pos) override
void handle_enter(Gui::Point pos) override
{
last_motion = LAST_MOTION_NITPICKER;
@ -1094,7 +1094,7 @@ class Wm::Nitpicker::Root : public Genode::Rpc_object<Genode::Typed_root<Session
});
}
void handle_click(Nitpicker::Point pos) override
void handle_click(Gui::Point pos) override
{
/*
* Propagate clicked-at position to decorator such that it can
@ -1132,14 +1132,14 @@ class Wm::Nitpicker::Root : public Genode::Rpc_object<Genode::Typed_root<Session
*/
List<Session_component> _sessions { };
Layouter_nitpicker_session *_layouter_session = nullptr;
Layouter_gui_session *_layouter_session = nullptr;
List<Decorator_nitpicker_session> _decorator_sessions { };
List<Decorator_gui_session> _decorator_sessions { };
/**
* Nitpicker session used to perform session-control operations
* GUI session used to perform session-control operations
*/
Nitpicker::Session &_focus_nitpicker_session;
Gui::Session &_focus_gui_session;
public:
@ -1150,14 +1150,14 @@ class Wm::Nitpicker::Root : public Genode::Rpc_object<Genode::Typed_root<Session
Window_registry &window_registry, Allocator &md_alloc,
Genode::Ram_allocator &ram,
Reporter &pointer_reporter, Reporter &focus_request_reporter,
Nitpicker::Session &focus_nitpicker_session)
Gui::Session &focus_gui_session)
:
_env(env),
_md_alloc(md_alloc), _ram(ram),
_pointer_reporter(pointer_reporter),
_focus_request_reporter(focus_request_reporter),
_window_registry(window_registry),
_focus_nitpicker_session(focus_nitpicker_session)
_focus_gui_session(focus_gui_session)
{
_window_layouter_input.event_queue().enabled(true);
@ -1215,11 +1215,11 @@ class Wm::Nitpicker::Root : public Genode::Rpc_object<Genode::Typed_root<Session
case ROLE_DECORATOR:
{
auto session = new (_md_alloc)
Decorator_nitpicker_session(_env, _ram, _md_alloc,
_pointer_reporter,
_last_motion,
_window_layouter_input,
*this);
Decorator_gui_session(_env, _ram, _md_alloc,
_pointer_reporter,
_last_motion,
_window_layouter_input,
*this);
_decorator_sessions.insert(session);
return _env.ep().manage(*session);
}
@ -1227,15 +1227,15 @@ class Wm::Nitpicker::Root : public Genode::Rpc_object<Genode::Typed_root<Session
case ROLE_LAYOUTER:
{
_layouter_session = new (_md_alloc)
Layouter_nitpicker_session(_env, _window_layouter_input_cap);
Layouter_gui_session(_env, _window_layouter_input_cap);
return _env.ep().manage(*_layouter_session);
}
case ROLE_DIRECT:
{
Direct_nitpicker_session *session = new (_md_alloc)
Direct_nitpicker_session(_env, session_label);
Direct_gui_session *session = new (_md_alloc)
Direct_gui_session(_env, session_label);
return _env.ep().manage(*session);
}
@ -1260,14 +1260,14 @@ class Wm::Nitpicker::Root : public Genode::Rpc_object<Genode::Typed_root<Session
if (regular_session)
regular_session->upgrade(args.string());
Decorator_nitpicker_session *decorator_session =
dynamic_cast<Decorator_nitpicker_session *>(session);
Decorator_gui_session *decorator_session =
dynamic_cast<Decorator_gui_session *>(session);
if (decorator_session)
decorator_session->upgrade(args.string());
Direct_nitpicker_session *direct_session =
dynamic_cast<Direct_nitpicker_session *>(session);
Direct_gui_session *direct_session =
dynamic_cast<Direct_gui_session *>(session);
if (direct_session)
direct_session->upgrade(args.string());
@ -1292,8 +1292,8 @@ class Wm::Nitpicker::Root : public Genode::Rpc_object<Genode::Typed_root<Session
return;
}
Direct_nitpicker_session *direct_session =
ep.apply(session_cap, [this] (Direct_nitpicker_session *session) {
Direct_gui_session *direct_session =
ep.apply(session_cap, [this] (Direct_gui_session *session) {
if (session) {
_env.ep().dissolve(*session);
}
@ -1304,8 +1304,8 @@ class Wm::Nitpicker::Root : public Genode::Rpc_object<Genode::Typed_root<Session
return;
}
Decorator_nitpicker_session *decorator_session =
ep.apply(session_cap, [this] (Decorator_nitpicker_session *session) {
Decorator_gui_session *decorator_session =
ep.apply(session_cap, [this] (Decorator_gui_session *session) {
if (session) {
_decorator_sessions.remove(session);
_env.ep().dissolve(*session);
@ -1317,7 +1317,7 @@ class Wm::Nitpicker::Root : public Genode::Rpc_object<Genode::Typed_root<Session
return;
}
auto layouter_lambda = [this] (Layouter_nitpicker_session *session) {
auto layouter_lambda = [this] (Layouter_gui_session *session) {
this->_env.ep().dissolve(*_layouter_session);
_layouter_session = nullptr;
return session;
@ -1366,11 +1366,10 @@ class Wm::Nitpicker::Root : public Genode::Rpc_object<Genode::Typed_root<Session
_window_registry.flush();
/*
* Forward the request to the nitpicker control session to apply
* the show/hide/to-front operations on "direct" nitpicker
* sessions.
* Forward the request to the GUI server's control session to apply
* the show/hide/to-front operations on "direct" GUI sessions.
*/
_focus_nitpicker_session.session_control(selector, operation);
_focus_gui_session.session_control(selector, operation);
}
@ -1423,7 +1422,7 @@ class Wm::Nitpicker::Root : public Genode::Rpc_object<Genode::Typed_root<Session
s->content_geometry(id, rect);
}
Capability<Session> lookup_nitpicker_session(unsigned win_id)
Capability<Session> lookup_gui_session(unsigned win_id)
{
for (Session_component *s = _sessions.first(); s; s = s->next())
if (s->has_win_id(win_id))
@ -1440,4 +1439,4 @@ class Wm::Nitpicker::Root : public Genode::Rpc_object<Genode::Typed_root<Session
}
};
#endif /* _NITPICKER_H_ */
#endif /* _GUI_H_ */

View File

@ -1,5 +1,5 @@
/*
* \brief Nitpicker service provided to layouter
* \brief GUI service provided to layouter
* \author Norman Feske
* \date 2015-06-06
*/
@ -11,47 +11,46 @@
* under the terms of the GNU Affero General Public License version 3.
*/
#ifndef _LAYOUTER_NITPICKER_H_
#define _LAYOUTER_NITPICKER_H_
#ifndef _LAYOUTER_GUI_H_
#define _LAYOUTER_GUI_H_
/* Genode includes */
#include <input/component.h>
#include <gui_session/connection.h>
namespace Wm {
struct Layouter_nitpicker_session;
struct Layouter_nitpicker_service;
struct Layouter_gui_session;
struct Layouter_gui_service;
}
struct Wm::Layouter_nitpicker_session : Genode::Rpc_object<Nitpicker::Session>
struct Wm::Layouter_gui_session : Genode::Rpc_object<Gui::Session>
{
typedef Nitpicker::View_capability View_capability;
typedef Nitpicker::Session::View_handle View_handle;
using View_capability = Gui::View_capability;
using View_handle = Gui::Session::View_handle;
Input::Session_capability _input_session_cap;
/*
* Nitpicker session solely used to supply the nitpicker mode to the
* layouter
* GUI session solely used to supply the GUI mode to the layouter
*/
Nitpicker::Connection _mode_sigh_nitpicker;
Gui::Connection _mode_sigh_gui;
Genode::Signal_context_capability _mode_sigh { };
Attached_ram_dataspace _command_ds;
Layouter_nitpicker_session(Genode::Env &env,
Input::Session_capability input_session_cap)
Layouter_gui_session(Genode::Env &env,
Input::Session_capability input_session_cap)
:
_input_session_cap(input_session_cap),
_mode_sigh_nitpicker(env), _command_ds(env.ram(), env.rm(), 4096)
_mode_sigh_gui(env), _command_ds(env.ram(), env.rm(), 4096)
{ }
/*********************************
** Nitpicker session interface **
*********************************/
/***************************
** GUI session interface **
***************************/
Framebuffer::Session_capability framebuffer_session() override
{
@ -86,7 +85,7 @@ struct Wm::Layouter_nitpicker_session : Genode::Rpc_object<Nitpicker::Session>
void execute() override { }
Framebuffer::Mode mode() override { return _mode_sigh_nitpicker.mode(); }
Framebuffer::Mode mode() override { return _mode_sigh_gui.mode(); }
void mode_sigh(Genode::Signal_context_capability sigh) override
{
@ -96,12 +95,12 @@ struct Wm::Layouter_nitpicker_session : Genode::Rpc_object<Nitpicker::Session>
*/
_mode_sigh = sigh;
_mode_sigh_nitpicker.mode_sigh(sigh);
_mode_sigh_gui.mode_sigh(sigh);
}
void buffer(Framebuffer::Mode, bool) override { }
void focus(Genode::Capability<Nitpicker::Session>) override { }
void focus(Genode::Capability<Gui::Session>) override { }
};
#endif /* _LAYOUTER_NITPICKER_H_ */
#endif /* _LAYOUTER_GUI_H_ */

View File

@ -21,7 +21,7 @@
#include <util/xml_node.h>
/* local includes */
#include <nitpicker.h>
#include <gui.h>
#include <report_forwarder.h>
#include <rom_forwarder.h>
@ -60,12 +60,11 @@ struct Wm::Main
Window_registry window_registry { heap, window_list_reporter };
Nitpicker::Connection focus_nitpicker_session { env };
Gui::Connection focus_gui_session { env };
Nitpicker::Root nitpicker_root { env, window_registry,
heap, env.ram(),
pointer_reporter, focus_request_reporter,
focus_nitpicker_session };
Gui::Root gui_root { env, window_registry, heap, env.ram(),
pointer_reporter, focus_request_reporter,
focus_gui_session };
void handle_focus_update()
{
@ -80,10 +79,10 @@ struct Wm::Main
.attribute("id").value(win_id);
if (win_id) {
Nitpicker::Session_capability session_cap =
nitpicker_root.lookup_nitpicker_session(win_id);
Gui::Session_capability session_cap =
gui_root.lookup_gui_session(win_id);
focus_nitpicker_session.focus(session_cap);
focus_gui_session.focus(session_cap);
}
} catch (...) { }
@ -103,7 +102,7 @@ struct Wm::Main
width = window.attribute_value("width", 0UL),
height = window.attribute_value("height", 0UL);
nitpicker_root.request_resize(win_id, Area(width, height));
gui_root.request_resize(win_id, Area(width, height));
});
}

View File

@ -4,12 +4,13 @@
* \date 2019-02-18
*
* This report service has the sole purpose of applying the same labeling
* policy to an application's shape report as done for the application's
* 'Nitpicker' session. This consistency is needed by the pointer to correlate
* the currently hovered nitpicker session with the reported shapes.
* Analogously, clipboard reports can be routed through the window
* manager to support the clipboard component with associating its clients
* with nitpicker's reported focus.
* policy to an application's shape report as done for the application's GUI
* session. This consistency is needed by the pointer to correlate the
* currently hovered GUI session with the reported shapes.
*
* Analogously, clipboard reports can be routed through the window manager to
* support the clipboard component with associating its clients with
* nitpicker's reported focus.
*/
/*

View File

@ -5,7 +5,7 @@
*
* This ROM service can be used as proxy for clipboard ROMs to ensure the
* consistency of the client labels appearing at the clipboard component
* with the label of the currently focused nitpicker client.
* with the label of the currently focused GUI client.
*/
/*