-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathJHybridHapticsSpec.cpp
More file actions
58 lines (47 loc) · 2.27 KB
/
JHybridHapticsSpec.cpp
File metadata and controls
58 lines (47 loc) · 2.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
///
/// JHybridHapticsSpec.cpp
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
/// https://github.com/mrousavy/nitro
/// Copyright © 2025 Marc Rousavy @ Margelo
///
#include "JHybridHapticsSpec.hpp"
// Forward declaration of `ImpactFeedbackStyle` to properly resolve imports.
namespace margelo::nitro::haptics { enum class ImpactFeedbackStyle; }
// Forward declaration of `NotificationFeedbackType` to properly resolve imports.
namespace margelo::nitro::haptics { enum class NotificationFeedbackType; }
#include "ImpactFeedbackStyle.hpp"
#include "JImpactFeedbackStyle.hpp"
#include "NotificationFeedbackType.hpp"
#include "JNotificationFeedbackType.hpp"
namespace margelo::nitro::haptics {
jni::local_ref<JHybridHapticsSpec::jhybriddata> JHybridHapticsSpec::initHybrid(jni::alias_ref<jhybridobject> jThis) {
return makeCxxInstance(jThis);
}
void JHybridHapticsSpec::registerNatives() {
registerHybrid({
makeNativeMethod("initHybrid", JHybridHapticsSpec::initHybrid),
});
}
size_t JHybridHapticsSpec::getExternalMemorySize() noexcept {
static const auto method = _javaPart->getClass()->getMethod<jlong()>("getMemorySize");
return method(_javaPart);
}
// Properties
// Methods
void JHybridHapticsSpec::impact(ImpactFeedbackStyle style) {
static const auto method = _javaPart->getClass()->getMethod<void(jni::alias_ref<JImpactFeedbackStyle> /* style */)>("impact");
method(_javaPart, JImpactFeedbackStyle::fromCpp(style));
}
void JHybridHapticsSpec::notification(NotificationFeedbackType type) {
static const auto method = _javaPart->getClass()->getMethod<void(jni::alias_ref<JNotificationFeedbackType> /* type */)>("notification");
method(_javaPart, JNotificationFeedbackType::fromCpp(type));
}
void JHybridHapticsSpec::selection() {
static const auto method = _javaPart->getClass()->getMethod<void()>("selection");
method(_javaPart);
}
void JHybridHapticsSpec::impactWithIntensity(ImpactFeedbackStyle style, double intensity) {
static const auto method = _javaPart->getClass()->getMethod<void(jni::alias_ref<JImpactFeedbackStyle> /* style */, double /* intensity */)>("impactWithIntensity");
method(_javaPart, JImpactFeedbackStyle::fromCpp(style), intensity);
}
} // namespace margelo::nitro::haptics