Second Revision (from Archive)
[~jspiros/WindowBlur.git] / CGSInternal / CGSMisc.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 "CGSInternal.h"
26
27 CG_EXTERN_C_BEGIN
28
29 /*! DOCUMENTATION PENDING */
30 CG_EXTERN CGError CGSFetchDirtyScreenRegion(CGSConnectionID cid, CGSRegionObj *outDirtyRegion);
31
32 /*! Is someone watching this screen? Applies to Apple's remote desktop only? */
33 CG_EXTERN bool CGSIsScreenWatcherPresent(void);
34
35 /*! Returns     `True` if the application has been deemed unresponsive for a certain amount of time. */
36 CG_EXTERN bool CGSEventIsAppUnresponsive(CGSConnectionID cid, const ProcessSerialNumber *psn);
37
38 /*! Sets the amount of time it takes for an application to be considered unresponsive. */
39 CG_EXTERN CGError CGSEventSetAppIsUnresponsiveNotificationTimeout(CGSConnectionID cid, double time);
40
41 /*! Sets the cursor position. */
42 CG_EXTERN CGError CGSWarpCursorPosition(CGSConnectionID cid, float x, float y);
43
44 /*! DOCUMENTATION PENDING */
45 CG_EXTERN CGError CGSHideBackstopMenuBar(CGSConnectionID cid);
46 CG_EXTERN CGError CGSShowBackstopMenuBar(CGSConnectionID cid);
47
48 /*! Determines if this computer is portable. Internally this just checks to see if it has a battery. */
49 CG_EXTERN bool CGSIsPortableMachine(void);
50
51 /*! Sets the area taken up by the dock. Requires the caller to be a universal owner. */
52 CG_EXTERN CGError CGSSetDockRect(CGSConnectionID cid, float x, float y, float width, float height);
53
54 /*! DOCUMENTATION PENDING - returns false. Perhaps related to the CGSTBE_QDACCEL env variable. */
55 CG_EXTERN bool CGSIsClassicBuffered(void);
56
57 #pragma mark errors
58 /* Logs an error and returns `err`. */
59 CG_EXTERN CGError CGSGlobalError(CGError err, const char *msg);
60
61 /* Logs an error and returns `err`. */
62 CG_EXTERN CGError CGSGlobalErrorv(CGError err, const char *msg, ...);
63
64 /*! Gets the error message for an error code. */
65 CG_EXTERN char *CGSErrorString(CGError error);
66
67 #pragma mark input
68 /*! Gets and sets the status of secure input. When secure input is enabled, keyloggers, etc are harder to do. */
69 CG_EXTERN bool CGSIsSecureEventInputSet(void);
70 CG_EXTERN CGError CGSSetSecureEventInput(CGSConnectionID cid, bool useSecureInput);
71
72 CG_EXTERN_C_END