The open source OpenXR runtime
at main 65 lines 1.4 kB view raw
1// Copyright 2020-2021, Collabora, Ltd. 2// SPDX-License-Identifier: BSL-1.0 3// Author: Rylie Pavlik <rylie.pavlik@collabora.com> 4 5#pragma once 6 7#include "ObjectWrapperBase.h" 8 9namespace wrap { 10namespace android::util { 11/*! 12 * Wrapper for android.util.DisplayMetrics objects. 13 */ 14class DisplayMetrics : public ObjectWrapperBase { 15 public: 16 using ObjectWrapperBase::ObjectWrapperBase; 17 static constexpr const char *getTypeName() noexcept { 18 return "android/util/DisplayMetrics"; 19 } 20 21 /*! 22 * Getter for the heightPixels field value 23 * 24 * Java prototype: 25 * `public int heightPixels;` 26 * 27 * JNI signature: I 28 * 29 */ 30 int32_t getHeightPixels() const; 31 32 /*! 33 * Getter for the widthPixels field value 34 * 35 * Java prototype: 36 * `public int widthPixels;` 37 * 38 * JNI signature: I 39 * 40 */ 41 int32_t getWidthPixels() const; 42 43 /*! 44 * Class metadata 45 */ 46 struct Meta : public MetaBaseDroppable { 47 impl::FieldId<int32_t> heightPixels; 48 impl::FieldId<int32_t> widthPixels; 49 50 /*! 51 * Singleton accessor 52 */ 53 static Meta &data() { 54 static Meta instance{}; 55 return instance; 56 } 57 58 private: 59 Meta(); 60 }; 61}; 62 63} // namespace android::util 64} // namespace wrap 65#include "android.util.impl.h"