Skip to content

Commit

Permalink
Updating the project to 64bit only to take advantage of new features …
Browse files Browse the repository at this point in the history
…in the objective-c language.

Cleaning up the header file code and comments.
  • Loading branch information
kgn committed May 1, 2012
1 parent 91dacc4 commit 61b2798
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 23 deletions.
39 changes: 19 additions & 20 deletions INAppStoreWindow.h
Expand Up @@ -27,36 +27,34 @@

/** @class INTitlebarView
Draws a default style Mac OS X title bar.
**/
*/
@interface INTitlebarView : NSView
@end

/** @class INAppStoreWindow
Creates a window similar to the Mac App Store window, with centered traffic lights and an enlarged title bar. This does not handle creating the toolbar.
**/
@interface INAppStoreWindow : NSWindow {
CGFloat _titleBarHeight;
NSView *_titleBarView;
NSString *_windowMenuTitle;
BOOL _centerFullScreenButton;
BOOL _hideTitleBarInFullScreen;
BOOL _showsBaselineSeparator;
BOOL _centerTrafficLightButtons;
CGFloat _cachedTitleBarHeight;
CGFloat _trafficLightButtonsLeftMargin;
CGFloat _fullScreenButtonRightMargin;
BOOL _setFullScreenButtonRightMargin;
}
/** The height of the title bar. By default, this is set to the standard title bar height. **/
Creates a window similar to the Mac App Store window, with centered traffic lights and an
enlarged title bar. This does not handle creating the toolbar.
*/
@interface INAppStoreWindow : NSWindow

/** The height of the title bar. By default, this is set to the standard title bar height. */
@property (nonatomic) CGFloat titleBarHeight;
/** The title bar view itself. Add subviews to this view that you want to show in the title bar (e.g. buttons, a toolbar, etc.). This view can also be set if you want to use a different styled title bar aside from the default one (textured, etc.). **/

/** The title bar view itself. Add subviews to this view that you want to show in the title bar
(e.g. buttons, a toolbar, etc.). This view can also be set if you want to use a different
styled title bar aside from the default one (textured, etc.). */
@property (INAppStoreWindowRetain) NSView *titleBarView;

/** Set whether the fullscreen or traffic light buttons are horizontally centered */
@property (nonatomic) BOOL centerFullScreenButton;
@property (nonatomic) BOOL centerTrafficLightButtons;
/** If you want to hide the title bar in fullscreen mode, set this boolean to YES **/

/** If you want to hide the title bar in fullscreen mode, set this boolean to YES */
@property (nonatomic) BOOL hideTitleBarInFullScreen;

/** Use this API to hide the baseline INAppStoreWindow draws between itself and the main window contents. */
@property (nonatomic) BOOL showsBaselineSeparator;

/** Adjust the left and right padding of the trafficlight and fullscreen buttons */
@property (nonatomic) CGFloat trafficLightButtonsLeftMargin;
@property (nonatomic) CGFloat fullScreenButtonRightMargin;
Expand All @@ -66,7 +64,8 @@
it would be a shame to have to re-invent that just to change the look. So this block can be used
to override the default Mac App Store style titlebar drawing with your own drawing code!
*/
typedef void (^INAppStoreWindowTitleBarDrawingBlock)(BOOL drawsAsMainWindow, CGRect drawingRect, CGPathRef clippingPath, CGContextRef context);
typedef void (^INAppStoreWindowTitleBarDrawingBlock)(BOOL drawsAsMainWindow, CGRect drawingRect,
CGPathRef clippingPath, CGContextRef context);
@property (INAppStoreWindowCopy) INAppStoreWindowTitleBarDrawingBlock titleBarDrawingBlock;

@end
11 changes: 10 additions & 1 deletion INAppStoreWindow.m
Expand Up @@ -224,12 +224,21 @@ - (void)mouseUp:(NSEvent *)theEvent

@end

@implementation INAppStoreWindow
@implementation INAppStoreWindow{
CGFloat _cachedTitleBarHeight;
BOOL _setFullScreenButtonRightMargin;
}

@synthesize titleBarView = _titleBarView;
@synthesize titleBarHeight = _titleBarHeight;
@synthesize windowMenuTitle = _windowMenuTitle;
@synthesize centerFullScreenButton = _centerFullScreenButton;
@synthesize centerTrafficLightButtons = _centerTrafficLightButtons;
@synthesize hideTitleBarInFullScreen = _hideTitleBarInFullScreen;
@synthesize titleBarDrawingBlock = _titleBarDrawingBlock;
@synthesize showsBaselineSeparator = _showsBaselineSeparator;
@synthesize fullScreenButtonRightMargin = _fullScreenButtonRightMargin;
@synthesize trafficLightButtonsLeftMargin = _trafficLightButtonsLeftMargin;

#pragma mark -
#pragma mark Initialization
Expand Down
Binary file modified SampleApp/SampleApp.app/Contents/MacOS/SampleApp
Binary file not shown.
4 changes: 2 additions & 2 deletions SampleApp/SampleApp.xcodeproj/project.pbxproj
Expand Up @@ -218,7 +218,7 @@
03970F111315CE4400F15C7E /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = DEBUG;
Expand All @@ -235,7 +235,7 @@
03970F121315CE4400F15C7E /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
Expand Down

0 comments on commit 61b2798

Please sign in to comment.