Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Latest commit

 

History

History
87 lines (68 loc) · 2.07 KB

SDL_nxmouse.c

File metadata and controls

87 lines (68 loc) · 2.07 KB
 
1
2
/*
SDL - Simple DirectMedia Layer
Jan 4, 2004
Jan 4, 2004
3
Copyright (C) 1997-2004 Sam Lantinga
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Copyright (C) 2001 Hsieh-Fu Tsai
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Sam Lantinga
Dec 14, 2001
Dec 14, 2001
21
slouken@libsdl.org
22
23
24
25
Hsieh-Fu Tsai
clare@setabox.com
*/
Feb 21, 2006
Feb 21, 2006
26
#include "SDL_config.h"
Feb 16, 2006
Feb 16, 2006
28
#include "../../events/SDL_events_c.h"
29
30
31
32
#include "SDL_nxmouse_c.h"
// The implementation dependent data for the window manager cursor
May 28, 2006
May 28, 2006
33
34
35
36
struct WMcursor
{
int unused;
};
May 28, 2006
May 28, 2006
38
39
40
41
WMcursor *
NX_CreateWMCursor (_THIS,
Uint8 * data, Uint8 * mask, int w, int h, int hot_x,
int hot_y)
May 28, 2006
May 28, 2006
43
WMcursor *cursor;
May 28, 2006
May 28, 2006
45
Dprintf ("enter NX_CreateWMCursor\n");
May 28, 2006
May 28, 2006
47
cursor = (WMcursor *) SDL_malloc (sizeof (WMcursor));
48
if (cursor == NULL) {
May 28, 2006
May 28, 2006
49
50
SDL_OutOfMemory ();
return NULL;
May 28, 2006
May 28, 2006
53
54
Dprintf ("leave NX_CreateWMCursor\n");
return cursor;
May 28, 2006
May 28, 2006
57
58
void
NX_FreeWMCursor (_THIS, WMcursor * cursor)
May 28, 2006
May 28, 2006
60
61
62
Dprintf ("NX_FreeWMCursor\n");
SDL_free (cursor);
return;
May 28, 2006
May 28, 2006
65
66
void
NX_WarpWMCursor (_THIS, Uint16 x, Uint16 y)
May 28, 2006
May 28, 2006
68
GR_WINDOW_INFO info;
May 28, 2006
May 28, 2006
70
71
Dprintf ("enter NX_WarpWMCursor\n");
SDL_Lock_EventThread ();
May 28, 2006
May 28, 2006
73
74
75
76
77
GrGetWindowInfo (SDL_Window, &info);
GrMoveCursor (info.x + x, info.y + y);
SDL_Unlock_EventThread ();
Dprintf ("leave NX_WarpWMCursor\n");
May 28, 2006
May 28, 2006
80
81
int
NX_ShowWMCursor (_THIS, WMcursor * cursor)
May 28, 2006
May 28, 2006
83
84
Dprintf ("NX_ShowWMCursor\n");
return 1;
May 28, 2006
May 28, 2006
86
87
/* vi: set ts=4 sw=4 expandtab: */