5 // Created by Joseph Spiros on 5/12/09.
6 // Copyright 2009 __MyCompanyName__. All rights reserved.
9 #import "WindowBlurSIMBL.h"
10 #import "WindowBlurWindowHack.h"
11 #import <objc/objc-class.h>
13 void MethodSwizzle(Class aClass, SEL orig_sel, SEL alt_sel)
15 Method orig_method = nil, alt_method = nil;
17 // First, look for the methods
18 orig_method = class_getInstanceMethod(aClass, orig_sel);
19 alt_method = class_getInstanceMethod(aClass, alt_sel);
21 // If both are found, swizzle them
22 if ((orig_method != nil) && (alt_method != nil))
27 temp1 = orig_method->method_types;
28 orig_method->method_types = alt_method->method_types;
29 alt_method->method_types = temp1;
31 temp2 = orig_method->method_imp;
32 orig_method->method_imp = alt_method->method_imp;
33 alt_method->method_imp = temp2;
37 @implementation WindowBlurSIMBL
40 [WindowBlurWindowHack poseAsClass:[NSWindow class]];