mirror of
https://github.com/RGBCube/serenity
synced 2025-05-19 05:55:07 +00:00

SPDX License Identifiers are a more compact / standardized way of representing file license information. See: https://spdx.dev/resources/use/#identifiers This was done with the `ambr` search and replace tool. ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
36 lines
865 B
C++
36 lines
865 B
C++
/*
|
|
* Copyright (c) 2020, the SerenityOS developers.
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#include <LibWeb/HTML/EventNames.h>
|
|
#include <LibWeb/UIEvents/EventNames.h>
|
|
#include <LibWeb/UIEvents/MouseEvent.h>
|
|
|
|
namespace Web::UIEvents {
|
|
|
|
MouseEvent::MouseEvent(const FlyString& event_name, i32 offset_x, i32 offset_y, i32 client_x, i32 client_y)
|
|
: UIEvent(event_name)
|
|
, m_offset_x(offset_x)
|
|
, m_offset_y(offset_y)
|
|
, m_client_x(client_x)
|
|
, m_client_y(client_y)
|
|
{
|
|
set_event_characteristics();
|
|
}
|
|
|
|
MouseEvent::~MouseEvent()
|
|
{
|
|
}
|
|
|
|
void MouseEvent::set_event_characteristics()
|
|
{
|
|
if (type().is_one_of(EventNames::mousedown, EventNames::mousemove, EventNames::mouseout, EventNames::mouseover, EventNames::mouseup, HTML::EventNames::click)) {
|
|
set_bubbles(true);
|
|
set_cancelable(true);
|
|
set_composed(true);
|
|
}
|
|
}
|
|
|
|
}
|