1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 18:28:12 +00:00

WindowServer: Add a WSCursor class (a bitmap and a hotspot.)

Also import a bunch of cursors I drew. Only the default ("arrow") cursor is
ever used so far.
This commit is contained in:
Andreas Kling 2019-03-31 22:09:10 +02:00
parent 25f28a54a1
commit 2334ffcbf8
13 changed files with 80 additions and 15 deletions

View file

@ -13,6 +13,7 @@
#include <WindowServer/WSWindowSwitcher.h>
#include <WindowServer/WSWindowType.h>
#include <WindowServer/WSWindow.h>
#include <WindowServer/WSCursor.h>
#include <AK/CircularQueue.h>
class WSAPIClientRequest;
@ -23,7 +24,6 @@ class WSClientWantsToPaintMessage;
class WSWindow;
class WSClientConnection;
class WSWindowSwitcher;
class CharacterBitmap;
class GraphicsBitmap;
enum class ResizeDirection { None, Left, UpLeft, Up, UpRight, Right, DownRight, Down, DownLeft };
@ -84,6 +84,9 @@ public:
bool set_wallpaper(const String& path);
String wallpaper_path() const { return m_wallpaper_path; }
const WSCursor& active_cursor() const { return *m_arrow_cursor; }
Rect current_cursor_rect() const;
private:
void process_mouse_event(WSMouseEvent&, WSWindow*& event_window);
bool process_ongoing_window_resize(WSMouseEvent&, WSWindow*& event_window);
@ -154,8 +157,13 @@ private:
bool m_pending_compose_event { false };
RetainPtr<CharacterBitmap> m_cursor_bitmap_inner;
RetainPtr<CharacterBitmap> m_cursor_bitmap_outer;
RetainPtr<WSCursor> m_arrow_cursor;
RetainPtr<WSCursor> m_resize_horizontally_cursor;
RetainPtr<WSCursor> m_resize_vertically_cursor;
RetainPtr<WSCursor> m_resize_diagonally_tlbr_cursor;
RetainPtr<WSCursor> m_resize_diagonally_bltr_cursor;
RetainPtr<WSCursor> m_i_beam_cursor;
RetainPtr<WSCursor> m_disallowed_cursor;
OwnPtr<Painter> m_back_painter;
OwnPtr<Painter> m_front_painter;