The window now extends into the display cutout and the top bars sit at the top edge with the gap fixed at the screen center. Top buttons are at most 0.8 of the bottom bar buttons. The cutout query is removed again.
50 lines
1.2 KiB
C++
50 lines
1.2 KiB
C++
#pragma once
|
|
|
|
#include "Vec.hpp"
|
|
|
|
#include <string>
|
|
|
|
namespace tp {
|
|
|
|
enum class OperatingSystem { Linux, Android, Windows, MacOS, IOS, Unknown };
|
|
|
|
enum class FormFactor { Desktop, Tablet, Phone, Unknown };
|
|
|
|
struct EdgeInsets {
|
|
halnf left = 0;
|
|
halnf top = 0;
|
|
halnf right = 0;
|
|
halnf bottom = 0;
|
|
|
|
[[nodiscard]] bool operator==(const EdgeInsets& other) const = default;
|
|
};
|
|
|
|
struct PlatformInfo {
|
|
OperatingSystem system = OperatingSystem::Unknown;
|
|
FormFactor formFactor = FormFactor::Unknown;
|
|
std::string systemVersion;
|
|
std::string deviceName;
|
|
|
|
halnf contentScale = 1;
|
|
Vec2F screenSize = { 0, 0 };
|
|
EdgeInsets safeInsets;
|
|
|
|
bool hasMouse = false;
|
|
bool hasTouch = false;
|
|
bool hasPen = false;
|
|
bool hasPhysicalKeyboard = false;
|
|
|
|
bool hasWindowControls = false;
|
|
bool canMoveWindow = false;
|
|
bool canResizeWindow = false;
|
|
bool hasHoverPointer = false;
|
|
|
|
[[nodiscard]] bool isTouchFirst() const {
|
|
return formFactor == FormFactor::Tablet || formFactor == FormFactor::Phone;
|
|
}
|
|
};
|
|
|
|
[[nodiscard]] const char* toString(OperatingSystem system);
|
|
[[nodiscard]] const char* toString(FormFactor formFactor);
|
|
[[nodiscard]] std::string describe(const PlatformInfo& info);
|
|
}
|