13#include "wrap/android.app.h"
14#include "wrap/android.content.h"
15#include "wrap/android.view.h"
20namespace org::freedesktop::monado::auxiliary {
24 wrap::android::view::WindowManager_LayoutParams
const &lp)
26 return MonadoView(
Meta::data().clazz().call<jni::Object>(
28 static_cast<long long>(
reinterpret_cast<uintptr_t
>(nativePointer)), lp.object()));
52 int32_t displayModeId)
54 return Meta::data().clazz().call<int32_t>(
Meta::data().getDisplayModeIdWidth, displayContext.object(),
55 displayId, displayModeId);
61 int32_t displayModeId)
63 return Meta::data().clazz().call<int32_t>(
Meta::data().getDisplayModeIdHeight, displayContext.object(),
64 displayId, displayModeId);
67 inline std::vector<float>
70 jni::Object refreshRateArray =
72 jfloat *refreshRates =
73 (jfloat *)jni::env()->GetFloatArrayElements((jfloatArray)refreshRateArray.getHandle(), 0);
74 jsize length = jni::env()->GetArrayLength((jfloatArray)refreshRateArray.getHandle());
75 std::vector<float> refreshRateVector;
76 for (
int i = 0; i < length; i++) {
77 refreshRateVector.push_back(refreshRates[i]);
79 return refreshRateVector;
86 return reinterpret_cast<void *
>(
87 static_cast<intptr_t
>(object().call<
long long>(
Meta::data().getNativePointer)));
94 return object().call<
void>(
Meta::data().markAsDiscardedByNative);
97 inline android::view::SurfaceHolder
101 return android::view::SurfaceHolder(
109 Meta::data().init,
static_cast<long long>(
reinterpret_cast<uintptr_t
>(nativePointer))));
115 object().call<
void>(
Meta::data().registerCallback, activity.object());
121 object().call<
void>(
Meta::data().unregisterCallback, activity.object());
Definition: org.freedesktop.monado.auxiliary.hpp:230
void registerCallback(android::app::Activity const &activity)
Wrapper for the registerCallback method.
Definition: org.freedesktop.monado.auxiliary.impl.hpp:113
static ActivityLifecycleListener construct(void *nativePointer)
Wrapper for a constructor.
Definition: org.freedesktop.monado.auxiliary.impl.hpp:106
void unregisterCallback(android::app::Activity const &activity)
Wrapper for the unregisterCallback method.
Definition: org.freedesktop.monado.auxiliary.impl.hpp:119
Wrapper for org.freedesktop.monado.auxiliary.MonadoView objects.
Definition: org.freedesktop.monado.auxiliary.hpp:42
static void removeFromWindow(MonadoView const &view)
Wrapper for the removeFromWindow static method.
Definition: org.freedesktop.monado.auxiliary.impl.hpp:32
void markAsDiscardedByNative()
Wrapper for the markAsDiscardedByNative method.
Definition: org.freedesktop.monado.auxiliary.impl.hpp:91
static float getDisplayRefreshRate(android::content::Context const &context)
Wrapper for the getDisplayRefreshRate static method.
Definition: org.freedesktop.monado.auxiliary.impl.hpp:44
static int32_t getDisplayModeIdHeight(android::content::Context const &context, int32_t displayId, int32_t displayModeId)
Wrapper for the getDisplayModeIdHeight static method.
Definition: org.freedesktop.monado.auxiliary.impl.hpp:59
static int32_t getDisplayModeIdWidth(android::content::Context const &context, int32_t displayId, int32_t displayModeId)
Wrapper for the getDisplayModeIdWidth static method.
Definition: org.freedesktop.monado.auxiliary.impl.hpp:50
android::view::SurfaceHolder waitGetSurfaceHolder(int32_t wait_ms)
Wrapper for the waitGetSurfaceHolder method.
Definition: org.freedesktop.monado.auxiliary.impl.hpp:98
static MonadoView attachToWindow(android::content::Context const &displayContext, void *nativePointer, android::view::WindowManager_LayoutParams const &lp)
Wrapper for the attachToWindow static method.
static std::vector< float > getSupportedRefreshRates(android::content::Context const &context)
Wrapper for the getSupportedRefreshRates static method.
Definition: org.freedesktop.monado.auxiliary.impl.hpp:68
static jni::Object getDisplayMetrics(android::content::Context const &context)
Wrapper for the getDisplayMetrics static method.
Definition: org.freedesktop.monado.auxiliary.impl.hpp:38
void * getNativePointer()
Wrapper for the getNativePointer method.
Definition: org.freedesktop.monado.auxiliary.impl.hpp:83