SharedGraphics: Add LogStream operator<<'s for Rect, Point and Size.

This commit is contained in:
Andreas Kling 2019-07-04 06:45:50 +02:00
parent 05cc59921a
commit 07d11a9b6b
Notes: sideshowbarker 2024-07-19 13:23:41 +09:00
3 changed files with 18 additions and 0 deletions

View file

@ -1,6 +1,7 @@
#pragma once
#include <AK/AKString.h>
#include <AK/LogStream.h>
class Rect;
struct WSAPI_Point;
@ -71,3 +72,8 @@ private:
int m_x { 0 };
int m_y { 0 };
};
inline const LogStream& operator<<(const LogStream& stream, const Point& value)
{
return stream << value.to_string();
}

View file

@ -1,6 +1,7 @@
#pragma once
#include <AK/AKString.h>
#include <AK/LogStream.h>
#include <SharedGraphics/Point.h>
#include <SharedGraphics/Size.h>
#include <SharedGraphics/TextAlignment.h>
@ -244,3 +245,8 @@ inline void Point::constrain(const Rect& rect)
else if (y() > rect.bottom())
set_y(rect.bottom());
}
inline const LogStream& operator<<(const LogStream& stream, const Rect& value)
{
return stream << value.to_string();
}

View file

@ -1,6 +1,7 @@
#pragma once
#include <AK/AKString.h>
#include <AK/LogStream.h>
struct WSAPI_Size;
@ -57,3 +58,8 @@ private:
int m_width { 0 };
int m_height { 0 };
};
inline const LogStream& operator<<(const LogStream& stream, const Size& value)
{
return stream << value.to_string();
}