vsg: include/vsg/ui/TouchEvent.h Source File

vsg 1.1.10 VulkanSceneGraph library |

Loading...
Searching...
No Matches
TouchEvent.h
1#pragma once
2
3/* <editor-fold desc="MIT License">
4
5Copyright(c) 2018 Robert Osfield
6
7Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
8
9The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
10
11THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
12
13</editor-fold> */
14
15#include <vsg/app/Window.h>
16#include <vsg/core/observer_ptr.h>
17#include <vsg/ui/WindowEvent.h>
18
19namespace vsg
20{
21
23 class VSG_DECLSPEC TouchEvent : public Inherit<WindowEvent, TouchEvent>
24 {
25 public:
26 TouchEvent() {}
27
28 TouchEvent(Window* in_window, time_point in_time, uint32_t in_x, uint32_t in_y, uint32_t in_id) :
29 Inherit(in_window, in_time),
30 x(in_x),
31 y(in_y),
32 id(in_id) {}
33
34 uint32_t x = 0;
35 uint32_t y = 0;
36 uint32_t id = 0;
37
38 void read(Input& input) override;
39 void write(Output& output) const override;
40 };
41 VSG_type_name(vsg::TouchEvent);
42
44 class TouchDownEvent : public Inherit<TouchEvent, TouchDownEvent>
45 {
46 public:
47 TouchDownEvent() {}
48
49 TouchDownEvent(Window* in_window, time_point in_time, uint32_t in_x, uint32_t in_y, uint32_t in_id) :
50 Inherit(in_window, in_time, in_x, in_y, in_id) {}
51 };
52 VSG_type_name(vsg::TouchDownEvent);
53
55 class TouchUpEvent : public Inherit<TouchEvent, TouchUpEvent>
56 {
57 public:
58 TouchUpEvent() {}
59
60 TouchUpEvent(Window* in_window, time_point in_time, uint32_t in_x, uint32_t in_y, uint32_t in_id) :
61 Inherit(in_window, in_time, in_x, in_y, in_id) {}
62 };
63 VSG_type_name(vsg::TouchUpEvent);
64
66 class TouchMoveEvent : public Inherit<TouchEvent, TouchMoveEvent>
67 {
68 public:
69 TouchMoveEvent() {}
70
71 TouchMoveEvent(Window* in_window, time_point in_time, uint32_t in_x, uint32_t in_y, uint32_t in_id) :
72 Inherit(in_window, in_time, in_x, in_y, in_id) {}
73 };
74 VSG_type_name(vsg::TouchMoveEvent);
75
76} // namespace vsg
vsg::Input
Definition Input.h:44
vsg::Output
Definition Output.h:41
vsg::TouchDownEvent
TouchDownEvent represents a touch down event.
Definition TouchEvent.h:45
vsg::TouchEvent
TouchEvent is a base class for touch events.
Definition TouchEvent.h:24
vsg::TouchMoveEvent
TouchMoveEvent represents a touch move event.
Definition TouchEvent.h:67
vsg::TouchUpEvent
TouchUpEvent represents a touch up event.
Definition TouchEvent.h:56
vsg::Window
Definition Window.h:31