reflexion 0.1.6 → 0.1.7
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 +7 -0
- data/.doc/ext/reflex/application.cpp +54 -39
- data/.doc/ext/reflex/capture_event.cpp +87 -0
- data/.doc/ext/reflex/draw_event.cpp +103 -0
- data/.doc/ext/reflex/event.cpp +73 -0
- data/.doc/ext/reflex/focus_event.cpp +98 -0
- data/.doc/ext/reflex/frame_event.cpp +133 -0
- data/.doc/ext/reflex/image_view.cpp +74 -0
- data/.doc/ext/reflex/key_event.cpp +124 -0
- data/.doc/ext/reflex/native.cpp +45 -6
- data/.doc/ext/reflex/pointer_event.cpp +181 -0
- data/.doc/ext/reflex/reflex.cpp +17 -41
- data/.doc/ext/reflex/scroll_event.cpp +141 -0
- data/.doc/ext/reflex/selector.cpp +135 -0
- data/.doc/ext/reflex/style.cpp +253 -0
- data/.doc/ext/reflex/style_length.cpp +133 -0
- data/.doc/ext/reflex/style_length2.cpp +149 -0
- data/.doc/ext/reflex/style_length4.cpp +192 -0
- data/.doc/ext/reflex/update_event.cpp +77 -0
- data/.doc/ext/reflex/view.cpp +408 -88
- data/.doc/ext/reflex/wheel_event.cpp +146 -0
- data/.doc/ext/reflex/window.cpp +95 -92
- data/Rakefile +6 -5
- data/VERSION +1 -1
- data/ext/reflex/application.cpp +67 -49
- data/ext/reflex/capture_event.cpp +92 -0
- data/ext/reflex/draw_event.cpp +110 -0
- data/ext/reflex/event.cpp +77 -0
- data/ext/reflex/extconf.rb +18 -68
- data/ext/reflex/focus_event.cpp +104 -0
- data/ext/reflex/frame_event.cpp +143 -0
- data/ext/reflex/image_view.cpp +77 -0
- data/ext/reflex/key_event.cpp +133 -0
- data/ext/reflex/native.cpp +45 -6
- data/ext/reflex/pointer_event.cpp +195 -0
- data/ext/reflex/reflex.cpp +21 -47
- data/ext/reflex/scroll_event.cpp +152 -0
- data/ext/reflex/selector.cpp +144 -0
- data/ext/reflex/style.cpp +277 -0
- data/ext/reflex/style_length.cpp +140 -0
- data/ext/reflex/style_length2.cpp +157 -0
- data/ext/reflex/style_length4.cpp +204 -0
- data/ext/reflex/update_event.cpp +81 -0
- data/ext/reflex/view.cpp +469 -114
- data/ext/reflex/wheel_event.cpp +158 -0
- data/ext/reflex/window.cpp +130 -123
- data/include/reflex/application.h +12 -7
- data/include/reflex/defs.h +13 -89
- data/include/reflex/event.h +260 -0
- data/include/reflex/exception.h +17 -11
- data/include/reflex/image_view.h +45 -0
- data/include/reflex/reflex.h +2 -6
- data/include/reflex/ruby/application.h +40 -13
- data/include/reflex/ruby/event.h +72 -0
- data/include/reflex/ruby/image_view.h +25 -0
- data/include/reflex/ruby/selector.h +27 -0
- data/include/reflex/ruby/style.h +27 -0
- data/include/reflex/ruby/style_length.h +37 -0
- data/include/reflex/ruby/view.h +193 -38
- data/include/reflex/ruby/window.h +123 -39
- data/include/reflex/ruby.h +3 -2
- data/include/reflex/selector.h +64 -0
- data/include/reflex/style.h +144 -0
- data/include/reflex/style_length.h +147 -0
- data/include/reflex/view.h +182 -19
- data/include/reflex/window.h +35 -19
- data/include/reflex.h +7 -0
- data/lib/reflex/application.rb +14 -5
- data/lib/reflex/arc_shape.rb +20 -0
- data/lib/reflex/button.rb +75 -0
- data/lib/reflex/capture_event.rb +37 -0
- data/lib/reflex/color.rb +13 -0
- data/lib/reflex/color_space.rb +13 -0
- data/lib/reflex/draw_event.rb +19 -0
- data/lib/reflex/ellipse_shape.rb +20 -0
- data/lib/reflex/ext.rb +1 -1
- data/lib/reflex/flags.rb +18 -0
- data/lib/reflex/focus_event.rb +38 -0
- data/lib/reflex/font.rb +13 -0
- data/lib/reflex/frame_event.rb +42 -0
- data/lib/reflex/helper.rb +87 -30
- data/lib/reflex/image_view.rb +25 -0
- data/lib/reflex/key_event.rb +38 -0
- data/lib/reflex/line_shape.rb +20 -0
- data/lib/reflex/list_view.rb +15 -0
- data/lib/reflex/model.rb +149 -0
- data/lib/reflex/model_owner.rb +57 -0
- data/lib/reflex/model_view.rb +22 -0
- data/lib/reflex/module.rb +11 -7
- data/lib/reflex/pointer_event.rb +85 -0
- data/lib/reflex/rect_shape.rb +20 -0
- data/lib/reflex/reflex.rb +13 -2
- data/lib/reflex/scroll_event.rb +19 -0
- data/lib/reflex/selector.rb +31 -0
- data/lib/reflex/shader.rb +13 -0
- data/lib/reflex/shape.rb +34 -0
- data/lib/reflex/style.rb +55 -0
- data/lib/reflex/style_length.rb +30 -0
- data/lib/reflex/style_length2.rb +34 -0
- data/lib/reflex/style_length4.rb +38 -0
- data/lib/reflex/text_view.rb +55 -0
- data/lib/reflex/update_event.rb +19 -0
- data/lib/reflex/view.rb +38 -4
- data/lib/reflex/wheel_event.rb +19 -0
- data/lib/reflex/window.rb +7 -5
- data/lib/reflex.rb +38 -1
- data/lib/reflexion/include.rb +5 -0
- data/lib/reflexion.rb +100 -0
- data/reflex.gemspec +3 -4
- data/samples/app.rb +13 -0
- data/samples/bats.rb +91 -0
- data/samples/checker.rb +36 -0
- data/{examples/ruby/shapes.rb → samples/fans.rb} +12 -16
- data/samples/fps.rb +46 -0
- data/samples/grid.rb +60 -0
- data/{examples/ruby → samples}/hello.rb +14 -16
- data/samples/image.rb +44 -0
- data/samples/ios/hello/hello/Images.xcassets/AppIcon.appiconset/Contents.json +53 -0
- data/samples/ios/hello/hello/Images.xcassets/LaunchImage.launchimage/Contents.json +51 -0
- data/samples/ios/hello/hello/en.lproj/InfoPlist.strings +2 -0
- data/samples/ios/hello/hello/hello-Info.plist +47 -0
- data/samples/ios/hello/hello/hello-Prefix.pch +10 -0
- data/samples/ios/hello/hello/main.cpp +79 -0
- data/samples/ios/hello/hello.xcodeproj/project.pbxproj +725 -0
- data/{examples/ruby → samples}/key.rb +11 -14
- data/samples/layout.rb +89 -0
- data/samples/model.rb +86 -0
- data/samples/osx/hello/hello/Images.xcassets/AppIcon.appiconset/Contents.json +58 -0
- data/samples/osx/hello/hello/en.lproj/Credits.rtf +29 -0
- data/samples/osx/hello/hello/en.lproj/InfoPlist.strings +2 -0
- data/samples/osx/hello/hello/hello-Info.plist +32 -0
- data/samples/osx/hello/hello/hello-Prefix.pch +3 -0
- data/samples/osx/hello/hello/main.cpp +79 -0
- data/samples/osx/hello/hello.xcodeproj/project.pbxproj +725 -0
- data/samples/reflexion/hello.rb +24 -0
- data/samples/reflexion/paint.rb +40 -0
- data/samples/reflexion/pulse.rb +34 -0
- data/samples/repl.rb +69 -0
- data/samples/shader.rb +41 -0
- data/samples/shapes.rb +30 -0
- data/{examples/ruby → samples}/text.rb +7 -8
- data/samples/tree.rb +71 -0
- data/samples/views.rb +41 -0
- data/samples/visuals.rb +22 -0
- data/src/event.cpp +225 -0
- data/src/exception.cpp +24 -15
- data/src/image_view.cpp +70 -0
- data/src/ios/app_delegate.h +17 -0
- data/src/ios/app_delegate.mm +120 -0
- data/src/ios/application.mm +116 -0
- data/src/{cocoa/applicationdata.h → ios/application_data.h} +6 -6
- data/src/ios/event.h +26 -0
- data/src/ios/event.mm +31 -0
- data/src/ios/native_window.h +37 -0
- data/src/ios/native_window.mm +220 -0
- data/src/ios/opengl_view.h +13 -0
- data/src/ios/opengl_view.mm +131 -0
- data/src/{cocoa → ios}/reflex.mm +8 -12
- data/src/ios/window.mm +303 -0
- data/src/ios/window_data.h +75 -0
- data/src/osx/app_delegate.h +17 -0
- data/src/{cocoa/cocoaapplication.mm → osx/app_delegate.mm} +90 -48
- data/src/osx/application.mm +132 -0
- data/src/osx/application_data.h +45 -0
- data/src/osx/event.h +42 -0
- data/src/osx/event.mm +112 -0
- data/src/osx/native_window.h +26 -0
- data/src/osx/native_window.mm +322 -0
- data/src/{cocoa/openglview.h → osx/opengl_view.h} +0 -4
- data/src/{cocoa/openglview.mm → osx/opengl_view.mm} +66 -23
- data/src/osx/reflex.mm +50 -0
- data/src/osx/window.mm +308 -0
- data/src/osx/window_data.h +75 -0
- data/src/selector.cpp +121 -0
- data/src/style.cpp +576 -0
- data/src/style_length.cpp +341 -0
- data/src/view.cpp +1228 -129
- data/src/win32/application.cpp +1 -1
- data/src/window.cpp +54 -26
- data/test/helper.rb +8 -4
- data/test/test_capture_event.rb +41 -0
- data/test/test_event.rb +20 -0
- data/test/test_has_frame.rb +45 -0
- data/test/test_model.rb +9 -0
- data/test/test_model_owner.rb +9 -0
- data/test/test_selector.rb +75 -0
- data/test/test_style.rb +70 -0
- data/test/test_style_length.rb +38 -0
- data/test/test_style_length2.rb +50 -0
- data/test/test_style_length4.rb +56 -0
- data/test/test_view.rb +97 -23
- data/test/test_window.rb +54 -46
- metadata +205 -84
- data/.doc/ext/reflex/defs.cpp +0 -8
- data/.doc/ext/reflex/key.cpp +0 -122
- data/.doc/ext/reflex/points.cpp +0 -151
- data/.gitignore +0 -14
- data/ChangeLog +0 -8
- data/examples/hello/.gitignore +0 -2
- data/examples/hello/Rakefile +0 -41
- data/examples/hello/main.cpp +0 -18
- data/examples/ruby/app.rb +0 -13
- data/examples/ruby/checker.rb +0 -41
- data/examples/ruby/fps.rb +0 -49
- data/examples/ruby/grid.rb +0 -65
- data/examples/ruby/views.rb +0 -88
- data/examples/ruby/visuals.rb +0 -27
- data/ext/reflex/defs.cpp +0 -8
- data/ext/reflex/key.cpp +0 -129
- data/ext/reflex/points.cpp +0 -161
- data/include/reflex/ruby/key.h +0 -39
- data/include/reflex/ruby/points.h +0 -39
- data/lib/reflex/visuals/string.rb +0 -53
- data/src/cocoa/application.mm +0 -101
- data/src/cocoa/cocoaapplication.h +0 -21
- data/src/cocoa/cocoawindow.h +0 -46
- data/src/cocoa/cocoawindow.mm +0 -230
- data/src/cocoa/defs.h +0 -34
- data/src/cocoa/defs.mm +0 -87
- data/src/cocoa/window.mm +0 -148
- data/src/cocoa/windowdata.h +0 -56
- data/src/defs.cpp +0 -47
- data/src/helper.h +0 -12
- data/src/reflex.cpp +0 -43
- /data/{README → README.md} +0 -0
data/src/cocoa/defs.mm
DELETED
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
// -*- c++ -*-
|
|
2
|
-
#include "defs.h"
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
#import <Cocoa/Cocoa.h>
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
namespace Reflex
|
|
9
|
-
{
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
static const char*
|
|
13
|
-
get_chars (NSEvent* e)
|
|
14
|
-
{
|
|
15
|
-
NSString* chars = [e characters];//charactersIgnoringModifiers];
|
|
16
|
-
return [chars UTF8String];
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
static uint
|
|
20
|
-
get_current_point_type ()
|
|
21
|
-
{
|
|
22
|
-
NSUInteger buttons = [NSEvent pressedMouseButtons];
|
|
23
|
-
uint ret = 0;
|
|
24
|
-
if (buttons & (1 << 0)) ret |= POINT_MOUSE_LEFT;
|
|
25
|
-
if (buttons & (1 << 1)) ret |= POINT_MOUSE_RIGHT;
|
|
26
|
-
if (buttons >= (1 << 2)) ret |= POINT_MOUSE_MIDDLE;
|
|
27
|
-
return ret;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
static uint
|
|
31
|
-
get_point_type (NSEvent* e)
|
|
32
|
-
{
|
|
33
|
-
switch ([e type])
|
|
34
|
-
{
|
|
35
|
-
case NSLeftMouseDown:
|
|
36
|
-
case NSLeftMouseUp:
|
|
37
|
-
case NSLeftMouseDragged:
|
|
38
|
-
return POINT_MOUSE_LEFT;
|
|
39
|
-
|
|
40
|
-
case NSRightMouseDown:
|
|
41
|
-
case NSRightMouseUp:
|
|
42
|
-
case NSRightMouseDragged:
|
|
43
|
-
return POINT_MOUSE_RIGHT;
|
|
44
|
-
|
|
45
|
-
case NSMouseMoved:
|
|
46
|
-
return get_current_point_type();
|
|
47
|
-
}
|
|
48
|
-
return 0;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
static uint
|
|
52
|
-
get_modifiers (NSEvent* e)
|
|
53
|
-
{
|
|
54
|
-
NSUInteger flags = [e modifierFlags];
|
|
55
|
-
return
|
|
56
|
-
(flags & NSAlphaShiftKeyMask) ? MOD_CAPS : 0 |
|
|
57
|
-
(flags & NSShiftKeyMask) ? MOD_SHIFT : 0 |
|
|
58
|
-
(flags & NSControlKeyMask) ? MOD_CONTROL : 0 |
|
|
59
|
-
(flags & NSAlternateKeyMask) ? MOD_ALT : 0 |
|
|
60
|
-
(flags & NSCommandKeyMask) ? MOD_COMMAND : 0 |
|
|
61
|
-
(flags & NSNumericPadKeyMask) ? MOD_NUMPAD : 0 |
|
|
62
|
-
(flags & NSHelpKeyMask) ? MOD_HELP : 0 |
|
|
63
|
-
(flags & NSFunctionKeyMask) ? MOD_FUNCTION : 0;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
CocoaKey::CocoaKey (NSEvent* e)
|
|
68
|
-
: Key(get_chars(e), [e keyCode], get_modifiers(e), [e isARepeat] ? 1 : 0)
|
|
69
|
-
{
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
CocoaPoints::CocoaPoints (NSEvent* e, NSView* view)
|
|
74
|
-
: Points(
|
|
75
|
-
get_point_type(e), (coord) 0, (coord) 0,
|
|
76
|
-
get_modifiers(e), (uint) [e clickCount],
|
|
77
|
-
[e type] == NSLeftMouseDragged || [e type] == NSRightMouseDragged)
|
|
78
|
-
{
|
|
79
|
-
NSPoint p = [e locationInWindow];
|
|
80
|
-
NSRect b = [view bounds];
|
|
81
|
-
if (view) p = [view convertPoint: p fromView: nil];
|
|
82
|
-
x = p.x;
|
|
83
|
-
y = b.size.height - p.y;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
};// Reflex
|
data/src/cocoa/window.mm
DELETED
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
// -*- objc -*-
|
|
2
|
-
#include "reflex/window.h"
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
#import <Cocoa/Cocoa.h>
|
|
6
|
-
#include <rays/bounds.h>
|
|
7
|
-
#include "windowdata.h"
|
|
8
|
-
#import "cocoawindow.h"
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
namespace Reflex
|
|
12
|
-
{
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
void set_owner_window (View* view, Window* owner);
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
Window::Window ()
|
|
19
|
-
{
|
|
20
|
-
[[[[CocoaWindow alloc] init] autorelease] bind: this];
|
|
21
|
-
|
|
22
|
-
set_owner_window(self->root.get(), this);
|
|
23
|
-
|
|
24
|
-
self->painter.canvas(0, 0, 1, 1);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
Window::~Window ()
|
|
28
|
-
{
|
|
29
|
-
//close();
|
|
30
|
-
|
|
31
|
-
set_owner_window(self->root.get(), NULL);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
bool
|
|
35
|
-
Window::show ()
|
|
36
|
-
{
|
|
37
|
-
if (!*this) return false;
|
|
38
|
-
|
|
39
|
-
if (--self->hidecount == 0)
|
|
40
|
-
[self->cocoa makeKeyAndOrderFront: nil];
|
|
41
|
-
return true;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
bool
|
|
45
|
-
Window::hide ()
|
|
46
|
-
{
|
|
47
|
-
if (!*this) return false;
|
|
48
|
-
|
|
49
|
-
if (++self->hidecount == 1)
|
|
50
|
-
[self->cocoa orderOut: self->cocoa];
|
|
51
|
-
return true;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
bool
|
|
55
|
-
Window::close ()
|
|
56
|
-
{
|
|
57
|
-
if (!*this) return false;
|
|
58
|
-
|
|
59
|
-
[self->cocoa close];
|
|
60
|
-
return true;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
bool
|
|
64
|
-
Window::redraw ()
|
|
65
|
-
{
|
|
66
|
-
if (!*this) return false;
|
|
67
|
-
|
|
68
|
-
self->redraw = true;
|
|
69
|
-
return true;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
bool
|
|
73
|
-
Window::set_title (const char* title)
|
|
74
|
-
{
|
|
75
|
-
if (!*this || !title) return false;
|
|
76
|
-
|
|
77
|
-
[self->cocoa setTitle: [NSString stringWithUTF8String: title]];
|
|
78
|
-
return true;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
const char*
|
|
82
|
-
Window::title () const
|
|
83
|
-
{
|
|
84
|
-
if (!*this) return "";
|
|
85
|
-
|
|
86
|
-
NSString* s = [self->cocoa title];
|
|
87
|
-
self->title_tmp = s ? [s UTF8String] : "";
|
|
88
|
-
return self->title_tmp.c_str();
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
bool
|
|
92
|
-
Window::set_bounds (coord x, coord y, coord width, coord height)
|
|
93
|
-
{
|
|
94
|
-
if (!*this) return false;
|
|
95
|
-
|
|
96
|
-
NSRect frame =
|
|
97
|
-
[CocoaWindow frameRectForContentRect: NSMakeRect(x, y, width, height)];
|
|
98
|
-
[self->cocoa setFrame: frame display: NO animate: NO];
|
|
99
|
-
return true;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
bool
|
|
103
|
-
Window::set_bounds (const Bounds& bounds)
|
|
104
|
-
{
|
|
105
|
-
return set_bounds(bounds.x, bounds.y, bounds.width, bounds.height);
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
Bounds
|
|
109
|
-
Window::bounds () const
|
|
110
|
-
{
|
|
111
|
-
Bounds b;
|
|
112
|
-
if (!*this) return b;
|
|
113
|
-
|
|
114
|
-
NSRect frame = [self->cocoa contentRectForFrameRect: [self->cocoa frame]];
|
|
115
|
-
b.x = frame.origin.x;
|
|
116
|
-
b.y = frame.origin.y;
|
|
117
|
-
b.width = frame.size.width;
|
|
118
|
-
b.height = frame.size.height;
|
|
119
|
-
return b;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
bool
|
|
123
|
-
Window::hidden () const
|
|
124
|
-
{
|
|
125
|
-
if (!*this) return false;
|
|
126
|
-
|
|
127
|
-
return self->hidecount > 0;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
View*
|
|
131
|
-
Window::root ()
|
|
132
|
-
{
|
|
133
|
-
return self->root.get();
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
Painter*
|
|
137
|
-
Window::painter ()
|
|
138
|
-
{
|
|
139
|
-
return &self->painter;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
Window::operator bool () const
|
|
143
|
-
{
|
|
144
|
-
return self && *self;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
}// Reflex
|
data/src/cocoa/windowdata.h
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
// -*- c++ -*-
|
|
2
|
-
#pragma once
|
|
3
|
-
#ifndef __REFLEX_COCOA_WINDOWDATA_H__
|
|
4
|
-
#define __REFLEX_COCOA_WINDOWDATA_H__
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
#include <rays/painter.h>
|
|
8
|
-
#include <reflex/window.h>
|
|
9
|
-
#include <reflex/view.h>
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
@class CocoaWindow;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
namespace Reflex
|
|
16
|
-
{
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
struct Window::Data
|
|
20
|
-
{
|
|
21
|
-
|
|
22
|
-
CocoaWindow* cocoa;
|
|
23
|
-
|
|
24
|
-
int hidecount;
|
|
25
|
-
|
|
26
|
-
bool redraw;
|
|
27
|
-
|
|
28
|
-
Painter painter;
|
|
29
|
-
|
|
30
|
-
View::Ref root;
|
|
31
|
-
|
|
32
|
-
String title_tmp;
|
|
33
|
-
|
|
34
|
-
Data ()
|
|
35
|
-
: cocoa(nil), hidecount(1), redraw(true), root(new View)
|
|
36
|
-
{
|
|
37
|
-
root->set_name("root");
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
operator bool () const
|
|
41
|
-
{
|
|
42
|
-
return cocoa;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
bool operator ! () const
|
|
46
|
-
{
|
|
47
|
-
return !operator bool();
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
};// Window::Data
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}// Reflex
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
#endif//EOH
|
data/src/defs.cpp
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
#include "reflex/defs.h"
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
namespace Reflex
|
|
5
|
-
{
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
Key::Key ()
|
|
9
|
-
: code(KEY_NONE), modifiers(MOD_NONE), repeat(0)
|
|
10
|
-
{
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
Key::Key (const char* chars, int code, uint modifiers, int repeat)
|
|
14
|
-
: chars(chars ? chars : ""), code(code), modifiers(modifiers), repeat(repeat)
|
|
15
|
-
{
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
Points::Points ()
|
|
20
|
-
: type(POINT_NONE), size(0), modifiers(MOD_NONE), count(0), drag(false),
|
|
21
|
-
x(0), y(0)
|
|
22
|
-
{
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
Points::Points (
|
|
26
|
-
int type, coord x_, coord y_, uint modifiers, uint count, bool drag)
|
|
27
|
-
: type(type), size(1), modifiers(modifiers), count(count), drag(drag),
|
|
28
|
-
x(x_), y(y_)
|
|
29
|
-
{
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
Points::Points (
|
|
33
|
-
int type, const Point* points_, size_t size_,
|
|
34
|
-
uint modifiers, uint count, bool drag)
|
|
35
|
-
: type(type), size(size_), modifiers(modifiers), count(count), drag(drag)
|
|
36
|
-
{
|
|
37
|
-
if (size > MAX) size = MAX;
|
|
38
|
-
|
|
39
|
-
if (points_)
|
|
40
|
-
{
|
|
41
|
-
for (size_t i = 0; i < size; ++i)
|
|
42
|
-
points[i] = points_[i];
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
};// Reflex
|
data/src/helper.h
DELETED
data/src/reflex.cpp
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
#include "reflex/reflex.h"
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
#include <reflex/application.h>
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
namespace Reflex
|
|
8
|
-
{
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
bool initialized ();
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
bool
|
|
15
|
-
run (const char* name)
|
|
16
|
-
{
|
|
17
|
-
if (!initialized()) return false;
|
|
18
|
-
|
|
19
|
-
Application::Ref ref;
|
|
20
|
-
if (!app())
|
|
21
|
-
{
|
|
22
|
-
ref = new Application;
|
|
23
|
-
if (!ref || !*ref) return false;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
if (!app()) return false;
|
|
27
|
-
|
|
28
|
-
if (name && !app()->set_name(name))
|
|
29
|
-
return false;
|
|
30
|
-
|
|
31
|
-
return app()->run();
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
bool
|
|
35
|
-
quit ()
|
|
36
|
-
{
|
|
37
|
-
if (!initialized() || !app()) return false;
|
|
38
|
-
|
|
39
|
-
return app()->quit();
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}// Reflex
|
/data/{README → README.md}
RENAMED
|
File without changes
|