master ba272ac695df cached
32 files
140.2 KB
34.0k tokens
2 symbols
1 requests
Download .txt
Repository: indragiek/INPopoverController
Branch: master
Commit: ba272ac695df
Files: 32
Total size: 140.2 KB

Directory structure:
gitextract_bwryhk85/

├── .gitignore
├── INPopoverController/
│   ├── INPopoverController-Info.plist
│   ├── INPopoverController.h
│   ├── INPopoverController.m
│   ├── INPopoverControllerDefines.h
│   ├── INPopoverParentWindow.h
│   ├── INPopoverParentWindow.m
│   ├── INPopoverPrefixHeader.pch
│   ├── INPopoverWindow.h
│   ├── INPopoverWindow.m
│   ├── INPopoverWindowFrame.h
│   └── INPopoverWindowFrame.m
├── INPopoverController.podspec
├── INPopoverController.xcodeproj/
│   ├── project.pbxproj
│   └── project.xcworkspace/
│       └── contents.xcworkspacedata
├── LICENSE
├── PopoverSampleApp/
│   ├── PopoverSampleApp/
│   │   ├── AlphaColorWell.h
│   │   ├── AlphaColorWell.m
│   │   ├── ContentViewController.h
│   │   ├── ContentViewController.m
│   │   ├── ContentViewController.xib
│   │   ├── PopoverSampleApp-Info.plist
│   │   ├── PopoverSampleApp-Prefix.pch
│   │   ├── PopoverSampleAppAppDelegate.h
│   │   ├── PopoverSampleAppAppDelegate.m
│   │   ├── en.lproj/
│   │   │   ├── Credits.rtf
│   │   │   ├── InfoPlist.strings
│   │   │   └── MainMenu.xib
│   │   └── main.m
│   └── PopoverSampleApp.xcodeproj/
│       ├── project.pbxproj
│       └── project.xcworkspace/
│           └── contents.xcworkspacedata
└── README.md

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

================================================
FILE: .gitignore
================================================
# OS X
.DS_Store

# Xcode
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
*.xccheckout
profile
*.moved-aside
DerivedData
*.hmap
*.ipa

# CocoaPods
Pods

# AppCode
.idea/

================================================
FILE: INPopoverController/INPopoverController-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>English</string>
        <key>CFBundleExecutable</key>
        <string>${EXECUTABLE_NAME}</string>
        <key>CFBundleIconFile</key>
        <string></string>
        <key>CFBundleIdentifier</key>
        <string>com.indragie.INPopoverController.${PRODUCT_NAME:rfc1034identifier}</string>
        <key>CFBundleInfoDictionaryVersion</key>
        <string>6.0</string>
        <key>CFBundleName</key>
        <string>${PRODUCT_NAME}</string>
        <key>CFBundlePackageType</key>
        <string>FMWK</string>
        <key>CFBundleShortVersionString</key>
        <string>1.0</string>
        <key>CFBundleSignature</key>
        <string>????</string>
        <key>CFBundleVersion</key>
        <string>1</string>
        <key>NSHumanReadableCopyright</key>
        <string>Copyright © 2011 Indragie Karunaratne. All rights reserved.</string>
        <key>NSPrincipalClass</key>
        <string></string>
    </dict>
</plist>


================================================
FILE: INPopoverController/INPopoverController.h
================================================
//
//  INPopoverController.h
//  Copyright 2011-2014 Indragie Karunaratne. All rights reserved.
//

#import <Cocoa/Cocoa.h>
#import "INPopoverControllerDefines.h"

@protocol INPopoverControllerDelegate;

@interface INPopoverController : NSObject

#pragma mark -
#pragma mark Properties

/** The delegate of the INPopoverController object (should conform to the INPopoverControllerDelegate protocol) **/
@property (nonatomic, assign) id <INPopoverControllerDelegate> delegate;

/** The background color of the popover. Default value is [NSColor blackColor] with an alpha value of 0.8. Changes to this value are not animated. **/
@property (nonatomic, strong) NSColor *color;

/** Border color to use when drawing a border. Default value: [NSColor blackColor]. Changes to this value are not animated. **/
@property (nonatomic, strong) NSColor *borderColor;

/** Color to use for drawing a 1px highlight just below the top. Can be nil. Changes to this value are not animated. **/
@property (nonatomic, strong) NSColor *topHighlightColor;

/** The width of the popover border, drawn using borderColor. Default value: 0.0 (no border). Changes to this value are not animated. **/
@property (nonatomic, assign) CGFloat borderWidth;

/** Corner radius of the popover window. Default value: 4. Changes to this value are not animated. **/
@property (nonatomic, assign) CGFloat cornerRadius;

/** The size of the popover arrow. Default value: {23, 12}. Changes to this value are not animated. **/
@property (nonatomic, assign) NSSize arrowSize;

/** The current arrow direction of the popover. If the popover has never been displayed, then this will return INPopoverArrowDirectionUndefined */
@property (nonatomic, assign, readonly) INPopoverArrowDirection arrowDirection;

/** The size of the content of the popover. This is automatically set to contentViewController's size when the view controller is set, but can be modified. Changes to this value are animated when animates is set to YES **/
@property (nonatomic, assign) NSSize contentSize;

/** Whether the popover closes when user presses escape key. Default value: YES */
@property (nonatomic, assign) BOOL closesWhenEscapeKeyPressed;

/** Whether the popover closes when the popover window resigns its key status. Default value: YES **/
@property (nonatomic, assign) BOOL closesWhenPopoverResignsKey;

/** Whether the popover closes when the application becomes inactive. Default value: NO **/
@property (nonatomic, assign) BOOL closesWhenApplicationBecomesInactive;

/** Enable or disable animation when showing/closing the popover and changing the content size. Default value: YES */
@property (nonatomic, assign) BOOL animates;

/* If `animates` is `YES`, this is the animation type to use when showing/closing the popover.
   Default value: `INPopoverAnimationTypePop` **/
@property (nonatomic, assign) INPopoverAnimationType animationType;

/** The content view controller from which content is displayed in the popover **/
@property (nonatomic, strong) NSViewController *contentViewController;

/** The view that the currently displayed popover is positioned relative to. If there is no popover being displayed, this returns nil. **/
@property (nonatomic, strong, readonly) NSView *positionView;

/** The window of the popover **/
@property (nonatomic, strong, readonly) NSWindow *popoverWindow;

/** Whether the popover is currently visible or not **/
@property (nonatomic, assign, readonly) BOOL popoverIsVisible;

#pragma mark -
#pragma mark Methods

/**
 Initializes the popover with a content view already set.
 @param viewController the content view controller
 @returns a new instance of INPopoverController
 */
- (id)initWithContentViewController:(NSViewController *)viewController;

/**
 Displays the popover.
 @param rect the rect in the positionView from which to display the popover
 @param positionView the view that the popover is positioned relative to
 @param direction the prefered direction at which the arrow will point. There is no guarantee that this will be the actual arrow direction, depending on whether the screen is able to accomodate the popover in that position.
 @param anchors Whether the popover binds to the frame of the positionView. This means that if the positionView is resized or moved, the popover will be repositioned according to the point at which it was originally placed. This also means that if the positionView goes off screen, the popover will be automatically closed. **/

- (void)presentPopoverFromRect:(NSRect)rect inView:(NSView *)positionView preferredArrowDirection:(INPopoverArrowDirection)direction anchorsToPositionView:(BOOL)anchors;

/** 
 Recalculates the best arrow direction for the current window position and resets the arrow direction. The change will not be animated. **/
- (void)recalculateAndResetArrowDirection;

/**
 Closes the popover unless NO is returned for the -popoverShouldClose: delegate method 
 @param sender the object that sent this message
 */
- (IBAction)closePopover:(id)sender;

/**
 Closes the popover regardless of what the delegate returns
 @param sender the object that sent this message
 */
- (IBAction)forceClosePopover:(id)sender;

/**
 Returns the frame for a popop window with a given size depending on the arrow direction.
 @param contentSize the popover window content size
 @param direction the arrow direction
 */
- (NSRect)popoverFrameWithSize:(NSSize)contentSize andArrowDirection:(INPopoverArrowDirection)direction;

@end

@protocol INPopoverControllerDelegate <NSObject>
@optional
/**
 When the -closePopover: method is invoked, this method is called to give a change for the delegate to prevent it from closing. Returning NO for this delegate method will prevent the popover being closed. This delegate method does not apply to the -forceClosePopover: method, which will close the popover regardless of what the delegate returns.
 @param popover the @class INPopoverController object that is controlling the popover
 @returns whether the popover should close or not
 */
- (BOOL)popoverShouldClose:(INPopoverController *)popover;

/**
 Invoked right before the popover shows on screen
 @param popover the @class INPopoverController object that is controlling the popover
 */
- (void)popoverWillShow:(INPopoverController *)popover;

/**
 Invoked right after the popover shows on screen
 @param popover the @class INPopoverController object that is controlling the popover
 */
- (void)popoverDidShow:(INPopoverController *)popover;

/**
 Invoked right before the popover closes
 @param popover the @class INPopoverController object that is controlling the popover
 */
- (void)popoverWillClose:(INPopoverController *)popover;

/**
 Invoked right after the popover closes
 @param popover the @class INPopoverController object that is controlling the popover
 */
- (void)popoverDidClose:(INPopoverController *)popover;
@end


================================================
FILE: INPopoverController/INPopoverController.m
================================================
//
//  INPopoverController.m
//  Copyright 2011-2014 Indragie Karunaratne. All rights reserved.
//

#import "INPopoverController.h"
#import "INPopoverWindow.h"
#import "INPopoverWindowFrame.h"
#import "INPopoverParentWindow.h"
#include <QuartzCore/QuartzCore.h>

@implementation INPopoverController {
	INPopoverWindow *_popoverWindow;
	NSRect _screenRect;
	NSRect _viewRect;
}

#pragma mark -
#pragma mark Initialization

- (id)init
{
	if ((self = [super init])) {
		[self _setInitialPropertyValues];
	}
	return self;
}

- (void)awakeFromNib
{
	[super awakeFromNib];
	[self _setInitialPropertyValues];
}

#pragma mark - 
#pragma mark - Memory Management

- (void)dealloc
{
	_popoverWindow.popoverController = nil;
}

#pragma mark -
#pragma mark Public Methods

- (id)initWithContentViewController:(NSViewController *)viewController
{
	if ((self = [super init])) {
		[self _setInitialPropertyValues];
		self.contentViewController = viewController;
	}
	return self;
}

- (void)presentPopoverFromRect:(NSRect)rect inView:(NSView *)positionView preferredArrowDirection:(INPopoverArrowDirection)direction anchorsToPositionView:(BOOL)anchors
{
	if (self.popoverIsVisible) {return;} // If it's already visible, do nothing
	NSWindow *mainWindow = [positionView window];
	_positionView = positionView;
	_viewRect = rect;
	_screenRect = [positionView convertRect:rect toView:nil]; // Convert the rect to window coordinates
	_screenRect.origin = [mainWindow convertBaseToScreen:_screenRect.origin]; // Convert window coordinates to screen coordinates
	INPopoverArrowDirection calculatedDirection = [self _arrowDirectionWithPreferredArrowDirection:direction]; // Calculate the best arrow direction
	[self _setArrowDirection:calculatedDirection]; // Change the arrow direction of the popover
	NSRect windowFrame = [self popoverFrameWithSize:self.contentSize andArrowDirection:calculatedDirection]; // Calculate the window frame based on the arrow direction
	[_popoverWindow setFrame:windowFrame display:YES]; // Se the frame of the window
	[[_popoverWindow animationForKey:@"alphaValue"] setDelegate:self];

	// Show the popover
	[self _callDelegateMethod:@selector(popoverWillShow:)]; // Call the delegate
	if (self.animates && self.animationType != INPopoverAnimationTypeFadeOut) {
		// Animate the popover in
		[_popoverWindow presentAnimated];
	} else {
		[_popoverWindow setAlphaValue:1.0];
		[mainWindow addChildWindow:_popoverWindow ordered:NSWindowAbove]; // Add the popover as a child window of the main window
		[_popoverWindow makeKeyAndOrderFront:nil]; // Show the popover
		[self _callDelegateMethod:@selector(popoverDidShow:)]; // Call the delegate
	}

	NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
	if (anchors) {  // If the anchors option is enabled, register for frame change notifications
		[nc addObserver:self selector:@selector(_positionViewFrameChanged:) name:NSViewFrameDidChangeNotification object:self.positionView];
	}
	// When -closesWhenPopoverResignsKey is set to YES, the popover will automatically close when the popover loses its key status
	if (self.closesWhenPopoverResignsKey) {
		[nc addObserver:self selector:@selector(closePopover:) name:NSWindowDidResignKeyNotification object:_popoverWindow];
		if (!self.closesWhenApplicationBecomesInactive) {
			[nc addObserver:self selector:@selector(applicationDidBecomeActive:) name:NSApplicationDidBecomeActiveNotification object:nil];
		}
	} else if (self.closesWhenApplicationBecomesInactive) {
		// this is only needed if closesWhenPopoverResignsKey is NO, otherwise we already get a "resign key" notification when resigning active
		[nc addObserver:self selector:@selector(closePopover:) name:NSApplicationDidResignActiveNotification object:nil];
	}
}

- (void)recalculateAndResetArrowDirection
{
	INPopoverArrowDirection direction = [self _arrowDirectionWithPreferredArrowDirection:self.arrowDirection];
	[self _setArrowDirection:direction];
}

- (IBAction)closePopover:(id)sender
{
	if (![_popoverWindow isVisible]) {return;}
	if ([sender isKindOfClass:[NSNotification class]] && [[(NSNotification *) sender name] isEqualToString:NSWindowDidResignKeyNotification]) {
		// ignore "resign key" notification sent when app becomes inactive unless closesWhenApplicationBecomesInactive is enabled
		if (!self.closesWhenApplicationBecomesInactive && ![NSApp isActive])
			return;
	}
	BOOL close = YES;
	// Check to see if the delegate has implemented the -popoverShouldClose: method
	if ([self.delegate respondsToSelector:@selector(popoverShouldClose:)]) {
		close = [self.delegate popoverShouldClose:self];
	}
	if (close) {[self forceClosePopover:nil];}
}

- (IBAction)forceClosePopover:(id)sender
{
	if (![_popoverWindow isVisible]) {return;}
	[self _callDelegateMethod:@selector(popoverWillClose:)]; // Call delegate
	if (self.animates && self.animationType != INPopoverAnimationTypeFadeIn) {
		[_popoverWindow dismissAnimated];
	} else {
		[self _closePopoverAndResetVariables];
	}
}

// Calculate the frame of the window depending on the arrow direction
- (NSRect)popoverFrameWithSize:(NSSize)contentSize andArrowDirection:(INPopoverArrowDirection)direction
{
	NSRect contentRect = NSZeroRect;
	contentRect.size = contentSize;
	NSRect windowFrame = [_popoverWindow frameRectForContentRect:contentRect];
	if (direction == INPopoverArrowDirectionUp) {
		CGFloat xOrigin = NSMidX(_screenRect) - floor(windowFrame.size.width / 2.0);
		CGFloat yOrigin = NSMinY(_screenRect) - windowFrame.size.height;
		windowFrame.origin = NSMakePoint(xOrigin, yOrigin);
	} else if (direction == INPopoverArrowDirectionDown) {
		CGFloat xOrigin = NSMidX(_screenRect) - floor(windowFrame.size.width / 2.0);
		windowFrame.origin = NSMakePoint(xOrigin, NSMaxY(_screenRect));
	} else if (direction == INPopoverArrowDirectionLeft) {
		CGFloat yOrigin = NSMidY(_screenRect) - floor(windowFrame.size.height / 2.0);
		windowFrame.origin = NSMakePoint(NSMaxX(_screenRect), yOrigin);
	} else if (direction == INPopoverArrowDirectionRight) {
		CGFloat xOrigin = NSMinX(_screenRect) - windowFrame.size.width;
		CGFloat yOrigin = NSMidY(_screenRect) - floor(windowFrame.size.height / 2.0);
		windowFrame.origin = NSMakePoint(xOrigin, yOrigin);
	} else {
		// If no arrow direction is specified, just return an empty rect
		windowFrame = NSZeroRect;
	}
	return windowFrame;
}

- (void)animationDidStop:(CAAnimation *)animation finished:(BOOL)flag
{
#pragma unused(animation)
#pragma unused(flag)
	// Detect the end of fade out and close the window
	if (0.0 == [_popoverWindow alphaValue])
		[self _closePopoverAndResetVariables];
	else if (1.0 == [_popoverWindow alphaValue]) {
		[[_positionView window] addChildWindow:_popoverWindow ordered:NSWindowAbove];
		[self _callDelegateMethod:@selector(popoverDidShow:)];
	}
}

- (void)applicationDidBecomeActive:(NSNotification *)notification
{
	// when the user clicks in the parent window for activating the app, the parent window becomes key which prevents 
	if ([_popoverWindow isVisible])
		[self performSelector:@selector(checkPopoverKeyWindowStatus) withObject:nil afterDelay:0];
}

