Mercurial > sdl-ios-xcode
comparison include/SDL_mouse.h @ 1670:eef792d31de8 SDL-1.3
Work in progress. :)
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Wed, 07 Jun 2006 16:10:28 +0000 |
parents | 4da1ee79c9af |
children | 89f7510fe17a |
comparison
equal
deleted
inserted
replaced
1669:9857d21967bb | 1670:eef792d31de8 |
---|---|
39 /* *INDENT-OFF* */ | 39 /* *INDENT-OFF* */ |
40 extern "C" { | 40 extern "C" { |
41 /* *INDENT-ON* */ | 41 /* *INDENT-ON* */ |
42 #endif | 42 #endif |
43 | 43 |
44 typedef struct WMcursor WMcursor; /* Implementation dependent */ | 44 typedef struct SDL_Cursor SDL_Cursor; /* Implementation dependent */ |
45 typedef struct SDL_Cursor | |
46 { | |
47 SDL_Rect area; /* The area of the mouse cursor */ | |
48 Sint16 hot_x, hot_y; /* The "tip" of the cursor */ | |
49 Uint8 *data; /* B/W cursor data */ | |
50 Uint8 *mask; /* B/W cursor mask */ | |
51 Uint8 *save[2]; /* Place to save cursor area */ | |
52 WMcursor *wm_cursor; /* Window-manager cursor */ | |
53 } SDL_Cursor; | |
54 | 45 |
55 /* Function prototypes */ | 46 /* Function prototypes */ |
47 | |
48 /* \fn int SDL_GetNumMice(void) | |
49 * | |
50 * \brief Get the number of mouse input devices available. | |
51 * | |
52 * \sa SDL_SelectMouse() | |
53 */ | |
54 extern DECLSPEC int SDLCALL SDL_GetNumMice(void); | |
55 | |
56 /* \fn int SDL_SelectMouse(int index) | |
57 * | |
58 * \brief Set the index of the currently selected mouse. | |
59 * | |
60 * \return The index of the currently selected mouse. | |
61 * | |
62 * \note You can query the currently selected mouse by passing an index of -1. | |
63 * | |
64 * \sa SDL_GetNumMice() | |
65 */ | |
66 extern DECLSPEC int SDLCALL SDL_SelectMouse(int index); | |
67 | |
68 /* \fn SDL_WindowID SDL_GetMouseFocusWindow(void) | |
69 * | |
70 * \brief Get the window which currently has focus for the currently selected mouse. | |
71 */ | |
72 extern DECLSPEC SDL_WindowID SDLCALL SDL_GetMouseFocusWindow(void); | |
73 | |
56 /* | 74 /* |
57 * Retrieve the current state of the mouse. | 75 * \fn Uint8 SDL_GetMouseState(int *x, int *y) |
76 * | |
77 * \brief Retrieve the current state of the mouse. | |
78 * | |
58 * The current button state is returned as a button bitmask, which can | 79 * The current button state is returned as a button bitmask, which can |
59 * be tested using the SDL_BUTTON(X) macros, and x and y are set to the | 80 * be tested using the SDL_BUTTON(X) macros, and x and y are set to the |
60 * current mouse cursor position. You can pass NULL for either x or y. | 81 * mouse cursor position relative to the focus window for the currently |
82 * selected mouse. You can pass NULL for either x or y. | |
61 */ | 83 */ |
62 extern DECLSPEC Uint8 SDLCALL SDL_GetMouseState(int *x, int *y); | 84 extern DECLSPEC Uint8 SDLCALL SDL_GetMouseState(int *x, int *y); |
63 | 85 |
64 /* | 86 /* |
65 * Retrieve the current state of the mouse. | 87 * \fn Uint8 SDL_GetRelativeMouseState(int *x, int *y) |
88 * | |
89 * \brief Retrieve the current state of the mouse. | |
90 * | |
66 * The current button state is returned as a button bitmask, which can | 91 * The current button state is returned as a button bitmask, which can |
67 * be tested using the SDL_BUTTON(X) macros, and x and y are set to the | 92 * be tested using the SDL_BUTTON(X) macros, and x and y are set to the |
68 * mouse deltas since the last call to SDL_GetRelativeMouseState(). | 93 * mouse deltas since the last call to SDL_GetRelativeMouseState(). |
69 */ | 94 */ |
70 extern DECLSPEC Uint8 SDLCALL SDL_GetRelativeMouseState(int *x, int *y); | 95 extern DECLSPEC Uint8 SDLCALL SDL_GetRelativeMouseState(int *x, int *y); |
71 | 96 |
72 /* | 97 /* |
73 * Set the position of the mouse cursor (generates a mouse motion event) | 98 * \fn void SDL_WarpMouseInWindow(SDL_WindowID windowID, int x, int y) |
99 * | |
100 * \brief Moves the currently selected mouse to the given position within the window. | |
101 * | |
102 * \param windowID The window to move the mouse into, or 0 for the current mouse focus | |
103 * \param x The x coordinate within the window | |
104 * \param y The y coordinate within the window | |
105 * | |
106 * \note This function generates a mouse motion event | |
74 */ | 107 */ |
75 extern DECLSPEC void SDLCALL SDL_WarpMouse(Uint16 x, Uint16 y); | 108 extern DECLSPEC void SDLCALL SDL_WarpMouseInWindow(SDL_WindowID windowID, |
109 int x, int y); | |
76 | 110 |
77 /* | 111 /* |
78 * Create a cursor using the specified data and mask (in MSB format). | 112 * Create a cursor using the specified data and mask (in MSB format). |
79 * The cursor width must be a multiple of 8 bits. | 113 * The cursor width must be a multiple of 8 bits. |
80 * | 114 * |