Skip to content

Commit

Permalink
Initial commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
bdrister committed Oct 1, 2009
0 parents commit 624afd5
Show file tree
Hide file tree
Showing 80 changed files with 6,553 additions and 0 deletions.
538 changes: 538 additions & 0 deletions Developer/AquaticPrime Developer.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions Developer/AquaticPrimeDeveloper_Prefix.pch
@@ -0,0 +1,7 @@
//
// Prefix header for all source files of the 'AquaticPrime' target in the 'AquaticPrime' project.
//

#ifdef __OBJC__
#import <Cocoa/Cocoa.h>
#endif
7 changes: 7 additions & 0 deletions Developer/Classes/AQAppKit/AQAboutView.h
@@ -0,0 +1,7 @@
#import <Cocoa/Cocoa.h>

@interface AQAboutView : NSView
{
NSImage *aboutImage;
}
@end
21 changes: 21 additions & 0 deletions Developer/Classes/AQAppKit/AQAboutView.m
@@ -0,0 +1,21 @@
#import "AQAboutView.h"

@implementation AQAboutView

-(void)awakeFromNib
{
aboutImage = [NSImage imageNamed:@"aboutbox"];
[self setNeedsDisplay:YES];
}

-(void)drawRect:(NSRect)rect
{
[[NSColor clearColor] set];
NSRectFill([self frame]);

[aboutImage compositeToPoint:NSZeroPoint operation:NSCompositeSourceOver];

[[self window] invalidateShadow];
}

@end
6 changes: 6 additions & 0 deletions Developer/Classes/AQAppKit/AQAboutWindow.h
@@ -0,0 +1,6 @@
#import <Cocoa/Cocoa.h>

@interface AQAboutWindow : NSWindow
{
}
@end
46 changes: 46 additions & 0 deletions Developer/Classes/AQAppKit/AQAboutWindow.m
@@ -0,0 +1,46 @@
#import "AQAboutWindow.h"

@implementation AQAboutWindow

- (id)initWithContentRect:(NSRect)contentRect styleMask:(unsigned int)aStyle backing:(NSBackingStoreType)bufferingType defer:(BOOL)flag
{
NSWindow *result = [super initWithContentRect:contentRect styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:NO];
[result setBackgroundColor: [NSColor clearColor]];
[result setLevel: NSStatusWindowLevel];
[result setOpaque:NO];
[result setHasShadow:YES];
[result setDelegate:self];
return result;
}

- (BOOL)canBecomeKeyWindow
{
return YES;
}

- (BOOL)acceptsFirstResponder
{
return YES;
}

- (BOOL)becomeFirstResponder
{
return YES;
}

- (void)mouseDown:(NSEvent *)theEvent
{
[self orderOut:self];
}

- (void)keyDown:(NSEvent *)theEvent
{
[self orderOut:self];
}

- (void)windowDidResignKey:(NSNotification *)aNotification
{
[self orderOut:self];
}

@end
36 changes: 36 additions & 0 deletions Developer/Classes/AQAppKit/AQTableView.h
@@ -0,0 +1,36 @@
//
// AQTableView.h
// AquaticPrime Developer
//
// Copyright (c) 2005, Lucas Newman
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
// ¥Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
// ¥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.
// ¥Neither the name of the Aquatic nor the names of its contributors may be used to
// endorse or promote products derived from this software without specific prior written permission.
//
// 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 OWNER OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
// IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
// OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#import <Cocoa/Cocoa.h>

@interface AQTableView : NSTableView
{
}

// Delegate method
- (void)deleteItemAtIndex:(int)index;

@end
49 changes: 49 additions & 0 deletions Developer/Classes/AQAppKit/AQTableView.m
@@ -0,0 +1,49 @@
//
// AQTableView.m
// AquaticPrime Developer
//
// Copyright (c) 2005, Lucas Newman
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
// ¥Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
// ¥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.
// ¥Neither the name of the Aquatic nor the names of its contributors may be used to
// endorse or promote products derived from this software without specific prior written permission.
//
// 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 OWNER OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
// IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
// OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#import "AQTableView.h"

@implementation AQTableView

- (void)keyDown:(NSEvent *)event
{
unichar key = [[event charactersIgnoringModifiers] characterAtIndex:0];

if ( (key == NSDeleteCharacter || key == NSDeleteFunctionKey) &&
([self numberOfRows] > 0) && ([self selectedRow] != -1) )
{
[self deleteItemAtIndex:[self selectedRow]];
} else {
[super keyDown:event];
}
}

- (void)deleteItemAtIndex:(int)row
{
[[self delegate] deleteItemAtIndex:row];
}

@end
8 changes: 8 additions & 0 deletions Developer/Classes/AQAppKit/AQTextFieldCell.h
@@ -0,0 +1,8 @@
/* AQTextFieldCell */

#import <Cocoa/Cocoa.h>

@interface AQTextFieldCell : NSTextFieldCell
{
}
@end
26 changes: 26 additions & 0 deletions Developer/Classes/AQAppKit/AQTextFieldCell.m
@@ -0,0 +1,26 @@
#import "AQTextFieldCell.h"

@implementation AQTextFieldCell

// Deal with drawing the text inside the cell ourselves
- (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView
{
// First get the string and string attributes
NSString *string = [self stringValue];
NSMutableDictionary *attribs = [[[self attributedStringValue] attributesAtIndex:0 effectiveRange:nil] mutableCopy];

// If the cell is selected and its control view is the first responder, draw the text white
if ([self isHighlighted])
[attribs setObject:[NSColor whiteColor] forKey:NSForegroundColorAttributeName];

// Then adjust the drawing rectangle and draw the text so that it is centered vertically
NSSize stringSize = [string sizeWithAttributes:attribs];
cellFrame.origin.x += 4.0;
cellFrame.size.width -= 4.0;
cellFrame.origin.y += (cellFrame.size.height - stringSize.height) / 2;
cellFrame.size.height = stringSize.height;
[string drawInRect:cellFrame withAttributes:attribs];
[attribs release];
}

@end
23 changes: 23 additions & 0 deletions Developer/Classes/AQAppKit/OAGradientTableView.h
@@ -0,0 +1,23 @@
// Copyright 2003-2004 Omni Development, Inc. All rights reserved.
//
// This software may only be used and reproduced according to the
// terms in the file OmniSourceLicense.html, which should be
// distributed with this project and can also be found at
// <http://www.omnigroup.com/developer/sourcecode/sourcelicense/>.
//

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

// For this to look right your cell class must return -[NSColor textBackgroundColor] from -textColor when it is highlighted. See OATextWithIconCell for example.

@interface OAGradientTableView : AQTableView
{
struct {
unsigned int acceptsFirstMouse:1;
} flags;
}

- (void)setAcceptsFirstMouse:(BOOL)flag;

@end

0 comments on commit 624afd5

Please sign in to comment.