2020-10-28 16:37:06 +00:00
|
|
|
// Copyright 2020, Collabora, Ltd.
|
|
|
|
// SPDX-License-Identifier: BSL-1.0
|
|
|
|
/*!
|
|
|
|
* @file
|
|
|
|
* @brief Inline implementations for partially-generated wrapper for the
|
|
|
|
* `org.freedesktop.monado.auxiliary` Java package - do not include on its own!
|
|
|
|
* @author Ryan Pavlik <ryan.pavlik@collabora.com>
|
|
|
|
* @ingroup aux_android
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "wrap/android.app.h"
|
|
|
|
#include "wrap/android.view.h"
|
|
|
|
|
|
|
|
namespace wrap {
|
|
|
|
namespace org::freedesktop::monado::auxiliary {
|
|
|
|
inline MonadoView
|
2020-10-28 22:15:59 +00:00
|
|
|
MonadoView::attachToActivity(android::app::Activity const &activity,
|
|
|
|
void *nativePointer)
|
2020-10-28 16:37:06 +00:00
|
|
|
{
|
|
|
|
return MonadoView(Meta::data().clazz().call<jni::Object>(
|
2020-10-28 22:15:59 +00:00
|
|
|
Meta::data().attachToActivity, activity.object(),
|
|
|
|
static_cast<long long>(
|
|
|
|
reinterpret_cast<intptr_t>(nativePointer))));
|
2020-10-28 16:37:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
inline android::view::SurfaceHolder
|
|
|
|
MonadoView::waitGetSurfaceHolder(int32_t wait_ms)
|
|
|
|
{
|
|
|
|
assert(!isNull());
|
|
|
|
return android::view::SurfaceHolder(object().call<jni::Object>(
|
|
|
|
Meta::data().waitGetSurfaceHolder, wait_ms));
|
|
|
|
}
|
|
|
|
|
|
|
|
inline void
|
|
|
|
MonadoView::markAsDiscardedByNative()
|
|
|
|
{
|
|
|
|
assert(!isNull());
|
|
|
|
return object().call<void>(
|
|
|
|
Meta::data().markAsDiscardedByNative);
|
|
|
|
}
|
2020-11-27 14:42:11 +00:00
|
|
|
|
|
|
|
inline jni::Object
|
|
|
|
MonadoView::getDisplayMetrics(android::app::Activity const &activity)
|
|
|
|
{
|
|
|
|
return Meta::data().clazz().call<jni::Object>(
|
|
|
|
Meta::data().getDisplayMetrics, activity.object());
|
|
|
|
}
|
|
|
|
|
2020-10-28 16:37:06 +00:00
|
|
|
} // namespace org::freedesktop::monado::auxiliary
|
|
|
|
} // namespace wrap
|