Skip to content

Commit

Permalink
Merge branch 'master' of github.com:uliwitness/UliKit
Browse files Browse the repository at this point in the history
  • Loading branch information
uliwitness committed Apr 11, 2013
2 parents d6a09b9 + d1a214b commit 8dbdba4
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 23 deletions.
6 changes: 3 additions & 3 deletions NSFileManager+NameForTempFile.m
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ -(NSString*) uniqueFileName: (NSString*)oldName
NSString* baseName = [oldName stringByDeletingPathExtension];
NSString* suffix = [oldName pathExtension];
NSString* numSuffix = nil;
int n = 1;
NSInteger n = 1;
NSString* fname = oldName;
BOOL didRemoveTrailingNumber = NO;

Expand Down Expand Up @@ -110,9 +110,9 @@ -(NSString*) uniqueFileName: (NSString*)oldName
}

if( [suffix length] == 0 ) // Build "/folder/file 1"-style path:
fname = [baseName stringByAppendingString: [NSString stringWithFormat:@" %i", n++]];
fname = [baseName stringByAppendingString: [NSString stringWithFormat:@" %ld", n++]];
else // Build "/folder/file 1.suffix"-style path:
fname = [baseName stringByAppendingString: [NSString stringWithFormat:@" %i.%@", n++, suffix]];
fname = [baseName stringByAppendingString: [NSString stringWithFormat:@" %ld.%@", n++, suffix]];

if( n <= 0 ) // overflow!
return nil;
Expand Down
4 changes: 2 additions & 2 deletions NSStringDrawing+SizeWithRect.m
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ -(NSSize) sizeWithRect: (NSRect)box
[layoutManager release];

[textContainer setContainerSize: NSMakeSize(box.size.width, FLT_MAX)];
(NSRange) [layoutManager glyphRangeForTextContainer: textContainer]; // Cause re-layout.
[layoutManager glyphRangeForTextContainer: textContainer]; // Cause re-layout.
NSRect neededBox = [layoutManager usedRectForTextContainer: textContainer];

[textStorage release];
Expand All @@ -65,7 +65,7 @@ -(NSSize) sizeWithRect: (NSRect)box attributes: (NSDictionary*)attrs
[layoutManager release];

[textContainer setContainerSize: NSMakeSize(box.size.width, FLT_MAX)];
(NSRange) [layoutManager glyphRangeForTextContainer: textContainer]; // Cause re-layout.
[layoutManager glyphRangeForTextContainer: textContainer]; // Cause re-layout.
NSRect neededBox = [layoutManager usedRectForTextContainer: textContainer];

[textStorage release];
Expand Down
14 changes: 7 additions & 7 deletions NSWindow+ULIZoomEffect.m
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ -(NSImage*) uli_imageWithSnapshotForceActive: (BOOL)doForceActive
[self orderFront: nil];

// snag the image
CGImageRef windowImage = CGWindowListCreateImage(CGRectNull, kCGWindowListOptionIncludingWindow, [self windowNumber], kCGWindowImageBoundsIgnoreFraming);
CGImageRef windowImage = CGWindowListCreateImage(CGRectNull, kCGWindowListOptionIncludingWindow, (CGWindowID)[self windowNumber], kCGWindowImageBoundsIgnoreFraming);

if( !wasVisible )
[self orderOut: nil];
Expand All @@ -199,11 +199,11 @@ -(NSImage*) uli_imageWithSnapshotForceActive: (BOOL)doForceActive

// Create a borderless window that shows and contains the given image:

