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 "CGSConnection.h"
27 typedef int CGSTransitionID;
35 kCGSTransitionWarpFade,
38 kCGSTransitionWarpSwitch,
43 /*! Directions for the transition. Some directions don't apply to some transitions. */
44 kCGSTransitionDirectionLeft = 1 << 0,
45 kCGSTransitionDirectionRight = 1 << 1,
46 kCGSTransitionDirectionDown = 1 << 2,
47 kCGSTransitionDirectionUp = 1 << 3,
48 kCGSTransitionDirectionCenter = 1 << 4,
50 /*! Reverses a transition. Doesn't apply for all transitions. */
51 kCGSTransitionFlagReversed = 1 << 5,
53 /*! Ignore the background color and only transition the window. */
54 kCGSTransitionFlagTransparent = 1 << 7,
58 int unknown; // always set to zero
59 CGSTransitionType type;
60 CGSTransitionFlags options;
61 CGSWindowID wid; /* 0 means a full screen transition. */
62 float *backColor; /* NULL means black. */
67 /*! Creates a new transition from a `CGSTransitionSpec`. */
68 CG_EXTERN CGError CGSNewTransition(CGSConnectionID cid, const CGSTransitionSpec *spec, CGSTransitionID *outTransition);
70 /*! Invokes a transition asynchronously. Note that `duration` is in seconds. */
71 CG_EXTERN CGError CGSInvokeTransition(CGSConnectionID cid, CGSTransitionID transition, float duration);
73 /*! Releases a transition. */
74 CG_EXTERN CGError CGSReleaseTransition(CGSConnectionID cid, CGSTransitionID transition);