Second Revision (from Archive)
[~jspiros/WindowBlur.git] / CGSInternal / CGSCursor.h
1 /*
2  * Copyright (C) 2007-2008 Alacatia Labs
3  * 
4  * This software is provided 'as-is', without any express or implied
5  * warranty.  In no event will the authors be held liable for any damages
6  * arising from the use of this software.
7  * 
8  * Permission is granted to anyone to use this software for any purpose,
9  * including commercial applications, and to alter it and redistribute it
10  * freely, subject to the following restrictions:
11  * 
12  * 1. The origin of this software must not be misrepresented; you must not
13  *    claim that you wrote the original software. If you use this software
14  *    in a product, an acknowledgment in the product documentation would be
15  *    appreciated but is not required.
16  * 2. Altered source versions must be plainly marked as such, and must not be
17  *    misrepresented as being the original software.
18  * 3. This notice may not be removed or altered from any source distribution.
19  * 
20  * Joe Ranieri joe@alacatia.com
21  *
22  */
23
24 #pragma once
25 #include "CGSConnection.h"
26
27 typedef int CGSCursorID;
28
29
30 CG_EXTERN_C_BEGIN
31
32 /*! Does the system support hardware cursors? */
33 CG_EXTERN CGError CGSSystemSupportsHardwareCursor(CGSConnectionID cid, bool *outSupportsHardwareCursor);
34
35 /*! Does the system support hardware color cursors? */
36 CG_EXTERN CGError CGSSystemSupportsColorHardwareCursor(CGSConnectionID cid, bool *outSupportsHardwareCursor);
37
38 /*! Shows the cursor. */
39 CG_EXTERN CGError CGSShowCursor(CGSConnectionID cid);
40
41 /*! Hides the cursor. */
42 CG_EXTERN CGError CGSHideCursor(CGSConnectionID cid);
43
44 /*! Hides the cursor until the mouse is moved. */
45 CG_EXTERN CGError CGSObscureCursor(CGSConnectionID cid);
46
47 /*! Gets the cursor location. */
48 CG_EXTERN CGError CGSGetCurrentCursorLocation(CGSConnectionID cid, CGPoint *outPos);
49
50 /*! Gets the name (in reverse DNS form) of a system cursor. */
51 CG_EXTERN char *CGSCursorNameForSystemCursor(CGSCursorID cursor);
52
53 /*! Gets the size of the data for the connection's cursor. */
54 CG_EXTERN CGError CGSGetCursorDataSize(CGSConnectionID cid, int *outDataSize);
55
56 /*! Gets the data for the connection's cursor. */
57 CG_EXTERN CGError CGSGetCursorData(CGSConnectionID cid, void *outData);
58
59 /*! Gets the size of the data for the current cursor. */
60 CG_EXTERN CGError CGSGetGlobalCursorDataSize(CGSConnectionID cid, int *outDataSize);
61
62 /*! Gets the data for the current cursor. */
63 CG_EXTERN CGError CGSGetGlobalCursorData(CGSConnectionID cid, void *outData, int *outRowBytes, CGRect *outRect, CGRect *outHotSpot, int *outDepth, int *outComponents, int *outBitsPerComponent);
64
65 /*! Gets the size of data for a system-defined cursor. */
66 CG_EXTERN CGError CGSGetSystemDefinedCursorDataSize(CGSConnectionID cid, CGSCursorID cursor, int *outDataSize);
67
68 /*! Gets the data for a system-defined cursor. */
69 CG_EXTERN CGError CGSGetSystemDefinedCursorData(CGSConnectionID cid, CGSCursorID cursor, void *outData, int *outRowBytes, CGRect *outRect, CGRect *outHotSpot, int *outDepth, int *outComponents, int *outBitsPerComponent);
70
71 /*! Gets the cursor 'seed'. Every time the cursor is updated, the seed changes. */
72 CG_EXTERN int CGSCurrentCursorSeed(void);
73
74 /*! Shows or hides the spinning beachball of death. */
75 CG_EXTERN CGError CGSForceWaitCursorActive(CGSConnectionID cid, bool showWaitCursor);
76
77 CG_EXTERN_C_END