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

Latest commit

 

History

History
85 lines (69 loc) · 2.22 KB

SDL_amigamouse.c

File metadata and controls

85 lines (69 loc) · 2.22 KB
 
Apr 26, 2001
Apr 26, 2001
1
2
/*
SDL - Simple DirectMedia Layer
Feb 1, 2006
Feb 1, 2006
3
Copyright (C) 1997-2006 Sam Lantinga
Apr 26, 2001
Apr 26, 2001
4
5
This library is free software; you can redistribute it and/or
Feb 1, 2006
Feb 1, 2006
6
modify it under the terms of the GNU Lesser General Public
Apr 26, 2001
Apr 26, 2001
7
License as published by the Free Software Foundation; either
Feb 1, 2006
Feb 1, 2006
8
version 2.1 of the License, or (at your option) any later version.
Apr 26, 2001
Apr 26, 2001
9
10
11
12
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
Feb 1, 2006
Feb 1, 2006
13
Lesser General Public License for more details.
Apr 26, 2001
Apr 26, 2001
14
Feb 1, 2006
Feb 1, 2006
15
16
17
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Apr 26, 2001
Apr 26, 2001
18
19
Sam Lantinga
Dec 14, 2001
Dec 14, 2001
20
slouken@libsdl.org
Apr 26, 2001
Apr 26, 2001
21
*/
Feb 21, 2006
Feb 21, 2006
22
#include "SDL_config.h"
Apr 26, 2001
Apr 26, 2001
23
24
#include "SDL_mouse.h"
Feb 16, 2006
Feb 16, 2006
25
26
#include "../../events/SDL_events_c.h"
#include "../SDL_cursor_c.h"
Apr 26, 2001
Apr 26, 2001
27
28
29
30
31
#include "SDL_amigamouse_c.h"
/* The implementation dependent data for the window manager cursor */
May 28, 2006
May 28, 2006
32
typedef void *WMCursor;
Apr 26, 2001
Apr 26, 2001
33
May 28, 2006
May 28, 2006
34
void
May 29, 2006
May 29, 2006
35
amiga_FreeWMCursor(_THIS, WMcursor * cursor)
Apr 26, 2001
Apr 26, 2001
36
37
38
{
}
May 28, 2006
May 28, 2006
39
WMcursor *
May 29, 2006
May 29, 2006
40
41
42
amiga_CreateWMCursor(_THIS,
Uint8 * data, Uint8 * mask, int w, int h, int hot_x,
int hot_y)
Apr 26, 2001
Apr 26, 2001
43
{
May 28, 2006
May 28, 2006
44
return (WMcursor *) 1; // Amiga has an Hardware cursor, so it's ok to return something unuseful but true
Apr 26, 2001
Apr 26, 2001
45
46
}
May 28, 2006
May 28, 2006
47
int
May 29, 2006
May 29, 2006
48
amiga_ShowWMCursor(_THIS, WMcursor * cursor)
Apr 26, 2001
Apr 26, 2001
49
{
May 28, 2006
May 28, 2006
50
51
52
53
/* Don't do anything if the display is gone */
if (SDL_Display == NULL) {
return (0);
}
Apr 26, 2001
Apr 26, 2001
54
May 28, 2006
May 28, 2006
55
/* Set the Amiga prefs cursor cursor, or blank if cursor is NULL */
Apr 26, 2001
Apr 26, 2001
56
May 28, 2006
May 28, 2006
57
if (SDL_Window) {
May 29, 2006
May 29, 2006
58
SDL_Lock_EventThread();
May 28, 2006
May 28, 2006
59
60
if (cursor == NULL) {
if (SDL_BlankCursor != NULL) {
Apr 26, 2001
Apr 26, 2001
61
// Hide cursor HERE
May 29, 2006
May 29, 2006
62
SetPointer(SDL_Window, (UWORD *) SDL_BlankCursor, 1, 1, 0, 0);
May 28, 2006
May 28, 2006
63
64
}
} else {
Apr 26, 2001
Apr 26, 2001
65
// Show cursor
May 29, 2006
May 29, 2006
66
ClearPointer(SDL_Window);
May 28, 2006
May 28, 2006
67
}
May 29, 2006
May 29, 2006
68
SDL_Unlock_EventThread();
May 28, 2006
May 28, 2006
69
70
}
return (1);
Apr 26, 2001
Apr 26, 2001
71
72
}
May 28, 2006
May 28, 2006
73
void
May 29, 2006
May 29, 2006
74
amiga_WarpWMCursor(_THIS, Uint16 x, Uint16 y)
Apr 26, 2001
Apr 26, 2001
75
76
77
78
79
{
/* FIXME: Not implemented */
}
/* Check to see if we need to enter or leave mouse relative mode */
May 28, 2006
May 28, 2006
80
void
May 29, 2006
May 29, 2006
81
amiga_CheckMouseMode(_THIS)
Apr 26, 2001
Apr 26, 2001
82
83
{
}
May 28, 2006
May 28, 2006
84
85
/* vi: set ts=4 sw=4 expandtab: */