summaryrefslogtreecommitdiffstats
path: root/platform/javascript/display_server_javascript.h
diff options
context:
space:
mode:
authorFabio Alessandrelli <fabio.alessandrelli@gmail.com>2020-07-01 02:23:22 +0200
committerFabio Alessandrelli <fabio.alessandrelli@gmail.com>2020-07-01 17:16:03 +0200
commita1c4c1d318469c5d58becd36537c14eca1fec014 (patch)
tree00c861c19ccc91c9a46d9effb031651c609fd797 /platform/javascript/display_server_javascript.h
parentfd92270b0aa7a14bb09d959302df52040f2c3999 (diff)
downloadredot-engine-a1c4c1d318469c5d58becd36537c14eca1fec014.tar.gz
More static methods in DisplayServerJavaScript.
Were static functions in cpp file, polluting global namespace.
Diffstat (limited to 'platform/javascript/display_server_javascript.h')
-rw-r--r--platform/javascript/display_server_javascript.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/platform/javascript/display_server_javascript.h b/platform/javascript/display_server_javascript.h
index 2ce335100f..e9776ad688 100644
--- a/platform/javascript/display_server_javascript.h
+++ b/platform/javascript/display_server_javascript.h
@@ -53,7 +53,18 @@ class DisplayServerJavaScript : public DisplayServer {
double last_click_ms = 0;
int last_click_button_index = -1;
+ // utilities
static Point2 compute_position_in_canvas(int p_x, int p_y);
+ static void focus_canvas();
+ static bool is_canvas_focused();
+ template <typename T>
+ static void dom2godot_mod(T *emscripten_event_ptr, Ref<InputEventWithModifiers> godot_event);
+ static Ref<InputEventKey> setup_key_event(const EmscriptenKeyboardEvent *emscripten_event);
+ static const char *godot2dom_cursor(DisplayServer::CursorShape p_shape);
+ static void set_css_cursor(const char *p_cursor);
+ bool is_css_cursor_hidden() const;
+
+ // events
static EM_BOOL fullscreen_change_callback(int p_event_type, const EmscriptenFullscreenChangeEvent *p_event, void *p_user_data);
static EM_BOOL keydown_callback(int p_event_type, const EmscriptenKeyboardEvent *p_event, void *p_user_data);