reflexion 0.5.2 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.doc/ext/reflex/application.cpp +19 -1
- data/.doc/ext/reflex/chase_constraint.cpp +84 -0
- data/.doc/ext/reflex/clipboard.cpp +65 -0
- data/.doc/ext/reflex/constraint.cpp +135 -0
- data/.doc/ext/reflex/key_event.cpp +6 -6
- data/.doc/ext/reflex/link_constraint.cpp +178 -0
- data/.doc/ext/reflex/menu.cpp +302 -0
- data/.doc/ext/reflex/native.cpp +22 -4
- data/.doc/ext/reflex/pin.cpp +156 -0
- data/.doc/ext/reflex/pointer.cpp +2 -0
- data/.doc/ext/reflex/pointer_event.cpp +1 -1
- data/.doc/ext/reflex/reflex.cpp +42 -7
- data/.doc/ext/reflex/selector.cpp +4 -4
- data/.doc/ext/reflex/snap_constraint.cpp +125 -0
- data/.doc/ext/reflex/style_length.cpp +3 -2
- data/.doc/ext/reflex/view.cpp +96 -23
- data/.doc/ext/reflex/wheel_constraint.cpp +142 -0
- data/.doc/ext/reflex/window.cpp +59 -17
- data/.github/workflows/release-gem.yml +10 -1
- data/.github/workflows/test.yml +9 -0
- data/ChangeLog.md +30 -0
- data/README.md +1 -0
- data/VERSION +1 -1
- data/ext/reflex/application.cpp +21 -1
- data/ext/reflex/chase_constraint.cpp +89 -0
- data/ext/reflex/clipboard.cpp +69 -0
- data/ext/reflex/constraint.cpp +146 -0
- data/ext/reflex/key_event.cpp +6 -6
- data/ext/reflex/link_constraint.cpp +194 -0
- data/ext/reflex/menu.cpp +330 -0
- data/ext/reflex/native.cpp +22 -4
- data/ext/reflex/pin.cpp +165 -0
- data/ext/reflex/pointer.cpp +2 -0
- data/ext/reflex/pointer_event.cpp +1 -1
- data/ext/reflex/reflex.cpp +42 -7
- data/ext/reflex/selector.cpp +4 -4
- data/ext/reflex/selector.h +1 -1
- data/ext/reflex/snap_constraint.cpp +135 -0
- data/ext/reflex/style_length.cpp +3 -2
- data/ext/reflex/view.cpp +117 -37
- data/ext/reflex/wheel_constraint.cpp +154 -0
- data/ext/reflex/window.cpp +65 -18
- data/include/reflex/application.h +9 -0
- data/include/reflex/clipboard.h +53 -0
- data/include/reflex/constraint.h +275 -0
- data/include/reflex/defs.h +204 -195
- data/include/reflex/event.h +2 -0
- data/include/reflex/menu.h +120 -0
- data/include/reflex/pin.h +68 -0
- data/include/reflex/pointer.h +4 -0
- data/include/reflex/ruby/clipboard.h +23 -0
- data/include/reflex/ruby/constraint.h +94 -0
- data/include/reflex/ruby/menu.h +103 -0
- data/include/reflex/ruby/pin.h +40 -0
- data/include/reflex/ruby/view.h +36 -0
- data/include/reflex/ruby/window.h +36 -18
- data/include/reflex/view.h +39 -12
- data/include/reflex/window.h +17 -4
- data/include/reflex.h +5 -0
- data/lib/reflex/chase_constraint.rb +15 -0
- data/lib/reflex/clipboard.rb +19 -0
- data/lib/reflex/constraint.rb +29 -0
- data/lib/reflex/extension.rb +1 -1
- data/lib/reflex/helper.rb +28 -0
- data/lib/reflex/key_event.rb +7 -12
- data/lib/reflex/link_constraint.rb +31 -0
- data/lib/reflex/menu.rb +76 -0
- data/lib/reflex/pin.rb +39 -0
- data/lib/reflex/pointer.rb +18 -0
- data/lib/reflex/pointer_event.rb +1 -1
- data/lib/reflex/snap_constraint.rb +28 -0
- data/lib/reflex/view.rb +56 -4
- data/lib/reflex/wheel_constraint.rb +28 -0
- data/lib/reflex/wheel_event.rb +9 -0
- data/lib/reflex.rb +15 -6
- data/pod.rake +4 -2
- data/reflex.gemspec +3 -3
- data/samples/constraint.rb +152 -0
- data/samples/menu.rb +29 -0
- data/src/application.cpp +21 -2
- data/src/application.h +5 -0
- data/src/clipboard.cpp +81 -0
- data/src/constraint.cpp +1662 -0
- data/src/constraint.h +64 -0
- data/src/event.cpp +7 -1
- data/src/event.h +1 -2
- data/src/ios/application.mm +5 -0
- data/src/ios/clipboard.mm +44 -0
- data/src/ios/event.h +6 -2
- data/src/ios/event.mm +31 -12
- data/src/ios/menu.mm +36 -0
- data/src/ios/view_controller.mm +45 -12
- data/src/ios/window.mm +6 -0
- data/src/menu.cpp +325 -0
- data/src/menu.h +65 -0
- data/src/osx/app_delegate.mm +74 -125
- data/src/osx/application.mm +16 -0
- data/src/osx/clipboard.mm +45 -0
- data/src/osx/event.mm +40 -10
- data/src/osx/menu.h +25 -0
- data/src/osx/menu.mm +372 -0
- data/src/osx/native_window.mm +27 -0
- data/src/osx/opengl_view.mm +51 -0
- data/src/osx/window.mm +11 -0
- data/src/pin.cpp +137 -0
- data/src/pointer.cpp +27 -16
- data/src/pointer.h +6 -0
- data/src/sdl/application.cpp +5 -0
- data/src/sdl/clipboard.cpp +39 -0
- data/src/sdl/event.cpp +20 -3
- data/src/sdl/event.h +6 -3
- data/src/sdl/menu.cpp +35 -0
- data/src/sdl/window.cpp +26 -8
- data/src/view.cpp +313 -52
- data/src/view.h +18 -2
- data/src/win32/application.cpp +5 -0
- data/src/win32/clipboard.cpp +210 -0
- data/src/win32/event.cpp +11 -1
- data/src/win32/event.h +2 -0
- data/src/win32/menu.cpp +352 -0
- data/src/win32/menu.h +27 -0
- data/src/win32/window.cpp +62 -0
- data/src/win32/window.h +3 -0
- data/src/window.cpp +235 -22
- data/src/window.h +13 -2
- data/src/world.cpp +77 -14
- data/src/world.h +9 -2
- data/test/helper.rb +7 -0
- data/test/test_application.rb +11 -0
- data/test/test_chase_constraint.rb +124 -0
- data/test/test_clipboard.rb +54 -0
- data/test/test_constraint.rb +186 -0
- data/test/test_key_event.rb +6 -0
- data/test/test_link_constraint.rb +239 -0
- data/test/test_menu.rb +207 -0
- data/test/test_pin.rb +65 -0
- data/test/test_pointer.rb +23 -9
- data/test/test_pointer_event.rb +1 -1
- data/test/test_snap_constraint.rb +142 -0
- data/test/test_view.rb +113 -23
- data/test/test_wheel_constraint.rb +127 -0
- data/test/test_wheel_event.rb +15 -9
- data/test/test_window.rb +10 -0
- metadata +82 -8
data/src/pin.cpp
ADDED
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
#include "reflex/pin.h"
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
#include "reflex/exception.h"
|
|
5
|
+
#include "view.h"
|
|
6
|
+
#include "constraint.h"
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
namespace Reflex
|
|
10
|
+
{
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
struct Pin::Data
|
|
14
|
+
{
|
|
15
|
+
|
|
16
|
+
Xot::WeakRef<View> view;
|
|
17
|
+
|
|
18
|
+
std::unique_ptr<Point> pposition;
|
|
19
|
+
|
|
20
|
+
};// Pin::Data
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
template <typename T>
|
|
24
|
+
static T*
|
|
25
|
+
setup_constraint (
|
|
26
|
+
T* constraint,
|
|
27
|
+
View* view0, const Point* position0,
|
|
28
|
+
View* view1, const Point* position1)
|
|
29
|
+
{
|
|
30
|
+
if (!view0)
|
|
31
|
+
invalid_state_error(__FILE__, __LINE__, "the pin has no view");
|
|
32
|
+
|
|
33
|
+
Constraint_set_pins(constraint, view0, position0, view1, position1);
|
|
34
|
+
View_add_constraint(view0, constraint);
|
|
35
|
+
return constraint;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
Pin::Pin ()
|
|
40
|
+
{
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
Pin::Pin (coord x, coord y)
|
|
44
|
+
: Pin(NULL, Point(x, y))
|
|
45
|
+
{
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
Pin::Pin (const Point& position)
|
|
49
|
+
: Pin(NULL, position)
|
|
50
|
+
{
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
Pin::Pin (View* view)
|
|
54
|
+
{
|
|
55
|
+
self->view = view;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
Pin::Pin (View* view, coord x, coord y)
|
|
59
|
+
: Pin(view, Point(x, y))
|
|
60
|
+
{
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
Pin::Pin (View* view, const Point& position)
|
|
64
|
+
{
|
|
65
|
+
self->view = view;
|
|
66
|
+
self->pposition.reset(new Point(position));
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
SnapConstraint*
|
|
70
|
+
Pin::snap (Pin target)
|
|
71
|
+
{
|
|
72
|
+
return setup_constraint(
|
|
73
|
+
Xot::Ref<SnapConstraint>(SnapConstraint_create()).get(),
|
|
74
|
+
view(), position(), target.view(), target.position());
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
LinkConstraint*
|
|
78
|
+
Pin::link (Pin target)
|
|
79
|
+
{
|
|
80
|
+
return setup_constraint(
|
|
81
|
+
Xot::Ref<LinkConstraint>(LinkConstraint_create()).get(),
|
|
82
|
+
view(), position(), target.view(), target.position());
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
WheelConstraint*
|
|
86
|
+
Pin::wheel (Pin target)
|
|
87
|
+
{
|
|
88
|
+
return setup_constraint(
|
|
89
|
+
Xot::Ref<WheelConstraint>(WheelConstraint_create()).get(),
|
|
90
|
+
view(), position(), target.view(), target.position());
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
ChaseConstraint*
|
|
94
|
+
Pin::chase (Pin target)
|
|
95
|
+
{
|
|
96
|
+
if (target.view() && target.view() == view())
|
|
97
|
+
argument_error(__FILE__, __LINE__, "can not chase itself");
|
|
98
|
+
|
|
99
|
+
ChaseConstraint* chase = setup_constraint(
|
|
100
|
+
Xot::Ref<ChaseConstraint>(ChaseConstraint_create()).get(),
|
|
101
|
+
view(), position(), NULL, NULL);
|
|
102
|
+
chase->set_target(target);
|
|
103
|
+
return chase;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
View*
|
|
107
|
+
Pin::view ()
|
|
108
|
+
{
|
|
109
|
+
return self->view.get();
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
const View*
|
|
113
|
+
Pin::view () const
|
|
114
|
+
{
|
|
115
|
+
return const_cast<Pin*>(this)->view();
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
const Point*
|
|
119
|
+
Pin::position () const
|
|
120
|
+
{
|
|
121
|
+
return self->pposition ? self->pposition.get() : NULL;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
Pin::operator bool () const
|
|
125
|
+
{
|
|
126
|
+
return true;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
bool
|
|
130
|
+
Pin::operator ! () const
|
|
131
|
+
{
|
|
132
|
+
return !operator bool();
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
}// Reflex
|
|
137
|
+
|
data/src/pointer.cpp
CHANGED
|
@@ -29,13 +29,11 @@ namespace Reflex
|
|
|
29
29
|
|
|
30
30
|
DRAG = Xot::bit(0, TYPE_LAST),
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
FLOATABLE = Xot::bit(1, TYPE_LAST),
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
HAS_SYSTEM_ID = Xot::bit(2, TYPE_LAST),
|
|
35
35
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
HAS_PREV_POS = Xot::bit(4, TYPE_LAST),
|
|
36
|
+
HAS_PREV_POS = Xot::bit(3, TYPE_LAST),
|
|
39
37
|
|
|
40
38
|
};// Flag
|
|
41
39
|
|
|
@@ -56,23 +54,15 @@ namespace Reflex
|
|
|
56
54
|
Data (
|
|
57
55
|
ID id = -1, uint types = TYPE_NONE, Action action = ACTION_NONE,
|
|
58
56
|
const Point& position = 0, uint modifiers = 0, uint click_count = 0,
|
|
59
|
-
bool drag = false,
|
|
57
|
+
bool drag = false,
|
|
60
58
|
double time = 0)
|
|
61
59
|
: id(id), types(types), action(action),
|
|
62
60
|
position(position), modifiers(modifiers), click_count(click_count),
|
|
63
|
-
flags(
|
|
61
|
+
flags(drag ? DRAG : 0),
|
|
64
62
|
time(time)
|
|
65
63
|
{
|
|
66
64
|
}
|
|
67
65
|
|
|
68
|
-
uint make_flags (bool drag, bool enter, bool exit)
|
|
69
|
-
{
|
|
70
|
-
return
|
|
71
|
-
(drag ? DRAG : 0) |
|
|
72
|
-
(enter ? ENTER : 0) |
|
|
73
|
-
(exit ? EXIT : 0);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
66
|
bool is_valid () const
|
|
77
67
|
{
|
|
78
68
|
return id >= 0 && types != TYPE_NONE && action != ACTION_NONE;
|
|
@@ -96,6 +86,27 @@ namespace Reflex
|
|
|
96
86
|
it->self->id = id;
|
|
97
87
|
}
|
|
98
88
|
|
|
89
|
+
void
|
|
90
|
+
Pointer_set_action (Pointer* it, Pointer::Action action)
|
|
91
|
+
{
|
|
92
|
+
it->self->action = action;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
void
|
|
96
|
+
Pointer_set_floatable (Pointer* it, bool floatable)
|
|
97
|
+
{
|
|
98
|
+
if (floatable)
|
|
99
|
+
Xot::add_flag(&it->self->flags, Pointer::Data::FLOATABLE);
|
|
100
|
+
else
|
|
101
|
+
Xot::remove_flag(&it->self->flags, Pointer::Data::FLOATABLE);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
bool
|
|
105
|
+
Pointer_is_floatable (const Pointer& it)
|
|
106
|
+
{
|
|
107
|
+
return Xot::has_flag(it.self->flags, Pointer::Data::FLOATABLE);
|
|
108
|
+
}
|
|
109
|
+
|
|
99
110
|
void
|
|
100
111
|
Pointer_add_flag (Pointer* it, uint flag)
|
|
101
112
|
{
|
|
@@ -167,7 +178,7 @@ namespace Reflex
|
|
|
167
178
|
double time)
|
|
168
179
|
: self(new Data(
|
|
169
180
|
id, types, action,
|
|
170
|
-
position, modifiers, click_count, drag,
|
|
181
|
+
position, modifiers, click_count, drag,
|
|
171
182
|
time))
|
|
172
183
|
{
|
|
173
184
|
}
|
data/src/pointer.h
CHANGED
|
@@ -16,6 +16,12 @@ namespace Reflex
|
|
|
16
16
|
|
|
17
17
|
void Pointer_set_id (Pointer* it, Pointer::ID id);
|
|
18
18
|
|
|
19
|
+
void Pointer_set_action (Pointer* it, Pointer::Action action);
|
|
20
|
+
|
|
21
|
+
void Pointer_set_floatable (Pointer* it, bool floatable);
|
|
22
|
+
|
|
23
|
+
bool Pointer_is_floatable (const Pointer& it);
|
|
24
|
+
|
|
19
25
|
void Pointer_add_flag (Pointer* it, uint flag);
|
|
20
26
|
|
|
21
27
|
void Pointer_remove_flag (Pointer* it, uint flag);
|
data/src/sdl/application.cpp
CHANGED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
#include "reflex/clipboard.h"
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
#include <SDL.h>
|
|
5
|
+
#include "reflex/exception.h"
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
namespace Reflex
|
|
9
|
+
{
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
void
|
|
13
|
+
set_clipboard (const Clipboard& clipboard)
|
|
14
|
+
{
|
|
15
|
+
const char* text = clipboard.text();
|
|
16
|
+
if (SDL_SetClipboardText(text ? text : "") != 0)
|
|
17
|
+
reflex_error(__FILE__, __LINE__, SDL_GetError());
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
Clipboard
|
|
21
|
+
get_clipboard ()
|
|
22
|
+
{
|
|
23
|
+
Clipboard clipboard;
|
|
24
|
+
|
|
25
|
+
if (SDL_HasClipboardText() == SDL_TRUE)
|
|
26
|
+
{
|
|
27
|
+
char* text = SDL_GetClipboardText();
|
|
28
|
+
if (text)
|
|
29
|
+
{
|
|
30
|
+
clipboard.set_text(text);
|
|
31
|
+
SDL_free(text);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return clipboard;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
}// Reflex
|
data/src/sdl/event.cpp
CHANGED
|
@@ -94,7 +94,7 @@ namespace Reflex
|
|
|
94
94
|
}
|
|
95
95
|
|
|
96
96
|
NativePointerEvent::NativePointerEvent (
|
|
97
|
-
const SDL_MouseButtonEvent& e,
|
|
97
|
+
SDL_Window* window, const SDL_MouseButtonEvent& e, Pointer::Action action)
|
|
98
98
|
{
|
|
99
99
|
PointerEvent_add_pointer(this, Pointer(
|
|
100
100
|
0,
|
|
@@ -108,7 +108,7 @@ namespace Reflex
|
|
|
108
108
|
}
|
|
109
109
|
|
|
110
110
|
NativePointerEvent::NativePointerEvent (
|
|
111
|
-
const SDL_MouseMotionEvent& e
|
|
111
|
+
SDL_Window* window, const SDL_MouseMotionEvent& e)
|
|
112
112
|
{
|
|
113
113
|
PointerEvent_add_pointer(this, Pointer(
|
|
114
114
|
0,
|
|
@@ -122,7 +122,7 @@ namespace Reflex
|
|
|
122
122
|
}
|
|
123
123
|
|
|
124
124
|
NativePointerEvent::NativePointerEvent (
|
|
125
|
-
const SDL_TouchFingerEvent& e,
|
|
125
|
+
SDL_Window* window, const SDL_TouchFingerEvent& e, Pointer::Action action)
|
|
126
126
|
{
|
|
127
127
|
uint mods = get_modifiers(SDL_GetModState());
|
|
128
128
|
double t = time();
|
|
@@ -157,6 +157,23 @@ namespace Reflex
|
|
|
157
157
|
}
|
|
158
158
|
}
|
|
159
159
|
|
|
160
|
+
NativePointerEvent::NativePointerEvent (
|
|
161
|
+
SDL_Window* window, Pointer::Action action)
|
|
162
|
+
{
|
|
163
|
+
int x = 0, y = 0;
|
|
164
|
+
Uint32 state = SDL_GetMouseState(&x, &y);
|
|
165
|
+
|
|
166
|
+
PointerEvent_add_pointer(this, Pointer(
|
|
167
|
+
0,
|
|
168
|
+
get_current_pointer_type(state),
|
|
169
|
+
action,
|
|
170
|
+
Point(x, y),
|
|
171
|
+
get_modifiers(SDL_GetModState()),
|
|
172
|
+
0,
|
|
173
|
+
false,
|
|
174
|
+
time()));
|
|
175
|
+
}
|
|
176
|
+
|
|
160
177
|
|
|
161
178
|
NativeWheelEvent::NativeWheelEvent (
|
|
162
179
|
const SDL_MouseWheelEvent& e, SDL_Window* window)
|
data/src/sdl/event.h
CHANGED
|
@@ -28,16 +28,19 @@ namespace Reflex
|
|
|
28
28
|
public:
|
|
29
29
|
|
|
30
30
|
NativePointerEvent (
|
|
31
|
-
const SDL_MouseButtonEvent& event,
|
|
31
|
+
SDL_Window* window, const SDL_MouseButtonEvent& event,
|
|
32
32
|
Pointer::Action action);
|
|
33
33
|
|
|
34
34
|
NativePointerEvent (
|
|
35
|
-
const SDL_MouseMotionEvent& event
|
|
35
|
+
SDL_Window* window, const SDL_MouseMotionEvent& event);
|
|
36
36
|
|
|
37
37
|
NativePointerEvent (
|
|
38
|
-
const SDL_TouchFingerEvent& event,
|
|
38
|
+
SDL_Window* window, const SDL_TouchFingerEvent& event,
|
|
39
39
|
Pointer::Action action);
|
|
40
40
|
|
|
41
|
+
NativePointerEvent (
|
|
42
|
+
SDL_Window* window, Pointer::Action action);
|
|
43
|
+
|
|
41
44
|
};// NativePointerEvent
|
|
42
45
|
|
|
43
46
|
|
data/src/sdl/menu.cpp
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
#include "../menu.h"
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
namespace Reflex
|
|
5
|
+
{
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
Menu::Data*
|
|
9
|
+
Menu_create_data ()
|
|
10
|
+
{
|
|
11
|
+
return new Menu::Data();
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
void
|
|
15
|
+
Menu_update (Menu* menu)
|
|
16
|
+
{
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
void
|
|
20
|
+
Menu_popup (Menu* menu, View* view, coord x, coord y)
|
|
21
|
+
{
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
void
|
|
25
|
+
Menu_child_added (Menu* parent, Menu* child, int index)
|
|
26
|
+
{
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
void
|
|
30
|
+
Menu_child_removed (Menu* parent, Menu* child)
|
|
31
|
+
{
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
}// Reflex
|
data/src/sdl/window.cpp
CHANGED
|
@@ -283,6 +283,12 @@ namespace Reflex
|
|
|
283
283
|
return Bounds(x, y, w, h);
|
|
284
284
|
}
|
|
285
285
|
|
|
286
|
+
void
|
|
287
|
+
Window_set_menu (Window* window, Menu* menu)
|
|
288
|
+
{
|
|
289
|
+
not_implemented_error(__FILE__, __LINE__);
|
|
290
|
+
}
|
|
291
|
+
|
|
286
292
|
Screen
|
|
287
293
|
Window_get_screen (const Window& win)
|
|
288
294
|
{
|
|
@@ -383,6 +389,20 @@ namespace Reflex
|
|
|
383
389
|
case SDL_WINDOWEVENT_FOCUS_LOST:
|
|
384
390
|
Window_call_deactivate_event(win);
|
|
385
391
|
break;
|
|
392
|
+
|
|
393
|
+
case SDL_WINDOWEVENT_ENTER:
|
|
394
|
+
{
|
|
395
|
+
NativePointerEvent e(self->native, Pointer::ENTER);
|
|
396
|
+
Window_call_pointer_event(win, &e);
|
|
397
|
+
break;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
case SDL_WINDOWEVENT_LEAVE:
|
|
401
|
+
{
|
|
402
|
+
NativePointerEvent e(self->native, Pointer::LEAVE);
|
|
403
|
+
Window_call_pointer_event(win, &e);
|
|
404
|
+
break;
|
|
405
|
+
}
|
|
386
406
|
}
|
|
387
407
|
break;
|
|
388
408
|
}
|
|
@@ -403,23 +423,21 @@ namespace Reflex
|
|
|
403
423
|
|
|
404
424
|
case SDL_MOUSEBUTTONDOWN:
|
|
405
425
|
{
|
|
406
|
-
NativePointerEvent e(
|
|
407
|
-
event.button, self->native, Pointer::DOWN);
|
|
426
|
+
NativePointerEvent e(self->native, event.button, Pointer::DOWN);
|
|
408
427
|
Window_call_pointer_event(win, &e);
|
|
409
428
|
break;
|
|
410
429
|
}
|
|
411
430
|
|
|
412
431
|
case SDL_MOUSEBUTTONUP:
|
|
413
432
|
{
|
|
414
|
-
NativePointerEvent e(
|
|
415
|
-
event.button, self->native, Pointer::UP);
|
|
433
|
+
NativePointerEvent e(self->native, event.button, Pointer::UP);
|
|
416
434
|
Window_call_pointer_event(win, &e);
|
|
417
435
|
break;
|
|
418
436
|
}
|
|
419
437
|
|
|
420
438
|
case SDL_MOUSEMOTION:
|
|
421
439
|
{
|
|
422
|
-
NativePointerEvent e(event.motion
|
|
440
|
+
NativePointerEvent e(self->native, event.motion);
|
|
423
441
|
Window_call_pointer_event(win, &e);
|
|
424
442
|
break;
|
|
425
443
|
}
|
|
@@ -433,21 +451,21 @@ namespace Reflex
|
|
|
433
451
|
|
|
434
452
|
case SDL_FINGERDOWN:
|
|
435
453
|
{
|
|
436
|
-
NativePointerEvent e(event.tfinger,
|
|
454
|
+
NativePointerEvent e(self->native, event.tfinger, Pointer::DOWN);
|
|
437
455
|
Window_call_pointer_event(win, &e);
|
|
438
456
|
break;
|
|
439
457
|
}
|
|
440
458
|
|
|
441
459
|
case SDL_FINGERUP:
|
|
442
460
|
{
|
|
443
|
-
NativePointerEvent e(event.tfinger,
|
|
461
|
+
NativePointerEvent e(self->native, event.tfinger, Pointer::UP);
|
|
444
462
|
Window_call_pointer_event(win, &e);
|
|
445
463
|
break;
|
|
446
464
|
}
|
|
447
465
|
|
|
448
466
|
case SDL_FINGERMOTION:
|
|
449
467
|
{
|
|
450
|
-
NativePointerEvent e(event.tfinger,
|
|
468
|
+
NativePointerEvent e(self->native, event.tfinger, Pointer::MOVE);
|
|
451
469
|
Window_call_pointer_event(win, &e);
|
|
452
470
|
break;
|
|
453
471
|
}
|