mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-07 21:59:54 +00:00
LibWeb+UI+WebContent: Pipe pinch events from AppKit UI to WebContent
This commit is contained in:
parent
e6831003c6
commit
c630de17ab
Notes:
github-actions[bot]
2025-10-10 13:39:44 +00:00
Author: https://github.com/kalenikaliaksandr
Commit: c630de17ab
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6430
Reviewed-by: https://github.com/gmta
Reviewed-by: https://github.com/konradekk
10 changed files with 86 additions and 1 deletions
|
|
@ -105,3 +105,19 @@ ErrorOr<Web::DragEvent> IPC::decode(Decoder& decoder)
|
|||
|
||||
return Web::DragEvent { type, position, screen_position, button, buttons, modifiers, move(files), nullptr };
|
||||
}
|
||||
|
||||
template<>
|
||||
WEB_API ErrorOr<void> IPC::encode(Encoder& encoder, Web::PinchEvent const& event)
|
||||
{
|
||||
TRY(encoder.encode(event.position));
|
||||
TRY(encoder.encode(event.scale_delta));
|
||||
return {};
|
||||
}
|
||||
|
||||
template<>
|
||||
WEB_API ErrorOr<Web::PinchEvent> IPC::decode(Decoder& decoder)
|
||||
{
|
||||
auto position = TRY(decoder.decode<Web::DevicePixelPoint>());
|
||||
auto scale_delta = TRY(decoder.decode<double>());
|
||||
return Web::PinchEvent { position, scale_delta };
|
||||
}
|
||||
|
|
|
|||
|
|
@ -85,7 +85,12 @@ struct WEB_API DragEvent {
|
|||
OwnPtr<BrowserInputData> browser_data;
|
||||
};
|
||||
|
||||
using InputEvent = Variant<KeyEvent, MouseEvent, DragEvent>;
|
||||
struct WEB_API PinchEvent {
|
||||
Web::DevicePixelPoint position;
|
||||
double scale_delta;
|
||||
};
|
||||
|
||||
using InputEvent = Variant<KeyEvent, MouseEvent, DragEvent, PinchEvent>;
|
||||
|
||||
struct QueuedInputEvent {
|
||||
u64 page_id { 0 };
|
||||
|
|
@ -115,4 +120,10 @@ WEB_API ErrorOr<void> encode(Encoder&, Web::DragEvent const&);
|
|||
template<>
|
||||
WEB_API ErrorOr<Web::DragEvent> decode(Decoder&);
|
||||
|
||||
template<>
|
||||
WEB_API ErrorOr<void> encode(Encoder&, Web::PinchEvent const&);
|
||||
|
||||
template<>
|
||||
WEB_API ErrorOr<Web::PinchEvent> decode(Decoder&);
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue