From: Javier Sancho Date: Sun, 26 Apr 2020 18:12:06 +0000 (+0200) Subject: event-gui-caller X-Git-Url: https://git.jsancho.org/?a=commitdiff_plain;h=b6dc1786bc0cf88d56dfe5f307ce7eb873fe6874;p=guile-irrlicht.git event-gui-caller --- diff --git a/src/event-receiver.cpp b/src/event-receiver.cpp index 5d5467f..c0728ff 100644 --- a/src/event-receiver.cpp +++ b/src/event-receiver.cpp @@ -23,6 +23,7 @@ #include #include "event-receiver.h" +#include "gui-element.h" #include "gsubr.h" #include "keycodes.h" #include "wrapped.h" @@ -34,6 +35,7 @@ extern "C" { { init_event_receiver_type (); init_event_type (); + DEFINE_GSUBR ("event-gui-caller", 1, 0, 0, event_gui_caller); DEFINE_GSUBR ("event-key-input-key", 1, 0, 0, event_key_input_key); DEFINE_GSUBR ("event-key-input-pressed", 1, 0, 0, event_key_input_pressed); DEFINE_GSUBR ("event-type", 1, 0, 0, event_type); @@ -48,6 +50,12 @@ extern "C" { init_event_type, event_p, wrap_event, unwrap_event); + SCM + event_gui_caller (SCM event) + { + return wrap_gui_element (unwrap_event (event)->GUIEvent.Caller); + } + SCM event_key_input_key (SCM event) { diff --git a/src/event-receiver.h b/src/event-receiver.h index 44dfc1a..c3bc67d 100644 --- a/src/event-receiver.h +++ b/src/event-receiver.h @@ -37,6 +37,9 @@ extern "C" { DECLARE_WRAPPED_TYPE (irr::SEvent*, init_event_type, event_p, wrap_event, unwrap_event); + SCM + event_gui_caller (SCM event); + SCM event_key_input_key (SCM event);