- (void)checkPopoverKeyWindowStatus
{
	id parentWindow = [_positionView window]; // could be INPopoverParentWindow
	BOOL isKey = [parentWindow respondsToSelector:@selector(isReallyKeyWindow)] ? [parentWindow isReallyKeyWindow] : [parentWindow isKeyWindow];
	if (isKey)
		[_popoverWindow makeKeyWindow];
}

#pragma mark -
#pragma mark Getters

- (NSColor *)color
{
	return _popoverWindow.frameView.color;
}

- (CGFloat)borderWidth
{
	return _popoverWindow.frameView.borderWidth;
}

- (NSColor *)borderColor
{
	return _popoverWindow.frameView.borderColor;
}

- (NSColor *)topHighlightColor
{
	return _popoverWindow.frameView.topHighlightColor;
}

- (CGFloat)cornerRadius
{
	return _popoverWindow.frameView.cornerRadius;
}

- (NSSize)arrowSize
{
	return _popoverWindow.frameView.arrowSize;
}

- (INPopoverArrowDirection)arrowDirection
{
	return _popoverWindow.frameView.arrowDirection;
}

- (NSView *)contentView
{
	return [_popoverWindow popoverContentView];
}

- (BOOL)popoverIsVisible
{
	return [_popoverWindow isVisible];
}

#pragma mark -
#pragma mark Setters

- (void)setColor:(NSColor *)newColor
{
	_popoverWindow.frameView.color = newColor;
}

- (void)setBorderWidth:(CGFloat)newBorderWidth
{
	_popoverWindow.frameView.borderWidth = newBorderWidth;
}

- (void)setBorderColor:(NSColor *)newBorderColor
{
	_popoverWindow.frameView.borderColor = newBorderColor;
}

- (void)setTopHighlightColor:(NSColor *)newTopHighlightColor
{
	_popoverWindow.frameView.topHighlightColor = newTopHighlightColor;
}

- (void)setCornerRadius:(CGFloat)cornerRadius
{
	_popoverWindow.frameView.cornerRadius = cornerRadius;
}

- (void)setArrowSize:(NSSize)arrowSize
{
	_popoverWindow.frameView.arrowSize = arrowSize;
}

- (void)setContentViewController:(NSViewController *)newContentViewController
{
	if (_contentViewController != newContentViewController) {
		[_popoverWindow setPopoverContentView:nil]; // Clear the content view
		_contentViewController = newContentViewController;
		NSView *contentView = [_contentViewController view];
		self.contentSize = [contentView frame].size;
		[_popoverWindow setPopoverContentView:contentView];
	}
}

- (void)setContentSize:(NSSize)newContentSize
{
	// We use -frameRectForContentRect: just to get the frame size because the origin it returns is not the one we want to use. Instead, -windowFrameWithSize:andArrowDirection: is used to  complete the frame
	_contentSize = newContentSize;
	NSRect adjustedRect = [self popoverFrameWithSize:newContentSize andArrowDirection:self.arrowDirection];
	[_popoverWindow setFrame:adjustedRect display:YES animate:self.animates];
}

- (void)_setArrowDirection:(INPopoverArrowDirection)direction
{
	_popoverWindow.frameView.arrowDirection = direction;
}

#pragma mark -
#pragma mark Private

// Set the default values for all the properties as described in the header documentation
- (void)_setInitialPropertyValues
{
	// Create an empty popover window
	_popoverWindow = [[INPopoverWindow alloc] initWithContentRect:NSZeroRect styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:NO];
	_popoverWindow.popoverController = self;

	// set defaults like iCal popover
	self.color = [NSColor colorWithCalibratedWhite:0.94 alpha:0.92];
	self.borderColor = [NSColor colorWithCalibratedWhite:1.0 alpha:0.92];
	self.borderWidth = 1.0;
	self.closesWhenEscapeKeyPressed = YES;
	self.closesWhenPopoverResignsKey = YES;
	self.closesWhenApplicationBecomesInactive = NO;
	self.animates = YES;
	self.animationType = INPopoverAnimationTypePop;

	// create animation to get callback - delegate is set when opening popover to avoid memory cycles
	CAAnimation *animation = [CABasicAnimation animation];
	[_popoverWindow setAnimations:[NSDictionary dictionaryWithObject:animation forKey:@"alphaValue"]];
}

// Figure out which direction best stays in screen bounds
- (INPopoverArrowDirection)_arrowDirectionWithPreferredArrowDirection:(INPopoverArrowDirection)direction
{
	NSRect screenFrame = [[[_positionView window] screen] frame];
	// If the window with the preferred arrow direction already falls within the screen bounds then no need to go any further
	NSRect windowFrame = [self popoverFrameWithSize:self.contentSize andArrowDirection:direction];
	if (NSContainsRect(screenFrame, windowFrame)) {
		return direction;
	}
	// First thing to try is making the popover go opposite of its current direction
	INPopoverArrowDirection newDirection = INPopoverArrowDirectionUndefined;
	switch (direction) {
		case INPopoverArrowDirectionUp:
			newDirection = INPopoverArrowDirectionDown;
			break;
		case INPopoverArrowDirectionDown:
			newDirection = INPopoverArrowDirectionUp;
			break;
		case INPopoverArrowDirectionLeft:
			newDirection = INPopoverArrowDirectionRight;
			break;
		case INPopoverArrowDirectionRight:
			newDirection = INPopoverArrowDirectionLeft;
			break;
		default:
			break;
	}
	// If the popover now fits within bounds, then return the newly adjusted direction
	windowFrame = [self popoverFrameWithSize:self.contentSize andArrowDirection:newDirection];
	if (NSContainsRect(screenFrame, windowFrame)) {
		return newDirection;
	}
	// Calculate the remaining space on each side and figure out which would be the best to try next
	CGFloat left = NSMinX(_screenRect);
	CGFloat right = screenFrame.size.width - NSMaxX(_screenRect);
	CGFloat up = screenFrame.size.height - NSMaxY(_screenRect);
	CGFloat down = NSMinY(_screenRect);
	BOOL arrowLeft = (right > left);
	BOOL arrowUp = (down > up);
	// Now the next thing to try is the direction with the most space
	switch (direction) {
		case INPopoverArrowDirectionUp:
		case INPopoverArrowDirectionDown:
			newDirection = arrowLeft ? INPopoverArrowDirectionLeft : INPopoverArrowDirectionRight;
		case INPopoverArrowDirectionLeft:
		case INPopoverArrowDirectionRight:
			newDirection = arrowUp ? INPopoverArrowDirectionUp : INPopoverArrowDirectionDown;
			break;
		default:
			break;
	}
	// If the popover now fits within bounds, then return the newly adjusted direction
	windowFrame = [self popoverFrameWithSize:self.contentSize andArrowDirection:newDirection];
	if (NSContainsRect(screenFrame, windowFrame)) {
		return newDirection;
	}
	// If that didn't fit, then that means that it will be out of bounds on every side so just return the original direction
	return direction;
}

- (void)_positionViewFrameChanged:(NSNotification *)notification
{
	NSRect superviewBounds = [[self.positionView superview] bounds];
	if (!(NSContainsRect(superviewBounds, [self.positionView frame]))) {
		[self forceClosePopover:nil]; // If the position view goes off screen then close the popover
		return;
	}
	NSRect newFrame = [_popoverWindow frame];
	_screenRect = [self.positionView convertRect:_viewRect toView:nil]; // Convert the rect to window coordinates
	_screenRect.origin = [[self.positionView window] convertBaseToScreen:_screenRect.origin]; // Convert window coordinates to screen coordinates
	NSRect calculatedFrame = [self popoverFrameWithSize:self.contentSize andArrowDirection:self.arrowDirection]; // Calculate the window frame based on the arrow direction
	newFrame.origin = calculatedFrame.origin;
	[_popoverWindow setFrame:newFrame display:YES animate:NO]; // Set the frame of the window
}

- (void)_closePopoverAndResetVariables
{
	NSWindow *positionWindow = [self.positionView window];
	[_popoverWindow orderOut:nil]; // Close the window 
	[self _callDelegateMethod:@selector(popoverDidClose:)]; // Call the delegate to inform that the popover has closed
	[positionWindow removeChildWindow:_popoverWindow]; // Remove it as a child window
	[positionWindow makeKeyAndOrderFront:nil];
	// Clear all the ivars
	[self _setArrowDirection:INPopoverArrowDirectionUndefined];
	[[NSNotificationCenter defaultCenter] removeObserver:self];
	_positionView = nil;
	_screenRect = NSZeroRect;
	_viewRect = NSZeroRect;

	// When using ARC and no animation, there is a "message sent to deallocated instance" crash if setDelegate: is not performed at the end of the event.
	[[_popoverWindow animationForKey:@"alphaValue"] performSelector:@selector(setDelegate:) withObject:nil afterDelay:0];
}

- (void)_callDelegateMethod:(SEL)selector
{
	if ([self.delegate respondsToSelector:selector]) {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Warc-performSelector-leaks"
		[self.delegate performSelector:selector withObject:self];
#pragma clang diagnostic pop
	}
}

@end


================================================
FILE: INPopoverController/INPopoverControllerDefines.h
================================================
//
//  INPopoverControllerDefines.h
//  Copyright 2011-2014 Indragie Karunaratne. All rights reserved.
//

typedef NS_ENUM(NSUInteger, INPopoverArrowDirection) {
	INPopoverArrowDirectionUndefined = 0,
	INPopoverArrowDirectionLeft,
	INPopoverArrowDirectionRight,
	INPopoverArrowDirectionUp,
	INPopoverArrowDirectionDown
};

typedef NS_ENUM(NSInteger, INPopoverAnimationType) {
	INPopoverAnimationTypePop = 0,	// Pop animation similar to NSPopover
	INPopoverAnimationTypeFadeIn,	// Fade in only, no fade out
	INPopoverAnimationTypeFadeOut,	// Fade out only, no fade in
	INPopoverAnimationTypeFadeInOut // Fade in and out
};

================================================
FILE: INPopoverController/INPopoverParentWindow.h
================================================
//
//  INPopoverParentWindow.h
//  Copyright 2011-2014 Indragie Karunaratne. All rights reserved.
//

#import <Cocoa/Cocoa.h>

@interface INPopoverParentWindow : NSWindow

- (BOOL)isReallyKeyWindow;

@end


================================================
FILE: INPopoverController/INPopoverParentWindow.m
================================================
//
//  INAlwaysKeyWindow.m
//  Copyright 2011-2014 Indragie Karunaratne. All rights reserved.
//

#import "INPopoverParentWindow.h"
#import "INPopoverWindow.h"

@implementation INPopoverParentWindow

- (BOOL)isKeyWindow
{
	BOOL isKey = [super isKeyWindow];
	if (!isKey) {
		for (NSWindow *childWindow in [self childWindows]) {
			if ([childWindow isKindOfClass:[INPopoverWindow class]]) {
				// if we have popover attached, window is key if app is active
				isKey = [NSApp isActive];
				break;
			}
		}
	}
	return isKey;
}

- (BOOL)isReallyKeyWindow
{
	return [super isKeyWindow];
}

@end


================================================
FILE: INPopoverController/INPopoverPrefixHeader.pch
================================================
#ifdef __OBJC__

#import <Cocoa/Cocoa.h>

#endif


================================================
FILE: INPopoverController/INPopoverWindow.h
================================================
//
//  INPopoverWindow.h
//  Copyright 2011-2014 Indragie Karunaratne. All rights reserved.
//

#import <AppKit/AppKit.h>
#import "INPopoverControllerDefines.h"

/** 
 @class INPopoverWindow
 An NSWindow subclass used to draw a custom window frame (@class INPopoverWindowFrame)
 **/
@class INPopoverWindowFrame;
@class INPopoverController;

@interface INPopoverWindow : NSPanel
@property (nonatomic, readonly) INPopoverWindowFrame *frameView; // Equivalent to contentView
@property (nonatomic, assign) INPopoverController *popoverController;
@property (nonatomic, strong) NSView *popoverContentView;

- (void)presentAnimated;
- (void)dismissAnimated;

@end


================================================
FILE: INPopoverController/INPopoverWindow.m
================================================
//
//  INPopoverWindow.m
//  Copyright 2011-2014 Indragie Karunaratne. All rights reserved.
//

#import "INPopoverWindow.h"
#import "INPopoverControllerDefines.h"
#import "INPopoverWindowFrame.h"
#import "INPopoverController.h"
#import <QuartzCore/QuartzCore.h>

#define START_SIZE            NSMakeSize(20, 20)
#define OVERSHOOT_FACTOR    1.2

// A lot of this code was adapted from the following article:
// <http://cocoawithlove.com/2008/12/drawing-custom-window-on-mac-os-x.html>

@implementation INPopoverWindow {
	NSView *_popoverContentView;
	NSWindow *_zoomWindow;
}

// Borderless, transparent window
- (id)initWithContentRect:(NSRect)contentRect styleMask:(NSUInteger)windowStyle backing:(NSBackingStoreType)bufferingType defer:(BOOL)deferCreation
{
	if ((self = [super initWithContentRect:contentRect styleMask:NSNonactivatingPanelMask backing:bufferingType defer:deferCreation])) {
		[self setOpaque:NO];
		[self setBackgroundColor:[NSColor clearColor]];
		[self setHasShadow:YES];
	}
	return self;
}

// Leave some space around the content for drawing the arrow
- (NSRect)contentRectForFrameRect:(NSRect)windowFrame
{
	windowFrame.origin = NSZeroPoint;
	const CGFloat arrowHeight = self.frameView.arrowSize.height;
	return NSInsetRect(windowFrame, arrowHeight, arrowHeight);
}

- (NSRect)frameRectForContentRect:(NSRect)contentRect
{
	const CGFloat arrowHeight = self.frameView.arrowSize.height;
	return NSInsetRect(contentRect, -arrowHeight, -arrowHeight);
}

// Allow the popover to become the key window
- (BOOL)canBecomeKeyWindow
{
	return YES;
}

- (BOOL)canBecomeMainWindow
{
	return NO;
}

- (BOOL)isVisible
{
	return [super isVisible] || [_zoomWindow isVisible];
}

- (INPopoverWindowFrame *)frameView
{
	return (INPopoverWindowFrame *) [self contentView];
}

- (void)setContentView:(NSView *)aView
{
	[self setPopoverContentView:aView];
}

