From 8f1db47c268f25d666265cd15bf0173432fe6fec Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Thu, 18 Mar 2021 17:35:12 +0100 Subject: [PATCH] sculpt: screen capturing and event injection This patch adds session-routing options to connect components to the capture/event interfaces of the global nitpicker GUI server or the leitzentrale GUI server. It thereby enables the implementation of screen capturing components, remote management tools, or virtual keyboards. Since those services are very powerful, they are subsumed under the "hardware" category of the component graph as opposed to the GUI category, which guarantees the separation of clients. Fixes #4053 --- repos/gems/recipes/src/sculpt_manager/used_apis | 2 ++ repos/gems/run/sculpt.run | 6 ++++++ repos/gems/run/sculpt/leitzentrale.config | 12 +++++++++++- repos/gems/src/app/sculpt_manager/main.cc | 4 ++++ repos/gems/src/app/sculpt_manager/model/route.h | 4 ++++ .../src/app/sculpt_manager/model/runtime_config.h | 8 +++++++- repos/gems/src/app/sculpt_manager/model/service.h | 8 +++++--- 7 files changed, 39 insertions(+), 5 deletions(-) diff --git a/repos/gems/recipes/src/sculpt_manager/used_apis b/repos/gems/recipes/src/sculpt_manager/used_apis index c7b53ffe6d..e213a51c5a 100644 --- a/repos/gems/recipes/src/sculpt_manager/used_apis +++ b/repos/gems/recipes/src/sculpt_manager/used_apis @@ -13,3 +13,5 @@ gui_session terminal_session rtc_session input_session +event_session +capture_session diff --git a/repos/gems/run/sculpt.run b/repos/gems/run/sculpt.run index a9641255fb..04d66f8075 100644 --- a/repos/gems/run/sculpt.run +++ b/repos/gems/run/sculpt.run @@ -407,6 +407,8 @@ install_config { + + @@ -490,6 +492,10 @@ install_config { + + + + diff --git a/repos/gems/run/sculpt/leitzentrale.config b/repos/gems/run/sculpt/leitzentrale.config index 8c39ccd3e2..99084b71cf 100644 --- a/repos/gems/run/sculpt/leitzentrale.config +++ b/repos/gems/run/sculpt/leitzentrale.config @@ -23,6 +23,12 @@ + + + + + + @@ -76,11 +82,15 @@ - + + + + + diff --git a/repos/gems/src/app/sculpt_manager/main.cc b/repos/gems/src/app/sculpt_manager/main.cc index 3f0fd7ae51..6e5ad0547e 100644 --- a/repos/gems/src/app/sculpt_manager/main.cc +++ b/repos/gems/src/app/sculpt_manager/main.cc @@ -21,6 +21,8 @@ #include #include #include +#include +#include /* included from depot_deploy tool */ #include @@ -1668,6 +1670,8 @@ void Sculpt::Main::_generate_runtime_config(Xml_generator &xml) const gen_parent_service(xml); gen_parent_service(xml); gen_parent_service(xml); + gen_parent_service(xml); + gen_parent_service(xml); }); xml.node("affinity-space", [&] () { diff --git a/repos/gems/src/app/sculpt_manager/model/route.h b/repos/gems/src/app/sculpt_manager/model/route.h index 7ae5eae67c..233dec4e7a 100644 --- a/repos/gems/src/app/sculpt_manager/model/route.h +++ b/repos/gems/src/app/sculpt_manager/model/route.h @@ -31,6 +31,8 @@ struct Sculpt::Route : List_model::Element case Service::Type::AUDIO_IN: return "audio_in"; case Service::Type::AUDIO_OUT: return "audio_out"; case Service::Type::BLOCK: return "block"; + case Service::Type::EVENT: return "event"; + case Service::Type::CAPTURE: return "capture"; case Service::Type::FILE_SYSTEM: return "file_system"; case Service::Type::NIC: return "nic"; case Service::Type::GUI: return "gui"; @@ -58,6 +60,8 @@ struct Sculpt::Route : List_model::Element case Service::Type::AUDIO_IN: return "Audio input"; case Service::Type::AUDIO_OUT: return "Audio output"; case Service::Type::BLOCK: return "Block device"; + case Service::Type::EVENT: return "Event"; + case Service::Type::CAPTURE: return "Capture"; case Service::Type::FILE_SYSTEM: return "File system"; case Service::Type::NIC: return "Network"; case Service::Type::GUI: return "GUI"; diff --git a/repos/gems/src/app/sculpt_manager/model/runtime_config.h b/repos/gems/src/app/sculpt_manager/model/runtime_config.h index e0d92b45a9..c67b4fdba3 100644 --- a/repos/gems/src/app/sculpt_manager/model/runtime_config.h +++ b/repos/gems/src/app/sculpt_manager/model/runtime_config.h @@ -74,7 +74,9 @@ class Sculpt::Runtime_config || (service == "IO_MEM") || (service == "Rtc") || (service == "IRQ") - || (service == "TRACE"); + || (service == "TRACE") + || (service == "Event") + || (service == "Capture"); if (hardware) { result = "hardware"; return; @@ -327,6 +329,10 @@ class Sculpt::Runtime_config _backdrop { _r, Type::GUI, "desktop background", "backdrop" }, _lockscreen{ _r, Type::GUI, "desktop lock screen", "lock_screen" }, _nitpicker { _r, Type::GUI, "system GUI server" }, + _lz_event { _r, Type::EVENT, "management GUI events", "leitzentrale" }, + _event { _r, Type::EVENT, "system input events", "global" }, + _lz_capture{ _r, Type::CAPTURE, "management GUI", "leitzentrale" }, + _capture { _r, Type::CAPTURE, "system GUI", "global" }, _config_fs { _r, Type::FILE_SYSTEM, "writeable system configuration", "config" }, _report_fs { _r, Type::FILE_SYSTEM, "read-only system reports", "report" }, _capslock { _r, Type::ROM, "global capslock state", "capslock" }, diff --git a/repos/gems/src/app/sculpt_manager/model/service.h b/repos/gems/src/app/sculpt_manager/model/service.h index 2cca0d5a4e..930c8982c5 100644 --- a/repos/gems/src/app/sculpt_manager/model/service.h +++ b/repos/gems/src/app/sculpt_manager/model/service.h @@ -25,9 +25,9 @@ struct Sculpt::Service typedef String<32> Info; enum class Type { - AUDIO_IN, AUDIO_OUT, BLOCK, FILE_SYSTEM, NIC, GUI, - RM, IO_MEM, IO_PORT, IRQ, REPORT, ROM, TERMINAL, TRACE, - USB, RTC, PLATFORM, VM, PD, UNDEFINED }; + AUDIO_IN, AUDIO_OUT, BLOCK, EVENT, CAPTURE, FILE_SYSTEM, NIC, GUI, + RM, IO_MEM, IO_PORT, IRQ, REPORT, ROM, TERMINAL, TRACE, USB, RTC, + PLATFORM, VM, PD, UNDEFINED }; enum class Match_label { EXACT, LAST }; @@ -46,6 +46,8 @@ struct Sculpt::Service case Type::AUDIO_IN: return "Audio_in"; case Type::AUDIO_OUT: return "Audio_out"; case Type::BLOCK: return "Block"; + case Type::EVENT: return "Event"; + case Type::CAPTURE: return "Capture"; case Type::FILE_SYSTEM: return "File_system"; case Type::NIC: return "Nic"; case Type::GUI: return "Gui";