mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2024-12-29 11:06:18 +00:00
external: Update android-jni-wrap, add Display.Mode
This commit is contained in:
parent
9dde11eff7
commit
f60c512cc9
|
@ -49,5 +49,12 @@ WindowManager_LayoutParams::Meta::Meta(bool deferDrop)
|
|||
MetaBaseDroppable::dropClassRef();
|
||||
}
|
||||
}
|
||||
Display_Mode::Meta::Meta() : MetaBaseDroppable(Display_Mode::getTypeName()),
|
||||
getModeId(classRef().getMethod("getModeId", "()I")),
|
||||
getPhysicalHeight(classRef().getMethod("getPhysicalHeight", "()I")),
|
||||
getPhysicalWidth(classRef().getMethod("getPhysicalWidth", "()I")),
|
||||
getRefreshRate(classRef().getMethod("getRefreshRate", "()F")) {
|
||||
MetaBaseDroppable::dropClassRef();
|
||||
}
|
||||
} // namespace android::view
|
||||
} // namespace wrap
|
||||
|
|
|
@ -343,6 +343,37 @@ public:
|
|||
};
|
||||
};
|
||||
|
||||
class Display_Mode : public ObjectWrapperBase {
|
||||
public:
|
||||
using ObjectWrapperBase::ObjectWrapperBase;
|
||||
static constexpr const char *getTypeName() noexcept {
|
||||
return "android/view/Display$Mode";
|
||||
}
|
||||
|
||||
int getModeId();
|
||||
|
||||
int getPhysicalHeight();
|
||||
|
||||
int getPhysicalWidth();
|
||||
|
||||
float getRefreshRate();
|
||||
|
||||
struct Meta : public MetaBaseDroppable {
|
||||
jni::method_t getModeId;
|
||||
jni::method_t getPhysicalHeight;
|
||||
jni::method_t getPhysicalWidth;
|
||||
jni::method_t getRefreshRate;
|
||||
|
||||
static Meta &data() {
|
||||
static Meta instance{};
|
||||
return instance;
|
||||
}
|
||||
|
||||
private:
|
||||
Meta();
|
||||
};
|
||||
};
|
||||
|
||||
} // namespace android::view
|
||||
} // namespace wrap
|
||||
#include "android.view.impl.h"
|
||||
|
|
|
@ -98,5 +98,25 @@ inline WindowManager_LayoutParams WindowManager_LayoutParams::construct(int32_t
|
|||
Meta::data().clazz().newInstance(Meta::data().init2, type, flags));
|
||||
}
|
||||
|
||||
inline int Display_Mode::getModeId() {
|
||||
assert(!isNull());
|
||||
return object().call<int>(Meta::data().getModeId);
|
||||
}
|
||||
|
||||
inline int Display_Mode::getPhysicalHeight() {
|
||||
assert(!isNull());
|
||||
return object().call<int>(Meta::data().getPhysicalHeight);
|
||||
}
|
||||
|
||||
inline int Display_Mode::getPhysicalWidth() {
|
||||
assert(!isNull());
|
||||
return object().call<int>(Meta::data().getPhysicalWidth);
|
||||
}
|
||||
|
||||
inline float Display_Mode::getRefreshRate() {
|
||||
assert(!isNull());
|
||||
return object().call<float>(Meta::data().getRefreshRate);
|
||||
}
|
||||
|
||||
} // namespace android::view
|
||||
} // namespace wrap
|
||||
|
|
Loading…
Reference in a new issue