1 /** 2 * @file cursor.h 3 * @author Joe Wingbermuehle 4 * @date 2004-2006 5 * 6 * @brief Header for the cursor functions. 7 * 8 */ 9 10 #ifndef CURSOR_H 11 #define CURSOR_H 12 13 #include "border.h" 14 15 /*@{*/ 16 #define InitializeCursors() (void)(0) 17 void StartupCursors(void); 18 void ShutdownCursors(void); 19 #define DestroyCursors() (void)(0) 20 /*@}*/ 21 22 /** Grab the mouse for resizing a window. 23 * @param action The resize action. 24 * @return 1 on success, 0 on failure. 25 */ 26 char GrabMouseForResize(BorderActionType action); 27 28 /** Grab the mouse for moving a window. 29 * @return 1 on success, 0 on failure. 30 */ 31 char GrabMouseForMove(void); 32 33 /** Grab the mouse. 34 * @return 1 on success, 0 on failure. 35 */ 36 char GrabMouse(Window w); 37 38 /** Grab the mouse to select a window. 39 * @return 1 on success, 0 on failure. 40 */ 41 char GrabMouseForChoose(void); 42 43 /** Get the cursor to use given a border action. 44 * @param action The border action. 45 * @return The cursor to use. 46 */ 47 Cursor GetFrameCursor(BorderActionType action); 48 49 /** Move the mouse cursor. 50 * @param win The window to act as an origin for the coordinates. 51 * @param x The x-coordinate. 52 * @param y The y-coordinate. 53 */ 54 void MoveMouse(Window win, int x, int y); 55 56 /** Set the current mouse position. 57 * @param x The x-coordinate (relative to the current desktop). 58 * @param y The y-coordinate (relative to the current desktop). 59 * @param w The window under the mouse. 60 */ 61 void SetMousePosition(int x, int y, Window w); 62 63 /** Get the current mouse position. 64 * @param x Location to store the x-coordinate. 65 * @param y Location to store the y-coordinate. 66 * @param w The window under the mouse. 67 */ 68 void GetMousePosition(int *x, int *y, Window *w); 69 70 /** Get a mask of the current mouse buttons pressed. 71 * @return A mask of the current mouse buttons pressed. 72 */ 73 unsigned int GetMouseMask(void); 74 75 /** Reset to the default cursor on a window. 76 * @param w The window whose cursor to change. 77 */ 78 void SetDefaultCursor(Window w); 79 80 #endif /* CURSOR_H */ 81 82