Monado OpenXR Runtime
org.freedesktop.monado.auxiliary.hpp
Go to the documentation of this file.
1// Copyright 2020-2021, Collabora, Ltd.
2// SPDX-License-Identifier: BSL-1.0
3/*!
4 * @file
5 * @brief Partially-generated wrapper for the
6 * `org.freedesktop.monado.auxiliary` Java package.
7 * @author Rylie Pavlik <rylie.pavlik@collabora.com>
8 * @ingroup aux_android
9 */
10
11#pragma once
12
13#include "wrap/ObjectWrapperBase.h"
14
15namespace wrap {
16namespace android::app {
17 class Activity;
18} // namespace android::app
19
20namespace android::content {
21 class Context;
22} // namespace android::content
23
24namespace android::view {
25 class SurfaceHolder;
26 class WindowManager_LayoutParams;
27} // namespace android::view
28
29namespace org::freedesktop::monado::auxiliary {
30 class MonadoView;
31} // namespace org::freedesktop::monado::auxiliary
32
33} // namespace wrap
34
35
36namespace wrap {
37namespace org::freedesktop::monado::auxiliary {
38 /*!
39 * Wrapper for org.freedesktop.monado.auxiliary.MonadoView objects.
40 */
42 {
43 public:
44 using ObjectWrapperBase::ObjectWrapperBase;
45 static constexpr const char *
46 getTypeName() noexcept
47 {
48 return "org/freedesktop/monado/auxiliary/MonadoView";
49 }
50
51 static constexpr const char *
52 getFullyQualifiedTypeName() noexcept
53 {
54 return "org.freedesktop.monado.auxiliary.MonadoView";
55 }
56
57 /*!
58 * Wrapper for the attachToWindow static method
59 *
60 * Java prototype:
61 * `public static org.freedesktop.monado.auxiliary.MonadoView attachToActivity(android.content.Context,
62 * long, android.view.WindowManager.LayoutParams);`
63 *
64 * JNI signature:
65 * (Landroid/content/Context;JLandroid/view/WindowManager$LayoutParams;)Lorg/freedesktop/monado/auxiliary/MonadoView;
66 *
67 */
68 static MonadoView
69 attachToWindow(android::content::Context const &displayContext,
70 void *nativePointer,
71 android::view::WindowManager_LayoutParams const &lp);
72
73 /*!
74 * Wrapper for the removeFromWindow static method
75 *
76 * Java prototype:
77 * `public static void removeFromWindow(android.content.Context,
78 * org.freedesktop.monado.auxiliary.MonadoView, int);`
79 *
80 * JNI signature: (Landroid/content/Context;Lorg/freedesktop/monado/auxiliary/MonadoView;I)V
81 *
82 */
83 static void
84 removeFromWindow(MonadoView const &view);
85
86 /*!
87 * Wrapper for the getDisplayMetrics static method
88 *
89 * Java prototype:
90 * `public static android.util.DisplayMetrics getDisplayMetrics(android.content.Context);`
91 *
92 * JNI signature: (Landroid/content/Context;)Landroid/util/DisplayMetrics;
93 *
94 */
95 static jni::Object
96 getDisplayMetrics(android::content::Context const &context);
97
98 /*!
99 * Wrapper for the getDisplayRefreshRate static method
100 *
101 * Java prototype:
102 * `public static float getDisplayRefreshRate(android.content.Context);`
103 *
104 * JNI signature: (Landroid/content/Context;)F;
105 *
106 */
107 static float
108 getDisplayRefreshRate(android::content::Context const &context);
109
110 /*!
111 * Wrapper for the getDisplayModeIdWidth static method
112 *
113 * Java prototype:
114 * `public static int getDisplayModeIdWidth(@NonNull final Context context, int display,
115 * int displayModeId);`
116 *
117 * JNI signature: (Landroid/content/Context;II)I;
118 *
119 */
120 static int32_t
121 getDisplayModeIdWidth(android::content::Context const &context,
122 int32_t displayId,
123 int32_t displayModeId);
124
125 /*!
126 * Wrapper for the getDisplayModeIdHeight static method
127 *
128 * Java prototype:
129 * `public static int getDisplayModeIdHeight(@NonNull final Context context, int display,
130 * int displayModeId);`
131 *
132 * JNI signature: (Landroid/content/Context;II)I;
133 *
134 */
135 static int32_t
136 getDisplayModeIdHeight(android::content::Context const &context,
137 int32_t displayId,
138 int32_t displayModeId);
139
140 /*!
141 * Wrapper for the getSupportedRefreshRates static method
142 *
143 * Java prototype:
144 * `public static float[] getSupportedRefreshRates(android.content.Context);`
145 *
146 * JNI signature: (Landroid/content/Context;)[F;
147 *
148 */
149 static std::vector<float>
150 getSupportedRefreshRates(android::content::Context const &context);
151
152 /*!
153 * Wrapper for the getNativePointer method
154 *
155 * Java prototype:
156 * `public long getNativePointer();`
157 *
158 * JNI signature: ()J
159 *
160 */
161 void *
163
164 /*!
165 * Wrapper for the markAsDiscardedByNative method
166 *
167 * Java prototype:
168 * `public void markAsDiscardedByNative();`
169 *
170 * JNI signature: ()V
171 *
172 */
173 void
175
176 /*!
177 * Wrapper for the waitGetSurfaceHolder method
178 *
179 * Java prototype:
180 * `public android.view.SurfaceHolder waitGetSurfaceHolder(int);`
181 *
182 * JNI signature: (I)Landroid/view/SurfaceHolder;
183 *
184 */
185 android::view::SurfaceHolder
186 waitGetSurfaceHolder(int32_t wait_ms);
187
188 /*!
189 * Initialize the static metadata of this wrapper with a known
190 * (non-null) Java class.
191 */
192 static void
193 staticInitClass(jni::jclass clazz)
194 {
195 Meta::data(clazz);
196 }
197
198 /*!
199 * Class metadata
200 */
201 struct Meta : public MetaBase
202 {
203 jni::method_t attachToWindow;
204 jni::method_t removeFromWindow;
205 jni::method_t getDisplayMetrics;
206 jni::method_t getDisplayRefreshRate;
207 jni::method_t getSupportedRefreshRates;
208 jni::method_t getNativePointer;
209 jni::method_t markAsDiscardedByNative;
210 jni::method_t waitGetSurfaceHolder;
211 jni::method_t getDisplayModeIdWidth;
212 jni::method_t getDisplayModeIdHeight;
213
214 /*!
215 * Singleton accessor
216 */
217 static Meta &
218 data(jni::jclass clazz = nullptr)
219 {
220 static Meta instance{clazz};
221 return instance;
222 }
223
224 private:
225 explicit Meta(jni::jclass clazz);
226 };
227 };
228
230 {
231 public:
232 using ObjectWrapperBase::ObjectWrapperBase;
233 static constexpr const char *
234 getTypeName() noexcept
235 {
236 return "org/freedesktop/monado/auxiliary/ActivityLifecycleListener";
237 }
238
239 static constexpr const char *
240 getFullyQualifiedTypeName() noexcept
241 {
242 return "org.freedesktop.monado.auxiliary.ActivityLifecycleListener";
243 }
244
245 /*!
246 * Initialize the static metadata of this wrapper with a known
247 * (non-null) Java class.
248 */
249 static void
250 staticInitClass(jni::jclass clazz)
251 {
252 Meta::data(clazz);
253 }
254
255 /*!
256 * Wrapper for a constructor
257 *
258 * Java prototype:
259 * `public org.freedesktop.monado.auxiliary.ActivityLifecycleListener(long);`
260 *
261 * JNI signature: (J)V
262 *
263 */
265 construct(void *nativePointer);
266
267 /*!
268 * Wrapper for the registerCallback method
269 *
270 * Java prototype:
271 * `public void registerCallback(android.app.Activity);`
272 *
273 * JNI signature: (Landroid/app/Activity;)V
274 *
275 */
276 void
277 registerCallback(android::app::Activity const &activity);
278
279 /*!
280 * Wrapper for the unregisterCallback method
281 *
282 * Java prototype:
283 * `public void unregisterCallback(android.app.Activity);`
284 *
285 * JNI signature: (Landroid/app/Activity;)V
286 *
287 */
288 void
289 unregisterCallback(android::app::Activity const &activity);
290
291 /*!
292 * Class metadata
293 */
294 struct Meta : public MetaBase
295 {
296 jni::method_t init;
297 jni::method_t registerCallback;
298 jni::method_t unregisterCallback;
299
300 /*!
301 * Singleton accessor
302 */
303 static Meta &
304 data(jni::jclass clazz = nullptr)
305 {
306 static Meta instance{clazz};
307 return instance;
308 }
309
310 private:
311 explicit Meta(jni::jclass clazz);
312 };
313 };
314
315} // namespace org::freedesktop::monado::auxiliary
316} // namespace wrap
317
Definition: context.hpp:57
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 void staticInitClass(jni::jclass clazz)
Initialize the static metadata of this wrapper with a known (non-null) Java class.
Definition: org.freedesktop.monado.auxiliary.hpp:250
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 void staticInitClass(jni::jclass clazz)
Initialize the static metadata of this wrapper with a known (non-null) Java class.
Definition: org.freedesktop.monado.auxiliary.hpp:193
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
Inline implementations for partially-generated wrapper for the org.freedesktop.monado....
Class metadata.
Definition: org.freedesktop.monado.auxiliary.hpp:295
static Meta & data(jni::jclass clazz=nullptr)
Singleton accessor.
Definition: org.freedesktop.monado.auxiliary.hpp:304
Class metadata.
Definition: org.freedesktop.monado.auxiliary.hpp:202
static Meta & data(jni::jclass clazz=nullptr)
Singleton accessor.
Definition: org.freedesktop.monado.auxiliary.hpp:218