diff options
author | Bernhard Liebl <Bernhard.Liebl@gmx.org> | 2017-11-01 21:49:39 +0100 |
---|---|---|
committer | Bernhard Liebl <Bernhard.Liebl@gmx.org> | 2017-11-21 09:11:39 +0100 |
commit | 80ad8afc85a90e6fda1b136b13c1eb42e35c115e (patch) | |
tree | bc145bc5c008a2abfa159f4d5437c8d0b8813aca /core/os/input_event.h | |
parent | 5ff84070ca3604b43e86562a3d000ed924a604a2 (diff) | |
download | redot-engine-80ad8afc85a90e6fda1b136b13c1eb42e35c115e.tar.gz |
Native pan and zoom for macOS
Diffstat (limited to 'core/os/input_event.h')
-rw-r--r-- | core/os/input_event.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/core/os/input_event.h b/core/os/input_event.h index de3c0232ff..2cba60bede 100644 --- a/core/os/input_event.h +++ b/core/os/input_event.h @@ -213,6 +213,8 @@ public: void set_command(bool p_enabled); bool get_command() const; + void set_modifiers_from_event(const InputEventWithModifiers *event); + InputEventWithModifiers(); }; @@ -468,4 +470,42 @@ public: InputEventAction(); }; +class InputEventGesture : public InputEventWithModifiers { + + GDCLASS(InputEventGesture, InputEventWithModifiers) + + Vector2 pos; + +public: + void set_position(const Vector2 &p_pos); + Vector2 get_position() const; +}; + +class InputEventMagnifyGesture : public InputEventGesture { + + GDCLASS(InputEventMagnifyGesture, InputEventGesture) + real_t factor; + +public: + void set_factor(real_t p_factor); + real_t get_factor() const; + + virtual Ref<InputEvent> xformed_by(const Transform2D &p_xform, const Vector2 &p_local_ofs = Vector2()) const; + + InputEventMagnifyGesture(); +}; + +class InputEventPanGesture : public InputEventGesture { + + GDCLASS(InputEventPanGesture, InputEventGesture) + Vector2 delta; + +public: + void set_delta(const Vector2 &p_delta); + Vector2 get_delta() const; + + virtual Ref<InputEvent> xformed_by(const Transform2D &p_xform, const Vector2 &p_local_ofs = Vector2()) const; + + InputEventPanGesture(); +}; #endif |