misc/winutils/include/SDL_mouse.h
changeset 10017 de822cd3df3a
parent 7809 7d4fb2f35f4f
equal deleted inserted replaced
10015:4feced261c68 10017:de822cd3df3a
    35 /* Set up for C function definitions, even when using C++ */
    35 /* Set up for C function definitions, even when using C++ */
    36 #ifdef __cplusplus
    36 #ifdef __cplusplus
    37 extern "C" {
    37 extern "C" {
    38 #endif
    38 #endif
    39 
    39 
    40 typedef struct WMcursor WMcursor;	/**< Implementation dependent */
    40 typedef struct WMcursor WMcursor;   /**< Implementation dependent */
    41 typedef struct SDL_Cursor {
    41 typedef struct SDL_Cursor {
    42 	SDL_Rect area;			/**< The area of the mouse cursor */
    42     SDL_Rect area;          /**< The area of the mouse cursor */
    43 	Sint16 hot_x, hot_y;		/**< The "tip" of the cursor */
    43     Sint16 hot_x, hot_y;        /**< The "tip" of the cursor */
    44 	Uint8 *data;			/**< B/W cursor data */
    44     Uint8 *data;            /**< B/W cursor data */
    45 	Uint8 *mask;			/**< B/W cursor mask */
    45     Uint8 *mask;            /**< B/W cursor mask */
    46 	Uint8 *save[2];			/**< Place to save cursor area */
    46     Uint8 *save[2];         /**< Place to save cursor area */
    47 	WMcursor *wm_cursor;		/**< Window-manager cursor */
    47     WMcursor *wm_cursor;        /**< Window-manager cursor */
    48 } SDL_Cursor;
    48 } SDL_Cursor;
    49 
    49 
    50 /* Function prototypes */
    50 /* Function prototypes */
    51 /**
    51 /**
    52  * Retrieve the current state of the mouse.
    52  * Retrieve the current state of the mouse.
    81  *  1     0       Inverted color if possible, black if not.
    81  *  1     0       Inverted color if possible, black if not.
    82  *
    82  *
    83  * Cursors created with this function must be freed with SDL_FreeCursor().
    83  * Cursors created with this function must be freed with SDL_FreeCursor().
    84  */
    84  */
    85 extern DECLSPEC SDL_Cursor * SDLCALL SDL_CreateCursor
    85 extern DECLSPEC SDL_Cursor * SDLCALL SDL_CreateCursor
    86 		(Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y);
    86         (Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y);
    87 
    87 
    88 /**
    88 /**
    89  * Set the currently active cursor to the specified one.
    89  * Set the currently active cursor to the specified one.
    90  * If the cursor is currently visible, the change will be immediately 
    90  * If the cursor is currently visible, the change will be immediately
    91  * represented on the display.
    91  * represented on the display.
    92  */
    92  */
    93 extern DECLSPEC void SDLCALL SDL_SetCursor(SDL_Cursor *cursor);
    93 extern DECLSPEC void SDLCALL SDL_SetCursor(SDL_Cursor *cursor);
    94 
    94 
    95 /**
    95 /**
   111  */
   111  */
   112 extern DECLSPEC int SDLCALL SDL_ShowCursor(int toggle);
   112 extern DECLSPEC int SDLCALL SDL_ShowCursor(int toggle);
   113 
   113 
   114 /*@{*/
   114 /*@{*/
   115 /** Used as a mask when testing buttons in buttonstate
   115 /** Used as a mask when testing buttons in buttonstate
   116  *  Button 1:	Left mouse button
   116  *  Button 1:   Left mouse button
   117  *  Button 2:	Middle mouse button
   117  *  Button 2:   Middle mouse button
   118  *  Button 3:	Right mouse button
   118  *  Button 3:   Right mouse button
   119  *  Button 4:	Mouse wheel up	 (may also be a real button)
   119  *  Button 4:   Mouse wheel up   (may also be a real button)
   120  *  Button 5:	Mouse wheel down (may also be a real button)
   120  *  Button 5:   Mouse wheel down (may also be a real button)
   121  */
   121  */
   122 #define SDL_BUTTON(X)		(1 << ((X)-1))
   122 #define SDL_BUTTON(X)       (1 << ((X)-1))
   123 #define SDL_BUTTON_LEFT		1
   123 #define SDL_BUTTON_LEFT     1
   124 #define SDL_BUTTON_MIDDLE	2
   124 #define SDL_BUTTON_MIDDLE   2
   125 #define SDL_BUTTON_RIGHT	3
   125 #define SDL_BUTTON_RIGHT    3
   126 #define SDL_BUTTON_WHEELUP	4
   126 #define SDL_BUTTON_WHEELUP  4
   127 #define SDL_BUTTON_WHEELDOWN	5
   127 #define SDL_BUTTON_WHEELDOWN    5
   128 #define SDL_BUTTON_X1		6
   128 #define SDL_BUTTON_X1       6
   129 #define SDL_BUTTON_X2		7
   129 #define SDL_BUTTON_X2       7
   130 #define SDL_BUTTON_LMASK	SDL_BUTTON(SDL_BUTTON_LEFT)
   130 #define SDL_BUTTON_LMASK    SDL_BUTTON(SDL_BUTTON_LEFT)
   131 #define SDL_BUTTON_MMASK	SDL_BUTTON(SDL_BUTTON_MIDDLE)
   131 #define SDL_BUTTON_MMASK    SDL_BUTTON(SDL_BUTTON_MIDDLE)
   132 #define SDL_BUTTON_RMASK	SDL_BUTTON(SDL_BUTTON_RIGHT)
   132 #define SDL_BUTTON_RMASK    SDL_BUTTON(SDL_BUTTON_RIGHT)
   133 #define SDL_BUTTON_X1MASK	SDL_BUTTON(SDL_BUTTON_X1)
   133 #define SDL_BUTTON_X1MASK   SDL_BUTTON(SDL_BUTTON_X1)
   134 #define SDL_BUTTON_X2MASK	SDL_BUTTON(SDL_BUTTON_X2)
   134 #define SDL_BUTTON_X2MASK   SDL_BUTTON(SDL_BUTTON_X2)
   135 /*@}*/
   135 /*@}*/
   136 
   136 
   137 /* Ends C function definitions when using C++ */
   137 /* Ends C function definitions when using C++ */
   138 #ifdef __cplusplus
   138 #ifdef __cplusplus
   139 }
   139 }