summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorEkaitz Zarraga <ekaitz@elenq.tech>2022-07-22 14:43:22 +0200
committerDavid Thompson <dthompson2@worcester.edu>2022-07-25 20:54:02 -0400
commit6789ffa5366604d361267e96732f25f391943130 (patch)
treee4cee4c1aaa276ed466c64133739d590c0fec02a /doc
parent697a403617b97b4ce333132dae89cb009f6b6e3b (diff)
mouse: Add cursor manipulation bindings.
* sdl2/bindings.scm (SDL_SYSTEM_CURSOR_ARROW, SDL_SYSTEM_CURSOR_IBEAM) (SDL_SYSTEM_CURSOR_WAIT, SDL_SYSTEM_CURSOR_CROSSHAIR) (SDL_SYSTEM_CURSOR_WAITARROW, SDL_SYSTEM_CURSOR_SIZENWSE) (SDL_SYSTEM_CURSOR_SIZENESW, SDL_SYSTEM_CURSOR_SIZEWE) (SDL_SYSTEM_CURSOR_SIZENS, SDL_SYSTEM_CURSOR_SIZEALL) (SDL_SYSTEM_CURSOR_NO, SDL_SYSTEM_CURSOR_HAND, SDL_NUM_SYSTEM_CURSORS): New variables. (sdl-create-system-cursor, sdl-create-color-cursor, sdl-free-cursor) (sdl-set-cursor, sdl-get-cursor, sdl-show-cursor): New procedures. * sdl2/input/mouse.scm (make-system-cursor, make-surface-cursor) (set-cursor!, get-cursor, delete-cursor!): New procedures. * doc/api.texi (Mouse): Document the added features
Diffstat (limited to 'doc')
-rw-r--r--doc/api.texi41
1 files changed, 41 insertions, 0 deletions
diff --git a/doc/api.texi b/doc/api.texi
index 8e0fe73..85e5bf7 100644
--- a/doc/api.texi
+++ b/doc/api.texi
@@ -313,6 +313,47 @@ Return @code{#t} if @var{button} is currently being pressed.
Return @code{#t} if @var{button} is not currently being pressed.
@end deffn
+@deffn {Procedure} make-system-cursor cursor-type
+Create a new cursor from the system's available set, chosen by
+@var{cursor-type}. The possible values for @var{cursor-type} are:
+
+@itemize
+@item @code{arrow}
+@item @code{crosshair}
+@item @code{hand}
+@item @code{i-beam}
+@item @code{size-north-south}
+@item @code{size-northwest-southeast}
+@item @code{size-northeast-southwest}
+@item @code{size-west-east}
+@item @code{size-all}
+@item @code{no}
+@item @code{wait}
+@item @code{wait-arrow}
+@end itemize
+
+@end deffn
+
+@deffn {Procedure} make-surface-cursor surface hot-x hot-y
+Create a new cursor from a surface and the given hotspot coordinates
+(@var{hot-x}, @var{hot-y}).
+@end deffn
+
+@deffn {Procedure} get-cursor
+Return the cursor currently in use. The returned cursor object is
+internally managed and it's not necessary to call
+@code{delete-cursor!} for it.
+@end deffn
+
+@deffn {Procedure} set-cursor! cursor
+Set the current cursor to @var{cursor}. If @var{cursor} is @code{#f},
+the system default cursor is restored.
+@end deffn
+
+@deffn {Procedure} delete-cursor! cursor
+Free the memory used by @var{cursor}. Be careful!
+@end deffn
+
@node Joysticks
@subsection Joysticks