-(NSWindow*) uli_animationWindowForZoomEffectWithImage: (NSImage*)snapshotImage
-(ULIQuicklyAnimatingWindow*) uli_animationWindowForZoomEffectWithImage: (NSImage*)snapshotImage
{
NSRect myFrame = [self frame];
myFrame.size = [snapshotImage size];
NSWindow * animationWindow = [[ULIQuicklyAnimatingWindow alloc] initWithContentRect: myFrame styleMask: NSBorderlessWindowMask backing: NSBackingStoreBuffered defer: NO];
ULIQuicklyAnimatingWindow * animationWindow = [[ULIQuicklyAnimatingWindow alloc] initWithContentRect: myFrame styleMask: NSBorderlessWindowMask backing: NSBackingStoreBuffered defer: NO];
[animationWindow setOpaque: NO];

if( [animationWindow respondsToSelector: @selector(setAnimationBehavior:)] )
Expand Down Expand Up @@ -241,7 +241,7 @@ -(void) makeKeyAndOrderFrontWithPopEffect
NSRect myFrame = [self frame];
NSRect poppedFrame = NSInsetRect(myFrame, -20, -20);
myFrame.size = snapshotImage.size;
NSWindow * animationWindow = [self uli_animationWindowForZoomEffectWithImage: snapshotImage];
ULIQuicklyAnimatingWindow * animationWindow = [self uli_animationWindowForZoomEffectWithImage: snapshotImage];
[animationWindow setAnimationResizeTime: 0.025];
[animationWindow setFrame: myFrame display: YES];
[animationWindow orderFront: nil];
Expand Down Expand Up @@ -275,7 +275,7 @@ -(void) makeKeyAndOrderFrontWithZoomEffectFromRect: (NSRect)globalStartPoint
NSImage * snapshotImage = [self uli_imageWithSnapshotForceActive: YES];
NSRect myFrame = [self frame];
myFrame.size = snapshotImage.size;
NSWindow * animationWindow = [self uli_animationWindowForZoomEffectWithImage: snapshotImage];
ULIQuicklyAnimatingWindow * animationWindow = [self uli_animationWindowForZoomEffectWithImage: snapshotImage];
[animationWindow setFrame: globalStartPoint display: YES];
[animationWindow orderFront: nil];
[animationWindow setFrame: myFrame display: YES animate: YES];
Expand Down Expand Up @@ -306,7 +306,7 @@ -(void) orderFrontWithZoomEffectFromRect: (NSRect)globalStartPoint
NSImage * snapshotImage = [self uli_imageWithSnapshotForceActive: NO];
NSRect myFrame = [self frame];
myFrame.size = snapshotImage.size;
NSWindow * animationWindow = [self uli_animationWindowForZoomEffectWithImage: snapshotImage];
ULIQuicklyAnimatingWindow * animationWindow = [self uli_animationWindowForZoomEffectWithImage: snapshotImage];
[animationWindow setFrame: globalStartPoint display: YES];
[animationWindow orderFront: nil];
[animationWindow setFrame: myFrame display: YES animate: YES];
Expand Down Expand Up @@ -337,7 +337,7 @@ -(void) orderOutWithZoomEffectToRect: (NSRect)globalEndPoint
NSImage * snapshotImage = [self uli_imageWithSnapshotForceActive: NO];
NSRect myFrame = [self frame];
myFrame.size = snapshotImage.size;
NSWindow * animationWindow = [self uli_animationWindowForZoomEffectWithImage: snapshotImage];
ULIQuicklyAnimatingWindow * animationWindow = [self uli_animationWindowForZoomEffectWithImage: snapshotImage];
[animationWindow setFrame: myFrame display: YES];

NSDisableScreenUpdates();
Expand Down
3 changes: 3 additions & 0 deletions UKGraphics.m
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@
#endif


void UKGlossInterpolation(void *info, const CGFloat *input, CGFloat *output);


void UKDrawWhiteBezel( NSRect box, NSRect clipBox )
{
UKDrawDropHighlightedWhiteBezel( NO, box, clipBox );
Expand Down
2 changes: 1 addition & 1 deletion UKRandomInteger.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
#import <Cocoa/Cocoa.h>


NSInteger UKRandomInteger();
NSInteger UKRandomInteger( void );


2 changes: 1 addition & 1 deletion UKRandomInteger.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#import "UKRandomInteger.h"


NSInteger UKRandomInteger()
NSInteger UKRandomInteger( void )
{
#if __LP64__
return (((NSInteger)rand()) | ((NSInteger)rand()) << 32);
Expand Down
29 changes: 20 additions & 9 deletions make_git_version_header.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,16 @@
#
# Run this file as part of your build process to extract the latest
# revision from your Git working copy and create a 'svn_version.h'
# file defining a SVN_VERSION constant to that value.
# file defining a SVN_VERSION constant to that value in the current directory.
#
# This is for a user-visible build number, so we use the number of revisions
# and not the actual git hash.
# and not the actual git hash. You can override this value if you want to e.g.
# have your CI server provide the build number, simply by defining
# SVN_VERSION_NUM.
#
# The file will be created in the current directory and the subversion
# revision number is extracted from the current folder's .svn/entries
# file.
# There is also a SVN_BUILD_MEANS define that is a string with which you can
# indicate who built it (kind of as a namespace for the build number, e.g.
# -DSVN_BUILD_MEANS=nightly
#

echo -n "note: Finding revision in "
Expand All @@ -51,8 +53,17 @@ fullrevnum=`$GIT rev-parse HEAD`
builddate=`date "+%Y-%m-%d"`

# Now write the constant declaration to the file:
echo "#define SVN_VERSION \"$revnum\"" > svn_version.h
echo "#define GIT_HASH \"$fullrevnum\"" >> svn_version.h
echo "#define SVN_VERSION_NUM $revnum" >> svn_version.h
echo "#define SVN_BUILD_DATE \"$builddate\"" >> svn_version.h
echo "#define MGVH_TOSTRING2(n) #n" > svn_version.h
echo "#define MGVH_TOSTRING(n) MGVH_TOSTRING2(n)" >> svn_version.h
echo "#ifndef SVN_VERSION_NUM" >> svn_version.h
echo "#define SVN_VERSION_NUM $revnum" >> svn_version.h
echo "#endif /* SVN_VERSION_NUM */" >> svn_version.h
echo "#define SVN_VERSION MGVH_TOSTRING(SVN_VERSION_NUM)" >> svn_version.h
echo "#define GIT_HASH \"$fullrevnum\"" >> svn_version.h
echo "#define SVN_BUILD_DATE \"$builddate\"" >> svn_version.h
echo "#ifndef SVN_BUILD_MEANS" >> svn_version.h
echo "#define SVN_BUILD_MEANS manual" >> svn_version.h
echo "#endif /* SVN_BUILD_MEANS */" >> svn_version.h
echo "#define SVN_BUILD_MEANS_STR MGVH_TOSTRING(SVN_BUILD_MEANS)" >> svn_version.h

echo "note: Wrote revision $revnum to svn_version.h"

0 comments on commit 8dbdba4

Please sign in to comment.