Full Code of weAreYeah/WAYWindow for AI

master 7d25185d0a7f cached
16 files
104.4 KB
23.9k tokens
1 requests
Download .txt
Repository: weAreYeah/WAYWindow
Branch: master
Commit: 7d25185d0a7f
Files: 16
Total size: 104.4 KB

Directory structure:
gitextract_c5i6pguk/

├── .gitignore
├── LICENSE
├── README.md
├── WAYWindow/
│   ├── WAYWindow.h
│   └── WAYWindow.m
├── WAYWindowDemo/
│   ├── AppDelegate.h
│   ├── AppDelegate.m
│   ├── Base.lproj/
│   │   └── MainMenu.xib
│   ├── Info.plist
│   ├── WAYWindow.h
│   ├── WAYWindow.m
│   └── main.m
└── WAYWindowDemo.xcodeproj/
    ├── project.pbxproj
    └── project.xcworkspace/
        ├── contents.xcworkspacedata
        └── xcshareddata/
            ├── WAYWindow.xccheckout
            └── WAYWindowDemo.xccheckout

================================================
FILE CONTENTS
================================================

================================================
FILE: .gitignore
================================================

#####
# OS X temporary files that should never be committed
#
# c.f. http://www.westwind.com/reference/os-x/invisibles.html

.DS_Store

# c.f. http://www.westwind.com/reference/os-x/invisibles.html

.Trashes

# c.f. http://www.westwind.com/reference/os-x/invisibles.html

*.swp

#
# *.lock - this is used and abused by many editors for many different things.
#    For the main ones I use (e.g. Eclipse), it should be excluded 
#    from source-control, but YMMV.
#   (lock files are usually local-only file-synchronization on the local FS that should NOT go in git)
# c.f. the "OPTIONAL" section at bottom though, for tool-specific variations!

*.lock


#
# profile - REMOVED temporarily (on double-checking, I can't find it in OS X docs?)
#profile


####
# Xcode temporary files that should never be committed
# 
# NB: NIB/XIB files still exist even on Storyboard projects, so we want this...

*~.nib


####
# Xcode build files -
#
# NB: slash on the end, so we only remove the FOLDER, not any files that were badly named "DerivedData"

DerivedData/

# NB: slash on the end, so we only remove the FOLDER, not any files that were badly named "build"

build/


#####
# Xcode private settings (window sizes, bookmarks, breakpoints, custom executables, smart groups)
#
# This is complicated:
#
# SOMETIMES you need to put this file in version control.
# Apple designed it poorly - if you use "custom executables", they are
#  saved in this file.
# 99% of projects do NOT use those, so they do NOT want to version control this file.
#  ..but if you're in the 1%, comment out the line "*.pbxuser"

# .pbxuser: http://lists.apple.com/archives/xcode-users/2004/Jan/msg00193.html

*.pbxuser

# .mode1v3: http://lists.apple.com/archives/xcode-users/2007/Oct/msg00465.html

*.mode1v3

# .mode2v3: http://lists.apple.com/archives/xcode-users/2007/Oct/msg00465.html

*.mode2v3

# .perspectivev3: http://stackoverflow.com/questions/5223297/xcode-projects-what-is-a-perspectivev3-file

*.perspectivev3

#    NB: also, whitelist the default ones, some projects need to use these
!default.pbxuser
!default.mode1v3
!default.mode2v3
!default.perspectivev3


####
# Xcode 4 - semi-personal settings
#
#
# OPTION 1: ---------------------------------
#     throw away ALL personal settings (including custom schemes!
#     - unless they are "shared")
#
# NB: this is exclusive with OPTION 2 below
xcuserdata

# OPTION 2: ---------------------------------
#     get rid of ALL personal settings, but KEEP SOME OF THEM
#     - NB: you must manually uncomment the bits you want to keep
#
# NB: this *requires* git v1.8.2 or above; you may need to upgrade to latest OS X,
#    or manually install git over the top of the OS X version
# NB: this is exclusive with OPTION 1 above
#
#xcuserdata/**/*

#     (requires option 2 above): Personal Schemes
#
#!xcuserdata/**/xcschemes/*

####
# XCode 4 workspaces - more detailed
#
# Workspaces are important! They are a core feature of Xcode - don't exclude them :)
#
# Workspace layout is quite spammy. For reference:
#
# /(root)/
#   /(project-name).xcodeproj/
#     project.pbxproj
#     /project.xcworkspace/
#       contents.xcworkspacedata
#       /xcuserdata/
#         /(your name)/xcuserdatad/
#           UserInterfaceState.xcuserstate
#     /xcsshareddata/
#       /xcschemes/
#         (shared scheme name).xcscheme
#     /xcuserdata/
#       /(your name)/xcuserdatad/
#         (private scheme).xcscheme
#         xcschememanagement.plist
#
#

####
# Xcode 4 - Deprecated classes
#
# Allegedly, if you manually "deprecate" your classes, they get moved here.
#
# We're using source-control, so this is a "feature" that we do not want!

*.moved-aside

####
# OPTIONAL: Some well-known tools that people use side-by-side with Xcode / iOS development
#
# NB: I'd rather not include these here, but gitignore's design is weak and doesn't allow
#     modular gitignore: you have to put EVERYTHING in one file.
#
# COCOAPODS:
#
# c.f. http://guides.cocoapods.org/using/using-cocoapods.html#what-is-a-podfilelock
# c.f. http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control
#
#!Podfile.lock
#
# RUBY:
#
# c.f. http://yehudakatz.com/2010/12/16/clarifying-the-roles-of-the-gemspec-and-gemfile/
#
#!Gemfile.lock
#
# IDEA:
#
#.idea
#
# TEXTMATE:
#
# -- UNVERIFIED: c.f. http://stackoverflow.com/a/50283/153422
#
#tm_build_errors

####
# UNKNOWN: recommended by others, but I can't discover what these files are
#
# Community suggestions (unverified, no evidence available - DISABLED by default)
#
# 1. Xcode 5 - VCS file
#
# "The data in this file not represent state of your project.
# If you'll leave this file in git - you will have merge conflicts during 
# pull your cahnges to other's repo"
#
#*.xccheckout

================================================
FILE: LICENSE
================================================
WAYWindow 
by Raffael Hannemann (@raffael_me, @weAreYeah)

Licensed under the BSD License http://www.opensource.org/licenses/bsd-license THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

================================================
FILE: README.md
================================================
WAYWindow
=========

```NSWindow``` subclass that simplifies Yosemite exclusive features:

 - custom titlebar height
 - custom traffic lights margings
 - simplified NSAppearance switching
 - and more

This NSWindow subclass provides an interface to enable OS X 10.10 Yosemite exclusive features conveniently.
Next to customizing the look of the ```WAYWindow``` content view, you can also customize the title bar and standard window buttons ('traffic lights').
The public interface is generally similar to ```INAppStoreWindow``` to facilitate the migration.
Whenever it makes sense, the properties of your ```WAYWindow``` instance in Interface Builder are inspectable.


Tips:
 - Check out the WWDC '14 session "Adopting Advanced Features of the New UI of OS X Yosemite", which provides more details on how to make use of the new Yosemite APIs.
 - Also check out the new APIs in ```NSScrollView``` to make use of contentInsets, scrollInsets, and more.

Many thanks to [@indragie](http://twitter.com/indragie) for his [INAppStoreWindow](https://github.com/indragiek/INAppStoreWindow/), which has been the inspiration for this class.

Example
-------

![WAYWindow](WAYWindow%20Example.png)


Usage
-----

1. Drag a new ```NSWindow``` instance to your XIB
2. Set the class of the instance to ```WAYWindow```
3. Customize the properties via Interface Builder or programmatically

**Note: You should probably consider using [WAYAppStoreWindow](https://github.com/weAreYeah/WAYAppStoreWindow/) instead of this class directly!**



Interesting
-----------
We are new, weAreYeah.com.
Follow us on [@weAreYeah](http://twitter.com/weAreYeah) for upcoming goodies.

License
-------

Licensed under the BSD License <http://www.opensource.org/licenses/bsd-license>

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

<a href="http://www.weAreYeah.com/"><img src="http://www.weAreYeah.com/we-are-yeah-black@2x.jpg" width="75" /></a>


================================================
FILE: WAYWindow/WAYWindow.h
================================================
//
//  WAYWindow.m
//  WAYWindow
//
//  Created by Raffael Hannemann on 15.11.14.
//  Copyright (c) 2014 Raffael Hannemann. All rights reserved.
//  Visit weAreYeah.com or follow @weareYeah for updates.
//
//  Licensed under the BSD License <http://www.opensource.org/licenses/bsd-license>
//  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
//  EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
//  SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
//  TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
//  BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
//  STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
//  THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//

#import <Cocoa/Cocoa.h>

/** This NSWindow subclass provides an interface to enable OS X 10.10 Yosemite exclusive features conveniently. Next to customizing the look of the WAYWindow content view, you can also customize the title bar and standard window buttons (`traffic lights´). The public interface is generally similar to INAppStoreWindow to simplify the migration.
 Whenever it makes sense, the properties of your WAYWindow instance in Interface Builder are inspectable.
 
 Tips:
 - Check out the WWDC '14 session `Adopting Advanced Features of the New UI of OS X Yosemite´, which provides more details on how to make use of the new Yosemite APIs.
 - Also check out the new APIs in NSScrollView to make use of contentInsets, scrollInsets, and more.
 */
@interface WAYWindow : NSWindow

/// Returns YES, if the class supports vibrant appearances. Can be used to determine if running on OS X 10.10+
+ (BOOL) supportsVibrantAppearances;

/// Defines the window's titlebar height. Defaut: OS X default value.
@property (nonatomic) IBInspectable CGFloat titleBarHeight;

//// Returns the titlebar view of the window, which you can add arbitrary subviews to.
@property (strong,readonly) IBOutlet NSView *titleBarView;

/// If set to YES, the standard window button will be vertically centered. Default: YES.
@property (nonatomic) IBInspectable BOOL centerTrafficLightButtons;

/// Defines the left margin of the standard window buttons. Defaut: OS X default value.
@property (nonatomic) IBInspectable CGFloat trafficLightButtonsLeftMargin;

/// Defines the top margin of the standard window buttons. Used if not centered. Defaut: OS X default value.
@property (nonatomic) IBInspectable CGFloat trafficLightButtonsTopMargin;

/// If set to YES, the title of the window will be hidden. Default: YES.
@property (nonatomic) IBInspectable BOOL hidesTitle;

/// Replaces the window's content view with an instance of NSVisualEffectView and applies the Vibrant Dark look. Transfers all subviews to the new content view.
- (void) setContentViewAppearanceVibrantDark;

/// Replaces the window's content view with an instance of NSVisualEffectView and applies the Vibrant Light look. Transfers all subviews to the new content view.
- (void) setContentViewAppearanceVibrantLight;

/// Convenient method to set the NSAppearance of the window to NSAppearanceNameVibrantDark
- (void) setVibrantDarkAppearance;

/// Convenient method to set the NSAppearance of the window to NSAppearanceNameVibrantLight
- (void) setVibrantLightAppearance;

/// Convenient method to set the NSAppearance of the window to NSAppearanceNameVibrantAqua
- (void) setAquaAppearance;

/// Replaces a view of the window subview hierarchy with the specified view, and transfers all current subviews to the new one. The frame of the new view will be set to the frame of the old view, if flag is YES.
- (void) replaceSubview: (NSView *) aView withView: (NSView *) newView resizing: (BOOL) flag;

/// Replaces a view of the window subview hierarchy with a new view of the specified NSView class, and transfers all current subviews to the new one.
- (NSView *) replaceSubview: (NSView *) aView withViewOfClass: (Class) newViewClass;

/// Returns YES if the window is currently in full-screen.
- (BOOL) isFullScreen;

@end


================================================
FILE: WAYWindow/WAYWindow.m
================================================
//
//  WAYWindow.m
//  WAYWindow
//
//  Created by Raffael Hannemann on 15.11.14.
//  Copyright (c) 2014 Raffael Hannemann. All rights reserved.
//  Visit weAreYeah.com or follow @weareYeah for updates.
//
//  Licensed under the BSD License <http://www.opensource.org/licenses/bsd-license>
//  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
//  EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
//  SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
//  TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
//  BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
//  STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
//  THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//

#import "WAYWindow.h"

/** 
 Convenience methods to make NSPointerArray act like a stack of selectors. It would be a subclass, but NSPointerArray
 is a class cluster and doesn't really like being subclassed.
 */
#pragma mark - WAY_SelectorStack
@interface NSPointerArray (WAY_SelectorStack)
- (instancetype)initWAYSelectorStack;
- (BOOL)way_containsSelector:(SEL)aSelector;
- (void)way_pushSelector:(SEL)aSelector;
- (SEL)way_pop;
@end

@implementation NSPointerArray (WAY_SelectorStack)
- (instancetype)initWAYSelectorStack {
	NSPointerFunctions *pointerFunctions = [NSPointerFunctions pointerFunctionsWithOptions:(NSPointerFunctionsOpaqueMemory |
																							NSPointerFunctionsOpaquePersonality)];
	self = [self initWithPointerFunctions:pointerFunctions];
	return self;
}

- (BOOL)way_containsSelector:(SEL)aSelector {
	NSInteger count = self.count;
	for (NSInteger i=0; i<count; ++i) {
		SEL sel = [self pointerAtIndex:i];
		if (aSelector == sel) {
			return YES;
		}
	}
	return NO;
}
- (void)way_pushSelector:(SEL)aSelector {
	[self addPointer:aSelector];
}

- (SEL)way_pop {
	NSInteger index = self.count - 1;
	SEL theSel = [self pointerAtIndex:index];
	[self removePointerAtIndex:index];
	return theSel;
}

@end





@interface WAYWindowDelegateProxy : NSProxy <NSWindowDelegate>
@property (nonatomic, weak) id<NSWindowDelegate> secondaryDelegate;
@property (nonatomic, weak) id<NSWindowDelegate> firstDelegate;
@end

/** Since the window needs to update itself at specific events, e.g., windowDidResize:;, we need to set the window as its own delegate. To allow proper window delegates as usual, we need to make use of a proxy object, which forwards all method invovations first to the WAYWindow instance, and then to the real delegate. */
#pragma mark - WAYWindowDelegateProxy
@implementation WAYWindowDelegateProxy {
	NSPointerArray *_selectorStack;
}

- (instancetype)init {
	_selectorStack = [[NSPointerArray alloc] initWAYSelectorStack];
	return self;
}

- (NSMethodSignature *)methodSignatureForSelector:(SEL)selector {
	NSMethodSignature *signature = [[self.firstDelegate class] instanceMethodSignatureForSelector:selector];
	if (!signature) {
		signature = [[self.secondaryDelegate class] instanceMethodSignatureForSelector:selector];
		if (!signature) {
			signature = [super methodSignatureForSelector:selector];
		}
	}
	return signature;
}

- (BOOL)respondsToSelector:(SEL)aSelector {
	if (aSelector==@selector(windowDidResize:)) {
		return YES;
	} else if ([self.secondaryDelegate respondsToSelector:aSelector]) {
		return YES;
	} else {
		return NO;
	}
}

- (void)forwardInvocation:(NSInvocation *)anInvocation {
	SEL selector = anInvocation.selector;
	if ([_selectorStack way_containsSelector:selector]) {
		// We're already in the middle of forwarding this selector; stop the infinite recursion right here.
		return;
	}
	
	[_selectorStack way_pushSelector:selector];
	{
		if ([self.firstDelegate respondsToSelector:selector]) {
			[anInvocation invokeWithTarget:self.firstDelegate];
		}
		if ([self.secondaryDelegate respondsToSelector:selector]) {
			[anInvocation invokeWithTarget:self.secondaryDelegate];
		}
	}
	[_selectorStack way_pop];
}

- (BOOL)isKindOfClass:(Class)aClass {
	if (self.secondaryDelegate) {
		return [self.secondaryDelegate isKindOfClass:aClass];
	}
	return NO;
}
@end


#pragma mark - WAYWindow
@interface WAYWindow () <NSWindowDelegate>
@property (strong) WAYWindowDelegateProxy* delegateProxy;
@property (strong) NSArray* standardButtons;
@property (strong) NSTitlebarAccessoryViewController *dummyTitlebarAccessoryViewController;

@end

static float kWAYWindowDefaultTrafficLightButtonsLeftMargin = 0;
static float kWAYWindowDefaultTrafficLightButtonsTopMargin = 0;

@implementation WAYWindow

+ (BOOL) supportsVibrantAppearances {
	return (NSClassFromString(@"NSVisualEffectView")!=nil);
}

+ (float) defaultTitleBarHeight {
	NSRect frame = NSMakeRect(0, 0, 800, 600);
	NSRect contentRect = [NSWindow contentRectForFrameRect:frame styleMask: NSTitledWindowMask];
	return NSHeight(frame) - NSHeight(contentRect);
}

#pragma mark - NSWindow Overwritings

- (id)initWithContentRect:(NSRect)contentRect styleMask:(NSUInteger)aStyle backing:(NSBackingStoreType)bufferingType defer:(BOOL)flag {
	if ((self = [super initWithContentRect:contentRect styleMask:aStyle backing:bufferingType defer:flag])) {
		[self _setUp];
	}
	return self;
}

- (id)initWithContentRect:(NSRect)contentRect styleMask:(NSUInteger)aStyle backing:(NSBackingStoreType)bufferingType defer:(BOOL)flag screen:(NSScreen *)screen {
	if ((self = [super initWithContentRect:contentRect styleMask:aStyle backing:bufferingType defer:flag screen:screen])) {
		[self _setUp];
	}
	return self;
}

- (void) setDelegate:(id<NSWindowDelegate>)delegate {
	[_delegateProxy setSecondaryDelegate:delegate];
	[super setDelegate:nil];
	[super setDelegate:_delegateProxy];
}

- (id<NSWindowDelegate>) delegate {
	return [_delegateProxy secondaryDelegate];
}

- (void) setFrame:(NSRect)frameRect display:(BOOL)flag {
	[super setFrame:frameRect display:flag];
	[self _setNeedsLayout];
}

- (void) restoreStateWithCoder:(NSCoder *)coder {
	[super restoreStateWithCoder:coder];
	[self _setNeedsLayout];
}

- (void) orderFront:(id)sender {
	[super orderFront:sender];
	[self _setNeedsLayout];
}

#pragma mark - Public

- (NSView *) titleBarView {
	return [_standardButtons[0] superview];
}

- (void) setCenterTrafficLightButtons:(BOOL)centerTrafficLightButtons {
	_centerTrafficLightButtons = centerTrafficLightButtons;
	[self _setNeedsLayout];
}

- (void) setTitleBarHeight:(CGFloat)titleBarHeight {

	titleBarHeight = MAX(titleBarHeight,[[self class] defaultTitleBarHeight]);
	CGFloat delta = titleBarHeight - _titleBarHeight;
	_titleBarHeight = titleBarHeight;
	
	if (_dummyTitlebarAccessoryViewController) {
		[self removeTitlebarAccessoryViewControllerAtIndex:0];
	}
	
	NSView *view = [[NSView alloc] initWithFrame:NSMakeRect(0, 0, 10, titleBarHeight-[WAYWindow defaultTitleBarHeight])];
	_dummyTitlebarAccessoryViewController = [NSTitlebarAccessoryViewController new];
	_dummyTitlebarAccessoryViewController.view = view;
	_dummyTitlebarAccessoryViewController.fullScreenMinHeight = titleBarHeight;
	[self addTitlebarAccessoryViewController:_dummyTitlebarAccessoryViewController];
	
	NSRect frame = self.frame;
	frame.size.height += delta;
	frame.origin.y -= delta;
	
	[self _setNeedsLayout];
	[self setFrame:frame display:NO]; // NO is important.
}

- (void) setHidesTitle:(BOOL)hidesTitle {
	_hidesTitle = hidesTitle;
	[self setTitleVisibility:hidesTitle ? NSWindowTitleHidden : NSWindowTitleVisible];
}

- (void) setContentViewAppearanceVibrantDark {
	[self setContentViewAppearance:NSVisualEffectMaterialDark];
}

- (void) setContentViewAppearanceVibrantLight {
	[self setContentViewAppearance:NSVisualEffectMaterialLight];
}

- (void) setContentViewAppearance: (int) material {
	if (![WAYWindow supportsVibrantAppearances])
		return;
	
	NSVisualEffectView *newContentView = (NSVisualEffectView *)[self replaceSubview:self.contentView withViewOfClass:[NSVisualEffectView class]];
	[newContentView setMaterial:material];
	[self setContentView:newContentView];
}

- (void) setVibrantDarkAppearance {
	[self setAppearance:[NSAppearance appearanceNamed:NSAppearanceNameVibrantDark]];
}

- (void) setVibrantLightAppearance {
	[self setAppearance:[NSAppearance appearanceNamed:NSAppearanceNameVibrantLight]];
}

- (void) setAquaAppearance {
	[self setAppearance:[NSAppearance appearanceNamed:NSAppearanceNameAqua]];
}

- (BOOL) isFullScreen {
	return (([self styleMask] & NSFullScreenWindowMask) == NSFullScreenWindowMask);
}

- (void) replaceSubview: (NSView *) aView withView: (NSView *) newView resizing:(BOOL)flag {
	if (flag) {
		[newView setFrame:aView.frame];
	}
	
	[newView setAutoresizesSubviews:aView.autoresizesSubviews];
	[aView.subviews.copy enumerateObjectsUsingBlock:^(NSView *subview, NSUInteger idx, BOOL *stop) {
		NSRect frame = subview.frame;
		if (subview.constraints.count>0) {
			// Note: so far, constraint based contentView subviews are not supported yet
			NSLog(@"WARNING: [%@ %@] does not work yet with NSView instances, that use auto-layout.",
				  NSStringFromClass([self class]),
				  NSStringFromSelector(_cmd));
		}
		[subview removeFromSuperview];
		[newView addSubview:subview];
		[subview setFrame:frame];
	}];
	
	if (aView==self.contentView) {
		[self setContentView: newView];
	} else {
		[aView.superview replaceSubview:aView with:newView];
	}
	[self _setNeedsLayout];
}

- (NSView *) replaceSubview:(NSView *)aView withViewOfClass:(Class)newViewClass {
	NSView *view = [[newViewClass alloc] initWithFrame:aView.frame];
	[self replaceSubview:aView withView:view resizing:YES];
	return view;
}

#pragma mark - Private

- (void) _setUp {
	_delegateProxy = [[WAYWindowDelegateProxy alloc] init];
	_delegateProxy.firstDelegate = self;
	super.delegate = _delegateProxy;
	
	_standardButtons = @[[self standardWindowButton:NSWindowCloseButton],
						 [self standardWindowButton:NSWindowMiniaturizeButton],
						 [self standardWindowButton:NSWindowZoomButton]];
	_centerTrafficLightButtons = YES;
	
	NSButton *closeButton = [self standardWindowButton:NSWindowCloseButton];
	kWAYWindowDefaultTrafficLightButtonsLeftMargin = NSMinX(closeButton.frame);
	kWAYWindowDefaultTrafficLightButtonsTopMargin = NSHeight(closeButton.superview.frame)-NSMaxY(closeButton.frame);
	
	self.styleMask |= NSFullSizeContentViewWindowMask;
	_trafficLightButtonsLeftMargin = kWAYWindowDefaultTrafficLightButtonsLeftMargin;
	_trafficLightButtonsTopMargin = kWAYWindowDefaultTrafficLightButtonsTopMargin;
	
	self.hidesTitle = YES;
	
	[super setDelegate:self];
	[self _setNeedsLayout];
}

- (void) _setNeedsLayout {
	[_standardButtons enumerateObjectsUsingBlock:^(NSButton *standardButton, NSUInteger idx, BOOL *stop) {
		NSRect frame = standardButton.frame;
		if (_centerTrafficLightButtons)
			frame.origin.y = NSHeight(standardButton.superview.frame)/2-NSHeight(standardButton.frame)/2;
		else
			frame.origin.y = NSHeight(standardButton.superview.frame)-NSHeight(standardButton.frame)-_trafficLightButtonsTopMargin;
		
		frame.origin.x = _trafficLightButtonsLeftMargin +idx*(NSWidth(frame) + 6);
		[standardButton setFrame:frame];
	}];
}

#pragma mark - NSWindow Delegate

- (void) windowDidResize:(NSNotification *)notification {
	[self _setNeedsLayout];
}

@end


================================================
FILE: WAYWindowDemo/AppDelegate.h
================================================
//
//  AppDelegate.h
//  WAYWindow
//
//  Created by Raffael Hannemann on 15.11.14.
//  Copyright (c) 2014 We Are Yeah!. All rights reserved.
//

#import <Cocoa/Cocoa.h>

@interface AppDelegate : NSObject <NSApplicationDelegate>


@end



================================================
FILE: WAYWindowDemo/AppDelegate.m
================================================
//
//  AppDelegate.m
//  WAYWindow
//
//  Created by Raffael Hannemann on 15.11.14.
//  Copyright (c) 2014 We Are Yeah!. All rights reserved.
//

#import "AppDelegate.h"
#import "WAYWindow.h"

@interface AppDelegate ()

@property (weak) IBOutlet WAYWindow *window;
@property (weak) IBOutlet NSView *titlebar;
@end

@implementation AppDelegate

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
	// Insert code here to initialize your application
	[_window setVibrantDarkAppearance];
	[_window setContentViewAppearanceVibrantDark];
	[_window.titleBarView addSubview:_titlebar];
}

- (void)applicationWillTerminate:(NSNotification *)aNotification {
	// Insert code here to tear down your application
}

@end


================================================
FILE: WAYWindowDemo/Base.lproj/MainMenu.xib
================================================
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="6249" systemVersion="14B23" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" customObjectInstantitationMethod="direct">
    <dependencies>
        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="6249"/>
    </dependencies>
    <objects>
        <customObject id="-2" userLabel="File's Owner" customClass="NSApplication">
            <connections>
                <outlet property="delegate" destination="Voe-Tx-rLC" id="GzC-gU-4Uq"/>
            </connections>
        </customObject>
        <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
        <customObject id="-3" userLabel="Application" customClass="NSObject"/>
        <customObject id="Voe-Tx-rLC" customClass="AppDelegate">
            <connections>
                <outlet property="titlebar" destination="z5d-5j-EOw" id="L10-sQ-Tp4"/>
                <outlet property="window" destination="QvC-M9-y7g" id="gIp-Ho-8D9"/>
            </connections>
        </customObject>
        <customObject id="YLy-65-1bz" customClass="NSFontManager"/>
        <menu title="Main Menu" systemMenu="main" id="AYu-sK-qS6">
            <items>
                <menuItem title="WAYWindowDemo" id="1Xt-HY-uBw">
                    <modifierMask key="keyEquivalentModifierMask"/>
                    <menu key="submenu" title="WAYWindowDemo" systemMenu="apple" id="uQy-DD-JDr">
                        <items>
                            <menuItem title="About WAYWindowDemo" id="5kV-Vb-QxS">
                                <modifierMask key="keyEquivalentModifierMask"/>
                                <connections>
                                    <action selector="orderFrontStandardAboutPanel:" target="-1" id="Exp-CZ-Vem"/>
                                </connections>
                            </menuItem>
                            <menuItem isSeparatorItem="YES" id="VOq-y0-SEH"/>
                            <menuItem title="Preferences…" keyEquivalent="," id="BOF-NM-1cW"/>
                            <menuItem isSeparatorItem="YES" id="wFC-TO-SCJ"/>
                            <menuItem title="Services" id="NMo-om-nkz">
                                <modifierMask key="keyEquivalentModifierMask"/>
                                <menu key="submenu" title="Services" systemMenu="services" id="hz9-B4-Xy5"/>
                            </menuItem>
                            <menuItem isSeparatorItem="YES" id="4je-JR-u6R"/>
                            <menuItem title="Hide WAYWindowDemo" keyEquivalent="h" id="Olw-nP-bQN">
                                <connections>
                                    <action selector="hide:" target="-1" id="PnN-Uc-m68"/>
                                </connections>
                            </menuItem>
                            <menuItem title="Hide Others" keyEquivalent="h" id="Vdr-fp-XzO">
                                <modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
                                <connections>
                                    <action selector="hideOtherApplications:" target="-1" id="VT4-aY-XCT"/>
                                </connections>
                            </menuItem>
                            <menuItem title="Show All" id="Kd2-mp-pUS">
                                <modifierMask key="keyEquivalentModifierMask"/>
                                <connections>
                                    <action selector="unhideAllApplications:" target="-1" id="Dhg-Le-xox"/>
                                </connections>
                            </menuItem>
                            <menuItem isSeparatorItem="YES" id="kCx-OE-vgT"/>
                            <menuItem title="Quit WAYWindowDemo" keyEquivalent="q" id="4sb-4s-VLi">
                                <connections>
                                    <action selector="terminate:" target="-1" id="Te7-pn-YzF"/>
                                </connections>
                            </menuItem>
                        </items>
                    </menu>
                </menuItem>
                <menuItem title="File" id="dMs-cI-mzQ">
                    <modifierMask key="keyEquivalentModifierMask"/>
                    <menu key="submenu" title="File" id="bib-Uj-vzu">
                        <items>
                            <menuItem title="New" keyEquivalent="n" id="Was-JA-tGl">
                                <connections>
                                    <action selector="newDocument:" target="-1" id="4Si-XN-c54"/>
                                </connections>
                            </menuItem>
                            <menuItem title="Open…" keyEquivalent="o" id="IAo-SY-fd9">
                                <connections>
                                    <action selector="openDocument:" target="-1" id="bVn-NM-KNZ"/>
                                </connections>
                            </menuItem>
                            <menuItem title="Open Recent" id="tXI-mr-wws">
                                <modifierMask key="keyEquivalentModifierMask"/>
                                <menu key="submenu" title="Open Recent" systemMenu="recentDocuments" id="oas-Oc-fiZ">
                                    <items>
                                        <menuItem title="Clear Menu" id="vNY-rz-j42">
                                            <modifierMask key="keyEquivalentModifierMask"/>
                                            <connections>
                                                <action selector="clearRecentDocuments:" target="-1" id="Daa-9d-B3U"/>
                                            </connections>
                                        </menuItem>
                                    </items>
                                </menu>
                            </menuItem>
                            <menuItem isSeparatorItem="YES" id="m54-Is-iLE"/>
                            <menuItem title="Close" keyEquivalent="w" id="DVo-aG-piG">
                                <connections>
                                    <action selector="performClose:" target="-1" id="HmO-Ls-i7Q"/>
                                </connections>
                            </menuItem>
                            <menuItem title="Save…" keyEquivalent="s" id="pxx-59-PXV">
                                <connections>
                                    <action selector="saveDocument:" target="-1" id="teZ-XB-qJY"/>
                                </connections>
                            </menuItem>
                            <menuItem title="Save As…" keyEquivalent="S" id="Bw7-FT-i3A">
                                <connections>
                                    <action selector="saveDocumentAs:" target="-1" id="mDf-zr-I0C"/>
                                </connections>
                            </menuItem>
                            <menuItem title="Revert to Saved" id="KaW-ft-85H">
                                <modifierMask key="keyEquivalentModifierMask"/>
                                <connections>
                                    <action selector="revertDocumentToSaved:" target="-1" id="iJ3-Pv-kwq"/>
                                </connections>
                            </menuItem>
                            <menuItem isSeparatorItem="YES" id="aJh-i4-bef"/>
                            <menuItem title="Page Setup…" keyEquivalent="P" id="qIS-W8-SiK">
                                <modifierMask key="keyEquivalentModifierMask" shift="YES" command="YES"/>
                                <connections>
                                    <action selector="runPageLayout:" target="-1" id="Din-rz-gC5"/>
                                </connections>
                            </menuItem>
                            <menuItem title="Print…" keyEquivalent="p" id="aTl-1u-JFS">
                                <connections>
                                    <action selector="print:" target="-1" id="qaZ-4w-aoO"/>
                                </connections>
                            </menuItem>
                        </items>
                    </menu>
                </menuItem>
                <menuItem title="Edit" id="5QF-Oa-p0T">
                    <modifierMask key="keyEquivalentModifierMask"/>
                    <menu key="submenu" title="Edit" id="W48-6f-4Dl">
                        <items>
                            <menuItem title="Undo" keyEquivalent="z" id="dRJ-4n-Yzg">
                                <connections>
                                    <action selector="undo:" target="-1" id="M6e-cu-g7V"/>
                                </connections>
                            </menuItem>
                            <menuItem title="Redo" keyEquivalent="Z" id="6dh-zS-Vam">
                                <connections>
                                    <action selector="redo:" target="-1" id="oIA-Rs-6OD"/>
                                </connections>
                            </menuItem>
                            <menuItem isSeparatorItem="YES" id="WRV-NI-Exz"/>
                            <menuItem title="Cut" keyEquivalent="x" id="uRl-iY-unG">
                                <connections>
                                    <action selector="cut:" target="-1" id="YJe-68-I9s"/>
                                </connections>
                            </menuItem>
                            <menuItem title="Copy" keyEquivalent="c" id="x3v-GG-iWU">
                                <connections>
                                    <action selector="copy:" target="-1" id="G1f-GL-Joy"/>
                                </connections>
                            </menuItem>
                            <menuItem title="Paste" keyEquivalent="v" id="gVA-U4-sdL">
                                <connections>
                                    <action selector="paste:" target="-1" id="UvS-8e-Qdg"/>
                                </connections>
                            </menuItem>
                            <menuItem title="Paste and Match Style" keyEquivalent="V" id="WeT-3V-zwk">
                                <modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
                                <connections>
                                    <action selector="pasteAsPlainText:" target="-1" id="cEh-KX-wJQ"/>
                                </connections>
                            </menuItem>
                            <menuItem title="Delete" id="pa3-QI-u2k">
                                <modifierMask key="keyEquivalentModifierMask"/>
                                <connections>
                                    <action selector="delete:" target="-1" id="0Mk-Ml-PaM"/>
                                </connections>
                            </menuItem>
                            <menuItem title="Select All" keyEquivalent="a" id="Ruw-6m-B2m">
                                <connections>
                                    <action selector="selectAll:" target="-1" id="VNm-Mi-diN"/>
                                </connections>
                            </menuItem>
                            <menuItem isSeparatorItem="YES" id="uyl-h8-XO2"/>
                            <menuItem title="Find" id="4EN-yA-p0u">
                                <modifierMask key="keyEquivalentModifierMask"/>
                                <menu key="submenu" title="Find" id="1b7-l0-nxx">
                                    <items>
                                        <menuItem title="Find…" tag="1" keyEquivalent="f" id="Xz5-n4-O0W">
                                            <connections>
                                                <action selector="performFindPanelAction:" target="-1" id="cD7-Qs-BN4"/>
                                            </connections>
                                        </menuItem>
                                        <menuItem title="Find and Replace…" tag="12" keyEquivalent="f" id="YEy-JH-Tfz">
                                            <modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
                                            <connections>
                                                <action selector="performFindPanelAction:" target="-1" id="WD3-Gg-5AJ"/>
                                            </connections>
                                        </menuItem>
                                        <menuItem title="Find Next" tag="2" keyEquivalent="g" id="q09-fT-Sye">
                                            <connections>
                                                <action selector="performFindPanelAction:" target="-1" id="NDo-RZ-v9R"/>
                                            </connections>
                                        </menuItem>
                                        <menuItem title="Find Previous" tag="3" keyEquivalent="G" id="OwM-mh-QMV">
                                            <connections>
                                                <action selector="performFindPanelAction:" target="-1" id="HOh-sY-3ay"/>
                                            </connections>
                                        </menuItem>
                                        <menuItem title="Use Selection for Find" tag="7" keyEquivalent="e" id="buJ-ug-pKt">
                                            <connections>
                                                <action selector="performFindPanelAction:" target="-1" id="U76-nv-p5D"/>
                                            </connections>
                                        </menuItem>
                                        <menuItem title="Jump to Selection" keyEquivalent="j" id="S0p-oC-mLd">
                                            <connections>
                                                <action selector="centerSelectionInVisibleArea:" target="-1" id="IOG-6D-g5B"/>
                                            </connections>
                                        </menuItem>
                                    </items>
                                </menu>
                            </menuItem>
                            <menuItem title="Spelling and Grammar" id="Dv1-io-Yv7">
                                <modifierMask key="keyEquivalentModifierMask"/>
                                <menu key="submenu" title="Spelling" id="3IN-sU-3Bg">
                                    <items>
                                        <menuItem title="Show Spelling and Grammar" keyEquivalent=":" id="HFo-cy-zxI">
                                            <connections>
                                                <action selector="showGuessPanel:" target="-1" id="vFj-Ks-hy3"/>
                                            </connections>
                                        </menuItem>
                                        <menuItem title="Check Document Now" keyEquivalent=";" id="hz2-CU-CR7">
                                            <connections>
                                                <action selector="checkSpelling:" target="-1" id="fz7-VC-reM"/>
                                            </connections>
                                        </menuItem>
                                        <menuItem isSeparatorItem="YES" id="bNw-od-mp5"/>
                                        <menuItem title="Check Spelling While Typing" id="rbD-Rh-wIN">
                                            <modifierMask key="keyEquivalentModifierMask"/>
                                            <connections>
                                                <action selector="toggleContinuousSpellChecking:" target="-1" id="7w6-Qz-0kB"/>
                                            </connections>
                                        </menuItem>
                                        <menuItem title="Check Grammar With Spelling" id="mK6-2p-4JG">
                                            <modifierMask key="keyEquivalentModifierMask"/>
                                            <connections>
                                                <action selector="toggleGrammarChecking:" target="-1" id="muD-Qn-j4w"/>
                                            </connections>
                                        </menuItem>
                                        <menuItem title="Correct Spelling Automatically" id="78Y-hA-62v">
                                            <modifierMask key="keyEquivalentModifierMask"/>
                                            <connections>
                                                <action selector="toggleAutomaticSpellingCorrection:" target="-1" id="2lM-Qi-WAP"/>
                                            </connections>
                                        </menuItem>
                                    </items>
                                </menu>
                            </menuItem>
                            <menuItem title="Substitutions" id="9ic-FL-obx">
                                <modifierMask key="keyEquivalentModifierMask"/>
                                <menu key="submenu" title="Substitutions" id="FeM-D8-WVr">
                                    <items>
                                        <menuItem title="Show Substitutions" id="z6F-FW-3nz">
                                            <modifierMask key="keyEquivalentModifierMask"/>
                                            <connections>
                                                <action selector="orderFrontSubstitutionsPanel:" target="-1" id="oku-mr-iSq"/>
                                            </connections>
                                        </menuItem>
                                        <menuItem isSeparatorItem="YES" id="gPx-C9-uUO"/>
                                        <menuItem title="Smart Copy/Paste" id="9yt-4B-nSM">
                                            <modifierMask key="keyEquivalentModifierMask"/>
                                            <connections>
                                                <action selector="toggleSmartInsertDelete:" target="-1" id="3IJ-Se-DZD"/>
                                            </connections>
                                        </menuItem>
                                        <menuItem title="Smart Quotes" id="hQb-2v-fYv">
                                            <modifierMask key="keyEquivalentModifierMask"/>
                                            <connections>
                                                <action selector="toggleAutomaticQuoteSubstitution:" target="-1" id="ptq-xd-QOA"/>
                                            </connections>
                                        </menuItem>
                                        <menuItem title="Smart Dashes" id="rgM-f4-ycn">
                                            <modifierMask key="keyEquivalentModifierMask"/>
                                            <connections>
                                                <action selector="toggleAutomaticDashSubstitution:" target="-1" id="oCt-pO-9gS"/>
                                            </connections>
                                        </menuItem>
                                        <menuItem title="Smart Links" id="cwL-P1-jid">
                                            <modifierMask key="keyEquivalentModifierMask"/>
                                            <connections>
                                                <action selector="toggleAutomaticLinkDetection:" target="-1" id="Gip-E3-Fov"/>
                                            </connections>
                                        </menuItem>
                                        <menuItem title="Data Detectors" id="tRr-pd-1PS">
                                            <modifierMask key="keyEquivalentModifierMask"/>
                                            <connections>
                                                <action selector="toggleAutomaticDataDetection:" target="-1" id="R1I-Nq-Kbl"/>
                                            </connections>
                                        </menuItem>
                                        <menuItem title="Text Replacement" id="HFQ-gK-NFA">
                                            <modifierMask key="keyEquivalentModifierMask"/>
                                            <connections>
                                                <action selector="toggleAutomaticTextReplacement:" target="-1" id="DvP-Fe-Py6"/>
                                            </connections>
                                        </menuItem>
                                    </items>
                                </menu>
                            </menuItem>
                            <menuItem title="Transformations" id="2oI-Rn-ZJC">
                                <modifierMask key="keyEquivalentModifierMask"/>
                                <menu key="submenu" title="Transformations" id="c8a-y6-VQd">
                                    <items>
                                        <menuItem title="Make Upper Case" id="vmV-6d-7jI">
                                            <modifierMask key="keyEquivalentModifierMask"/>
                                            <connections>
                                                <action selector="uppercaseWord:" target="-1" id="sPh-Tk-edu"/>
                                            </connections>
                                        </menuItem>
                                        <menuItem title="Make Lower Case" id="d9M-CD-aMd">
                                            <modifierMask key="keyEquivalentModifierMask"/>
                                            <connections>
                                                <action selector="lowercaseWord:" target="-1" id="iUZ-b5-hil"/>
                                            </connections>
                                        </menuItem>
                                        <menuItem title="Capitalize" id="UEZ-Bs-lqG">
                                            <modifierMask key="keyEquivalentModifierMask"/>
                                            <connections>
                                                <action selector="capitalizeWord:" target="-1" id="26H-TL-nsh"/>
                                            </connections>
                                        </menuItem>
                                    </items>
                                </menu>
                            </menuItem>
                            <menuItem title="Speech" id="xrE-MZ-jX0">
                                <modifierMask key="keyEquivalentModifierMask"/>
                                <menu key="submenu" title="Speech" id="3rS-ZA-NoH">
                                    <items>
                                        <menuItem title="Start Speaking" id="Ynk-f8-cLZ">
                                            <modifierMask key="keyEquivalentModifierMask"/>
                                            <connections>
                                                <action selector="startSpeaking:" target="-1" id="654-Ng-kyl"/>
                                            </connections>
                                        </menuItem>
                                        <menuItem title="Stop Speaking" id="Oyz-dy-DGm">
                                            <modifierMask key="keyEquivalentModifierMask"/>
                                            <connections>
                                                <action selector="stopSpeaking:" target="-1" id="dX8-6p-jy9"/>
                                            </connections>
                                        </menuItem>
                                    </items>
                                </menu>
                            </menuItem>
                        </items>
                    </menu>
                </menuItem>
                <menuItem title="Format" id="jxT-CU-nIS">
                    <modifierMask key="keyEquivalentModifierMask"/>
                    <menu key="submenu" title="Format" id="GEO-Iw-cKr">
                        <items>
                            <menuItem title="Font" id="Gi5-1S-RQB">
                                <modifierMask key="keyEquivalentModifierMask"/>
                                <menu key="submenu" title="Font" systemMenu="font" id="aXa-aM-Jaq">
                                    <items>
                                        <menuItem title="Show Fonts" keyEquivalent="t" id="Q5e-8K-NDq">
                                            <connections>
                                                <action selector="orderFrontFontPanel:" target="YLy-65-1bz" id="WHr-nq-2xA"/>
                                            </connections>
                                        </menuItem>
                                        <menuItem title="Bold" tag="2" keyEquivalent="b" id="GB9-OM-e27">
                                            <connections>
                                                <action selector="addFontTrait:" target="YLy-65-1bz" id="hqk-hr-sYV"/>
                                            </connections>
                                        </menuItem>
                                        <menuItem title="Italic" tag="1" keyEquivalent="i" id="Vjx-xi-njq">
                                            <connections>
                                                <action selector="addFontTrait:" target="YLy-65-1bz" id="IHV-OB-c03"/>
                                            </connections>
                                        </menuItem>
                                        <menuItem title="Underline" keyEquivalent="u" id="WRG-CD-K1S">
                                            <connections>
                                                <action selector="underline:" target="-1" id="FYS-2b-JAY"/>
                                            </connections>
                                        </menuItem>
                                        <menuItem isSeparatorItem="YES" id="5gT-KC-WSO"/>
                                        <menuItem title="Bigger" tag="3" keyEquivalent="+" id="Ptp-SP-VEL">
                                            <connections>
                                                <action selector="modifyFont:" target="YLy-65-1bz" id="Uc7-di-UnL"/>
                                            </connections>
                                        </menuItem>
                                        <menuItem title="Smaller" tag="4" keyEquivalent="-" id="i1d-Er-qST">
                                            <connections>
                                                <action selector="modifyFont:" target="YLy-65-1bz" id="HcX-Lf-eNd"/>
                                            </connections>
                                        </menuItem>
                                        <menuItem isSeparatorItem="YES" id="kx3-Dk-x3B"/>
                                        <menuItem title="Kern" id="jBQ-r6-VK2">
                                            <modifierMask key="keyEquivalentModifierMask"/>
                                            <menu key="submenu" title="Kern" id="tlD-Oa-oAM">
                                                <items>
                                                    <menuItem title="Use Default" id="GUa-eO-cwY">
                                                        <modifierMask key="keyEquivalentModifierMask"/>
                                                        <connections>
                                                            <action selector="useStandardKerning:" target="-1" id="6dk-9l-Ckg"/>
                                                        </connections>
                                                    </menuItem>
                                                    <menuItem title="Use None" id="cDB-IK-hbR">
                                                        <modifierMask key="keyEquivalentModifierMask"/>
                                                        <connections>
                                                            <action selector="turnOffKerning:" target="-1" id="U8a-gz-Maa"/>
                                                        </connections>
                                                    </menuItem>
                                                    <menuItem title="Tighten" id="46P-cB-AYj">
                                                        <modifierMask key="keyEquivalentModifierMask"/>
                                                        <connections>
                                                            <action selector="tightenKerning:" target="-1" id="hr7-Nz-8ro"/>
                                                        </connections>
                                                    </menuItem>
                                                    <menuItem title="Loosen" id="ogc-rX-tC1">
                                                        <modifierMask key="keyEquivalentModifierMask"/>
                                                        <connections>
                                                            <action selector="loosenKerning:" target="-1" id="8i4-f9-FKE"/>
                                                        </connections>
                                                    </menuItem>
                                                </items>
                                            </menu>
                                        </menuItem>
                                        <menuItem title="Ligatures" id="o6e-r0-MWq">
                                            <modifierMask key="keyEquivalentModifierMask"/>
                                            <menu key="submenu" title="Ligatures" id="w0m-vy-SC9">
                                                <items>
                                                    <menuItem title="Use Default" id="agt-UL-0e3">
                                                        <modifierMask key="keyEquivalentModifierMask"/>
                                                        <connections>
                                                            <action selector="useStandardLigatures:" target="-1" id="7uR-wd-Dx6"/>
                                                        </connections>
                                                    </menuItem>
                                                    <menuItem title="Use None" id="J7y-lM-qPV">
                                                        <modifierMask key="keyEquivalentModifierMask"/>
                                                        <connections>
                                                            <action selector="turnOffLigatures:" target="-1" id="iX2-gA-Ilz"/>
                                                        </connections>
                                                    </menuItem>
                                                    <menuItem title="Use All" id="xQD-1f-W4t">
                                                        <modifierMask key="keyEquivalentModifierMask"/>
                                                        <connections>
                                                            <action selector="useAllLigatures:" target="-1" id="KcB-kA-TuK"/>
                                                        </connections>
                                                    </menuItem>
                                                </items>
                                            </menu>
                                        </menuItem>
                                        <menuItem title="Baseline" id="OaQ-X3-Vso">
                                            <modifierMask key="keyEquivalentModifierMask"/>
                                            <menu key="submenu" title="Baseline" id="ijk-EB-dga">
                                                <items>
                                                    <menuItem title="Use Default" id="3Om-Ey-2VK">
                                                        <modifierMask key="keyEquivalentModifierMask"/>
                                                        <connections>
                                                            <action selector="unscript:" target="-1" id="0vZ-95-Ywn"/>
                                                        </connections>
                                                    </menuItem>
                                                    <menuItem title="Superscript" id="Rqc-34-cIF">
                                                        <modifierMask key="keyEquivalentModifierMask"/>
                                                        <connections>
                                                            <action selector="superscript:" target="-1" id="3qV-fo-wpU"/>
                                                        </connections>
                                                    </menuItem>
                                                    <menuItem title="Subscript" id="I0S-gh-46l">
                                                        <modifierMask key="keyEquivalentModifierMask"/>
                                                        <connections>
                                                            <action selector="subscript:" target="-1" id="Q6W-4W-IGz"/>
                                                        </connections>
                                                    </menuItem>
                                                    <menuItem title="Raise" id="2h7-ER-AoG">
                                                        <modifierMask key="keyEquivalentModifierMask"/>
                                                        <connections>
                                                            <action selector="raiseBaseline:" target="-1" id="4sk-31-7Q9"/>
                                                        </connections>
                                                    </menuItem>
                                                    <menuItem title="Lower" id="1tx-W0-xDw">
                                                        <modifierMask key="keyEquivalentModifierMask"/>
                                                        <connections>
                                                            <action selector="lowerBaseline:" target="-1" id="OF1-bc-KW4"/>
                                                        </connections>
                                                    </menuItem>
                                                </items>
                                            </menu>
                                        </menuItem>
                                        <menuItem isSeparatorItem="YES" id="Ndw-q3-faq"/>
                                        <menuItem title="Show Colors" keyEquivalent="C" id="bgn-CT-cEk">
                                            <connections>
                                                <action selector="orderFrontColorPanel:" target="-1" id="mSX-Xz-DV3"/>
                                            </connections>
                                        </menuItem>
                                        <menuItem isSeparatorItem="YES" id="iMs-zA-UFJ"/>
                                        <menuItem title="Copy Style" keyEquivalent="c" id="5Vv-lz-BsD">
                                            <modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
                                            <connections>
                                                <action selector="copyFont:" target="-1" id="GJO-xA-L4q"/>
                                            </connections>
                                        </menuItem>
                                        <menuItem title="Paste Style" keyEquivalent="v" id="vKC-jM-MkH">
                                            <modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
                                            <connections>
                                                <action selector="pasteFont:" target="-1" id="JfD-CL-leO"/>
                                            </connections>
                                        </menuItem>
                                    </items>
                                </menu>
                            </menuItem>
                            <menuItem title="Text" id="Fal-I4-PZk">
                                <modifierMask key="keyEquivalentModifierMask"/>
                                <menu key="submenu" title="Text" id="d9c-me-L2H">
                                    <items>
                                        <menuItem title="Align Left" keyEquivalent="{" id="ZM1-6Q-yy1">
                                            <connections>
                                                <action selector="alignLeft:" target="-1" id="zUv-R1-uAa"/>
                                            </connections>
                                        </menuItem>
                                        <menuItem title="Center" keyEquivalent="|" id="VIY-Ag-zcb">
                                            <connections>
                                                <action selector="alignCenter:" target="-1" id="spX-mk-kcS"/>
                                            </connections>
                                        </menuItem>
                                        <menuItem title="Justify" id="J5U-5w-g23">
                                            <modifierMask key="keyEquivalentModifierMask"/>
                                            <connections>
                                                <action selector="alignJustified:" target="-1" id="ljL-7U-jND"/>
                                            </connections>
                                        </menuItem>
                                        <menuItem title="Align Right" keyEquivalent="}" id="wb2-vD-lq4">
                                            <connections>
                                                <action selector="alignRight:" target="-1" id="r48-bG-YeY"/>
                                            </connections>
                                        </menuItem>
                                        <menuItem isSeparatorItem="YES" id="4s2-GY-VfK"/>
                                        <menuItem title="Writing Direction" id="H1b-Si-o9J">
                                            <modifierMask key="keyEquivalentModifierMask"/>
                                            <menu key="submenu" title="Writing Direction" id="8mr-sm-Yjd">
                                                <items>
                                                    <menuItem title="Paragraph" enabled="NO" id="ZvO-Gk-QUH">
                                                        <modifierMask key="keyEquivalentModifierMask"/>
                                                    </menuItem>
                                                    <menuItem id="YGs-j5-SAR">
                                                        <string key="title">	Default</string>
                                                        <modifierMask key="keyEquivalentModifierMask"/>
                                                        <connections>
                                                            <action selector="makeBaseWritingDirectionNatural:" target="-1" id="qtV-5e-UBP"/>
                                                        </connections>
                                                    </menuItem>
                                                    <menuItem id="Lbh-J2-qVU">
                                                        <string key="title">	Left to Right</string>
                                                        <modifierMask key="keyEquivalentModifierMask"/>
                                                        <connections>
                                                            <action selector="makeBaseWritingDirectionLeftToRight:" target="-1" id="S0X-9S-QSf"/>
                                                        </connections>
                                                    </menuItem>
                                                    <menuItem id="jFq-tB-4Kx">
                                                        <string key="title">	Right to Left</string>
                                                        <modifierMask key="keyEquivalentModifierMask"/>
                                                        <connections>
                                                            <action selector="makeBaseWritingDirectionRightToLeft:" target="-1" id="5fk-qB-AqJ"/>
                                                        </connections>
                                                    </menuItem>
                                                    <menuItem isSeparatorItem="YES" id="swp-gr-a21"/>
                                                    <menuItem title="Selection" enabled="NO" id="cqv-fj-IhA">
                                                        <modifierMask key="keyEquivalentModifierMask"/>
                                                    </menuItem>
                                                    <menuItem id="Nop-cj-93Q">
                                                        <string key="title">	Default</string>
                                                        <modifierMask key="keyEquivalentModifierMask"/>
                                                        <connections>
                                                            <action selector="makeTextWritingDirectionNatural:" target="-1" id="lPI-Se-ZHp"/>
                                                        </connections>
                                                    </menuItem>
                                                    <menuItem id="BgM-ve-c93">
                                                        <string key="title">	Left to Right</string>
                                                        <modifierMask key="keyEquivalentModifierMask"/>
                                                        <connections>
                                                            <action selector="makeTextWritingDirectionLeftToRight:" target="-1" id="caW-Bv-w94"/>
                                                        </connections>
                                                    </menuItem>
                                                    <menuItem id="RB4-Sm-HuC">
                                                        <string key="title">	Right to Left</string>
                                                        <modifierMask key="keyEquivalentModifierMask"/>
                                                        <connections>
                                                            <action selector="makeTextWritingDirectionRightToLeft:" target="-1" id="EXD-6r-ZUu"/>
                                                        </connections>
                                                    </menuItem>
                                                </items>
                                            </menu>
                                        </menuItem>
                                        <menuItem isSeparatorItem="YES" id="fKy-g9-1gm"/>
                                        <menuItem title="Show Ruler" id="vLm-3I-IUL">
                                            <modifierMask key="keyEquivalentModifierMask"/>
                                            <connections>
                                                <action selector="toggleRuler:" target="-1" id="FOx-HJ-KwY"/>
                                            </connections>
                                        </menuItem>
                                        <menuItem title="Copy Ruler" keyEquivalent="c" id="MkV-Pr-PK5">
                                            <modifierMask key="keyEquivalentModifierMask" control="YES" command="YES"/>
                                            <connections>
                                                <action selector="copyRuler:" target="-1" id="71i-fW-3W2"/>
                                            </connections>
                                        </menuItem>
                                        <menuItem title="Paste Ruler" keyEquivalent="v" id="LVM-kO-fVI">
                                            <modifierMask key="keyEquivalentModifierMask" control="YES" command="YES"/>
                                            <connections>
                                                <action selector="pasteRuler:" target="-1" id="cSh-wd-qM2"/>
                                            </connections>
                                        </menuItem>
                                    </items>
                                </menu>
                            </menuItem>
                        </items>
                    </menu>
                </menuItem>
                <menuItem title="View" id="H8h-7b-M4v">
                    <modifierMask key="keyEquivalentModifierMask"/>
                    <menu key="submenu" title="View" id="HyV-fh-RgO">
                        <items>
                            <menuItem title="Show Toolbar" keyEquivalent="t" id="snW-S8-Cw5">
                                <modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
                                <connections>
                                    <action selector="toggleToolbarShown:" target="-1" id="BXY-wc-z0C"/>
                                </connections>
                            </menuItem>
                            <menuItem title="Customize Toolbar…" id="1UK-8n-QPP">
                                <modifierMask key="keyEquivalentModifierMask"/>
                                <connections>
                                    <action selector="runToolbarCustomizationPalette:" target="-1" id="pQI-g3-MTW"/>
                                </connections>
                            </menuItem>
                        </items>
                    </menu>
                </menuItem>
                <menuItem title="Window" id="aUF-d1-5bR">
                    <modifierMask key="keyEquivalentModifierMask"/>
                    <menu key="submenu" title="Window" systemMenu="window" id="Td7-aD-5lo">
                        <items>
                            <menuItem title="Minimize" keyEquivalent="m" id="OY7-WF-poV">
                                <connections>
                                    <action selector="performMiniaturize:" target="-1" id="VwT-WD-YPe"/>
                                </connections>
                            </menuItem>
                            <menuItem title="Zoom" id="R4o-n2-Eq4">
                                <modifierMask key="keyEquivalentModifierMask"/>
                                <connections>
                                    <action selector="performZoom:" target="-1" id="DIl-cC-cCs"/>
                                </connections>
                            </menuItem>
                            <menuItem isSeparatorItem="YES" id="eu3-7i-yIM"/>
                            <menuItem title="Bring All to Front" id="LE2-aR-0XJ">
                                <modifierMask key="keyEquivalentModifierMask"/>
                                <connections>
                                    <action selector="arrangeInFront:" target="-1" id="DRN-fu-gQh"/>
                                </connections>
                            </menuItem>
                        </items>
                    </menu>
                </menuItem>
                <menuItem title="Help" id="wpr-3q-Mcd">
                    <modifierMask key="keyEquivalentModifierMask"/>
                    <menu key="submenu" title="Help" systemMenu="help" id="F2S-fz-NVQ">
                        <items>
                            <menuItem title="WAYWindowDemo Help" keyEquivalent="?" id="FKE-Sm-Kum">
                                <connections>
                                    <action selector="showHelp:" target="-1" id="y7X-2Q-9no"/>
                                </connections>
                            </menuItem>
                        </items>
                    </menu>
                </menuItem>
            </items>
        </menu>
        <window title="WAYWindowDemo" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" animationBehavior="default" id="QvC-M9-y7g" customClass="WAYWindow">
            <windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
            <windowCollectionBehavior key="collectionBehavior" fullScreenPrimary="YES"/>
            <windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
            <rect key="contentRect" x="335" y="390" width="400" height="363"/>
            <rect key="screenRect" x="0.0" y="0.0" width="1920" height="1177"/>
            <view key="contentView" id="EiT-Mj-1SZ">
                <rect key="frame" x="0.0" y="0.0" width="400" height="363"/>
                <autoresizingMask key="autoresizingMask"/>
                <subviews>
                    <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" id="vRH-X4-fCc">
                        <rect key="frame" x="0.0" y="-1" width="400" height="282"/>
                        <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                        <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="dummyBackground" id="pEM-sv-YO8"/>
                    </imageView>
                    <box verticalHuggingPriority="750" title="Box" boxType="separator" titlePosition="noTitle" id="LGW-5d-w8c">
                        <rect key="frame" x="0.0" y="320" width="400" height="5"/>
                        <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
                        <color key="borderColor" white="0.0" alpha="0.41999999999999998" colorSpace="calibratedWhite"/>
                        <color key="fillColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
                        <font key="titleFont" metaFont="system"/>
                    </box>
                    <textField verticalHuggingPriority="750" id="62X-op-kOS">
                        <rect key="frame" x="188" y="289" width="200" height="30"/>
                        <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                        <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" alignment="right" placeholderString="122.3" id="ktO-3M-d4T">
                            <font key="font" metaFont="system" size="25"/>
                            <color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
                            <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
                        </textFieldCell>
                    </textField>
                </subviews>
            </view>
            <userDefinedRuntimeAttributes>
                <userDefinedRuntimeAttribute type="number" keyPath="titleBarHeight">
                    <real key="value" value="38"/>
                </userDefinedRuntimeAttribute>
                <userDefinedRuntimeAttribute type="boolean" keyPath="centerTrafficLightButtons" value="YES"/>
                <userDefinedRuntimeAttribute type="boolean" keyPath="hidesTitle" value="YES"/>
                <userDefinedRuntimeAttribute type="number" keyPath="trafficLightButtonsLeftMargin">
                    <real key="value" value="12"/>
                </userDefinedRuntimeAttribute>
            </userDefinedRuntimeAttributes>
            <point key="canvasLocation" x="350" y="483.5"/>
        </window>
        <customView id="z5d-5j-EOw" userLabel="Title Bar View">
            <rect key="frame" x="0.0" y="0.0" width="400" height="38"/>
            <autoresizingMask key="autoresizingMask" flexibleMinY="YES" heightSizable="YES"/>
            <subviews>
                <segmentedControl verticalHuggingPriority="750" id="NtU-Il-4TR">
                    <rect key="frame" x="149" y="6" width="103" height="25"/>
                    <autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES"/>
                    <segmentedCell key="cell" borderStyle="border" alignment="left" style="texturedSquare" trackingMode="momentary" id="41G-xZ-ulW">
                        <font key="font" metaFont="system"/>
                        <segments>
                            <segment image="viewIcon" width="50">
                                <nil key="label"/>
                            </segment>
                            <segment image="calculatorIcon" width="50" tag="1">
                                <nil key="label"/>
                            </segment>
                        </segments>
                    </segmentedCell>
                </segmentedControl>
            </subviews>
            <point key="canvasLocation" x="350" y="737"/>
        </customView>
    </objects>
    <resources>
        <image name="calculatorIcon" width="32" height="32"/>
        <image name="dummyBackground" width="400" height="280"/>
        <image name="viewIcon" width="32" height="32"/>
    </resources>
</document>


================================================
FILE: WAYWindowDemo/Info.plist
================================================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>CFBundleDevelopmentRegion</key>
	<string>en</string>
	<key>CFBundleExecutable</key>
	<string>$(EXECUTABLE_NAME)</string>
	<key>CFBundleIconFile</key>
	<string></string>
	<key>CFBundleIdentifier</key>
	<string>com.weareyeah.$(PRODUCT_NAME:rfc1034identifier)</string>
	<key>CFBundleInfoDictionaryVersion</key>
	<string>6.0</string>
	<key>CFBundleName</key>
	<string>$(PRODUCT_NAME)</string>
	<key>CFBundlePackageType</key>
	<string>APPL</string>
	<key>CFBundleShortVersionString</key>
	<string>1.0</string>
	<key>CFBundleSignature</key>
	<string>????</string>
	<key>CFBundleVersion</key>
	<string>1</string>
	<key>LSMinimumSystemVersion</key>
	<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
	<key>NSHumanReadableCopyright</key>
	<string>Copyright © 2014 We Are Yeah!. All rights reserved.</string>
	<key>NSMainNibFile</key>
	<string>MainMenu</string>
	<key>NSPrincipalClass</key>
	<string>NSApplication</string>
</dict>
</plist>


================================================
FILE: WAYWindowDemo/WAYWindow.h
================================================
//
//  WAYWindow.m
//  WAYWindow
//
//  Created by Raffael Hannemann on 15.11.14.
//  Copyright (c) 2014 Raffael Hannemann. All rights reserved.
//  Visit weAreYeah.com or follow @weareYeah for updates.
//
//  Licensed under the BSD License <http://www.opensource.org/licenses/bsd-license>
//  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
//  EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
//  SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
//  TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
//  BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
//  STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
//  THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//

#import <Cocoa/Cocoa.h>

/** This NSWindow subclass provides an interface to enable OS X 10.10 Yosemite exclusive features conveniently. Next to customizing the look of the WAYWindow content view, you can also customize the title bar and standard window buttons (`traffic lights´). The public interface is generally similar to INAppStoreWindow to facilitate the migration.
 Whenever it makes sense, the properties of your WAYWindow instance in Interface Builder are inspectable.
 
 Tips:
 - Check out the WWDC '14 session `Adopting Advanced Features of the New UI of OS X Yosemite´, which provides more details on how to make use of the new Yosemite APIs.
 - Also check out the new APIs in NSScrollView to make use of contentInsets, scrollInsets, and more.
 */
@interface WAYWindow : NSWindow

/// Returns YES, if the class supports vibrant appearances. Can be used to determine if running on OS X 10.10+
+ (BOOL) supportsVibrantAppearances;

/// Defines the window's titlebar height.
@property (nonatomic) IBInspectable CGFloat titleBarHeight;

//// Returns the titlebar view of the window, which you can add arbitrary subviews to.
@property (strong,readonly) NSView *titleBarView;

/// If set to YES, the standard window button will be vertically centered.
@property (nonatomic) IBInspectable BOOL centerTrafficLightButtons;

/// Defines the left margin of the standard window buttons
@property (nonatomic) IBInspectable CGFloat trafficLightButtonsLeftMargin;

/// If set to YES, the title of the window will be hidden.
@property (nonatomic) IBInspectable BOOL hidesTitle;

/// Replaces the window's content view with an instance of NSVisualEffectView and applies the Vibrant Dark look. Transfers all subviews to the new content view.
- (void) setContentViewAppearanceVibrantDark;

/// Replaces the window's content view with an instance of NSVisualEffectView and applies the Vibrant Light look. Transfers all subviews to the new content view.
- (void) setContentViewAppearanceVibrantLight;

/// Convenient method to set the NSAppearance of the window to NSAppearanceNameVibrantDark
- (void) setVibrantDarkAppearance;

/// Convenient method to set the NSAppearance of the window to NSAppearanceNameVibrantLight
- (void) setVibrantLightAppearance;

/// Convenient method to set the NSAppearance of the window to NSAppearanceNameVibrantAqua
- (void) setAquaAppearance;

/// Replaces a view of the window subview hierarchy with the specified view, and transfers all current subviews to the new one. The frame of the new view will be set to the frame of the old view, if flag is YES.
- (void) replaceSubview: (NSView *) aView withView: (NSView *) newView resizing: (BOOL) flag;

/// Replaces a view of the window subview hierarchy with a new view of the specified NSView class, and transfers all current subviews to the new one.
- (NSView *) replaceSubview: (NSView *) aView withViewOfClass: (Class) newViewClass;

/// Returns YES if the window is currently in full-screen.
- (BOOL) isFullScreen;

@end


================================================
FILE: WAYWindowDemo/WAYWindow.m
================================================
//
//  WAYWindow.m
//  WAYWindow
//
//  Created by Raffael Hannemann on 15.11.14.
//  Copyright (c) 2014 Raffael Hannemann. All rights reserved.
//  Visit weAreYeah.com or follow @weareYeah for updates.
//
//  Licensed under the BSD License <http://www.opensource.org/licenses/bsd-license>
//  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
//  EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
//  SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
//  TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
//  BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
//  STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
//  THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//

#import "WAYWindow.h"

@interface WAYWindowDelegateProxy : NSProxy <NSWindowDelegate>
@property (nonatomic, assign) id<NSWindowDelegate> secondaryDelegate;
@end

@implementation WAYWindowDelegateProxy
@end

@interface WAYWindow () <NSWindowDelegate>
@property (strong) WAYWindowDelegateProxy* delegateProxy;
@property (strong) NSArray* standardButtons;
@property (strong) NSTitlebarAccessoryViewController *dummyTitlebarAccessoryViewController;

@end

static float kWAYWindowDefaultTrafficLightButtonsLeftMargin = 0;
static float kWAYWindowDefaultTrafficLightButtonsTopMargin = 0;

@implementation WAYWindow

+ (BOOL) supportsVibrantAppearances {
	return (NSClassFromString(@"NSVisualEffectView")!=nil);
}

+ (float) defaultTitleBarHeight {
	NSRect frame = NSMakeRect(0, 0, 800, 600);
	NSRect contentRect = [NSWindow contentRectForFrameRect:frame styleMask: NSTitledWindowMask];
	return NSHeight(frame) - NSHeight(contentRect);
}

#pragma mark - NSWindow Overwritings

- (id)initWithContentRect:(NSRect)contentRect styleMask:(NSUInteger)aStyle backing:(NSBackingStoreType)bufferingType defer:(BOOL)flag {
	if ((self = [super initWithContentRect:contentRect styleMask:aStyle backing:bufferingType defer:flag])) {
		[self setUp];
	}
	return self;
}

- (id)initWithContentRect:(NSRect)contentRect styleMask:(NSUInteger)aStyle backing:(NSBackingStoreType)bufferingType defer:(BOOL)flag screen:(NSScreen *)screen {
	if ((self = [super initWithContentRect:contentRect styleMask:aStyle backing:bufferingType defer:flag screen:screen])) {
		[self setUp];
	}
	return self;
}

- (void) setDelegate:(id<NSWindowDelegate>)delegate {
	[_delegateProxy setSecondaryDelegate:delegate];
	[super setDelegate:_delegateProxy];
}

- (id<NSWindowDelegate>) delegate {
	return [_delegateProxy secondaryDelegate];
}

- (void) setFrame:(NSRect)frameRect display:(BOOL)flag {
	[super setFrame:frameRect display:flag];
	[self setNeedsLayout];
}

#pragma mark - Public

- (NSView *) titleBarView {
	return [_standardButtons[0] superview];
}

- (void) setCenterTrafficLightButtons:(BOOL)centerTrafficLightButtons {
	_centerTrafficLightButtons = centerTrafficLightButtons;
	[self setNeedsLayout];
}

- (void) setTitleBarHeight:(CGFloat)titleBarHeight {
	if (_dummyTitlebarAccessoryViewController) {
		[self removeTitlebarAccessoryViewControllerAtIndex:0];
	}
	
	NSView *view = [[NSView alloc] initWithFrame:NSMakeRect(0, 0, 10, titleBarHeight-[WAYWindow defaultTitleBarHeight])];
	_dummyTitlebarAccessoryViewController = [NSTitlebarAccessoryViewController new];
	_dummyTitlebarAccessoryViewController.view = view;
	[self addTitlebarAccessoryViewController:_dummyTitlebarAccessoryViewController];
}

- (void) setHidesTitle:(BOOL)hidesTitle {
	_hidesTitle = hidesTitle;
	[self setTitleVisibility:hidesTitle ? NSWindowTitleHidden : NSWindowTitleVisible];
}

- (void) setContentViewAppearanceVibrantDark {
	[self setContentViewAppearance:NSVisualEffectMaterialDark];
}

- (void) setContentViewAppearanceVibrantLight {
	[self setContentViewAppearance:NSVisualEffectMaterialLight];
}

- (void) setContentViewAppearance: (int) material {
	if (![WAYWindow supportsVibrantAppearances])
		return;
	
	NSVisualEffectView *newContentView = [self replaceSubview:self.contentView withViewOfClass:[NSVisualEffectView class]];
	[newContentView setMaterial:material];
	[self setContentView:newContentView];
}

- (void) setVibrantDarkAppearance {
	[self setAppearance:[NSAppearance appearanceNamed:NSAppearanceNameVibrantDark]];
}

- (void) setVibrantLightAppearance {
	[self setAppearance:[NSAppearance appearanceNamed:NSAppearanceNameVibrantLight]];
}

- (void) setAquaAppearance {
	[self setAppearance:[NSAppearance appearanceNamed:NSAppearanceNameAqua]];
}

- (BOOL) isFullScreen {
	return (([self styleMask] & NSFullScreenWindowMask) == NSFullScreenWindowMask);
}

- (void) replaceSubview: (NSView *) aView withView: (NSView *) newView resizing:(BOOL)flag {
	if (flag) {
		[newView setFrame:aView.frame];
	}
	
	[newView setAutoresizesSubviews:aView.autoresizesSubviews];
	[aView.subviews.copy enumerateObjectsUsingBlock:^(NSView *subview, NSUInteger idx, BOOL *stop) {
		NSRect frame = subview.frame;
		if (subview.constraints.count>0) {
			NSLog(@"WARNING: [%@ %@] does not work yet with NSView instances, that use auto-layout.", NSStringFromClass([self class]), NSStringFromSelector(_cmd));
		}
		[subview removeFromSuperview];
		[newView addSubview:subview];
		[subview setFrame:frame];
	}];
	
	if (aView==self.contentView) {
		[self setContentView: newView];
	} else {
		[aView.superview replaceSubview:aView with:newView];
	}
}

- (NSView *) replaceSubview:(NSView *)aView withViewOfClass:(Class)newViewClass {
	NSView *view = [[newViewClass alloc] initWithFrame:aView.frame];
	[self replaceSubview:aView withView:view resizing:YES];
	return view;
}

#pragma mark - Private

- (void) setUp {
	_delegateProxy = [WAYWindowDelegateProxy alloc];
	_standardButtons = @[[self standardWindowButton:NSWindowCloseButton],
						 [self standardWindowButton:NSWindowMiniaturizeButton],
						 [self standardWindowButton:NSWindowZoomButton]];
	_centerTrafficLightButtons = YES;
	
	NSButton *closeButton = [self standardWindowButton:NSWindowCloseButton];
	kWAYWindowDefaultTrafficLightButtonsLeftMargin = NSMinX(closeButton.frame);
	kWAYWindowDefaultTrafficLightButtonsTopMargin = NSHeight(closeButton.superview.frame)-NSMaxY(closeButton.frame);
	
	self.styleMask |= NSFullSizeContentViewWindowMask;
	_trafficLightButtonsLeftMargin = kWAYWindowDefaultTrafficLightButtonsLeftMargin;
	
	[super setDelegate:self];
	[self setNeedsLayout];
}

- (void) setNeedsLayout {
	[_standardButtons enumerateObjectsUsingBlock:^(NSButton *standardButton, NSUInteger idx, BOOL *stop) {
		NSRect frame = standardButton.frame;
		if (_centerTrafficLightButtons) frame.origin.y = NSHeight(standardButton.superview.frame)/2-NSHeight(standardButton.frame)/2;
		else frame.origin.y = NSHeight(standardButton.superview.frame)-NSHeight(standardButton.frame)-kWAYWindowDefaultTrafficLightButtonsTopMargin;
		
		frame.origin.x = _trafficLightButtonsLeftMargin +idx*(NSWidth(frame) + 6);
		[standardButton setFrame:frame];
	}];
}

#pragma mark - NSWindow Delegate

- (void) windowDidResize:(NSNotification *)notification {
	[self setNeedsLayout];
}

@end


================================================
FILE: WAYWindowDemo/main.m
================================================
//
//  main.m
//  WAYWindow
//
//  Created by Raffael Hannemann on 15.11.14.
//  Copyright (c) 2014 We Are Yeah!. All rights reserved.
//

#import <Cocoa/Cocoa.h>

int main(int argc, const char * argv[]) {
	return NSApplicationMain(argc, argv);
}


================================================
FILE: WAYWindowDemo.xcodeproj/project.pbxproj
================================================
// !$*UTF8*$!
{
	archiveVersion = 1;
	classes = {
	};
	objectVersion = 46;
	objects = {

/* Begin PBXBuildFile section */
		4D06F6551A18C13600B725C6 /* WAYWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = 4D06F6541A18C13600B725C6 /* WAYWindow.m */; };
		4DF97AD11A17DA7700351BC9 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 4DF97AD01A17DA7700351BC9 /* AppDelegate.m */; };
		4DF97AD31A17DA7700351BC9 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 4DF97AD21A17DA7700351BC9 /* main.m */; };
		4DF97AD81A17DA7700351BC9 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4DF97AD61A17DA7700351BC9 /* MainMenu.xib */; };
		4DF97AFA1A17F11900351BC9 /* calculatorIcon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4DF97AF81A17F11900351BC9 /* calculatorIcon@2x.png */; };
		4DF97AFB1A17F11900351BC9 /* viewIcon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4DF97AF91A17F11900351BC9 /* viewIcon@2x.png */; };
		4DF97AFD1A17F1E600351BC9 /* dummyBackground@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 4DF97AFC1A17F1E600351BC9 /* dummyBackground@2x.png */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
		4D06F6531A18C13600B725C6 /* WAYWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WAYWindow.h; sourceTree = "<group>"; };
		4D06F6541A18C13600B725C6 /* WAYWindow.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WAYWindow.m; sourceTree = "<group>"; };
		4DF97ACA1A17DA7700351BC9 /* WAYWindowDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = WAYWindowDemo.app; sourceTree = BUILT_PRODUCTS_DIR; };
		4DF97ACE1A17DA7700351BC9 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
		4DF97ACF1A17DA7700351BC9 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.objj.h; path = AppDelegate.h; sourceTree = "<group>"; };
		4DF97AD01A17DA7700351BC9 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
		4DF97AD21A17DA7700351BC9 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
		4DF97AD71A17DA7700351BC9 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = "<group>"; };
		4DF97AF81A17F11900351BC9 /* calculatorIcon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "calculatorIcon@2x.png"; sourceTree = "<group>"; };
		4DF97AF91A17F11900351BC9 /* viewIcon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "viewIcon@2x.png"; sourceTree = "<group>"; };
		4DF97AFC1A17F1E600351BC9 /* dummyBackground@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "dummyBackground@2x.png"; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
		4DF97AC71A17DA7700351BC9 /* Frameworks */ = {
			isa = PBXFrameworksBuildPhase;
			buildActionMask = 2147483647;
			files = (
			);
			runOnlyForDeploymentPostprocessing = 0;
		};
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
		4D06F6521A18C13600B725C6 /* WAYWindow */ = {
			isa = PBXGroup;
			children = (
				4D06F6531A18C13600B725C6 /* WAYWindow.h */,
				4D06F6541A18C13600B725C6 /* WAYWindow.m */,
			);
			path = WAYWindow;
			sourceTree = SOURCE_ROOT;
		};
		4DF97AC11A17DA7700351BC9 = {
			isa = PBXGroup;
			children = (
				4DF97ACC1A17DA7700351BC9 /* WAYWindowDemo */,
				4DF97ACB1A17DA7700351BC9 /* Products */,
			);
			sourceTree = "<group>";
		};
		4DF97ACB1A17DA7700351BC9 /* Products */ = {
			isa = PBXGroup;
			children = (
				4DF97ACA1A17DA7700351BC9 /* WAYWindowDemo.app */,
			);
			name = Products;
			sourceTree = "<group>";
		};
		4DF97ACC1A17DA7700351BC9 /* WAYWindowDemo */ = {
			isa = PBXGroup;
			children = (
				4D06F6521A18C13600B725C6 /* WAYWindow */,
				4DF97ACF1A17DA7700351BC9 /* AppDelegate.h */,
				4DF97AD01A17DA7700351BC9 /* AppDelegate.m */,
				4DF97AF81A17F11900351BC9 /* calculatorIcon@2x.png */,
				4DF97AF91A17F11900351BC9 /* viewIcon@2x.png */,
				4DF97AFC1A17F1E600351BC9 /* dummyBackground@2x.png */,
				4DF97AD61A17DA7700351BC9 /* MainMenu.xib */,
				4DF97ACD1A17DA7700351BC9 /* Supporting Files */,
			);
			path = WAYWindowDemo;
			sourceTree = "<group>";
		};
		4DF97ACD1A17DA7700351BC9 /* Supporting Files */ = {
			isa = PBXGroup;
			children = (
				4DF97ACE1A17DA7700351BC9 /* Info.plist */,
				4DF97AD21A17DA7700351BC9 /* main.m */,
			);
			name = "Supporting Files";
			sourceTree = "<group>";
		};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
		4DF97AC91A17DA7700351BC9 /* WAYWindowDemo */ = {
			isa = PBXNativeTarget;
			buildConfigurationList = 4DF97AE71A17DA7700351BC9 /* Build configuration list for PBXNativeTarget "WAYWindowDemo" */;
			buildPhases = (
				4DF97AC61A17DA7700351BC9 /* Sources */,
				4DF97AC71A17DA7700351BC9 /* Frameworks */,
				4DF97AC81A17DA7700351BC9 /* Resources */,
			);
			buildRules = (
			);
			dependencies = (
			);
			name = WAYWindowDemo;
			productName = WAYWindow;
			productReference = 4DF97ACA1A17DA7700351BC9 /* WAYWindowDemo.app */;
			productType = "com.apple.product-type.application";
		};
/* End PBXNativeTarget section */

/* Begin PBXProject section */
		4DF97AC21A17DA7700351BC9 /* Project object */ = {
			isa = PBXProject;
			attributes = {
				LastUpgradeCheck = 0610;
				ORGANIZATIONNAME = "We Are Yeah!";
				TargetAttributes = {
					4DF97AC91A17DA7700351BC9 = {
						CreatedOnToolsVersion = 6.1;
					};
				};
			};
			buildConfigurationList = 4DF97AC51A17DA7700351BC9 /* Build configuration list for PBXProject "WAYWindowDemo" */;
			compatibilityVersion = "Xcode 3.2";
			developmentRegion = English;
			hasScannedForEncodings = 0;
			knownRegions = (
				en,
				Base,
			);
			mainGroup = 4DF97AC11A17DA7700351BC9;
			productRefGroup = 4DF97ACB1A17DA7700351BC9 /* Products */;
			projectDirPath = "";
			projectRoot = "";
			targets = (
				4DF97AC91A17DA7700351BC9 /* WAYWindowDemo */,
			);
		};
/* End PBXProject section */

/* Begin PBXResourcesBuildPhase section */
		4DF97AC81A17DA7700351BC9 /* Resources */ = {
			isa = PBXResourcesBuildPhase;
			buildActionMask = 2147483647;
			files = (
				4DF97AD81A17DA7700351BC9 /* MainMenu.xib in Resources */,
				4DF97AFB1A17F11900351BC9 /* viewIcon@2x.png in Resources */,
				4DF97AFA1A17F11900351BC9 /* calculatorIcon@2x.png in Resources */,
				4DF97AFD1A17F1E600351BC9 /* dummyBackground@2x.png in Resources */,
			);
			runOnlyForDeploymentPostprocessing = 0;
		};
/* End PBXResourcesBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
		4DF97AC61A17DA7700351BC9 /* Sources */ = {
			isa = PBXSourcesBuildPhase;
			buildActionMask = 2147483647;
			files = (
				4D06F6551A18C13600B725C6 /* WAYWindow.m in Sources */,
				4DF97AD31A17DA7700351BC9 /* main.m in Sources */,
				4DF97AD11A17DA7700351BC9 /* AppDelegate.m in Sources */,
			);
			runOnlyForDeploymentPostprocessing = 0;
		};
/* End PBXSourcesBuildPhase section */

/* Begin PBXVariantGroup section */
		4DF97AD61A17DA7700351BC9 /* MainMenu.xib */ = {
			isa = PBXVariantGroup;
			children = (
				4DF97AD71A17DA7700351BC9 /* Base */,
			);
			name = MainMenu.xib;
			sourceTree = "<group>";
		};
/* End PBXVariantGroup section */

/* Begin XCBuildConfiguration section */
		4DF97AE51A17DA7700351BC9 /* Debug */ = {
			isa = XCBuildConfiguration;
			buildSettings = {
				ALWAYS_SEARCH_USER_PATHS = NO;
				CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
				CLANG_CXX_LIBRARY = "libc++";
				CLANG_ENABLE_MODULES = YES;
				CLANG_ENABLE_OBJC_ARC = YES;
				CLANG_WARN_BOOL_CONVERSION = YES;
				CLANG_WARN_CONSTANT_CONVERSION = YES;
				CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
				CLANG_WARN_EMPTY_BODY = YES;
				CLANG_WARN_ENUM_CONVERSION = YES;
				CLANG_WARN_INT_CONVERSION = YES;
				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
				CLANG_WARN_UNREACHABLE_CODE = YES;
				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
				CODE_SIGN_IDENTITY = "-";
				COPY_PHASE_STRIP = NO;
				ENABLE_STRICT_OBJC_MSGSEND = YES;
				GCC_C_LANGUAGE_STANDARD = gnu99;
				GCC_DYNAMIC_NO_PIC = NO;
				GCC_OPTIMIZATION_LEVEL = 0;
				GCC_PREPROCESSOR_DEFINITIONS = (
					"DEBUG=1",
					"$(inherited)",
				);
				GCC_SYMBOLS_PRIVATE_EXTERN = NO;
				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
				GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
				GCC_WARN_UNDECLARED_SELECTOR = YES;
				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
				GCC_WARN_UNUSED_FUNCTION = YES;
				GCC_WARN_UNUSED_VARIABLE = YES;
				MACOSX_DEPLOYMENT_TARGET = 10.10;
				MTL_ENABLE_DEBUG_INFO = YES;
				ONLY_ACTIVE_ARCH = YES;
				SDKROOT = macosx;
			};
			name = Debug;
		};
		4DF97AE61A17DA7700351BC9 /* Release */ = {
			isa = XCBuildConfiguration;
			buildSettings = {
				ALWAYS_SEARCH_USER_PATHS = NO;
				CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
				CLANG_CXX_LIBRARY = "libc++";
				CLANG_ENABLE_MODULES = YES;
				CLANG_ENABLE_OBJC_ARC = YES;
				CLANG_WARN_BOOL_CONVERSION = YES;
				CLANG_WARN_CONSTANT_CONVERSION = YES;
				CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
				CLANG_WARN_EMPTY_BODY = YES;
				CLANG_WARN_ENUM_CONVERSION = YES;
				CLANG_WARN_INT_CONVERSION = YES;
				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
				CLANG_WARN_UNREACHABLE_CODE = YES;
				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
				CODE_SIGN_IDENTITY = "-";
				COPY_PHASE_STRIP = YES;
				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
				ENABLE_NS_ASSERTIONS = NO;
				ENABLE_STRICT_OBJC_MSGSEND = YES;
				GCC_C_LANGUAGE_STANDARD = gnu99;
				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
				GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
				GCC_WARN_UNDECLARED_SELECTOR = YES;
				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
				GCC_WARN_UNUSED_FUNCTION = YES;
				GCC_WARN_UNUSED_VARIABLE = YES;
				MACOSX_DEPLOYMENT_TARGET = 10.10;
				MTL_ENABLE_DEBUG_INFO = NO;
				SDKROOT = macosx;
			};
			name = Release;
		};
		4DF97AE81A17DA7700351BC9 /* Debug */ = {
			isa = XCBuildConfiguration;
			buildSettings = {
				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
				COMBINE_HIDPI_IMAGES = YES;
				INFOPLIST_FILE = "$(SRCROOT)/WAYWindowDemo/Info.plist";
				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
				PRODUCT_NAME = WAYWindowDemo;
			};
			name = Debug;
		};
		4DF97AE91A17DA7700351BC9 /* Release */ = {
			isa = XCBuildConfiguration;
			buildSettings = {
				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
				COMBINE_HIDPI_IMAGES = YES;
				INFOPLIST_FILE = "$(SRCROOT)/WAYWindowDemo/Info.plist";
				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
				PRODUCT_NAME = WAYWindowDemo;
			};
			name = Release;
		};
/* End XCBuildConfiguration section */

/* Begin XCConfigurationList section */
		4DF97AC51A17DA7700351BC9 /* Build configuration list for PBXProject "WAYWindowDemo" */ = {
			isa = XCConfigurationList;
			buildConfigurations = (
				4DF97AE51A17DA7700351BC9 /* Debug */,
				4DF97AE61A17DA7700351BC9 /* Release */,
			);
			defaultConfigurationIsVisible = 0;
			defaultConfigurationName = Release;
		};
		4DF97AE71A17DA7700351BC9 /* Build configuration list for PBXNativeTarget "WAYWindowDemo" */ = {
			isa = XCConfigurationList;
			buildConfigurations = (
				4DF97AE81A17DA7700351BC9 /* Debug */,
				4DF97AE91A17DA7700351BC9 /* Release */,
			);
			defaultConfigurationIsVisible = 0;
			defaultConfigurationName = Release;
		};
/* End XCConfigurationList section */
	};
	rootObject = 4DF97AC21A17DA7700351BC9 /* Project object */;
}


================================================
FILE: WAYWindowDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata
================================================
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
   version = "1.0">
   <FileRef
      location = "self:WAYWindowDemo.xcodeproj">
   </FileRef>
</Workspace>


================================================
FILE: WAYWindowDemo.xcodeproj/project.xcworkspace/xcshareddata/WAYWindow.xccheckout
================================================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>IDESourceControlProjectFavoriteDictionaryKey</key>
	<false/>
	<key>IDESourceControlProjectIdentifier</key>
	<string>A133E621-7D99-47BA-83AB-1FBAB9AE441B</string>
	<key>IDESourceControlProjectOriginsDictionary</key>
	<dict>
		<key>C1421C99D055D3A535089DA2BBEC5EFC9A0200F0</key>
		<string>https://github.com/weAreYeah/WAYWindow.git</string>
	</dict>
	<key>IDESourceControlProjectRelativeInstallPathDictionary</key>
	<dict>
		<key>C1421C99D055D3A535089DA2BBEC5EFC9A0200F0</key>
		<string>WAYWindow/</string>
	</dict>
	<key>IDESourceControlProjectURL</key>
	<string>https://github.com/weAreYeah/WAYWindow.git</string>
	<key>IDESourceControlProjectVersion</key>
	<integer>111</integer>
	<key>IDESourceControlProjectWCCIdentifier</key>
	<string>C1421C99D055D3A535089DA2BBEC5EFC9A0200F0</string>
	<key>IDESourceControlProjectWCConfigurations</key>
	<array>
		<dict>
			<key>IDESourceControlRepositoryExtensionIdentifierKey</key>
			<string>public.vcs.git</string>
			<key>IDESourceControlWCCIdentifierKey</key>
			<string>C1421C99D055D3A535089DA2BBEC5EFC9A0200F0</string>
			<key>IDESourceControlWCCName</key>
			<string>WAYWindow</string>
		</dict>
	</array>
</dict>
</plist>


================================================
FILE: WAYWindowDemo.xcodeproj/project.xcworkspace/xcshareddata/WAYWindowDemo.xccheckout
================================================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>IDESourceControlProjectFavoriteDictionaryKey</key>
	<false/>
	<key>IDESourceControlProjectIdentifier</key>
	<string>D7D9DF91-EC69-454D-809B-D007E8C6135B</string>
	<key>IDESourceControlProjectName</key>
	<string>WAYWindowDemo</string>
	<key>IDESourceControlProjectOriginsDictionary</key>
	<dict>
		<key>C1421C99D055D3A535089DA2BBEC5EFC9A0200F0</key>
		<string>https://github.com/weAreYeah/WAYWindow.git</string>
	</dict>
	<key>IDESourceControlProjectPath</key>
	<string>WAYWindowDemo.xcodeproj</string>
	<key>IDESourceControlProjectRelativeInstallPathDictionary</key>
	<dict>
		<key>C1421C99D055D3A535089DA2BBEC5EFC9A0200F0</key>
		<string>../..</string>
	</dict>
	<key>IDESourceControlProjectURL</key>
	<string>https://github.com/weAreYeah/WAYWindow.git</string>
	<key>IDESourceControlProjectVersion</key>
	<integer>111</integer>
	<key>IDESourceControlProjectWCCIdentifier</key>
	<string>C1421C99D055D3A535089DA2BBEC5EFC9A0200F0</string>
	<key>IDESourceControlProjectWCConfigurations</key>
	<array>
		<dict>
			<key>IDESourceControlRepositoryExtensionIdentifierKey</key>
			<string>public.vcs.git</string>
			<key>IDESourceControlWCCIdentifierKey</key>
			<string>C1421C99D055D3A535089DA2BBEC5EFC9A0200F0</string>
			<key>IDESourceControlWCCName</key>
			<string>WAYWindow</string>
		</dict>
	</array>
