1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 13:07:46 +00:00

WindowServer: Add the ability to animate cursors

This adds the ability to specify cursor attributes as part of their
file names, which allows us to remove hard coded values like the hot
spot from the code. The attributes can be specified between the last
two dots of the file name. Each attribute begins with a character,
followed by one or more digits that specify a uint value.

Supported attributes:
x: The x-coordinate of the cursor hotspot
y: The y-coordinate of the cursor hotspot
f: The number of animated frames horizontally in the image
t: The number of milliseconds per frame

For example, the filename wait.f14t100.png specifies that the image
contains 14 frames that should be cycled through at a rate of 100ms.
The hotspot is not specified, so it defaults to the center.
This commit is contained in:
Tom 2020-12-16 22:15:14 -07:00 committed by Andreas Kling
parent 853664bd3c
commit 07badd9530
12 changed files with 188 additions and 39 deletions

View file

@ -7,7 +7,7 @@ Name=Default
[Cursor]
Hidden=/res/cursors/hidden.png
Arrow=/res/cursors/arrow.png
Arrow=/res/cursors/arrow.x2y2.png
ResizeH=/res/cursors/resize-horizontal.png
ResizeV=/res/cursors/resize-vertical.png
ResizeDTLBR=/res/cursors/resize-diagonal-tlbr.png
@ -17,10 +17,10 @@ ResizeRow=/res/cursors/resize-row.png
IBeam=/res/cursors/i-beam.png
Disallowed=/res/cursors/disallowed.png
Move=/res/cursors/move.png
Hand=/res/cursors/hand.png
Help=/res/cursors/help.png
Hand=/res/cursors/hand.x8y4.png
Help=/res/cursors/help.x1y1.png
Drag=/res/cursors/drag.png
Wait=/res/cursors/wait.png
Wait=/res/cursors/wait.f14t100.png
Crosshair=/res/cursors/crosshair.png
[Input]