- (void)setPopoverContentView:(NSView *)aView
{
	if ([_popoverContentView isEqualTo:aView]) {return;}
	NSRect bounds = [self frame];
	bounds.origin = NSZeroPoint;
	INPopoverWindowFrame *frameView = [self frameView];
	if (!frameView) {
		frameView = [[INPopoverWindowFrame alloc] initWithFrame:bounds];
		[super setContentView:frameView]; // Call on super or there will be infinite loop
	}
	if (_popoverContentView) {
		[_popoverContentView removeFromSuperview];
	}
	_popoverContentView = aView;
	[_popoverContentView setFrame:[self contentRectForFrameRect:bounds]];
	[_popoverContentView setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
	[frameView addSubview:_popoverContentView];
}

- (void)presentAnimated
{
	if ([self isVisible])
		return;
	
	switch (self.popoverController.animationType) {
		case INPopoverAnimationTypePop:
			[self presentWithPopAnimation];
			break;
		case INPopoverAnimationTypeFadeIn:
		case INPopoverAnimationTypeFadeInOut:
			[self presentWithFadeAnimation];
			break;
		default:
			break;
	}
}

- (void)presentWithPopAnimation
{
	NSRect endFrame = [self frame];
	NSRect startFrame = [self.popoverController popoverFrameWithSize:START_SIZE andArrowDirection:self.frameView.arrowDirection];
	NSRect overshootFrame = [self.popoverController popoverFrameWithSize:NSMakeSize(endFrame.size.width * OVERSHOOT_FACTOR, endFrame.size.height * OVERSHOOT_FACTOR) andArrowDirection:self.frameView.arrowDirection];
	
	_zoomWindow = [self _zoomWindowWithRect:startFrame];
	[_zoomWindow setAlphaValue:0.0];
	[_zoomWindow orderFront:self];
	
	// configure bounce-out animation
	CAKeyframeAnimation *anim = [CAKeyframeAnimation animation];
	[anim setDelegate:self];
	[anim setValues:[NSArray arrayWithObjects:[NSValue valueWithRect:startFrame], [NSValue valueWithRect:overshootFrame], [NSValue valueWithRect:endFrame], nil]];
	[_zoomWindow setAnimations:[NSDictionary dictionaryWithObjectsAndKeys:anim, @"frame", nil]];
	
	[NSAnimationContext beginGrouping];
	[[_zoomWindow animator] setAlphaValue:1.0];
	[[_zoomWindow animator] setFrame:endFrame display:YES];
	[NSAnimationContext endGrouping];
}

- (void)presentWithFadeAnimation
{
	[self setAlphaValue:0.0];
	[self makeKeyAndOrderFront:nil];
	[[self animator] setAlphaValue:1.0];
}

- (void)dismissAnimated
{
	[[_zoomWindow animator] setAlphaValue:0.0]; // in case zoom window is currently animating
	[[self animator] setAlphaValue:0.0];
}

- (void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag
{
	[self setAlphaValue:1.0];
	[self makeKeyAndOrderFront:self];
	[_zoomWindow close];
	_zoomWindow = nil;

	// call the animation delegate of the "real" window
	CAAnimation *windowAnimation = [self animationForKey:@"alphaValue"];
	[[windowAnimation delegate] animationDidStop:anim finished:flag];
}

- (void)cancelOperation:(id)sender
{
	if (self.popoverController.closesWhenEscapeKeyPressed) [self.popoverController closePopover:nil];
}

#pragma mark -
#pragma mark Private

// The following method is adapted from the following class:
// <https://github.com/MrNoodle/NoodleKit/blob/master/NSWindow-NoodleEffects.m>
//  Copyright 2007-2009 Noodlesoft, LLC. All rights reserved.
- (NSWindow *)_zoomWindowWithRect:(NSRect)rect
{
	BOOL isOneShot = [self isOneShot];
	if (isOneShot)
		[self setOneShot:NO];

	if ([self windowNumber] <= 0) {
		// force creation of window device by putting it on-screen. We make it transparent to minimize the chance of visible flicker
		CGFloat alpha = [self alphaValue];
		[self setAlphaValue:0.0];
		[self orderBack:self];
		[self orderOut:self];
		[self setAlphaValue:alpha];
	}

	// get window content as image
	NSRect frame = [self frame];
	NSImage *image = [[NSImage alloc] initWithSize:frame.size];
	[self displayIfNeeded];    // refresh view
	NSView *view = self.contentView;
	NSBitmapImageRep *imageRep = [view bitmapImageRepForCachingDisplayInRect:view.bounds];
	[view cacheDisplayInRect:view.bounds toBitmapImageRep:imageRep];
	[image addRepresentation:imageRep];

	// create zoom window
	NSWindow *zoomWindow = [[NSWindow alloc] initWithContentRect:rect styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:NO];
	[zoomWindow setBackgroundColor:[NSColor clearColor]];
	[zoomWindow setHasShadow:[self hasShadow]];
	[zoomWindow setLevel:[self level]];
	[zoomWindow setOpaque:NO];
	[zoomWindow setReleasedWhenClosed:NO];
	[zoomWindow useOptimizedDrawing:YES];

	NSImageView *imageView = [[NSImageView alloc] initWithFrame:[zoomWindow contentRectForFrameRect:frame]];
	[imageView setImage:image];
	[imageView setImageFrameStyle:NSImageFrameNone];
	[imageView setImageScaling:NSScaleToFit];
	[imageView setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];

	[zoomWindow setContentView:imageView];

	// reset one shot flag
	[self setOneShot:isOneShot];

	return zoomWindow;
}

@end


================================================
FILE: INPopoverController/INPopoverWindowFrame.h
================================================
//
//  INPopoverWindowFrame.h
//  Copyright 2011-2014 Indragie Karunaratne. All rights reserved.
//

#import <Cocoa/Cocoa.h>
#import "INPopoverControllerDefines.h"

/**
 @class INPopoverWindowFrame
 The NSView subclass responsible for drawing the frame of the popover
 */
@interface INPopoverWindowFrame : NSView
@property (nonatomic, strong) NSColor *color;
@property (nonatomic, strong) NSColor *borderColor;
@property (nonatomic, strong) NSColor *topHighlightColor;
@property (nonatomic, assign) CGFloat borderWidth;
@property (nonatomic, assign) CGFloat cornerRadius;
@property (nonatomic, assign) NSSize arrowSize;
@property (nonatomic, assign) INPopoverArrowDirection arrowDirection;
@end


================================================
FILE: INPopoverController/INPopoverWindowFrame.m
================================================
//
//  INPopoverWindowFrame.m
//  Copyright 2011-2014 Indragie Karunaratne. All rights reserved.
//

#import "INPopoverWindowFrame.h"

@implementation INPopoverWindowFrame

- (id)initWithFrame:(NSRect)frame
{
	if ((self = [super initWithFrame:frame])) {
		_color = [NSColor colorWithCalibratedWhite:0.0 alpha:0.8];
		_cornerRadius = 4.0;
		_arrowSize = NSMakeSize(23.0, 12.0);
		_arrowDirection = INPopoverArrowDirectionLeft;
	}
	return self;
}

- (void)drawRect:(NSRect)dirtyRect
{
	NSRect bounds = [self bounds];
	if (((NSUInteger) self.borderWidth % 2) == 1) { // Remove draw glitch on odd border width
		bounds = NSInsetRect(bounds, 0.5, 0.5);
	}

	NSBezierPath *path = [self _popoverBezierPathWithRect:bounds];
	if (self.color) {
		[self.color set];
		[path fill];
	}
	if (self.borderWidth > 0) {
		[path setLineWidth:self.borderWidth];
		[self.borderColor set];
		[path stroke];
	}

	const CGFloat arrowWidth = self.arrowSize.width;
	const CGFloat arrowHeight = self.arrowSize.height;
	const CGFloat radius = self.cornerRadius;

	if (self.topHighlightColor) {
		[self.topHighlightColor set];
		NSRect bounds = NSInsetRect([self bounds], arrowHeight, arrowHeight);
		NSRect lineRect = NSMakeRect(floor(NSMinX(bounds) + (radius / 2.0)), NSMaxY(bounds) - self.borderWidth - 1, NSWidth(bounds) - radius, 1.0);

		if (self.arrowDirection == INPopoverArrowDirectionUp) {
			CGFloat width = floor((lineRect.size.width / 2.0) - (arrowWidth / 2.0));
			NSRectFill(NSMakeRect(lineRect.origin.x, lineRect.origin.y, width, lineRect.size.height));
			NSRectFill(NSMakeRect(floor(lineRect.origin.x + (lineRect.size.width / 2.0) + (arrowWidth / 2.0)), lineRect.origin.y, width, lineRect.size.height));
		} else {
			NSRectFill(lineRect);
		}
	}
}

#pragma mark -
#pragma mark Private

- (NSBezierPath *)_popoverBezierPathWithRect:(NSRect)aRect
{
	const CGFloat radius = self.cornerRadius;
	const CGFloat arrowWidth = self.arrowSize.width;
	const CGFloat arrowHeight = self.arrowSize.height;
	const CGFloat inset = radius + arrowHeight;
	const NSRect drawingRect = NSInsetRect(aRect, inset, inset);
	const CGFloat minX = NSMinX(drawingRect);
	const CGFloat maxX = NSMaxX(drawingRect);
	const CGFloat minY = NSMinY(drawingRect);
	const CGFloat maxY = NSMaxY(drawingRect);

	NSBezierPath *path = [NSBezierPath bezierPath];
	[path setLineJoinStyle:NSRoundLineJoinStyle];

	// Bottom left corner
	[path appendBezierPathWithArcWithCenter:NSMakePoint(minX, minY) radius:radius startAngle:180.0 endAngle:270.0];
	if (self.arrowDirection == INPopoverArrowDirectionDown) {
		CGFloat midX = NSMidX(drawingRect);
		NSPoint points[3];
		points[0] = NSMakePoint(floor(midX - (arrowWidth / 2.0)), minY - radius); // Starting point
		points[1] = NSMakePoint(floor(midX), points[0].y - arrowHeight); // Arrow tip
		points[2] = NSMakePoint(floor(midX + (arrowWidth / 2.0)), points[0].y); // Ending point
		[path appendBezierPathWithPoints:points count:3];
	}
	// Bottom right corner
	[path appendBezierPathWithArcWithCenter:NSMakePoint(maxX, minY) radius:radius startAngle:270.0 endAngle:360.0];
	if (self.arrowDirection == INPopoverArrowDirectionRight) {
		CGFloat midY = NSMidY(drawingRect);
		NSPoint points[3];
		points[0] = NSMakePoint(maxX + radius, floor(midY - (arrowWidth / 2.0)));
		points[1] = NSMakePoint(points[0].x + arrowHeight, floor(midY));
		points[2] = NSMakePoint(points[0].x, floor(midY + (arrowWidth / 2.0)));
		[path appendBezierPathWithPoints:points count:3];
	}
	// Top right corner
	[path appendBezierPathWithArcWithCenter:NSMakePoint(maxX, maxY) radius:radius startAngle:0.0 endAngle:90.0];
	if (self.arrowDirection == INPopoverArrowDirectionUp) {
		CGFloat midX = NSMidX(drawingRect);
		NSPoint points[3];
		points[0] = NSMakePoint(floor(midX + (arrowWidth / 2.0)), maxY + radius);
		points[1] = NSMakePoint(floor(midX), points[0].y + arrowHeight);
		points[2] = NSMakePoint(floor(midX - (arrowWidth / 2.0)), points[0].y);
		[path appendBezierPathWithPoints:points count:3];
	}
	// Top left corner
	[path appendBezierPathWithArcWithCenter:NSMakePoint(minX, maxY) radius:radius startAngle:90.0 endAngle:180.0];
	if (self.arrowDirection == INPopoverArrowDirectionLeft) {
		CGFloat midY = NSMidY(drawingRect);
		NSPoint points[3];
		points[0] = NSMakePoint(minX - radius, floor(midY + (arrowWidth / 2.0)));
		points[1] = NSMakePoint(points[0].x - arrowHeight, floor(midY));
		points[2] = NSMakePoint(points[0].x, floor(midY - (arrowWidth / 2.0)));
		[path appendBezierPathWithPoints:points count:3];
	}
	[path closePath];

	return path;
}

#pragma mark -
#pragma mark Accessors

// Redraw the frame every time a property is changed
- (void)setColor:(NSColor *)newColor
{
	if (_color != newColor) {
		_color = newColor;
		[self setNeedsDisplay:YES];
	}
}

- (void)setBorderColor:(NSColor *)newBorderColor
{
	if (_borderColor != newBorderColor) {
		_borderColor = newBorderColor;
		[self setNeedsDisplay:YES];
	}
}


- (void)setBorderWidth:(CGFloat)newBorderWidth
{
	if (_borderWidth != newBorderWidth) {
		_borderWidth = newBorderWidth;
		[self setNeedsDisplay:YES];
	}
}

- (void)setCornerRadius:(CGFloat)cornerRadius
{
	if (_cornerRadius != cornerRadius) {
		_cornerRadius = cornerRadius;
		[self setNeedsDisplay:YES];
	}
}

- (void)setArrowSize:(NSSize)arrowSize
{
	if (!NSEqualSizes(_arrowSize, arrowSize)) {
		_arrowSize = arrowSize;
		[self setNeedsDisplay:YES];
	}
}

- (void)setArrowDirection:(INPopoverArrowDirection)newArrowDirection
{
	if (_arrowDirection != newArrowDirection) {
		_arrowDirection = newArrowDirection;
		[self setNeedsDisplay:YES];
	}
}

@end


================================================
FILE: INPopoverController.podspec
================================================
Pod::Spec.new do |s|
	s.name					= 'INPopoverController'
	s.version				= '0.0.1'
	s.summary				= 'A customizable popover controller for Mac OS X'
	s.homepage				= 'https://github.com/indragiek/INPopoverController'
	s.author   				= { 'Indragie Karunaratne' => 'i@indragie.com' }
	s.source   				= { :git => 'https://github.com/indragiek/INPopoverController.git' }
	s.source_files			= 'INPopoverController/*.{h,m}'
 	s.public_header_files	= 'INPopoverController/*.h'
	s.platform 				= :osx
	s.requires_arc 			= true
	s.license				= 'BSD'
	s.frameworks			= 'QuartzCore'
end


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

/* Begin PBXBuildFile section */
		7619A0908F1873F212A86D92 /* INPopoverController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7619A090EED3A0874FFB0542 /* INPopoverController.m */; };
		7619A507692D41F9A4EA0EB1 /* INPopoverController.h in Headers */ = {isa = PBXBuildFile; fileRef = 7619AF3F1F908EC06616FBBA /* INPopoverController.h */; settings = {ATTRIBUTES = (Public, ); }; };
		7619A5078560AD04EB09398F /* INPopoverWindowFrame.m in Sources */ = {isa = PBXBuildFile; fileRef = 7619AFDD9CA28B629C79B9B7 /* INPopoverWindowFrame.m */; };
		7619A72138650AA792042726 /* INPopoverParentWindow.h in Headers */ = {isa = PBXBuildFile; fileRef = 7619A3274F11C96F76F9A2AA /* INPopoverParentWindow.h */; };
		7619A73868BE7D04215703FA /* INPopoverControllerDefines.h in Headers */ = {isa = PBXBuildFile; fileRef = 7619A49B8AE793DFA2663E95 /* INPopoverControllerDefines.h */; settings = {ATTRIBUTES = (Public, ); }; };
		7619A73A585AD478336FBD44 /* INPopoverParentWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = 7619A840E914A3391A33BCB2 /* INPopoverParentWindow.m */; };
		7619A7C39101BC5170F2CF23 /* INPopoverWindow.h in Headers */ = {isa = PBXBuildFile; fileRef = 7619AEB4110920D49EB68147 /* INPopoverWindow.h */; };
		7619AFCF3AC75534C6582B37 /* INPopoverWindowFrame.h in Headers */ = {isa = PBXBuildFile; fileRef = 7619ABC89C19022487731625 /* INPopoverWindowFrame.h */; };
		7619AFCFD4611DEE23332859 /* INPopoverWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = 7619A46EB85527945376718B /* INPopoverWindow.m */; };
		98BA893B143EA04A006F744E /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 98BA893A143EA04A006F744E /* Cocoa.framework */; };
		98BA8983143EA1E9006F744E /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 98BA8982143EA1E9006F744E /* QuartzCore.framework */; };
		98BA8985143EA28E006F744E /* INPopoverPrefixHeader.pch in Headers */ = {isa = PBXBuildFile; fileRef = 98BA8984143EA28E006F744E /* INPopoverPrefixHeader.pch */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
		7619A090EED3A0874FFB0542 /* INPopoverController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = INPopoverController.m; sourceTree = "<group>"; };
		7619A3274F11C96F76F9A2AA /* INPopoverParentWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = INPopoverParentWindow.h; sourceTree = "<group>"; };
		7619A46EB85527945376718B /* INPopoverWindow.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = INPopoverWindow.m; sourceTree = "<group>"; };
		7619A49B8AE793DFA2663E95 /* INPopoverControllerDefines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = INPopoverControllerDefines.h; sourceTree = "<group>"; };
		7619A840E914A3391A33BCB2 /* INPopoverParentWindow.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = INPopoverParentWindow.m; sourceTree = "<group>"; };
		7619ABC89C19022487731625 /* INPopoverWindowFrame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = INPopoverWindowFrame.h; sourceTree = "<group>"; };
		7619AEB4110920D49EB68147 /* INPopoverWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = INPopoverWindow.h; sourceTree = "<group>"; };
		7619AF3F1F908EC06616FBBA /* INPopoverController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = INPopoverController.h; sourceTree = "<group>"; };
		7619AFDD9CA28B629C79B9B7 /* INPopoverWindowFrame.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = INPopoverWindowFrame.m; sourceTree = "<group>"; };
		98BA8937143EA04A006F744E /* INPopoverController.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = INPopoverController.framework; sourceTree = BUILT_PRODUCTS_DIR; };
		98BA893A143EA04A006F744E /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
		98BA893D143EA04A006F744E /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; };
		98BA893E143EA04A006F744E /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; };
		98BA893F143EA04A006F744E /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
		98BA8942143EA04A006F744E /* INPopoverController-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "INPopoverController-Info.plist"; sourceTree = "<group>"; };
		98BA8982143EA1E9006F744E /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = SDKs/MacOSX10.6.sdk/System/Library/Frameworks/QuartzCore.framework; sourceTree = DEVELOPER_DIR; };
		98BA8984143EA28E006F744E /* INPopoverPrefixHeader.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = INPopoverPrefixHeader.pch; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
		98BA8933143EA04A006F744E /* Frameworks */ = {
			isa = PBXFrameworksBuildPhase;
			buildActionMask = 2147483647;
			files = (
				98BA893B143EA04A006F744E /* Cocoa.framework in Frameworks */,
				98BA8983143EA1E9006F744E /* QuartzCore.framework in Frameworks */,
			);
			runOnlyForDeploymentPostprocessing = 0;
		};
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
		98BA892B143EA049006F744E = {
			isa = PBXGroup;
			children = (
				98BA8940143EA04A006F744E /* INPopoverController */,
				98BA8939143EA04A006F744E /* Frameworks */,
				98BA8938143EA04A006F744E /* Products */,
			);
			sourceTree = "<group>";
		};
		98BA8938143EA04A006F744E /* Products */ = {
			isa = PBXGroup;
			children = (
				98BA8937143EA04A006F744E /* INPopoverController.framework */,
			);
			name = Products;
			sourceTree = "<group>";
		};
		98BA8939143EA04A006F744E /* Frameworks */ = {
			isa = PBXGroup;
			children = (
				98BA8982143EA1E9006F744E /* QuartzCore.framework */,
				98BA893A143EA04A006F744E /* Cocoa.framework */,
				98BA893C143EA04A006F744E /* Other Frameworks */,
			);
			name = Frameworks;
			sourceTree = "<group>";
		};
		98BA893C143EA04A006F744E /* Other Frameworks */ = {
			isa = PBXGroup;
			children = (
				98BA893D143EA04A006F744E /* AppKit.framework */,
				98BA893E143EA04A006F744E /* CoreData.framework */,
				98BA893F143EA04A006F744E /* Foundation.framework */,
			);
			name = "Other Frameworks";
			sourceTree = "<group>";
		};
		98BA8940143EA04A006F744E /* INPopoverController */ = {
			isa = PBXGroup;
			children = (
				98BA8941143EA04A006F744E /* Supporting Files */,
				7619A49B8AE793DFA2663E95 /* INPopoverControllerDefines.h */,
				7619AF3F1F908EC06616FBBA /* INPopoverController.h */,
				7619A090EED3A0874FFB0542 /* INPopoverController.m */,
				7619ABC89C19022487731625 /* INPopoverWindowFrame.h */,
				7619AFDD9CA28B629C79B9B7 /* INPopoverWindowFrame.m */,
				7619AEB4110920D49EB68147 /* INPopoverWindow.h */,
				7619A46EB85527945376718B /* INPopoverWindow.m */,
				7619A3274F11C96F76F9A2AA /* INPopoverParentWindow.h */,
				7619A840E914A3391A33BCB2 /* INPopoverParentWindow.m */,
			);
			path = INPopoverController;
			sourceTree = "<group>";
		};
		98BA8941143EA04A006F744E /* Supporting Files */ = {
			isa = PBXGroup;
			children = (
				98BA8984143EA28E006F744E /* INPopoverPrefixHeader.pch */,
				98BA8942143EA04A006F744E /* INPopoverController-Info.plist */,
			);
			name = "Supporting Files";
			sourceTree = "<group>";
		};
/* End PBXGroup section */

/* Begin PBXHeadersBuildPhase section */
		98BA8934143EA04A006F744E /* Headers */ = {
			isa = PBXHeadersBuildPhase;
			buildActionMask = 2147483647;
			files = (
				98BA8985143EA28E006F744E /* INPopoverPrefixHeader.pch in Headers */,
				7619A507692D41F9A4EA0EB1 /* INPopoverController.h in Headers */,
				7619A72138650AA792042726 /* INPopoverParentWindow.h in Headers */,
				7619A73868BE7D04215703FA /* INPopoverControllerDefines.h in Headers */,
				7619A7C39101BC5170F2CF23 /* INPopoverWindow.h in Headers */,
				7619AFCF3AC75534C6582B37 /* INPopoverWindowFrame.h in Headers */,
			);
			runOnlyForDeploymentPostprocessing = 0;
		};
/* End PBXHeadersBuildPhase section */

/* Begin PBXNativeTarget section */
		98BA8936143EA04A006F744E /* INPopoverController */ = {
			isa = PBXNativeTarget;
			buildConfigurationList = 98BA8962143EA04B006F744E /* Build configuration list for PBXNativeTarget "INPopoverController" */;
			buildPhases = (
				98BA8932143EA04A006F744E /* Sources */,
				98BA8933143EA04A006F744E /* Frameworks */,
				98BA8934143EA04A006F744E /* Headers */,
				98BA8935143EA04A006F744E /* Resources */,
			);
			buildRules = (
			);
			dependencies = (
			);
			name = INPopoverController;
			productName = INPopoverController;
			productReference = 98BA8937143EA04A006F744E /* INPopoverController.framework */;
			productType = "com.apple.product-type.framework";
		};
/* End PBXNativeTarget section */

/* Begin PBXProject section */
		98BA892D143EA049006F744E /* Project object */ = {
			isa = PBXProject;
			attributes = {
				LastUpgradeCheck = 0500;
			};
			buildConfigurationList = 98BA8930143EA049006F744E /* Build configuration list for PBXProject "INPopoverController" */;
			compatibilityVersion = "Xcode 3.2";
			developmentRegion = English;
			hasScannedForEncodings = 0;
			knownRegions = (
				en,
			);
			mainGroup = 98BA892B143EA049006F744E;
			productRefGroup = 98BA8938143EA04A006F744E /* Products */;
			projectDirPath = "";
			projectRoot = "";
			targets = (
				98BA8936143EA04A006F744E /* INPopoverController */,
			);
		};
/* End PBXProject section */

/* Begin PBXResourcesBuildPhase section */
		98BA8935143EA04A006F744E /* Resources */ = {
			isa = PBXResourcesBuildPhase;
			buildActionMask = 2147483647;
			files = (
			);
			runOnlyForDeploymentPostprocessing = 0;
		};
/* End PBXResourcesBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
		98BA8932143EA04A006F744E /* Sources */ = {
			isa = PBXSourcesBuildPhase;
			buildActionMask = 2147483647;
			files = (
				7619A0908F1873F212A86D92 /* INPopoverController.m in Sources */,
				7619A5078560AD04EB09398F /* INPopoverWindowFrame.m in Sources */,
				7619AFCFD4611DEE23332859 /* INPopoverWindow.m in Sources */,
				7619A73A585AD478336FBD44 /* INPopoverParentWindow.m in Sources */,
			);
			runOnlyForDeploymentPostprocessing = 0;
		};
/* End PBXSourcesBuildPhase section */

/* Begin XCBuildConfiguration section */
		98BA8960143EA04B006F744E /* Debug */ = {
			isa = XCBuildConfiguration;
			buildSettings = {
				ALWAYS_SEARCH_USER_PATHS = NO;
				CLANG_ENABLE_OBJC_ARC = YES;
				CLANG_WARN_BOOL_CONVERSION = YES;
				CLANG_WARN_CONSTANT_CONVERSION = YES;
				CLANG_WARN_EMPTY_BODY = YES;
				CLANG_WARN_ENUM_CONVERSION = YES;
				CLANG_WARN_INT_CONVERSION = YES;
				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
				COPY_PHASE_STRIP = NO;
				GCC_C_LANGUAGE_STANDARD = gnu99;
				GCC_DYNAMIC_NO_PIC = NO;
				GCC_ENABLE_OBJC_EXCEPTIONS = YES;
				GCC_OPTIMIZATION_LEVEL = 0;
				GCC_PREPROCESSOR_DEFINITIONS = (
					"DEBUG=1",
					"$(inherited)",
				);
				GCC_SYMBOLS_PRIVATE_EXTERN = NO;
				GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
				GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
				GCC_WARN_ABOUT_RETURN_TYPE = YES;
				GCC_WARN_UNDECLARED_SELECTOR = YES;
				GCC_WARN_UNINITIALIZED_AUTOS = YES;
				GCC_WARN_UNUSED_FUNCTION = YES;
				GCC_WARN_UNUSED_VARIABLE = YES;
				MACOSX_DEPLOYMENT_TARGET = 10.6;
				ONLY_ACTIVE_ARCH = YES;
				SDKROOT = macosx;
			};
			name = Debug;
		};
		98BA8961143EA04B006F744E /* Release */ = {
			isa = XCBuildConfiguration;
			buildSettings = {
				ALWAYS_SEARCH_USER_PATHS = NO;
				CLANG_ENABLE_OBJC_ARC = YES;
				CLANG_WARN_BOOL_CONVERSION = YES;
				CLANG_WARN_CONSTANT_CONVERSION = YES;
				CLANG_WARN_EMPTY_BODY = YES;
				CLANG_WARN_ENUM_CONVERSION = YES;
				CLANG_WARN_INT_CONVERSION = YES;
				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
				COPY_PHASE_STRIP = YES;
				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
				GCC_C_LANGUAGE_STANDARD = gnu99;
				GCC_ENABLE_OBJC_EXCEPTIONS = YES;
				GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
				GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
				GCC_WARN_ABOUT_RETURN_TYPE = YES;
				GCC_WARN_UNDECLARED_SELECTOR = YES;
				GCC_WARN_UNINITIALIZED_AUTOS = YES;
				GCC_WARN_UNUSED_FUNCTION = YES;
				GCC_WARN_UNUSED_VARIABLE = YES;
				MACOSX_DEPLOYMENT_TARGET = 10.6;
				SDKROOT = macosx;
			};
			name = Release;
		};
		98BA8963143EA04B006F744E /* Debug */ = {
			isa = XCBuildConfiguration;
			buildSettings = {
				CLANG_ENABLE_OBJC_ARC = YES;
				COMBINE_HIDPI_IMAGES = YES;
				DYLIB_COMPATIBILITY_VERSION = 1;
				DYLIB_CURRENT_VERSION = 1;
				FRAMEWORK_SEARCH_PATHS = (
					"$(inherited)",
					"\"$(DEVELOPER_DIR)/SDKs/MacOSX10.6.sdk/System/Library/Frameworks\"",
				);
				FRAMEWORK_VERSION = A;
				GCC_PRECOMPILE_PREFIX_HEADER = YES;
				GCC_PREFIX_HEADER = INPopoverController/INPopoverPrefixHeader.pch;
				GCC_VERSION = "";
				GCC_WARN_64_TO_32_BIT_CONVERSION = NO;
				INFOPLIST_FILE = "INPopoverController/INPopoverController-Info.plist";
				INSTALL_PATH = "@rpath";
				PRODUCT_NAME = "$(TARGET_NAME)";
				SDKROOT = macosx;
				WRAPPER_EXTENSION = framework;
			};
			name = Debug;
		};
		98BA8964143EA04B006F744E /* Release */ = {
			isa = XCBuildConfiguration;
			buildSettings = {
				CLANG_ENABLE_OBJC_ARC = YES;
				COMBINE_HIDPI_IMAGES = YES;
				DYLIB_COMPATIBILITY_VERSION = 1;
				DYLIB_CURRENT_VERSION = 1;
				FRAMEWORK_SEARCH_PATHS = (
					"$(inherited)",
					"\"$(DEVELOPER_DIR)/SDKs/MacOSX10.6.sdk/System/Library/Frameworks\"",
				);
				FRAMEWORK_VERSION = A;
				GCC_PRECOMPILE_PREFIX_HEADER = YES;
				GCC_PREFIX_HEADER = INPopoverController/INPopoverPrefixHeader.pch;
				GCC_VERSION = "";
				GCC_WARN_64_TO_32_BIT_CONVERSION = NO;
				INFOPLIST_FILE = "INPopoverController/INPopoverController-Info.plist";
				INSTALL_PATH = "@rpath";
				PRODUCT_NAME = "$(TARGET_NAME)";
				SDKROOT = macosx;
				WRAPPER_EXTENSION = framework;
			};
			name = Release;
		};
/* End XCBuildConfiguration section */

/* Begin XCConfigurationList section */
		98BA8930143EA049006F744E /* Build configuration list for PBXProject "INPopoverController" */ = {
			isa = XCConfigurationList;
			buildConfigurations = (
				98BA8960143EA04B006F744E /* Debug */,
				98BA8961143EA04B006F744E /* Release */,
			);
			defaultConfigurationIsVisible = 0;
			defaultConfigurationName = Release;
		};
		98BA8962143EA04B006F744E /* Build configuration list for PBXNativeTarget "INPopoverController" */ = {
			isa = XCConfigurationList;
			buildConfigurations = (
				98BA8963143EA04B006F744E /* Debug */,
				98BA8964143EA04B006F744E /* Release */,
			);
			defaultConfigurationIsVisible = 0;
			defaultConfigurationName = Release;
		};
/* End XCConfigurationList section */
	};
	rootObject = 98BA892D143EA049006F744E /* Project object */;
}


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


