File tree Expand file tree Collapse file tree 7 files changed +38
-0
lines changed Expand file tree Collapse file tree 7 files changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -29,4 +29,12 @@ std::shared_ptr<Choreographer> AndroidFilamentProxy::createChoreographer() {
29
29
return _proxy->cthis ()->createChoreographer ();
30
30
}
31
31
32
+ std::shared_ptr<react::CallInvoker> AndroidFilamentProxy::getCallInvoker () {
33
+ return _proxy->cthis ()->getCallInvoker ();
34
+ }
35
+
36
+ jsi::Runtime& AndroidFilamentProxy::getRuntime () {
37
+ return _proxy->cthis ()->getRuntime ();
38
+ }
39
+
32
40
} // namespace margelo
Original file line number Diff line number Diff line change @@ -27,6 +27,10 @@ class AndroidFilamentProxy : public FilamentProxy {
27
27
std::shared_ptr<FilamentView> findFilamentView (int id) override ;
28
28
std::shared_ptr<Choreographer> createChoreographer () override ;
29
29
30
+ public:
31
+ jsi::Runtime& getRuntime () override ;
32
+ std::shared_ptr<react::CallInvoker> getCallInvoker () override ;
33
+
30
34
private:
31
35
jni::global_ref<JFilamentProxy::javaobject> _proxy;
32
36
};
Original file line number Diff line number Diff line change @@ -49,6 +49,10 @@ jsi::Runtime& JFilamentProxy::getRuntime() {
49
49
return *_runtime;
50
50
}
51
51
52
+ std::shared_ptr<react::CallInvoker> JFilamentProxy::getCallInvoker () {
53
+ return _callInvoker;
54
+ }
55
+
52
56
void JFilamentProxy::registerNatives () {
53
57
registerHybrid ({makeNativeMethod (" initHybrid" , JFilamentProxy::initHybrid)});
54
58
}
Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ class JFilamentProxy : public jni::HybridClass<JFilamentProxy> {
29
29
std::shared_ptr<Choreographer> createChoreographer ();
30
30
31
31
jsi::Runtime& getRuntime ();
32
+ std::shared_ptr<react::CallInvoker> getCallInvoker ();
32
33
33
34
private:
34
35
friend HybridBase;
Original file line number Diff line number Diff line change 11
11
#include " FilamentView.h"
12
12
#include " jsi/HybridObject.h"
13
13
#include " test/TestHybridObject.h"
14
+ #include < ReactCommon/CallInvoker.h>
15
+ #include < jsi/jsi.h>
14
16
15
17
namespace margelo {
16
18
@@ -24,6 +26,10 @@ class FilamentProxy : public HybridObject {
24
26
25
27
std::shared_ptr<TestHybridObject> createTestObject ();
26
28
29
+ public:
30
+ virtual jsi::Runtime& getRuntime () = 0;
31
+ virtual std::shared_ptr<react::CallInvoker> getCallInvoker () = 0;
32
+
27
33
public:
28
34
void loadHybridMethods () override ;
29
35
};
Original file line number Diff line number Diff line change @@ -25,6 +25,9 @@ class AppleFilamentProxy : public FilamentProxy {
25
25
std::shared_ptr<FilamentView> findFilamentView (int modelId) override ;
26
26
std::shared_ptr<Choreographer> createChoreographer () override ;
27
27
28
+ jsi::Runtime& getRuntime () override ;
29
+ std::shared_ptr<react::CallInvoker> getCallInvoker () override ;
30
+
28
31
private:
29
32
jsi::Runtime* _runtime;
30
33
std::shared_ptr<react::CallInvoker> _callInvoker;
Original file line number Diff line number Diff line change 25
25
// TODO(hanno): cleanup here?
26
26
}
27
27
28
+ jsi::Runtime& AppleFilamentProxy::getRuntime () {
29
+ if (_runtime == nullptr ) {
30
+ [[unlikely]];
31
+ throw std::runtime_error (" JSI Runtime was null!" );
32
+ }
33
+ return *_runtime;
34
+ }
35
+
36
+ std::shared_ptr<react::CallInvoker> AppleFilamentProxy::getCallInvoker () {
37
+ return _callInvoker;
38
+ }
39
+
28
40
int AppleFilamentProxy::loadModel (std::string path) {
29
41
// TODO(hanno): Implement model loading here
30
42
return 13 ;
You can’t perform that action at this time.
0 commit comments