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"
26 #include "CGSTransitions.h"
29 kCGSNotificationDebugOptionsChanged = 200,
31 kCGSNotificationMouseMoved = 715,
33 kCGSNotificationTrackingRegionEntered = 718,
34 kCGSNotificationTrackingRegionExited = 719,
36 // 724 - keyboard preferences changed
38 // 729, 730 seem to be process deactivated / activated - but only for this process
39 // 731 seems to be this process hidden or shown
41 kCGSNotificationAppUnresponsive = 750,
42 kCGSNotificationAppResponsive = 751,
44 // 761 - hotkey disabled
45 // 762 - hotkey enabled (do these two fire twice?)
47 // 763 - hotkey begins editing
48 // 764 - hotkey ends editing
50 // 765, 766 seem to be about the hotkey state (all disabled, etc)
52 kCGSNotificationWorkspaceChanged = 1401,
54 kCGSNotificationTransitionEnded = 1700,
55 } CGSNotificationType;
57 //! The data sent with kCGSNotificationAppUnresponsive and kCGSNotificationAppResponsive.
60 uint16_t majorVersion;
61 uint16_t minorVersion;
63 uint16_t minorVersion;
64 uint16_t majorVersion;
67 //! The length of the entire notification.
72 ProcessSerialNumber psn;
73 } CGSProcessNotificationData;
75 //! The data sent with kCGSNotificationDebugOptionsChanged.
78 int unknown[2]; // these two seem to be zero
79 } CGSDebugNotificationData;
81 //! The data sent with kCGSNotificationTransitionEnded
83 CGSTransitionID transition;
84 } CGSTransitionNotificationData;
87 typedef void (*CGSNotifyProcPtr)(CGSNotificationType type, void *data, unsigned int dataLength, void *userData);
91 //! Registers a function to receive notifications.
92 CG_EXTERN CGError CGSRegisterNotifyProc(CGSNotifyProcPtr proc, CGSNotificationType type, void *userData);
94 //! Unregisters a function that was registered to receive notifications.
95 CG_EXTERN CGError CGSRemoveNotifyProc(CGSNotifyProcPtr proc, CGSNotificationType type, void *userData);