================================================
FILE: LICENSE
================================================
Copyright (c) 2011-2014, Indragie Karunaratne
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

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: PopoverSampleApp/PopoverSampleApp/AlphaColorWell.h
================================================
//
//  AlphaColorWell.h
//  PopoverSampleApp
//
//  Created by Indragie Karunaratne on 1/11/2014.
//

#import <Cocoa/Cocoa.h>

@interface AlphaColorWell : NSColorWell

@end


================================================
FILE: PopoverSampleApp/PopoverSampleApp/AlphaColorWell.m
================================================
//
//  AlphaColorWell.m
//  PopoverSampleApp
//
//  Created by Indragie Karunaratne on 1/11/2014.
//

#import "AlphaColorWell.h"

@implementation AlphaColorWell

- (void)activate:(BOOL)exclusive
{
    [[NSColorPanel sharedColorPanel] setShowsAlpha:YES];
    [super activate:exclusive];
}

@end


================================================
FILE: PopoverSampleApp/PopoverSampleApp/ContentViewController.h
================================================
//
//  ContentViewController.h
//  Copyright 2011-2014 Indragie Karunaratne. All rights reserved.
//

#import <Cocoa/Cocoa.h>


@interface ContentViewController : NSViewController {
@private
    
}

@end


================================================
FILE: PopoverSampleApp/PopoverSampleApp/ContentViewController.m
================================================
//
//  ContentViewController.m
//  Copyright 2011-2014 Indragie Karunaratne. All rights reserved.
//

#import "ContentViewController.h"


@implementation ContentViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Initialization code here.
    }
    
    return self;
}


@end


================================================
FILE: PopoverSampleApp/PopoverSampleApp/ContentViewController.xib
================================================
<?xml version="1.0" encoding="UTF-8"?>
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="8.00">
	<data>
		<int key="IBDocument.SystemTarget">1070</int>
		<string key="IBDocument.SystemVersion">11A390</string>
		<string key="IBDocument.InterfaceBuilderVersion">1510</string>
		<string key="IBDocument.AppKitVersion">1110.91</string>
		<string key="IBDocument.HIToolboxVersion">544.00</string>
		<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
			<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
			<string key="NS.object.0">1510</string>
		</object>
		<array key="IBDocument.IntegratedClassDependencies">
			<string>NSCustomView</string>
			<string>NSTextField</string>
			<string>NSTextFieldCell</string>
			<string>NSCustomObject</string>
		</array>
		<array key="IBDocument.PluginDependencies">
			<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
		</array>
		<dictionary class="NSMutableDictionary" key="IBDocument.Metadata"/>
		<array class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
			<object class="NSCustomObject" id="1001">
				<string key="NSClassName">ContentViewController</string>
			</object>
			<object class="NSCustomObject" id="1003">
				<string key="NSClassName">FirstResponder</string>
			</object>
			<object class="NSCustomObject" id="1004">
				<string key="NSClassName">NSApplication</string>
			</object>
			<object class="NSCustomView" id="1005">
				<reference key="NSNextResponder"/>
				<int key="NSvFlags">268</int>
				<array class="NSMutableArray" key="NSSubviews">
					<object class="NSTextField" id="423807661">
						<reference key="NSNextResponder" ref="1005"/>
						<int key="NSvFlags">268</int>
						<string key="NSFrame">{{68, 83}, {215, 39}}</string>
						<reference key="NSSuperview" ref="1005"/>
						<reference key="NSWindow"/>
						<string key="NSReuseIdentifierKey">_NS:3583</string>
						<bool key="NSEnabled">YES</bool>
						<object class="NSTextFieldCell" key="NSCell" id="854481628">
							<int key="NSCellFlags">67239424</int>
							<int key="NSCellFlags2">272629760</int>
							<string key="NSContents">This is view content loaded from ContentViewController.xib</string>
							<object class="NSFont" key="NSSupport">
								<string key="NSName">LucidaGrande</string>
								<double key="NSSize">13</double>
								<int key="NSfFlags">16</int>
							</object>
							<reference key="NSControlView" ref="423807661"/>
							<object class="NSColor" key="NSBackgroundColor">
								<int key="NSColorSpace">6</int>
								<string key="NSCatalogName">System</string>
								<string key="NSColorName">controlColor</string>
								<object class="NSColor" key="NSColor">
									<int key="NSColorSpace">3</int>
									<bytes key="NSWhite">MC42NjY2NjY2NjY3AA</bytes>
								</object>
							</object>
							<object class="NSColor" key="NSTextColor">
								<int key="NSColorSpace">1</int>
								<bytes key="NSRGB">MCAwIDAAA</bytes>
							</object>
						</object>
					</object>
				</array>
				<string key="NSFrameSize">{351, 204}</string>
				<reference key="NSSuperview"/>
				<reference key="NSWindow"/>
				<string key="NSClassName">NSView</string>
			</object>
		</array>
		<object class="IBObjectContainer" key="IBDocument.Objects">
			<array class="NSMutableArray" key="connectionRecords">
				<object class="IBConnectionRecord">
					<object class="IBOutletConnection" key="connection">
						<string key="label">view</string>
						<reference key="source" ref="1001"/>
						<reference key="destination" ref="1005"/>
					</object>
					<int key="connectionID">3</int>
				</object>
			</array>
			<object class="IBMutableOrderedSet" key="objectRecords">
				<array key="orderedObjects">
					<object class="IBObjectRecord">
						<int key="objectID">0</int>
						<array key="object" id="0"/>
						<reference key="children" ref="1000"/>
						<nil key="parent"/>
					</object>
					<object class="IBObjectRecord">
						<int key="objectID">-2</int>
						<reference key="object" ref="1001"/>
						<reference key="parent" ref="0"/>
						<string key="objectName">File's Owner</string>
					</object>
					<object class="IBObjectRecord">
						<int key="objectID">-1</int>
						<reference key="object" ref="1003"/>
						<reference key="parent" ref="0"/>
						<string key="objectName">First Responder</string>
					</object>
					<object class="IBObjectRecord">
						<int key="objectID">-3</int>
						<reference key="object" ref="1004"/>
						<reference key="parent" ref="0"/>
						<string key="objectName">Application</string>
					</object>
					<object class="IBObjectRecord">
						<int key="objectID">1</int>
						<reference key="object" ref="1005"/>
						<array class="NSMutableArray" key="children">
							<reference ref="423807661"/>
						</array>
						<reference key="parent" ref="0"/>
					</object>
					<object class="IBObjectRecord">
						<int key="objectID">6</int>
						<reference key="object" ref="423807661"/>
						<array class="NSMutableArray" key="children">
							<reference ref="854481628"/>
						</array>
						<reference key="parent" ref="1005"/>
					</object>
					<object class="IBObjectRecord">
						<int key="objectID">7</int>
						<reference key="object" ref="854481628"/>
						<reference key="parent" ref="423807661"/>
					</object>
				</array>
			</object>
			<dictionary class="NSMutableDictionary" key="flattenedProperties">
				<string key="-1.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
				<string key="-2.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
				<string key="-3.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
				<string key="1.IBEditorWindowLastContentRect">{{633, 728}, {480, 272}}</string>
				<string key="1.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
				<string key="1.WindowOrigin">{628, 654}</string>
				<string key="1.editorWindowContentRectSynchronizationRect">{{357, 416}, {480, 272}}</string>
				<string key="6.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
				<string key="7.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
			</dictionary>
			<dictionary class="NSMutableDictionary" key="unlocalizedProperties"/>
			<nil key="activeLocalization"/>
			<dictionary class="NSMutableDictionary" key="localizations"/>
			<nil key="sourceID"/>
			<int key="maxID">7</int>
		</object>
		<object class="IBClassDescriber" key="IBDocument.Classes">
			<array class="NSMutableArray" key="referencedPartialClassDescriptions">
				<object class="IBPartialClassDescription">
					<string key="className">ContentViewController</string>
					<string key="superclassName">NSViewController</string>
					<object class="IBClassDescriptionSource" key="sourceIdentifier">
						<string key="majorKey">IBProjectSource</string>
						<string key="minorKey">./Classes/ContentViewController.h</string>
					</object>
				</object>
			</array>
		</object>
		<int key="IBDocument.localizationMode">0</int>
		<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string>
		<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
		<int key="IBDocument.defaultPropertyAccessControl">3</int>
	</data>
