-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathBHWindow.m
46 lines (37 loc) · 1.08 KB
/
BHWindow.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//
// BHWindow.m
// BezelHUD
//
// Created by Julius Eckert on 05.05.08.
// Copyright 2008 __MyCompanyName__. All rights reserved.
//
#import "BHWindow.h"
#import "BlurSetting.h"
int blurFilter = -1;
BHFieldEditor* fEditor = nil;
@implementation BHWindow
-(void) applyBlurEffect {
if (!SUPPORT_BLURRING) return;
if (blurFilter != -1) return;
CGSNewCIFilterByName(_CGSDefaultConnection(), (CFStringRef)@"CIGaussianBlur", &blurFilter);
CGSAddWindowFilter(_CGSDefaultConnection(), [self windowNumber], blurFilter, 12289);
NSDictionary* dict = [NSDictionary dictionaryWithObject:[NSNumber numberWithFloat:1.5] forKey:@"inputRadius"];
CGSSetCIFilterValuesFromDictionary(_CGSDefaultConnection(), blurFilter, dict);
}
-(void) makeKeyAndOrderFront:(id)sender {
[super makeKeyAndOrderFront:sender];
[self applyBlurEffect];
}
- (NSTimeInterval)animationResizeTime:(NSRect)newWindowFrame
{
return 0.05f;
}
//*
-(NSText*) fieldEditor:(BOOL)createWhenNeeded forObject:(id)anObject {
if (!fEditor)
fEditor = [[BHFieldEditor alloc] init];
//[anObject addSubview:fe];
return fEditor;
}
/**/
@end