Monado OpenXR Runtime
org.freedesktop.monado.ipc.impl.hpp
Go to the documentation of this file.
1// Copyright 2020, Collabora, Ltd.
2// SPDX-License-Identifier: BSL-1.0
3/*!
4 * @file
5 * @brief Inline implementations for partially-generated wrapper for the
6 * `org.freedesktop.monado.ipc` Java package - do not include on its own!
7 * @author Rylie Pavlik <rylie.pavlik@collabora.com>
8 * @ingroup ipc_android
9 */
10
11#pragma once
12
13#include "wrap/android.content.h"
14#include "wrap/android.view.h"
15#include <string>
16
17namespace wrap {
18namespace org::freedesktop::monado::ipc {
19 inline IMonado
21 {
22 assert(!isNull());
23 return get(Meta::data().monado, object());
24 }
25
26 inline bool
28 {
29 assert(!isNull());
30 return get(Meta::data().failed, object());
31 }
32
33 inline Client
34 Client::construct(void *nativePointer)
35 {
36 return Client(Meta::data().clazz().newInstance(
37 Meta::data().init, static_cast<long long>(reinterpret_cast<intptr_t>(nativePointer))));
38 }
39
40 inline void
42 {
43 assert(!isNull());
44 return object().call<void>(Meta::data().markAsDiscardedByNative);
45 }
46
47 inline int32_t
48 Client::blockingConnect(android::content::Context const &context, std::string const &packageName)
49 {
50 assert(!isNull());
51 return object().call<int32_t>(Meta::data().blockingConnect, context.object(), packageName);
52 }
53 inline void
54 IMonado::passAppSurface(android::view::Surface const &surface)
55 {
56 assert(!isNull());
57 return object().call<void>(Meta::data().passAppSurface, surface.object());
58 }
59} // namespace org::freedesktop::monado::ipc
60} // namespace wrap
Wrapper for org.freedesktop.monado.ipc.Client objects.
Definition: org.freedesktop.monado.ipc.hpp:37
IMonado getMonado() const
Getter for the monado field value.
Definition: org.freedesktop.monado.ipc.impl.hpp:20
void markAsDiscardedByNative()
Wrapper for the markAsDiscardedByNative method.
Definition: org.freedesktop.monado.ipc.impl.hpp:41
bool getFailed() const
Getter for the failed field value.
Definition: org.freedesktop.monado.ipc.impl.hpp:27
int32_t blockingConnect(android::content::Context const &context, std::string const &packageName)
Wrapper for the blockingConnect method.
Definition: org.freedesktop.monado.ipc.impl.hpp:48
static Client construct(void *nativePointer)
Wrapper for a constructor.
Definition: org.freedesktop.monado.ipc.impl.hpp:34
void passAppSurface(android::view::Surface const &surface)
Wrapper for the passAppSurface method.
Definition: org.freedesktop.monado.ipc.impl.hpp:54
static Meta & data(jni::jclass clazz=nullptr)
Singleton accessor.
Definition: org.freedesktop.monado.ipc.hpp:138
static Meta & data()
Singleton accessor.
Definition: org.freedesktop.monado.ipc.hpp:185
static const cJSON * get(const cJSON *json, const char *f)
Less typing.
Definition: u_json.c:36