The open source OpenXR runtime
at main 60 lines 1.5 kB view raw
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 20 Client::getMonado() const 21 { 22 assert(!isNull()); 23 return get(Meta::data().monado, object()); 24 } 25 26 inline bool 27 Client::getFailed() const 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 41 Client::markAsDiscardedByNative() 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