网页升级
This commit is contained in:
@@ -184,8 +184,8 @@ std::optional<Web_Event> Web_Event_Adapter::decode(std::string_view message) {
|
||||
const auto height = finite_number(root, "height");
|
||||
if (!width || !height)
|
||||
return std::nullopt;
|
||||
return Viewport_Resize{{std::clamp(static_cast<int>(*width), 240, 1920),
|
||||
std::clamp(static_cast<int>(*height), 180, 1200)}};
|
||||
return Viewport_Resize{{static_cast<int>(std::clamp(*width, 240.0, 1920.0)),
|
||||
static_cast<int>(std::clamp(*height, 180.0, 1200.0))}};
|
||||
}
|
||||
if (type == "show")
|
||||
return Event(Event_Type::Show);
|
||||
@@ -207,6 +207,16 @@ std::optional<Web_Event> Web_Event_Adapter::decode(std::string_view message) {
|
||||
return key_event(root, Event_Type::Key_Release);
|
||||
if (type == "control")
|
||||
return control_event(root);
|
||||
if (type == "gallery_catalog")
|
||||
return Gallery_Request{Gallery_Request_Kind::Catalog, std::string(message)};
|
||||
if (type == "gallery_open")
|
||||
return Gallery_Request{Gallery_Request_Kind::Open, std::string(message)};
|
||||
if (type == "gallery_patch")
|
||||
return Gallery_Request{Gallery_Request_Kind::Patch, std::string(message)};
|
||||
if (type == "gallery_action")
|
||||
return Gallery_Request{Gallery_Request_Kind::Action, std::string(message)};
|
||||
if (type == "gallery_observe")
|
||||
return Gallery_Request{Gallery_Request_Kind::Observe, std::string(message)};
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user