mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:47:44 +00:00
LibGfx: Rename Rect,Point,Size => IntRect,IntPoint,IntSize
This fits nicer with FloatRect,FloatPoint,FloatSize and gives a much better visual clue about what type of metric is being used.
This commit is contained in:
parent
656b01eb0f
commit
116cf92156
212 changed files with 1144 additions and 1144 deletions
|
@ -111,7 +111,7 @@ public:
|
|||
|
||||
class WMWindowStateChangedEvent : public WMEvent {
|
||||
public:
|
||||
WMWindowStateChangedEvent(int client_id, int window_id, const StringView& title, const Gfx::Rect& rect, bool is_active, WindowType window_type, bool is_minimized, bool is_frameless, int progress)
|
||||
WMWindowStateChangedEvent(int client_id, int window_id, const StringView& title, const Gfx::IntRect& rect, bool is_active, WindowType window_type, bool is_minimized, bool is_frameless, int progress)
|
||||
: WMEvent(Event::Type::WM_WindowStateChanged, client_id, window_id)
|
||||
, m_title(title)
|
||||
, m_rect(rect)
|
||||
|
@ -124,7 +124,7 @@ public:
|
|||
}
|
||||
|
||||
String title() const { return m_title; }
|
||||
Gfx::Rect rect() const { return m_rect; }
|
||||
Gfx::IntRect rect() const { return m_rect; }
|
||||
bool is_active() const { return m_active; }
|
||||
WindowType window_type() const { return m_window_type; }
|
||||
bool is_minimized() const { return m_minimized; }
|
||||
|
@ -133,7 +133,7 @@ public:
|
|||
|
||||
private:
|
||||
String m_title;
|
||||
Gfx::Rect m_rect;
|
||||
Gfx::IntRect m_rect;
|
||||
WindowType m_window_type;
|
||||
bool m_active;
|
||||
bool m_minimized;
|
||||
|
@ -143,21 +143,21 @@ private:
|
|||
|
||||
class WMWindowRectChangedEvent : public WMEvent {
|
||||
public:
|
||||
WMWindowRectChangedEvent(int client_id, int window_id, const Gfx::Rect& rect)
|
||||
WMWindowRectChangedEvent(int client_id, int window_id, const Gfx::IntRect& rect)
|
||||
: WMEvent(Event::Type::WM_WindowRectChanged, client_id, window_id)
|
||||
, m_rect(rect)
|
||||
{
|
||||
}
|
||||
|
||||
Gfx::Rect rect() const { return m_rect; }
|
||||
Gfx::IntRect rect() const { return m_rect; }
|
||||
|
||||
private:
|
||||
Gfx::Rect m_rect;
|
||||
Gfx::IntRect m_rect;
|
||||
};
|
||||
|
||||
class WMWindowIconBitmapChangedEvent : public WMEvent {
|
||||
public:
|
||||
WMWindowIconBitmapChangedEvent(int client_id, int window_id, int icon_buffer_id, const Gfx::Size& icon_size)
|
||||
WMWindowIconBitmapChangedEvent(int client_id, int window_id, int icon_buffer_id, const Gfx::IntSize& icon_size)
|
||||
: WMEvent(Event::Type::WM_WindowIconBitmapChanged, client_id, window_id)
|
||||
, m_icon_buffer_id(icon_buffer_id)
|
||||
, m_icon_size(icon_size)
|
||||
|
@ -165,79 +165,79 @@ public:
|
|||
}
|
||||
|
||||
int icon_buffer_id() const { return m_icon_buffer_id; }
|
||||
const Gfx::Size& icon_size() const { return m_icon_size; }
|
||||
const Gfx::IntSize& icon_size() const { return m_icon_size; }
|
||||
|
||||
private:
|
||||
int m_icon_buffer_id;
|
||||
Gfx::Size m_icon_size;
|
||||
Gfx::IntSize m_icon_size;
|
||||
};
|
||||
|
||||
class MultiPaintEvent final : public Event {
|
||||
public:
|
||||
explicit MultiPaintEvent(const Vector<Gfx::Rect, 32>& rects, const Gfx::Size& window_size)
|
||||
explicit MultiPaintEvent(const Vector<Gfx::IntRect, 32>& rects, const Gfx::IntSize& window_size)
|
||||
: Event(Event::MultiPaint)
|
||||
, m_rects(rects)
|
||||
, m_window_size(window_size)
|
||||
{
|
||||
}
|
||||
|
||||
const Vector<Gfx::Rect, 32>& rects() const { return m_rects; }
|
||||
Gfx::Size window_size() const { return m_window_size; }
|
||||
const Vector<Gfx::IntRect, 32>& rects() const { return m_rects; }
|
||||
Gfx::IntSize window_size() const { return m_window_size; }
|
||||
|
||||
private:
|
||||
Vector<Gfx::Rect, 32> m_rects;
|
||||
Gfx::Size m_window_size;
|
||||
Vector<Gfx::IntRect, 32> m_rects;
|
||||
Gfx::IntSize m_window_size;
|
||||
};
|
||||
|
||||
class PaintEvent final : public Event {
|
||||
public:
|
||||
explicit PaintEvent(const Gfx::Rect& rect, const Gfx::Size& window_size = {})
|
||||
explicit PaintEvent(const Gfx::IntRect& rect, const Gfx::IntSize& window_size = {})
|
||||
: Event(Event::Paint)
|
||||
, m_rect(rect)
|
||||
, m_window_size(window_size)
|
||||
{
|
||||
}
|
||||
|
||||
Gfx::Rect rect() const { return m_rect; }
|
||||
Gfx::Size window_size() const { return m_window_size; }
|
||||
Gfx::IntRect rect() const { return m_rect; }
|
||||
Gfx::IntSize window_size() const { return m_window_size; }
|
||||
|
||||
private:
|
||||
Gfx::Rect m_rect;
|
||||
Gfx::Size m_window_size;
|
||||
Gfx::IntRect m_rect;
|
||||
Gfx::IntSize m_window_size;
|
||||
};
|
||||
|
||||
class ResizeEvent final : public Event {
|
||||
public:
|
||||
explicit ResizeEvent(const Gfx::Size& old_size, const Gfx::Size& size)
|
||||
explicit ResizeEvent(const Gfx::IntSize& old_size, const Gfx::IntSize& size)
|
||||
: Event(Event::Resize)
|
||||
, m_old_size(old_size)
|
||||
, m_size(size)
|
||||
{
|
||||
}
|
||||
|
||||
const Gfx::Size& old_size() const { return m_old_size; }
|
||||
const Gfx::Size& size() const { return m_size; }
|
||||
const Gfx::IntSize& old_size() const { return m_old_size; }
|
||||
const Gfx::IntSize& size() const { return m_size; }
|
||||
|
||||
private:
|
||||
Gfx::Size m_old_size;
|
||||
Gfx::Size m_size;
|
||||
Gfx::IntSize m_old_size;
|
||||
Gfx::IntSize m_size;
|
||||
};
|
||||
|
||||
class ContextMenuEvent final : public Event {
|
||||
public:
|
||||
explicit ContextMenuEvent(const Gfx::Point& position, const Gfx::Point& screen_position)
|
||||
explicit ContextMenuEvent(const Gfx::IntPoint& position, const Gfx::IntPoint& screen_position)
|
||||
: Event(Event::ContextMenu)
|
||||
, m_position(position)
|
||||
, m_screen_position(screen_position)
|
||||
{
|
||||
}
|
||||
|
||||
const Gfx::Point& position() const { return m_position; }
|
||||
const Gfx::Point& screen_position() const { return m_screen_position; }
|
||||
const Gfx::IntPoint& position() const { return m_position; }
|
||||
const Gfx::IntPoint& screen_position() const { return m_screen_position; }
|
||||
|
||||
private:
|
||||
Gfx::Point m_position;
|
||||
Gfx::Point m_screen_position;
|
||||
Gfx::IntPoint m_position;
|
||||
Gfx::IntPoint m_screen_position;
|
||||
};
|
||||
|
||||
class ShowEvent final : public Event {
|
||||
|
@ -296,7 +296,7 @@ private:
|
|||
|
||||
class MouseEvent final : public Event {
|
||||
public:
|
||||
MouseEvent(Type type, const Gfx::Point& position, unsigned buttons, MouseButton button, unsigned modifiers, int wheel_delta)
|
||||
MouseEvent(Type type, const Gfx::IntPoint& position, unsigned buttons, MouseButton button, unsigned modifiers, int wheel_delta)
|
||||
: Event(type)
|
||||
, m_position(position)
|
||||
, m_buttons(buttons)
|
||||
|
@ -306,7 +306,7 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
Gfx::Point position() const { return m_position; }
|
||||
Gfx::IntPoint position() const { return m_position; }
|
||||
int x() const { return m_position.x(); }
|
||||
int y() const { return m_position.y(); }
|
||||
MouseButton button() const { return m_button; }
|
||||
|
@ -315,7 +315,7 @@ public:
|
|||
int wheel_delta() const { return m_wheel_delta; }
|
||||
|
||||
private:
|
||||
Gfx::Point m_position;
|
||||
Gfx::IntPoint m_position;
|
||||
unsigned m_buttons { 0 };
|
||||
MouseButton m_button { MouseButton::None };
|
||||
unsigned m_modifiers { 0 };
|
||||
|
@ -324,33 +324,33 @@ private:
|
|||
|
||||
class DragEvent final : public Event {
|
||||
public:
|
||||
DragEvent(Type type, const Gfx::Point& position, const String& data_type)
|
||||
DragEvent(Type type, const Gfx::IntPoint& position, const String& data_type)
|
||||
: Event(type)
|
||||
, m_position(position)
|
||||
, m_data_type(data_type)
|
||||
{
|
||||
}
|
||||
|
||||
const Gfx::Point& position() const { return m_position; }
|
||||
const Gfx::IntPoint& position() const { return m_position; }
|
||||
const String& data_type() const { return m_data_type; }
|
||||
|
||||
private:
|
||||
Gfx::Point m_position;
|
||||
Gfx::IntPoint m_position;
|
||||
String m_data_type;
|
||||
};
|
||||
|
||||
class DropEvent final : public Event {
|
||||
public:
|
||||
DropEvent(const Gfx::Point&, const String& text, NonnullRefPtr<Core::MimeData> mime_data);
|
||||
DropEvent(const Gfx::IntPoint&, const String& text, NonnullRefPtr<Core::MimeData> mime_data);
|
||||
|
||||
~DropEvent();
|
||||
|
||||
const Gfx::Point& position() const { return m_position; }
|
||||
const Gfx::IntPoint& position() const { return m_position; }
|
||||
const String& text() const { return m_text; }
|
||||
const Core::MimeData& mime_data() const { return m_mime_data; }
|
||||
|
||||
private:
|
||||
Gfx::Point m_position;
|
||||
Gfx::IntPoint m_position;
|
||||
String m_text;
|
||||
NonnullRefPtr<Core::MimeData> m_mime_data;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue