More static methods in DisplayServerJavaScript.

Were static functions in cpp file, polluting global namespace.
This commit is contained in:
Fabio Alessandrelli 2020-07-01 02:23:22 +02:00
parent fd92270b0a
commit a1c4c1d318
2 changed files with 19 additions and 9 deletions

View file

@ -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);