</archive>


================================================
FILE: PopoverSampleApp/PopoverSampleApp/PopoverSampleApp-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.indragie.${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>NSMainNibFile</key>
	<string>MainMenu</string>
	<key>NSPrincipalClass</key>
	<string>NSApplication</string>
</dict>
</plist>


================================================
FILE: PopoverSampleApp/PopoverSampleApp/PopoverSampleApp-Prefix.pch
================================================
//
// Prefix header for all source files of the 'PopoverSampleApp' target in the 'PopoverSampleApp' project
//

#ifdef __OBJC__
    #import <Cocoa/Cocoa.h>
#endif


================================================
FILE: PopoverSampleApp/PopoverSampleApp/PopoverSampleAppAppDelegate.h
================================================
//
//  PopoverSampleAppAppDelegate.h
//  Copyright 2011-2014 Indragie Karunaratne. All rights reserved.
//

#import <Cocoa/Cocoa.h>

@class INPopoverController;
@interface PopoverSampleAppAppDelegate : NSObject <NSApplicationDelegate> {
@private
    NSWindow *__weak window;
    INPopoverController *popoverController;
}
@property (nonatomic, strong) INPopoverController *popoverController;
@property (weak) IBOutlet NSWindow *window;
- (IBAction)togglePopover:(id)sender;
@end


================================================
FILE: PopoverSampleApp/PopoverSampleApp/PopoverSampleAppAppDelegate.m
================================================
//
//  PopoverSampleAppAppDelegate.m
//  Copyright 2011-2014 Indragie Karunaratne. All rights reserved.
//

#import "PopoverSampleAppAppDelegate.h"
#import "ContentViewController.h"
#import <INPopoverController/INPopoverController.h>

@implementation PopoverSampleAppAppDelegate
@synthesize window, popoverController;

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
    ContentViewController *viewController = [[ContentViewController alloc] initWithNibName:@"ContentViewController" bundle:nil];
    self.popoverController = [[INPopoverController alloc] initWithContentViewController:viewController];
}

- (IBAction)togglePopover:(id)sender
{
    if (self.popoverController.popoverIsVisible) {
        [self.popoverController closePopover:nil];
    } else {
        [self.popoverController presentPopoverFromRect:[sender bounds] inView:sender preferredArrowDirection:INPopoverArrowDirectionLeft anchorsToPositionView:YES];
    }
}

@end


================================================
FILE: PopoverSampleApp/PopoverSampleApp/en.lproj/Credits.rtf
================================================
{\rtf0\ansi{\fonttbl\f0\fswiss Helvetica;}
{\colortbl;\red255\green255\blue255;}
\paperw9840\paperh8400
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural

\f0\b\fs24 \cf0 Engineering:
\b0 \
	Some people\
\

\b Human Interface Design:
\b0 \
	Some other people\
\

\b Testing:
\b0 \
	Hopefully not nobody\
\

\b Documentation:
\b0 \
	Whoever\
\

\b With special thanks to:
\b0 \
	Mom\
}


================================================
FILE: PopoverSampleApp/PopoverSampleApp/en.lproj/InfoPlist.strings
================================================
/* Localized versions of Info.plist keys */



