reflexion 0.1.41 → 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/ChangeLog.md +8 -0
- data/VERSION +1 -1
- 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 +2 -2
- data/src/osx/screen.mm +8 -4
- data/src/osx/window.h +1 -3
- data/src/osx/window.mm +13 -14
- data/src/window.cpp +21 -4
- data/src/window.h +5 -10
- metadata +4 -2
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/ChangeLog.md
CHANGED
@@ -1,6 +1,14 @@
|
|
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
|
+
|
4
12
|
## [v0.1.41] - 2023-05-29
|
5
13
|
|
6
14
|
- Add Reflex::Screen class
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.42
|
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
|
data/src/ios/screen.mm
ADDED
@@ -0,0 +1,62 @@
|
|
1
|
+
// -*- mode: objc -*-
|
2
|
+
#include "screen.h"
|
3
|
+
|
4
|
+
|
5
|
+
#include "reflex/exception.h"
|
6
|
+
|
7
|
+
|
8
|
+
namespace Reflex
|
9
|
+
{
|
10
|
+
|
11
|
+
|
12
|
+
struct Screen::Data
|
13
|
+
{
|
14
|
+
|
15
|
+
UIScreen* screen = nil;
|
16
|
+
|
17
|
+
~Data ()
|
18
|
+
{
|
19
|
+
if (screen) [screen release];
|
20
|
+
}
|
21
|
+
|
22
|
+
};// Screen::Data
|
23
|
+
|
24
|
+
|
25
|
+
void
|
26
|
+
Screen_initialize (Screen* pthis, UIScreen* screen)
|
27
|
+
{
|
28
|
+
pthis->self->screen = [screen retain];
|
29
|
+
}
|
30
|
+
|
31
|
+
|
32
|
+
Screen::Screen ()
|
33
|
+
{
|
34
|
+
}
|
35
|
+
|
36
|
+
Screen::~Screen ()
|
37
|
+
{
|
38
|
+
}
|
39
|
+
|
40
|
+
Bounds
|
41
|
+
Screen::frame () const
|
42
|
+
{
|
43
|
+
if (!*this)
|
44
|
+
invalid_state_error(__FILE__, __LINE__);
|
45
|
+
|
46
|
+
CGRect b = self->screen.bounds;
|
47
|
+
return Bounds(b.origin.x, b.origin.y, b.size.width, b.size.height);
|
48
|
+
}
|
49
|
+
|
50
|
+
Screen::operator bool () const
|
51
|
+
{
|
52
|
+
return self->screen;
|
53
|
+
}
|
54
|
+
|
55
|
+
bool
|
56
|
+
Screen::operator ! () const
|
57
|
+
{
|
58
|
+
return !operator bool();
|
59
|
+
}
|
60
|
+
|
61
|
+
|
62
|
+
}// Reflex
|
data/src/ios/view_controller.h
CHANGED
data/src/ios/view_controller.mm
CHANGED
@@ -293,6 +293,12 @@ ReflexViewController_get_show_fun ()
|
|
293
293
|
[super viewDidDisappear: animated];
|
294
294
|
}
|
295
295
|
|
296
|
+
- (void)viewDidLayoutSubviews
|
297
|
+
{
|
298
|
+
[super viewDidLayoutSubviews];
|
299
|
+
self.reflexView.frame = self.view.bounds;
|
300
|
+
}
|
301
|
+
|
296
302
|
- (void) startTimer
|
297
303
|
{
|
298
304
|
[self startTimer: 60];
|
data/src/ios/window.h
CHANGED
data/src/ios/window.mm
CHANGED
@@ -3,6 +3,7 @@
|
|
3
3
|
|
4
4
|
|
5
5
|
#include "reflex/exception.h"
|
6
|
+
#include "screen.h"
|
6
7
|
#import "view_controller.h"
|
7
8
|
|
8
9
|
|
@@ -48,6 +49,12 @@ namespace Reflex
|
|
48
49
|
return new WindowData();
|
49
50
|
}
|
50
51
|
|
52
|
+
uint
|
53
|
+
Window_default_flags ()
|
54
|
+
{
|
55
|
+
return 0;
|
56
|
+
}
|
57
|
+
|
51
58
|
void
|
52
59
|
Window_initialize (Window* window)
|
53
60
|
{
|
@@ -127,24 +134,44 @@ namespace Reflex
|
|
127
134
|
Bounds
|
128
135
|
Window_get_frame (const Window& window)
|
129
136
|
{
|
130
|
-
CGRect
|
131
|
-
return Bounds(
|
132
|
-
rect.origin.x,
|
133
|
-
rect.origin.y,
|
134
|
-
rect.size.width,
|
135
|
-
rect.size.height);
|
137
|
+
CGRect b = get_vc(&window).reflexView.bounds;
|
138
|
+
return Bounds(b.origin.x, b.origin.y, b.size.width, b.size.height);
|
136
139
|
}
|
137
140
|
|
138
141
|
void
|
139
|
-
|
142
|
+
Window_set_flags (Window* window, uint flags)
|
140
143
|
{
|
141
|
-
|
144
|
+
if (Xot::has_flag(flags, Window::FLAG_CLOSABLE))
|
145
|
+
argument_error(__FILE__, __LINE__, "FLAG_CLOSABLE is not supported");
|
146
|
+
|
147
|
+
if (Xot::has_flag(flags, Window::FLAG_MINIMIZABLE))
|
148
|
+
argument_error(__FILE__, __LINE__, "FLAG_MINIMIZABLE is not supported");
|
149
|
+
|
150
|
+
if (Xot::has_flag(flags, Window::FLAG_RESIZABLE))
|
151
|
+
argument_error(__FILE__, __LINE__, "FLAG_RESIZABLE is not supported");
|
152
|
+
}
|
153
|
+
|
154
|
+
static UIScreen*
|
155
|
+
get_screen (const Window& window)
|
156
|
+
{
|
157
|
+
UIWindow* w = get_vc(&window).view.window;
|
158
|
+
if (@available(iOS 13.0, *))
|
159
|
+
{
|
160
|
+
return w.windowScene.screen;
|
161
|
+
}
|
162
|
+
else
|
163
|
+
{
|
164
|
+
return w.screen;
|
165
|
+
}
|
142
166
|
}
|
143
167
|
|
144
|
-
|
145
|
-
|
168
|
+
Screen
|
169
|
+
Window_get_screen (const Window& window)
|
146
170
|
{
|
147
|
-
|
171
|
+
Screen s;
|
172
|
+
UIScreen* screen = get_screen(window);
|
173
|
+
Screen_initialize(&s, screen ? screen : UIScreen.mainScreen);
|
174
|
+
return s;
|
148
175
|
}
|
149
176
|
|
150
177
|
float
|
@@ -154,10 +181,4 @@ namespace Reflex
|
|
154
181
|
}
|
155
182
|
|
156
183
|
|
157
|
-
WindowData::WindowData ()
|
158
|
-
{
|
159
|
-
view_controller = nil;
|
160
|
-
}
|
161
|
-
|
162
|
-
|
163
184
|
}// Reflex
|
data/src/osx/native_window.mm
CHANGED
@@ -15,8 +15,8 @@
|
|
15
15
|
static NSWindowStyleMask
|
16
16
|
default_style_mask ()
|
17
17
|
{
|
18
|
-
return Window_make_style_mask(
|
19
|
-
Reflex::
|
18
|
+
return Reflex::Window_make_style_mask(
|
19
|
+
Reflex::Window_default_flags(),
|
20
20
|
NSTitledWindowMask | NSTexturedBackgroundWindowMask);
|
21
21
|
}
|
22
22
|
|
data/src/osx/screen.mm
CHANGED
@@ -2,6 +2,9 @@
|
|
2
2
|
#include "screen.h"
|
3
3
|
|
4
4
|
|
5
|
+
#include "reflex/exception.h"
|
6
|
+
|
7
|
+
|
5
8
|
namespace Reflex
|
6
9
|
{
|
7
10
|
|
@@ -37,10 +40,11 @@ namespace Reflex
|
|
37
40
|
Bounds
|
38
41
|
Screen::frame () const
|
39
42
|
{
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
43
|
+
if (!*this)
|
44
|
+
invalid_state_error(__FILE__, __LINE__);
|
45
|
+
|
46
|
+
NSRect f = self->screen.frame;
|
47
|
+
return Bounds(f.origin.x, f.origin.y, f.size.width, f.size.height);
|
44
48
|
}
|
45
49
|
|
46
50
|
Screen::operator bool () const
|
data/src/osx/window.h
CHANGED
data/src/osx/window.mm
CHANGED
@@ -70,6 +70,15 @@ namespace Reflex
|
|
70
70
|
return new WindowData();
|
71
71
|
}
|
72
72
|
|
73
|
+
uint
|
74
|
+
Window_default_flags ()
|
75
|
+
{
|
76
|
+
return
|
77
|
+
Window::FLAG_CLOSABLE |
|
78
|
+
Window::FLAG_MINIMIZABLE |
|
79
|
+
Window::FLAG_RESIZABLE;
|
80
|
+
}
|
81
|
+
|
73
82
|
void
|
74
83
|
Window_initialize (Window* window)
|
75
84
|
{
|
@@ -126,12 +135,8 @@ namespace Reflex
|
|
126
135
|
Window_get_frame (const Window& window)
|
127
136
|
{
|
128
137
|
NativeWindow* native = get_native(&window);
|
129
|
-
NSRect
|
130
|
-
return Bounds(
|
131
|
-
rect.origin.x,
|
132
|
-
rect.origin.y,
|
133
|
-
rect.size.width,
|
134
|
-
rect.size.height);
|
138
|
+
NSRect r = [native contentRectForFrameRect: [native frame]];
|
139
|
+
return Bounds(r.origin.x, r.origin.y, r.size.width, r.size.height);
|
135
140
|
}
|
136
141
|
|
137
142
|
void
|
@@ -149,8 +154,8 @@ namespace Reflex
|
|
149
154
|
Window_get_screen (const Window& window)
|
150
155
|
{
|
151
156
|
Screen s;
|
152
|
-
|
153
|
-
if (
|
157
|
+
NSScreen* screen = get_native(&window).screen;
|
158
|
+
if (screen) Screen_initialize(&s, screen);
|
154
159
|
return s;
|
155
160
|
}
|
156
161
|
|
@@ -161,10 +166,4 @@ namespace Reflex
|
|
161
166
|
}
|
162
167
|
|
163
168
|
|
164
|
-
WindowData::WindowData ()
|
165
|
-
{
|
166
|
-
native = nil;
|
167
|
-
}
|
168
|
-
|
169
|
-
|
170
169
|
}// Reflex
|
data/src/window.cpp
CHANGED
@@ -22,6 +22,17 @@ namespace Reflex
|
|
22
22
|
using TargetPointerMap = Window::Data::TargetPointerMap;
|
23
23
|
|
24
24
|
|
25
|
+
Window::Data::Data ()
|
26
|
+
: flags(Window_default_flags())
|
27
|
+
{
|
28
|
+
prev_time_update = prev_time_draw = Xot::time();
|
29
|
+
}
|
30
|
+
|
31
|
+
Window::Data::~Data ()
|
32
|
+
{
|
33
|
+
}
|
34
|
+
|
35
|
+
|
25
36
|
Window::Data::PointerData::PointerData (uint view_index)
|
26
37
|
: view_index(view_index)
|
27
38
|
{
|
@@ -520,17 +531,23 @@ namespace Reflex
|
|
520
531
|
void
|
521
532
|
Window::add_flag (uint flags)
|
522
533
|
{
|
523
|
-
|
534
|
+
uint value = self->flags;
|
535
|
+
Xot::add_flag(&value, flags);
|
524
536
|
|
525
|
-
Window_set_flags(this,
|
537
|
+
Window_set_flags(this, value);
|
538
|
+
|
539
|
+
self->flags = value;
|
526
540
|
}
|
527
541
|
|
528
542
|
void
|
529
543
|
Window::remove_flag (uint flags)
|
530
544
|
{
|
531
|
-
|
545
|
+
uint value = self->flags;
|
546
|
+
Xot::remove_flag(&value, flags);
|
547
|
+
|
548
|
+
Window_set_flags(this, value);
|
532
549
|
|
533
|
-
|
550
|
+
self->flags = value;
|
534
551
|
}
|
535
552
|
|
536
553
|
bool
|
data/src/window.h
CHANGED
@@ -37,8 +37,6 @@ namespace Reflex
|
|
37
37
|
|
38
38
|
typedef std::map<View::Ref, TargetPointerMap> CaptureMap;
|
39
39
|
|
40
|
-
enum {FLAG_DEFAULT = FLAG_CLOSABLE | FLAG_MINIMIZABLE | FLAG_RESIZABLE};
|
41
|
-
|
42
40
|
int hide_count = 1;
|
43
41
|
|
44
42
|
bool redraw = true;
|
@@ -53,16 +51,11 @@ namespace Reflex
|
|
53
51
|
|
54
52
|
CaptureMap captures;
|
55
53
|
|
56
|
-
uint flags
|
54
|
+
uint flags;
|
57
55
|
|
58
|
-
Data ()
|
59
|
-
{
|
60
|
-
prev_time_update = prev_time_draw = Xot::time();
|
61
|
-
}
|
56
|
+
Data ();
|
62
57
|
|
63
|
-
virtual ~Data ()
|
64
|
-
{
|
65
|
-
}
|
58
|
+
virtual ~Data ();
|
66
59
|
|
67
60
|
virtual bool is_valid () const = 0;
|
68
61
|
|
@@ -81,6 +74,8 @@ namespace Reflex
|
|
81
74
|
|
82
75
|
Window::Data* Window_create_data ();
|
83
76
|
|
77
|
+
uint Window_default_flags ();
|
78
|
+
|
84
79
|
void Window_initialize (Window* window);
|
85
80
|
|
86
81
|
void Window_show (Window* window);
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: reflexion
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.42
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- xordog
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-06-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: xot
|
@@ -355,6 +355,8 @@ files:
|
|
355
355
|
- src/ios/event.h
|
356
356
|
- src/ios/event.mm
|
357
357
|
- src/ios/reflex.mm
|
358
|
+
- src/ios/screen.h
|
359
|
+
- src/ios/screen.mm
|
358
360
|
- src/ios/view_controller.h
|
359
361
|
- src/ios/view_controller.mm
|
360
362
|
- src/ios/window.h
|