</dict>
</plist>
Download .txt
gitextract_c5i6pguk/

├── .gitignore
├── LICENSE
├── README.md
├── WAYWindow/
│   ├── WAYWindow.h
│   └── WAYWindow.m
├── WAYWindowDemo/
│   ├── AppDelegate.h
│   ├── AppDelegate.m
│   ├── Base.lproj/
│   │   └── MainMenu.xib
│   ├── Info.plist
│   ├── WAYWindow.h
│   ├── WAYWindow.m
│   └── main.m
└── WAYWindowDemo.xcodeproj/
    ├── project.pbxproj
    └── project.xcworkspace/
        ├── contents.xcworkspacedata
        └── xcshareddata/
            ├── WAYWindow.xccheckout
            └── WAYWindowDemo.xccheckout
Condensed preview — 16 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (113K chars).
[
  {
    "path": ".gitignore",
    "chars": 4785,
    "preview": "\n#####\n# OS X temporary files that should never be committed\n#\n# c.f. http://www.westwind.com/reference/os-x/invisibles."
  },
  {
    "path": "LICENSE",
    "chars": 892,
    "preview": "WAYWindow \nby Raffael Hannemann (@raffael_me, @weAreYeah)\n\nLicensed under the BSD License http://www.opensource.org/lice"
  },
  {
    "path": "README.md",
    "chars": 2624,
    "preview": "WAYWindow\n=========\n\n```NSWindow``` subclass that simplifies Yosemite exclusive features:\n\n - custom titlebar height\n - "
  },
  {
    "path": "WAYWindow/WAYWindow.h",
    "chars": 4363,
    "preview": "//\n//  WAYWindow.m\n//  WAYWindow\n//\n//  Created by Raffael Hannemann on 15.11.14.\n//  Copyright (c) 2014 Raffael Hannema"
  },
  {
    "path": "WAYWindow/WAYWindow.m",
    "chars": 11468,
    "preview": "//\n//  WAYWindow.m\n//  WAYWindow\n//\n//  Created by Raffael Hannemann on 15.11.14.\n//  Copyright (c) 2014 Raffael Hannema"
  },
  {
    "path": "WAYWindowDemo/AppDelegate.h",
    "chars": 237,
    "preview": "//\n//  AppDelegate.h\n//  WAYWindow\n//\n//  Created by Raffael Hannemann on 15.11.14.\n//  Copyright (c) 2014 We Are Yeah!."
  },
  {
    "path": "WAYWindowDemo/AppDelegate.m",
    "chars": 728,
    "preview": "//\n//  AppDelegate.m\n//  WAYWindow\n//\n//  Created by Raffael Hannemann on 15.11.14.\n//  Copyright (c) 2014 We Are Yeah!."
  },
  {
    "path": "WAYWindowDemo/Base.lproj/MainMenu.xib",
    "chars": 54178,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<document type=\"com.apple.InterfaceBuilder3.Cocoa.XIB\" version=\"3"
  },
  {
    "path": "WAYWindowDemo/Info.plist",
    "chars": 1102,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/P"
  },
  {
    "path": "WAYWindowDemo/WAYWindow.h",
    "chars": 4087,
    "preview": "//\n//  WAYWindow.m\n//  WAYWindow\n//\n//  Created by Raffael Hannemann on 15.11.14.\n//  Copyright (c) 2014 Raffael Hannema"
  },
  {
    "path": "WAYWindowDemo/WAYWindow.m",
    "chars": 7359,
    "preview": "//\n//  WAYWindow.m\n//  WAYWindow\n//\n//  Created by Raffael Hannemann on 15.11.14.\n//  Copyright (c) 2014 Raffael Hannema"
  },
  {
    "path": "WAYWindowDemo/main.m",
    "chars": 247,
    "preview": "//\n//  main.m\n//  WAYWindow\n//\n//  Created by Raffael Hannemann on 15.11.14.\n//  Copyright (c) 2014 We Are Yeah!. All ri"
  },
  {
    "path": "WAYWindowDemo.xcodeproj/project.pbxproj",
    "chars": 11786,
    "preview": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 46;\n\tobjects = {\n\n/* Begin PBXBuildFile section *"
  },
  {
    "path": "WAYWindowDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata",
    "chars": 158,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Workspace\n   version = \"1.0\">\n   <FileRef\n      location = \"self:WAYWindowDemo.x"
  },
  {
    "path": "WAYWindowDemo.xcodeproj/project.xcworkspace/xcshareddata/WAYWindow.xccheckout",
    "chars": 1347,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/P"
  },
  {
    "path": "WAYWindowDemo.xcodeproj/project.xcworkspace/xcshareddata/WAYWindowDemo.xccheckout",
    "chars": 1496,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/P"
  }
]

About this extraction

This page contains the full source code of the weAreYeah/WAYWindow GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 16 files (104.4 KB), approximately 23.9k tokens. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!