28 #if defined( __unix__ )
29 #include <X11/Xcursor/Xcursor.h>
61 #if defined( __unix__ )
64 typedef Cursor XCursor;
83 m_native_cursor(NULL),
84 m_renderbackend(renderbackend),
92 m_invalidated(false) {
100 if (!SDL_ShowCursor(1)) {
115 if (SDL_ShowCursor(0)) {
129 if (SDL_ShowCursor(0)) {
289 #elif defined( __unix__ )
335 #if defined( WIN32 ) || defined(__unix__)
340 #if defined( __unix__ )
341 static Display* dsp = XOpenDisplay(NULL);
342 XCursor xCursor = XcursorShapeLoadCursor(dsp, cursor_id);
348 FL_WARN(
_log,
"Cursor: No cursor matching cursor_id was found.");
351 #elif defined( WIN32 )
353 HCURSOR hIcon = LoadCursor(NULL, MAKEINTRESOURCE(cursor_id));
354 if (hIcon == static_cast<HCURSOR>(0)) {
359 FL_WARN(
_log,
"Cursor: No cursor matching cursor_id was found.");
368 cursor = (WMcursor *)SDL_malloc(
sizeof(*cursor));
369 curs2 = (SDL_Cursor *)SDL_malloc(
sizeof *curs2);
372 curs2->wm_cursor = cursor;
375 curs2->save[0] = NULL;
376 curs2->save[1] = NULL;
385 cursor->curs = hIcon;
393 if (GetIconInfo(hIcon, &iconinfo)) {
394 curs2->hot_x =
static_cast<Sint16
>(iconinfo.xHotspot);
395 curs2->hot_y =
static_cast<Sint16
>(iconinfo.yHotspot);
398 #elif defined(__unix__)
399 cursor->x_cursor = xCursor;
404 SDL_SetCursor(curs2);
406 #endif // WIN32 || __unix__
#define FL_WARN(logger, msg)
Abstract interface for all the renderbackends.
MouseCursorType m_cursor_type
MouseCursorType m_drag_type
TimeManager * m_timemanager
int32_t getXShift() const
void reset(T *ptr=0)
reset this pointer to a null shared pointer this can be used to lower the reference count of the shar...
uint32_t getDuration() const
Gets the total duration for the whole animation.
int32_t getYShift() const
static Logger _log(LM_AUDIO)
ImagePtr m_cursor_drag_image
void setDrag(ImagePtr image, int32_t drag_offset_x=0, int32_t drag_offset_y=0)
Sets the current drag image cursor.
uint32_t getHeight() const
AnimationPtr m_cursor_animation
void setNativeCursor(uint32_t cursor_id)
Sets the cursor to a native type.
uint32_t getTime() const
Get the time.
ImagePtr getFrameByTimestamp(uint32_t timestamp)
Gets the frame image that matches the given timestamp.
virtual void draw()
draws cursor on screen
void pushClipArea(const Rect &cliparea, bool clear=true)
Pushes clip area to clip stack Clip areas define which area is drawn on screen.
void popClipArea()
Pops clip area from clip stack.
uint32_t getWidth() const
void set(uint32_t cursor_id=0)
Sets the current mouse cursor.
void resetDrag()
Resets the cursor drag type to CURSOR_NONE.
uint32_t getNativeId(uint32_t cursor_id)
To get some consistancy between platforms, this function checks if cursor_id matches any of the value...
AnimationPtr m_cursor_drag_animation
virtual void render(const Rect &rect, uint8_t alpha=255, uint8_t const *rgb=0)=0
Renders itself to the current render target (main screen or attached destination image) at the rectan...
Cursor(RenderBackend *renderbackend)
Constructor.
void getPosition(int32_t *x, int32_t *y)
Get the current mouse position.
virtual void renderVertexArrays()=0
Render the Vertex Arrays, only for primitives (points, lines,...)
RenderBackend * m_renderbackend
SDL_Cursor * m_native_cursor
void setPosition(uint32_t x, uint32_t y)
Set the mouse position.