mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 20:17:34 +00:00
AK+Everywhere: Rename FlyString to DeprecatedFlyString
DeprecatedFlyString relies heavily on DeprecatedString's StringImpl, so let's rename it to A) match the name of DeprecatedString, B) write a new FlyString class that is tied to String.
This commit is contained in:
parent
2eacc7aec1
commit
f3db548a3d
316 changed files with 1177 additions and 1177 deletions
|
@ -8,7 +8,7 @@
|
|||
|
||||
namespace Web::UIEvents::EventNames {
|
||||
|
||||
#define __ENUMERATE_UI_EVENT(name) FlyString name;
|
||||
#define __ENUMERATE_UI_EVENT(name) DeprecatedFlyString name;
|
||||
ENUMERATE_UI_EVENTS
|
||||
#undef __ENUMERATE_UI_EVENT
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/FlyString.h>
|
||||
#include <AK/DeprecatedFlyString.h>
|
||||
|
||||
namespace Web::UIEvents::EventNames {
|
||||
|
||||
|
@ -29,7 +29,7 @@ namespace Web::UIEvents::EventNames {
|
|||
__ENUMERATE_UI_EVENT(resize) \
|
||||
__ENUMERATE_UI_EVENT(wheel)
|
||||
|
||||
#define __ENUMERATE_UI_EVENT(name) extern FlyString name;
|
||||
#define __ENUMERATE_UI_EVENT(name) extern DeprecatedFlyString name;
|
||||
ENUMERATE_UI_EVENTS
|
||||
#undef __ENUMERATE_UI_EVENT
|
||||
|
||||
|
|
|
@ -9,12 +9,12 @@
|
|||
|
||||
namespace Web::UIEvents {
|
||||
|
||||
FocusEvent* FocusEvent::construct_impl(JS::Realm& realm, FlyString const& event_name, FocusEventInit const& event_init)
|
||||
FocusEvent* FocusEvent::construct_impl(JS::Realm& realm, DeprecatedFlyString const& event_name, FocusEventInit const& event_init)
|
||||
{
|
||||
return realm.heap().allocate<FocusEvent>(realm, realm, event_name, event_init);
|
||||
}
|
||||
|
||||
FocusEvent::FocusEvent(JS::Realm& realm, FlyString const& event_name, FocusEventInit const& event_init)
|
||||
FocusEvent::FocusEvent(JS::Realm& realm, DeprecatedFlyString const& event_name, FocusEventInit const& event_init)
|
||||
: UIEvent(realm, event_name)
|
||||
{
|
||||
set_prototype(&Bindings::cached_web_prototype(realm, "FocusEvent"));
|
||||
|
|
|
@ -18,12 +18,12 @@ class FocusEvent final : public UIEvent {
|
|||
WEB_PLATFORM_OBJECT(FocusEvent, UIEvent);
|
||||
|
||||
public:
|
||||
static FocusEvent* construct_impl(JS::Realm&, FlyString const& event_name, FocusEventInit const& event_init);
|
||||
static FocusEvent* construct_impl(JS::Realm&, DeprecatedFlyString const& event_name, FocusEventInit const& event_init);
|
||||
|
||||
virtual ~FocusEvent() override;
|
||||
|
||||
private:
|
||||
FocusEvent(JS::Realm&, FlyString const& event_name, FocusEventInit const&);
|
||||
FocusEvent(JS::Realm&, DeprecatedFlyString const& event_name, FocusEventInit const&);
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -66,7 +66,7 @@ static unsigned long determine_key_code(KeyCode platform_key, u32 code_point)
|
|||
return platform_key;
|
||||
}
|
||||
|
||||
KeyboardEvent* KeyboardEvent::create_from_platform_event(JS::Realm& realm, FlyString const& event_name, KeyCode platform_key, unsigned modifiers, u32 code_point)
|
||||
KeyboardEvent* KeyboardEvent::create_from_platform_event(JS::Realm& realm, DeprecatedFlyString const& event_name, KeyCode platform_key, unsigned modifiers, u32 code_point)
|
||||
{
|
||||
// FIXME: Figure out what these should actually contain.
|
||||
DeprecatedString event_key = key_code_to_string(platform_key);
|
||||
|
@ -104,17 +104,17 @@ bool KeyboardEvent::get_modifier_state(DeprecatedString const& key_arg)
|
|||
return false;
|
||||
}
|
||||
|
||||
KeyboardEvent* KeyboardEvent::create(JS::Realm& realm, FlyString const& event_name, KeyboardEventInit const& event_init)
|
||||
KeyboardEvent* KeyboardEvent::create(JS::Realm& realm, DeprecatedFlyString const& event_name, KeyboardEventInit const& event_init)
|
||||
{
|
||||
return realm.heap().allocate<KeyboardEvent>(realm, realm, event_name, event_init);
|
||||
}
|
||||
|
||||
KeyboardEvent* KeyboardEvent::construct_impl(JS::Realm& realm, FlyString const& event_name, KeyboardEventInit const& event_init)
|
||||
KeyboardEvent* KeyboardEvent::construct_impl(JS::Realm& realm, DeprecatedFlyString const& event_name, KeyboardEventInit const& event_init)
|
||||
{
|
||||
return create(realm, event_name, event_init);
|
||||
}
|
||||
|
||||
KeyboardEvent::KeyboardEvent(JS::Realm& realm, FlyString const& event_name, KeyboardEventInit const& event_init)
|
||||
KeyboardEvent::KeyboardEvent(JS::Realm& realm, DeprecatedFlyString const& event_name, KeyboardEventInit const& event_init)
|
||||
: UIEvent(realm, event_name, event_init)
|
||||
, m_key(event_init.key)
|
||||
, m_code(event_init.code)
|
||||
|
|
|
@ -28,9 +28,9 @@ class KeyboardEvent final : public UIEvent {
|
|||
WEB_PLATFORM_OBJECT(KeyboardEvent, UIEvent);
|
||||
|
||||
public:
|
||||
static KeyboardEvent* create(JS::Realm&, FlyString const& event_name, KeyboardEventInit const& event_init = {});
|
||||
static KeyboardEvent* construct_impl(JS::Realm&, FlyString const& event_name, KeyboardEventInit const& event_init);
|
||||
static KeyboardEvent* create_from_platform_event(JS::Realm&, FlyString const& event_name, KeyCode, unsigned modifiers, u32 code_point);
|
||||
static KeyboardEvent* create(JS::Realm&, DeprecatedFlyString const& event_name, KeyboardEventInit const& event_init = {});
|
||||
static KeyboardEvent* construct_impl(JS::Realm&, DeprecatedFlyString const& event_name, KeyboardEventInit const& event_init);
|
||||
static KeyboardEvent* create_from_platform_event(JS::Realm&, DeprecatedFlyString const& event_name, KeyCode, unsigned modifiers, u32 code_point);
|
||||
|
||||
virtual ~KeyboardEvent() override;
|
||||
|
||||
|
@ -54,7 +54,7 @@ public:
|
|||
virtual u32 which() const override { return m_key_code; }
|
||||
|
||||
private:
|
||||
KeyboardEvent(JS::Realm&, FlyString const& event_name, KeyboardEventInit const& event_init);
|
||||
KeyboardEvent(JS::Realm&, DeprecatedFlyString const& event_name, KeyboardEventInit const& event_init);
|
||||
|
||||
DeprecatedString m_key;
|
||||
DeprecatedString m_code;
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
namespace Web::UIEvents {
|
||||
|
||||
MouseEvent::MouseEvent(JS::Realm& realm, FlyString const& event_name, MouseEventInit const& event_init)
|
||||
MouseEvent::MouseEvent(JS::Realm& realm, DeprecatedFlyString const& event_name, MouseEventInit const& event_init)
|
||||
: UIEvent(realm, event_name, event_init)
|
||||
, m_offset_x(event_init.offset_x)
|
||||
, m_offset_y(event_init.offset_y)
|
||||
|
@ -49,12 +49,12 @@ static i16 determine_button(unsigned mouse_button)
|
|||
}
|
||||
}
|
||||
|
||||
MouseEvent* MouseEvent::create(JS::Realm& realm, FlyString const& event_name, MouseEventInit const& event_init)
|
||||
MouseEvent* MouseEvent::create(JS::Realm& realm, DeprecatedFlyString const& event_name, MouseEventInit const& event_init)
|
||||
{
|
||||
return realm.heap().allocate<MouseEvent>(realm, realm, event_name, event_init);
|
||||
}
|
||||
|
||||
MouseEvent* MouseEvent::create_from_platform_event(JS::Realm& realm, FlyString const& event_name, CSSPixelPoint offset, CSSPixelPoint client_offset, CSSPixelPoint page_offset, unsigned buttons, unsigned mouse_button)
|
||||
MouseEvent* MouseEvent::create_from_platform_event(JS::Realm& realm, DeprecatedFlyString const& event_name, CSSPixelPoint offset, CSSPixelPoint client_offset, CSSPixelPoint page_offset, unsigned buttons, unsigned mouse_button)
|
||||
{
|
||||
MouseEventInit event_init {};
|
||||
event_init.offset_x = static_cast<double>(offset.x().value());
|
||||
|
|
|
@ -29,8 +29,8 @@ class MouseEvent : public UIEvent {
|
|||
WEB_PLATFORM_OBJECT(MouseEvent, UIEvent);
|
||||
|
||||
public:
|
||||
static MouseEvent* create(JS::Realm&, FlyString const& event_name, MouseEventInit const& event_init = {});
|
||||
static MouseEvent* create_from_platform_event(JS::Realm&, FlyString const& event_name, CSSPixelPoint offset, CSSPixelPoint client_offset, CSSPixelPoint page_offset, unsigned buttons, unsigned mouse_button = 1);
|
||||
static MouseEvent* create(JS::Realm&, DeprecatedFlyString const& event_name, MouseEventInit const& event_init = {});
|
||||
static MouseEvent* create_from_platform_event(JS::Realm&, DeprecatedFlyString const& event_name, CSSPixelPoint offset, CSSPixelPoint client_offset, CSSPixelPoint page_offset, unsigned buttons, unsigned mouse_button = 1);
|
||||
|
||||
virtual ~MouseEvent() override;
|
||||
|
||||
|
@ -56,7 +56,7 @@ public:
|
|||
virtual u32 which() const override { return m_button + 1; }
|
||||
|
||||
protected:
|
||||
MouseEvent(JS::Realm&, FlyString const& event_name, MouseEventInit const& event_init);
|
||||
MouseEvent(JS::Realm&, DeprecatedFlyString const& event_name, MouseEventInit const& event_init);
|
||||
|
||||
private:
|
||||
void set_event_characteristics();
|
||||
|
|
|
@ -9,23 +9,23 @@
|
|||
|
||||
namespace Web::UIEvents {
|
||||
|
||||
UIEvent* UIEvent::create(JS::Realm& realm, FlyString const& event_name)
|
||||
UIEvent* UIEvent::create(JS::Realm& realm, DeprecatedFlyString const& event_name)
|
||||
{
|
||||
return realm.heap().allocate<UIEvent>(realm, realm, event_name);
|
||||
}
|
||||
|
||||
UIEvent* UIEvent::construct_impl(JS::Realm& realm, FlyString const& event_name, UIEventInit const& event_init)
|
||||
UIEvent* UIEvent::construct_impl(JS::Realm& realm, DeprecatedFlyString const& event_name, UIEventInit const& event_init)
|
||||
{
|
||||
return realm.heap().allocate<UIEvent>(realm, realm, event_name, event_init);
|
||||
}
|
||||
|
||||
UIEvent::UIEvent(JS::Realm& realm, FlyString const& event_name)
|
||||
UIEvent::UIEvent(JS::Realm& realm, DeprecatedFlyString const& event_name)
|
||||
: Event(realm, event_name)
|
||||
{
|
||||
set_prototype(&Bindings::cached_web_prototype(realm, "UIEvent"));
|
||||
}
|
||||
|
||||
UIEvent::UIEvent(JS::Realm& realm, FlyString const& event_name, UIEventInit const& event_init)
|
||||
UIEvent::UIEvent(JS::Realm& realm, DeprecatedFlyString const& event_name, UIEventInit const& event_init)
|
||||
: Event(realm, event_name, event_init)
|
||||
, m_view(event_init.view)
|
||||
, m_detail(event_init.detail)
|
||||
|
|
|
@ -21,8 +21,8 @@ class UIEvent : public DOM::Event {
|
|||
WEB_PLATFORM_OBJECT(UIEvent, DOM::Event);
|
||||
|
||||
public:
|
||||
static UIEvent* create(JS::Realm&, FlyString const& type);
|
||||
static UIEvent* construct_impl(JS::Realm&, FlyString const& event_name, UIEventInit const& event_init);
|
||||
static UIEvent* create(JS::Realm&, DeprecatedFlyString const& type);
|
||||
static UIEvent* construct_impl(JS::Realm&, DeprecatedFlyString const& event_name, UIEventInit const& event_init);
|
||||
|
||||
virtual ~UIEvent() override;
|
||||
|
||||
|
@ -38,8 +38,8 @@ public:
|
|||
}
|
||||
|
||||
protected:
|
||||
UIEvent(JS::Realm&, FlyString const& event_name);
|
||||
UIEvent(JS::Realm&, FlyString const& event_name, UIEventInit const& event_init);
|
||||
UIEvent(JS::Realm&, DeprecatedFlyString const& event_name);
|
||||
UIEvent(JS::Realm&, DeprecatedFlyString const& event_name, UIEventInit const& event_init);
|
||||
|
||||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
namespace Web::UIEvents {
|
||||
|
||||
WheelEvent::WheelEvent(JS::Realm& realm, FlyString const& event_name, WheelEventInit const& event_init)
|
||||
WheelEvent::WheelEvent(JS::Realm& realm, DeprecatedFlyString const& event_name, WheelEventInit const& event_init)
|
||||
: MouseEvent(realm, event_name, event_init)
|
||||
, m_delta_x(event_init.delta_x)
|
||||
, m_delta_y(event_init.delta_y)
|
||||
|
@ -23,12 +23,12 @@ WheelEvent::WheelEvent(JS::Realm& realm, FlyString const& event_name, WheelEvent
|
|||
|
||||
WheelEvent::~WheelEvent() = default;
|
||||
|
||||
WheelEvent* WheelEvent::create(JS::Realm& realm, FlyString const& event_name, WheelEventInit const& event_init)
|
||||
WheelEvent* WheelEvent::create(JS::Realm& realm, DeprecatedFlyString const& event_name, WheelEventInit const& event_init)
|
||||
{
|
||||
return realm.heap().allocate<WheelEvent>(realm, realm, event_name, event_init);
|
||||
}
|
||||
|
||||
WheelEvent* WheelEvent::create_from_platform_event(JS::Realm& realm, FlyString const& event_name, CSSPixels offset_x, CSSPixels offset_y, CSSPixels client_x, CSSPixels client_y, double delta_x, double delta_y, unsigned buttons, unsigned button)
|
||||
WheelEvent* WheelEvent::create_from_platform_event(JS::Realm& realm, DeprecatedFlyString const& event_name, CSSPixels offset_x, CSSPixels offset_y, CSSPixels client_x, CSSPixels client_y, double delta_x, double delta_y, unsigned buttons, unsigned button)
|
||||
{
|
||||
WheelEventInit event_init {};
|
||||
event_init.offset_x = static_cast<double>(offset_x.value());
|
||||
|
|
|
@ -29,8 +29,8 @@ class WheelEvent final : public MouseEvent {
|
|||
WEB_PLATFORM_OBJECT(WheelEvent, MouseEvent);
|
||||
|
||||
public:
|
||||
static WheelEvent* create(JS::Realm&, FlyString const& event_name, WheelEventInit const& event_init = {});
|
||||
static WheelEvent* create_from_platform_event(JS::Realm&, FlyString const& event_name, CSSPixels offset_x, CSSPixels offset_y, CSSPixels client_x, CSSPixels client_y, double delta_x, double delta_y, unsigned buttons, unsigned button);
|
||||
static WheelEvent* create(JS::Realm&, DeprecatedFlyString const& event_name, WheelEventInit const& event_init = {});
|
||||
static WheelEvent* create_from_platform_event(JS::Realm&, DeprecatedFlyString const& event_name, CSSPixels offset_x, CSSPixels offset_y, CSSPixels client_x, CSSPixels client_y, double delta_x, double delta_y, unsigned buttons, unsigned button);
|
||||
|
||||
virtual ~WheelEvent() override;
|
||||
|
||||
|
@ -40,7 +40,7 @@ public:
|
|||
unsigned long delta_mode() const { return to_underlying(m_delta_mode); }
|
||||
|
||||
private:
|
||||
WheelEvent(JS::Realm&, FlyString const& event_name, WheelEventInit const& event_init);
|
||||
WheelEvent(JS::Realm&, DeprecatedFlyString const& event_name, WheelEventInit const& event_init);
|
||||
|
||||
void set_event_characteristics();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue