First Revision (from Archive)
[~jspiros/WindowBlur.git] / CGSInternal / CGSCIFilter.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 #include "CGSWindow.h"
27
28 typedef int CGSCIFilterID;
29
30 /*! Creates a new CGSCIFilter from a filter name. These names are the same as you'd usually use for CIFilters. */
31 CG_EXTERN CGError CGSNewCIFilterByName(CGSConnectionID cid, CFStringRef filterName, CGSCIFilterID *outFilter);
32
33 /*! Adds or removes a CIFilter to a window. Flags are currently unknown (the Dock uses 0x3001).
34         Note: This stuff is VERY crashy under 10.4.10 - make sure to remove the filter before minimizing the window or closing it. */
35 CG_EXTERN CGError CGSAddWindowFilter(CGSConnectionID cid, CGSWindowID wid, CGSCIFilterID filter, int flags);
36 CG_EXTERN CGError CGSRemoveWindowFilter(CGSConnectionID cid, CGSWindowID wid, CGSCIFilterID filter);
37
38 enum {
39         kCGWindowFilterUnderlay = 1,
40         kCGWindowFilterDock = 0x3001,
41 };
42
43 /*! Loads a set of values into the CIFilter. */
44 CG_EXTERN CGError CGSSetCIFilterValuesFromDictionary(CGSConnectionID cid, CGSCIFilterID filter, CFDictionaryRef filterValues);
45
46 /*! Releases a CIFilter. */
47 CG_EXTERN CGError CGSReleaseCIFilter(CGSConnectionID cid, CGSCIFilterID filter);
48
49 CG_EXTERN_C_END