================================================
FILE: PopoverSampleApp/PopoverSampleApp/en.lproj/MainMenu.xib
================================================
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="4514" systemVersion="13A598" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
    <dependencies>
        <deployment defaultVersion="1070" identifier="macosx"/>
        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="4514"/>
    </dependencies>
    <objects>
        <customObject id="-2" userLabel="File's Owner" customClass="NSApplication">
            <connections>
                <outlet property="delegate" destination="494" id="495"/>
            </connections>
        </customObject>
        <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
        <customObject id="-3" userLabel="Application"/>
        <menu title="AMainMenu" systemMenu="main" id="29">
            <items>
                <menuItem title="PopoverSampleApp" id="56">
                    <menu key="submenu" title="PopoverSampleApp" systemMenu="apple" id="57">
                        <items>
                            <menuItem title="About PopoverSampleApp" id="58">
                                <modifierMask key="keyEquivalentModifierMask"/>
                                <connections>
                                    <action selector="orderFrontStandardAboutPanel:" target="-2" id="142"/>
                                </connections>
                            </menuItem>
                            <menuItem isSeparatorItem="YES" id="236">
                                <modifierMask key="keyEquivalentModifierMask" command="YES"/>
                            </menuItem>
                            <menuItem title="Preferences…" keyEquivalent="," id="129"/>
                            <menuItem isSeparatorItem="YES" id="143">
                                <modifierMask key="keyEquivalentModifierMask" command="YES"/>
                            </menuItem>
                            <menuItem title="Services" id="131">
                                <menu key="submenu" title="Services" systemMenu="services" id="130"/>
                            </menuItem>
                            <menuItem isSeparatorItem="YES" id="144">
                                <modifierMask key="keyEquivalentModifierMask" command="YES"/>
                            </menuItem>
                            <menuItem title="Hide PopoverSampleApp" keyEquivalent="h" id="134">
                                <connections>
                                    <action selector="hide:" target="-1" id="367"/>
                                </connections>
                            </menuItem>
                            <menuItem title="Hide Others" keyEquivalent="h" id="145">
                                <modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
                                <connections>
                                    <action selector="hideOtherApplications:" target="-1" id="368"/>
                                </connections>
                            </menuItem>
                            <menuItem title="Show All" id="150">
                                <connections>
                                    <action selector="unhideAllApplications:" target="-1" id="370"/>
                                </connections>
                            </menuItem>
                            <menuItem isSeparatorItem="YES" id="149">
                                <modifierMask key="keyEquivalentModifierMask" command="YES"/>
                            </menuItem>
                            <menuItem title="Quit PopoverSampleApp" keyEquivalent="q" id="136">
                                <connections>
                                    <action selector="terminate:" target="-3" id="449"/>
                                </connections>
                            </menuItem>
                        </items>
                    </menu>
                </menuItem>
                <menuItem title="File" id="83">
                    <menu key="submenu" title="File" id="81">
                        <items>
                            <menuItem title="New" keyEquivalent="n" id="82">
                                <connections>
                                    <action selector="newDocument:" target="-1" id="373"/>
                                </connections>
                            </menuItem>
                            <menuItem title="Open…" keyEquivalent="o" id="72">
                                <connections>
                                    <action selector="openDocument:" target="-1" id="374"/>
                                </connections>
                            </menuItem>
                            <menuItem title="Open Recent" id="124">
                                <menu key="submenu" title="Open Recent" systemMenu="recentDocuments" id="125">
                                    <items>
                                        <menuItem title="Clear Menu" id="126">
                                            <connections>
                                                <action selector="clearRecentDocuments:" target="-1" id="127"/>
                                            </connections>
                                        </menuItem>
                                    </items>
                                </menu>
                            </menuItem>
                            <menuItem isSeparatorItem="YES" id="79">
                                <modifierMask key="keyEquivalentModifierMask" command="YES"/>
                            </menuItem>
                            <menuItem title="Close" keyEquivalent="w" id="73">
                                <connections>
                                    <action selector="performClose:" target="-1" id="193"/>
                                </connections>
                            </menuItem>
                            <menuItem title="Save" keyEquivalent="s" id="75">
                                <connections>
                                    <action selector="saveDocument:" target="-1" id="362"/>
                                </connections>
                            </menuItem>
                            <menuItem title="Save As…" keyEquivalent="S" id="80">
                                <modifierMask key="keyEquivalentModifierMask" shift="YES" command="YES"/>
                                <connections>
                                    <action selector="saveDocumentAs:" target="-1" id="363"/>
                                </connections>
                            </menuItem>
                            <menuItem title="Revert to Saved" id="112">
                                <modifierMask key="keyEquivalentModifierMask"/>
                                <connections>
                                    <action selector="revertDocumentToSaved:" target="-1" id="364"/>
                                </connections>
                            </menuItem>
                            <menuItem isSeparatorItem="YES" id="74">
                                <modifierMask key="keyEquivalentModifierMask" command="YES"/>
                            </menuItem>
                            <menuItem title="Page Setup..." keyEquivalent="P" id="77">
                                <modifierMask key="keyEquivalentModifierMask" shift="YES" command="YES"/>
                                <connections>
                                    <action selector="runPageLayout:" target="-1" id="87"/>
                                </connections>
                            </menuItem>
                            <menuItem title="Print…" keyEquivalent="p" id="78">
                                <connections>
                                    <action selector="print:" target="-1" id="86"/>
                                </connections>
                            </menuItem>
                        </items>
                    </menu>
                </menuItem>
                <menuItem title="Edit" id="217">
                    <menu key="submenu" title="Edit" id="205">
                        <items>
                            <menuItem title="Undo" keyEquivalent="z" id="207">
                                <connections>
                                    <action selector="undo:" target="-1" id="223"/>
                                </connections>
                            </menuItem>
                            <menuItem title="Redo" keyEquivalent="Z" id="215">
                                <modifierMask key="keyEquivalentModifierMask" shift="YES" command="YES"/>
                                <connections>
                                    <action selector="redo:" target="-1" id="231"/>
                                </connections>
                            </menuItem>
                            <menuItem isSeparatorItem="YES" id="206">
                                <modifierMask key="keyEquivalentModifierMask" command="YES"/>
                            </menuItem>
                            <menuItem title="Cut" keyEquivalent="x" id="199">
                                <connections>
                                    <action selector="cut:" target="-1" id="228"/>
                                </connections>
                            </menuItem>
                            <menuItem title="Copy" keyEquivalent="c" id="197">
                                <connections>
                                    <action selector="copy:" target="-1" id="224"/>
                                </connections>
                            </menuItem>
                            <menuItem title="Paste" keyEquivalent="v" id="203">
                                <connections>
                                    <action selector="paste:" target="-1" id="226"/>
                                </connections>
                            </menuItem>
                            <menuItem title="Paste and Match Style" keyEquivalent="V" id="485">
                                <modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
                                <connections>
                                    <action selector="pasteAsPlainText:" target="-1" id="486"/>
                                </connections>
                            </menuItem>
                            <menuItem title="Delete" id="202">
                                <connections>
                                    <action selector="delete:" target="-1" id="235"/>
                                </connections>
                            </menuItem>
                            <menuItem title="Select All" keyEquivalent="a" id="198">
                                <connections>
                                    <action selector="selectAll:" target="-1" id="232"/>
                                </connections>
                            </menuItem>
                            <menuItem isSeparatorItem="YES" id="214">
                                <modifierMask key="keyEquivalentModifierMask" command="YES"/>
                            </menuItem>
                            <menuItem title="Find" id="218">
                                <menu key="submenu" title="Find" id="220">
                                    <items>
                                        <menuItem title="Find…" tag="1" keyEquivalent="f" id="209">
                                            <connections>
                                                <action selector="performFindPanelAction:" target="-1" id="241"/>
                                            </connections>
                                        </menuItem>
                                        <menuItem title="Find Next" tag="2" keyEquivalent="g" id="208">
                                            <connections>
                                                <action selector="performFindPanelAction:" target="-1" id="487"/>
                                            </connections>
                                        </menuItem>
                                        <menuItem title="Find Previous" tag="3" keyEquivalent="G" id="213">
                                            <modifierMask key="keyEquivalentModifierMask" shift="YES" command="YES"/>
                                            <connections>
                                                <action selector="performFindPanelAction:" target="-1" id="488"/>
                                            </connections>
                                        </menuItem>
                                        <menuItem title="Use Selection for Find" tag="7" keyEquivalent="e" id="221">
                                            <connections>
                                                <action selector="performFindPanelAction:" target="-1" id="489"/>
                                            </connections>
                                        </menuItem>
                                        <menuItem title="Jump to Selection" keyEquivalent="j" id="210">
                                            <connections>
                                                <action selector="centerSelectionInVisibleArea:" target="-1" id="245"/>
                                            </connections>
                                        </menuItem>
                                    </items>
                                </menu>
                            </menuItem>
                            <menuItem title="Spelling and Grammar" id="216">
                                <menu key="submenu" title="Spelling and Grammar" id="200">
                                    <items>
                                        <menuItem title="Show Spelling and Grammar" keyEquivalent=":" id="204">
                                            <connections>
                                                <action selector="showGuessPanel:" target="-1" id="230"/>
                                            </connections>
                                        </menuItem>
                                        <menuItem title="Check Document Now" keyEquivalent=";" id="201">
                                            <connections>
                                                <action selector="checkSpelling:" target="-1" id="225"/>
                                            </connections>
                                        </menuItem>
                                        <menuItem isSeparatorItem="YES" id="453"/>
                                        <menuItem title="Check Spelling While Typing" id="219">
                                            <connections>
                                                <action selector="toggleContinuousSpellChecking:" target="-1" id="222"/>
                                            </connections>
                                        </menuItem>
                                        <menuItem title="Check Grammar With Spelling" id="346">
                                            <connections>
                                                <action selector="toggleGrammarChecking:" target="-1" id="347"/>
                                            </connections>
                                        </menuItem>
                                        <menuItem title="Correct Spelling Automatically" id="454">
                                            <modifierMask key="keyEquivalentModifierMask"/>
                                            <connections>
                                                <action selector="toggleAutomaticSpellingCorrection:" target="-1" id="456"/>
                                            </connections>
                                        </menuItem>
                                    </items>
                                </menu>
                            </menuItem>
                            <menuItem title="Substitutions" id="348">
                                <menu key="submenu" title="Substitutions" id="349">
                                    <items>
                                        <menuItem title="Show Substitutions" id="457">
                                            <modifierMask key="keyEquivalentModifierMask"/>
                                            <connections>
                                                <action selector="orderFrontSubstitutionsPanel:" target="-1" id="458"/>
                                            </connections>
                                        </menuItem>
                                        <menuItem isSeparatorItem="YES" id="459"/>
                                        <menuItem title="Smart Copy/Paste" tag="1" keyEquivalent="f" id="350">
                                            <connections>
                                                <action selector="toggleSmartInsertDelete:" target="-1" id="355"/>
                                            </connections>
                                        </menuItem>
                                        <menuItem title="Smart Quotes" tag="2" keyEquivalent="g" id="351">
                                            <connections>
                                                <action selector="toggleAutomaticQuoteSubstitution:" target="-1" id="356"/>
                                            </connections>
                                        </menuItem>
                                        <menuItem title="Smart Dashes" id="460">
                                            <modifierMask key="keyEquivalentModifierMask"/>
                                            <connections>
                                                <action selector="toggleAutomaticDashSubstitution:" target="-1" id="461"/>
                                            </connections>
                                        </menuItem>
                                        <menuItem title="Smart Links" tag="3" keyEquivalent="G" id="354">
                                            <modifierMask key="keyEquivalentModifierMask" shift="YES" command="YES"/>
                                            <connections>
                                                <action selector="toggleAutomaticLinkDetection:" target="-1" id="357"/>
                                            </connections>
                                        </menuItem>
                                        <menuItem title="Text Replacement" id="462">
                                            <modifierMask key="keyEquivalentModifierMask"/>
                                            <connections>
                                                <action selector="toggleAutomaticTextReplacement:" target="-1" id="463"/>
                                            </connections>
                                        </menuItem>
                                    </items>
                                </menu>
                            </menuItem>
                            <menuItem title="Transformations" id="450">
                                <modifierMask key="keyEquivalentModifierMask"/>
                                <menu key="submenu" title="Transformations" id="451">
                                    <items>
                                        <menuItem title="Make Upper Case" id="452">
                                            <modifierMask key="keyEquivalentModifierMask"/>
                                            <connections>
                                                <action selector="uppercaseWord:" target="-1" id="464"/>
                                            </connections>
                                        </menuItem>
                                        <menuItem title="Make Lower Case" id="465">
                                            <modifierMask key="keyEquivalentModifierMask"/>
                                            <connections>
                                                <action selector="lowercaseWord:" target="-1" id="468"/>
                                            </connections>
                                        </menuItem>
                                        <menuItem title="Capitalize" id="466">
                                            <modifierMask key="keyEquivalentModifierMask"/>
                                            <connections>
                                                <action selector="capitalizeWord:" target="-1" id="467"/>
                                            </connections>
                                        </menuItem>
                                    </items>
                                </menu>
                            </menuItem>
                            <menuItem title="Speech" id="211">
                                <menu key="submenu" title="Speech" id="212">
                                    <items>
                                        <menuItem title="Start Speaking" id="196">
                                            <connections>
                                                <action selector="startSpeaking:" target="-1" id="233"/>
                                            </connections>
                                        </menuItem>
                                        <menuItem title="Stop Speaking" id="195">
                                            <connections>
                                                <action selector="stopSpeaking:" target="-1" id="227"/>
                                            </connections>
                                        </menuItem>
                                    </items>
                                </menu>
                            </menuItem>
                        </items>
                    </menu>
                </menuItem>
                <menuItem title="Format" id="375">
                    <modifierMask key="keyEquivalentModifierMask"/>
                    <menu key="submenu" title="Format" id="376">
                        <items>
                            <menuItem title="Font" id="377">
                                <modifierMask key="keyEquivalentModifierMask"/>
                                <menu key="submenu" title="Font" systemMenu="font" id="388">
                                    <items>
                                        <menuItem title="Show Fonts" keyEquivalent="t" id="389">
                                            <connections>
                                                <action selector="orderFrontFontPanel:" target="420" id="424"/>
                                            </connections>
                                        </menuItem>
                                        <menuItem title="Bold" tag="2" keyEquivalent="b" id="390">
                                            <connections>
                                                <action selector="addFontTrait:" target="420" id="421"/>
                                            </connections>
                                        </menuItem>
                                        <menuItem title="Italic" tag="1" keyEquivalent="i" id="391">
                                            <connections>
                                                <action selector="addFontTrait:" target="420" id="422"/>
                                            </connections>
                                        </menuItem>
                                        <menuItem title="Underline" keyEquivalent="u" id="392">
                                            <connections>
                                                <action selector="underline:" target="-1" id="432"/>
                                            </connections>
                                        </menuItem>
                                        <menuItem isSeparatorItem="YES" id="393"/>
                                        <menuItem title="Bigger" tag="3" keyEquivalent="+" id="394">
                                            <connections>
                                                <action selector="modifyFont:" target="420" id="425"/>
                                            </connections>
                                        </menuItem>
                                        <menuItem title="Smaller" tag="4" keyEquivalent="-" id="395">
                                            <connections>
                                                <action selector="modifyFont:" target="420" id="423"/>
                                            </connections>
                                        </menuItem>
                                        <menuItem isSeparatorItem="YES" id="396"/>
                                        <menuItem title="Kern" id="397">
                                            <modifierMask key="keyEquivalentModifierMask"/>
                                            <menu key="submenu" title="Kern" id="415">
                                                <items>
                                                    <menuItem title="Use Default" id="416">
                                                        <modifierMask key="keyEquivalentModifierMask"/>
                                                        <connections>
                                                            <action selector="useStandardKerning:" target="-1" id="438"/>
                                                        </connections>
                                                    </menuItem>
                                                    <menuItem title="Use None" id="417">
                                                        <modifierMask key="keyEquivalentModifierMask"/>
                                                        <connections>
                                                            <action selector="turnOffKerning:" target="-1" id="441"/>
                                                        </connections>
                                                    </menuItem>
                                                    <menuItem title="Tighten" id="418">
                                                        <modifierMask key="keyEquivalentModifierMask"/>
                                                        <connections>
                                                            <action selector="tightenKerning:" target="-1" id="431"/>
                                                        </connections>
                                                    </menuItem>
                                                    <menuItem title="Loosen" id="419">
                                                        <modifierMask key="keyEquivalentModifierMask"/>
                                                        <connections>
                                                            <action selector="loosenKerning:" target="-1" id="435"/>
                                                        </connections>
                                                    </menuItem>
                                                </items>
                                            </menu>
                                        </menuItem>
                                        <menuItem title="Ligature" id="398">
                                            <modifierMask key="keyEquivalentModifierMask"/>
                                            <menu key="submenu" title="Ligature" id="411">
                                                <items>
                                                    <menuItem title="Use Default" id="412">
                                                        <modifierMask key="keyEquivalentModifierMask"/>
                                                        <connections>
                                                            <action selector="useStandardLigatures:" target="-1" id="439"/>
                                                        </connections>
                                                    </menuItem>
                                                    <menuItem title="Use None" id="413">
                                                        <modifierMask key="keyEquivalentModifierMask"/>
                                                        <connections>
                                                            <action selector="turnOffLigatures:" target="-1" id="440"/>
                                                        </connections>
                                                    </menuItem>
                                                    <menuItem title="Use All" id="414">
                                                        <modifierMask key="keyEquivalentModifierMask"/>
                                                        <connections>
                                                            <action selector="useAllLigatures:" target="-1" id="434"/>
                                                        </connections>
                                                    </menuItem>
                                                </items>
                                            </menu>
                                        </menuItem>
                                        <menuItem title="Baseline" id="399">
                                            <modifierMask key="keyEquivalentModifierMask"/>
                                            <menu key="submenu" title="Baseline" id="405">
                                                <items>
                                                    <menuItem title="Use Default" id="406">
                                                        <modifierMask key="keyEquivalentModifierMask"/>
                                                        <connections>
                                                            <action selector="unscript:" target="-1" id="437"/>
                                                        </connections>
                                                    </menuItem>
                                                    <menuItem title="Superscript" id="407">
                                                        <modifierMask key="keyEquivalentModifierMask"/>
                                                        <connections>
                                                            <action selector="superscript:" target="-1" id="430"/>
                                                        </connections>
                                                    </menuItem>
                                                    <menuItem title="Subscript" id="408">
                                                        <modifierMask key="keyEquivalentModifierMask"/>
                                                        <connections>
                                                            <action selector="subscript:" target="-1" id="429"/>
                                                        </connections>
                                                    </menuItem>
                                                    <menuItem title="Raise" id="409">
                                                        <modifierMask key="keyEquivalentModifierMask"/>
                                                        <connections>
                                                            <action selector="raiseBaseline:" target="-1" id="426"/>
                                                        </connections>
                                                    </menuItem>
                                                    <menuItem title="Lower" id="410">
                                                        <modifierMask key="keyEquivalentModifierMask"/>
                                                        <connections>
                                                            <action selector="lowerBaseline:" target="-1" id="427"/>
                                                        </connections>
                                                    </menuItem>
                                                </items>
                                            </menu>
                                        </menuItem>
                                        <menuItem isSeparatorItem="YES" id="400"/>
                                        <menuItem title="Show Colors" keyEquivalent="C" id="401">
                                            <connections>
                                                <action selector="orderFrontColorPanel:" target="-1" id="433"/>
                                            </connections>
                                        </menuItem>
                                        <menuItem isSeparatorItem="YES" id="402"/>
                                        <menuItem title="Copy Style" keyEquivalent="c" id="403">
                                            <modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
                                            <connections>
                                                <action selector="copyFont:" target="-1" id="428"/>
                                            </connections>
                                        </menuItem>
                                        <menuItem title="Paste Style" keyEquivalent="v" id="404">
                                            <modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
                                            <connections>
                                                <action selector="pasteFont:" target="-1" id="436"/>
                                            </connections>
                                        </menuItem>
                                    </items>
                                </menu>
                            </menuItem>
                            <menuItem title="Text" id="496">
                                <modifierMask key="keyEquivalentModifierMask"/>
                                <menu key="submenu" title="Text" id="497">
                                    <items>
                                        <menuItem title="Align Left" keyEquivalent="{" id="498">
                                            <connections>
                                                <action selector="alignLeft:" target="-1" id="524"/>
                                            </connections>
                                        </menuItem>
                                        <menuItem title="Center" keyEquivalent="|" id="499">
                                            <connections>
                                                <action selector="alignCenter:" target="-1" id="518"/>
                                            </connections>
                                        </menuItem>
                                        <menuItem title="Justify" id="500">
                                            <modifierMask key="keyEquivalentModifierMask"/>
                                            <connections>
                                                <action selector="alignJustified:" target="-1" id="523"/>
                                            </connections>
                                        </menuItem>
                                        <menuItem title="Align Right" keyEquivalent="}" id="501">
                                            <connections>
                                                <action selector="alignRight:" target="-1" id="521"/>
                                            </connections>
                                        </menuItem>
                                        <menuItem isSeparatorItem="YES" id="502"/>
                                        <menuItem title="Writing Direction" id="503">
                                            <modifierMask key="keyEquivalentModifierMask"/>
                                            <menu key="submenu" title="Writing Direction" id="508">
                                                <items>
                                                    <menuItem title="Paragraph" enabled="NO" id="509">
                                                        <modifierMask key="keyEquivalentModifierMask"/>
                                                    </menuItem>
                                                    <menuItem id="510">
                                                        <string key="title">	Default</string>
                                                        <modifierMask key="keyEquivalentModifierMask"/>
                                                        <connections>
                                                            <action selector="makeBaseWritingDirectionNatural:" target="-1" id="525"/>
                                                        </connections>
                                                    </menuItem>
                                                    <menuItem id="511">
                                                        <string key="title">	Left to Right</string>
                                                        <modifierMask key="keyEquivalentModifierMask"/>
                                                        <connections>
                                                            <action selector="makeBaseWritingDirectionLeftToRight:" target="-1" id="526"/>
                                                        </connections>
                                                    </menuItem>
                                                    <menuItem id="512">
                                                        <string key="title">	Right to Left</string>
                                                        <modifierMask key="keyEquivalentModifierMask"/>
                                                        <connections>
                                                            <action selector="makeBaseWritingDirectionRightToLeft:" target="-1" id="527"/>
                                                        </connections>
                                                    </menuItem>
                                                    <menuItem isSeparatorItem="YES" id="513"/>
                                                    <menuItem title="Selection" enabled="NO" id="514">
                                                        <modifierMask key="keyEquivalentModifierMask"/>
                                                    </menuItem>
                                                    <menuItem id="515">
                                                        <string key="title">	Default</string>
                                                        <modifierMask key="keyEquivalentModifierMask"/>
                                                        <connections>
                                                            <action selector="makeTextWritingDirectionNatural:" target="-1" id="528"/>
                                                        </connections>
                                                    </menuItem>
                                                    <menuItem id="516">
                                                        <string key="title">	Left to Right</string>
                                                        <modifierMask key="keyEquivalentModifierMask"/>
                                                        <connections>
                                                            <action selector="makeTextWritingDirectionLeftToRight:" target="-1" id="529"/>
                                                        </connections>
                                                    </menuItem>
                                                    <menuItem id="517">
                                                        <string key="title">	Right to Left</string>
                                                        <modifierMask key="keyEquivalentModifierMask"/>
                                                        <connections>
                                                            <action selector="makeTextWritingDirectionRightToLeft:" target="-1" id="530"/>
                                                        </connections>
                                                    </menuItem>
                                                </items>
                                            </menu>
                                        </menuItem>
                                        <menuItem isSeparatorItem="YES" id="504"/>
                                        <menuItem title="Show Ruler" id="505">
                                            <modifierMask key="keyEquivalentModifierMask"/>
                                            <connections>
                                                <action selector="toggleRuler:" target="-1" id="520"/>
                                            </connections>
                                        </menuItem>
                                        <menuItem title="Copy Ruler" keyEquivalent="c" id="506">
                                            <modifierMask key="keyEquivalentModifierMask" control="YES" command="YES"/>
                                            <connections>
                                                <action selector="copyRuler:" target="-1" id="522"/>
                                            </connections>
                                        </menuItem>
                                        <menuItem title="Paste Ruler" keyEquivalent="v" id="507">
                                            <modifierMask key="keyEquivalentModifierMask" control="YES" command="YES"/>
                                            <connections>
                                                <action selector="pasteRuler:" target="-1" id="519"/>
                                            </connections>
                                        </menuItem>
                                    </items>
                                </menu>
                            </menuItem>
                        </items>
                    </menu>
                </menuItem>
                <menuItem title="View" id="295">
                    <menu key="submenu" title="View" id="296">
                        <items>
                            <menuItem title="Show Toolbar" keyEquivalent="t" id="297">
                                <modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
                                <connections>
                                    <action selector="toggleToolbarShown:" target="-1" id="366"/>
                                </connections>
                            </menuItem>
                            <menuItem title="Customize Toolbar…" id="298">
                                <connections>
                                    <action selector="runToolbarCustomizationPalette:" target="-1" id="365"/>
                                </connections>
                            </menuItem>
                        </items>
                    </menu>
                </menuItem>
                <menuItem title="Window" id="19">
                    <menu key="submenu" title="Window" systemMenu="window" id="24">
                        <items>
                            <menuItem title="Minimize" keyEquivalent="m" id="23">
                                <connections>
                                    <action selector="performMiniaturize:" target="-1" id="37"/>
                                </connections>
                            </menuItem>
                            <menuItem title="Zoom" id="239">
                                <connections>
                                    <action selector="performZoom:" target="-1" id="240"/>
                                </connections>
                            </menuItem>
                            <menuItem isSeparatorItem="YES" id="92">
                                <modifierMask key="keyEquivalentModifierMask" command="YES"/>
                            </menuItem>
                            <menuItem title="Bring All to Front" id="5">
                                <connections>
                                    <action selector="arrangeInFront:" target="-1" id="39"/>
                                </connections>
                            </menuItem>
                        </items>
                    </menu>
                </menuItem>
                <menuItem title="Help" id="490">
                    <modifierMask key="keyEquivalentModifierMask"/>
                    <menu key="submenu" title="Help" systemMenu="help" id="491">
                        <items>
                            <menuItem title="PopoverSampleApp Help" keyEquivalent="?" id="492">
                                <connections>
                                    <action selector="showHelp:" target="-1" id="493"/>
                                </connections>
                            </menuItem>
                        </items>
                    </menu>
                </menuItem>
            </items>
        </menu>
        <window title="PopoverSampleApp" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" animationBehavior="default" id="371" customClass="INPopoverParentWindow">
            <windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES"/>
            <windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
            <rect key="contentRect" x="335" y="390" width="373" height="185"/>
            <rect key="screenRect" x="0.0" y="0.0" width="1680" height="1028"/>
            <view key="contentView" id="372">
                <rect key="frame" x="0.0" y="0.0" width="373" height="185"/>
                <autoresizingMask key="autoresizingMask"/>
                <subviews>
                    <colorWell id="533" customClass="AlphaColorWell">
                        <rect key="frame" x="132" y="145" width="44" height="23"/>
                        <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
                        <color key="color" red="0.05813049898" green="0.055541899059999997" blue="1" alpha="1" colorSpace="calibratedRGB"/>
                        <connections>
                            <binding destination="494" name="value" keyPath="popoverController.color" id="559"/>
                        </connections>
                    </colorWell>
                    <colorWell id="534" customClass="AlphaColorWell">
                        <rect key="frame" x="132" y="114" width="44" height="23"/>
                        <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
                        <color key="color" red="0.05813049898" green="0.055541899059999997" blue="1" alpha="1" colorSpace="calibratedRGB"/>
                        <connections>
                            <binding destination="494" name="value" keyPath="popoverController.borderColor" id="563"/>
                        </connections>
                    </colorWell>
                    <textField verticalHuggingPriority="750" id="538">
                        <rect key="frame" x="17" y="148" width="97" height="17"/>
                        <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
                        <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Popover Color:" id="539">
                            <font key="font" metaFont="system"/>
                            <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
                            <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
                        </textFieldCell>
                    </textField>
                    <textField verticalHuggingPriority="750" id="540">
                        <rect key="frame" x="25" y="117" width="97" height="17"/>
                        <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
                        <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Border Color:" id="541">
                            <font key="font" metaFont="system"/>
                            <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
                            <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
                        </textFieldCell>
                    </textField>
                    <textField verticalHuggingPriority="750" id="552">
                        <rect key="frame" x="24" y="87" width="97" height="17"/>
                        <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
                        <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Border Width:" id="553">
                            <font key="font" metaFont="system"/>
                            <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
                            <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
                        </textFieldCell>
                    </textField>
                    <button verticalHuggingPriority="750" id="554">
                        <rect key="frame" x="220" y="109" width="139" height="32"/>
                        <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
                        <buttonCell key="cell" type="push" title="Toggle Popover" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="555">
                            <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
                            <font key="font" metaFont="system"/>
                        </buttonCell>
                        <connections>
                            <action selector="togglePopover:" target="494" id="556"/>
                        </connections>
                    </button>
                    <textField verticalHuggingPriority="750" id="567">
                        <rect key="frame" x="132" y="82" width="44" height="22"/>
                        <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
                        <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" continuous="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" drawsBackground="YES" id="568">
                            <numberFormatter key="formatter" formatterBehavior="default10_4" positiveFormat="#,##0.###" negativeFormat="#,##0.###" numberStyle="decimal" minimumIntegerDigits="1" maximumIntegerDigits="309" minimumFractionDigits="0" maximumFractionDigits="3" id="569">
                                <real key="roundingIncrement" value="0.0"/>
                                <metadata>
                                    <bool key="localizesFormat" value="YES"/>
                                </metadata>
                            </numberFormatter>
                            <font key="font" metaFont="system"/>
                            <color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
                            <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
                        </textFieldCell>
                        <connections>
                            <binding destination="494" name="value" keyPath="popoverController.borderWidth" id="573"/>
                        </connections>
                    </textField>
                    <button id="574">
                        <rect key="frame" x="18" y="38" width="232" height="18"/>
                        <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
                        <buttonCell key="cell" type="check" title="Closes when popover resigns key" bezelStyle="regularSquare" imagePosition="left" alignment="left" state="on" inset="2" id="575">
                            <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
                            <font key="font" metaFont="system"/>
                        </buttonCell>
                        <connections>
                            <binding destination="494" name="value" keyPath="popoverController.closesWhenPopoverResignsKey" id="577"/>
                        </connections>
                    </button>
                    <button id="578">
                        <rect key="frame" x="18" y="18" width="287" height="18"/>
                        <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
                        <buttonCell key="cell" type="check" title="Closes when application becomes inactive" bezelStyle="regularSquare" imagePosition="left" alignment="left" state="on" inset="2" id="579">
                            <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
                            <font key="font" metaFont="system"/>
                        </buttonCell>
                        <connections>
                            <binding destination="494" name="value" keyPath="popoverController.closesWhenApplicationBecomesInactive" id="581"/>
                        </connections>
                    </button>
                    <button id="582">
                        <rect key="frame" x="18" y="58" width="81" height="18"/>
                        <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
                        <buttonCell key="cell" type="check" title="Animates" bezelStyle="regularSquare" imagePosition="left" alignment="left" state="on" inset="2" id="583">
                            <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
                            <font key="font" metaFont="system"/>
                        </buttonCell>
                        <connections>
                            <binding destination="494" name="value" keyPath="popoverController.animates" id="585"/>
                        </connections>
                    </button>
                </subviews>
            </view>
        </window>
        <customObject id="494" customClass="PopoverSampleAppAppDelegate">
            <connections>
                <outlet property="window" destination="371" id="532"/>
            </connections>
        </customObject>
        <customObject id="420" customClass="NSFontManager"/>
    </objects>
</document>

================================================
FILE: PopoverSampleApp/PopoverSampleApp/main.m
================================================
//
//  main.m
//  PopoverSampleApp
//
//  Created by Indragie Karunaratne on 11-03-02.
//  Copyright 2011-2014 PCWiz Computer. All rights reserved.
//

#import <Cocoa/Cocoa.h>

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


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

/* Begin PBXBuildFile section */
		03657F2B187A09BE00C969BA /* INPopoverController.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 03657F28187A09A000C969BA /* INPopoverController.framework */; };
		03657F2D187A09C900C969BA /* INPopoverController.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 03657F28187A09A000C969BA /* INPopoverController.framework */; };
		0391A4FF18822FAA007D32D5 /* AlphaColorWell.m in Sources */ = {isa = PBXBuildFile; fileRef = 0391A4FE18822FAA007D32D5 /* AlphaColorWell.m */; };
		0393272D131F613D0007496E /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0393272C131F613D0007496E /* Cocoa.framework */; };
		03932737131F613D0007496E /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 03932735131F613D0007496E /* InfoPlist.strings */; };
		0393273A131F613D0007496E /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 03932739131F613D0007496E /* main.m */; };
		0393273D131F613D0007496E /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = 0393273B131F613D0007496E /* Credits.rtf */; };
		03932740131F613D0007496E /* PopoverSampleAppAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 0393273F131F613D0007496E /* PopoverSampleAppAppDelegate.m */; };
		03932743131F613D0007496E /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 03932741131F613D0007496E /* MainMenu.xib */; };
		0393274C131F61590007496E /* ContentViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 0393274A131F61590007496E /* ContentViewController.m */; };
		0393274D131F61590007496E /* ContentViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 0393274B131F61590007496E /* ContentViewController.xib */; };
		BFF06C9116CAAEC100C3D751 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BFF06C9016CAAEC100C3D751 /* QuartzCore.framework */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
		03657F27187A09A000C969BA /* PBXContainerItemProxy */ = {
			isa = PBXContainerItemProxy;
			containerPortal = 03657F23187A09A000C969BA /* INPopoverController.xcodeproj */;
			proxyType = 2;
			remoteGlobalIDString = 98BA8937143EA04A006F744E;
			remoteInfo = INPopoverController;
		};
		03657F29187A09BA00C969BA /* PBXContainerItemProxy */ = {
			isa = PBXContainerItemProxy;
			containerPortal = 03657F23187A09A000C969BA /* INPopoverController.xcodeproj */;
			proxyType = 1;
			remoteGlobalIDString = 98BA8936143EA04A006F744E;
			remoteInfo = INPopoverController;
		};
/* End PBXContainerItemProxy section */

/* Begin PBXCopyFilesBuildPhase section */
		03657F2C187A09C300C969BA /* CopyFiles */ = {
			isa = PBXCopyFilesBuildPhase;
			buildActionMask = 2147483647;
			dstPath = "";
			dstSubfolderSpec = 10;
			files = (
				03657F2D187A09C900C969BA /* INPopoverController.framework in CopyFiles */,
			);
			runOnlyForDeploymentPostprocessing = 0;
		};
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
		03657F23187A09A000C969BA /* INPopoverController.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = INPopoverController.xcodeproj; path = ../../INPopoverController.xcodeproj; sourceTree = "<group>"; };
		0391A4FD18822FAA007D32D5 /* AlphaColorWell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AlphaColorWell.h; sourceTree = "<group>"; };
		0391A4FE18822FAA007D32D5 /* AlphaColorWell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AlphaColorWell.m; sourceTree = "<group>"; };
		03932728131F613D0007496E /* PopoverSampleApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = PopoverSampleApp.app; sourceTree = BUILT_PRODUCTS_DIR; };
		0393272C131F613D0007496E /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
		0393272F131F613D0007496E /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; };
		03932730131F613D0007496E /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; };
		03932731131F613D0007496E /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
		03932734131F613D0007496E /* PopoverSampleApp-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "PopoverSampleApp-Info.plist"; sourceTree = "<group>"; };
		03932736131F613D0007496E /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
		03932738131F613D0007496E /* PopoverSampleApp-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "PopoverSampleApp-Prefix.pch"; sourceTree = "<group>"; };
		03932739131F613D0007496E /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
		0393273C131F613D0007496E /* en */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = en; path = en.lproj/Credits.rtf; sourceTree = "<group>"; };
		0393273E131F613D0007496E /* PopoverSampleAppAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PopoverSampleAppAppDelegate.h; sourceTree = "<group>"; };
		0393273F131F613D0007496E /* PopoverSampleAppAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PopoverSampleAppAppDelegate.m; sourceTree = "<group>"; };
		03932742131F613D0007496E /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/MainMenu.xib; sourceTree = "<group>"; };
		03932749131F61590007496E /* ContentViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContentViewController.h; sourceTree = "<group>"; };
		0393274A131F61590007496E /* ContentViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ContentViewController.m; sourceTree = "<group>"; };
		0393274B131F61590007496E /* ContentViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ContentViewController.xib; sourceTree = "<group>"; };
		BFF06C9016CAAEC100C3D751 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
		03932725131F613D0007496E /* Frameworks */ = {
			isa = PBXFrameworksBuildPhase;
			buildActionMask = 2147483647;
			files = (
				03657F2B187A09BE00C969BA /* INPopoverController.framework in Frameworks */,
				BFF06C9116CAAEC100C3D751 /* QuartzCore.framework in Frameworks */,
				0393272D131F613D0007496E /* Cocoa.framework in Frameworks */,
			);
			runOnlyForDeploymentPostprocessing = 0;
		};
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
		03657F24187A09A000C969BA /* Products */ = {
			isa = PBXGroup;
			children = (
				03657F28187A09A000C969BA /* INPopoverController.framework */,
			);
			name = Products;
			sourceTree = "<group>";
		};
		0393271D131F613D0007496E = {
			isa = PBXGroup;
			children = (
				03932732131F613D0007496E /* PopoverSampleApp */,
				0393272B131F613D0007496E /* Frameworks */,
				03932729131F613D0007496E /* Products */,
			);
			sourceTree = "<group>";
		};
		03932729131F613D0007496E /* Products */ = {
			isa = PBXGroup;
			children = (
				03932728131F613D0007496E /* PopoverSampleApp.app */,
			);
			name = Products;
			sourceTree = "<group>";
		};
		0393272B131F613D0007496E /* Frameworks */ = {
			isa = PBXGroup;
			children = (
				BFF06C9016CAAEC100C3D751 /* QuartzCore.framework */,
				0393272C131F613D0007496E /* Cocoa.framework */,
				0393272E131F613D0007496E /* Other Frameworks */,
			);
			name = Frameworks;
			sourceTree = "<group>";
		};
		0393272E131F613D0007496E /* Other Frameworks */ = {
			isa = PBXGroup;
			children = (
				0393272F131F613D0007496E /* AppKit.framework */,
				03932730131F613D0007496E /* CoreData.framework */,
				03932731131F613D0007496E /* Foundation.framework */,
			);
			name = "Other Frameworks";
			sourceTree = "<group>";
		};
		03932732131F613D0007496E /* PopoverSampleApp */ = {
			isa = PBXGroup;
			children = (
				03657F23187A09A000C969BA /* INPopoverController.xcodeproj */,
				0393273E131F613D0007496E /* PopoverSampleAppAppDelegate.h */,
				0393273F131F613D0007496E /* PopoverSampleAppAppDelegate.m */,
				03932749131F61590007496E /* ContentViewController.h */,
				0393274A131F61590007496E /* ContentViewController.m */,
				0391A4FD18822FAA007D32D5 /* AlphaColorWell.h */,
				0391A4FE18822FAA007D32D5 /* AlphaColorWell.m */,
				03932741131F613D0007496E /* MainMenu.xib */,
				0393274B131F61590007496E /* ContentViewController.xib */,
				03932733131F613D0007496E /* Supporting Files */,
			);
			path = PopoverSampleApp;
			sourceTree = "<group>";
		};
		03932733131F613D0007496E /* Supporting Files */ = {
			isa = PBXGroup;
			children = (
				03932734131F613D0007496E /* PopoverSampleApp-Info.plist */,
				03932735131F613D0007496E /* InfoPlist.strings */,
				03932738131F613D0007496E /* PopoverSampleApp-Prefix.pch */,
				03932739131F613D0007496E /* main.m */,
				0393273B131F613D0007496E /* Credits.rtf */,
			);
			name = "Supporting Files";
			sourceTree = "<group>";
		};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
		03932727131F613D0007496E /* PopoverSampleApp */ = {
			isa = PBXNativeTarget;
			buildConfigurationList = 03932746131F613D0007496E /* Build configuration list for PBXNativeTarget "PopoverSampleApp" */;
			buildPhases = (
				03932724131F613D0007496E /* Sources */,
				03932725131F613D0007496E /* Frameworks */,
				03932726131F613D0007496E /* Resources */,
				03657F2C187A09C300C969BA /* CopyFiles */,
			);
			buildRules = (
			);
			dependencies = (
				03657F2A187A09BA00C969BA /* PBXTargetDependency */,
			);
			name = PopoverSampleApp;
			productName = PopoverSampleApp;
			productReference = 03932728131F613D0007496E /* PopoverSampleApp.app */;
			productType = "com.apple.product-type.application";
		};
/* End PBXNativeTarget section */

/* Begin PBXProject section */
		0393271F131F613D0007496E /* Project object */ = {
			isa = PBXProject;
			attributes = {
				ORGANIZATIONNAME = "Indragie Karunaratne";
			};
			buildConfigurationList = 03932722131F613D0007496E /* Build configuration list for PBXProject "PopoverSampleApp" */;
			compatibilityVersion = "Xcode 3.2";
			developmentRegion = English;
			hasScannedForEncodings = 0;
			knownRegions = (
				en,
			);
			mainGroup = 0393271D131F613D0007496E;
			productRefGroup = 03932729131F613D0007496E /* Products */;
			projectDirPath = "";
			projectReferences = (
				{
					ProductGroup = 03657F24187A09A000C969BA /* Products */;
					ProjectRef = 03657F23187A09A000C969BA /* INPopoverController.xcodeproj */;
				},
			);
			projectRoot = "";
			targets = (
				03932727131F613D0007496E /* PopoverSampleApp */,
			);
		};
/* End PBXProject section */

/* Begin PBXReferenceProxy section */
		03657F28187A09A000C969BA /* INPopoverController.framework */ = {
			isa = PBXReferenceProxy;
			fileType = wrapper.framework;
			path = INPopoverController.framework;
			remoteRef = 03657F27187A09A000C969BA /* PBXContainerItemProxy */;
			sourceTree = BUILT_PRODUCTS_DIR;
		};
/* End PBXReferenceProxy section */

/* Begin PBXResourcesBuildPhase section */
		03932726131F613D0007496E /* Resources */ = {
			isa = PBXResourcesBuildPhase;
			buildActionMask = 2147483647;
			files = (
				03932737131F613D0007496E /* InfoPlist.strings in Resources */,
				0393273D131F613D0007496E /* Credits.rtf in Resources */,
				03932743131F613D0007496E /* MainMenu.xib in Resources */,
				0393274D131F61590007496E /* ContentViewController.xib in Resources */,
			);
			runOnlyForDeploymentPostprocessing = 0;
		};
/* End PBXResourcesBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
		03932724131F613D0007496E /* Sources */ = {
			isa = PBXSourcesBuildPhase;
			buildActionMask = 2147483647;
			files = (
				0391A4FF18822FAA007D32D5 /* AlphaColorWell.m in Sources */,
				0393273A131F613D0007496E /* main.m in Sources */,
				03932740131F613D0007496E /* PopoverSampleAppAppDelegate.m in Sources */,
				0393274C131F61590007496E /* ContentViewController.m in Sources */,
			);
			runOnlyForDeploymentPostprocessing = 0;
		};
/* End PBXSourcesBuildPhase section */

/* Begin PBXTargetDependency section */
		03657F2A187A09BA00C969BA /* PBXTargetDependency */ = {
			isa = PBXTargetDependency;
			name = INPopoverController;
			targetProxy = 03657F29187A09BA00C969BA /* PBXContainerItemProxy */;
		};
/* End PBXTargetDependency section */

/* Begin PBXVariantGroup section */
		03932735131F613D0007496E /* InfoPlist.strings */ = {
			isa = PBXVariantGroup;
			children = (
				03932736131F613D0007496E /* en */,
			);
			name = InfoPlist.strings;
			sourceTree = "<group>";
		};
		0393273B131F613D0007496E /* Credits.rtf */ = {
			isa = PBXVariantGroup;
			children = (
				0393273C131F613D0007496E /* en */,
			);
			name = Credits.rtf;
			sourceTree = "<group>";
		};
		03932741131F613D0007496E /* MainMenu.xib */ = {
			isa = PBXVariantGroup;
			children = (
				03932742131F613D0007496E /* en */,
			);
			name = MainMenu.xib;
			sourceTree = "<group>";
		};
