From c18bee3d5b07739e0865174ceaae64987d8041af Mon Sep 17 00:00:00 2001 From: Emery Hemingway Date: Wed, 27 Jun 2018 11:31:59 +0200 Subject: [PATCH] Input::Binding for non-C++ language bindings Quietly insert forward declaration of a Input::Binding class, and make it a friend of Input::Event and Input::Session_client. This is to allow non-C++ language bindings (Nim) to access private members by providing their own implementation of the Binding class. Fix #2889 --- repos/os/include/input/event.h | 3 +++ repos/os/include/input_session/client.h | 2 ++ 2 files changed, 5 insertions(+) diff --git a/repos/os/include/input/event.h b/repos/os/include/input/event.h index fb9d355f7..c01797678 100644 --- a/repos/os/include/input/event.h +++ b/repos/os/include/input/event.h @@ -41,6 +41,7 @@ namespace Input { struct Touch_release { Touch_id id; }; class Event; + class Binding; } @@ -74,6 +75,8 @@ class Input::Event template static Genode::Point _xy(T const &a) { return Genode::Point(a.x, a.y); } + friend class Input::Binding; + public: /** diff --git a/repos/os/include/input_session/client.h b/repos/os/include/input_session/client.h index ec6144612..af0362b76 100644 --- a/repos/os/include/input_session/client.h +++ b/repos/os/include/input_session/client.h @@ -31,6 +31,8 @@ class Input::Session_client : public Genode::Rpc_client Genode::size_t const _max_events = _event_ds.size() / sizeof(Input::Event); + friend class Input::Binding; + public: Session_client(Genode::Region_map &local_rm, Session_capability session)