mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-21 02:08:12 +03:00
b0e3f73375
Userspace programs can now open /dev/gui_events and read a stream of GUI_Event structs one at a time. I was stuck on a stupid problem where we'd reenter Scheduler::yield() due to having one of the has_data_available_for_reading() implementations using locks.
32 lines
620 B
C++
32 lines
620 B
C++
#pragma once
|
|
|
|
struct GUI_Size;
|
|
|
|
class Size {
|
|
public:
|
|
Size() { }
|
|
Size(int w, int h) : m_width(w), m_height(h) { }
|
|
Size(const GUI_Size&);
|
|
|
|
bool is_empty() const { return !m_width || !m_height; }
|
|
|
|
int width() const { return m_width; }
|
|
int height() const { return m_height; }
|
|
|
|
void setWidth(int w) { m_width = w; }
|
|
void setHeight(int h) { m_height = h; }
|
|
|
|
bool operator==(const Size& other) const
|
|
{
|
|
return m_width == other.m_width &&
|
|
m_height == other.m_height;
|
|
}
|
|
|
|
operator GUI_Size() const;
|
|
|
|
private:
|
|
int m_width { 0 };
|
|
int m_height { 0 };
|
|
};
|
|
|