reflexion 0.1.21 → 0.1.25
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.doc/ext/reflex/capture_event.cpp +6 -5
- data/.doc/ext/reflex/contact_event.cpp +18 -16
- data/.doc/ext/reflex/draw_event.cpp +10 -8
- data/.doc/ext/reflex/event.cpp +10 -10
- data/.doc/ext/reflex/focus_event.cpp +18 -17
- data/.doc/ext/reflex/frame_event.cpp +17 -17
- data/.doc/ext/reflex/key_event.cpp +227 -28
- data/.doc/ext/reflex/native.cpp +2 -0
- data/.doc/ext/reflex/pointer.cpp +158 -0
- data/.doc/ext/reflex/pointer_event.cpp +32 -91
- data/.doc/ext/reflex/scroll_event.cpp +14 -17
- data/.doc/ext/reflex/selector.cpp +8 -0
- data/.doc/ext/reflex/timer.cpp +9 -1
- data/.doc/ext/reflex/timer_event.cpp +4 -13
- data/.doc/ext/reflex/update_event.cpp +6 -5
- data/.doc/ext/reflex/view.cpp +57 -0
- data/.doc/ext/reflex/wheel_event.cpp +39 -22
- data/.doc/ext/reflex/window.cpp +24 -0
- data/VERSION +1 -1
- data/ext/reflex/capture_event.cpp +6 -5
- data/ext/reflex/contact_event.cpp +18 -16
- data/ext/reflex/draw_event.cpp +9 -7
- data/ext/reflex/event.cpp +11 -11
- data/ext/reflex/focus_event.cpp +18 -17
- data/ext/reflex/frame_event.cpp +16 -16
- data/ext/reflex/key_event.cpp +228 -28
- data/ext/reflex/native.cpp +2 -0
- data/ext/reflex/pointer.cpp +170 -0
- data/ext/reflex/pointer_event.cpp +31 -96
- data/ext/reflex/scroll_event.cpp +15 -18
- data/ext/reflex/selector.cpp +9 -0
- data/ext/reflex/timer.cpp +15 -6
- data/ext/reflex/timer_event.cpp +9 -19
- data/ext/reflex/update_event.cpp +6 -5
- data/ext/reflex/view.cpp +67 -3
- data/ext/reflex/wheel_event.cpp +40 -21
- data/ext/reflex/window.cpp +30 -3
- data/include/reflex/defs.h +140 -106
- data/include/reflex/event.h +232 -124
- data/include/reflex/pointer.h +107 -0
- data/include/reflex/ruby/pointer.h +41 -0
- data/include/reflex/ruby/view.h +9 -0
- data/include/reflex/ruby/window.h +9 -0
- data/include/reflex/selector.h +1 -1
- data/include/reflex/shape.h +2 -2
- data/include/reflex/view.h +6 -4
- data/include/reflex/window.h +10 -8
- data/lib/reflex/application.rb +3 -3
- data/lib/reflex/autoinit.rb +1 -1
- data/lib/reflex/button.rb +7 -7
- data/lib/reflex/capture_event.rb +7 -7
- data/lib/reflex/contact_event.rb +10 -10
- data/lib/reflex/draw_event.rb +2 -2
- data/lib/reflex/ellipse_shape.rb +2 -2
- data/lib/reflex/focus_event.rb +11 -11
- data/lib/reflex/frame_event.rb +5 -5
- data/lib/reflex/helper.rb +20 -20
- data/lib/reflex/image_view.rb +2 -2
- data/lib/reflex/key_event.rb +12 -12
- data/lib/reflex/model.rb +22 -22
- data/lib/reflex/model_owner.rb +7 -7
- data/lib/reflex/model_view.rb +1 -1
- data/lib/reflex/module.rb +5 -5
- data/lib/reflex/pointer.rb +107 -0
- data/lib/reflex/pointer_event.rb +16 -54
- data/lib/reflex/polygon_shape.rb +2 -2
- data/lib/reflex/reflex.rb +3 -3
- data/lib/reflex/scroll_event.rb +1 -1
- data/lib/reflex/selector.rb +4 -4
- data/lib/reflex/shape.rb +13 -13
- data/lib/reflex/style.rb +11 -11
- data/lib/reflex/style_length.rb +1 -1
- data/lib/reflex/text_view.rb +2 -2
- data/lib/reflex/timer.rb +2 -2
- data/lib/reflex/timer_event.rb +3 -2
- data/lib/reflex/update_event.rb +1 -1
- data/lib/reflex/view.rb +32 -32
- data/lib/reflex/wheel_event.rb +2 -10
- data/lib/reflex/window.rb +6 -6
- data/lib/reflex.rb +1 -0
- data/lib/reflexion.rb +17 -17
- data/reflex.gemspec +5 -5
- data/samples/reflexion/noise.rb +1 -1
- data/samples/tree.rb +1 -1
- data/src/event.cpp +792 -86
- data/src/event.h +47 -0
- data/src/image_view.cpp +2 -2
- data/src/ios/event.h +15 -3
- data/src/ios/event.mm +126 -11
- data/src/ios/view_controller.mm +50 -22
- data/src/ios/window.mm +1 -1
- data/src/osx/event.h +15 -4
- data/src/osx/event.mm +214 -24
- data/src/osx/native_window.mm +84 -17
- data/src/pointer.cpp +203 -0
- data/src/pointer.h +26 -0
- data/src/selector.cpp +1 -1
- data/src/shape.cpp +11 -13
- data/src/shape.h +1 -1
- data/src/view.cpp +205 -118
- data/src/view.h +5 -10
- data/src/window.cpp +334 -104
- data/src/window.h +22 -3
- data/src/world.cpp +6 -4
- data/test/helper.rb +3 -3
- data/test/test_application.rb +1 -1
- data/test/test_capture_event.rb +22 -6
- data/test/test_contact_event.rb +40 -0
- data/test/test_draw_event.rb +35 -0
- data/test/test_event.rb +33 -5
- data/test/test_focus_event.rb +34 -0
- data/test/test_frame_event.rb +38 -0
- data/test/test_has_frame.rb +11 -11
- data/test/test_key_event.rb +33 -0
- data/test/test_pointer.rb +149 -0
- data/test/test_pointer_event.rb +70 -104
- data/test/test_reflex.rb +1 -1
- data/test/test_scroll_event.rb +39 -0
- data/test/test_selector.rb +15 -8
- data/test/test_shape.rb +8 -8
- data/test/test_style.rb +13 -13
- data/test/test_style_length.rb +5 -5
- data/test/test_timer_event.rb +38 -0
- data/test/test_update_event.rb +29 -0
- data/test/test_view.rb +57 -30
- data/test/test_wheel_event.rb +40 -0
- data/test/test_window.rb +29 -27
- metadata +64 -35
data/src/event.h
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
// -*- c++ -*-
|
2
|
+
#pragma once
|
3
|
+
#ifndef __REFLEX_SRC_EVENT_H__
|
4
|
+
#define __REFLEX_SRC_EVENT_H__
|
5
|
+
|
6
|
+
|
7
|
+
#include <functional>
|
8
|
+
#include <reflex/event.h>
|
9
|
+
|
10
|
+
|
11
|
+
namespace Reflex
|
12
|
+
{
|
13
|
+
|
14
|
+
|
15
|
+
void DrawEvent_set_view (DrawEvent* pthis, View* view);
|
16
|
+
|
17
|
+
void DrawEvent_set_painter (DrawEvent* pthis, Painter* painter);
|
18
|
+
|
19
|
+
void DrawEvent_set_bounds (DrawEvent* pthis, const Bounds& bounds);
|
20
|
+
|
21
|
+
|
22
|
+
void KeyEvent_set_captured (KeyEvent* pthis, bool captured);
|
23
|
+
|
24
|
+
|
25
|
+
void PointerEvent_add_pointer (PointerEvent* pthis, const Pointer& pointer);
|
26
|
+
|
27
|
+
void PointerEvent_erase_pointer (PointerEvent* pthis, Pointer::ID id);
|
28
|
+
|
29
|
+
Pointer& PointerEvent_pointer_at (PointerEvent* pthis, size_t index);
|
30
|
+
|
31
|
+
void PointerEvent_each_pointer (
|
32
|
+
const PointerEvent* pthis, std::function<void(const Pointer&)> fun);
|
33
|
+
|
34
|
+
void PointerEvent_set_captured (PointerEvent* pthis, bool captured);
|
35
|
+
|
36
|
+
void PointerEvent_update_for_child_view (PointerEvent* pthis, const View* view);
|
37
|
+
|
38
|
+
void PointerEvent_update_for_capturing_view (PointerEvent* pthis, const View* view);
|
39
|
+
|
40
|
+
|
41
|
+
void WheelEvent_set_position (WheelEvent* pthis, const Point& position);
|
42
|
+
|
43
|
+
|
44
|
+
}// Reflex
|
45
|
+
|
46
|
+
|
47
|
+
#endif//EOH
|
data/src/image_view.cpp
CHANGED
data/src/ios/event.h
CHANGED
@@ -4,18 +4,30 @@
|
|
4
4
|
#define __REFLEX_SRC_IOS_EVENT_H__
|
5
5
|
|
6
6
|
|
7
|
+
#include <list>
|
7
8
|
#import <UIKit/UIEvent.h>
|
8
|
-
#include
|
9
|
+
#include "../event.h"
|
9
10
|
|
10
11
|
|
11
12
|
namespace Reflex
|
12
13
|
{
|
13
14
|
|
14
15
|
|
15
|
-
|
16
|
+
typedef std::list<Pointer> PrevPointerList;
|
17
|
+
|
18
|
+
|
19
|
+
class NativePointerEvent : public PointerEvent
|
16
20
|
{
|
17
21
|
|
18
|
-
|
22
|
+
public:
|
23
|
+
|
24
|
+
NativePointerEvent (
|
25
|
+
NSSet* touches, UIEvent* event, UIView* view,
|
26
|
+
Pointer::ID* pointer_id);
|
27
|
+
|
28
|
+
NativePointerEvent (
|
29
|
+
NSSet* touches, UIEvent* event, UIView* view,
|
30
|
+
PrevPointerList* prev_pointers);
|
19
31
|
|
20
32
|
};// NativePointerEvent
|
21
33
|
|
data/src/ios/event.mm
CHANGED
@@ -3,30 +3,145 @@
|
|
3
3
|
|
4
4
|
|
5
5
|
#include <assert.h>
|
6
|
+
#include <algorithm>
|
7
|
+
#include "../pointer.h"
|
6
8
|
|
7
9
|
|
8
10
|
namespace Reflex
|
9
11
|
{
|
10
12
|
|
11
13
|
|
12
|
-
static
|
13
|
-
|
14
|
+
static uint
|
15
|
+
get_type (UITouch* touch)
|
14
16
|
{
|
15
|
-
assert(
|
16
|
-
|
17
|
+
assert(touch);
|
18
|
+
|
19
|
+
NSInteger type = 0;
|
20
|
+
if (@available(iOS 9.0, *)) type = touch.type;
|
21
|
+
|
22
|
+
switch (type)
|
23
|
+
{
|
24
|
+
case UITouchTypeDirect: return Pointer::TOUCH;
|
25
|
+
case UITouchTypePencil: return Pointer::PEN;
|
26
|
+
default: return Pointer::TYPE_NONE;
|
27
|
+
}
|
28
|
+
}
|
29
|
+
|
30
|
+
static Pointer::Action
|
31
|
+
get_action (UITouch* touch)
|
32
|
+
{
|
33
|
+
assert(touch);
|
34
|
+
|
35
|
+
switch (touch.phase)
|
36
|
+
{
|
37
|
+
case UITouchPhaseBegan: return Pointer::DOWN;
|
38
|
+
case UITouchPhaseEnded: return Pointer::UP;
|
39
|
+
case UITouchPhaseMoved: return Pointer::MOVE;
|
40
|
+
case UITouchPhaseStationary: return Pointer::STAY;
|
41
|
+
case UITouchPhaseCancelled: return Pointer::CANCEL;
|
42
|
+
//case UITouchPhaseRegionEntered: return Pointer::MOVE;
|
43
|
+
//case UITouchPhaseRegionExited: return Pointer::MOVE;
|
44
|
+
//case UITouchPhaseRegionMoved: return Pointer::MOVE;
|
45
|
+
default: return Pointer::ACTION_NONE;
|
46
|
+
}
|
47
|
+
}
|
48
|
+
|
49
|
+
static Point
|
50
|
+
to_point (const CGPoint& point)
|
51
|
+
{
|
52
|
+
return Point(point.x, point.y);
|
53
|
+
}
|
54
|
+
|
55
|
+
static uint
|
56
|
+
get_modifiers (const UIEvent* event)
|
57
|
+
{
|
58
|
+
assert(event);
|
59
|
+
|
60
|
+
NSInteger flags = 0;
|
61
|
+
if (@available(iOS 13.4, *)) flags = event.modifierFlags;
|
62
|
+
|
63
|
+
return
|
64
|
+
(flags & UIKeyModifierAlphaShift) ? MOD_CAPS : 0 |
|
65
|
+
(flags & UIKeyModifierShift) ? MOD_SHIFT : 0 |
|
66
|
+
(flags & UIKeyModifierControl) ? MOD_CONTROL : 0 |
|
67
|
+
(flags & UIKeyModifierAlternate) ? MOD_ALT : 0 |
|
68
|
+
(flags & UIKeyModifierCommand) ? MOD_COMMAND : 0 |
|
69
|
+
(flags & UIKeyModifierNumericPad) ? MOD_NUMPAD : 0;
|
70
|
+
}
|
71
|
+
|
72
|
+
static void
|
73
|
+
attach_prev_pointer (
|
74
|
+
Pointer* pointer, PrevPointerList* prev_pointers, const Point& prev_position)
|
75
|
+
{
|
76
|
+
assert(pointer && prev_pointers);
|
77
|
+
|
78
|
+
auto it = std::find_if(
|
79
|
+
prev_pointers->begin(), prev_pointers->end(),
|
80
|
+
[&](const Reflex::Pointer& p) {return p.position() == prev_position;});
|
81
|
+
|
82
|
+
if (it != prev_pointers->end())
|
83
|
+
{
|
84
|
+
Reflex::Pointer_set_prev(pointer, &*it);
|
85
|
+
prev_pointers->erase(it);
|
86
|
+
}
|
87
|
+
else if (prev_pointers->size() == 1)
|
88
|
+
{
|
89
|
+
Reflex::Pointer_set_prev(pointer, &prev_pointers->front());
|
90
|
+
prev_pointers->clear();
|
91
|
+
}
|
92
|
+
else
|
93
|
+
Reflex::Pointer_set_prev(pointer, NULL);
|
94
|
+
|
95
|
+
if (pointer->prev())
|
96
|
+
Reflex::Pointer_set_id(pointer, pointer->prev()->id());
|
17
97
|
}
|
18
98
|
|
99
|
+
static Pointer
|
100
|
+
create_pointer (
|
101
|
+
UITouch* touch, UIEvent* event, UIView* view, double time,
|
102
|
+
Pointer::ID pointer_id, PrevPointerList* prev_pointers)
|
103
|
+
{
|
104
|
+
Reflex::Pointer::Action action = get_action(touch);
|
105
|
+
Reflex::Pointer pointer(
|
106
|
+
pointer_id,
|
107
|
+
get_type(touch),
|
108
|
+
action,
|
109
|
+
to_point([touch locationInView: view]),
|
110
|
+
get_modifiers(event),
|
111
|
+
(uint) touch.tapCount,
|
112
|
+
action == Pointer::MOVE,
|
113
|
+
time);
|
114
|
+
|
115
|
+
if (prev_pointers)
|
116
|
+
{
|
117
|
+
attach_prev_pointer(
|
118
|
+
&pointer, prev_pointers,
|
119
|
+
to_point([touch previousLocationInView: view]));
|
120
|
+
}
|
121
|
+
|
122
|
+
return pointer;
|
123
|
+
}
|
124
|
+
|
125
|
+
NativePointerEvent::NativePointerEvent (
|
126
|
+
NSSet* touches, UIEvent* event, UIView* view,
|
127
|
+
Pointer::ID* pointer_id)
|
128
|
+
{
|
129
|
+
for (UITouch* touch in touches)
|
130
|
+
{
|
131
|
+
PointerEvent_add_pointer(
|
132
|
+
this, create_pointer(touch, event, view, time(), ++*pointer_id, NULL));
|
133
|
+
}
|
134
|
+
}
|
19
135
|
|
20
136
|
NativePointerEvent::NativePointerEvent (
|
21
|
-
NSSet* touches, UIEvent*
|
22
|
-
|
137
|
+
NSSet* touches, UIEvent* event, UIView* view,
|
138
|
+
PrevPointerList* prev_pointers)
|
23
139
|
{
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
140
|
+
for (UITouch* touch in touches)
|
141
|
+
{
|
142
|
+
PointerEvent_add_pointer(
|
143
|
+
this, create_pointer(touch, event, view, time(), 0, prev_pointers));
|
28
144
|
}
|
29
|
-
size = index;
|
30
145
|
}
|
31
146
|
|
32
147
|
|
data/src/ios/view_controller.mm
CHANGED
@@ -3,9 +3,9 @@
|
|
3
3
|
|
4
4
|
|
5
5
|
#include <rays/opengl.h>
|
6
|
-
#include <rays/exception.h>
|
7
6
|
#include "reflex/exception.h"
|
8
7
|
#include "../view.h"
|
8
|
+
#include "../pointer.h"
|
9
9
|
#include "event.h"
|
10
10
|
#include "window.h"
|
11
11
|
|
@@ -14,7 +14,7 @@
|
|
14
14
|
|
15
15
|
|
16
16
|
static ReflexViewController*
|
17
|
-
|
17
|
+
create_reflex_view_controller ()
|
18
18
|
{
|
19
19
|
return [[ReflexViewController alloc] init];
|
20
20
|
}
|
@@ -52,7 +52,7 @@ get_top_view_controller (UIViewController* vc)
|
|
52
52
|
}
|
53
53
|
|
54
54
|
static void
|
55
|
-
|
55
|
+
show_reflex_view_controller (
|
56
56
|
UIViewController* root_vc, ReflexViewController* reflex_vc)
|
57
57
|
{
|
58
58
|
UIViewController* top = get_top_view_controller(root_vc);
|
@@ -90,13 +90,13 @@ ReflexViewController_set_show_fun (ReflexViewController_ShowFun fun)
|
|
90
90
|
ReflexViewController_CreateFun
|
91
91
|
ReflexViewController_get_create_fun ()
|
92
92
|
{
|
93
|
-
return global::create_fun ? global::create_fun :
|
93
|
+
return global::create_fun ? global::create_fun : create_reflex_view_controller;
|
94
94
|
}
|
95
95
|
|
96
96
|
ReflexViewController_ShowFun
|
97
97
|
ReflexViewController_get_show_fun ()
|
98
98
|
{
|
99
|
-
return global::show_fun ? global::show_fun :
|
99
|
+
return global::show_fun ? global::show_fun : show_reflex_view_controller;
|
100
100
|
}
|
101
101
|
|
102
102
|
|
@@ -131,6 +131,10 @@ ReflexViewController_get_show_fun ()
|
|
131
131
|
|
132
132
|
{
|
133
133
|
Reflex::Window *pwindow, *ptr_for_rebind;
|
134
|
+
int update_count;
|
135
|
+
int touching_count;
|
136
|
+
Reflex::Pointer::ID pointer_id;
|
137
|
+
Reflex::PrevPointerList prev_pointers;
|
134
138
|
}
|
135
139
|
|
136
140
|
- (id) init
|
@@ -138,7 +142,11 @@ ReflexViewController_get_show_fun ()
|
|
138
142
|
self = [super init];
|
139
143
|
if (!self) return nil;
|
140
144
|
|
141
|
-
pwindow
|
145
|
+
pwindow =
|
146
|
+
ptr_for_rebind = NULL;
|
147
|
+
update_count = 0;
|
148
|
+
touching_count = 0;
|
149
|
+
pointer_id = 0;
|
142
150
|
|
143
151
|
return self;
|
144
152
|
}
|
@@ -312,6 +320,8 @@ ReflexViewController_get_show_fun ()
|
|
312
320
|
Reflex::Window* win = self.window;
|
313
321
|
if (!win) return;
|
314
322
|
|
323
|
+
++update_count;
|
324
|
+
|
315
325
|
double now = Xot::time();
|
316
326
|
Reflex::UpdateEvent e(now, now - win->self->prev_time_update);
|
317
327
|
win->self->prev_time_update = now;
|
@@ -332,6 +342,9 @@ ReflexViewController_get_show_fun ()
|
|
332
342
|
Reflex::Window* win = self.window;
|
333
343
|
if (!win) return;
|
334
344
|
|
345
|
+
if (update_count == 0)
|
346
|
+
[self update];
|
347
|
+
|
335
348
|
EAGLContext* context = self.reflexView.context;
|
336
349
|
if (!context) return;
|
337
350
|
|
@@ -363,7 +376,7 @@ ReflexViewController_get_show_fun ()
|
|
363
376
|
|
364
377
|
if (dpos != 0 || dsize != 0)
|
365
378
|
{
|
366
|
-
Reflex::FrameEvent e(b, dpos.x, dpos.y, dsize.x, dsize.y);
|
379
|
+
Reflex::FrameEvent e(b, dpos.x, dpos.y, dsize.x, dsize.y, 0, 0);
|
367
380
|
if (dpos != 0) win->on_move(&e);
|
368
381
|
if (dsize != 0)
|
369
382
|
{
|
@@ -386,9 +399,12 @@ ReflexViewController_get_show_fun ()
|
|
386
399
|
Reflex::Window* win = self.window;
|
387
400
|
if (!win) return;
|
388
401
|
|
389
|
-
Reflex::NativePointerEvent e(
|
390
|
-
|
391
|
-
|
402
|
+
Reflex::NativePointerEvent e(touches, event, self.reflexView, &pointer_id);
|
403
|
+
[self addToPrevPointers: e];
|
404
|
+
|
405
|
+
touching_count += e.size();
|
406
|
+
|
407
|
+
Window_call_pointer_event(win, &e);
|
392
408
|
}
|
393
409
|
|
394
410
|
- (void) touchesEnded: (NSSet*) touches withEvent: (UIEvent*) event
|
@@ -396,19 +412,20 @@ ReflexViewController_get_show_fun ()
|
|
396
412
|
Reflex::Window* win = self.window;
|
397
413
|
if (!win) return;
|
398
414
|
|
399
|
-
Reflex::NativePointerEvent e(
|
400
|
-
|
401
|
-
|
415
|
+
Reflex::NativePointerEvent e(touches, event, self.reflexView, &prev_pointers);
|
416
|
+
|
417
|
+
touching_count -= e.size();
|
418
|
+
if (touching_count == 0)
|
419
|
+
prev_pointers.clear();
|
420
|
+
else if (touching_count < 0)
|
421
|
+
Reflex::invalid_state_error(__FILE__, __LINE__);
|
422
|
+
|
423
|
+
Window_call_pointer_event(win, &e);
|
402
424
|
}
|
403
425
|
|
404
426
|
- (void) touchesCancelled: (NSSet*) touches withEvent: (UIEvent*) event
|
405
427
|
{
|
406
|
-
|
407
|
-
if (!win) return;
|
408
|
-
|
409
|
-
Reflex::NativePointerEvent e(
|
410
|
-
touches, event, self.reflexView, Reflex::PointerEvent::UP);
|
411
|
-
win->on_pointer(&e);
|
428
|
+
[self touchesEnded: touches withEvent: event];
|
412
429
|
}
|
413
430
|
|
414
431
|
- (void) touchesMoved: (NSSet*) touches withEvent: (UIEvent*) event
|
@@ -416,9 +433,20 @@ ReflexViewController_get_show_fun ()
|
|
416
433
|
Reflex::Window* win = self.window;
|
417
434
|
if (!win) return;
|
418
435
|
|
419
|
-
Reflex::NativePointerEvent e(
|
420
|
-
|
421
|
-
|
436
|
+
Reflex::NativePointerEvent e(touches, event, self.reflexView, &prev_pointers);
|
437
|
+
[self addToPrevPointers: e];
|
438
|
+
|
439
|
+
Window_call_pointer_event(win, &e);
|
440
|
+
}
|
441
|
+
|
442
|
+
- (void) addToPrevPointers: (const Reflex::PointerEvent&) event
|
443
|
+
{
|
444
|
+
size_t size = event.size();
|
445
|
+
for (size_t i = 0; i < size; ++i)
|
446
|
+
{
|
447
|
+
prev_pointers.emplace_back(event[i]);
|
448
|
+
Reflex::Pointer_set_prev(&prev_pointers.back(), NULL);
|
449
|
+
}
|
422
450
|
}
|
423
451
|
|
424
452
|
@end// ReflexViewController
|
data/src/ios/window.mm
CHANGED
data/src/osx/event.h
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
|
7
7
|
#import <AppKit/NSEvent.h>
|
8
|
-
#include
|
8
|
+
#include "../event.h"
|
9
9
|
|
10
10
|
|
11
11
|
namespace Reflex
|
@@ -15,15 +15,26 @@ namespace Reflex
|
|
15
15
|
struct NativeKeyEvent : public KeyEvent
|
16
16
|
{
|
17
17
|
|
18
|
-
NativeKeyEvent (NSEvent* event,
|
18
|
+
NativeKeyEvent (NSEvent* event, Action action);
|
19
19
|
|
20
20
|
};// NativeKeyEvent
|
21
21
|
|
22
22
|
|
23
|
-
struct
|
23
|
+
struct NativeFlagKeyEvent : public KeyEvent
|
24
24
|
{
|
25
25
|
|
26
|
-
|
26
|
+
NativeFlagKeyEvent (NSEvent* event);
|
27
|
+
|
28
|
+
};// NativeFlagKeyEvent
|
29
|
+
|
30
|
+
|
31
|
+
class NativePointerEvent : public PointerEvent
|
32
|
+
{
|
33
|
+
|
34
|
+
public:
|
35
|
+
|
36
|
+
NativePointerEvent (
|
37
|
+
NSEvent* event, NSView* view, Pointer::ID id, Pointer::Action action);
|
27
38
|
|
28
39
|
};// NativePointerEvent
|
29
40
|
|