reflexion 0.1.40 → 0.1.42
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/native.cpp +2 -0
- data/.doc/ext/reflex/screen.cpp +53 -0
- data/.doc/ext/reflex/window.cpp +70 -12
- data/ChangeLog.md +15 -0
- data/VERSION +1 -1
- data/ext/reflex/native.cpp +2 -0
- data/ext/reflex/screen.cpp +55 -0
- data/ext/reflex/window.cpp +76 -13
- data/include/reflex/ruby/screen.h +40 -0
- data/include/reflex/screen.h +43 -0
- data/include/reflex/window.h +21 -3
- data/lib/reflex/screen.rb +21 -0
- data/lib/reflex/window.rb +3 -1
- data/lib/reflex.rb +1 -0
- data/reflex.gemspec +5 -8
- data/src/ios/screen.h +20 -0
- data/src/ios/screen.mm +62 -0
- data/src/ios/view_controller.h +2 -0
- data/src/ios/view_controller.mm +6 -0
- data/src/ios/window.h +1 -3
- data/src/ios/window.mm +38 -17
- data/src/osx/native_window.mm +10 -10
- data/src/osx/screen.h +21 -0
- data/src/osx/screen.mm +62 -0
- data/src/osx/window.h +5 -3
- data/src/osx/window.mm +46 -21
- data/src/window.cpp +40 -7
- data/src/window.h +8 -9
- data/test/test_event.rb +4 -0
- data/test/test_screen.rb +18 -0
- data/test/test_view.rb +6 -6
- data/test/test_window.rb +48 -6
- metadata +22 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fa7ec97efd9d68e5053ddc3bf852f718a66ff883a5bb8693f605dcf45e962732
|
4
|
+
data.tar.gz: f2fd1319de6f1032802ce96c6657e9ac7dc0327a10c9ef9b1ba2f910c117c57a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 61d0f5a9fc7ec41480642825f071d103d211035a38bcfda25eb90789fb642cf2663dce3f18771cc3702482e0a78d0385c4601ab23b4654f677f946af6000b425
|
7
|
+
data.tar.gz: abd4d92237cd9d49795ce5010b38565d7f3a4abd0b73ae4b18ca1989e748e911144ac3b11bdc6869400599c8eac6f120f751f75484c821a483b7475aefcec78a
|
data/.doc/ext/reflex/native.cpp
CHANGED
@@ -32,6 +32,7 @@ void Init_reflex_rect_shape ();
|
|
32
32
|
void Init_reflex_ellipse_shape ();
|
33
33
|
|
34
34
|
void Init_reflex_application ();
|
35
|
+
void Init_reflex_screen ();
|
35
36
|
void Init_reflex_window ();
|
36
37
|
void Init_reflex_view ();
|
37
38
|
|
@@ -80,6 +81,7 @@ extern "C" void
|
|
80
81
|
Init_reflex_ellipse_shape();
|
81
82
|
|
82
83
|
Init_reflex_application();
|
84
|
+
Init_reflex_screen();
|
83
85
|
Init_reflex_window();
|
84
86
|
Init_reflex_view();
|
85
87
|
|
@@ -0,0 +1,53 @@
|
|
1
|
+
#include "reflex/ruby/screen.h"
|
2
|
+
|
3
|
+
|
4
|
+
#include <rays/ruby/bounds.h>
|
5
|
+
#include "defs.h"
|
6
|
+
|
7
|
+
|
8
|
+
RUCY_DEFINE_VALUE_FROM_TO(Reflex::Screen)
|
9
|
+
|
10
|
+
#define THIS to<Reflex::Screen*>(self)
|
11
|
+
|
12
|
+
#define CHECK RUCY_CHECK_OBJECT(Reflex::Screen, self)
|
13
|
+
|
14
|
+
|
15
|
+
static
|
16
|
+
VALUE alloc(VALUE klass)
|
17
|
+
{
|
18
|
+
Reflex::reflex_error(__FILE__, __LINE__, "can not instantiate Screen class.");
|
19
|
+
}
|
20
|
+
|
21
|
+
static
|
22
|
+
VALUE get_frame(VALUE self)
|
23
|
+
{
|
24
|
+
CHECK;
|
25
|
+
return value(THIS->frame());
|
26
|
+
}
|
27
|
+
|
28
|
+
|
29
|
+
static Class cScreen;
|
30
|
+
|
31
|
+
void
|
32
|
+
Init_reflex_screen ()
|
33
|
+
{
|
34
|
+
Module mReflex = rb_define_module("Reflex");
|
35
|
+
|
36
|
+
cScreen = rb_define_class_under(mReflex, "Screen", rb_cObject);
|
37
|
+
rb_define_alloc_func(cScreen, alloc);
|
38
|
+
rb_define_method(cScreen, "frame", RUBY_METHOD_FUNC(get_frame), 0);
|
39
|
+
}
|
40
|
+
|
41
|
+
|
42
|
+
namespace Reflex
|
43
|
+
{
|
44
|
+
|
45
|
+
|
46
|
+
Class
|
47
|
+
screen_class ()
|
48
|
+
{
|
49
|
+
return cScreen;
|
50
|
+
}
|
51
|
+
|
52
|
+
|
53
|
+
}// Reflex
|
data/.doc/ext/reflex/window.cpp
CHANGED
@@ -3,6 +3,7 @@
|
|
3
3
|
|
4
4
|
#include <rays/ruby/bounds.h>
|
5
5
|
#include <rays/ruby/painter.h>
|
6
|
+
#include "reflex/ruby/screen.h"
|
6
7
|
#include "reflex/ruby/view.h"
|
7
8
|
#include "defs.h"
|
8
9
|
|
@@ -38,6 +39,13 @@ VALUE hide(VALUE self)
|
|
38
39
|
return self;
|
39
40
|
}
|
40
41
|
|
42
|
+
static
|
43
|
+
VALUE hidden(VALUE self)
|
44
|
+
{
|
45
|
+
CHECK;
|
46
|
+
return value(THIS->hidden());
|
47
|
+
}
|
48
|
+
|
41
49
|
static
|
42
50
|
VALUE close(VALUE self)
|
43
51
|
{
|
@@ -98,44 +106,89 @@ VALUE get_frame(VALUE self)
|
|
98
106
|
return value(THIS->frame());
|
99
107
|
}
|
100
108
|
|
109
|
+
static
|
110
|
+
VALUE set_closable(VALUE self, VALUE state)
|
111
|
+
{
|
112
|
+
CHECK;
|
113
|
+
|
114
|
+
if (state)
|
115
|
+
THIS-> add_flag(Reflex::Window::FLAG_CLOSABLE);
|
116
|
+
else
|
117
|
+
THIS->remove_flag(Reflex::Window::FLAG_CLOSABLE);
|
118
|
+
|
119
|
+
return state;
|
120
|
+
}
|
121
|
+
|
122
|
+
static
|
123
|
+
VALUE is_closable(VALUE self)
|
124
|
+
{
|
125
|
+
CHECK;
|
126
|
+
return value(THIS->has_flag(Reflex::Window::FLAG_CLOSABLE));
|
127
|
+
}
|
128
|
+
|
129
|
+
static
|
130
|
+
VALUE set_minimizable(VALUE self, VALUE state)
|
131
|
+
{
|
132
|
+
CHECK;
|
133
|
+
|
134
|
+
if (state)
|
135
|
+
THIS-> add_flag(Reflex::Window::FLAG_MINIMIZABLE);
|
136
|
+
else
|
137
|
+
THIS->remove_flag(Reflex::Window::FLAG_MINIMIZABLE);
|
138
|
+
|
139
|
+
return state;
|
140
|
+
}
|
141
|
+
|
142
|
+
static
|
143
|
+
VALUE is_minimizable(VALUE self)
|
144
|
+
{
|
145
|
+
CHECK;
|
146
|
+
return value(THIS->has_flag(Reflex::Window::FLAG_MINIMIZABLE));
|
147
|
+
}
|
148
|
+
|
101
149
|
static
|
102
150
|
VALUE set_resizable(VALUE self, VALUE state)
|
103
151
|
{
|
104
152
|
CHECK;
|
105
|
-
|
106
|
-
|
153
|
+
|
154
|
+
if (state)
|
155
|
+
THIS-> add_flag(Reflex::Window::FLAG_RESIZABLE);
|
156
|
+
else
|
157
|
+
THIS->remove_flag(Reflex::Window::FLAG_RESIZABLE);
|
158
|
+
|
159
|
+
return state;
|
107
160
|
}
|
108
161
|
|
109
162
|
static
|
110
163
|
VALUE is_resizable(VALUE self)
|
111
164
|
{
|
112
165
|
CHECK;
|
113
|
-
return value(THIS->
|
166
|
+
return value(THIS->has_flag(Reflex::Window::FLAG_RESIZABLE));
|
114
167
|
}
|
115
168
|
|
116
169
|
static
|
117
|
-
VALUE
|
170
|
+
VALUE get_screen(VALUE self)
|
118
171
|
{
|
119
172
|
CHECK;
|
120
|
-
return value(THIS->
|
173
|
+
return value(THIS->screen());
|
121
174
|
}
|
122
175
|
|
123
176
|
static
|
124
|
-
VALUE
|
177
|
+
VALUE get_root(VALUE self)
|
125
178
|
{
|
126
179
|
CHECK;
|
127
180
|
return value(THIS->root());
|
128
181
|
}
|
129
182
|
|
130
183
|
static
|
131
|
-
VALUE
|
184
|
+
VALUE get_focus(VALUE self)
|
132
185
|
{
|
133
186
|
CHECK;
|
134
187
|
return value(THIS->focus());
|
135
188
|
}
|
136
189
|
|
137
190
|
static
|
138
|
-
VALUE
|
191
|
+
VALUE get_painter(VALUE self)
|
139
192
|
{
|
140
193
|
CHECK;
|
141
194
|
return value(THIS->painter());
|
@@ -277,12 +330,17 @@ Init_reflex_window ()
|
|
277
330
|
rb_define_method(cWindow, "title", RUBY_METHOD_FUNC(get_title), 0);
|
278
331
|
rb_define_method(cWindow, "frame=", RUBY_METHOD_FUNC(set_frame), -1);
|
279
332
|
rb_define_method(cWindow, "frame", RUBY_METHOD_FUNC(get_frame), 0);
|
333
|
+
rb_define_method(cWindow, "closable=", RUBY_METHOD_FUNC(set_closable), 1);
|
334
|
+
cWindow.define_method("closable?", is_closable);
|
335
|
+
rb_define_method(cWindow, "minimizable=", RUBY_METHOD_FUNC(set_minimizable), 1);
|
336
|
+
cWindow.define_method("minimizable?", is_minimizable);
|
280
337
|
rb_define_method(cWindow, "resizable=", RUBY_METHOD_FUNC(set_resizable), 1);
|
281
|
-
cWindow.define_method("resizable?",
|
338
|
+
cWindow.define_method("resizable?", is_resizable);
|
282
339
|
rb_define_method(cWindow, "hidden", RUBY_METHOD_FUNC(hidden), 0);
|
283
|
-
rb_define_method(cWindow, "
|
284
|
-
rb_define_method(cWindow, "
|
285
|
-
rb_define_method(cWindow, "
|
340
|
+
rb_define_method(cWindow, "screen", RUBY_METHOD_FUNC(get_screen), 0);
|
341
|
+
rb_define_method(cWindow, "root", RUBY_METHOD_FUNC(get_root), 0);
|
342
|
+
rb_define_method(cWindow, "focus", RUBY_METHOD_FUNC(get_focus), 0);
|
343
|
+
rb_define_method(cWindow, "painter", RUBY_METHOD_FUNC(get_painter), 0);
|
286
344
|
rb_define_method(cWindow, "on_show", RUBY_METHOD_FUNC(on_show), 1);
|
287
345
|
rb_define_method(cWindow, "on_hide", RUBY_METHOD_FUNC(on_hide), 1);
|
288
346
|
rb_define_method(cWindow, "on_close", RUBY_METHOD_FUNC(on_close), 1);
|
data/ChangeLog.md
CHANGED
@@ -1,6 +1,21 @@
|
|
1
1
|
# reflex ChangeLog
|
2
2
|
|
3
3
|
|
4
|
+
## [v0.1.42] - 2023-06-02
|
5
|
+
|
6
|
+
- Implement the Screen class for iOS
|
7
|
+
- Implement Window_get_screen() for iOS
|
8
|
+
- Implement window flags for iOS
|
9
|
+
- Update reflexView's size on viewDidLayoutSubviews
|
10
|
+
|
11
|
+
|
12
|
+
## [v0.1.41] - 2023-05-29
|
13
|
+
|
14
|
+
- Add Reflex::Screen class
|
15
|
+
- Add Window#closable and Window#minimizable accessors
|
16
|
+
- Fix that non-closable, non-minimizable, or non-resizable buttons raise error on clicking them
|
17
|
+
|
18
|
+
|
4
19
|
## [v0.1.40] - 2023-05-27
|
5
20
|
|
6
21
|
- required_ruby_version >= 3.0.0
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.42
|
data/ext/reflex/native.cpp
CHANGED
@@ -32,6 +32,7 @@ void Init_reflex_rect_shape ();
|
|
32
32
|
void Init_reflex_ellipse_shape ();
|
33
33
|
|
34
34
|
void Init_reflex_application ();
|
35
|
+
void Init_reflex_screen ();
|
35
36
|
void Init_reflex_window ();
|
36
37
|
void Init_reflex_view ();
|
37
38
|
|
@@ -80,6 +81,7 @@ extern "C" void
|
|
80
81
|
Init_reflex_ellipse_shape();
|
81
82
|
|
82
83
|
Init_reflex_application();
|
84
|
+
Init_reflex_screen();
|
83
85
|
Init_reflex_window();
|
84
86
|
Init_reflex_view();
|
85
87
|
|
@@ -0,0 +1,55 @@
|
|
1
|
+
#include "reflex/ruby/screen.h"
|
2
|
+
|
3
|
+
|
4
|
+
#include <rays/ruby/bounds.h>
|
5
|
+
#include "defs.h"
|
6
|
+
|
7
|
+
|
8
|
+
RUCY_DEFINE_VALUE_FROM_TO(Reflex::Screen)
|
9
|
+
|
10
|
+
#define THIS to<Reflex::Screen*>(self)
|
11
|
+
|
12
|
+
#define CHECK RUCY_CHECK_OBJECT(Reflex::Screen, self)
|
13
|
+
|
14
|
+
|
15
|
+
static
|
16
|
+
RUCY_DEF_ALLOC(alloc, klass)
|
17
|
+
{
|
18
|
+
Reflex::reflex_error(__FILE__, __LINE__, "can not instantiate Screen class.");
|
19
|
+
}
|
20
|
+
RUCY_END
|
21
|
+
|
22
|
+
static
|
23
|
+
RUCY_DEF0(get_frame)
|
24
|
+
{
|
25
|
+
CHECK;
|
26
|
+
return value(THIS->frame());
|
27
|
+
}
|
28
|
+
RUCY_END
|
29
|
+
|
30
|
+
|
31
|
+
static Class cScreen;
|
32
|
+
|
33
|
+
void
|
34
|
+
Init_reflex_screen ()
|
35
|
+
{
|
36
|
+
Module mReflex = define_module("Reflex");
|
37
|
+
|
38
|
+
cScreen = mReflex.define_class("Screen");
|
39
|
+
cScreen.define_alloc_func(alloc);
|
40
|
+
cScreen.define_method("frame", get_frame);
|
41
|
+
}
|
42
|
+
|
43
|
+
|
44
|
+
namespace Reflex
|
45
|
+
{
|
46
|
+
|
47
|
+
|
48
|
+
Class
|
49
|
+
screen_class ()
|
50
|
+
{
|
51
|
+
return cScreen;
|
52
|
+
}
|
53
|
+
|
54
|
+
|
55
|
+
}// Reflex
|
data/ext/reflex/window.cpp
CHANGED
@@ -3,6 +3,7 @@
|
|
3
3
|
|
4
4
|
#include <rays/ruby/bounds.h>
|
5
5
|
#include <rays/ruby/painter.h>
|
6
|
+
#include "reflex/ruby/screen.h"
|
6
7
|
#include "reflex/ruby/view.h"
|
7
8
|
#include "defs.h"
|
8
9
|
|
@@ -41,6 +42,14 @@ RUCY_DEF0(hide)
|
|
41
42
|
}
|
42
43
|
RUCY_END
|
43
44
|
|
45
|
+
static
|
46
|
+
RUCY_DEF0(hidden)
|
47
|
+
{
|
48
|
+
CHECK;
|
49
|
+
return value(THIS->hidden());
|
50
|
+
}
|
51
|
+
RUCY_END
|
52
|
+
|
44
53
|
static
|
45
54
|
RUCY_DEF0(close)
|
46
55
|
{
|
@@ -109,12 +118,61 @@ RUCY_DEF0(get_frame)
|
|
109
118
|
}
|
110
119
|
RUCY_END
|
111
120
|
|
121
|
+
static
|
122
|
+
RUCY_DEF1(set_closable, state)
|
123
|
+
{
|
124
|
+
CHECK;
|
125
|
+
|
126
|
+
if (state)
|
127
|
+
THIS-> add_flag(Reflex::Window::FLAG_CLOSABLE);
|
128
|
+
else
|
129
|
+
THIS->remove_flag(Reflex::Window::FLAG_CLOSABLE);
|
130
|
+
|
131
|
+
return state;
|
132
|
+
}
|
133
|
+
RUCY_END
|
134
|
+
|
135
|
+
static
|
136
|
+
RUCY_DEF0(is_closable)
|
137
|
+
{
|
138
|
+
CHECK;
|
139
|
+
return value(THIS->has_flag(Reflex::Window::FLAG_CLOSABLE));
|
140
|
+
}
|
141
|
+
RUCY_END
|
142
|
+
|
143
|
+
static
|
144
|
+
RUCY_DEF1(set_minimizable, state)
|
145
|
+
{
|
146
|
+
CHECK;
|
147
|
+
|
148
|
+
if (state)
|
149
|
+
THIS-> add_flag(Reflex::Window::FLAG_MINIMIZABLE);
|
150
|
+
else
|
151
|
+
THIS->remove_flag(Reflex::Window::FLAG_MINIMIZABLE);
|
152
|
+
|
153
|
+
return state;
|
154
|
+
}
|
155
|
+
RUCY_END
|
156
|
+
|
157
|
+
static
|
158
|
+
RUCY_DEF0(is_minimizable)
|
159
|
+
{
|
160
|
+
CHECK;
|
161
|
+
return value(THIS->has_flag(Reflex::Window::FLAG_MINIMIZABLE));
|
162
|
+
}
|
163
|
+
RUCY_END
|
164
|
+
|
112
165
|
static
|
113
166
|
RUCY_DEF1(set_resizable, state)
|
114
167
|
{
|
115
168
|
CHECK;
|
116
|
-
|
117
|
-
|
169
|
+
|
170
|
+
if (state)
|
171
|
+
THIS-> add_flag(Reflex::Window::FLAG_RESIZABLE);
|
172
|
+
else
|
173
|
+
THIS->remove_flag(Reflex::Window::FLAG_RESIZABLE);
|
174
|
+
|
175
|
+
return state;
|
118
176
|
}
|
119
177
|
RUCY_END
|
120
178
|
|
@@ -122,20 +180,20 @@ static
|
|
122
180
|
RUCY_DEF0(is_resizable)
|
123
181
|
{
|
124
182
|
CHECK;
|
125
|
-
return value(THIS->
|
183
|
+
return value(THIS->has_flag(Reflex::Window::FLAG_RESIZABLE));
|
126
184
|
}
|
127
185
|
RUCY_END
|
128
186
|
|
129
187
|
static
|
130
|
-
RUCY_DEF0(
|
188
|
+
RUCY_DEF0(get_screen)
|
131
189
|
{
|
132
190
|
CHECK;
|
133
|
-
return value(THIS->
|
191
|
+
return value(THIS->screen());
|
134
192
|
}
|
135
193
|
RUCY_END
|
136
194
|
|
137
195
|
static
|
138
|
-
RUCY_DEF0(
|
196
|
+
RUCY_DEF0(get_root)
|
139
197
|
{
|
140
198
|
CHECK;
|
141
199
|
return value(THIS->root());
|
@@ -143,7 +201,7 @@ RUCY_DEF0(root)
|
|
143
201
|
RUCY_END
|
144
202
|
|
145
203
|
static
|
146
|
-
RUCY_DEF0(
|
204
|
+
RUCY_DEF0(get_focus)
|
147
205
|
{
|
148
206
|
CHECK;
|
149
207
|
return value(THIS->focus());
|
@@ -151,7 +209,7 @@ RUCY_DEF0(focus)
|
|
151
209
|
RUCY_END
|
152
210
|
|
153
211
|
static
|
154
|
-
RUCY_DEF0(
|
212
|
+
RUCY_DEF0(get_painter)
|
155
213
|
{
|
156
214
|
CHECK;
|
157
215
|
return value(THIS->painter());
|
@@ -310,12 +368,17 @@ Init_reflex_window ()
|
|
310
368
|
cWindow.define_method("title", get_title);
|
311
369
|
cWindow.define_method("frame=", set_frame);
|
312
370
|
cWindow.define_method("frame", get_frame);
|
313
|
-
cWindow.define_method("
|
314
|
-
cWindow.define_method("
|
371
|
+
cWindow.define_method("closable=", set_closable);
|
372
|
+
cWindow.define_method("closable?", is_closable);
|
373
|
+
cWindow.define_method("minimizable=", set_minimizable);
|
374
|
+
cWindow.define_method("minimizable?", is_minimizable);
|
375
|
+
cWindow.define_method("resizable=", set_resizable);
|
376
|
+
cWindow.define_method("resizable?", is_resizable);
|
315
377
|
cWindow.define_method("hidden", hidden);
|
316
|
-
cWindow.define_method("
|
317
|
-
cWindow.define_method("
|
318
|
-
cWindow.define_method("
|
378
|
+
cWindow.define_method("screen", get_screen);
|
379
|
+
cWindow.define_method("root", get_root);
|
380
|
+
cWindow.define_method("focus", get_focus);
|
381
|
+
cWindow.define_method("painter", get_painter);
|
319
382
|
cWindow.define_method("on_show", on_show);
|
320
383
|
cWindow.define_method("on_hide", on_hide);
|
321
384
|
cWindow.define_method("on_close", on_close);
|
@@ -0,0 +1,40 @@
|
|
1
|
+
// -*- c++ -*-
|
2
|
+
#pragma once
|
3
|
+
#ifndef __REFLEX_RUBY_SCREEN_H__
|
4
|
+
#define __REFLEX_RUBY_SCREEN_H__
|
5
|
+
|
6
|
+
|
7
|
+
#include <rucy/class.h>
|
8
|
+
#include <rucy/extension.h>
|
9
|
+
#include <reflex/screen.h>
|
10
|
+
|
11
|
+
|
12
|
+
RUCY_DECLARE_VALUE_FROM_TO(Reflex::Screen)
|
13
|
+
|
14
|
+
|
15
|
+
namespace Reflex
|
16
|
+
{
|
17
|
+
|
18
|
+
|
19
|
+
Rucy::Class screen_class ();
|
20
|
+
// class Reflex::Screen
|
21
|
+
|
22
|
+
|
23
|
+
}// Reflex
|
24
|
+
|
25
|
+
|
26
|
+
namespace Rucy
|
27
|
+
{
|
28
|
+
|
29
|
+
|
30
|
+
template <> inline Class
|
31
|
+
get_ruby_class<Reflex::Screen> ()
|
32
|
+
{
|
33
|
+
return Reflex::screen_class();
|
34
|
+
}
|
35
|
+
|
36
|
+
|
37
|
+
}// Rucy
|
38
|
+
|
39
|
+
|
40
|
+
#endif//EOH
|
@@ -0,0 +1,43 @@
|
|
1
|
+
// -*- c++ -*-
|
2
|
+
#pragma once
|
3
|
+
#ifndef __REFLEX_SCREEN_H__
|
4
|
+
#define __REFLEX_SCREEN_H__
|
5
|
+
|
6
|
+
|
7
|
+
#include <xot/pimpl.h>
|
8
|
+
#include <rays/bounds.h>
|
9
|
+
#include <reflex/defs.h>
|
10
|
+
|
11
|
+
|
12
|
+
namespace Reflex
|
13
|
+
{
|
14
|
+
|
15
|
+
|
16
|
+
class Screen
|
17
|
+
{
|
18
|
+
|
19
|
+
typedef Screen This;
|
20
|
+
|
21
|
+
public:
|
22
|
+
|
23
|
+
Screen ();
|
24
|
+
|
25
|
+
virtual ~Screen ();
|
26
|
+
|
27
|
+
virtual Bounds frame () const;
|
28
|
+
|
29
|
+
operator bool () const;
|
30
|
+
|
31
|
+
bool operator ! () const;
|
32
|
+
|
33
|
+
struct Data;
|
34
|
+
|
35
|
+
Xot::PSharedImpl<Data> self;
|
36
|
+
|
37
|
+
};// Screen
|
38
|
+
|
39
|
+
|
40
|
+
}// Reflex
|
41
|
+
|
42
|
+
|
43
|
+
#endif//EOH
|
data/include/reflex/window.h
CHANGED
@@ -11,6 +11,7 @@
|
|
11
11
|
#include <rays/painter.h>
|
12
12
|
#include <reflex/defs.h>
|
13
13
|
#include <reflex/event.h>
|
14
|
+
#include <reflex/screen.h>
|
14
15
|
|
15
16
|
|
16
17
|
namespace Reflex
|
@@ -29,12 +30,27 @@ namespace Reflex
|
|
29
30
|
|
30
31
|
typedef Xot::Ref<This> Ref;
|
31
32
|
|
33
|
+
enum Flag
|
34
|
+
{
|
35
|
+
|
36
|
+
FLAG_CLOSABLE = Xot::bit(0),
|
37
|
+
|
38
|
+
FLAG_MINIMIZABLE = Xot::bit(1),
|
39
|
+
|
40
|
+
FLAG_RESIZABLE = Xot::bit(2),
|
41
|
+
|
42
|
+
FLAG_LAST = FLAG_RESIZABLE
|
43
|
+
|
44
|
+
};// Flag
|
45
|
+
|
32
46
|
Window ();
|
33
47
|
|
34
48
|
virtual void show ();
|
35
49
|
|
36
50
|
virtual void hide ();
|
37
51
|
|
52
|
+
virtual bool hidden () const;
|
53
|
+
|
38
54
|
virtual void close (bool force = false);
|
39
55
|
|
40
56
|
virtual void redraw ();
|
@@ -53,11 +69,13 @@ namespace Reflex
|
|
53
69
|
|
54
70
|
virtual Bounds frame () const;
|
55
71
|
|
56
|
-
virtual void
|
72
|
+
virtual void add_flag (uint flags);
|
57
73
|
|
58
|
-
virtual
|
74
|
+
virtual void remove_flag (uint flags);
|
59
75
|
|
60
|
-
virtual bool
|
76
|
+
virtual bool has_flag (uint flags) const;
|
77
|
+
|
78
|
+
virtual Screen screen () const;
|
61
79
|
|
62
80
|
virtual View* root ();
|
63
81
|
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'forwardable'
|
2
|
+
|
3
|
+
|
4
|
+
module Reflex
|
5
|
+
|
6
|
+
|
7
|
+
class Screen
|
8
|
+
|
9
|
+
extend Forwardable
|
10
|
+
|
11
|
+
def_delegators :frame,
|
12
|
+
:x, :y, :z, :w, :h, :d, :width, :height, :depth,
|
13
|
+
:left, :top, :back, :right, :bottom, :front,
|
14
|
+
:left_top, :right_top, :left_bottom, :right_bottom,
|
15
|
+
:lt, :lr, :lb, :rb,
|
16
|
+
:position, :pos, :size, :center
|
17
|
+
|
18
|
+
end# Screen
|
19
|
+
|
20
|
+
|
21
|
+
end# Reflex
|
data/lib/reflex/window.rb
CHANGED
@@ -62,7 +62,9 @@ module Reflex
|
|
62
62
|
:restitution=, :restitution
|
63
63
|
|
64
64
|
universal_accessor :title, :frame,
|
65
|
-
|
65
|
+
closable: {reader: :closable?},
|
66
|
+
minimizable: {reader: :minimizable?},
|
67
|
+
resizable: {reader: :resizable?}
|
66
68
|
|
67
69
|
def initialize(options = nil, &block)
|
68
70
|
super()
|
data/lib/reflex.rb
CHANGED
data/reflex.gemspec
CHANGED
@@ -1,10 +1,7 @@
|
|
1
1
|
# -*- mode: ruby -*-
|
2
2
|
|
3
3
|
|
4
|
-
|
5
|
-
.tap {|s| $:.unshift s if !$:.include?(s) && File.directory?(s)}
|
6
|
-
|
7
|
-
require 'reflex/extension'
|
4
|
+
require_relative 'lib/reflex/extension'
|
8
5
|
|
9
6
|
|
10
7
|
Gem::Specification.new do |s|
|
@@ -28,10 +25,10 @@ Gem::Specification.new do |s|
|
|
28
25
|
s.platform = Gem::Platform::RUBY
|
29
26
|
s.required_ruby_version = '>= 3.0.0'
|
30
27
|
|
31
|
-
s.add_runtime_dependency 'xot', '~> 0.1.
|
32
|
-
s.add_runtime_dependency 'rucy', '~> 0.1.
|
33
|
-
s.add_runtime_dependency 'beeps', '~> 0.1.
|
34
|
-
s.add_runtime_dependency 'rays', '~> 0.1.
|
28
|
+
s.add_runtime_dependency 'xot', '~> 0.1.38'
|
29
|
+
s.add_runtime_dependency 'rucy', '~> 0.1.38'
|
30
|
+
s.add_runtime_dependency 'beeps', '~> 0.1.39'
|
31
|
+
s.add_runtime_dependency 'rays', '~> 0.1.39'
|
35
32
|
|
36
33
|
s.add_development_dependency 'rake'
|
37
34
|
s.add_development_dependency 'test-unit'
|
data/src/ios/screen.h
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
// -*- c++ -*-
|
2
|
+
#pragma once
|
3
|
+
#ifndef __REFLEX_SRC_IOS_SCREEN_H__
|
4
|
+
#define __REFLEX_SRC_IOS_SCREEN_H__
|
5
|
+
|
6
|
+
|
7
|
+
#include "reflex/screen.h"
|
8
|
+
|
9
|
+
|
10
|
+
namespace Reflex
|
11
|
+
{
|
12
|
+
|
13
|
+
|
14
|
+
void Screen_initialize (Screen* pthis, UIScreen* screen);
|
15
|
+
|
16
|
+
|
17
|
+
}// Reflex
|
18
|
+
|
19
|
+
|
20
|
+
#endif//EOH
|