mirror of
https://github.com/kunkundi/crossdesk.git
synced 2026-10-18 01:46:47 +08:00
[feat] add HarmonyOS desktop and mobile clients,issue #117
This commit is contained in:
@@ -116,7 +116,7 @@ struct CursorState {
|
||||
CursorHiddenReason hidden_reason;
|
||||
};
|
||||
|
||||
enum class HostPlatform { Unknown, Windows, MacOS, Linux, IOS, Android };
|
||||
enum class HostPlatform { Unknown, Windows, MacOS, Linux, IOS, Android, HarmonyOS };
|
||||
|
||||
const char* HostPlatformName(HostPlatform platform);
|
||||
HostPlatform ParseHostPlatform(const std::string& platform);
|
||||
|
||||
@@ -61,6 +61,7 @@ const char* HostPlatformName(HostPlatform platform) {
|
||||
case HostPlatform::Linux: return "linux";
|
||||
case HostPlatform::IOS: return "ios";
|
||||
case HostPlatform::Android: return "android";
|
||||
case HostPlatform::HarmonyOS: return "harmonyos";
|
||||
default: return "unknown";
|
||||
}
|
||||
}
|
||||
@@ -71,6 +72,7 @@ HostPlatform ParseHostPlatform(const std::string& platform) {
|
||||
if (platform == "linux") return HostPlatform::Linux;
|
||||
if (platform == "ios") return HostPlatform::IOS;
|
||||
if (platform == "android") return HostPlatform::Android;
|
||||
if (platform == "harmonyos") return HostPlatform::HarmonyOS;
|
||||
return HostPlatform::Unknown;
|
||||
}
|
||||
|
||||
|
||||
@@ -166,7 +166,7 @@ int main() {
|
||||
|
||||
// The platform is optional metadata, not a requirement for connecting.
|
||||
for (const auto& platform : std::vector<std::string>{
|
||||
"windows", "linux", "macos", "ios", "android", "unknown"}) {
|
||||
"windows", "linux", "macos", "ios", "android", "harmonyos", "unknown"}) {
|
||||
advertised = crossdesk::MakeHostInformation(
|
||||
"Host", {}, true, "1.5.3-20260928",
|
||||
crossdesk::ParseHostPlatform(platform));
|
||||
|
||||
Reference in New Issue
Block a user