@pompadour/react-native-skia 1.5.34 → 1.5.35

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,7 +2,6 @@
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"
@@ -10,37 +9,44 @@
10
9
  #include "State.h"
11
10
  #include "UIManager.h"
12
11
  #include "ViewportManager.h"
13
- #include "utils/Input.h"
12
+ #include "input/input.h"
14
13
 
15
- 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 {
16
19
  public:
17
20
  NeatPlayer();
18
- ~NeatPlayer();
21
+ ~NeatPlayer() override;
19
22
 
20
- // Update / Render
23
+ // Initialization
21
24
  void initialize(int argc, char** argv);
22
- void update(double deltaTime);
23
- void render(SkCanvas* canvas);
24
- // Data Loading
25
+
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
- // System Input
31
- bool onKey(skui::Key key, skui::InputState inputState, skui::ModifierKey modifiers);
36
+
37
+ // Input handling
38
+ bool onKey(Key key, skui::InputState state, skui::ModifierKey modifiers);
32
39
  bool onChar(SkUnichar character);
33
- bool onMouse(int x, int y, skui::InputState inputState, skui::ModifierKey modifiers);
34
- bool onMouseWheel(float delta, int x, int y, skui::ModifierKey modifiers);
35
- void onTouchBegan(int32_t touchId, const SkPoint& position);
36
- void onTouchMoved(int32_t touchId, const SkPoint& position);
37
- void onTouchEnded(int32_t touchId);
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);
38
46
 
39
47
  // Player API
40
- bool isPlaying();
41
48
  void togglePlayPause();
42
49
  void seek(double time);
43
- void cyclePlaybackSpeed();
44
50
  bool previous();
45
51
  bool next();
46
52
  void cycleBackgroundShader();
@@ -57,20 +63,16 @@ private:
57
63
  ResourceManager resourceManager;
58
64
  UIManager uiManager;
59
65
  ShaderManager shaderManager;
60
- InputManager inputManager;
61
66
  PerformanceManager& performanceManager;
62
67
 
68
+ InputSystem& inputSystem;
69
+
63
70
  const double seekDelta = 1.0; // 1 seconds seek
64
- const std::vector<double> playbackSpeeds = {0.1, 0.25, 0.5, 1.0, 1.5, 2.0, 5.0};
65
- size_t currentSpeedIndex = 1; // Start at normal speed (1.0)
66
71
 
67
- // void initializeInputHandlers();
72
+ void initializeInputSystem();
68
73
  void initializeKeyBindings();
69
- void onSelectionChanged(const void* data);
70
74
 
71
75
  private:
72
- void handlePanGesture(const SkPoint& delta);
73
- void handleZoomGesture(const SkPoint& center, float delta);
74
76
  void updateViewportForContent();
75
77
  void renderCanvasCursor(SkCanvas* canvas);
76
78
  void renderScreenCursor(SkCanvas* canvas);
@@ -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>
@@ -8,34 +8,34 @@
8
8
  <key>BinaryPath</key>
9
9
  <string>libsvg.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>libsvg.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>libsvg.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>libsvg.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.34",
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",