/* End PBXVariantGroup section */

/* Begin XCBuildConfiguration section */
		03932744131F613D0007496E /* Debug */ = {
			isa = XCBuildConfiguration;
			buildSettings = {
				CLANG_ENABLE_OBJC_ARC = YES;
				GCC_C_LANGUAGE_STANDARD = gnu99;
				GCC_OPTIMIZATION_LEVEL = 0;
				GCC_PREPROCESSOR_DEFINITIONS = DEBUG;
				GCC_SYMBOLS_PRIVATE_EXTERN = NO;
				GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
				GCC_WARN_ABOUT_RETURN_TYPE = YES;
				GCC_WARN_UNUSED_VARIABLE = YES;
				MACOSX_DEPLOYMENT_TARGET = 10.7;
				ONLY_ACTIVE_ARCH = YES;
				SDKROOT = macosx;
			};
			name = Debug;
		};
		03932745131F613D0007496E /* Release */ = {
			isa = XCBuildConfiguration;
			buildSettings = {
				CLANG_ENABLE_OBJC_ARC = YES;
				GCC_C_LANGUAGE_STANDARD = gnu99;
				GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
				GCC_WARN_ABOUT_RETURN_TYPE = YES;
				GCC_WARN_UNUSED_VARIABLE = YES;
				MACOSX_DEPLOYMENT_TARGET = 10.7;
				SDKROOT = macosx;
			};
			name = Release;
		};
		03932747131F613D0007496E /* Debug */ = {
			isa = XCBuildConfiguration;
			buildSettings = {
				ALWAYS_SEARCH_USER_PATHS = NO;
				ARCHS = "$(ARCHS_STANDARD_64_BIT)";
				CLANG_ENABLE_OBJC_ARC = YES;
				COPY_PHASE_STRIP = NO;
				GCC_DYNAMIC_NO_PIC = NO;
				GCC_ENABLE_OBJC_EXCEPTIONS = YES;
				GCC_PRECOMPILE_PREFIX_HEADER = YES;
				GCC_PREFIX_HEADER = "PopoverSampleApp/PopoverSampleApp-Prefix.pch";
				INFOPLIST_FILE = "PopoverSampleApp/PopoverSampleApp-Info.plist";
				LD_RUNPATH_SEARCH_PATHS = "@loader_path/../Frameworks";
				PRODUCT_NAME = "$(TARGET_NAME)";
				WRAPPER_EXTENSION = app;
			};
			name = Debug;
		};
		03932748131F613D0007496E /* Release */ = {
			isa = XCBuildConfiguration;
			buildSettings = {
				ALWAYS_SEARCH_USER_PATHS = NO;
				ARCHS = "$(ARCHS_STANDARD_64_BIT)";
				CLANG_ENABLE_OBJC_ARC = YES;
				COPY_PHASE_STRIP = YES;
				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
				GCC_ENABLE_OBJC_EXCEPTIONS = YES;
				GCC_PRECOMPILE_PREFIX_HEADER = YES;
				GCC_PREFIX_HEADER = "PopoverSampleApp/PopoverSampleApp-Prefix.pch";
				INFOPLIST_FILE = "PopoverSampleApp/PopoverSampleApp-Info.plist";
				LD_RUNPATH_SEARCH_PATHS = "@loader_path/../Frameworks";
				PRODUCT_NAME = "$(TARGET_NAME)";
				WRAPPER_EXTENSION = app;
			};
			name = Release;
		};
/* End XCBuildConfiguration section */

/* Begin XCConfigurationList section */
		03932722131F613D0007496E /* Build configuration list for PBXProject "PopoverSampleApp" */ = {
			isa = XCConfigurationList;
			buildConfigurations = (
				03932744131F613D0007496E /* Debug */,
				03932745131F613D0007496E /* Release */,
			);
			defaultConfigurationIsVisible = 0;
			defaultConfigurationName = Release;
		};
		03932746131F613D0007496E /* Build configuration list for PBXNativeTarget "PopoverSampleApp" */ = {
			isa = XCConfigurationList;
			buildConfigurations = (
				03932747131F613D0007496E /* Debug */,
				03932748131F613D0007496E /* Release */,
			);
			defaultConfigurationIsVisible = 0;
			defaultConfigurationName = Release;
		};
/* End XCConfigurationList section */
	};
	rootObject = 0393271F131F613D0007496E /* Project object */;
}


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


================================================
FILE: README.md
================================================
## INPopoverController
### Open source OS X popover implementation

OS X 10.7 introduced the `NSPopover` class for displaying popover windows. That said, developers who want to support older versions of OS X (like me) are unable to use that API without breaking backward compatibility. So I developed this class that will allow developers to easily add popovers into their applications and also have it be compatible with older versions of OS X. I've included a sample app to demonstrate how to use INPopoverController:

![INPopoverController](https://raw.github.com/indragiek/INPopoverController/master/screenshot.png)

**Features:**

- Customizable color, border color, border width, arrow size, and corner radius.
- Automatically calculates the best arrow direction depending on screen space and popover position
- Displays content from a regular `NSViewController` (can be loaded from a NIB)
- Animation for when the popover appears/disappears and when the content size is changed
- Popover can anchor to a view
- Customizable popover behaviour (close when key status is lost, when application resigns active)

### How to use it

The headers are well documented (and I've also included a sample app) so it should be simple to figure out how to use it. There are `color`, `borderColor`, and `borderWidth` properties to customize the appearance of the popover. There are also some hard-coded defines in the `INPopoverControllerDefines.h` file which can be changed to further customize the appearance. The `closesWhenPopoverResignsKey` and `closesWhenApplicationBecomesInactive` properties can be used to control the behaviour of the popover. Everything else should be pretty much self explanatory. 

If you want to completely customize the drawing of the popover, you can edit the `INPopoverWindowFrame.m` file to run your own drawing code instead of the default. Make sure that you're taking the `arrowDirection` property into account when drawing. 

**Create a new issue if you have trouble getting it working, or if you want to request new features**

### Contact

* Indragie Karunaratne
* [@indragie](http://twitter.com/indragie)
* [http://indragie.com](http://indragie.com)

### Licensing

INPopoverController is licensed under the [BSD license](http://www.opensource.org/licenses/bsd-license.php).
Download .txt
gitextract_bwryhk85/

├── .gitignore
├── INPopoverController/
│   ├── INPopoverController-Info.plist
│   ├── INPopoverController.h
│   ├── INPopoverController.m
│   ├── INPopoverControllerDefines.h
│   ├── INPopoverParentWindow.h
│   ├── INPopoverParentWindow.m
│   ├── INPopoverPrefixHeader.pch
│   ├── INPopoverWindow.h
│   ├── INPopoverWindow.m
│   ├── INPopoverWindowFrame.h
│   └── INPopoverWindowFrame.m
├── INPopoverController.podspec
├── INPopoverController.xcodeproj/
│   ├── project.pbxproj
│   └── project.xcworkspace/
│       └── contents.xcworkspacedata
├── LICENSE
├── PopoverSampleApp/
│   ├── PopoverSampleApp/
│   │   ├── AlphaColorWell.h
│   │   ├── AlphaColorWell.m
│   │   ├── ContentViewController.h
│   │   ├── ContentViewController.m
│   │   ├── ContentViewController.xib
│   │   ├── PopoverSampleApp-Info.plist
│   │   ├── PopoverSampleApp-Prefix.pch
│   │   ├── PopoverSampleAppAppDelegate.h
│   │   ├── PopoverSampleAppAppDelegate.m
│   │   ├── en.lproj/
│   │   │   ├── Credits.rtf
│   │   │   ├── InfoPlist.strings
│   │   │   └── MainMenu.xib
│   │   └── main.m
│   └── PopoverSampleApp.xcodeproj/
│       ├── project.pbxproj
│       └── project.xcworkspace/
│           └── contents.xcworkspacedata
└── README.md
Download .txt
SYMBOL INDEX (2 symbols across 2 files)

FILE: PopoverSampleApp/PopoverSampleApp/ContentViewController.h
  function interface (line 9) | interface ContentViewController : NSViewController {

FILE: PopoverSampleApp/PopoverSampleApp/PopoverSampleAppAppDelegate.h
  function interface (line 9) | interface PopoverSampleAppAppDelegate : NSObject <NSApplicationDelegate> {
Condensed preview — 32 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (155K chars).
[
  {
    "path": ".gitignore",
    "chars": 259,
    "preview": "# OS X\n.DS_Store\n\n# Xcode\nbuild/\n*.pbxuser\n!default.pbxuser\n*.mode1v3\n!default.mode1v3\n*.mode2v3\n!default.mode2v3\n*.pers"
  },
  {
    "path": "INPopoverController/INPopoverController-Info.plist",
    "chars": 1163,
    "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": "INPopoverController/INPopoverController.h",
    "chars": 6876,
    "preview": "//\n//  INPopoverController.h\n//  Copyright 2011-2014 Indragie Karunaratne. All rights reserved.\n//\n\n#import <Cocoa/Cocoa"
  },
  {
    "path": "INPopoverController/INPopoverController.m",
    "chars": 15479,
    "preview": "//\n//  INPopoverController.m\n//  Copyright 2011-2014 Indragie Karunaratne. All rights reserved.\n//\n\n#import \"INPopoverCo"
  },
  {
    "path": "INPopoverController/INPopoverControllerDefines.h",
    "chars": 621,
    "preview": "//\n//  INPopoverControllerDefines.h\n//  Copyright 2011-2014 Indragie Karunaratne. All rights reserved.\n//\n\ntypedef NS_EN"
  },
  {
    "path": "INPopoverController/INPopoverParentWindow.h",
    "chars": 205,
    "preview": "//\n//  INPopoverParentWindow.h\n//  Copyright 2011-2014 Indragie Karunaratne. All rights reserved.\n//\n\n#import <Cocoa/Coc"
  },
  {
    "path": "INPopoverController/INPopoverParentWindow.m",
    "chars": 592,
    "preview": "//\n//  INAlwaysKeyWindow.m\n//  Copyright 2011-2014 Indragie Karunaratne. All rights reserved.\n//\n\n#import \"INPopoverPare"
  },
  {
    "path": "INPopoverController/INPopoverPrefixHeader.pch",
    "chars": 49,
    "preview": "#ifdef __OBJC__\n\n#import <Cocoa/Cocoa.h>\n\n#endif\n"
  },
  {
    "path": "INPopoverController/INPopoverWindow.h",
    "chars": 657,
    "preview": "//\n//  INPopoverWindow.h\n//  Copyright 2011-2014 Indragie Karunaratne. All rights reserved.\n//\n\n#import <AppKit/AppKit.h"
  },
  {
    "path": "INPopoverController/INPopoverWindow.m",
    "chars": 6690,
    "preview": "//\n//  INPopoverWindow.m\n//  Copyright 2011-2014 Indragie Karunaratne. All rights reserved.\n//\n\n#import \"INPopoverWindow"
  },
  {
    "path": "INPopoverController/INPopoverWindowFrame.h",
    "chars": 695,
    "preview": "//\n//  INPopoverWindowFrame.h\n//  Copyright 2011-2014 Indragie Karunaratne. All rights reserved.\n//\n\n#import <Cocoa/Coco"
  },
  {
    "path": "INPopoverController/INPopoverWindowFrame.m",
    "chars": 5568,
    "preview": "//\n//  INPopoverWindowFrame.m\n//  Copyright 2011-2014 Indragie Karunaratne. All rights reserved.\n//\n\n#import \"INPopoverW"
  },
  {
    "path": "INPopoverController.podspec",
    "chars": 572,
    "preview": "Pod::Spec.new do |s|\n\ts.name\t\t\t\t\t= 'INPopoverController'\n\ts.version\t\t\t\t= '0.0.1'\n\ts.summary\t\t\t\t= 'A customizable popover"
  },
  {
    "path": "INPopoverController.xcodeproj/project.pbxproj",
    "chars": 15756,
    "preview": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 46;\n\tobjects = {\n\n/* Begin PBXBuildFile section *"
  },
  {
    "path": "INPopoverController.xcodeproj/project.xcworkspace/contents.xcworkspacedata",
    "chars": 164,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Workspace\n   version = \"1.0\">\n   <FileRef\n      location = \"self:INPopoverContro"
  },
  {
    "path": "LICENSE",
    "chars": 1304,
    "preview": "Copyright (c) 2011-2014, Indragie Karunaratne\nAll rights reserved.\n\nRedistribution and use in source and binary forms, w"
  },
  {
    "path": "PopoverSampleApp/PopoverSampleApp/AlphaColorWell.h",
    "chars": 173,
    "preview": "//\n//  AlphaColorWell.h\n//  PopoverSampleApp\n//\n//  Created by Indragie Karunaratne on 1/11/2014.\n//\n\n#import <Cocoa/Coc"
  },
  {
    "path": "PopoverSampleApp/PopoverSampleApp/AlphaColorWell.m",
    "chars": 294,
    "preview": "//\n//  AlphaColorWell.m\n//  PopoverSampleApp\n//\n//  Created by Indragie Karunaratne on 1/11/2014.\n//\n\n#import \"AlphaColo"
  },
  {
    "path": "PopoverSampleApp/PopoverSampleApp/ContentViewController.h",
    "chars": 204,
    "preview": "//\n//  ContentViewController.h\n//  Copyright 2011-2014 Indragie Karunaratne. All rights reserved.\n//\n\n#import <Cocoa/Coc"
  },
  {
    "path": "PopoverSampleApp/PopoverSampleApp/ContentViewController.m",
    "chars": 421,
    "preview": "//\n//  ContentViewController.m\n//  Copyright 2011-2014 Indragie Karunaratne. All rights reserved.\n//\n\n#import \"ContentVi"
  },
  {
    "path": "PopoverSampleApp/PopoverSampleApp/ContentViewController.xib",
    "chars": 7299,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<archive type=\"com.apple.InterfaceBuilder3.Cocoa.XIB\" version=\"8.00\">\n\t<data>\n\t\t<"
  },
  {
    "path": "PopoverSampleApp/PopoverSampleApp/PopoverSampleApp-Info.plist",
    "chars": 994,
    "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": "PopoverSampleApp/PopoverSampleApp/PopoverSampleApp-Prefix.pch",
    "chars": 163,
    "preview": "//\n// Prefix header for all source files of the 'PopoverSampleApp' target in the 'PopoverSampleApp' project\n//\n\n#ifdef _"
  },
  {
    "path": "PopoverSampleApp/PopoverSampleApp/PopoverSampleAppAppDelegate.h",
    "chars": 478,
    "preview": "//\n//  PopoverSampleAppAppDelegate.h\n//  Copyright 2011-2014 Indragie Karunaratne. All rights reserved.\n//\n\n#import <Coc"
  },
  {
    "path": "PopoverSampleApp/PopoverSampleApp/PopoverSampleAppAppDelegate.m",
    "chars": 961,
    "preview": "//\n//  PopoverSampleAppAppDelegate.m\n//  Copyright 2011-2014 Indragie Karunaratne. All rights reserved.\n//\n\n#import \"Pop"
  },
  {
    "path": "PopoverSampleApp/PopoverSampleApp/en.lproj/Credits.rtf",
    "chars": 436,
    "preview": "{\\rtf0\\ansi{\\fonttbl\\f0\\fswiss Helvetica;}\n{\\colortbl;\\red255\\green255\\blue255;}\n\\paperw9840\\paperh8400\n\\pard\\tx560\\tx11"
  },
  {
    "path": "PopoverSampleApp/PopoverSampleApp/en.lproj/InfoPlist.strings",
    "chars": 45,
    "preview": "/* Localized versions of Info.plist keys */\n\n"
  },
  {
    "path": "PopoverSampleApp/PopoverSampleApp/en.lproj/MainMenu.xib",
    "chars": 55544,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<document type=\"com.apple.InterfaceBuilder3.Cocoa.XIB\" version=\"3"
  },
  {
    "path": "PopoverSampleApp/PopoverSampleApp/main.m",
    "chars": 271,
    "preview": "//\n//  main.m\n//  PopoverSampleApp\n//\n//  Created by Indragie Karunaratne on 11-03-02.\n//  Copyright 2011-2014 PCWiz Com"
  },
  {
    "path": "PopoverSampleApp/PopoverSampleApp.xcodeproj/project.pbxproj",
    "chars": 17204,
    "preview": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 46;\n\tobjects = {\n\n/* Begin PBXBuildFile section *"
  },
  {
    "path": "PopoverSampleApp/PopoverSampleApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata",
    "chars": 161,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Workspace\n   version = \"1.0\">\n   <FileRef\n      location = \"self:PopoverSampleAp"
  },
  {
    "path": "README.md",
    "chars": 2305,
    "preview": "## INPopoverController\n### Open source OS X popover implementation\n\nOS X 10.7 introduced the `NSPopover` class for displ"
  }
]

About this extraction

This page contains the full source code of the indragiek/INPopoverController GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 32 files (140.2 KB), approximately 34.0k tokens, and a symbol index with 2 extracted functions, classes, methods, constants, and types. 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!