2 * Copyright (C) 2007-2008 Alacatia Labs
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.
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:
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.
20 * Joe Ranieri joe@alacatia.com
25 #include "CGSInternal.h"
29 /*! DOCUMENTATION PENDING */
30 CG_EXTERN CGError CGSFetchDirtyScreenRegion(CGSConnectionID cid, CGSRegionObj *outDirtyRegion);
32 /*! Is someone watching this screen? Applies to Apple's remote desktop only? */
33 CG_EXTERN bool CGSIsScreenWatcherPresent(void);
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);
38 /*! Sets the amount of time it takes for an application to be considered unresponsive. */
39 CG_EXTERN CGError CGSEventSetAppIsUnresponsiveNotificationTimeout(CGSConnectionID cid, double time);
41 /*! Sets the cursor position. */
42 CG_EXTERN CGError CGSWarpCursorPosition(CGSConnectionID cid, float x, float y);
44 /*! DOCUMENTATION PENDING */
45 CG_EXTERN CGError CGSHideBackstopMenuBar(CGSConnectionID cid);
46 CG_EXTERN CGError CGSShowBackstopMenuBar(CGSConnectionID cid);
48 /*! Determines if this computer is portable. Internally this just checks to see if it has a battery. */
49 CG_EXTERN bool CGSIsPortableMachine(void);
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);
54 /*! DOCUMENTATION PENDING - returns false. Perhaps related to the CGSTBE_QDACCEL env variable. */
55 CG_EXTERN bool CGSIsClassicBuffered(void);
58 /* Logs an error and returns `err`. */
59 CG_EXTERN CGError CGSGlobalError(CGError err, const char *msg);
61 /* Logs an error and returns `err`. */
62 CG_EXTERN CGError CGSGlobalErrorv(CGError err, const char *msg, ...);
64 /*! Gets the error message for an error code. */
65 CG_EXTERN char *CGSErrorString(CGError error);
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);