The open source OpenXR runtime
at main 136 lines 3.2 kB view raw
1// Copyright 2022-2023, Qualcomm Innovation Center, Inc. 2// SPDX-License-Identifier: BSL-1.0 3// Author: Jarvis Huang 4 5#pragma once 6 7#include "ObjectWrapperBase.h" 8#include <string> 9 10namespace wrap { 11namespace android::view { 12class Display; 13} // namespace android::view 14} // namespace wrap 15 16namespace wrap { 17namespace android::hardware::display { 18/*! 19 * Wrapper for android.hardware.display.DisplayManager objects. 20 */ 21class DisplayManager : public ObjectWrapperBase { 22 public: 23 using ObjectWrapperBase::ObjectWrapperBase; 24 static constexpr const char *getTypeName() noexcept { 25 return "android/hardware/display/DisplayManager"; 26 } 27 28 /*! 29 * Getter for the DISPLAY_CATEGORY_PRESENTATION static field value 30 * 31 * Java prototype: 32 * `public static final java.lang.String DISPLAY_CATEGORY_PRESENTATION;` 33 * 34 * JNI signature: Ljava/lang/String; 35 * 36 */ 37 static std::string DISPLAY_CATEGORY_PRESENTATION(); 38 39 /*! 40 * Wrapper for the getDisplay method 41 * 42 * Java prototype: 43 * `public android.view.Display getDisplay(int);` 44 * 45 * JNI signature: (I)Landroid/view/Display; 46 * 47 */ 48 view::Display getDisplay(int32_t displayId) const; 49 50 /*! 51 * Wrapper for the getDisplays method 52 * 53 * Java prototype: 54 * `public android.view.Display[] getDisplays();` 55 * 56 * JNI signature: ()[Landroid/view/Display; 57 * 58 */ 59 jni::Array<jni::Object> getDisplays() const; 60 61 /*! 62 * Wrapper for the getDisplays method 63 * 64 * Java prototype: 65 * `public android.view.Display[] getDisplays(java.lang.String);` 66 * 67 * JNI signature: (Ljava/lang/String;)[Landroid/view/Display; 68 * 69 */ 70 jni::Array<jni::Object> getDisplays(std::string const &category); 71 72 /*! 73 * Class metadata 74 */ 75 struct Meta : public MetaBaseDroppable { 76 impl::StaticFieldId<std::string> DISPLAY_CATEGORY_PRESENTATION; 77 jni::method_t getDisplay; 78 jni::method_t getDisplays; 79 jni::method_t getDisplays1; 80 81 /*! 82 * Singleton accessor 83 */ 84 static Meta &data(bool deferDrop = false) { 85 static Meta instance{deferDrop}; 86 return instance; 87 } 88 89 private: 90 explicit Meta(bool deferDrop); 91 }; 92}; 93 94/*! 95 * Wrapper for android.hardware.display.DeviceProductInfo objects. 96 */ 97class DeviceProductInfo : public ObjectWrapperBase { 98 public: 99 using ObjectWrapperBase::ObjectWrapperBase; 100 static constexpr const char *getTypeName() noexcept { 101 return "android/hardware/display/DeviceProductInfo"; 102 } 103 104 /*! 105 * Wrapper for the getName method 106 * 107 * Java prototype: 108 * `public java.lang.String getName();` 109 * 110 * JNI signature: ()Ljava/lang/String; 111 * 112 */ 113 std::string getName() const; 114 115 /*! 116 * Class metadata 117 */ 118 struct Meta : public MetaBaseDroppable { 119 jni::method_t getName; 120 121 /*! 122 * Singleton accessor 123 */ 124 static Meta &data() { 125 static Meta instance{}; 126 return instance; 127 } 128 129 private: 130 Meta(); 131 }; 132}; 133 134} // namespace android::hardware::display 135} // namespace wrap 136#include "android.hardware.display.impl.h"