forked from SerenityOS/serenity
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
1 parent
25f28a5
commit 2334ffc
Showing
13 changed files
with
80 additions
and
15 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#include <WindowServer/WSCursor.h> | ||
|
||
WSCursor::WSCursor(Retained<GraphicsBitmap>&& bitmap, const Point& hotspot) | ||
: m_bitmap(move(bitmap)) | ||
, m_hotspot(hotspot) | ||
{ | ||
} | ||
|
||
WSCursor::~WSCursor() | ||
{ | ||
} | ||
|
||
Retained<WSCursor> WSCursor::create(Retained<GraphicsBitmap>&& bitmap) | ||
{ | ||
return adopt(*new WSCursor(move(bitmap), bitmap->rect().center())); | ||
} | ||
|
||
Retained<WSCursor> WSCursor::create(Retained<GraphicsBitmap>&& bitmap, const Point& hotspot) | ||
{ | ||
return adopt(*new WSCursor(move(bitmap), hotspot)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#pragma once | ||
|
||
#include <SharedGraphics/GraphicsBitmap.h> | ||
|
||
class WSCursor : public Retainable<WSCursor> { | ||
public: | ||
static Retained<WSCursor> create(Retained<GraphicsBitmap>&&, const Point& hotspot); | ||
static Retained<WSCursor> create(Retained<GraphicsBitmap>&&); | ||
~WSCursor(); | ||
|
||
Point hotspot() const { return m_hotspot; } | ||
const GraphicsBitmap& bitmap() const { return *m_bitmap; } | ||
|
||
Rect rect() const { return m_bitmap->rect(); } | ||
Size size() const { return m_bitmap->size(); } | ||
|
||
private: | ||
WSCursor(Retained<GraphicsBitmap>&&, const Point&); | ||
|
||
RetainPtr<GraphicsBitmap> m_bitmap; | ||
Point m_hotspot; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters