-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add support for
*.nitro.tsx
extension
- Loading branch information
1 parent
1b97dc7
commit cd99907
Showing
20 changed files
with
495 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
...ages/react-native-nitro-image/nitrogen/generated/android/c++/JHybridTestObjectTSXSpec.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/// | ||
/// JHybridTestObjectTSXSpec.cpp | ||
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. | ||
/// https://github.com/mrousavy/nitro | ||
/// Copyright © 2025 Marc Rousavy @ Margelo | ||
/// | ||
|
||
#include "JHybridTestObjectTSXSpec.hpp" | ||
|
||
|
||
|
||
|
||
|
||
namespace margelo::nitro::image { | ||
|
||
jni::local_ref<JHybridTestObjectTSXSpec::jhybriddata> JHybridTestObjectTSXSpec::initHybrid(jni::alias_ref<jhybridobject> jThis) { | ||
return makeCxxInstance(jThis); | ||
} | ||
|
||
void JHybridTestObjectTSXSpec::registerNatives() { | ||
registerHybrid({ | ||
makeNativeMethod("initHybrid", JHybridTestObjectTSXSpec::initHybrid), | ||
}); | ||
} | ||
|
||
size_t JHybridTestObjectTSXSpec::getExternalMemorySize() noexcept { | ||
static const auto method = _javaPart->getClass()->getMethod<jlong()>("getMemorySize"); | ||
return method(_javaPart); | ||
} | ||
|
||
// Properties | ||
double JHybridTestObjectTSXSpec::getTestValue() { | ||
static const auto method = _javaPart->getClass()->getMethod<double()>("getTestValue"); | ||
auto __result = method(_javaPart); | ||
return __result; | ||
} | ||
|
||
// Methods | ||
|
||
|
||
} // namespace margelo::nitro::image |
62 changes: 62 additions & 0 deletions
62
...ages/react-native-nitro-image/nitrogen/generated/android/c++/JHybridTestObjectTSXSpec.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/// | ||
/// HybridTestObjectTSXSpec.hpp | ||
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. | ||
/// https://github.com/mrousavy/nitro | ||
/// Copyright © 2025 Marc Rousavy @ Margelo | ||
/// | ||
|
||
#pragma once | ||
|
||
#include <NitroModules/JHybridObject.hpp> | ||
#include <fbjni/fbjni.h> | ||
#include "HybridTestObjectTSXSpec.hpp" | ||
|
||
|
||
|
||
|
||
namespace margelo::nitro::image { | ||
|
||
using namespace facebook; | ||
|
||
class JHybridTestObjectTSXSpec: public jni::HybridClass<JHybridTestObjectTSXSpec, JHybridObject>, | ||
public virtual HybridTestObjectTSXSpec { | ||
public: | ||
static auto constexpr kJavaDescriptor = "Lcom/margelo/nitro/image/HybridTestObjectTSXSpec;"; | ||
static jni::local_ref<jhybriddata> initHybrid(jni::alias_ref<jhybridobject> jThis); | ||
static void registerNatives(); | ||
|
||
protected: | ||
// C++ constructor (called from Java via `initHybrid()`) | ||
explicit JHybridTestObjectTSXSpec(jni::alias_ref<jhybridobject> jThis) : | ||
HybridObject(HybridTestObjectTSXSpec::TAG), | ||
_javaPart(jni::make_global(jThis)) {} | ||
|
||
public: | ||
~JHybridTestObjectTSXSpec() override { | ||
// Hermes GC can destroy JS objects on a non-JNI Thread. | ||
jni::ThreadScope::WithClassLoader([&] { _javaPart.reset(); }); | ||
} | ||
|
||
public: | ||
size_t getExternalMemorySize() noexcept override; | ||
|
||
public: | ||
inline const jni::global_ref<JHybridTestObjectTSXSpec::javaobject>& getJavaPart() const noexcept { | ||
return _javaPart; | ||
} | ||
|
||
public: | ||
// Properties | ||
double getTestValue() override; | ||
|
||
public: | ||
// Methods | ||
|
||
|
||
private: | ||
friend HybridBase; | ||
using HybridBase::HybridBase; | ||
jni::global_ref<JHybridTestObjectTSXSpec::javaobject> _javaPart; | ||
}; | ||
|
||
} // namespace margelo::nitro::image |
52 changes: 52 additions & 0 deletions
52
...mage/nitrogen/generated/android/kotlin/com/margelo/nitro/image/HybridTestObjectTSXSpec.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/// | ||
/// HybridTestObjectTSXSpec.kt | ||
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. | ||
/// https://github.com/mrousavy/nitro | ||
/// Copyright © 2025 Marc Rousavy @ Margelo | ||
/// | ||
|
||
package com.margelo.nitro.image | ||
|
||
import androidx.annotation.Keep | ||
import com.facebook.jni.HybridData | ||
import com.facebook.proguard.annotations.DoNotStrip | ||
import com.margelo.nitro.core.* | ||
|
||
/** | ||
* A Kotlin class representing the TestObjectTSX HybridObject. | ||
* Implement this abstract class to create Kotlin-based instances of TestObjectTSX. | ||
*/ | ||
@DoNotStrip | ||
@Keep | ||
@Suppress( | ||
"KotlinJniMissingFunction", "unused", | ||
"RedundantSuppression", "RedundantUnitReturnType", "SimpleRedundantLet", | ||
"LocalVariableName", "PropertyName", "PrivatePropertyName", "FunctionName" | ||
) | ||
abstract class HybridTestObjectTSXSpec: HybridObject() { | ||
@DoNotStrip | ||
private var mHybridData: HybridData = initHybrid() | ||
|
||
init { | ||
super.updateNative(mHybridData) | ||
} | ||
|
||
override fun updateNative(hybridData: HybridData) { | ||
mHybridData = hybridData | ||
super.updateNative(hybridData) | ||
} | ||
|
||
// Properties | ||
@get:DoNotStrip | ||
@get:Keep | ||
abstract val testValue: Double | ||
|
||
// Methods | ||
|
||
|
||
private external fun initHybrid(): HybridData | ||
|
||
companion object { | ||
private const val TAG = "HybridTestObjectTSXSpec" | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
...ages/react-native-nitro-image/nitrogen/generated/ios/c++/HybridTestObjectTSXSpecSwift.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/// | ||
/// HybridTestObjectTSXSpecSwift.cpp | ||
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. | ||
/// https://github.com/mrousavy/nitro | ||
/// Copyright © 2025 Marc Rousavy @ Margelo | ||
/// | ||
|
||
#include "HybridTestObjectTSXSpecSwift.hpp" | ||
|
||
namespace margelo::nitro::image { | ||
} // namespace margelo::nitro::image |
66 changes: 66 additions & 0 deletions
66
...ages/react-native-nitro-image/nitrogen/generated/ios/c++/HybridTestObjectTSXSpecSwift.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
/// | ||
/// HybridTestObjectTSXSpecSwift.hpp | ||
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE. | ||
/// https://github.com/mrousavy/nitro | ||
/// Copyright © 2025 Marc Rousavy @ Margelo | ||
/// | ||
|
||
#pragma once | ||
|
||
#include "HybridTestObjectTSXSpec.hpp" | ||
|
||
// Forward declaration of `HybridTestObjectTSXSpec_cxx` to properly resolve imports. | ||
namespace NitroImage { class HybridTestObjectTSXSpec_cxx; } | ||
|
||
|
||
|
||
|
||
|
||
#include "NitroImage-Swift-Cxx-Umbrella.hpp" | ||
|
||
namespace margelo::nitro::image { | ||
|
||
/** | ||
* The C++ part of HybridTestObjectTSXSpec_cxx.swift. | ||
* | ||
* HybridTestObjectTSXSpecSwift (C++) accesses HybridTestObjectTSXSpec_cxx (Swift), and might | ||
* contain some additional bridging code for C++ <> Swift interop. | ||
* | ||
* Since this obviously introduces an overhead, I hope at some point in | ||
* the future, HybridTestObjectTSXSpec_cxx can directly inherit from the C++ class HybridTestObjectTSXSpec | ||
* to simplify the whole structure and memory management. | ||
*/ | ||
class HybridTestObjectTSXSpecSwift: public virtual HybridTestObjectTSXSpec { | ||
public: | ||
// Constructor from a Swift instance | ||
explicit HybridTestObjectTSXSpecSwift(const NitroImage::HybridTestObjectTSXSpec_cxx& swiftPart): | ||
HybridObject(HybridTestObjectTSXSpec::TAG), | ||
_swiftPart(swiftPart) { } | ||
|
||
public: | ||
// Get the Swift part | ||
inline NitroImage::HybridTestObjectTSXSpec_cxx& getSwiftPart() noexcept { | ||
return _swiftPart; | ||
} | ||
|
||
public: | ||
// Get memory pressure | ||
inline size_t getExternalMemorySize() noexcept override { | ||
return _swiftPart.getMemorySize(); | ||
} | ||
|
||
public: | ||
// Properties | ||
inline double getTestValue() noexcept override { | ||
return _swiftPart.getTestValue(); | ||
} | ||
|
||
public: | ||
// Methods | ||
|
||
|
||
private: | ||
NitroImage::HybridTestObjectTSXSpec_cxx _swiftPart; | ||
}; | ||
|
||
} // namespace margelo::nitro::image |
Oops, something went wrong.