The open source OpenXR runtime
1// Copyright 2020-2021, Collabora, Ltd.
2// SPDX-License-Identifier: BSL-1.0
3// Author: Rylie Pavlik <rylie.pavlik@collabora.com>
4
5#include "android.view.h"
6
7namespace wrap {
8namespace android::view {
9Display::Meta::Meta(bool deferDrop)
10 : MetaBaseDroppable(Display::getTypeName()),
11 DEFAULT_DISPLAY(classRef(), "DEFAULT_DISPLAY"),
12 getDisplayId(classRef().getMethod("getDisplayId", "()I")),
13 getName(classRef().getMethod("getName", "()Ljava/lang/String;")),
14 getDeviceProductInfo(classRef().getMethod(
15 "getDeviceProductInfo",
16 "()Landroid/hardware/display/DeviceProductInfo;")),
17 getRealSize(
18 classRef().getMethod("getRealSize", "(Landroid/graphics/Point;)V")),
19 getRealMetrics(classRef().getMethod("getRealMetrics",
20 "(Landroid/util/DisplayMetrics;)V")) {
21 if (!deferDrop) {
22 MetaBaseDroppable::dropClassRef();
23 }
24}
25Surface::Meta::Meta()
26 : MetaBaseDroppable(Surface::getTypeName()),
27 isValid(classRef().getMethod("isValid", "()Z")) {
28 MetaBaseDroppable::dropClassRef();
29}
30SurfaceHolder::Meta::Meta()
31 : MetaBaseDroppable(SurfaceHolder::getTypeName()),
32 getSurface(
33 classRef().getMethod("getSurface", "()Landroid/view/Surface;")) {
34 MetaBaseDroppable::dropClassRef();
35}
36WindowManager::Meta::Meta()
37 : MetaBaseDroppable(WindowManager::getTypeName()),
38 getDefaultDisplay(classRef().getMethod("getDefaultDisplay",
39 "()Landroid/view/Display;")) {
40 MetaBaseDroppable::dropClassRef();
41}
42WindowManager_LayoutParams::Meta::Meta()
43 : MetaBase(WindowManager_LayoutParams::getTypeName()),
44 FLAG_FULLSCREEN(classRef(), "FLAG_FULLSCREEN"),
45 FLAG_NOT_FOCUSABLE(classRef(), "FLAG_NOT_FOCUSABLE"),
46 FLAG_NOT_TOUCHABLE(classRef(), "FLAG_NOT_TOUCHABLE"),
47 TYPE_APPLICATION(classRef(), "TYPE_APPLICATION"),
48 TYPE_APPLICATION_OVERLAY(classRef(), "TYPE_APPLICATION_OVERLAY"),
49 init(classRef().getMethod("<init>", "()V")),
50 init1(classRef().getMethod("<init>", "(I)V")),
51 init2(classRef().getMethod("<init>", "(II)V")),
52 init4(classRef().getMethod("<init>", "(IIIII)V")),
53 setTitle(
54 classRef().getMethod("setTitle", "(Ljava/lang/CharSequence;)V")) {}
55Display_Mode::Meta::Meta() : MetaBaseDroppable(Display_Mode::getTypeName()),
56 getModeId(classRef().getMethod("getModeId", "()I")),
57 getPhysicalHeight(classRef().getMethod("getPhysicalHeight", "()I")),
58 getPhysicalWidth(classRef().getMethod("getPhysicalWidth", "()I")),
59 getRefreshRate(classRef().getMethod("getRefreshRate", "()F")) {
60 MetaBaseDroppable::dropClassRef();
61}
62} // namespace android::view
63} // namespace wrap