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/pointer.h
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
// -*- c++ -*-
|
2
|
+
#pragma once
|
3
|
+
#ifndef __REFLEX_SRC_POINTER_H__
|
4
|
+
#define __REFLEX_SRC_POINTER_H__
|
5
|
+
|
6
|
+
|
7
|
+
#include <functional>
|
8
|
+
#include <reflex/pointer.h>
|
9
|
+
|
10
|
+
|
11
|
+
namespace Reflex
|
12
|
+
{
|
13
|
+
|
14
|
+
|
15
|
+
void Pointer_update_positions (
|
16
|
+
Pointer* pthis, std::function<void(Point*)> fun);
|
17
|
+
|
18
|
+
void Pointer_set_id (Pointer* pthis, Pointer::ID id);
|
19
|
+
|
20
|
+
void Pointer_set_prev (Pointer* pthis, const Pointer* prev);
|
21
|
+
|
22
|
+
|
23
|
+
}// Reflex
|
24
|
+
|
25
|
+
|
26
|
+
#endif//EOH
|
data/src/selector.cpp
CHANGED
data/src/shape.cpp
CHANGED
@@ -432,25 +432,23 @@ namespace Reflex
|
|
432
432
|
}
|
433
433
|
|
434
434
|
void
|
435
|
-
Shape_call_contact_event (Shape* shape,
|
435
|
+
Shape_call_contact_event (Shape* shape, ContactEvent* event)
|
436
436
|
{
|
437
|
-
if (!shape)
|
437
|
+
if (!shape || !event)
|
438
438
|
argument_error(__FILE__, __LINE__);
|
439
439
|
|
440
|
-
|
441
|
-
shape->on_contact(&e);
|
440
|
+
shape->on_contact(event);
|
442
441
|
|
443
|
-
switch (
|
442
|
+
switch (event->action())
|
444
443
|
{
|
445
|
-
case ContactEvent::BEGIN: shape->on_contact_begin(
|
446
|
-
case ContactEvent::END: shape->on_contact_end(
|
447
|
-
|
444
|
+
case ContactEvent::BEGIN: shape->on_contact_begin(event); break;
|
445
|
+
case ContactEvent::END: shape->on_contact_end(event); break;
|
446
|
+
default: break;
|
448
447
|
}
|
449
448
|
|
450
|
-
if (
|
451
|
-
return;
|
449
|
+
if (event->is_blocked()) return;
|
452
450
|
|
453
|
-
View_call_contact_event(shape->owner(),
|
451
|
+
View_call_contact_event(shape->owner(), event);
|
454
452
|
}
|
455
453
|
|
456
454
|
|
@@ -587,9 +585,9 @@ namespace Reflex
|
|
587
585
|
void
|
588
586
|
Shape::on_draw (DrawEvent* e)
|
589
587
|
{
|
590
|
-
assert(e && e->painter);
|
588
|
+
assert(e && e->painter());
|
591
589
|
|
592
|
-
e->painter->polygon(self->polygon);
|
590
|
+
e->painter()->polygon(self->polygon);
|
593
591
|
}
|
594
592
|
|
595
593
|
void
|
data/src/shape.h
CHANGED