mirror of
https://github.com/genodelabs/genode.git
synced 2025-06-11 11:51:46 +00:00
gems: move reusable wm headers to include/gems
This commit is contained in:
parent
ec565c1ded
commit
ece64db196
@ -11,17 +11,15 @@
|
|||||||
* under the terms of the GNU General Public License version 2.
|
* under the terms of the GNU General Public License version 2.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _LOCAL_REPORTER_H_
|
#ifndef _INCLUDE__GEMS__LOCAL_REPORTER_H_
|
||||||
#define _LOCAL_REPORTER_H_
|
#define _INCLUDE__GEMS__LOCAL_REPORTER_H_
|
||||||
|
|
||||||
|
/* Genode includes */
|
||||||
#include <os/attached_dataspace.h>
|
#include <os/attached_dataspace.h>
|
||||||
#include <util/xml_generator.h>
|
#include <util/xml_generator.h>
|
||||||
#include <report_session/client.h>
|
#include <report_session/client.h>
|
||||||
|
|
||||||
|
struct Local_reporter
|
||||||
namespace Wm { struct Local_reporter; }
|
|
||||||
|
|
||||||
struct Wm::Local_reporter
|
|
||||||
{
|
{
|
||||||
Report::Session_client _session;
|
Report::Session_client _session;
|
||||||
|
|
||||||
@ -49,4 +47,4 @@ struct Wm::Local_reporter
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* _LOCAL_REPORTER_H_ */
|
#endif /* _INCLUDE__GEMS__LOCAL_REPORTER_H_ */
|
@ -11,8 +11,8 @@
|
|||||||
* under the terms of the GNU General Public License version 2.
|
* under the terms of the GNU General Public License version 2.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _REPORT_ROM_SLAVE_H_
|
#ifndef _INCLUDE__GEMS__REPORT_ROM_SLAVE_H_
|
||||||
#define _REPORT_ROM_SLAVE_H_
|
#define _INCLUDE__GEMS__REPORT_ROM_SLAVE_H_
|
||||||
|
|
||||||
/* Genode includes */
|
/* Genode includes */
|
||||||
#include <base/lock.h>
|
#include <base/lock.h>
|
||||||
@ -48,19 +48,14 @@ class Report_rom_slave : public Genode::Noncopyable
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
Policy(Genode::Rpc_entrypoint &entrypoint,
|
Policy(Genode::Rpc_entrypoint &entrypoint,
|
||||||
Genode::Ram_session &ram)
|
Genode::Ram_session &ram,
|
||||||
|
const char *config)
|
||||||
:
|
:
|
||||||
Slave_policy("report_rom", entrypoint, &ram),
|
Slave_policy("report_rom", entrypoint, &ram),
|
||||||
_lock(Genode::Lock::LOCKED)
|
_lock(Genode::Lock::LOCKED)
|
||||||
{
|
{
|
||||||
configure("<config> <rom>"
|
if (config)
|
||||||
" <policy label=\"window_list\" report=\"window_list\"/>"
|
configure(config);
|
||||||
" <policy label=\"window_layout\" report=\"window_layout\"/>"
|
|
||||||
" <policy label=\"resize_request\" report=\"resize_request\"/>"
|
|
||||||
" <policy label=\"pointer\" report=\"pointer\"/>"
|
|
||||||
" <policy label=\"hover\" report=\"hover\"/>"
|
|
||||||
" <policy label=\"focus\" report=\"focus\"/>"
|
|
||||||
"</rom> </config>");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool announce_service(const char *service_name,
|
bool announce_service(const char *service_name,
|
||||||
@ -107,14 +102,15 @@ class Report_rom_slave : public Genode::Noncopyable
|
|||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* \param ep entrypoint used for nitpicker child thread
|
* \param ep entrypoint used for child thread
|
||||||
* \param ram RAM session used to allocate the configuration
|
* \param ram RAM session used to allocate the configuration
|
||||||
* dataspace
|
* dataspace
|
||||||
*/
|
*/
|
||||||
Report_rom_slave(Genode::Cap_session &cap, Genode::Ram_session &ram)
|
Report_rom_slave(Genode::Cap_session &cap, Genode::Ram_session &ram,
|
||||||
|
char const *config)
|
||||||
:
|
:
|
||||||
_ep(&cap, _ep_stack_size, "report_rom"),
|
_ep(&cap, _ep_stack_size, "report_rom"),
|
||||||
_policy(_ep, ram),
|
_policy(_ep, ram, config),
|
||||||
_slave(_ep, _policy, _quota),
|
_slave(_ep, _policy, _quota),
|
||||||
_rom_root(_policy.rom_root()),
|
_rom_root(_policy.rom_root()),
|
||||||
_report_root(_policy.report_root())
|
_report_root(_policy.report_root())
|
||||||
@ -170,4 +166,4 @@ class Report_rom_slave : public Genode::Noncopyable
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* _REPORT_ROM_SLAVE_H_ */
|
#endif /* _INCLUDE__GEMS__REPORT_ROM_SLAVE_H_ */
|
@ -11,14 +11,12 @@
|
|||||||
* under the terms of the GNU General Public License version 2.
|
* under the terms of the GNU General Public License version 2.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _SINGLE_SESSION_SERVICE_H_
|
#ifndef _INCLUDE__GEMS__SINGLE_SESSION_SERVICE_H_
|
||||||
#define _SINGLE_SESSION_SERVICE_H_
|
#define _INCLUDE__GEMS__SINGLE_SESSION_SERVICE_H_
|
||||||
|
|
||||||
#include <base/service.h>
|
#include <base/service.h>
|
||||||
|
|
||||||
namespace Wm { class Single_session_service; }
|
struct Single_session_service : Genode::Service
|
||||||
|
|
||||||
struct Wm::Single_session_service : Genode::Service
|
|
||||||
{
|
{
|
||||||
Genode::Session_capability session_cap;
|
Genode::Session_capability session_cap;
|
||||||
|
|
||||||
@ -38,4 +36,4 @@ struct Wm::Single_session_service : Genode::Service
|
|||||||
void close(Genode::Session_capability) override { }
|
void close(Genode::Session_capability) override { }
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* _SINGLE_SESSION_SERVICE_H_ */
|
#endif /* _INCLUDE__GEMS__SINGLE_SESSION_SERVICE_H_ */
|
@ -20,11 +20,13 @@
|
|||||||
#include <util/volatile_object.h>
|
#include <util/volatile_object.h>
|
||||||
#include <util/xml_node.h>
|
#include <util/xml_node.h>
|
||||||
|
|
||||||
|
/* gems includes */
|
||||||
|
#include <gems/single_session_service.h>
|
||||||
|
#include <gems/report_rom_slave.h>
|
||||||
|
#include <gems/local_reporter.h>
|
||||||
|
|
||||||
/* local includes */
|
/* local includes */
|
||||||
#include <single_session_service.h>
|
|
||||||
#include <report_rom_slave.h>
|
|
||||||
#include <decorator_nitpicker.h>
|
#include <decorator_nitpicker.h>
|
||||||
#include <local_reporter.h>
|
|
||||||
#include <decorator_slave.h>
|
#include <decorator_slave.h>
|
||||||
#include <window_layouter_slave.h>
|
#include <window_layouter_slave.h>
|
||||||
#include <nitpicker.h>
|
#include <nitpicker.h>
|
||||||
@ -47,7 +49,17 @@ struct Wm::Main
|
|||||||
|
|
||||||
Genode::Cap_connection cap;
|
Genode::Cap_connection cap;
|
||||||
|
|
||||||
Report_rom_slave report_rom_slave = { cap, *env()->ram_session() };
|
char const *report_rom_config =
|
||||||
|
"<config> <rom>"
|
||||||
|
" <policy label=\"window_list\" report=\"window_list\"/>"
|
||||||
|
" <policy label=\"window_layout\" report=\"window_layout\"/>"
|
||||||
|
" <policy label=\"resize_request\" report=\"resize_request\"/>"
|
||||||
|
" <policy label=\"pointer\" report=\"pointer\"/>"
|
||||||
|
" <policy label=\"hover\" report=\"hover\"/>"
|
||||||
|
" <policy label=\"focus\" report=\"focus\"/>"
|
||||||
|
"</rom> </config>";
|
||||||
|
|
||||||
|
Report_rom_slave report_rom_slave = { cap, *env()->ram_session(), report_rom_config };
|
||||||
|
|
||||||
Rom_session_capability window_list_rom = report_rom_slave.rom_session("window_list");
|
Rom_session_capability window_list_rom = report_rom_slave.rom_session("window_list");
|
||||||
Rom_session_capability window_layout_rom = report_rom_slave.rom_session("window_layout");
|
Rom_session_capability window_layout_rom = report_rom_slave.rom_session("window_layout");
|
||||||
|
@ -21,9 +21,8 @@
|
|||||||
#include <base/allocator.h>
|
#include <base/allocator.h>
|
||||||
#include <os/surface.h>
|
#include <os/surface.h>
|
||||||
|
|
||||||
/* local includes */
|
/* gems includes */
|
||||||
#include <local_reporter.h>
|
#include <gems/local_reporter.h>
|
||||||
|
|
||||||
|
|
||||||
namespace Wm { class Window_registry; }
|
namespace Wm { class Window_registry; }
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user