@pompadour/react-native-skia 1.5.33 → 1.5.35

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,43 +2,51 @@
2
2
  #define NEAT_PLAYER_H
3
3
 
4
4
  #include "CanvasManager.h"
5
- #include "InputManager.h"
6
5
  #include "PerformanceManager.h"
7
6
  #include "Renderer.h"
8
7
  #include "ResourceManager.h"
9
8
  #include "ShaderManager.h"
10
9
  #include "State.h"
11
10
  #include "UIManager.h"
12
- #include "utils/Input.h"
11
+ #include "ViewportManager.h"
12
+ #include "input/input.h"
13
13
 
14
- class NeatPlayer {
14
+ using neat::input::GestureEvent;
15
+ using neat::input::InputSystem;
16
+ using neat::input::Key;
17
+
18
+ class NeatPlayer : public Updatable, public Renderable {
15
19
  public:
16
20
  NeatPlayer();
17
- ~NeatPlayer();
21
+ ~NeatPlayer() override;
18
22
 
19
- // Update / Render
23
+ // Initialization
20
24
  void initialize(int argc, char** argv);
21
- void update(double deltaTime);
22
- void render(SkCanvas* canvas);
23
25
 
24
- // Data Loading
26
+ // Updatable/Renderable interface
27
+ void update(double deltaTime) override;
28
+ void render(SkCanvas* canvas) override;
29
+
30
+ // Loading
25
31
  bool load();
26
32
  #ifdef __EMSCRIPTEN__
27
33
  void loadUrl(const std::string& url);
28
34
  void loadJSON(const std::string& json);
29
35
  #endif
30
36
 
31
- // System Input
32
- bool onKey(skui::Key key, skui::InputState inputState, skui::ModifierKey modifiers);
37
+ // Input handling
38
+ bool onKey(Key key, skui::InputState state, skui::ModifierKey modifiers);
33
39
  bool onChar(SkUnichar character);
34
- bool onMouse(int x, int y, skui::InputState inputState, skui::ModifierKey modifiers);
35
- bool onMouseWheel(float delta, int x, int y, skui::ModifierKey modifiers);
40
+ bool onMouse(float x, float y, skui::InputState state, skui::ModifierKey modifiers);
41
+ bool onMouseWheel(float deltaX, float deltaY, int x, int y, bool isPrecise, skui::ModifierKey modifiers);
42
+ bool onTouchBegan(int32_t touchId, const SkPoint& position);
43
+ bool onTouchMoved(int32_t touchId, const SkPoint& position);
44
+ bool onTouchEnded(int32_t touchId, const SkPoint& position);
45
+ bool onGesture(const GestureEvent& gesture);
36
46
 
37
47
  // Player API
38
- bool isPlaying();
39
48
  void togglePlayPause();
40
49
  void seek(double time);
41
- void cyclePlaybackSpeed();
42
50
  bool previous();
43
51
  bool next();
44
52
  void cycleBackgroundShader();
@@ -47,6 +55,7 @@ public:
47
55
  void toggleHelpVisibility();
48
56
 
49
57
  private:
58
+ ViewportManager viewportManager;
50
59
  State state;
51
60
  Renderer renderer;
52
61
  FontManager fontManager;
@@ -54,15 +63,19 @@ private:
54
63
  ResourceManager resourceManager;
55
64
  UIManager uiManager;
56
65
  ShaderManager shaderManager;
57
- InputManager inputManager;
58
66
  PerformanceManager& performanceManager;
59
67
 
68
+ InputSystem& inputSystem;
69
+
60
70
  const double seekDelta = 1.0; // 1 seconds seek
61
- const std::vector<double> playbackSpeeds = {0.1, 0.25, 0.5, 1.0, 1.5, 2.0, 5.0};
62
- size_t currentSpeedIndex = 1; // Start at normal speed (1.0)
63
71
 
64
- // void initializeInputHandlers();
72
+ void initializeInputSystem();
65
73
  void initializeKeyBindings();
74
+
75
+ private:
76
+ void updateViewportForContent();
77
+ void renderCanvasCursor(SkCanvas* canvas);
78
+ void renderScreenCursor(SkCanvas* canvas);
66
79
  };
67
80
 
68
81
  #endif // NEAT_PLAYER_H
@@ -8,34 +8,34 @@
8
8
  <key>BinaryPath</key>
9
9
  <string>libskottie.a</string>
10
10
  <key>LibraryIdentifier</key>
11
- <string>ios-arm64_arm64e_x86_64-simulator</string>
11
+ <string>ios-arm64_arm64e</string>
12
12
  <key>LibraryPath</key>
13
13
  <string>libskottie.a</string>
14
14
  <key>SupportedArchitectures</key>
15
15
  <array>
16
16
  <string>arm64</string>
17
17
  <string>arm64e</string>
18
- <string>x86_64</string>
19
18
  </array>
20
19
  <key>SupportedPlatform</key>
21
20
  <string>ios</string>
22
- <key>SupportedPlatformVariant</key>
23
- <string>simulator</string>
24
21
  </dict>
25
22
  <dict>
26
23
  <key>BinaryPath</key>
27
24
  <string>libskottie.a</string>
28
25
  <key>LibraryIdentifier</key>
29
- <string>ios-arm64_arm64e</string>
26
+ <string>ios-arm64_arm64e_x86_64-simulator</string>
30
27
  <key>LibraryPath</key>
31
28
  <string>libskottie.a</string>
32
29
  <key>SupportedArchitectures</key>
33
30
  <array>
34
31
  <string>arm64</string>
35
32
  <string>arm64e</string>
33
+ <string>x86_64</string>
36
34
  </array>
37
35
  <key>SupportedPlatform</key>
38
36
  <string>ios</string>
37
+ <key>SupportedPlatformVariant</key>
38
+ <string>simulator</string>
39
39
  </dict>
40
40
  </array>
41
41
  <key>CFBundlePackageType</key>
@@ -8,34 +8,34 @@
8
8
  <key>BinaryPath</key>
9
9
  <string>libskparagraph.a</string>
10
10
  <key>LibraryIdentifier</key>
11
- <string>ios-arm64_arm64e</string>
11
+ <string>ios-arm64_arm64e_x86_64-simulator</string>
12
12
  <key>LibraryPath</key>
13
13
  <string>libskparagraph.a</string>
14
14
  <key>SupportedArchitectures</key>
15
15
  <array>
16
16
  <string>arm64</string>
17
17
  <string>arm64e</string>
18
+ <string>x86_64</string>
18
19
  </array>
19
20
  <key>SupportedPlatform</key>
20
21
  <string>ios</string>
22
+ <key>SupportedPlatformVariant</key>
23
+ <string>simulator</string>
21
24
  </dict>
22
25
  <dict>
23
26
  <key>BinaryPath</key>
24
27
  <string>libskparagraph.a</string>
25
28
  <key>LibraryIdentifier</key>
26
- <string>ios-arm64_arm64e_x86_64-simulator</string>
29
+ <string>ios-arm64_arm64e</string>
27
30
  <key>LibraryPath</key>
28
31
  <string>libskparagraph.a</string>
29
32
  <key>SupportedArchitectures</key>
30
33
  <array>
31
34
  <string>arm64</string>
32
35
  <string>arm64e</string>
33
- <string>x86_64</string>
34
36
  </array>
35
37
  <key>SupportedPlatform</key>
36
38
  <string>ios</string>
37
- <key>SupportedPlatformVariant</key>
38
- <string>simulator</string>
39
39
  </dict>
40
40
  </array>
41
41
  <key>CFBundlePackageType</key>
@@ -8,34 +8,34 @@
8
8
  <key>BinaryPath</key>
9
9
  <string>libskunicode.a</string>
10
10
  <key>LibraryIdentifier</key>
11
- <string>ios-arm64_arm64e_x86_64-simulator</string>
11
+ <string>ios-arm64_arm64e</string>
12
12
  <key>LibraryPath</key>
13
13
  <string>libskunicode.a</string>
14
14
  <key>SupportedArchitectures</key>
15
15
  <array>
16
16
  <string>arm64</string>
17
17
  <string>arm64e</string>
18
- <string>x86_64</string>
19
18
  </array>
20
19
  <key>SupportedPlatform</key>
21
20
  <string>ios</string>
22
- <key>SupportedPlatformVariant</key>
23
- <string>simulator</string>
24
21
  </dict>
25
22
  <dict>
26
23
  <key>BinaryPath</key>
27
24
  <string>libskunicode.a</string>
28
25
  <key>LibraryIdentifier</key>
29
- <string>ios-arm64_arm64e</string>
26
+ <string>ios-arm64_arm64e_x86_64-simulator</string>
30
27
  <key>LibraryPath</key>
31
28
  <string>libskunicode.a</string>
32
29
  <key>SupportedArchitectures</key>
33
30
  <array>
34
31
  <string>arm64</string>
35
32
  <string>arm64e</string>
33
+ <string>x86_64</string>
36
34
  </array>
37
35
  <key>SupportedPlatform</key>
38
36
  <string>ios</string>
37
+ <key>SupportedPlatformVariant</key>
38
+ <string>simulator</string>
39
39
  </dict>
40
40
  </array>
41
41
  <key>CFBundlePackageType</key>
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "setup-skia-web": "./scripts/setup-canvaskit.js"
8
8
  },
9
9
  "title": "React Native Skia",
10
- "version": "1.5.33",
10
+ "version": "1.5.35",
11
11
  "description": "High-performance React Native Graphics using Skia",
12
12
  "main": "lib/module/index.js",
13
13
  "react-native": "src/index.ts",