launcher: API transition (deprecated warnings)

Issue #1987
This commit is contained in:
Norman Feske 2017-02-13 17:29:27 +01:00
parent c6c79acf8e
commit 19868de69a
9 changed files with 37 additions and 15 deletions

View File

@ -53,19 +53,21 @@ struct Launcher::Dialog_nitpicker_session : Wrapped_nitpicker_session
virtual bool handle_input_event(Input::Event const &ev) = 0;
};
Env &_env;
Input_event_handler &_input_event_handler;
Rpc_entrypoint &_session_ep;
Nitpicker::Session &_nitpicker_session;
Input::Session_client _nitpicker_input { _nitpicker_session.input_session() };
Input::Session_client _nitpicker_input { _env.rm(), _nitpicker_session.input_session() };
Attached_dataspace _nitpicker_input_ds { _nitpicker_input.dataspace() };
Attached_dataspace _nitpicker_input_ds { _env.rm(), _nitpicker_input.dataspace() };
Signal_handler<Dialog_nitpicker_session> _input_handler;
Input::Session_component _input_session;
Input::Session_component _input_session { _env, _env.ram() };
/**
* Constructor
@ -75,12 +77,13 @@ struct Launcher::Dialog_nitpicker_session : Wrapped_nitpicker_session
* \param service_ep entrypoint providing the nitpicker session
* (slave-specific ep)
*/
Dialog_nitpicker_session(Nitpicker::Session &nitpicker_session,
Dialog_nitpicker_session(Env &env, Nitpicker::Session &nitpicker_session,
Entrypoint &input_sigh_ep,
Rpc_entrypoint &session_ep,
Input_event_handler &input_event_handler)
:
Wrapped_nitpicker_session(nitpicker_session),
_env(env),
_input_event_handler(input_event_handler),
_session_ep(session_ep),
_nitpicker_session(nitpicker_session),

View File

@ -54,6 +54,8 @@ class Launcher::Fading_dialog : private Input_event_handler
{
private:
Region_map &_rm;
Slave::Connection<Rom_connection> _dialog_rom;
/* dialog reported locally */
@ -66,7 +68,7 @@ class Launcher::Fading_dialog : private Input_event_handler
/* hovered element reported by menu view */
Slave::Connection<Report::Connection> _hover_report;
Local_reporter _dialog_reporter { "dialog", _dialog_report };
Local_reporter _dialog_reporter;
Input_event_handler &_dialog_input_event_handler;
@ -106,7 +108,7 @@ class Launcher::Fading_dialog : private Input_event_handler
if (!_hover_ds.constructed() || _hover_rom.update() == false) {
if (_hover_ds.constructed())
_hover_ds->invalidate();
_hover_ds.construct(_hover_rom.dataspace());
_hover_ds.construct(_rm, _hover_rom.dataspace());
}
Xml_node hover(_hover_ds->local_addr<char>());
@ -178,12 +180,14 @@ class Launcher::Fading_dialog : private Input_event_handler
Dialog_model &dialog_model,
Position initial_position)
:
_rm(env.rm()),
_dialog_rom(report_rom_slave.policy(), Slave::Args("label=", dialog_name)),
_dialog_report(report_rom_slave.policy(),
Slave::Args("label=", dialog_name, ", buffer_size=4096")),
_hover_rom(report_rom_slave.policy(), Slave::Args("label=", hover_name)),
_hover_report(report_rom_slave.policy(),
Slave::Args("label=", hover_name, ", buffer_size=4096")),
_dialog_reporter(env.rm(), "dialog", _dialog_report),
_dialog_input_event_handler(input_event_handler),
_hover_handler(hover_handler),
_dialog_generator(dialog_generator),
@ -191,10 +195,10 @@ class Launcher::Fading_dialog : private Input_event_handler
_hover_update_handler(env.ep(), *this, &Fading_dialog::_handle_hover_update),
_fader_slave_ep(&env.pd(), _fader_slave_ep_stack_size, "nit_fader"),
_nitpicker_connection(env, "menu"),
_nitpicker_session(_nitpicker_connection, env.ep(), _fader_slave_ep, *this),
_nitpicker_session(env, _nitpicker_connection, env.ep(), _fader_slave_ep, *this),
_nit_fader_slave(_fader_slave_ep, env.rm(), env.ram_session_cap(),
_nitpicker_service),
_nit_fader_connection(_nit_fader_slave.policy(), Slave::Args("label=menu")),
_nit_fader_connection(env.rm(), _nit_fader_slave.policy(), Slave::Args("label=menu")),
_menu_view_slave(env.pd(), env.rm(), env.ram_session_cap(),
_nit_fader_connection,
_dialog_rom, _hover_report, initial_position)

View File

@ -98,7 +98,7 @@ struct Launcher::Main
Label _focus_prefix;
Genode::Attached_rom_dataspace _focus_rom { "focus" };
Genode::Attached_rom_dataspace _focus_rom { _env, "focus" };
void _handle_focus_update();

View File

@ -39,6 +39,8 @@ class Launcher::Menu_dialog : Input_event_handler, Dialog_generator,
private:
Allocator &_alloc;
Response_handler &_response_handler;
typedef String<128> Title;
@ -104,10 +106,11 @@ class Launcher::Menu_dialog : Input_event_handler, Dialog_generator,
public:
Menu_dialog(Env &env,
Allocator &alloc,
Report_rom_slave &report_rom_slave,
Response_handler &response_handler)
:
_response_handler(response_handler),
_alloc(alloc), _response_handler(response_handler),
_dialog(env, report_rom_slave, "menu_dialog", "menu_hover",
*this, *this, *this, *this, _position)
{ }
@ -253,7 +256,7 @@ class Launcher::Menu_dialog : Input_event_handler, Dialog_generator,
subsystems.for_each_sub_node("subsystem",
[&] (Xml_node subsystem)
{
Element * const e = new (env()->heap()) Element(subsystem);
Element * const e = new (_alloc) Element(subsystem);
_elements.insert(e, last);
last = e;

View File

@ -87,7 +87,7 @@ class Launcher::Menu_view_slave
Position position)
:
Genode::Slave::Policy(_name(), _name(), *this, ep, rm, ram, _quota()),
_nitpicker(nitpicker_session),
_nitpicker(rm, nitpicker_session),
_dialog_rom(dialog_rom_session),
_hover_report(hover_report_session),
_position(position)

View File

@ -294,13 +294,14 @@ class Launcher::Panel_dialog : Input_event_handler, Dialog_generator,
Nitpicker::Session &nitpicker)
:
_alloc(alloc),
_timer(env),
_subsystem_manager(subsystem_manager),
_nitpicker(nitpicker),
_dialog(env, report_rom_slave, "panel_dialog", "panel_hover",
*this, *this, *this, *this, _position),
_timer_handler(env.ep(), *this, &Panel_dialog::_handle_timer),
_context_dialog(env, report_rom_slave, *this),
_menu_dialog(env, report_rom_slave, *this)
_menu_dialog(env, alloc, report_rom_slave, *this)
{
_elements.insert(&_menu_button);
_timer.sigh(_timer_handler);

View File

@ -15,7 +15,7 @@
#define _SUBSYSTEM_MANAGER_H_
/* Genode includes */
#include <os/server.h>
#include <base/component.h>
#include <decorator/xml_utils.h>
/* CLI-monitor includes */

View File

@ -40,7 +40,8 @@ class Genode::Single_session_service
*/
struct Client : SESSION::Client
{
Client(Session_capability cap) : SESSION::Client(cap) { }
Client(Session_capability cap) : SESSION::Client(cap) { }
Client(Region_map &rm, Session_capability cap) : SESSION::Client(rm, cap) { }
Session_capability cap() const { return *this; }
};
@ -55,6 +56,9 @@ class Genode::Single_session_service
Single_session_service(Session_capability cap) : _client(cap) { }
Single_session_service(Region_map &rm, Session_capability cap)
: _client(rm, cap) { }
Service &service() { return _service; }
};

View File

@ -280,6 +280,13 @@ struct Genode::Slave::Connection : private Connection_base<CONNECTION>,
Connection_base<CONNECTION>(policy, args, affinity),
CONNECTION::Client(Connection_base<CONNECTION>::_cap())
{ }
Connection(Region_map &rm, Slave::Policy &policy, Args const &args,
Affinity const &affinity = Affinity())
:
Connection_base<CONNECTION>(policy, args, affinity),
CONNECTION::Client(rm, Connection_base<CONNECTION>::_cap())
{ }
};
#endif /* _INCLUDE__OS__SLAVE_H_ */