merge with mainline

This commit is contained in:
Christopher Lloyd 2012-04-22 22:31:08 -04:00
commit ccf18d8eed
343 changed files with 23505 additions and 4485 deletions

View File

@ -12,4 +12,7 @@ build
*.swp
*~.nib
*.orig
*.orig
xcuserdata
project.xcworkspace

View File

@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 42;
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
@ -2147,6 +2147,14 @@
FE1708061260A1E000D18E9E /* NSEnterFullScreenTemplate.pdf in Resources */ = {isa = PBXBuildFile; fileRef = FE1707FC1260A1E000D18E9E /* NSEnterFullScreenTemplate.pdf */; };
FE1CEA6F0C8F12F800184630 /* opengl_dll.h in Headers */ = {isa = PBXBuildFile; fileRef = FE1CEA6B0C8F12F800184630 /* opengl_dll.h */; };
FE1CEA700C8F12F800184630 /* opengl_dll.m in Sources */ = {isa = PBXBuildFile; fileRef = FE1CEA6C0C8F12F800184630 /* opengl_dll.m */; };
FE1F650E1508165100C24624 /* darwin-i386-framework.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = FE1F65061508164F00C24624 /* darwin-i386-framework.xcconfig */; };
FE1F650F1508165100C24624 /* darwin-ppc-framework.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = FE1F65071508165000C24624 /* darwin-ppc-framework.xcconfig */; };
FE1F65101508165100C24624 /* darwin-x86_64-framework.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = FE1F65081508165000C24624 /* darwin-x86_64-framework.xcconfig */; };
FE1F65111508165100C24624 /* freebsd-i386-framework.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = FE1F65091508165000C24624 /* freebsd-i386-framework.xcconfig */; };
FE1F65121508165100C24624 /* linux-arm-framework.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = FE1F650A1508165000C24624 /* linux-arm-framework.xcconfig */; };
FE1F65131508165100C24624 /* linux-i386-framework.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = FE1F650B1508165000C24624 /* linux-i386-framework.xcconfig */; };
FE1F65141508165100C24624 /* linux-ppc-framework.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = FE1F650C1508165000C24624 /* linux-ppc-framework.xcconfig */; };
FE1F65151508165100C24624 /* solaris-sparc-framework.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = FE1F650D1508165100C24624 /* solaris-sparc-framework.xcconfig */; };
FE20C20E11892436006F01BA /* CAAnimation.m in Sources */ = {isa = PBXBuildFile; fileRef = FE20C20711892436006F01BA /* CAAnimation.m */; };
FE20C20F11892436006F01BA /* CIAffineTransform.m in Sources */ = {isa = PBXBuildFile; fileRef = FE20C20811892436006F01BA /* CIAffineTransform.m */; };
FE20C21011892436006F01BA /* CIColor.m in Sources */ = {isa = PBXBuildFile; fileRef = FE20C20911892436006F01BA /* CIColor.m */; };
@ -4220,16 +4228,6 @@
);
script = "";
};
FE01AABE0C5D9BCB00AEA51A /* PBXBuildRule */ = {
isa = PBXBuildRule;
compilerSpec = org.cocotron.1.0.windows.i386.gcc.default;
fileType = sourcecode.c;
isEditable = 1;
outputFiles = (
"",
);
script = "";
};
FE5A8BDF10C6F50E005E348A /* PBXBuildRule */ = {
isa = PBXBuildRule;
compilerSpec = org.cocotron.1.0.freebsd.i386.gcc.default;
@ -5015,6 +5013,14 @@
FE1E54ED1430303F000D60A1 /* windows.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = windows.xcconfig; sourceTree = "<group>"; };
FE1E86BF0BBCA62D0013B968 /* NSGraphicsStyle.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = NSGraphicsStyle.h; sourceTree = "<group>"; };
FE1E86C00BBCA62D0013B968 /* NSGraphicsStyle.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = NSGraphicsStyle.m; sourceTree = "<group>"; };
FE1F65061508164F00C24624 /* darwin-i386-framework.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = "darwin-i386-framework.xcconfig"; sourceTree = "<group>"; };
FE1F65071508165000C24624 /* darwin-ppc-framework.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = "darwin-ppc-framework.xcconfig"; sourceTree = "<group>"; };
FE1F65081508165000C24624 /* darwin-x86_64-framework.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = "darwin-x86_64-framework.xcconfig"; sourceTree = "<group>"; };
FE1F65091508165000C24624 /* freebsd-i386-framework.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = "freebsd-i386-framework.xcconfig"; sourceTree = "<group>"; };
FE1F650A1508165000C24624 /* linux-arm-framework.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = "linux-arm-framework.xcconfig"; sourceTree = "<group>"; };
FE1F650B1508165000C24624 /* linux-i386-framework.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = "linux-i386-framework.xcconfig"; sourceTree = "<group>"; };
FE1F650C1508165000C24624 /* linux-ppc-framework.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = "linux-ppc-framework.xcconfig"; sourceTree = "<group>"; };
FE1F650D1508165100C24624 /* solaris-sparc-framework.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = "solaris-sparc-framework.xcconfig"; sourceTree = "<group>"; };
FE20C20711892436006F01BA /* CAAnimation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CAAnimation.m; path = ../QuartzCore/CAAnimation.m; sourceTree = SOURCE_ROOT; };
FE20C20811892436006F01BA /* CIAffineTransform.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CIAffineTransform.m; path = ../QuartzCore/CIAffineTransform.m; sourceTree = SOURCE_ROOT; };
FE20C20911892436006F01BA /* CIColor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CIColor.m; path = ../QuartzCore/CIColor.m; sourceTree = SOURCE_ROOT; };
@ -6414,20 +6420,28 @@
FE1E54DE1430303F000D60A1 /* xcconfig */ = {
isa = PBXGroup;
children = (
FE70846E1431168800B99A95 /* windows-i386-framework.xcconfig */,
FE1F65061508164F00C24624 /* darwin-i386-framework.xcconfig */,
FE1E54DF1430303F000D60A1 /* darwin-i386.xcconfig */,
FE1F65071508165000C24624 /* darwin-ppc-framework.xcconfig */,
FE1E54E01430303F000D60A1 /* darwin-ppc.xcconfig */,
FE1F65081508165000C24624 /* darwin-x86_64-framework.xcconfig */,
FE1E54E11430303F000D60A1 /* darwin-x86_64.xcconfig */,
FE1E54E21430303F000D60A1 /* darwin.xcconfig */,
FE1F65091508165000C24624 /* freebsd-i386-framework.xcconfig */,
FE1E54E31430303F000D60A1 /* freebsd-i386.xcconfig */,
FE1E54E41430303F000D60A1 /* freebsd.xcconfig */,
FE1F650A1508165000C24624 /* linux-arm-framework.xcconfig */,
FE1E54E51430303F000D60A1 /* linux-arm.xcconfig */,
FE1F650B1508165000C24624 /* linux-i386-framework.xcconfig */,
FE1E54E61430303F000D60A1 /* linux-i386.xcconfig */,
FE1F650C1508165000C24624 /* linux-ppc-framework.xcconfig */,
FE1E54E71430303F000D60A1 /* linux-ppc.xcconfig */,
FE1E54E81430303F000D60A1 /* linux.xcconfig */,
FE1E54E91430303F000D60A1 /* platform.xcconfig */,
FE1F650D1508165100C24624 /* solaris-sparc-framework.xcconfig */,
FE1E54EA1430303F000D60A1 /* solaris-sparc.xcconfig */,
FE1E54EB1430303F000D60A1 /* solaris.xcconfig */,
FE70846E1431168800B99A95 /* windows-i386-framework.xcconfig */,
FE1E54EC1430303F000D60A1 /* windows-i386.xcconfig */,
FE1E54ED1430303F000D60A1 /* windows.xcconfig */,
);
@ -8907,7 +8921,6 @@
FE01AABD0C5D9BCB00AEA51A /* Rez */,
);
buildRules = (
FE01AABE0C5D9BCB00AEA51A /* PBXBuildRule */,
);
dependencies = (
FE01AACC0C5D9BE700AEA51A /* PBXTargetDependency */,
@ -8971,8 +8984,11 @@
/* Begin PBXProject section */
6E2B57700976075500DA0954 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0420;
};
buildConfigurationList = 6E2B57740976075500DA0954 /* Build configuration list for PBXProject "AppKit" */;
compatibilityVersion = "Xcode 2.4";
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
@ -9396,6 +9412,14 @@
630DCA0514CE45E60009A039 /* NSSystemInfoPanel.nib in Resources */,
630DCA0B14CE475C0009A039 /* NSToolbarCustomizationPalette.nib in Resources */,
630DCA1314CE48210009A039 /* NSSpellingViewController.xib in Resources */,
FE1F650E1508165100C24624 /* darwin-i386-framework.xcconfig in Resources */,
FE1F650F1508165100C24624 /* darwin-ppc-framework.xcconfig in Resources */,
FE1F65101508165100C24624 /* darwin-x86_64-framework.xcconfig in Resources */,
FE1F65111508165100C24624 /* freebsd-i386-framework.xcconfig in Resources */,
FE1F65121508165100C24624 /* linux-arm-framework.xcconfig in Resources */,
FE1F65131508165100C24624 /* linux-i386-framework.xcconfig in Resources */,
FE1F65141508165100C24624 /* linux-ppc-framework.xcconfig in Resources */,
FE1F65151508165100C24624 /* solaris-sparc-framework.xcconfig in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -11818,6 +11842,7 @@
6E2B57760976075500DA0954 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
};
name = Release;
};
@ -11850,9 +11875,7 @@
"-DCGL_INSIDE_BUILD",
);
OTHER_LDFLAGS = (
"-lz",
"-static",
"-ljpeg",
"-shared",
"-lmsimg32",
"-lole32",
@ -11865,7 +11888,6 @@
"-Wl,--export-all-symbols",
"-Wl,--out-implib,$TARGET_BUILD_DIR/AppKit.framework/libAppKit.a",
);
PREBINDING = NO;
PRODUCT_NAME = AppKit;
};
name = Debug;
@ -11873,6 +11895,7 @@
7E891F4E0D4967B6008150D3 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
};
name = Debug;
};
@ -11923,7 +11946,6 @@
"-lfreetype",
"-lfontconfig",
);
PREBINDING = NO;
PRODUCT_NAME = AppKit;
STRIP_INSTALLED_PRODUCT = YES;
SYMROOT = build/Linux/i386;
@ -11976,7 +11998,6 @@
"-lfreetype",
"-lfontconfig",
);
PREBINDING = NO;
PRODUCT_NAME = AppKit;
SYMROOT = build/Linux/i386;
};
@ -11998,7 +12019,7 @@
GCC_PRECOMPILE_PREFIX_HEADER = NO;
GCC_PREFIX_HEADER = "";
GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES;
GCC_VERSION = 4.2;
GCC_VERSION = com.apple.compilers.llvmgcc42;
HEADER_SEARCH_PATHS = (
/usr/X11/include/fontconfig,
/usr/X11/include/freetype2,
@ -12033,7 +12054,6 @@
"-lz",
);
OTHER_LDFLAGS_QUOTED_FOR_TARGET_1 = "\"/Developer/Cocotron/1.0/Darwin/i386/lib/libpixman-1.a\"";
PREBINDING = NO;
PRODUCT_NAME = AppKit;
STRIP_INSTALLED_PRODUCT = YES;
SYMROOT = build/Darwin/i386;
@ -12056,6 +12076,7 @@
GCC_PRECOMPILE_PREFIX_HEADER = NO;
GCC_PREFIX_HEADER = "";
GCC_UNROLL_LOOPS = NO;
GCC_VERSION = com.apple.compilers.llvmgcc42;
HEADER_SEARCH_PATHS = (
/Developer/Cocotron/1.0/Darwin/i386/include,
/Developer/Cocotron/1.0/Darwin/i386/include/X11,
@ -12090,7 +12111,6 @@
"-lz",
);
OTHER_LDFLAGS_QUOTED_FOR_TARGET_1 = "\"/Developer/Cocotron/1.0/Darwin/i386/lib/libpixman-1.a\"";
PREBINDING = NO;
PRODUCT_NAME = AppKit;
SYMROOT = build/Darwin/i386;
};
@ -12137,9 +12157,7 @@
"-DCGL_INSIDE_BUILD",
);
OTHER_LDFLAGS = (
"-lz",
"-static",
"-ljpeg",
"-shared",
"-lmsimg32",
"-lole32",
@ -12153,7 +12171,6 @@
"-Wl,--export-all-symbols",
"-Wl,--out-implib,$TARGET_BUILD_DIR/AppKit.framework/libAppKit.a",
);
PREBINDING = NO;
PRODUCT_NAME = AppKit;
};
name = Release;
@ -12204,7 +12221,6 @@
"-lfreetype",
"-lfontconfig",
);
PREBINDING = NO;
PRODUCT_NAME = AppKit;
STRIP_INSTALLED_PRODUCT = NO;
SYMROOT = build/FreeBSD/i386;
@ -12255,7 +12271,6 @@
"-lfreetype",
"-lfontconfig",
);
PREBINDING = NO;
PRODUCT_NAME = AppKit;
SYMROOT = build/FreeBSD/i386;
};
@ -12294,7 +12309,6 @@
"-framework",
ApplicationServices,
);
PREBINDING = NO;
PRODUCT_NAME = AppKit;
STRIP_INSTALLED_PRODUCT = YES;
SYMROOT = build/MacOS/i386;
@ -12324,7 +12338,7 @@
/Developer/Cocotron/1.0/Darwin/i386/include/freetype2,
/Developer/Cocotron/1.0/Darwin/i386/include/X11/fontconfig,
);
INFOPLIST_FILE = "/Users/cjwl/Cocotron/1.0/rForwarding/AppKit/Info copy.plist";
INFOPLIST_FILE = Info.plist;
INSTALL_PATH = /Developer/Cocotron/1.0/Darwin/i386/Frameworks;
LIBRARY_SEARCH_PATHS = /Developer/Cocotron/1.0/Darwin/i386/lib;
LIBRARY_SEARCH_PATHS_QUOTED_1 = "\"$(SRCROOT)/CoreGraphics.subproj\"";
@ -12349,7 +12363,6 @@
"-lz",
);
OTHER_LDFLAGS_QUOTED_FOR_TARGET_1 = "\"/Developer/Cocotron/1.0/Darwin/i386/lib/libpixman-1.a\"";
PREBINDING = NO;
PRODUCT_NAME = AppKit;
SYMROOT = build/MacOS/i386;
};

View File

@ -0,0 +1,57 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "FE01A8070C5D9BCB00AEA51A"
BuildableName = "AppKit.framework"
BlueprintName = "AppKit-Windows-i386"
ReferencedContainer = "container:AppKit.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
</Testables>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -181,8 +181,15 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
-(void)setAccessoryView:(NSView *)value {
value=[value retain];
[_accessoryView removeFromSuperview];
[_accessoryView release];
_accessoryView=value;
// We must add it as a subview here such that a makeFirstResponder: immediately after
// works properly by setting up the field editor
[[_window contentView] addSubview:_accessoryView];
_needsLayout=YES;
}
@ -382,7 +389,6 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
frame.origin.x=LEFT_MARGIN+iconSize.width+ICON_MAIN_GAP;
frame.origin.y=panelSize.height-TOP_MARGIN-messageSize.height-messageInformativeGap-informativeSize.height-informativeSuppressionGap-supressionSize.height-suppressionAccessoryGap-frame.size.height;
[_accessoryView setFrame:frame];
[[_window contentView] addSubview:_accessoryView];
}
NSPoint origin={panelSize.width-RIGHT_MARGIN,BOTTOM_MARGIN};

View File

@ -138,6 +138,7 @@ id NSApp=nil;
_modalStack=[NSMutableArray new];
_lock=NSZoneMalloc(NULL,sizeof(pthread_mutex_t));
pthread_mutex_init(_lock,NULL);
[self _showSplashImage];
@ -796,39 +797,67 @@ id NSApp=nil;
}
-(int)runModalSession:(NSModalSession)session {
while([session stopCode]==NSRunContinuesResponse) {
NSAutoreleasePool *pool=[NSAutoreleasePool new];
NSEvent *event=[self nextEventMatchingMask:NSAnyEventMask untilDate:[NSDate date] inMode:NSModalPanelRunLoopMode dequeue:YES];
NSMutableArray *savedEvents=[NSMutableArray array];
while([session stopCode]==NSRunContinuesResponse) {
NSAutoreleasePool *pool=[NSAutoreleasePool new];
NSEvent *event=[self nextEventMatchingMask:NSAnyEventMask untilDate:[NSDate date] inMode:NSModalPanelRunLoopMode dequeue:YES];
if(event==nil){
[pool release];
break;
if(event==nil){
[pool release];
break;
}
NSWindow *window=[event window];
// in theory this could get weird, but all we want is the ESC-cancel keybinding, afaik NSApp doesn't respond to any other doCommandBySelectors...
if([event type]==NSKeyDown && window == [session modalWindow])
[self interpretKeyEvents:[NSArray arrayWithObject:event]];
if(window==[session modalWindow] || [window worksWhenModal])
[self sendEvent:event];
else if([event type]==NSLeftMouseDown)
[[session modalWindow] makeKeyAndOrderFront:self];
else {
// We need to preserve some events which are not processed in the modal loop and requeue them.
// The particular case we need to handle is mouse down. run modal. then actually receive the mouse up when the modal is done.
// So we know this works in Cocoa, save the mouse up here.
// We don't want to save mouse moved or such.
// There is kind of adhoc, probably a better way to do it, find out which combinations should work (e.g. mouse enter, do we get mouse exit?)
if([[session unprocessedEvents] count]==0){
switch([event type]){
case NSLeftMouseUp:
case NSRightMouseUp:
[session addUnprocessedEvent: event];
break;
default:
// don't save
break;
}
}
}
[pool release];
}
NSWindow *window=[event window];
// in theory this could get weird, but all we want is the ESC-cancel keybinding, afaik NSApp doesn't respond to any other doCommandBySelectors...
if([event type]==NSKeyDown && window == [session modalWindow])
[self interpretKeyEvents:[NSArray arrayWithObject:event]];
if(window==[session modalWindow] || [window worksWhenModal])
[self sendEvent:event];
else if([event type]==NSLeftMouseDown)
[[session modalWindow] makeKeyAndOrderFront:self];
[pool release];
}
return [session stopCode];
return [session stopCode];
}
-(void)endModalSession:(NSModalSession)session {
if(session!=[_modalStack lastObject])
[NSException raise:NSInvalidArgumentException format:@"-[%@ %s] modal session %@ is not the current one %@",isa,sel_getName(_cmd),session,[_modalStack lastObject]];
[[session modalWindow] _showMenuViewIfNeeded];
[_modalStack removeLastObject];
if(session!=[_modalStack lastObject])
[NSException raise:NSInvalidArgumentException format:@"-[%@ %s] modal session %@ is not the current one %@",isa,sel_getName(_cmd),session,[_modalStack lastObject]];
for(NSEvent *requeue in [session unprocessedEvents]){
[self postEvent:requeue atStart:YES];
}
[[session modalWindow] _showMenuViewIfNeeded];
[_modalStack removeLastObject];
}
-(void)stopModalWithCode:(int)code {

View File

@ -800,7 +800,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
a different cell or the same cell is being edited after a makeFirstResponder
This needs to be straightened out
*/
if([self isScrollable]){
if([self isScrollable] || [self wraps]){
NSClipView *clipView;
if([[editor superview] isKindOfClass:[NSClipView class]] && [[editor superview] superview] == view){
@ -817,7 +817,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
[clipView setAutoresizingMask:NSViewWidthSizable|NSViewHeightSizable];
[editor setAutoresizingMask:0];
[editor setHorizontallyResizable:YES];
[editor setHorizontallyResizable:[self isScrollable]];
[editor setVerticallyResizable:YES];
[editor sizeToFit];
[editor setNeedsDisplay:YES];

View File

@ -11,19 +11,13 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
@interface NSCollectionViewItem : NSViewController <NSCoding,NSCopying> {
NSCollectionView *_collectionView;
id _representedObject;
NSView *_view;
BOOL _isSelected;
}
-(NSCollectionView *)collectionView;
-(NSView *)view;
-(BOOL)isSelected;
-representedObject;
-(void)setView:(NSView *)view;
-(void)setSelected:(BOOL)value;
-(void)setRepresentedObject:value;
@end

View File

@ -36,32 +36,12 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
return _collectionView;
}
-(NSView *)view {
return _view;
}
-(BOOL)isSelected {
return _isSelected;
}
-representedObject {
return _representedObject;
}
-(void)setView:(NSView *)view {
view=[view retain];
[_view release];
_view=view;
}
-(void)setSelected:(BOOL)value {
_isSelected=value;
}
-(void)setRepresentedObject:value {
value=[value retain];
[_representedObject release];
_representedObject=value;
}
@end

View File

@ -123,7 +123,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
}
-(NSString *)description {
return [NSString stringWithFormat:@"<%@[0x%lx] type: %d>", [self class], self, _type];
return [NSString stringWithFormat:@"<NSEvent: type=%d loc=(%f,%f) time=%f flags=0x%X win=%p winNum=%d",[self type], [self locationInWindow].x, [self locationInWindow].y, [self timestamp], [self modifierFlags], [self window], [self windowNumber]];
}
@ -194,7 +194,6 @@ static NSTimer *_periodicTimer=nil;
return 0;
}
@end
unsigned NSEventMaskFromType(NSEventType type){

View File

@ -607,7 +607,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
NSBitmapImageRep *image=[[NSBitmapImageRep alloc] initWithBitmapDataPlanes:NULL pixelsWide:size.width pixelsHigh:size.height bitsPerSample:8 samplesPerPixel:4 hasAlpha:YES isPlanar:NO colorSpaceName:NSDeviceRGBColorSpace bytesPerRow:0 bitsPerPixel:32];
[self lockFocusOnRepresentation:image];
[check draw];
// we should probably use -draw here but not all reps implement it, or not?
[check drawInRect:NSMakeRect(0,0,size.width,size.height)];
[self unlockFocus];
[bitmaps addObject:image];

View File

@ -59,6 +59,11 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
return [_cell imageScaling];
}
-(BOOL)refusesFirstResponder {
// we don't have an NSCell
return YES;
}
-(BOOL)isEditable {
return [_cell isEditable];
}

View File

@ -326,7 +326,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
if([key isEqualToString:characters]){
if ([item isEnabled])
[NSApp sendAction:[item action] to:[item target] from:item];
return [NSApp sendAction:[item action] to:[item target] from:item];
else
NSBeep();
return YES;

View File

@ -9,8 +9,9 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
#import <AppKit/NSWindow.h>
@interface NSModalSessionX : NSObject {
NSWindow *_window;
int _stopCode;
NSWindow *_window;
NSMutableArray *_unprocessedEvents;
int _stopCode;
}
+sessionWithWindow:(NSWindow *)window;
@ -19,4 +20,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
-(NSWindow *)modalWindow;
-(int)stopCode;
-(void)addUnprocessedEvent:(NSEvent *)event;
-(NSArray *)unprocessedEvents;
@end

View File

@ -6,16 +6,16 @@ The above copyright notice and this permission notice shall be included in all c
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
// Original - Christopher Lloyd <cjwl@objc.net>
#import <AppKit/NSModalSessionX.h>
#import <AppKit/NSApplication.h>
@implementation NSModalSessionX
-initWithWindow:(NSWindow *)window {
_window=[window retain];
_stopCode=NSRunContinuesResponse;
return self;
_window=[window retain];
_unprocessedEvents=[[NSMutableArray alloc] init];
_stopCode=NSRunContinuesResponse;
return self;
}
-(void)dealloc {
@ -39,4 +39,12 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
return _stopCode;
}
-(void)addUnprocessedEvent:(NSEvent *)event {
[_unprocessedEvents addObject: event];
}
-(NSArray *)unprocessedEvents {
return _unprocessedEvents;
}
@end

View File

@ -9,7 +9,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
#import <Foundation/NSObject.h>
#import <OpenGL/gl.h>
@class NSOpenGLPixelFormat,NSOpenGLPixelBuffer,NSView,CGLPixelSurface;
@class NSOpenGLPixelFormat,NSOpenGLPixelBuffer,NSView;
typedef enum {
NSOpenGLCPSwapRectangle =200,
@ -25,7 +25,7 @@ typedef enum {
NSOpenGLPixelFormat *_pixelFormat;
NSView *_view;
void *_glContext;
CGLPixelSurface *_overlay;
id __remove;
BOOL _hasPrepared;
}

View File

@ -14,10 +14,6 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
#import <OpenGL/OpenGL.h>
#import <Foundation/NSThread-Private.h>
@interface NSView(private)
-(void)_setOverlay:(CGLPixelSurface *)overlay;
@end
@interface NSOpenGLContext(private)
-(void)_clearCurrentContext;
@end
@ -70,6 +66,8 @@ static inline void _clearCurrentContext(){
_clearCurrentContext();
[_pixelFormat release];
_view=nil;
CGLReleaseContext(_glContext);
[super dealloc];
}
@ -98,15 +96,11 @@ static inline void _clearCurrentContext(){
}
-(void)getValues:(GLint *)vals forParameter:(NSOpenGLContextParameter)parameter {
CGLLockContext(_glContext);
CGLGetParameter(_glContext,parameter,vals);
CGLUnlockContext(_glContext);
}
-(void)setValues:(const GLint *)vals forParameter:(NSOpenGLContextParameter)parameter {
CGLLockContext(_glContext);
CGLSetParameter(_glContext,parameter,vals);
CGLUnlockContext(_glContext);
}
-(void)updateViewParameters {
@ -118,28 +112,33 @@ static inline void _clearCurrentContext(){
GLint size[2]={
rect.size.width,
rect.size.height };
CGLLockContext(_glContext);
GLint origin[2]={
rect.origin.x,
rect.origin.y };
GLint hidden[1]= {
[_view isHidden] ? 1 : 0
};
CGLSetParameter(_glContext,kCGLCPSurfaceBackingSize,size);
CGLUnlockContext(_glContext);
CGLSetParameter(_glContext,kCGLCPSurfaceBackingOrigin,origin);
CGLSetParameter(_glContext,kCGLCPSurfaceHidden,hidden);
}
-(void)setView:(NSView *)view {
if(_view!=view)
_hasPrepared=NO;
[_view _setOverlay:nil];
_view=view;
CGLPixelSurface *overlay=nil;
CGLLockContext(_glContext);
CGLGetParameter(_glContext,kCGLCPOverlayPointer,(GLint *)&overlay);
CGLUnlockContext(_glContext);
[_view _setOverlay:overlay];
GLint num[1]={[[_view window] windowNumber]};
CGLSetParameter(_glContext,kCGLCPSurfaceWindowNumber,num);
[self update];
CGLUnlockContext(_glContext);
}
-(void)makeCurrentContext {
@ -207,12 +206,11 @@ static inline void _clearCurrentContext(){
}
-(void)update {
[self updateViewParameters];
}
[self updateViewParameters];
}
-(void)clearDrawable {
_view=nil;
[self updateViewParameters];
[self setView:nil];
}
-(void)copyAttributesFromContext:(NSOpenGLContext *)context withMask:(unsigned long)mask {

View File

@ -71,6 +71,11 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
return _context;
}
- (void) _setWindow:(NSWindow *)window {
[super _setWindow:window];
[_context setView:self];
}
- (void)setPixelFormat:(NSOpenGLPixelFormat *)pixelFormat {
pixelFormat = [pixelFormat retain];
[_pixelFormat release];
@ -103,12 +108,24 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
return YES;
}
-(void)viewDidHide {
// reflect hidden setting
[_context setView:self];
}
-(void)viewDidUnhide {
// reflect hidden setting
[_context setView:self];
}
- (void)lockFocus {
[super lockFocus];
CGLLockContext([_context CGLContextObj]);
// create if needed
NSOpenGLContext *context = [self openGLContext];
CGLLockContext([context CGLContextObj]);
[_context setView:self];
[[self openGLContext] makeCurrentContext];
[context makeCurrentContext];
if (_needsReshape){
[self reshape];

View File

@ -139,6 +139,21 @@ static NSAppleScrollBarVariant appleScrollBarVariant(NSScroller *self){
[self setNeedsDisplay:YES];
}
-(double)doubleValue {
return _floatValue;
}
-(void)setDoubleValue:(double)zeroToOneValue {
_floatValue=zeroToOneValue;
if(_floatValue<=0)
_floatValue=0;
if(_floatValue>1)
_floatValue=1;
[self setNeedsDisplay:YES];
}
-(void)setArrowsPosition:(NSScrollArrowPosition)position {
_arrowsPosition=position;
}
@ -537,4 +552,27 @@ static inline float roundFloat(float value){
}
-(void)scrollWheel:(NSEvent *)event {
NSRect slotRect=[self rectForPart:NSScrollerKnobSlot];
NSRect knobRect=[self rectForPart:NSScrollerKnob];
if([self isVertical]) {
float delta=[event deltaY];
float totalSize=slotRect.size.height-knobRect.size.height;
if(totalSize==0)
_floatValue=0;
else
_floatValue=_floatValue-(delta/totalSize);
if(_floatValue<0)
_floatValue=0;
else if(_floatValue>1.0)
_floatValue=1.0;
[self setNeedsDisplay:YES];
[self sendAction:_action to:_target];
}
}
@end

View File

@ -24,6 +24,8 @@ typedef NSInteger NSStringDrawingOptions;
-(void)drawInRect:(NSRect)rect withAttributes:(NSDictionary *)attributes;
-(NSSize)sizeWithAttributes:(NSDictionary *)attributes;
-(NSRect)boundingRectWithSize:(NSSize)size options:(NSStringDrawingOptions)options attributes:(NSDictionary *)attributes;
@end
@interface NSAttributedString(NSStringDrawing)
@ -32,4 +34,5 @@ typedef NSInteger NSStringDrawingOptions;
-(void)drawWithRect:(NSRect)rect options:(NSStringDrawingOptions)options;
-(NSSize)size;
@end

View File

@ -26,6 +26,11 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
return [[NSStringDrawer sharedStringDrawer] sizeOfString:self withAttributes:attributes inSize:NSZeroSize];
}
- (NSRect)boundingRectWithSize:(NSSize)size options:(NSStringDrawingOptions)options attributes:(NSDictionary *)attributes {
NSUnimplementedMethod();
return NSMakeRect(0,0,0,0);
}
@end
@implementation NSAttributedString(NSStringDrawing)

View File

@ -853,7 +853,8 @@ _dataSource);
if ([_selectedRowIndexes containsIndex:i] != [newIndexes containsIndex:i]) {
if (_editedRow == i && _editingCell != nil)
[self abortEditing];
[self setNeedsDisplayInRect:NSInsetRect([self rectOfRow:i], 0, -1)];
[self setNeedsDisplay:YES];
changed = YES;
// NSLog(@"NSTableView row %d for redraw.", i);
}

View File

@ -123,7 +123,14 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
}
-(BOOL)acceptsFirstResponder {
return YES;
return YES;
}
-(BOOL)canBecomeKeyView {
if(![self isEditable])
return NO;
return [super canBecomeKeyView];
}
-(BOOL)needsPanelToBecomeKey {

View File

@ -17,7 +17,6 @@ typedef enum {
NSColor *_backgroundColor;
NSColor *_textColor;
BOOL _drawsBackground;
BOOL _isBezeled;
NSTextFieldBezelStyle _bezelStyle;
id _placeholder;
}
@ -25,7 +24,6 @@ typedef enum {
-(NSColor *)backgroundColor;
-(NSColor *)textColor;
-(BOOL)drawsBackground;
-(BOOL)isBezeled;
-(NSTextFieldBezelStyle)bezelStyle;
-(NSString *)placeholderString;
@ -34,7 +32,6 @@ typedef enum {
-(void)setBackgroundColor:(NSColor *)color;
-(void)setTextColor:(NSColor *)color;
-(void)setDrawsBackground:(BOOL)flag;
-(void)setBezeled:(BOOL)value;
-(void)setBezelStyle:(NSTextFieldBezelStyle)value;
-(void)setPlaceholderString:(NSString *)value;

View File

@ -88,10 +88,6 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
return _drawsBackground;
}
-(BOOL)isBezeled {
return _isBezeled;
}
-(NSTextFieldBezelStyle)bezelStyle {
return _bezelStyle;
}
@ -126,10 +122,6 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
_drawsBackground=flag;
}
-(void)setBezeled:(BOOL)value {
_isBezeled=value;
}
-(void)setBezelStyle:(NSTextFieldBezelStyle)value {
_bezelStyle=value;
}

View File

@ -260,6 +260,13 @@ NSString * const NSOldSelectedCharacterRange=@"NSOldSelectedCharacterRange";
return YES;
}
-(BOOL)canBecomeKeyView {
if(![self isEditable])
return NO;
return [super canBecomeKeyView];
}
-(BOOL)needsPanelToBecomeKey {
return YES;
}
@ -2414,8 +2421,8 @@ NSString * const NSOldSelectedCharacterRange=@"NSOldSelectedCharacterRange";
NSNotification *note=[NSNotification notificationWithName:NSTextDidEndEditingNotification object:self userInfo:nil];
[[NSNotificationCenter defaultCenter] postNotification:note];
_didSendTextDidEndNotification=NO;
}
return YES;
}

View File

@ -13,6 +13,12 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
#import <AppKit/NSImage.h>
#import <AppKit/NSMenuView.h>
#import <AppKit/NSToolbarView.h>
#import <AppKit/NSMainMenuView.h>
@interface NSWindow(private)
-(BOOL)hasMainMenu;
+(BOOL)hasMainMenuForStyleMask:(NSUInteger)styleMask;
@end
@implementation NSThemeFrame
@ -79,6 +85,14 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
// subtracts menu height but not toolbar height
NSRect contentFrame=[[[self window] class] contentRectForFrameRect:[self bounds] styleMask:[[self window] styleMask]];
// If the class thinks there is a menu but the instance does not want an instance
// we need to add the menu height back to the content view as contentRectForFrameRect subtracts it
if([[[self window] class] hasMainMenuForStyleMask:[[self window] styleMask]]) {
if(![[self window] hasMainMenu])
contentFrame.size.height+=[NSMainMenuView menuHeight];
}
NSRect menuFrame=(menuView!=nil)?[menuView frame]:NSZeroRect;
NSRect toolbarFrame=(toolbarView!=nil)?[toolbarView frame]:NSZeroRect;

View File

@ -15,7 +15,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
#import <AppKit/AppKitExport.h>
#import <ApplicationServices/ApplicationServices.h>
@class NSWindow, NSMenu, NSMenuItem, NSCursor, NSClipView, NSPasteboard, NSTextInputContext, NSImage, NSBitmapImageRep, NSScrollView, NSTrackingArea, NSShadow, NSScreen, CALayer, CIFilter, CGLPixelSurface,CALayerContext;
@class NSWindow, NSMenu, NSMenuItem, NSCursor, NSClipView, NSPasteboard, NSTextInputContext, NSImage, NSBitmapImageRep, NSScrollView, NSTrackingArea, NSShadow, NSScreen, CALayer, CIFilter,CALayerContext;
// See Cocoa Event Handling Guide : Using Tracking-Area Objects : Compatibility Issues
typedef NSTrackingArea *NSTrackingRectTag;
@ -110,7 +110,7 @@ APPKIT_EXPORT NSString * const NSViewFocusDidChangeNotification;
NSDictionary *_animations;
CALayerContext *_layerContext;
CGLPixelSurface *_overlay;
id __remove;
}
+(NSView *)focusView;

View File

@ -30,7 +30,6 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
#import <Onyx2D/O2Context.h>
#import <AppKit/NSRaise.h>
#import <AppKit/NSViewBackingLayer.h>
#import <CoreGraphics/CGLPixelSurface.h>
#import <CoreGraphics/CGWindow.h>
#import <QuartzCore/CALayerContext.h>
#import <QuartzCore/CATransaction.h>
@ -182,8 +181,7 @@ static BOOL NSViewLayersEnabled=NO;
[_layerContext invalidate];
[_layerContext release];
[_overlay release];
[super dealloc];
}
@ -481,35 +479,37 @@ static inline void buildTransformsIfNeeded(NSView *self) {
}
-(void)setHidden:(BOOL)flag {
flag=flag?YES:NO;
flag=flag?YES:NO;
if (_isHidden != flag)
{
invalidateTransform(self);
if ((_isHidden = flag))
{
id view=[_window firstResponder];
if ([view isKindOfClass:[NSView class]])
for (; view; view = [view superview])
{
if (self==view)
{
[_window makeFirstResponder:[self nextValidKeyView]];
break;
}
}
}
if (_isHidden != flag) {
invalidateTransform(self);
if ((_isHidden = flag)) {
id view=[_window firstResponder];
if ([view isKindOfClass:[NSView class]])
for (; view; view = [view superview]) {
if (self==view) {
[_window makeFirstResponder:[self nextValidKeyView]];
break;
}
}
}
[[self superview] setNeedsDisplay:YES];
[[self superview] setNeedsDisplay:YES];
if(_isHidden)
[self viewDidHide];
else
[self viewDidUnhide];
}
}
-(void)viewDidHide {
NSUnimplementedMethod();
// do nothing?
}
-(void)viewDidUnhide {
NSUnimplementedMethod();
// do nothing?
}
-(BOOL)canBecomeKeyView {
@ -527,8 +527,14 @@ static inline void buildTransformsIfNeeded(NSView *self) {
-(NSView *)nextValidKeyView {
NSView *result=[self nextKeyView];
while(result!=nil && ![result canBecomeKeyView])
result=[result nextKeyView];
while(result!=nil && ![result canBecomeKeyView]) {
// prevent an infinite loop
if(result==self)
return nil;
result=[result nextKeyView];
}
return result;
}
@ -538,12 +544,16 @@ static inline void buildTransformsIfNeeded(NSView *self) {
}
-(NSView *)previousValidKeyView {
NSView *result=[self previousKeyView];
while(result!=nil && ![result canBecomeKeyView])
result=[result previousKeyView];
return result;
NSView *result=[self previousKeyView];
while(result!=nil && ![result canBecomeKeyView]) {
// prevent an infinite loop
if(result==self)
return nil;
result=[result previousKeyView];
}
return result;
}
-(NSMenu *)menu {
@ -740,15 +750,17 @@ static inline void buildTransformsIfNeeded(NSView *self) {
[self resizeSubviewsWithOldSize:oldSize];
}
if(_superview==nil)
[_overlay setFrame:_frame];
else
[_overlay setFrame:[_superview convertRect:_frame toView:nil]];
invalidateTransform(self);
if(_postsNotificationOnFrameChange)
[[NSNotificationCenter defaultCenter] postNotificationName:NSViewFrameDidChangeNotification object:self];
NSRect layerFrame=_frame;
if(_superview!=nil)
layerFrame=[_superview convertRect:layerFrame toView:nil];
[_layerContext setFrame:layerFrame];
invalidateTransform(self);
if(_postsNotificationOnFrameChange)
[[NSNotificationCenter defaultCenter] postNotificationName:NSViewFrameDidChangeNotification object:self];
}
-(void)setFrameSize:(NSSize)size {
@ -813,40 +825,22 @@ static inline void buildTransformsIfNeeded(NSView *self) {
_postsNotificationOnBoundsChange=flag;
}
-(void)_setOverlay:(CGLPixelSurface *)overlay {
if(overlay!=_overlay){
[[[self window] platformWindow] removeOverlay:_overlay];
overlay=[overlay retain];
[_overlay release];
_overlay=overlay;
if(_superview==nil)
[_overlay setFrame:[self frame]];
else
[_overlay setFrame:[_superview convertRect:[self frame] toView:nil]];
if(_overlay!=nil)
[[[self window] platformWindow] addOverlay:_overlay];
}
}
-(void)_setWindow:(NSWindow *)window {
[self viewWillMoveToWindow:window];
if(_overlay!=nil)
[[_window platformWindow] removeOverlay:_overlay];
if(_window!=window)
[self setNextKeyView:nil];
_window=window;
if(_overlay!=nil)
[[_window platformWindow] addOverlay:_overlay];
[self viewWillMoveToWindow:window];
[_subviews makeObjectsPerformSelector:_cmd withObject:window];
_validTrackingAreas=NO;
[_window invalidateCursorRectsForView:self]; // this also invalidates tracking areas
[self viewDidMoveToWindow];
_window=window;
[_subviews makeObjectsPerformSelector:_cmd withObject:window];
_validTrackingAreas=NO;
[_window invalidateCursorRectsForView:self]; // this also invalidates tracking areas
if([_window autorecalculatesKeyViewLoop])
[_window recalculateKeyViewLoop];
[self viewDidMoveToWindow];
}
-(void)_setSuperview:superview {
@ -960,8 +954,12 @@ static inline void buildTransformsIfNeeded(NSView *self) {
}
-(void)setNextKeyView:(NSView *)next {
_nextKeyView=next;
[_nextKeyView _setPreviousKeyView:self];
if(next==nil)
[_nextKeyView _setPreviousKeyView:nil];
else
[_nextKeyView _setPreviousKeyView:self];
_nextKeyView=next;
}
-(BOOL)acceptsFirstMouse:(NSEvent *)event {
@ -1458,7 +1456,6 @@ static inline void buildTransformsIfNeeded(NSView *self) {
-(void)_removeLayerFromSuperlayer {
[_layer removeFromSuperlayer];
[self _setOverlay:nil];
[_layerContext invalidate];
[_layerContext release];
_layerContext=nil;
@ -1468,7 +1465,6 @@ static inline void buildTransformsIfNeeded(NSView *self) {
if([_superview layer]==nil){
_layerContext=[[CALayerContext alloc] initWithFrame:[self frame]];
[_layerContext setLayer:_layer];
[self _setOverlay:[_layerContext pixelSurface]];
}
}
@ -2261,23 +2257,24 @@ static NSGraphicsContext *graphicsContextForView(NSView *view){
}
-(void)scrollWheel:(NSEvent *)event {
NSScrollView *scrollView=[self enclosingScrollView];
if(scrollView!=nil){
NSRect bounds=[self bounds];
NSRect visible=[self visibleRect];
float direction=[self isFlipped]?-1:1;
visible.origin.y+=[event deltaY]*direction*[scrollView verticalLineScroll]*3;
// Something equivalent to this should be in scrollRectToVisible:
if(visible.origin.y<bounds.origin.y)
visible.origin.y=bounds.origin.y;
if(NSMaxY(visible)>NSMaxY(bounds))
visible.origin.y=NSMaxY(bounds)-visible.size.height;
[self scrollRectToVisible:visible];
}
NSScrollView *scrollView=[self enclosingScrollView];
if(scrollView!=nil){
NSView *documentView=[scrollView documentView];
NSRect bounds=[documentView bounds];
NSRect visible=[documentView visibleRect];
float direction=[documentView isFlipped]?-1:1;
visible.origin.y+=[event deltaY]*direction*[scrollView verticalLineScroll]*3;
// Something equivalent to this should be in scrollRectToVisible:
if(visible.origin.y<bounds.origin.y)
visible.origin.y=bounds.origin.y;
if(NSMaxY(visible)>NSMaxY(bounds))
visible.origin.y=NSMaxY(bounds)-visible.size.height;
[documentView scrollRectToVisible:visible];
}
}
-(BOOL)performKeyEquivalent:(NSEvent *)event {

View File

@ -73,6 +73,65 @@ NSString * const NSWindowDidAnimateNotification=@"NSWindowDidAnimateNotification
-(void)_setKeyWindow:(NSWindow *)window;
@end
@interface _NSKeyViewPosition : NSObject {
NSView *_view;
NSRect _rect;
}
+(NSArray *)sortedKeyViewPositionsWithView:(NSView *)view;
-initWithView:(NSView *)view;
-(NSView *)view;
-(NSComparisonResult)compareKeyViewPosition:(_NSKeyViewPosition *)other;
@end
@implementation _NSKeyViewPosition
+(void)addKeyViewPositionsWithView:(NSView *)view toArray:(NSMutableArray *)array {
[array addObject:[[[_NSKeyViewPosition alloc] initWithView:view] autorelease]];
for(NSView *child in [view subviews])
[self addKeyViewPositionsWithView:child toArray:array];
}
+(NSArray *)sortedKeyViewPositionsWithView:(NSView *)view {
NSMutableArray *result=[NSMutableArray array];
[self addKeyViewPositionsWithView:view toArray:result];
[result sortUsingSelector:@selector(compareKeyViewPosition:)];
return result;
}
-initWithView:(NSView *)view {
_view=view;
_rect=[[_view superview] convertRect:[_view frame] toView:nil];
return self;
}
-(NSView *)view {
return _view;
}
-(NSComparisonResult)compareKeyViewPosition:(_NSKeyViewPosition *)other {
// Sort by larger Y (cartesian coordinates)
if(NSMaxY(_rect)<NSMaxY(other->_rect))
return NSOrderedDescending;
else {
// Then sort by smaller X
if(NSMinX(_rect)<NSMinX(other->_rect))
return NSOrderedAscending;
else
return NSOrderedDescending;
}
}
@end
@implementation NSWindow
+(NSWindowDepth)defaultDepthLimit {
@ -525,7 +584,7 @@ NSString * const NSWindowDidAnimateNotification=@"NSWindowDidAnimateNotification
}
-(BOOL)autorecalculatesKeyViewLoop {
return _autorecalculatesKeyViewLoop;
return _autorecalculatesKeyViewLoop;
}
-(BOOL)canHide {
@ -697,7 +756,7 @@ NSString * const NSWindowDidAnimateNotification=@"NSWindowDidAnimateNotification
}
if(changed){
[self setFrame:frame display:YES];
[self setFrame:frame display:YES];
}
_makeSureIsOnAScreen=NO;
@ -1055,16 +1114,6 @@ NSString * const NSWindowDidAnimateNotification=@"NSWindowDidAnimateNotification
-(void)setWindowController:(NSWindowController *)value {
_windowController=value;
/*
Cocoa does not setReleasedWhenClosed:NO when setWindowController: is called.
The NSWindowController class does setReleasedWhenClosed:NO in conjunction with setWindowController:
However, there is one application (AC), which calls setWindowController: standalone and does
_something else_ which also does setReleasedWhenClosed:NO. Perhaps some byproduct of NSDOcument, NSWindowController or NSWindow.
THis hasn't been figured out yet. So, in the meantime we do setReleasedWhenClosed:NO since all cases which do call setWindowCOntroller: also
want setReleasedWhenClosed:NO.
*/
[self setReleasedWhenClosed:NO];
}
-(void)setDocumentEdited:(BOOL)flag {
@ -1092,7 +1141,7 @@ NSString * const NSWindowDidAnimateNotification=@"NSWindowDidAnimateNotification
}
-(void)setAutorecalculatesKeyViewLoop:(BOOL)value {
_autorecalculatesKeyViewLoop=value;
_autorecalculatesKeyViewLoop=value;
}
-(void)setCanHide:(BOOL)value {
@ -1522,12 +1571,25 @@ NSString * const NSWindowDidAnimateNotification=@"NSWindowDidAnimateNotification
}
-(void)makeKeyWindow {
[[self platformWindow] makeKey];
if(!_hasBeenOnScreen){
_hasBeenOnScreen=YES;
[self makeFirstResponder:[self initialFirstResponder]];
}
[[self platformWindow] makeKey];
if(!_hasBeenOnScreen){
_hasBeenOnScreen=YES;
// Ref. http://www.cocoadev.com/index.pl?KeyViewLoopGuidelines
// If there is an initial first responder there is a manual key view loop and we don't calculate one
if([self initialFirstResponder]!=nil)
[self makeFirstResponder:[self initialFirstResponder]];
else {
// otherwise calculate one and set the first responder
[self recalculateKeyViewLoop];
if([self firstResponder]==self)
[self makeFirstResponder:[_contentView nextValidKeyView]];
}
}
}
-(void)makeMainWindow {
@ -1604,6 +1666,7 @@ NSString * const NSWindowDidAnimateNotification=@"NSWindowDidAnimateNotification
-(void)selectKeyViewFollowingView:(NSView *)view {
NSView *next=[view nextValidKeyView];
[self makeFirstResponder:next];
}
@ -1613,8 +1676,30 @@ NSString * const NSWindowDidAnimateNotification=@"NSWindowDidAnimateNotification
[self makeFirstResponder:next];
}
-(void)recalculateKeyViewLoopIfNeeded {
if(YES){
// _needsKeyViewLoop=NO;
NSArray *sorted=[_NSKeyViewPosition sortedKeyViewPositionsWithView:_contentView];
NSUInteger i,count=[sorted count];
for(i=0;i<count;i++){
_NSKeyViewPosition *position=[sorted objectAtIndex:i];
if(i+1<count){
[[position view] setNextKeyView:[[sorted objectAtIndex:i+1] view]];
}
else {
[[position view] setNextKeyView:[[sorted objectAtIndex:0] view]];
}
}
}
}
-(void)recalculateKeyViewLoop {
// NSUnimplementedMethod();
//_needsKeyViewLoop=YES;
// This should be deferred
[self recalculateKeyViewLoopIfNeeded];
}
-(NSSelectionDirection)keyViewSelectionDirection {
@ -1668,10 +1753,9 @@ NSString * const NSWindowDidAnimateNotification=@"NSWindowDidAnimateNotification
-(void)setViewsNeedDisplay:(BOOL)flag {
if(flag && !_viewsNeedDisplay){
// NSApplication does a _displayAllWindowsIfNeeded before every event, but there are some things which wont generate
// an event such as performOnMainThread, so we do the callout here too. There is probably a better way to do this
// an event such as performOnMainThread, so we do the callout here too. There is probably a better way to do this
[[NSRunLoop currentRunLoop] cancelPerformSelector:@selector(_displayAllWindowsIfNeeded) target:NSApp argument:nil]; // Be sure we don't accumulate unneeded perform operations
[[NSRunLoop currentRunLoop] performSelector:@selector(_displayAllWindowsIfNeeded) target:NSApp argument:nil order:0 modes:[NSArray arrayWithObject:NSDefaultRunLoopMode]];
[[NSRunLoop currentRunLoop] performSelector:@selector(_displayAllWindowsIfNeeded) target:NSApp argument:nil order:0 modes:[NSArray arrayWithObjects:NSDefaultRunLoopMode, NSModalPanelRunLoopMode, NSEventTrackingRunLoopMode, nil]];
}
_viewsNeedDisplay=flag;
}
@ -2323,6 +2407,10 @@ NSString * const NSWindowDidAnimateNotification=@"NSWindowDidAnimateNotification
}
}
-(void)platformWindowShouldZoom:(CGWindow *)window {
[self zoom:nil];
}
-(void)miniaturize:sender {
[[self platformWindow] miniaturize];
}
@ -2637,8 +2725,8 @@ NSString * const NSWindowDidAnimateNotification=@"NSWindowDidAnimateNotification
}
-(void)platformWindowMiniaturized:(CGWindow *)window {
_isActive=NO;
_isActive=NO;
[self _updatePlatformWindowTitle];
if(_sheetContext!=nil){
[[_sheetContext sheet] orderWindow:NSWindowOut relativeTo:0];
@ -2659,7 +2747,9 @@ NSString * const NSWindowDidAnimateNotification=@"NSWindowDidAnimateNotification
}
-(void)platformWindow:(CGWindow *)window frameChanged:(NSRect)frame didSize:(BOOL)didSize {
_frame=frame;
// We don't want the miniaturized frame.
if(![self isMiniaturized])
_frame=frame;
_makeSureIsOnAScreen=YES;
@ -2956,7 +3046,7 @@ NSString * const NSWindowDidAnimateNotification=@"NSWindowDidAnimateNotification
return cursorIsSet;
}
-(NSUndoManager *)undoManager {
-(NSUndoManager *)undoManager {
if ([_delegate respondsToSelector:@selector(windowWillReturnUndoManager:)])
return [_delegate windowWillReturnUndoManager:self];
@ -2969,7 +3059,7 @@ NSString * const NSWindowDidAnimateNotification=@"NSWindowDidAnimateNotification
// If the delegate does not implement this method, the NSWindow creates an NSUndoManager for the window and all its views. -- seems like some duplication vs. NSDocument, but oh well..
if (_undoManager == nil){
_undoManager = [[NSUndoManager alloc] init];
[_undoManager setRunLoopModes:[NSArray arrayWithObjects:NSDefaultRunLoopMode, NSEventTrackingRunLoopMode,nil]];
[_undoManager setRunLoopModes:[NSArray arrayWithObjects:NSDefaultRunLoopMode, NSModalPanelRunLoopMode, NSEventTrackingRunLoopMode,nil]];
}
return _undoManager;

File diff suppressed because it is too large Load Diff

View File

@ -54,7 +54,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
-(void)stopWaitCursor;
-(void)startWaitCursor;
-(BOOL)postMSG:(MSG)msg;
-(BOOL)postMSG:(MSG)msg keyboardState:(BYTE *)keyboardState;
-(void)beep;

View File

@ -792,16 +792,18 @@ The values should be upgraded to something which is more generic to implement, p
return keyCode;
}
-(BOOL)postKeyboardMSG:(MSG)msg type:(NSEventType)type location:(NSPoint)location modifierFlags:(unsigned)modifierFlags window:(NSWindow *)window {
-(BOOL)postKeyboardMSG:(MSG)msg type:(NSEventType)type location:(NSPoint)location modifierFlags:(unsigned)modifierFlags window:(NSWindow *)window keyboardState:(BYTE *)keyboardState {
unichar buffer[256],ignoringBuffer[256];
NSString *characters;
NSString *charactersIgnoringModifiers;
BOOL isARepeat=NO;
unsigned short keyCode;
int bufferSize=0,ignoringBufferSize=0;
BYTE keyState[256];
BYTE *keyState=keyboardState;
GetKeyboardState(keyState);
if(keyState==NULL)
return NO;
bufferSize=ToUnicode(msg.wParam,msg.lParam>>16,keyState,buffer,256,0);
keyState[VK_CONTROL]=0x00;
@ -996,11 +998,11 @@ The values should be upgraded to something which is more generic to implement, p
return YES;
}
-(unsigned)currentModifierFlags {
-(unsigned)currentModifierFlagsWithKeyboardState:(BYTE *)keyboardState {
unsigned result=0;
BYTE keyState[256];
BYTE *keyState=keyboardState;
if(!GetKeyboardState(keyState))
if(keyState==NULL)
return result;
if(keyState[VK_LSHIFT]&0x80)
@ -1046,6 +1048,16 @@ The values should be upgraded to something which is more generic to implement, p
return result;
}
-(NSUInteger)currentModifierFlags {
BYTE keyState[256];
BYTE *keyboardState=NULL;
if(GetKeyboardState(keyState))
keyboardState=keyState;
return [self currentModifierFlagsWithKeyboardState:keyboardState];
}
NSArray *CGSOrderedWindowNumbers(){
NSMutableArray *result=[NSMutableArray array];
@ -1083,7 +1095,7 @@ static HWND findWindowForScrollWheel(POINT point){
}
-(BOOL)postMSG:(MSG)msg {
-(BOOL)postMSG:(MSG)msg keyboardState:(BYTE *)keyboardState {
NSEventType type;
HWND windowHandle=msg.hwnd;
id platformWindow;
@ -1144,6 +1156,7 @@ static HWND findWindowForScrollWheel(POINT point){
_lastPosition=msg.lParam;
}
switch(msg.message){
case WM_KEYDOWN:
@ -1222,22 +1235,38 @@ static HWND findWindowForScrollWheel(POINT point){
location.x=deviceLocation.x;
location.y=deviceLocation.y;
// This is used for OpenGL child windows which will interfere will scrollwheel coordinates
if(windowHandle!=[platformWindow windowHandle]){
RECT child={0},parent={0};
// There is no way to get a child's frame inside the parent, you have to get
// them both in screen coordinates and do a delta
// GetClientRect always returns 0,0 for top,left which makes it useless
GetWindowRect(msg.hwnd,&child);
GetWindowRect([platformWindow windowHandle],&parent);
location.x+=child.left-parent.left;
location.y+=child.top-parent.top;
}
[platformWindow adjustEventLocation:&location];
BOOL childWindow=NO;
modifierFlags=[self currentModifierFlags];
if(msg.message==WM_MOUSEWHEEL){
// WM_MOUSEWHEEL coordinates are on screen coordinates, others are in window
RECT frame={0};
GetWindowRect([platformWindow windowHandle],&frame);
location.x=location.x-frame.left;
location.y=location.y-frame.top;
}
else {
childWindow=(msg.hwnd!=[platformWindow windowHandle]);
if(childWindow){
RECT child={0},parent={0};
// There is no way to get a child's frame inside the parent, you have to get
// them both in screen coordinates and do a delta
// GetClientRect always returns 0,0 for top,left which makes it useless
GetWindowRect(msg.hwnd,&child);
GetWindowRect([platformWindow windowHandle],&parent);
location.x+=child.left-parent.left;
location.y+=child.top-parent.top;
}
}
[platformWindow adjustEventLocation:&location childWindow:childWindow];
modifierFlags=[self currentModifierFlagsWithKeyboardState:keyboardState];
switch(type){
case NSLeftMouseDown:
@ -1254,7 +1283,7 @@ static HWND findWindowForScrollWheel(POINT point){
case NSKeyDown:
case NSKeyUp:
case NSFlagsChanged:
return [self postKeyboardMSG:msg type:type location:location modifierFlags:modifierFlags window:window];
return [self postKeyboardMSG:msg type:type location:location modifierFlags:modifierFlags window:window keyboardState:keyboardState];
case NSScrollWheel:
return [self postScrollWheelMSG:msg type:type location:location modifierFlags:modifierFlags window:window];

View File

@ -7,9 +7,11 @@ The above copyright notice and this permission notice shall be included in all c
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#import <Foundation/NSInputSource.h>
#import <windows.h>
@interface Win32EventInputSource : NSInputSource {
// move eventMask and eventQueue here?
}
@end

View File

@ -22,16 +22,22 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
BOOL hadPeriodic=[[Win32Display currentDisplay] containsAndRemovePeriodicEvents];
MSG msg;
if(PeekMessage(&msg,NULL,0,0,PM_REMOVE)){
if(PeekMessage(&msg,NULL,0,0,PM_REMOVE)){
NSAutoreleasePool *pool=[NSAutoreleasePool new];
if(![(Win32Display *)[Win32Display currentDisplay] postMSG:msg]){
BYTE keyState[256];
BYTE *keyboardState=NULL;
if(GetKeyboardState(keyState))
keyboardState=keyState;
if(![(Win32Display *)[Win32Display currentDisplay] postMSG:msg keyboardState:keyboardState]){
Win32Event *cgEvent=[Win32Event eventWithMSG:msg];
NSEvent *event=[[[NSEvent_CoreGraphics alloc] initWithDisplayEvent:cgEvent] autorelease];
[[Win32Display currentDisplay] postEvent:event atStart:NO];
}
[pool release];
return YES;
}

View File

@ -24,14 +24,27 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
BOOL _hasShadow;
CGFloat _alphaValue;
HWND _handle;
HGLRC _hglrc;
GLint _backingTextureId;
BOOL _hasRenderTexture;
BOOL _hasMakeCurrentRead;
BOOL _hasReadback;
BOOL _hasSwapHintRect;
BOOL _reloadBackingTexture;
CGFloat _borderTop,_borderLeft,_borderBottom,_borderRight;
O2Context_gdi *_cgContext;
CGSBackingStoreType _backingType;
O2Context *_backingContext;
CGLContextObj _cglContext;
int _surfaceCount;
void **_surfaces;
int _textureIdCount;
GLint *_textureIds;
O2Surface_DIBSection *_overlayResult;
NSMutableArray *_overlays;
O2Surface_DIBSection *_overlayResult;
int _disableFlushWindow;
NSString *_title;
@ -41,7 +54,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
BOOL _disableDisplay;
unsigned _styleMask;
BOOL _isPanel;
BOOL _isMiniaturized;
id _delegate;
NSMutableDictionary *_deviceDictionary;
@ -76,15 +90,20 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
-(void)deminiaturize;
-(BOOL)isMiniaturized;
-(BOOL)isLayeredWindow;
-(void)flushBuffer;
-(NSPoint)convertPOINTLToBase:(POINTL)point;
-(NSPoint)mouseLocationOutsideOfEventStream;
-(void)adjustEventLocation:(NSPoint *)location;
-(void)adjustEventLocation:(NSPoint *)location childWindow:(BOOL)childWindow;
-(void)sendEvent:(CGEvent *)event;
-(int)WM_SETCURSOR_wParam:(WPARAM)wParam lParam:(LPARAM)lParam;
-(int)WM_APP1_wParam:(WPARAM)wParam lParam:(LPARAM)lParam;
@end
void CGNativeBorderFrameWidthsForStyle(unsigned styleMask,CGFloat *top,CGFloat *left,CGFloat *bottom,CGFloat *right);

File diff suppressed because it is too large Load Diff

View File

@ -29,6 +29,7 @@ GLvoid *opengl_glMapBuffer(GLenum target,GLenum access);
GLboolean opengl_glUnmapBuffer(GLenum target);
const char *opengl_wglGetExtensionsStringARB(HDC hdc);
const char *opengl_wglGetExtensionsStringEXT(HDC hdc);
HPBUFFERARB opengl_wglCreatePbufferARB(HDC hDC,int iPixelFormat,int iWidth,int iHeight,const int *piAttribList);
@ -46,11 +47,6 @@ BOOL opengl_wglGetPixelFormatAttribfvARB(HDC hdc,int iPixelFormat,int iLayerPlan
BOOL opengl_wglChoosePixelFormatARB(HDC hdc,const int *piAttribIList,const FLOAT *pfAttribFList,UINT nMaxFormats,int *piFormats,UINT *nNumFormats);
BOOL opengl_wglBindTexImageARB(HPBUFFERARB hPbuffer, int iBuffer);
BOOL opengl_wglReleaseTexImageARB(HPBUFFERARB hPbuffer, int iBuffer);
BOOL opengl_wglSetPbufferAttribARB(HPBUFFERARB hPbuffer, const int *piAttribList);
void opengl_glGenFramebuffersEXT (GLsizei, GLuint *);
void opengl_glDeleteFramebuffersEXT (GLsizei, const GLuint *);
void opengl_glBindFramebufferEXT (GLenum, GLuint);
@ -68,3 +64,11 @@ void opengl_glFramebufferTexture2DEXT(GLenum target, GLenum attachmentPoint,GLen
BOOL opengl_wglMakeContextCurrentARB(HDC hDrawDC,HDC hReadDC,HGLRC hglrc);
BOOL opengl_wglBindTexImageARB(HPBUFFERARB hPbuffer,int iBuffer);
BOOL opengl_wglReleaseTexImageARB(HPBUFFERARB hPbuffer,int iBuffer);
BOOL opengl_wglSetPbufferAttribARB(HPBUFFERARB hPbuffer,const int *piAttribList);
BOOL opengl_wglSwapIntervalEXT (int interval);
void opengl_glAddSwapHintRectWIN(GLint x,GLint y,GLsizei width,GLsizei height);

View File

@ -125,6 +125,18 @@ const char *opengl_wglGetExtensionsStringARB(HDC hdc) {
return function(hdc);
}
const char *opengl_wglGetExtensionsStringEXT(HDC hdc) {
APIENTRY typeof(opengl_wglGetExtensionsStringEXT) *function=(typeof(function))wglGetProcAddress("wglGetExtensionsStringEXT");
if(function==NULL){
if(NSDebugEnabled)
NSLog(@"wglGetProcAddress(wglGetExtensionsStringEXT) failed");
return NULL;
}
return function(hdc);
}
HPBUFFERARB opengl_wglCreatePbufferARB(HDC hDC,int iPixelFormat,int iWidth,int iHeight,const int *piAttribList) {
APIENTRY typeof(opengl_wglCreatePbufferARB) *function=(typeof(function))wglGetProcAddress("wglCreatePbufferARB");
@ -342,15 +354,88 @@ void opengl_glFramebufferTexture2DEXT(GLenum target, GLenum attachmentPoint,GLen
function(target,attachmentPoint,textureTarget,textureId,level);
}
HGLRC opengl_wglCreateContextAttribsARB(HDC hDC, HGLRC hshareContext,const int *attribList) {
APIENTRY typeof(opengl_wglCreateContextAttribsARB ) *function=(typeof(function))wglGetProcAddress("wglCreateContextAttribsARB");
if(function==NULL){
// if(NSDebugEnabled)
NSLog(@"wglGetProcAddress(wglCreateContextAttribsARB ) failed");
return NO;
}
return function(hDC,hshareContext,attribList);
}
BOOL opengl_wglMakeContextCurrentARB(HDC hDrawDC,HDC hReadDC,HGLRC hglrc) {
APIENTRY typeof(opengl_wglMakeContextCurrentARB ) *function=(typeof(function))wglGetProcAddress("wglMakeContextCurrentARB");
if(function==NULL){
if(NSDebugEnabled)
// if(NSDebugEnabled)
NSLog(@"wglGetProcAddress(wglMakeContextCurrentARB ) failed");
return NO;
}
return function(hDrawDC,hReadDC,hglrc);
}
BOOL opengl_wglBindTexImageARB(HPBUFFERARB hPbuffer,int iBuffer) {
APIENTRY typeof(opengl_wglBindTexImageARB) *function=(typeof(function))wglGetProcAddress("wglBindTexImageARB");
if(function==NULL){
// if(NSDebugEnabled)
NSLog(@"wglGetProcAddress(wglBindTexImageARB) failed");
return NO;
}
return function(hPbuffer,iBuffer);
}
BOOL opengl_wglReleaseTexImageARB(HPBUFFERARB hPbuffer,int iBuffer) {
APIENTRY typeof(opengl_wglReleaseTexImageARB) *function=(typeof(function))wglGetProcAddress("wglReleaseTexImageARB");
if(function==NULL){
// if(NSDebugEnabled)
NSLog(@"wglGetProcAddress(wglReleaseTexImageARB) failed");
return NO;
}
return function(hPbuffer,iBuffer);
}
BOOL opengl_wglSetPbufferAttribARB(HPBUFFERARB hPbuffer,const int *piAttribList) {
APIENTRY typeof(opengl_wglSetPbufferAttribARB) *function=(typeof(function))wglGetProcAddress("wglSetPbufferAttribARB");
if(function==NULL){
// if(NSDebugEnabled)
NSLog(@"wglGetProcAddress(wglSetPbufferAttribARB) failed");
return NO;
}
return function(hPbuffer,piAttribList);
}
BOOL opengl_wglSwapIntervalEXT (int interval) {
APIENTRY typeof(opengl_wglSwapIntervalEXT) *function=(typeof(function))wglGetProcAddress("wglSwapIntervalEXT");
if(function==NULL){
NSLog(@"wglGetProcAddress(wglSwapIntervalEXT) failed");
return NO;
}
return function(interval);
}
void opengl_glAddSwapHintRectWIN(GLint x,GLint y,GLsizei width,GLsizei height) {
WINAPI typeof(opengl_glAddSwapHintRectWIN) *function=(typeof(function))wglGetProcAddress("glAddSwapHintRectWIN");
if(function==NULL){
NSLog(@"wglGetProcAddress(glAddSwapHintRectWIN) failed");
return ;
}
return function(x,y,width,height);
}

View File

@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 42;
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
@ -30,14 +30,6 @@
outputFiles = (
);
};
FE01AAEA0C5D9BF900AEA51A /* PBXBuildRule */ = {
isa = PBXBuildRule;
compilerSpec = org.cocotron.1.0.windows.i386.gcc.default;
fileType = sourcecode.c;
isEditable = 1;
outputFiles = (
);
};
FE5A88A110C6F34A005E348A /* PBXBuildRule */ = {
isa = PBXBuildRule;
compilerSpec = org.cocotron.1.0.freebsd.i386.gcc.default;
@ -494,7 +486,6 @@
FE01AAE90C5D9BF900AEA51A /* Frameworks */,
);
buildRules = (
FE01AAEA0C5D9BF900AEA51A /* PBXBuildRule */,
);
dependencies = (
FEC11BB80FD4B88800082282 /* PBXTargetDependency */,
@ -532,8 +523,11 @@
/* Begin PBXProject section */
0867D690FE84028FC02AAC07 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0420;
};
buildConfigurationList = 1DEB91B108733DA50010E9CD /* Build configuration list for PBXProject "ApplicationServices" */;
compatibilityVersion = "Xcode 2.4";
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
@ -810,7 +804,6 @@
"-D__LITTLE_ENDIAN__",
);
OTHER_LDFLAGS = "";
PREBINDING = NO;
PRODUCT_NAME = ApplicationServices;
SYMROOT = build/Linux/i386;
};
@ -832,7 +825,6 @@
"-D__LITTLE_ENDIAN__",
);
OTHER_LDFLAGS = "";
PREBINDING = NO;
PRODUCT_NAME = ApplicationServices;
SYMROOT = build/Darwin/i386;
};
@ -850,7 +842,6 @@
"-DAPPLICATIONSERVICES_INSIDE_BUILD",
"-D__LITTLE_ENDIAN__",
);
PREBINDING = NO;
PRODUCT_NAME = ApplicationServices;
};
name = Release;
@ -872,7 +863,6 @@
"-D__LITTLE_ENDIAN__",
);
OTHER_LDFLAGS = "";
PREBINDING = NO;
PRODUCT_NAME = ApplicationServices;
SYMROOT = build/FreeBSD/i386;
};
@ -896,7 +886,6 @@
"-DAPPLICATIONSERVICES_INSIDE_BUILD",
"-D__LITTLE_ENDIAN__",
);
PREBINDING = NO;
PRODUCT_NAME = ApplicationServices;
};
name = Debug;
@ -918,7 +907,6 @@
"-D__LITTLE_ENDIAN__",
);
OTHER_LDFLAGS = "";
PREBINDING = NO;
PRODUCT_NAME = ApplicationServices;
SYMROOT = build/Linux/i386;
};
@ -940,7 +928,6 @@
"-D__LITTLE_ENDIAN__",
);
OTHER_LDFLAGS = "";
PREBINDING = NO;
PRODUCT_NAME = ApplicationServices;
SYMROOT = build/Darwin/i386;
};
@ -963,7 +950,6 @@
"-D__LITTLE_ENDIAN__",
);
OTHER_LDFLAGS = "";
PREBINDING = NO;
PRODUCT_NAME = ApplicationServices;
SYMROOT = build/FreeBSD/i386;
};

View File

@ -6,12 +6,12 @@
#import <Foundation/NSHandleMonitor_win32.h>
#undef WINVER
#define WINVER 0x501
#import <windows.h>
#import <winsock2.h>
#import <ws2tcpip.h>
#include <windows.h>
#include <winsock2.h>
#include <ws2tcpip.h>
#include <process.h>
#endif
#import <pthread.h>
#import <process.h>
#include <pthread.h>
#if defined(WIN32) || defined(LINUX)
#define MAXHOSTNAMELEN 512
@ -66,23 +66,23 @@ static int preXP_getaddrinfo(const char *host,const char *service,const struct a
if((hp=gethostbyname(host))==NULL)
return EAI_FAIL;
switch(hp->h_addrtype){
case AF_INET:;
uint32_t **addr_list;
addr_list=(uint32_t **)hp->h_addr_list;
for(;*addr_list!=NULL;addr_list++){
struct addrinfo *node=NSZoneCalloc(NULL,1,sizeof(struct addrinfo));
struct sockaddr_in *ipv4=NSZoneCalloc(NULL,1,sizeof(struct sockaddr_in));
node->ai_family=AF_INET;
node->ai_addrlen=sizeof(struct sockaddr_in);
node->ai_addr=(struct sockaddr *)ipv4;
ipv4->sin_family=AF_INET;
ipv4->sin_addr.s_addr=**addr_list;
if(list==NULL)
list=current=node;
else {
@ -92,14 +92,14 @@ static int preXP_getaddrinfo(const char *host,const char *service,const struct a
}
break;
}
*result=list;
return 0;
}
static void preXP_freeaddrinfo(struct addrinfo *info){
struct addrinfo *next;
for(;info!=NULL;info=next){
next=info->ai_next;
NSZoneFree(NULL,info->ai_addr);
@ -133,10 +133,10 @@ static void any_freeaddrinfo(struct addrinfo *info){
static struct addrinfo *blockingRequest(CFHostRequest *request){
struct addrinfo *result;
if(any_getaddrinfo(request->_name,NULL,NULL,&result)!=0)
return NULL;
return result;
}
@ -149,20 +149,20 @@ static unsigned addressResolverThread(void *arg){
EnterCriticalSection(&(info->queueLock));
queueEmpty=(info->queueCount==0)?TRUE:FALSE;
LeaveCriticalSection(&(info->queueLock));
if(queueEmpty){
NSCooperativeThreadBlocking();
WaitForSingleObject(info->queueEvent,INFINITE);
NSCooperativeThreadWaiting();
}
CFHostRequest *request=NULL;
EnterCriticalSection(&(info->queueLock));
while(info->queueCount>0 && request==NULL){
request=info->queue[0];
info->queueCount--;
int i;
@ -171,14 +171,14 @@ static unsigned addressResolverThread(void *arg){
}
if(request!=NULL)
request->_state=CFHostRequestInProgress;
LeaveCriticalSection(&(info->queueLock));
if(request!=NULL){
if(request!=NULL){
struct addrinfo *addressList=blockingRequest(request);
HANDLE event=NULL;
EnterCriticalSection(&(info->queueLock));
request->_addressList=addressList;
@ -188,7 +188,7 @@ static unsigned addressResolverThread(void *arg){
request=NULL;
}
LeaveCriticalSection(&(info->queueLock));
if(request!=NULL){
if(request->_addressList!=NULL)
any_freeaddrinfo(request->_addressList);
@ -202,7 +202,7 @@ static unsigned addressResolverThread(void *arg){
}
}
return 0;
}
-(void)handleMonitorIndicatesSignaled:(NSHandleMonitor_win32 *)monitor {
@ -211,14 +211,14 @@ static unsigned addressResolverThread(void *arg){
// cancelled
return;
}
CloseHandle(_request->_event);
_request->_event=NULL;
[_monitor invalidate];
[_monitor setDelegate:nil];
[_monitor autorelease];
_monitor=nil;
if(_addressing!=NULL){
CFRelease(_addressing);
_addressing=NULL;
@ -229,13 +229,13 @@ static unsigned addressResolverThread(void *arg){
}
else {
int i;
_addressing=CFArrayCreateMutable(NULL,0,&kCFTypeArrayCallBacks);
struct addrinfo *check=_request->_addressList,*next;
for(;check!=NULL;check=next){
next=check->ai_next;
CFDataRef data=CFDataCreate(NULL,(void *)check->ai_addr,check->ai_addrlen);
CFArrayAppendValue(_addressing,data);
@ -247,7 +247,7 @@ static unsigned addressResolverThread(void *arg){
NSZoneFree(NULL,_request->_name);
NSZoneFree(NULL,_request);
_request=NULL;
if(_callback!=NULL)
_callback(self,kCFHostAddresses,NULL,_context.info);
}
@ -260,23 +260,23 @@ static CFAddressResolverThreadInfo *asyncInfo;
static CFAddressResolverThreadInfo *startResolverThreadIfNeeded(){
pthread_mutex_lock(&asyncCreationLock);
if(asyncInfo==NULL){
asyncInfo=NSZoneMalloc(NULL,sizeof(CFAddressResolverThreadInfo));
InitializeCriticalSection(&(asyncInfo->queueLock));
asyncInfo->queueEvent=CreateEvent(NULL,FALSE,FALSE,NULL);
asyncInfo->queueCapacity=1;
asyncInfo->queueCount=0;
asyncInfo->queue=NSZoneMalloc(NULL,sizeof(CFHostRequest *)*asyncInfo->queueCapacity);
unsigned threadAddr;
_beginthreadex(NULL,0,addressResolverThread,asyncInfo,0,&threadAddr);
}
pthread_mutex_unlock(&asyncCreationLock);
return asyncInfo;
}
@ -307,7 +307,7 @@ static void queueHostToAddressResolver(CFHostRef host){
}
info->queue[info->queueCount++]=host->_request;
LeaveCriticalSection(&(info->queueLock));
SetEvent(info->queueEvent);
}
}
@ -316,24 +316,24 @@ static void cancelHostInAddressResolverIfNeeded(CFHostRef self){
if(self->_request==NULL)
return;
if(SYNCHRONOUS){
}
else {
CFAddressResolverThreadInfo *info;
if((info=asyncInfo)==NULL)
return;
EnterCriticalSection(&(info->queueLock));
if(self->_request->_state==CFHostRequestInProgress){
self->_request->_state=CFHostRequestDeallocate;
self->_request=NULL;
}
else {
int i;
for(i=0;i<info->queueCount;i++)
if(info->queue[i]==self->_request){
info->queueCount--;
@ -342,9 +342,9 @@ static void cancelHostInAddressResolverIfNeeded(CFHostRef self){
break;
}
}
LeaveCriticalSection(&(info->queueLock));
if(self->_request!=NULL){
NSZoneFree(NULL,self->_request->_name);
NSZoneFree(NULL,self->_request);
@ -379,7 +379,7 @@ CFHostRef CFHostCreateWithName(CFAllocatorRef allocator,CFStringRef name) {
CFHostRef result=[__CFHost allocWithZone:NULL];
result->_name=CFStringCreateCopy(allocator,name);
return result;
}
@ -391,7 +391,7 @@ CFHostRef CFHostCreateWithName(CFAllocatorRef allocator,CFStringRef name) {
#ifdef WINDOWS
if(self->_event!=NULL)
CloseHandle(self->_event);
[self->_monitor setDelegate:nil];
[self->_monitor invalidate];
[self->_monitor release];
@ -435,23 +435,25 @@ Boolean CFHostSetClient(CFHostRef self,CFHostClientCallBack callback,CFHostCl
if(self->_context.info!=NULL && self->_context.retain!=NULL)
self->_context.info=(void *)self->_context.retain(self->_context.info);
}
return TRUE;
}
static void CFHostCreateEventIfNeeded(CFHostRef self){
#ifdef WINDOWS
if(self->_event==NULL){
self->_event=CreateEvent(NULL,FALSE,FALSE,NULL);
self->_monitor=[[NSHandleMonitor_win32 handleMonitorWithHandle:self->_event] retain];
[self->_monitor setDelegate:self];
[self->_monitor setCurrentActivity:Win32HandleSignaled];
}
#endif
}
Boolean CFHostStartInfoResolution(CFHostRef self,CFHostInfoType infoType,CFStreamError *streamError) {
switch(infoType){
case kCFHostAddresses:
if(self->_hasResolvedAddressing){
NSLog(@"CFHostStartInfoResolution, addressing already resolved");
@ -470,13 +472,15 @@ Boolean CFHostStartInfoResolution(CFHostRef self,CFHostInfoType infoType,CFStrea
NSZoneFree(NULL,cStringName);
return FALSE;
}
self->_request=NSZoneMalloc(NULL,sizeof(CFHostRequest));
self->_request->_state=CFHostRequestInQueue;
self->_request->_name=cStringName;
self->_request->_addressList=NULL;
CFHostCreateEventIfNeeded(self);
#ifdef WINDOWS
self->_request->_event=self->_event;
#endif
queueHostToAddressResolver(self);
return TRUE;
@ -485,15 +489,15 @@ Boolean CFHostStartInfoResolution(CFHostRef self,CFHostInfoType infoType,CFStrea
NSUnimplementedFunction();
return FALSE;
}
case kCFHostNames:
NSUnimplementedFunction();
return FALSE;
case kCFHostReachability:
NSUnimplementedFunction();
return FALSE;
default:
[NSException raise:NSInvalidArgumentException format:@"CFHostStartInfoResolution CFHostInfoType is not valid (%d)",infoType];
return FALSE;
@ -502,19 +506,19 @@ Boolean CFHostStartInfoResolution(CFHostRef self,CFHostInfoType infoType,CFStrea
void CFHostCancelInfoResolution(CFHostRef self,CFHostInfoType infoType) {
switch(infoType){
case kCFHostAddresses:
cancelHostInAddressResolverIfNeeded(self);
break;
case kCFHostNames:
NSUnimplementedFunction();
break;
case kCFHostReachability:
NSUnimplementedFunction();
break;
default:
[NSException raise:NSInvalidArgumentException format:@"CFHostCancelInfoResolution CFHostInfoType is not valid (%d)",infoType];
break;
@ -526,14 +530,18 @@ void CFHostScheduleWithRunLoop(CFHostRef self,CFRunLoopRef runLoop,CFStringRef m
NSUnimplementedFunction();
CFHostCreateEventIfNeeded(self);
#ifdef WINDOWS
[(NSRunLoop *)runLoop addInputSource:self->_monitor forMode:(NSString *)mode];
#endif
}
void CFHostUnscheduleFromRunLoop(CFHostRef self,CFRunLoopRef runLoop,CFStringRef mode) {
if(runLoop!=CFRunLoopGetCurrent())
NSUnimplementedFunction();
#ifdef WINDOWS
[(NSRunLoop *)runLoop removeInputSource:self->_monitor forMode:(NSString *)mode];
#endif
}
@end

View File

@ -30,14 +30,6 @@
/* End PBXBuildFile section */
/* Begin PBXBuildRule section */
FE74338110A899DC004CDF00 /* PBXBuildRule */ = {
isa = PBXBuildRule;
compilerSpec = org.cocotron.1.0.windows.i386.gcc.default;
fileType = sourcecode.c;
isEditable = 1;
outputFiles = (
);
};
FE84930B119AF77F00E252CC /* PBXBuildRule */ = {
isa = PBXBuildRule;
compilerSpec = org.cocotron.1.0.freebsd.i386.gcc.default;
@ -241,7 +233,6 @@
8DC2EF500486A6940098B216 /* Headers */,
);
buildRules = (
FE74338110A899DC004CDF00 /* PBXBuildRule */,
);
dependencies = (
);
@ -306,6 +297,9 @@
/* Begin PBXProject section */
0867D690FE84028FC02AAC07 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0420;
};
buildConfigurationList = 1DEB91B108733DA50010E9CD /* Build configuration list for PBXProject "CFNetwork" */;
compatibilityVersion = "Xcode 3.1";
developmentRegion = English;

View File

@ -3,7 +3,7 @@
#import <Foundation/NSData.h>
#import <Foundation/NSRaiseException.h>
#import <pthread.h>
#include <pthread.h>
#import <openssl/err.h>
@implementation CFSSLHandler(openssl)

View File

@ -12,17 +12,6 @@
FE5C8314121D81470063E96F /* CFSSLHandler_openssl.m in Sources */ = {isa = PBXBuildFile; fileRef = FE5C8313121D81470063E96F /* CFSSLHandler_openssl.m */; };
/* End PBXBuildFile section */
/* Begin PBXBuildRule section */
FE5C82FA121D67BB0063E96F /* PBXBuildRule */ = {
isa = PBXBuildRule;
compilerSpec = org.cocotron.1.0.windows.i386.gcc.default;
fileType = sourcecode.c;
isEditable = 1;
outputFiles = (
);
};
/* End PBXBuildRule section */
/* Begin PBXContainerItemProxy section */
FE0513B6121E05F70097BA92 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
@ -223,7 +212,6 @@
8D576313048677EA00EA77CD /* Frameworks */,
);
buildRules = (
FE5C82FA121D67BB0063E96F /* PBXBuildRule */,
);
dependencies = (
FE0513C9121E05FD0097BA92 /* PBXTargetDependency */,

View File

@ -12,17 +12,6 @@
FE43057611E3879800EBDD56 /* Carbon.h in Headers */ = {isa = PBXBuildFile; fileRef = FE43057511E3879800EBDD56 /* Carbon.h */; settings = {ATTRIBUTES = (Public, ); }; };
/* End PBXBuildFile section */
/* Begin PBXBuildRule section */
FE43056011E3876B00EBDD56 /* PBXBuildRule */ = {
isa = PBXBuildRule;
compilerSpec = org.cocotron.1.0.windows.i386.gcc.default;
fileType = sourcecode.c;
isEditable = 1;
outputFiles = (
);
};
/* End PBXBuildRule section */
/* Begin PBXFileReference section */
0867D69BFE84028FC02AAC07 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
0867D6A5FE840307C02AAC07 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
@ -182,7 +171,6 @@
8DC2EF560486A6940098B216 /* Frameworks */,
);
buildRules = (
FE43056011E3876B00EBDD56 /* PBXBuildRule */,
);
dependencies = (
);

View File

@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 42;
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
@ -26,14 +26,6 @@
/* End PBXBuildFile section */
/* Begin PBXBuildRule section */
FE01AB1E0C5D9C3400AEA51A /* PBXBuildRule */ = {
isa = PBXBuildRule;
compilerSpec = org.cocotron.1.0.windows.i386.gcc.default;
fileType = sourcecode.c;
isEditable = 1;
outputFiles = (
);
};
FE5A873B10C6F1E8005E348A /* PBXBuildRule */ = {
isa = PBXBuildRule;
compilerSpec = org.cocotron.1.0.freebsd.i386.gcc.default;
@ -445,7 +437,6 @@
FE01AB1B0C5D9C3400AEA51A /* Frameworks */,
);
buildRules = (
FE01AB1E0C5D9C3400AEA51A /* PBXBuildRule */,
);
dependencies = (
FEF80ABE0C5D9F3000FF7CA5 /* PBXTargetDependency */,
@ -505,8 +496,11 @@
/* Begin PBXProject section */
0867D690FE84028FC02AAC07 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0420;
};
buildConfigurationList = 1DEB91B108733DA50010E9CD /* Build configuration list for PBXProject "Cocoa" */;
compatibilityVersion = "Xcode 2.4";
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
@ -744,7 +738,6 @@
"-DCOCOA_INSIDE_BUILD",
"-D__LITTLE_ENDIAN__",
);
PREBINDING = NO;
PRODUCT_NAME = Cocoa;
};
name = Debug;
@ -766,7 +759,6 @@
"-DCOCOA_INSIDE_BUILD",
"-D__LITTLE_ENDIAN__",
);
PREBINDING = NO;
PRODUCT_NAME = Cocoa;
SYMROOT = build/Darwin/i386;
};
@ -789,7 +781,6 @@
"-DCOCOA_INSIDE_BUILD",
"-D__LITTLE_ENDIAN__",
);
PREBINDING = NO;
PRODUCT_NAME = Cocoa;
SYMROOT = build/Darwin/i386;
};
@ -807,7 +798,6 @@
"-DCOCOA_INSIDE_BUILD",
"-D__LITTLE_ENDIAN__",
);
PREBINDING = NO;
PRODUCT_NAME = Cocoa;
};
name = Release;
@ -845,7 +835,6 @@
"-lfreetype",
"-lfontconfig",
);
PREBINDING = NO;
PRODUCT_NAME = Cocoa;
SYMROOT = build/FreeBSD/i386;
};
@ -869,7 +858,6 @@
"-DCOCOA_INSIDE_BUILD",
"-D__LITTLE_ENDIAN__",
);
PREBINDING = NO;
PRODUCT_NAME = Cocoa;
SYMROOT = build/FreeBSD/i386;
};
@ -893,7 +881,6 @@
"-DCOCOA_INSIDE_BUILD",
"-D__LITTLE_ENDIAN__",
);
PREBINDING = NO;
PRODUCT_NAME = Cocoa;
SYMROOT = build/Linux/i386;
};
@ -917,7 +904,6 @@
"-DCOCOA_INSIDE_BUILD",
"-D__LITTLE_ENDIAN__",
);
PREBINDING = NO;
PRODUCT_NAME = Cocoa;
SYMROOT = build/Linux/i386;
};

View File

@ -19,17 +19,6 @@
FEFD325B1434B22F00C14B08 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0867D69BFE84028FC02AAC07 /* Foundation.framework */; };
/* End PBXBuildFile section */
/* Begin PBXBuildRule section */
FE4301F311E2584800EBDD56 /* PBXBuildRule */ = {
isa = PBXBuildRule;
compilerSpec = org.cocotron.1.0.windows.i386.gcc.default;
fileType = sourcecode.c;
isEditable = 1;
outputFiles = (
);
};
/* End PBXBuildRule section */
/* Begin PBXFileReference section */
0867D69BFE84028FC02AAC07 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
089C1667FE841158C02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
@ -192,7 +181,6 @@
8DC2EF560486A6940098B216 /* Frameworks */,
);
buildRules = (
FE4301F311E2584800EBDD56 /* PBXBuildRule */,
);
dependencies = (
);

View File

@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 42;
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
@ -59,17 +59,6 @@
FEDE52F61209C3AE003D3EF1 /* NSEntityDescription-Private.h in Headers */ = {isa = PBXBuildFile; fileRef = FEDE52F51209C3AE003D3EF1 /* NSEntityDescription-Private.h */; };
/* End PBXBuildFile section */
/* Begin PBXBuildRule section */
FED50C130D52BED300195B38 /* PBXBuildRule */ = {
isa = PBXBuildRule;
compilerSpec = org.cocotron.1.0.windows.i386.gcc.default;
fileType = sourcecode.c;
isEditable = 1;
outputFiles = (
);
};
/* End PBXBuildRule section */
/* Begin PBXContainerItemProxy section */
FE39C6841203D5F800A80A71 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
@ -434,7 +423,6 @@
8DC2EF560486A6940098B216 /* Frameworks */,
);
buildRules = (
FED50C130D52BED300195B38 /* PBXBuildRule */,
);
dependencies = (
FE39C6851203D5F800A80A71 /* PBXTargetDependency */,
@ -450,8 +438,11 @@
/* Begin PBXProject section */
0867D690FE84028FC02AAC07 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0420;
};
buildConfigurationList = 1DEB91B108733DA50010E9CD /* Build configuration list for PBXProject "CoreData" */;
compatibilityVersion = "Xcode 2.4";
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
@ -623,7 +614,6 @@
"-DCOREDATA_INSIDE_BUILD",
"-D__LITTLE_ENDIAN__",
);
PREBINDING = NO;
PRODUCT_NAME = CoreData;
};
name = Debug;
@ -647,7 +637,6 @@
"-DCOREDATA_INSIDE_BUILD",
"-D__LITTLE_ENDIAN__",
);
PREBINDING = NO;
PRODUCT_NAME = CoreData;
};
name = Release;

View File

@ -65,86 +65,69 @@ id keyObjectForSelector(SEL selector){
}
static struct objc_method_list *appendMethodToList(struct objc_method_list *list,NSString *selectorName,IMP imp,const char *types,SEL *selectorp){
if(list==NULL){
list=malloc(sizeof(struct objc_method_list)+sizeof(struct objc_method));
list->method_count=1;
}
else {
list->method_count++;
list=realloc(list,sizeof(struct objc_method_list)+list->method_count*sizeof(struct objc_method));
}
SEL selector=NSSelectorFromString(selectorName);
list->method_list[list->method_count-1].method_name=selector;
list->method_list[list->method_count-1].method_types=(char *)types;
list->method_list[list->method_count-1].method_imp=imp;
*selectorp=selector;
return list;
static void appendMethodToList(Class class,NSString *selectorName,IMP imp,const char *types,SEL *selectorp){
SEL selector=NSSelectorFromString(selectorName);
class_addMethod(class, selector, imp, types);
*selectorp=selector;
}
-initWithCoder:(NSCoder *)coder {
if(![coder allowsKeyedCoding]) {
[NSException raise: NSInvalidArgumentException format: @"%@ can not initWithCoder:%@", isa, [coder class]];
return nil;
}
_className = [[coder decodeObjectForKey: @"NSClassNameForEntity"] retain];
_name = [[coder decodeObjectForKey: @"NSEntityName"] retain];
_model = [coder decodeObjectForKey: @"NSManagedObjectModel"];
_properties = [[coder decodeObjectForKey: @"NSProperties"] retain];
_subentities = [[coder decodeObjectForKey: @"NSSubentities"] retain];
_superentity = [[coder decodeObjectForKey: @"NSSuperentity"] retain];
_userInfo = [[coder decodeObjectForKey: @"NSUserInfo"] retain];
_versionHashModifier= [[coder decodeObjectForKey: @"NSVersionHashModifier"] retain];
_selectorPropertyMap = [[NSMutableDictionary alloc] init];
_hasBeenInstantiated = NO;
if(_className) {
Class class=NSClassFromString(_className);
struct objc_method_list *methodList=NULL;
for(NSPropertyDescription *property in [_properties allValues]) {
NSString *propertyName=[property name];
NSString *upperName=[[[propertyName substringToIndex:1] uppercaseString] stringByAppendingString:[propertyName substringFromIndex: 1]];
NSString *selectorName;
SEL selector;
methodList=appendMethodToList(methodList,propertyName,(IMP) getValue,"@@:",&selector);
[_selectorPropertyMap setObject:property forKey:keyObjectForSelector(selector)];
methodList=appendMethodToList(methodList,[NSString stringWithFormat: @"set%@:",upperName],(IMP) setValue,"v@:@",&selector);
[_selectorPropertyMap setObject:property forKey:keyObjectForSelector(selector)];
if([property isKindOfClass: [NSRelationshipDescription class]]) {
NSRelationshipDescription *relationship= (NSRelationshipDescription *) property;
if([relationship isToMany]){
methodList=appendMethodToList(methodList,[NSString stringWithFormat: @"add%@Object:",upperName],(IMP)addObject,"v@:@",&selector);
[_selectorPropertyMap setObject:property forKey:keyObjectForSelector(selector)];
methodList=appendMethodToList(methodList,[NSString stringWithFormat: @"remove%@Object:",upperName],(IMP)removeObject,"v@:@",&selector);
[_selectorPropertyMap setObject:property forKey:keyObjectForSelector(selector)];
methodList=appendMethodToList(methodList,[NSString stringWithFormat: @"add%@:",upperName],(IMP)addObjectSet,"v@:@",&selector);
[_selectorPropertyMap setObject:property forKey:keyObjectForSelector(selector)];
methodList=appendMethodToList(methodList,[NSString stringWithFormat: @"remove%@:",upperName],(IMP)removeObjectSet,"v@:@",&selector);
[_selectorPropertyMap setObject:property forKey:keyObjectForSelector(selector)];
}
}
if(![coder allowsKeyedCoding]) {
[NSException raise: NSInvalidArgumentException format: @"%@ can not initWithCoder:%@", isa, [coder class]];
return nil;
}
if(methodList!=NULL)
class_addMethods(class,methodList);
}
return self;
_className = [[coder decodeObjectForKey: @"NSClassNameForEntity"] retain];
_name = [[coder decodeObjectForKey: @"NSEntityName"] retain];
_model = [coder decodeObjectForKey: @"NSManagedObjectModel"];
_properties = [[coder decodeObjectForKey: @"NSProperties"] retain];
_subentities = [[coder decodeObjectForKey: @"NSSubentities"] retain];
_superentity = [[coder decodeObjectForKey: @"NSSuperentity"] retain];
_userInfo = [[coder decodeObjectForKey: @"NSUserInfo"] retain];
_versionHashModifier= [[coder decodeObjectForKey: @"NSVersionHashModifier"] retain];
_selectorPropertyMap = [[NSMutableDictionary alloc] init];
_hasBeenInstantiated = NO;
if(_className) {
Class class=NSClassFromString(_className);
for(NSPropertyDescription *property in [_properties allValues]) {
NSString *propertyName=[property name];
NSString *upperName=[[[propertyName substringToIndex:1] uppercaseString] stringByAppendingString:[propertyName substringFromIndex: 1]];
NSString *selectorName;
SEL selector;
appendMethodToList(class,propertyName,(IMP) getValue,"@@:",&selector);
[_selectorPropertyMap setObject:property forKey:keyObjectForSelector(selector)];
appendMethodToList(class,[NSString stringWithFormat: @"set%@:",upperName],(IMP) setValue,"v@:@",&selector);
[_selectorPropertyMap setObject:property forKey:keyObjectForSelector(selector)];
if([property isKindOfClass: [NSRelationshipDescription class]]) {
NSRelationshipDescription *relationship= (NSRelationshipDescription *) property;
if([relationship isToMany]){
appendMethodToList(class,[NSString stringWithFormat: @"add%@Object:",upperName],(IMP)addObject,"v@:@",&selector);
[_selectorPropertyMap setObject:property forKey:keyObjectForSelector(selector)];
appendMethodToList(class,[NSString stringWithFormat: @"remove%@Object:",upperName],(IMP)removeObject,"v@:@",&selector);
[_selectorPropertyMap setObject:property forKey:keyObjectForSelector(selector)];
appendMethodToList(class,[NSString stringWithFormat: @"add%@:",upperName],(IMP)addObjectSet,"v@:@",&selector);
[_selectorPropertyMap setObject:property forKey:keyObjectForSelector(selector)];
appendMethodToList(class,[NSString stringWithFormat: @"remove%@:",upperName],(IMP)removeObjectSet,"v@:@",&selector);
[_selectorPropertyMap setObject:property forKey:keyObjectForSelector(selector)];
}
}
}
}
return self;
}

View File

@ -47,12 +47,12 @@ static Boolean defaultEqual(const void *value,const void *other) {
-(void)dealloc {
CFIndex count=_count;
while(--count>=0)
_callBacks.release(NULL,_values[count]);
NSZoneFree(NULL,_values);
NSDeallocateObject(self);
return;
[super dealloc];
@ -127,32 +127,32 @@ static Boolean defaultEqual(const void *value,const void *other) {
-(BOOL)isEqualToArray:(NSArray *)array {
NSInteger i,count;
if(self==array)
return YES;
count=[self count];
if(count!=[array count])
return NO;
for(i=0;i<count;i++)
if (!_callBacks.equal([self objectAtIndex:i], [array objectAtIndex:i]))
return NO;
return YES;
}
-(NSUInteger)indexOfObject:object inRange:(NSRange)range {
NSInteger i,count=[self count];
if(NSMaxRange(range)>count)
NSRaiseException(NSRangeException,self,_cmd,@"range %@ beyond count %d",
NSStringFromRange(range),[self count]);
for(i=range.location;i<range.length;i++)
if (_callBacks.equal([self objectAtIndex:i], object))
return i;
return NSNotFound;
}
@ -190,7 +190,7 @@ CFArrayRef CFArrayCreate(CFAllocatorRef allocator,const void **values,CFIndex co
}
CFArrayRef CFArrayCreateCopy(CFAllocatorRef allocator,CFArrayRef self) {
return (CFArrayRef)[(id) self copy];
return (CFArrayRef)[(id) self copy];
}
@ -211,22 +211,24 @@ Boolean CFArrayContainsValue(CFArrayRef self,CFRange range,const void *value) {
return [(NSArray*)self indexOfObject:(id)value inRange:inrange] != NSNotFound;
}
CFIndex CFArrayGetFirstIndexOfValue(CFArrayRef self,CFRange range,const void *value) {
CFIndex CFArrayGetFirstIndexOfValue(CFArrayRef self, CFRange range, const void *value)
{
int i;
for(i=range.location;i<range.location+range.length;i++)
{
if([[(NSArray*)self objectAtIndex:i]isEqual:(id)value]) return i;
for (i = range.location; i < range.location + range.length; i++) {
if ([[(NSArray*)self objectAtIndex:i] isEqual:(id)value]) {
return i;
}
}
return NSNotFound;
}
CFIndex CFArrayGetLastIndexOfValue(CFArrayRef self,CFRange range,const void *value) {
// backwards search
NSInteger i=range.location+range.length;
NSInteger location=range.location;
while(--i>=location) {
if([[(NSArray*)self objectAtIndex:i]isEqual:(id)value])
return i;
@ -244,7 +246,7 @@ CFIndex CFArrayGetCountOfValue(CFArrayRef self,CFRange range,const void *value)
count++;
}
return count;
}
void CFArrayApplyFunction(CFArrayRef self,CFRange range,CFArrayApplierFunction function,void *context) {
@ -253,7 +255,7 @@ void CFArrayApplyFunction(CFArrayRef self,CFRange range,CFArrayApplierFunction f
{
if([(NSArray*)self objectAtIndex:i]) function(self,context);
}
}
CFIndex CFArrayBSearchValues(CFArrayRef self,CFRange range,const void *value,CFComparatorFunction function,void *context) {

View File

@ -7,19 +7,19 @@ The above copyright notice and this permission notice shall be included in all c
THE SOFTWARE IS PROVIDED "AS IS",WITHOUT WARRANTY OF ANY KIND,EXPRESS OR IMPLIED,INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,DAMAGES OR OTHER LIABILITY,WHETHER IN AN ACTION OF CONTRACT,TORT OR OTHERWISE,ARISING FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#import <sys/types.h>
#import <stdlib.h>
#import <ctype.h>
#import <errno.h>
#import <float.h>
#import <limits.h>
#import <math.h>
#import <stdarg.h>
#import <stddef.h>
#import <stdio.h>
#import <string.h>
#import <assert.h>
#import <stdint.h>
#import <time.h>
#include <stdlib.h>
#include <ctype.h>
#include <errno.h>
#include <float.h>
#include <limits.h>
#include <math.h>
#include <stdarg.h>
#include <stddef.h>
#include <stdio.h>
#include <string.h>
#include <assert.h>
#include <stdint.h>
#include <time.h>
#ifdef __cplusplus
@ -27,7 +27,7 @@ THE SOFTWARE IS PROVIDED "AS IS",WITHOUT WARRANTY OF ANY KIND,EXPRESS OR IMPLIED
#if defined(COREFOUNDATION_INSIDE_BUILD)
#define COREFOUNDATION_EXPORT extern "C" __declspec(dllexport)
#else
#define COREFOUNDATION_EXPORT extern "C" __declspec(dllimport)
#define COREFOUNDATION_EXPORT extern "C" __declspec(dllimport)
#endif
#else
#define COREFOUNDATION_EXPORT extern "C"
@ -50,7 +50,7 @@ THE SOFTWARE IS PROVIDED "AS IS",WITHOUT WARRANTY OF ANY KIND,EXPRESS OR IMPLIED
/* Apple's Foundation imports CoreGraphics in order to get some of the basic CG* types, unfortunately
this is a hassle on platforms where you just want to use Foundation, so we put them in CoreFoundation and see what happens
*/
enum
{
kCFNotFound = LONG_MAX
@ -60,10 +60,12 @@ enum
typedef double CGFloat;
#define CGFLOAT_MIN DBL_MIN
#define CGFLOAT_MAX DBL_MAX
#define CGFLOAT_SCAN "%lg"
#else
typedef float CGFloat;
#define CGFLOAT_MIN FLT_MIN
#define CGFLOAT_MAX FLT_MAX
#define CGFLOAT_SCAN "%g"
#endif
typedef struct CGPoint {
@ -80,7 +82,7 @@ typedef struct CGRect {
CGPoint origin;
CGSize size;
} CGRect;
typedef unsigned short UniChar;
typedef unsigned long UTF32Char;
@ -88,8 +90,14 @@ typedef float Float32;
typedef double Float64;
// ---
typedef unsigned CFUInteger;
typedef int CFInteger;
#if defined(__LP64__)
typedef long CFInteger;
typedef unsigned long CFUInteger;
#else
typedef int CFInteger;
typedef unsigned int CFUInteger;
#endif
typedef int8_t SInt8;
typedef uint8_t UInt8;
typedef int16_t SInt16;
@ -119,7 +127,7 @@ typedef struct {
static inline CFRange CFRangeMake(CFIndex loc,CFIndex len){
CFRange result={loc,len};
return result;
}

View File

@ -4,7 +4,7 @@
#import <Foundation/NSPathUtilities.h>
#import <Foundation/NSFileManager.h>
#ifdef WINDOWS
#import <windows.h>
#include <windows.h>
#endif
#import <Foundation/NSPlatform.h>

View File

@ -25,7 +25,7 @@ Boolean CFPreferencesAppValueIsForced(CFStringRef key,CFStringRef application) {
CFArrayRef CFPreferencesCopyApplicationList(CFStringRef user,CFStringRef host) {
NSUnimplementedFunction();
return nil;
return NULL;
}
CFPropertyListRef CFPreferencesCopyAppValue(CFStringRef key,CFStringRef application) {
@ -45,12 +45,12 @@ CFIndex CFPreferencesGetAppIntegerValue(CFStringRef key,CFStringRef application,
CFArrayRef CFPreferencesCopyKeyList(CFStringRef application,CFStringRef user,CFStringRef host) {
NSUnimplementedFunction();
return nil;
return NULL;
}
CFDictionaryRef CFPreferencesCopyMultiple(CFArrayRef keysToFetch,CFStringRef application,CFStringRef user,CFStringRef host) {
NSUnimplementedFunction();
return nil;
return NULL;
}
CFPropertyListRef CFPreferencesCopyValue(CFStringRef key,CFStringRef application,CFStringRef user,CFStringRef host) {

View File

@ -96,7 +96,7 @@ CFAbsoluteTime CFRunLoopGetNextTimerFireDate(CFRunLoopRef self,CFStringRef mode)
}
CFInteger CFRunLoopRunInMode(CFStringRef mode,CFTimeInterval seconds,Boolean returnAfterSourceHandled) {
CFRunLoopRef runLoop=CFRunLoopGetCurrent();
NSRunLoop *runLoop=(NSRunLoop*)CFRunLoopGetCurrent();
NSDate *before=[NSDate dateWithTimeIntervalSinceNow:seconds];
[runLoop->_continue addObject:[NSNumber numberWithBool:YES]];
@ -120,8 +120,9 @@ CFInteger CFRunLoopRunInMode(CFStringRef mode,CFTimeInterval seconds,Boolean ret
}
void CFRunLoopStop(CFRunLoopRef self) {
[self->_continue removeLastObject];
[self->_continue addObject:[NSNumber numberWithBool:NO]];
NSRunLoop *runLoop=(NSRunLoop*)self;
[runLoop->_continue removeLastObject];
[runLoop->_continue addObject:[NSNumber numberWithBool:NO]];
}
void CFRunLoopWakeUp(CFRunLoopRef self) {

View File

@ -15,7 +15,7 @@ typedef struct __CFString *CFMutableStringRef;
#import <CoreFoundation/CFLocale.h>
#import <CoreFoundation/CFData.h>
#import <CoreFoundation/CFCharacterSet.h>
#import <stdarg.h>
#include <stdarg.h>
typedef CFOptionFlags CFStringCompareFlags;

View File

@ -22,8 +22,8 @@ static NSString *notLegalURLCharacters(){
}
CFStringRef CFURLCreateStringByAddingPercentEscapes(CFAllocatorRef allocator,CFStringRef self,CFStringRef charactersToLeaveUnescaped,CFStringRef charactersToBeEscaped,CFStringEncoding encoding) {
NSCharacterSet *dontEscapeSet=[NSCharacterSet characterSetWithCharactersInString:charactersToLeaveUnescaped?ToNSString(charactersToLeaveUnescaped):@""];
NSCharacterSet *escapeSet=[NSCharacterSet characterSetWithCharactersInString:charactersToBeEscaped?ToNSString(charactersToBeEscaped):@""];
NSCharacterSet *dontEscapeSet=[NSCharacterSet characterSetWithCharactersInString:charactersToLeaveUnescaped?ToNSString(charactersToLeaveUnescaped):(NSString *)@""];
NSCharacterSet *escapeSet=[NSCharacterSet characterSetWithCharactersInString:charactersToBeEscaped?ToNSString(charactersToBeEscaped):(NSString *)@""];
NSCharacterSet *notLegalEscapeSet=[NSCharacterSet characterSetWithCharactersInString:notLegalURLCharacters()];
NSUInteger i,length=[ToNSString(self) length],resultLength=0;
unichar unicode[length];

View File

@ -2,8 +2,8 @@
#import <Foundation/NSRaise.h>
#import <Foundation/NSCFTypeID.h>
#ifdef WINDOWS
#import <windows.h>
#import <rpc.h>
#include <windows.h>
#include <rpc.h>
#endif
#define CastToCFUUID(x) ((CFUUID *)(x))
@ -110,27 +110,27 @@ CFUUIDRef CFUUIDGetConstantUUIDWithBytes(CFAllocatorRef allocator,uint8_t byte0,
}
CFUUIDBytes CFUUIDGetUUIDBytes(CFUUIDRef self){
return self->_bytes;
return ((CFUUID *)self)->_bytes;
}
CFStringRef CFUUIDCreateString(CFAllocatorRef allocator,CFUUIDRef self){
return (CFStringRef)[[NSString alloc] initWithFormat:@"%02X%02X%02X%02X-%02X%02X-%02X%02X-%02X%02X%02X%02X%02X%02X%02X%02X",
self->_bytes.byte0,
self->_bytes.byte1,
self->_bytes.byte2,
self->_bytes.byte3,
self->_bytes.byte4,
self->_bytes.byte5,
self->_bytes.byte6,
self->_bytes.byte7,
self->_bytes.byte8,
self->_bytes.byte9,
self->_bytes.byte10,
self->_bytes.byte11,
self->_bytes.byte12,
self->_bytes.byte13,
self->_bytes.byte14,
self->_bytes.byte15];
((CFUUID *)self)->_bytes.byte0,
((CFUUID *)self)->_bytes.byte1,
((CFUUID *)self)->_bytes.byte2,
((CFUUID *)self)->_bytes.byte3,
((CFUUID *)self)->_bytes.byte4,
((CFUUID *)self)->_bytes.byte5,
((CFUUID *)self)->_bytes.byte6,
((CFUUID *)self)->_bytes.byte7,
((CFUUID *)self)->_bytes.byte8,
((CFUUID *)self)->_bytes.byte9,
((CFUUID *)self)->_bytes.byte10,
((CFUUID *)self)->_bytes.byte11,
((CFUUID *)self)->_bytes.byte12,
((CFUUID *)self)->_bytes.byte13,
((CFUUID *)self)->_bytes.byte14,
((CFUUID *)self)->_bytes.byte15];
}
@end

View File

@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 42;
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
@ -290,14 +290,6 @@
outputFiles = (
);
};
FEE0F9D60DC9634200598037 /* PBXBuildRule */ = {
isa = PBXBuildRule;
compilerSpec = org.cocotron.1.0.windows.i386.gcc.default;
fileType = sourcecode.c;
isEditable = 1;
outputFiles = (
);
};
/* End PBXBuildRule section */
/* Begin PBXContainerItemProxy section */
@ -305,14 +297,14 @@
isa = PBXContainerItemProxy;
containerPortal = FE6784DB143389C80009A0A0 /* pthread.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = D2AAC0C705546C1D00DB518D /* pthread.1.0.dll */;
remoteGlobalIDString = D2AAC0C705546C1D00DB518D;
remoteInfo = pthread;
};
FE6784E4143389D10009A0A0 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = FE6784DB143389C80009A0A0 /* pthread.xcodeproj */;
proxyType = 1;
remoteGlobalIDString = D2AAC0C605546C1D00DB518D /* pthread */;
remoteGlobalIDString = D2AAC0C605546C1D00DB518D;
remoteInfo = pthread;
};
/* End PBXContainerItemProxy section */
@ -858,7 +850,6 @@
8DC2EF560486A6940098B216 /* Frameworks */,
);
buildRules = (
FEE0F9D60DC9634200598037 /* PBXBuildRule */,
);
dependencies = (
FE6784E5143389D10009A0A0 /* PBXTargetDependency */,
@ -974,8 +965,11 @@
/* Begin PBXProject section */
0867D690FE84028FC02AAC07 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0420;
};
buildConfigurationList = 1DEB91B108733DA50010E9CD /* Build configuration list for PBXProject "CoreFoundation" */;
compatibilityVersion = "Xcode 2.4";
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (

View File

@ -1,3 +1,3 @@
#import <stdint.h>
#include <stdint.h>
typedef int32_t CGError;

View File

@ -8,7 +8,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
#import <CoreGraphics/CoreGraphicsExport.h>
#import <CoreFoundation/CFBase.h>
#import <stdbool.h>
#include <stdbool.h>
COREGRAPHICS_EXPORT const CGRect CGRectZero;
COREGRAPHICS_EXPORT const CGRect CGRectNull;

View File

@ -5,8 +5,7 @@
@class O2Surface,CGWindow;
@interface CGLPixelSurface : NSObject {
CGWindow *_window;
int _x,_y,_width,_height;
int _width,_height;
BOOL _isOpaque,_validBuffers;
int _numberOfBuffers;
int _rowsPerBuffer;
@ -17,19 +16,13 @@
O2Surface *_surface;
}
-initWithFrame:(O2Rect)frame;
-initWithSize:(O2Size)size;
-(CGWindow *)window;
-(BOOL)isOpaque;
-(O2Rect)frame;
-(void)setWindow:(CGWindow *)window;
-(void)setFrame:(O2Rect)frame;
-(void)setFrameSize:(O2Size)value;
-(void)setOpaque:(BOOL)value;
-(void)readBuffer;
-(O2Surface *)validSurface;
@end

View File

@ -5,18 +5,15 @@
@implementation CGLPixelSurface
-initWithFrame:(O2Rect)frame {
_x=frame.origin.x;
_y=frame.origin.y;
_width=frame.size.width;
_height=frame.size.height;
_isOpaque=YES;
_validBuffers=NO;
_numberOfBuffers=0;
_bufferObjects=NULL;
_readPixels=NULL;
_staticPixels=NULL;
return self;
-initWithSize:(O2Size)size {
_width=size.width;
_height=size.height;
_validBuffers=NO;
_numberOfBuffers=0;
_bufferObjects=NULL;
_readPixels=NULL;
_staticPixels=NULL;
return self;
}
-(void)dealloc {
@ -24,40 +21,15 @@
[super dealloc];
}
-(CGWindow *)window {
return _window;
}
-(BOOL)isOpaque {
return _isOpaque;
}
-(O2Rect)frame {
return O2RectMake(_x,_y,_width,_height);
}
-(void)setWindow:(CGWindow *)window {
_window=window;
}
-(void)setFrame:(O2Rect)frame {
_x=frame.origin.x;
_y=frame.origin.y;
_width=frame.size.width;
_height=frame.size.height;
-(void)setFrameSize:(O2Size)value {
_width=value.width;
_height=value.height;
_validBuffers=NO;
}
-(void)setFrameSize:(O2Size)value {
NSRect rect=[self frame];
rect.size=value;
[self setFrame:rect];
}
-(void)setOpaque:(BOOL)value {
_isOpaque=value;
_isOpaque=value;
}
-(void)validateBuffersIfNeeded {
@ -163,8 +135,9 @@ static inline uint32_t premultiplyPixel(uint32_t value){
return value;
}
-(O2Surface *)validSurface {
return _surface;
-(O2Surface *)validSurface {
[self validateBuffersIfNeeded];
return _surface;
}
-(void)readBuffer {
@ -278,7 +251,7 @@ static inline uint32_t premultiplyPixel(uint32_t value){
}
-(NSString *)description {
return [NSString stringWithFormat:@"<%@ %p:frame={ %d %d %d %d } surface=%@",isa,self,_x,_y,_width,_height,_surface];
return [NSString stringWithFormat:@"<%@ %p:size={ %d %d } surface=%@",isa,self,_width,_height,_surface];
}
@end

View File

@ -8,8 +8,9 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
#import <Foundation/Foundation.h>
#import <CoreGraphics/CGWindowLevel.h>
#import <OpenGL/CGLTypes.h>
@class O2Context,CGEvent,CGLPixelSurface;
@class O2Context,CGEvent;
typedef enum {
CGSBackingStoreRetained=0,
@ -70,10 +71,10 @@ typedef enum {
-(void)addEntriesToDeviceDictionary:(NSDictionary *)entries;
-(void)flashWindow;
-(void)addOverlay:(CGLPixelSurface *)overlay;
-(void)removeOverlay:(CGLPixelSurface *)overlay;
-(void)addCGLContext:(CGLContextObj)cglContext;
-(void)removeCGLContext:(CGLContextObj)cglContext;
-(void)flushOverlay:(CGLPixelSurface *)overlay;
-(void)flushCGLContext:(CGLContextObj)cglContext;
@end
@ -103,6 +104,8 @@ typedef enum {
-(void)platformWindowDidInvalidateCGContext:(CGWindow *)window;
-(void)platformWindowShouldZoom:(CGWindow *)window;
@end
CGRect CGInsetRectForNativeWindowBorder(CGRect frame,unsigned styleMask);

View File

@ -158,13 +158,13 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
O2InvalidAbstractInvocation();
}
-(void)addOverlay:(CGLPixelSurface *)overlay {
-(void)addCGLContext:(CGLContextObj)cglContext {
}
-(void)removeOverlay:(CGLPixelSurface *)overlay {
-(void)removeCGLContext:(CGLContextObj)cglContext {
}
-(void)flushOverlay:(CGLPixelSurface *)overlay {
-(void)flushCGLContext:(CGLContextObj)cglContext {
}

View File

@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 42;
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
@ -490,14 +490,6 @@
outputFiles = (
);
};
FEC11B9C0FD4B74C00082282 /* PBXBuildRule */ = {
isa = PBXBuildRule;
compilerSpec = org.cocotron.1.0.windows.i386.gcc.default;
fileType = sourcecode.c;
isEditable = 1;
outputFiles = (
);
};
/* End PBXBuildRule section */
/* Begin PBXContainerItemProxy section */
@ -1822,7 +1814,6 @@
8DC2EF560486A6940098B216 /* Frameworks */,
);
buildRules = (
FEC11B9C0FD4B74C00082282 /* PBXBuildRule */,
);
dependencies = (
FE6F7BD70FD5573B00C3244F /* PBXTargetDependency */,
@ -1908,8 +1899,11 @@
/* Begin PBXProject section */
0867D690FE84028FC02AAC07 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0420;
};
buildConfigurationList = 1DEB91B108733DA50010E9CD /* Build configuration list for PBXProject "CoreGraphics" */;
compatibilityVersion = "Xcode 2.4";
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
@ -2214,7 +2208,6 @@
"-D__LITTLE_ENDIAN__",
"-Wreturn-type",
);
PREBINDING = NO;
PRODUCT_NAME = CoreGraphics;
};
name = Release;
@ -2254,7 +2247,6 @@
"-shared",
"-lm",
);
PREBINDING = NO;
PRODUCT_NAME = CoreGraphics;
STRIP_INSTALLED_PRODUCT = YES;
SYMROOT = build/FreeBSD/i386;
@ -2290,7 +2282,6 @@
"-shared",
"-lm",
);
PREBINDING = NO;
PRODUCT_NAME = CoreGraphics;
STRIP_INSTALLED_PRODUCT = YES;
SYMROOT = build/FreeBSD/i386;
@ -2326,7 +2317,6 @@
"-shared",
"-lm",
);
PREBINDING = NO;
PRODUCT_NAME = CoreGraphics;
STRIP_INSTALLED_PRODUCT = YES;
SYMROOT = build/Linux/i386;
@ -2360,7 +2350,6 @@
"-shared",
"-lm",
);
PREBINDING = NO;
PRODUCT_NAME = CoreGraphics;
STRIP_INSTALLED_PRODUCT = YES;
SYMROOT = build/Darwin/i386;
@ -2390,7 +2379,6 @@
"-D__LITTLE_ENDIAN__",
"-Wreturn-type",
);
PREBINDING = NO;
PRODUCT_NAME = CoreGraphics;
};
name = Debug;
@ -2424,7 +2412,6 @@
"-shared",
"-lm",
);
PREBINDING = NO;
PRODUCT_NAME = CoreGraphics;
STRIP_INSTALLED_PRODUCT = YES;
SYMROOT = build/Linux/i386;
@ -2458,7 +2445,6 @@
"-shared",
"-lm",
);
PREBINDING = NO;
PRODUCT_NAME = CoreGraphics;
STRIP_INSTALLED_PRODUCT = YES;
SYMROOT = build/Darwin/i386;

View File

@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 45;
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
@ -18,14 +18,6 @@
/* End PBXBuildFile section */
/* Begin PBXBuildRule section */
FE7433A310A89EB5004CDF00 /* PBXBuildRule */ = {
isa = PBXBuildRule;
compilerSpec = org.cocotron.1.0.windows.i386.gcc.default;
fileType = sourcecode.c;
isEditable = 1;
outputFiles = (
);
};
FE8492ED119A5EA000E252CC /* PBXBuildRule */ = {
isa = PBXBuildRule;
compilerSpec = org.cocotron.1.0.freebsd.i386.gcc.default;
@ -309,7 +301,6 @@
8DC2EF560486A6940098B216 /* Frameworks */,
);
buildRules = (
FE7433A310A89EB5004CDF00 /* PBXBuildRule */,
);
dependencies = (
FE7433B510A89F63004CDF00 /* PBXTargetDependency */,
@ -386,8 +377,11 @@
/* Begin PBXProject section */
0867D690FE84028FC02AAC07 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0420;
};
buildConfigurationList = 1DEB91B108733DA50010E9CD /* Build configuration list for PBXProject "CoreServices" */;
compatibilityVersion = "Xcode 3.1";
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (

View File

@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 45;
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
@ -34,14 +34,6 @@
outputFiles = (
);
};
FECF92600FFB2B8F007AECF1 /* PBXBuildRule */ = {
isa = PBXBuildRule;
compilerSpec = org.cocotron.1.0.windows.i386.gcc.default;
fileType = sourcecode.c;
isEditable = 1;
outputFiles = (
);
};
FECF92610FFB2B8F007AECF1 /* PBXBuildRule */ = {
isa = PBXBuildRule;
compilerSpec = org.cocotron.1.0.linux.i386.gcc.default;
@ -349,7 +341,6 @@
8DC2EF560486A6940098B216 /* Frameworks */,
);
buildRules = (
FECF92600FFB2B8F007AECF1 /* PBXBuildRule */,
);
dependencies = (
FECF92780FFB2BB0007AECF1 /* PBXTargetDependency */,
@ -427,8 +418,11 @@
/* Begin PBXProject section */
0867D690FE84028FC02AAC07 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0420;
};
buildConfigurationList = 1DEB91B108733DA50010E9CD /* Build configuration list for PBXProject "CoreText" */;
compatibilityVersion = "Xcode 3.1";
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
@ -591,7 +585,6 @@
"-D__LITTLE_ENDIAN__",
"-Wreturn-type",
);
PREBINDING = NO;
PRODUCT_NAME = CoreText;
};
name = Release;
@ -632,7 +625,6 @@
"-shared",
"-lm",
);
PREBINDING = NO;
PRODUCT_NAME = CoreText;
STRIP_INSTALLED_PRODUCT = YES;
SYMROOT = build/FreeBSD/i386;
@ -669,7 +661,6 @@
"-shared",
"-lm",
);
PREBINDING = NO;
PRODUCT_NAME = CoreText;
STRIP_INSTALLED_PRODUCT = YES;
SYMROOT = build/Linux/i386;
@ -704,7 +695,6 @@
"-shared",
"-lm",
);
PREBINDING = NO;
PRODUCT_NAME = CoreText;
STRIP_INSTALLED_PRODUCT = YES;
SYMROOT = build/Darwin/i386;
@ -735,7 +725,6 @@
"-D__LITTLE_ENDIAN__",
"-Wreturn-type",
);
PREBINDING = NO;
PRODUCT_NAME = CoreText;
};
name = Debug;
@ -770,7 +759,6 @@
"-shared",
"-lm",
);
PREBINDING = NO;
PRODUCT_NAME = CoreText;
STRIP_INSTALLED_PRODUCT = YES;
SYMROOT = build/Linux/i386;
@ -805,7 +793,6 @@
"-shared",
"-lm",
);
PREBINDING = NO;
PRODUCT_NAME = CoreText;
STRIP_INSTALLED_PRODUCT = YES;
SYMROOT = build/Darwin/i386;
@ -842,7 +829,6 @@
"-shared",
"-lm",
);
PREBINDING = NO;
PRODUCT_NAME = CoreText;
STRIP_INSTALLED_PRODUCT = YES;
SYMROOT = build/FreeBSD/i386;

View File

@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 45;
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
@ -15,17 +15,6 @@
FE43045B11E2779700EBDD56 /* CVReturn.h in Headers */ = {isa = PBXBuildFile; fileRef = FE43045A11E2779700EBDD56 /* CVReturn.h */; settings = {ATTRIBUTES = (Public, ); }; };
/* End PBXBuildFile section */
/* Begin PBXBuildRule section */
FE43016A11E2536B00EBDD56 /* PBXBuildRule */ = {
isa = PBXBuildRule;
compilerSpec = org.cocotron.1.0.windows.i386.gcc.default;
fileType = sourcecode.c;
isEditable = 1;
outputFiles = (
);
};
/* End PBXBuildRule section */
/* Begin PBXContainerItemProxy section */
50ACFD4A1275F6F3008BEDDD /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
@ -313,7 +302,6 @@
8DC2EF560486A6940098B216 /* Frameworks */,
);
buildRules = (
FE43016A11E2536B00EBDD56 /* PBXBuildRule */,
);
dependencies = (
50ACFD5D1275F6F8008BEDDD /* PBXTargetDependency */,
@ -330,8 +318,11 @@
/* Begin PBXProject section */
0867D690FE84028FC02AAC07 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0420;
};
buildConfigurationList = 1DEB91B108733DA50010E9CD /* Build configuration list for PBXProject "CoreVideo" */;
compatibilityVersion = "Xcode 3.1";
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
@ -500,7 +491,6 @@
GCC_PRECOMPILE_PREFIX_HEADER = NO;
GCC_PREFIX_HEADER = "";
INFOPLIST_FILE = Info.plist;
PREBINDING = NO;
PRODUCT_NAME = CoreVideo;
};
name = Release;

View File

@ -0,0 +1,445 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 42;
objects = {
/* Begin PBXBuildFile section */
8D11072A0486CEB800E47090 /* MainMenu.nib in Resources */ = {isa = PBXBuildFile; fileRef = 29B97318FDCFA39411CA2CEA /* MainMenu.nib */; };
8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; };
8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; };
8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };
FEFC48F00BB21906006628BF /* MainMenu.nib in Resources */ = {isa = PBXBuildFile; fileRef = 29B97318FDCFA39411CA2CEA /* MainMenu.nib */; };
FEFC48F10BB21906006628BF /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; };
FEFC48F30BB21906006628BF /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; };
FEFC48F50BB21906006628BF /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };
FEFC49240BB21A07006628BF /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 29B97325FDCFA39411CA2CEA /* Foundation.framework */; };
FEFC49250BB21A08006628BF /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 29B97324FDCFA39411CA2CEA /* AppKit.framework */; };
FEFC492A0BB21B1D006628BF /* GradientView.m in Sources */ = {isa = PBXBuildFile; fileRef = FEFC49290BB21B1D006628BF /* GradientView.m */; };
FEFC492B0BB21B1D006628BF /* GradientView.m in Sources */ = {isa = PBXBuildFile; fileRef = FEFC49290BB21B1D006628BF /* GradientView.m */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
FE386AF615268155007CC8C7 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = FE386AA415268151007CC8C7 /* Cocoa.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = FE01AB210C5D9C3400AEA51A;
remoteInfo = "Cocoa-Windows-i386";
};
FE386AF815268155007CC8C7 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = FE386AA415268151007CC8C7 /* Cocoa.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = C8E0BFAA0F0E6B0E00677729;
remoteInfo = "Cocoa-Darwin-i386";
};
FE386AFA15268155007CC8C7 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = FE386AA415268151007CC8C7 /* Cocoa.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = FECC1DD6108D025D00BD4A91;
remoteInfo = "Cocoa-Linux-i386";
};
FE386AFC15268155007CC8C7 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = FE386AA415268151007CC8C7 /* Cocoa.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = FE5A873F10C6F1E8005E348A;
remoteInfo = "Cocoa-FreeBSD-i386";
};
FE386B0315268162007CC8C7 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = FE386AA415268151007CC8C7 /* Cocoa.xcodeproj */;
proxyType = 1;
remoteGlobalIDString = FE01AB110C5D9C3400AEA51A;
remoteInfo = "Cocoa-Windows-i386";
};
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
089C165DFE840E0CC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
29B97319FDCFA39411CA2CEA /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/MainMenu.nib; sourceTree = "<group>"; };
29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
8D1107320486CEB800E47090 /* CGShadingCreate.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CGShadingCreate.app; sourceTree = BUILT_PRODUCTS_DIR; };
FE386AA415268151007CC8C7 /* Cocoa.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Cocoa.xcodeproj; path = ../../Cocoa/Cocoa.xcodeproj; sourceTree = "<group>"; };
FEFC48F90BB21906006628BF /* CGShadingCreate.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CGShadingCreate.app; sourceTree = BUILT_PRODUCTS_DIR; };
FEFC49280BB21B1D006628BF /* GradientView.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = GradientView.h; sourceTree = "<group>"; };
FEFC49290BB21B1D006628BF /* GradientView.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = GradientView.m; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
8D11072E0486CEB800E47090 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
FEFC48F40BB21906006628BF /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
FEFC48F50BB21906006628BF /* Cocoa.framework in Frameworks */,
FEFC49240BB21A07006628BF /* Foundation.framework in Frameworks */,
FEFC49250BB21A08006628BF /* AppKit.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
080E96DDFE201D6D7F000001 /* Classes */ = {
isa = PBXGroup;
children = (
);
name = Classes;
sourceTree = "<group>";
};
1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = {
isa = PBXGroup;
children = (
1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */,
);
name = "Linked Frameworks";
sourceTree = "<group>";
};
1058C7A2FEA54F0111CA2CBB /* Other Frameworks */ = {
isa = PBXGroup;
children = (
29B97324FDCFA39411CA2CEA /* AppKit.framework */,
29B97325FDCFA39411CA2CEA /* Foundation.framework */,
);
name = "Other Frameworks";
sourceTree = "<group>";
};
19C28FACFE9D520D11CA2CBB /* Products */ = {
isa = PBXGroup;
children = (
8D1107320486CEB800E47090 /* CGShadingCreate.app */,
FEFC48F90BB21906006628BF /* CGShadingCreate.app */,
);
name = Products;
sourceTree = "<group>";
};
29B97314FDCFA39411CA2CEA /* CGShadingCreate */ = {
isa = PBXGroup;
children = (
FE386AA415268151007CC8C7 /* Cocoa.xcodeproj */,
080E96DDFE201D6D7F000001 /* Classes */,
29B97315FDCFA39411CA2CEA /* Other Sources */,
29B97317FDCFA39411CA2CEA /* Resources */,
29B97323FDCFA39411CA2CEA /* Frameworks */,
19C28FACFE9D520D11CA2CBB /* Products */,
);
name = CGShadingCreate;
sourceTree = "<group>";
};
29B97315FDCFA39411CA2CEA /* Other Sources */ = {
isa = PBXGroup;
children = (
29B97316FDCFA39411CA2CEA /* main.m */,
FEFC49280BB21B1D006628BF /* GradientView.h */,
FEFC49290BB21B1D006628BF /* GradientView.m */,
);
name = "Other Sources";
sourceTree = "<group>";
};
29B97317FDCFA39411CA2CEA /* Resources */ = {
isa = PBXGroup;
children = (
8D1107310486CEB800E47090 /* Info.plist */,
089C165CFE840E0CC02AAC07 /* InfoPlist.strings */,
29B97318FDCFA39411CA2CEA /* MainMenu.nib */,
);
name = Resources;
sourceTree = "<group>";
};
29B97323FDCFA39411CA2CEA /* Frameworks */ = {
isa = PBXGroup;
children = (
1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */,
1058C7A2FEA54F0111CA2CBB /* Other Frameworks */,
);
name = Frameworks;
sourceTree = "<group>";
};
FE386AA515268151007CC8C7 /* Products */ = {
isa = PBXGroup;
children = (
FE386AF715268155007CC8C7 /* Cocoa.framework */,
FE386AF915268155007CC8C7 /* Cocoa.framework */,
FE386AFB15268155007CC8C7 /* Cocoa.framework */,
FE386AFD15268155007CC8C7 /* Cocoa.framework */,
);
name = Products;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
8D1107260486CEB800E47090 /* CGShadingCreate-Mac */ = {
isa = PBXNativeTarget;
buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "CGShadingCreate-Mac" */;
buildPhases = (
8D1107290486CEB800E47090 /* Resources */,
8D11072C0486CEB800E47090 /* Sources */,
8D11072E0486CEB800E47090 /* Frameworks */,
);
buildRules = (
);
dependencies = (
);
name = "CGShadingCreate-Mac";
productInstallPath = "$(HOME)/Applications";
productName = CGShadingCreate;
productReference = 8D1107320486CEB800E47090 /* CGShadingCreate.app */;
productType = "com.apple.product-type.application";
};
FEFC48EE0BB21906006628BF /* CGShadingCreate-Windows */ = {
isa = PBXNativeTarget;
buildConfigurationList = FEFC48F60BB21906006628BF /* Build configuration list for PBXNativeTarget "CGShadingCreate-Windows" */;
buildPhases = (
FEFC48EF0BB21906006628BF /* Resources */,
FEFC48F20BB21906006628BF /* Sources */,
FEFC48F40BB21906006628BF /* Frameworks */,
FEB8F1150D3DB75D00754380 /* ShellScript */,
);
buildRules = (
);
dependencies = (
FE386B0415268162007CC8C7 /* PBXTargetDependency */,
);
name = "CGShadingCreate-Windows";
productInstallPath = "$(HOME)/Applications";
productName = CGShadingCreate;
productReference = FEFC48F90BB21906006628BF /* CGShadingCreate.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
29B97313FDCFA39411CA2CEA /* Project object */ = {
isa = PBXProject;
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "CGShadingCreate" */;
compatibilityVersion = "Xcode 2.4";
developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
en,
);
mainGroup = 29B97314FDCFA39411CA2CEA /* CGShadingCreate */;
projectDirPath = "";
projectReferences = (
{
ProductGroup = FE386AA515268151007CC8C7 /* Products */;
ProjectRef = FE386AA415268151007CC8C7 /* Cocoa.xcodeproj */;
},
);
projectRoot = "";
targets = (
8D1107260486CEB800E47090 /* CGShadingCreate-Mac */,
FEFC48EE0BB21906006628BF /* CGShadingCreate-Windows */,
);
};
/* End PBXProject section */
/* Begin PBXReferenceProxy section */
FE386AF715268155007CC8C7 /* Cocoa.framework */ = {
isa = PBXReferenceProxy;
fileType = wrapper.framework;
path = Cocoa.framework;
remoteRef = FE386AF615268155007CC8C7 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
FE386AF915268155007CC8C7 /* Cocoa.framework */ = {
isa = PBXReferenceProxy;
fileType = wrapper.framework;
path = Cocoa.framework;
remoteRef = FE386AF815268155007CC8C7 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
FE386AFB15268155007CC8C7 /* Cocoa.framework */ = {
isa = PBXReferenceProxy;
fileType = wrapper.framework;
path = Cocoa.framework;
remoteRef = FE386AFA15268155007CC8C7 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
FE386AFD15268155007CC8C7 /* Cocoa.framework */ = {
isa = PBXReferenceProxy;
fileType = wrapper.framework;
path = Cocoa.framework;
remoteRef = FE386AFC15268155007CC8C7 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
/* End PBXReferenceProxy section */
/* Begin PBXResourcesBuildPhase section */
8D1107290486CEB800E47090 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
8D11072A0486CEB800E47090 /* MainMenu.nib in Resources */,
8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
FEFC48EF0BB21906006628BF /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
FEFC48F00BB21906006628BF /* MainMenu.nib in Resources */,
FEFC48F10BB21906006628BF /* InfoPlist.strings in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
FEB8F1150D3DB75D00754380 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "/Developer/Cocotron/1.0/bin/retargetBundle -framework Foundation -framework AppKit -destination $TARGET_BUILD_DIR\"/\"$EXECUTABLE_FOLDER_PATH\n\n";
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
8D11072C0486CEB800E47090 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
8D11072D0486CEB800E47090 /* main.m in Sources */,
FEFC492A0BB21B1D006628BF /* GradientView.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
FEFC48F20BB21906006628BF /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
FEFC48F30BB21906006628BF /* main.m in Sources */,
FEFC492B0BB21B1D006628BF /* GradientView.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
FE386B0415268162007CC8C7 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = "Cocoa-Windows-i386";
targetProxy = FE386B0315268162007CC8C7 /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin PBXVariantGroup section */
089C165CFE840E0CC02AAC07 /* InfoPlist.strings */ = {
isa = PBXVariantGroup;
children = (
089C165DFE840E0CC02AAC07 /* English */,
);
name = InfoPlist.strings;
sourceTree = "<group>";
};
29B97318FDCFA39411CA2CEA /* MainMenu.nib */ = {
isa = PBXVariantGroup;
children = (
29B97319FDCFA39411CA2CEA /* English */,
);
name = MainMenu.nib;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
C01FCF4C08A954540054247B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = i386;
GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
GCC_MODEL_TUNING = "";
INFOPLIST_FILE = Info.plist;
PRODUCT_NAME = CGShadingCreate;
WRAPPER_EXTENSION = app;
};
name = Release;
};
C01FCF5008A954540054247B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
PREBINDING = NO;
};
name = Release;
};
FEFC48F80BB21906006628BF /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = i386;
COPY_PHASE_STRIP = YES;
EFFECTIVE_PLATFORM_NAME = "-windows";
EXECUTABLE_FOLDER_PATH = "$(CONTENTS_FOLDER_PATH)/Windows";
EXECUTABLE_SUFFIX = .exe;
FRAMEWORK_SEARCH_PATHS = /Developer/Cocotron/1.0/Windows/i386/Frameworks;
GCC_DYNAMIC_NO_PIC = NO;
GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
GCC_MODEL_TUNING = "";
GCC_PRECOMPILE_PREFIX_HEADER = NO;
GCC_VERSION = org.cocotron.1.0.windows.i386.gcc.4.3.1;
INFOPLIST_FILE = Info.plist;
OTHER_LDFLAGS = (
"-Wl,--enable-auto-import",
"-mwindows",
);
PRODUCT_NAME = CGShadingCreate;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "CGShadingCreate-Mac" */ = {
isa = XCConfigurationList;
buildConfigurations = (
C01FCF4C08A954540054247B /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
C01FCF4E08A954540054247B /* Build configuration list for PBXProject "CGShadingCreate" */ = {
isa = XCConfigurationList;
buildConfigurations = (
C01FCF5008A954540054247B /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
FEFC48F60BB21906006628BF /* Build configuration list for PBXNativeTarget "CGShadingCreate-Windows" */ = {
isa = XCConfigurationList;
buildConfigurations = (
FEFC48F80BB21906006628BF /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 29B97313FDCFA39411CA2CEA /* Project object */;
}

View File

@ -0,0 +1,84 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "NO">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8D1107260486CEB800E47090"
BuildableName = "CGShadingCreate.app"
BlueprintName = "CGShadingCreate-Mac"
ReferencedContainer = "container:CGShadingCreate.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Release">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8D1107260486CEB800E47090"
BuildableName = "CGShadingCreate.app"
BlueprintName = "CGShadingCreate-Mac"
ReferencedContainer = "container:CGShadingCreate.xcodeproj">
</BuildableReference>
</MacroExpansion>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8D1107260486CEB800E47090"
BuildableName = "CGShadingCreate.app"
BlueprintName = "CGShadingCreate-Mac"
ReferencedContainer = "container:CGShadingCreate.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8D1107260486CEB800E47090"
BuildableName = "CGShadingCreate.app"
BlueprintName = "CGShadingCreate-Mac"
ReferencedContainer = "container:CGShadingCreate.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Release">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -0,0 +1,84 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "NO">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "FEFC48EE0BB21906006628BF"
BuildableName = "CGShadingCreate.app"
BlueprintName = "CGShadingCreate-Windows"
ReferencedContainer = "container:CGShadingCreate.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Release">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "FEFC48EE0BB21906006628BF"
BuildableName = "CGShadingCreate.app"
BlueprintName = "CGShadingCreate-Windows"
ReferencedContainer = "container:CGShadingCreate.xcodeproj">
</BuildableReference>
</MacroExpansion>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "FEFC48EE0BB21906006628BF"
BuildableName = "CGShadingCreate.app"
BlueprintName = "CGShadingCreate-Windows"
ReferencedContainer = "container:CGShadingCreate.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "FEFC48EE0BB21906006628BF"
BuildableName = "CGShadingCreate.app"
BlueprintName = "CGShadingCreate-Windows"
ReferencedContainer = "container:CGShadingCreate.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Release">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -0,0 +1,39 @@
{
IBClasses = (
{CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
{
ACTIONS = {
selectType = id;
takeEndColorFromSender = id;
takeEndXFromSender = id;
takeEndYFromSender = id;
takeExtendEndFromSender = id;
takeExtendStartFromSender = id;
takeInnerRadiusFromSender = id;
takeOuterRadiusFromSender = id;
takeStartColorFromSender = id;
takeStartXFromSender = id;
takeStartYFromSender = id;
};
CLASS = GradientView;
LANGUAGE = ObjC;
OUTLETS = {
"_endColor" = NSColorWell;
"_endExtend" = NSButton;
"_endXTextField" = NSTextField;
"_endYTextField" = NSTextField;
"_innerRadius" = NSFormCell;
"_innerRadiusSlider" = NSSlider;
"_outerRadius" = NSFormCell;
"_outerRadiusSlider" = NSSlider;
"_shadingType" = NSMatrix;
"_startColor" = NSColorWell;
"_startExtend" = NSButton;
"_startXTextField" = NSTextField;
"_startYTextField" = NSTextField;
};
SUPERCLASS = NSView;
}
);
IBVersion = 1;
}

View File

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IBDocumentLocation</key>
<string>76 78 356 240 0 0 1680 1028 </string>
<key>IBEditorPositions</key>
<dict>
<key>29</key>
<string>80 352 350 44 0 0 1680 1028 </string>
</dict>
<key>IBFramework Version</key>
<string>446.1</string>
<key>IBOpenObjects</key>
<array>
<integer>29</integer>
<integer>21</integer>
</array>
<key>IBSystem Version</key>
<string>8L2127</string>
<key>IBUsesTextArchiving</key>
<true/>
</dict>
</plist>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,49 @@
/* GradientView, not exactly MVC but you get the idea */
#import <Cocoa/Cocoa.h>
@interface GradientView : NSView {
float _C0[4];
float _C1[4];
NSPoint _startPoint;
NSPoint _endPoint;
BOOL _extendStart;
BOOL _extendEnd;
float _startRadius;
float _endRadius;
BOOL _mouseFirst;
IBOutlet NSMatrix *_shadingType;
IBOutlet NSTextField *_startXTextField;
IBOutlet NSTextField *_startYTextField;
IBOutlet NSColorWell *_startColor;
IBOutlet NSButton *_startExtend;
IBOutlet NSTextField *_endXTextField;
IBOutlet NSTextField *_endYTextField;
IBOutlet NSColorWell *_endColor;
IBOutlet NSButton *_endExtend;
IBOutlet NSFormCell *_innerRadius;
IBOutlet NSSlider *_innerRadiusSlider;
IBOutlet NSFormCell *_outerRadius;
IBOutlet NSSlider *_outerRadiusSlider;
}
-(IBAction)selectType:sender;
-(IBAction)takeStartXFromSender:sender;
-(IBAction)takeStartYFromSender:sender;
-(IBAction)takeEndXFromSender:sender;
-(IBAction)takeEndYFromSender:sender;
-(IBAction)takeStartColorFromSender:sender;
-(IBAction)takeEndColorFromSender:sender;
-(IBAction)takeExtendStartFromSender:sender;
-(IBAction)takeExtendEndFromSender:sender;
-(IBAction)takeInnerRadiusFromSender:sender;
-(IBAction)takeOuterRadiusFromSender:sender;
@end

View File

@ -0,0 +1,157 @@
#import "GradientView.h"
#import <ApplicationServices/ApplicationServices.h>
@implementation GradientView
-initWithFrame:(NSRect)frame {
[super initWithFrame:frame];
_C0[0]=0;
_C0[1]=0;
_C0[2]=0;
_C0[3]=1;
_C1[0]=1;
_C1[1]=0;
_C1[2]=0;
_C1[3]=1;
_startPoint=NSMakePoint(0,0);
_endPoint=NSMakePoint(frame.size.width,frame.size.height);
_extendStart=NO;
_extendEnd=NO;
_startRadius=10;
_endRadius=100;
_mouseFirst=YES;
return self;
}
-(void)updateRadius {
[_innerRadius setFloatValue:_startRadius];
[_innerRadiusSlider setFloatValue:_startRadius];
[_outerRadius setFloatValue:_endRadius];
[_outerRadiusSlider setFloatValue:_endRadius];
}
-(void)updatePointFields {
[_startXTextField setFloatValue:_startPoint.x];
[_startYTextField setFloatValue:_startPoint.y];
[_endXTextField setFloatValue:_endPoint.x];
[_endYTextField setFloatValue:_endPoint.y];
}
-(void)awakeFromNib {
[self updatePointFields];
[self updateRadius];
}
void evaluate(void *info,const float *in, float *output) {
float x=in[0];
GradientView *self=info;
int i;
for(i=0;i<4;i++)
output[i]=self->_C0[i]+x*(self->_C1[i]-self->_C0[i]);
}
-(void)drawRect:(NSRect)rect {
CGContextRef context=[[NSGraphicsContext currentContext] graphicsPort];
CGFunctionRef function;
CGShadingRef shading;
float domain[2]={0,1};
float range[8]={0,1,0,1,0,1,0,1};
CGFunctionCallbacks callbacks={0,evaluate,NULL};
[[NSColor whiteColor] set];
NSRectFill([self bounds]);
function=CGFunctionCreate(self,1,domain,4,range,&callbacks);
if([_shadingType selectedTag]==0)
shading=CGShadingCreateAxial(CGColorSpaceCreateDeviceRGB(),CGPointMake(_startPoint.x,_startPoint.y),
CGPointMake(_endPoint.x,_endPoint.y),function,_extendStart,_extendEnd);
else
shading=CGShadingCreateRadial(CGColorSpaceCreateDeviceRGB(),CGPointMake(_startPoint.x,_startPoint.y),_startRadius,
CGPointMake(_endPoint.x,_endPoint.y),_endRadius,function,_extendStart,_extendEnd);
CGContextDrawShading(context,shading);
CGFunctionRelease(function);
CGShadingRelease(shading);
}
-(void)mouseDown:(NSEvent *)event {
NSPoint *dest=(_mouseFirst)?&_startPoint:&_endPoint;
do {
NSPoint point=[self convertPoint:[event locationInWindow] fromView:nil];
*dest=point;
[self updatePointFields];
[self setNeedsDisplay:YES];
event=[[self window] nextEventMatchingMask:NSLeftMouseUpMask|NSLeftMouseDraggedMask];
}while([event type]!=NSLeftMouseUp);
_mouseFirst=!_mouseFirst;
}
-(IBAction)selectType:sender {
[self setNeedsDisplay:YES];
}
-(IBAction)takeStartXFromSender:sender {
_startPoint.x=[sender floatValue];
[self setNeedsDisplay:YES];
}
-(IBAction)takeStartYFromSender:sender {
_startPoint.y=[sender floatValue];
[self setNeedsDisplay:YES];
}
-(IBAction)takeEndXFromSender:sender {
_endPoint.x=[sender floatValue];
[self setNeedsDisplay:YES];
}
-(IBAction)takeEndYFromSender:sender {
_endPoint.y=[sender floatValue];
[self setNeedsDisplay:YES];
}
-(IBAction)takeStartColorFromSender:sender {
NSColor *color=[[sender color] colorUsingColorSpaceName:NSCalibratedRGBColorSpace];
[color getRed:_C0 green:_C0+1 blue:_C0+2 alpha:_C0+3];
[self setNeedsDisplay:YES];
}
-(IBAction)takeEndColorFromSender:sender {
NSColor *color=[[sender color] colorUsingColorSpaceName:NSCalibratedRGBColorSpace];
[color getRed:_C1 green:_C1+1 blue:_C1+2 alpha:_C1+3];
[self setNeedsDisplay:YES];
}
-(IBAction)takeExtendStartFromSender:sender {
_extendStart=[sender intValue]?YES:NO;
[self setNeedsDisplay:YES];
}
-(IBAction)takeExtendEndFromSender:sender {
_extendEnd=[sender intValue]?YES:NO;
[self setNeedsDisplay:YES];
}
-(IBAction)takeInnerRadiusFromSender:sender {
_startRadius=[sender floatValue];
[self updateRadius];
[self setNeedsDisplay:YES];
}
-(IBAction)takeOuterRadiusFromSender:sender {
_endRadius=[sender floatValue];
[self updateRadius];
[self setNeedsDisplay:YES];
}
@end

View File

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//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>org.cocotron.CGShadingCreateAxial</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>OBJC</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>NSMainNibFile</key>
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
</dict>
</plist>

View File

@ -0,0 +1,6 @@
#import <Cocoa/Cocoa.h>
int main(int argc, char *argv[])
{
return NSApplicationMain(argc, (const char **) argv);
}

View File

@ -0,0 +1,100 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<Group
location = "group:CGShadingCreate"
name = "CGShadingCreate">
<FileRef
location = "group:CGShadingCreate.xcodeproj">
</FileRef>
<Group
location = "group:English.lproj"
name = "English.lproj">
<FileRef
location = "group:InfoPlist.strings">
</FileRef>
<FileRef
location = "group:MainMenu.nib">
</FileRef>
</Group>
<FileRef
location = "group:GradientView.h">
</FileRef>
<FileRef
location = "group:GradientView.m">
</FileRef>
<FileRef
location = "group:Info.plist">
</FileRef>
<FileRef
location = "group:main.m">
</FileRef>
</Group>
<Group
location = "group:NSOpenGLView"
name = "NSOpenGLView">
<Group
location = "group:English.lproj"
name = "English.lproj">
<FileRef
location = "group:InfoPlist.strings">
</FileRef>
<FileRef
location = "group:Localizable-windows.strings">
</FileRef>
<FileRef
location = "group:Localizable.strings">
</FileRef>
<FileRef
location = "group:MainMenu.nib">
</FileRef>
</Group>
<FileRef
location = "group:Info.plist">
</FileRef>
<FileRef
location = "group:main.m">
</FileRef>
<FileRef
location = "group:MyOpenGLView.h">
</FileRef>
<FileRef
location = "group:MyOpenGLView.m">
</FileRef>
<FileRef
location = "group:NSOpenGLView.xcodeproj">
</FileRef>
</Group>
<Group
location = "group:TextEditor"
name = "TextEditor">
<Group
location = "group:English.lproj"
name = "English.lproj">
<FileRef
location = "group:Credits.rtf">
</FileRef>
<FileRef
location = "group:MainMenu.nib">
</FileRef>
<FileRef
location = "group:MyDocument.nib">
</FileRef>
</Group>
<FileRef
location = "group:Info.plist">
</FileRef>
<FileRef
location = "group:main.m">
</FileRef>
<FileRef
location = "group:MyDocument.h">
</FileRef>
<FileRef
location = "group:MyDocument.m">
</FileRef>
<FileRef
location = "group:TextEditor.xcodeproj">
</FileRef>
</Group>
</Workspace>

Binary file not shown.

View File

@ -0,0 +1 @@
"WindowTitle"="Cocotron NSOpenGLView";

View File

@ -0,0 +1,3 @@
"WindowTitle"="Cocoa NSOpenGLView";

View File

@ -0,0 +1,12 @@
{
IBClasses = (
{CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
{
ACTIONS = {};
CLASS = MyOpenGLView;
LANGUAGE = ObjC;
SUPERCLASS = NSOpenGLView;
}
);
IBVersion = 1;
}

View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IBDocumentLocation</key>
<string>135 107 356 240 0 0 1680 1028 </string>
<key>IBEditorPositions</key>
<dict>
<key>29</key>
<string>132 352 338 44 0 0 1680 1028 </string>
</dict>
<key>IBFramework Version</key>
<string>446.1</string>
<key>IBOpenObjects</key>
<array>
<integer>29</integer>
<integer>21</integer>
</array>
<key>IBSystem Version</key>
<string>8S2167</string>
</dict>
</plist>

Binary file not shown.

View File

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//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>org.cocotron.NSOpenGLView</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>NSMainNibFile</key>
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
</dict>
</plist>

View File

@ -0,0 +1,10 @@
/* MyOpenGLView */
#import <Cocoa/Cocoa.h>
@interface MyOpenGLView : NSOpenGLView {
NSTimer *_timer;
float _angleX;
}
@end

View File

@ -0,0 +1,129 @@
#import "MyOpenGLView.h"
#import <OpenGL/gl.h>
#import <OpenGL/glu.h>
#import <ApplicationServices/ApplicationServices.h>
@implementation MyOpenGLView
-(void)awakeFromNib {
_angleX=360;
_timer=[[NSTimer scheduledTimerWithTimeInterval:0.01 target:self selector:@selector(timer:) userInfo:nil repeats:YES] retain];
[[self window] setTitle:NSLocalizedString(@"WindowTitle",@"")];
}
static void drawArcWithDepth(float beginAngle,float endAngle,float innerRadius,float outerRadius,float z){
for(;beginAngle<=endAngle;beginAngle+=1){
CGAffineTransform matrix=CGAffineTransformMakeRotation(M_PI*beginAngle/180.0);
CGPoint innerPoint=CGPointMake(innerRadius,0);
CGPoint outerPoint=CGPointMake(outerRadius,0);
innerPoint=CGPointApplyAffineTransform(innerPoint,matrix);
outerPoint=CGPointApplyAffineTransform(outerPoint,matrix);
glVertex3f(innerPoint.x,innerPoint.y,z);
glVertex3f(outerPoint.x,outerPoint.y,z);
}
}
static void drawEdge(float beginAngle,float endAngle,float radius,float zclose,float zfar){
for(;beginAngle<=endAngle;beginAngle+=1){
CGAffineTransform matrix=CGAffineTransformMakeRotation(M_PI*beginAngle/180.0);
CGPoint point=CGPointMake(radius,0);
CGPoint normal=CGPointMake(1,0);
point=CGPointApplyAffineTransform(point,matrix);
normal=CGPointApplyAffineTransform(normal,matrix);
glNormal3f(normal.x,normal.y,0);
glVertex3f(point.x, point.y,zclose);
glVertex3f(point.x, point.y,zfar);
}
}
static void capAtAngle(float angle,float innerRadius,float outerRadius,float depth){
CGAffineTransform matrix=CGAffineTransformMakeRotation(M_PI*angle/180.0);
CGPoint innerPoint=CGPointMake(innerRadius,0);
CGPoint outerPoint=CGPointMake(outerRadius,0);
CGPoint normal=CGPointMake(1,0);
innerPoint=CGPointApplyAffineTransform(innerPoint,matrix);
outerPoint=CGPointApplyAffineTransform(outerPoint,matrix);
normal=CGPointApplyAffineTransform(normal,matrix);
glNormal3f(normal.x,normal.y,0);
glVertex3f(innerPoint.x, innerPoint.y,depth/2);
glVertex3f(outerPoint.x, outerPoint.y,depth/2);
glVertex3f(outerPoint.x, outerPoint.y,-depth/2);
glVertex3f(innerPoint.x, innerPoint.y,-depth/2);
}
static void drawArc(float beginAngle,float endAngle,float innerRadius,float outerRadius,float depth){
glNormal3f(1,0,0);
glBegin(GL_QUAD_STRIP);
drawArcWithDepth(beginAngle,endAngle,innerRadius,outerRadius,depth/2);
glEnd();
glNormal3f(-1,0,0);
glBegin(GL_QUAD_STRIP);
drawArcWithDepth(beginAngle,endAngle,innerRadius,outerRadius,-depth/2);
glEnd();
glColor3f(.2, .2, .2);
glBegin(GL_QUAD_STRIP);
drawEdge(beginAngle,endAngle,outerRadius,depth/2,-depth/2);
glEnd();
glBegin(GL_QUAD_STRIP);
drawEdge(beginAngle,endAngle,innerRadius,depth/2,-depth/2);
glEnd();
glBegin(GL_QUADS);
capAtAngle(beginAngle,innerRadius,outerRadius,depth);
capAtAngle(endAngle,innerRadius,outerRadius,depth);
glEnd();
}
static void drawCocotron(){
glColor3f(0, 0, 0);
drawArc(0,60,.5,1,.3);
glColor3f(0, 0, 0);
drawArc(120,180,.5,1,.3);
glColor3f(0, 0, 0);
drawArc(240,300,.5,1,.3);
glColor3f(.5, .5, 0);
drawArc(30,330,.2,.4,.3);
}
-(void)drawRect:(NSRect)bounds {
glClearColor(.3, 0, .3, 1);
glLoadIdentity();
glClear(GL_COLOR_BUFFER_BIT+GL_DEPTH_BUFFER_BIT+GL_STENCIL_BUFFER_BIT);
glRotatef(_angleX,0,1,0);
drawCocotron();
glFlush();
}
-(void)prepareOpenGL {
glEnable(GL_DEPTH_TEST);
glShadeModel(GL_SMOOTH);
}
-(void)reshape {
glViewport(0,0,[self bounds].size.width,[self bounds].size.height);
}
-(void) timer:(NSTimer *)timer {
_angleX -= 1;
if(_angleX<0)
_angleX=360;
[self setNeedsDisplay:YES];
}
@end

View File

@ -0,0 +1,484 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 42;
objects = {
/* Begin PBXBuildFile section */
8D11072A0486CEB800E47090 /* MainMenu.nib in Resources */ = {isa = PBXBuildFile; fileRef = 29B97318FDCFA39411CA2CEA /* MainMenu.nib */; };
8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; };
8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; };
8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };
FE472DAE0C85A959002B72EF /* MyOpenGLView.m in Sources */ = {isa = PBXBuildFile; fileRef = FE472DAD0C85A959002B72EF /* MyOpenGLView.m */; };
FE472DC90C85AAA1002B72EF /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FE472DC80C85AAA1002B72EF /* OpenGL.framework */; };
FE4733530C876FA1002B72EF /* MainMenu.nib in Resources */ = {isa = PBXBuildFile; fileRef = 29B97318FDCFA39411CA2CEA /* MainMenu.nib */; };
FE4733540C876FA1002B72EF /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; };
FE4733560C876FA1002B72EF /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; };
FE4733570C876FA1002B72EF /* MyOpenGLView.m in Sources */ = {isa = PBXBuildFile; fileRef = FE472DAD0C85A959002B72EF /* MyOpenGLView.m */; };
FEBEB04E0C96D3EE002C9F50 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = FEBEB04D0C96D3EE002C9F50 /* Localizable.strings */; };
FEBEB04F0C96D3EE002C9F50 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = FEBEB04D0C96D3EE002C9F50 /* Localizable.strings */; };
FEBEB0520C96D3FD002C9F50 /* Localizable-windows.strings in Resources */ = {isa = PBXBuildFile; fileRef = FEBEB0510C96D3FD002C9F50 /* Localizable-windows.strings */; };
FEBEB0530C96D3FD002C9F50 /* Localizable-windows.strings in Resources */ = {isa = PBXBuildFile; fileRef = FEBEB0510C96D3FD002C9F50 /* Localizable-windows.strings */; };
FEF2EB7D0C87B952001FC5A8 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 29B97325FDCFA39411CA2CEA /* Foundation.framework */; };
FEF2EB7E0C87B959001FC5A8 /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 29B97324FDCFA39411CA2CEA /* AppKit.framework */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
FE386A3C15267FB1007CC8C7 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = FE3869EA15267FAD007CC8C7 /* Cocoa.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = FE01AB210C5D9C3400AEA51A;
remoteInfo = "Cocoa-Windows-i386";
};
FE386A3E15267FB1007CC8C7 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = FE3869EA15267FAD007CC8C7 /* Cocoa.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = C8E0BFAA0F0E6B0E00677729;
remoteInfo = "Cocoa-Darwin-i386";
};
FE386A4015267FB1007CC8C7 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = FE3869EA15267FAD007CC8C7 /* Cocoa.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = FECC1DD6108D025D00BD4A91;
remoteInfo = "Cocoa-Linux-i386";
};
FE386A4215267FB1007CC8C7 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = FE3869EA15267FAD007CC8C7 /* Cocoa.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = FE5A873F10C6F1E8005E348A;
remoteInfo = "Cocoa-FreeBSD-i386";
};
FE386A4815267FC9007CC8C7 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = FE3869EA15267FAD007CC8C7 /* Cocoa.xcodeproj */;
proxyType = 1;
remoteGlobalIDString = FE01AB110C5D9C3400AEA51A;
remoteInfo = "Cocoa-Windows-i386";
};
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
089C165DFE840E0CC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
13E42FB307B3F0F600E4EEF1 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = /System/Library/Frameworks/CoreData.framework; sourceTree = "<absolute>"; };
29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
29B97319FDCFA39411CA2CEA /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/MainMenu.nib; sourceTree = "<group>"; };
29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
8D1107320486CEB800E47090 /* NSOpenGLView.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = NSOpenGLView.app; sourceTree = BUILT_PRODUCTS_DIR; };
FE3869EA15267FAD007CC8C7 /* Cocoa.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Cocoa.xcodeproj; path = ../../Cocoa/Cocoa.xcodeproj; sourceTree = "<group>"; };
FE472DAC0C85A959002B72EF /* MyOpenGLView.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MyOpenGLView.h; sourceTree = "<group>"; };
FE472DAD0C85A959002B72EF /* MyOpenGLView.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = MyOpenGLView.m; sourceTree = "<group>"; };
FE472DC80C85AAA1002B72EF /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = /System/Library/Frameworks/OpenGL.framework; sourceTree = "<absolute>"; };
FE47335D0C876FA1002B72EF /* NSOpenGLView.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = NSOpenGLView.app; sourceTree = BUILT_PRODUCTS_DIR; };
FEBEB00E0C96D208002C9F50 /* English */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/Localizable.strings; sourceTree = "<group>"; };
FEBEB0160C96D228002C9F50 /* English */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.plist.strings; name = English; path = "English.lproj/Localizable-windows.strings"; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
8D11072E0486CEB800E47090 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */,
FE472DC90C85AAA1002B72EF /* OpenGL.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
FE4733580C876FA1002B72EF /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
FEF2EB7D0C87B952001FC5A8 /* Foundation.framework in Frameworks */,
FEF2EB7E0C87B959001FC5A8 /* AppKit.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
080E96DDFE201D6D7F000001 /* Classes */ = {
isa = PBXGroup;
children = (
);
name = Classes;
sourceTree = "<group>";
};
1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = {
isa = PBXGroup;
children = (
1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */,
);
name = "Linked Frameworks";
sourceTree = "<group>";
};
1058C7A2FEA54F0111CA2CBB /* Other Frameworks */ = {
isa = PBXGroup;
children = (
29B97324FDCFA39411CA2CEA /* AppKit.framework */,
13E42FB307B3F0F600E4EEF1 /* CoreData.framework */,
29B97325FDCFA39411CA2CEA /* Foundation.framework */,
);
name = "Other Frameworks";
sourceTree = "<group>";
};
19C28FACFE9D520D11CA2CBB /* Products */ = {
isa = PBXGroup;
children = (
8D1107320486CEB800E47090 /* NSOpenGLView.app */,
FE47335D0C876FA1002B72EF /* NSOpenGLView.app */,
);
name = Products;
sourceTree = "<group>";
};
29B97314FDCFA39411CA2CEA /* NSOpenGLView */ = {
isa = PBXGroup;
children = (
FE3869EA15267FAD007CC8C7 /* Cocoa.xcodeproj */,
080E96DDFE201D6D7F000001 /* Classes */,
29B97315FDCFA39411CA2CEA /* Other Sources */,
29B97317FDCFA39411CA2CEA /* Resources */,
29B97323FDCFA39411CA2CEA /* Frameworks */,
19C28FACFE9D520D11CA2CBB /* Products */,
FEBEB04D0C96D3EE002C9F50 /* Localizable.strings */,
FEBEB0510C96D3FD002C9F50 /* Localizable-windows.strings */,
);
name = NSOpenGLView;
sourceTree = "<group>";
};
29B97315FDCFA39411CA2CEA /* Other Sources */ = {
isa = PBXGroup;
children = (
29B97316FDCFA39411CA2CEA /* main.m */,
FE472DAC0C85A959002B72EF /* MyOpenGLView.h */,
FE472DAD0C85A959002B72EF /* MyOpenGLView.m */,
);
name = "Other Sources";
sourceTree = "<group>";
};
29B97317FDCFA39411CA2CEA /* Resources */ = {
isa = PBXGroup;
children = (
8D1107310486CEB800E47090 /* Info.plist */,
089C165CFE840E0CC02AAC07 /* InfoPlist.strings */,
29B97318FDCFA39411CA2CEA /* MainMenu.nib */,
);
name = Resources;
sourceTree = "<group>";
};
29B97323FDCFA39411CA2CEA /* Frameworks */ = {
isa = PBXGroup;
children = (
FE472DC80C85AAA1002B72EF /* OpenGL.framework */,
1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */,
1058C7A2FEA54F0111CA2CBB /* Other Frameworks */,
);
name = Frameworks;
sourceTree = "<group>";
};
FE3869EB15267FAD007CC8C7 /* Products */ = {
isa = PBXGroup;
children = (
FE386A3D15267FB1007CC8C7 /* Cocoa.framework */,
FE386A3F15267FB1007CC8C7 /* Cocoa.framework */,
FE386A4115267FB1007CC8C7 /* Cocoa.framework */,
FE386A4315267FB1007CC8C7 /* Cocoa.framework */,
);
name = Products;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
8D1107260486CEB800E47090 /* NSOpenGLView-MacOS */ = {
isa = PBXNativeTarget;
buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "NSOpenGLView-MacOS" */;
buildPhases = (
8D1107290486CEB800E47090 /* Resources */,
8D11072C0486CEB800E47090 /* Sources */,
8D11072E0486CEB800E47090 /* Frameworks */,
);
buildRules = (
);
dependencies = (
);
name = "NSOpenGLView-MacOS";
productInstallPath = "$(HOME)/Applications";
productName = NSOpenGLView;
productReference = 8D1107320486CEB800E47090 /* NSOpenGLView.app */;
productType = "com.apple.product-type.application";
};
FE4733510C876FA1002B72EF /* NSOpenGLView-Windows */ = {
isa = PBXNativeTarget;
buildConfigurationList = FE47335B0C876FA1002B72EF /* Build configuration list for PBXNativeTarget "NSOpenGLView-Windows" */;
buildPhases = (
FE4733520C876FA1002B72EF /* Resources */,
FE4733550C876FA1002B72EF /* Sources */,
FE4733580C876FA1002B72EF /* Frameworks */,
FE2D932D0D491258005B7813 /* ShellScript */,
);
buildRules = (
);
dependencies = (
FE386A4915267FC9007CC8C7 /* PBXTargetDependency */,
);
name = "NSOpenGLView-Windows";
productInstallPath = "$(HOME)/Applications";
productName = NSOpenGLView;
productReference = FE47335D0C876FA1002B72EF /* NSOpenGLView.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
29B97313FDCFA39411CA2CEA /* Project object */ = {
isa = PBXProject;
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "NSOpenGLView" */;
compatibilityVersion = "Xcode 2.4";
developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
en,
);
mainGroup = 29B97314FDCFA39411CA2CEA /* NSOpenGLView */;
projectDirPath = "";
projectReferences = (
{
ProductGroup = FE3869EB15267FAD007CC8C7 /* Products */;
ProjectRef = FE3869EA15267FAD007CC8C7 /* Cocoa.xcodeproj */;
},
);
projectRoot = "";
targets = (
8D1107260486CEB800E47090 /* NSOpenGLView-MacOS */,
FE4733510C876FA1002B72EF /* NSOpenGLView-Windows */,
);
};
/* End PBXProject section */
/* Begin PBXReferenceProxy section */
FE386A3D15267FB1007CC8C7 /* Cocoa.framework */ = {
isa = PBXReferenceProxy;
fileType = wrapper.framework;
path = Cocoa.framework;
remoteRef = FE386A3C15267FB1007CC8C7 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
FE386A3F15267FB1007CC8C7 /* Cocoa.framework */ = {
isa = PBXReferenceProxy;
fileType = wrapper.framework;
path = Cocoa.framework;
remoteRef = FE386A3E15267FB1007CC8C7 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
FE386A4115267FB1007CC8C7 /* Cocoa.framework */ = {
isa = PBXReferenceProxy;
fileType = wrapper.framework;
path = Cocoa.framework;
remoteRef = FE386A4015267FB1007CC8C7 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
FE386A4315267FB1007CC8C7 /* Cocoa.framework */ = {
isa = PBXReferenceProxy;
fileType = wrapper.framework;
path = Cocoa.framework;
remoteRef = FE386A4215267FB1007CC8C7 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
/* End PBXReferenceProxy section */
/* Begin PBXResourcesBuildPhase section */
8D1107290486CEB800E47090 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
8D11072A0486CEB800E47090 /* MainMenu.nib in Resources */,
8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */,
FEBEB04E0C96D3EE002C9F50 /* Localizable.strings in Resources */,
FEBEB0520C96D3FD002C9F50 /* Localizable-windows.strings in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
FE4733520C876FA1002B72EF /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
FE4733530C876FA1002B72EF /* MainMenu.nib in Resources */,
FE4733540C876FA1002B72EF /* InfoPlist.strings in Resources */,
FEBEB04F0C96D3EE002C9F50 /* Localizable.strings in Resources */,
FEBEB0530C96D3FD002C9F50 /* Localizable-windows.strings in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
FE2D932D0D491258005B7813 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "/Developer/Cocotron/1.0/bin/retargetBundle -framework Foundation -framework AppKit -destination $TARGET_BUILD_DIR\"/\"$EXECUTABLE_FOLDER_PATH\n";
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
8D11072C0486CEB800E47090 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
8D11072D0486CEB800E47090 /* main.m in Sources */,
FE472DAE0C85A959002B72EF /* MyOpenGLView.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
FE4733550C876FA1002B72EF /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
FE4733560C876FA1002B72EF /* main.m in Sources */,
FE4733570C876FA1002B72EF /* MyOpenGLView.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
FE386A4915267FC9007CC8C7 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = "Cocoa-Windows-i386";
targetProxy = FE386A4815267FC9007CC8C7 /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin PBXVariantGroup section */
089C165CFE840E0CC02AAC07 /* InfoPlist.strings */ = {
isa = PBXVariantGroup;
children = (
089C165DFE840E0CC02AAC07 /* English */,
);
name = InfoPlist.strings;
sourceTree = "<group>";
};
29B97318FDCFA39411CA2CEA /* MainMenu.nib */ = {
isa = PBXVariantGroup;
children = (
29B97319FDCFA39411CA2CEA /* English */,
);
name = MainMenu.nib;
sourceTree = "<group>";
};
FEBEB04D0C96D3EE002C9F50 /* Localizable.strings */ = {
isa = PBXVariantGroup;
children = (
FEBEB00E0C96D208002C9F50 /* English */,
);
name = Localizable.strings;
sourceTree = "<group>";
};
FEBEB0510C96D3FD002C9F50 /* Localizable-windows.strings */ = {
isa = PBXVariantGroup;
children = (
FEBEB0160C96D228002C9F50 /* English */,
);
name = "Localizable-windows.strings";
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
C01FCF4C08A954540054247B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
GCC_MODEL_TUNING = "";
GCC_OPTIMIZATION_LEVEL = 1;
INFOPLIST_FILE = Info.plist;
INSTALL_PATH = "$(HOME)/Applications";
PRODUCT_NAME = NSOpenGLView;
SDKROOT = "";
WRAPPER_EXTENSION = app;
};
name = Release;
};
C01FCF5008A954540054247B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
PREBINDING = NO;
SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;
};
name = Release;
};
FE47335C0C876FA1002B72EF /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = i386;
COPY_PHASE_STRIP = YES;
EFFECTIVE_PLATFORM_NAME = "-windows";
EXECUTABLE_FOLDER_PATH = "$(CONTENTS_FOLDER_PATH)/Windows";
EXECUTABLE_SUFFIX = .exe;
FRAMEWORK_SEARCH_PATHS = /Developer/Cocotron/1.0/Windows/i386/Frameworks;
GCC_DYNAMIC_NO_PIC = NO;
GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
GCC_MODEL_TUNING = "";
GCC_PRECOMPILE_PREFIX_HEADER = NO;
GCC_VERSION = org.cocotron.1.0.windows.i386.gcc.4.3.1;
INFOPLIST_FILE = Info.plist;
INSTALL_PATH = "$(HOME)/Applications";
OTHER_LDFLAGS = (
"-Wl,--enable-auto-import",
"-mwindows",
"-lopengl32",
);
PREBINDING = NO;
PRODUCT_NAME = NSOpenGLView;
SDKROOT = "";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "NSOpenGLView-MacOS" */ = {
isa = XCConfigurationList;
buildConfigurations = (
C01FCF4C08A954540054247B /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
C01FCF4E08A954540054247B /* Build configuration list for PBXProject "NSOpenGLView" */ = {
isa = XCConfigurationList;
buildConfigurations = (
C01FCF5008A954540054247B /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
FE47335B0C876FA1002B72EF /* Build configuration list for PBXNativeTarget "NSOpenGLView-Windows" */ = {
isa = XCConfigurationList;
buildConfigurations = (
FE47335C0C876FA1002B72EF /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 29B97313FDCFA39411CA2CEA /* Project object */;
}

View File

@ -0,0 +1,84 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "NO">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8D1107260486CEB800E47090"
BuildableName = "NSOpenGLView.app"
BlueprintName = "NSOpenGLView-MacOS"
ReferencedContainer = "container:NSOpenGLView.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Release">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8D1107260486CEB800E47090"
BuildableName = "NSOpenGLView.app"
BlueprintName = "NSOpenGLView-MacOS"
ReferencedContainer = "container:NSOpenGLView.xcodeproj">
</BuildableReference>
</MacroExpansion>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8D1107260486CEB800E47090"
BuildableName = "NSOpenGLView.app"
BlueprintName = "NSOpenGLView-MacOS"
ReferencedContainer = "container:NSOpenGLView.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8D1107260486CEB800E47090"
BuildableName = "NSOpenGLView.app"
BlueprintName = "NSOpenGLView-MacOS"
ReferencedContainer = "container:NSOpenGLView.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Release">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -0,0 +1,84 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "NO">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "FE4733510C876FA1002B72EF"
BuildableName = "NSOpenGLView.app"
BlueprintName = "NSOpenGLView-Windows"
ReferencedContainer = "container:NSOpenGLView.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Deployment">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "FE4733510C876FA1002B72EF"
BuildableName = "NSOpenGLView.app"
BlueprintName = "NSOpenGLView-Windows"
ReferencedContainer = "container:NSOpenGLView.xcodeproj">
</BuildableReference>
</MacroExpansion>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.GDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "FE4733510C876FA1002B72EF"
BuildableName = "NSOpenGLView.app"
BlueprintName = "NSOpenGLView-Windows"
ReferencedContainer = "container:NSOpenGLView.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Deployment"
debugDocumentVersioning = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "FE4733510C876FA1002B72EF"
BuildableName = "NSOpenGLView.app"
BlueprintName = "NSOpenGLView-Windows"
ReferencedContainer = "container:NSOpenGLView.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Deployment">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Deployment"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -0,0 +1,14 @@
//
// main.m
// OpenGLView
//
// Created by Christopher Lloyd on 8/29/07.
// Copyright __MyCompanyName__ 2007. All rights reserved.
//
#import <Cocoa/Cocoa.h>
int main(int argc, char *argv[])
{
return NSApplicationMain(argc, (const char **) argv);
}

View File

@ -0,0 +1,29 @@
{\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 diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@ -0,0 +1,396 @@
<?xml version="1.0" encoding="UTF-8"?>
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="8.00">
<data>
<int key="IBDocument.SystemTarget">1060</int>
<string key="IBDocument.SystemVersion">10K549</string>
<string key="IBDocument.InterfaceBuilderVersion">1938</string>
<string key="IBDocument.AppKitVersion">1038.36</string>
<string key="IBDocument.HIToolboxVersion">461.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="NS.object.0">1938</string>
</object>
<array key="IBDocument.IntegratedClassDependencies">
<string>NSScrollView</string>
<string>NSWindowTemplate</string>
<string>NSView</string>
<string>NSTextView</string>
<string>NSCustomObject</string>
<string>NSScroller</string>
</array>
<array key="IBDocument.PluginDependencies">
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
</array>
<object class="NSMutableDictionary" key="IBDocument.Metadata">
<string key="NS.key.0">PluginDependencyRecalculationVersion</string>
<integer value="1" key="NS.object.0"/>
</object>
<array class="NSMutableArray" key="IBDocument.RootObjects" id="1021700397">
<object class="NSCustomObject" id="127645324">
<string key="NSClassName">MyDocument</string>
</object>
<object class="NSCustomObject" id="785203460">
<string key="NSClassName">FirstResponder</string>
</object>
<object class="NSCustomObject" id="328156411">
<string key="NSClassName">NSApplication</string>
</object>
<object class="NSWindowTemplate" id="282058195">
<int key="NSWindowStyleMask">15</int>
<int key="NSWindowBacking">2</int>
<string key="NSWindowRect">{{608, 357}, {489, 597}}</string>
<int key="NSWTFlags">1886912512</int>
<string key="NSWindowTitle">Window</string>
<string key="NSWindowClass">NSWindow</string>
<string key="NSViewClass">View</string>
<string key="NSWindowContentMinSize">{94, 86}</string>
<object class="NSView" key="NSWindowView" id="908518746">
<reference key="NSNextResponder"/>
<int key="NSvFlags">256</int>
<array class="NSMutableArray" key="NSSubviews">
<object class="NSScrollView" id="221022647">
<reference key="NSNextResponder" ref="908518746"/>
<int key="NSvFlags">274</int>
<array class="NSMutableArray" key="NSSubviews">
<object class="NSClipView" id="603049513">
<reference key="NSNextResponder" ref="221022647"/>
<int key="NSvFlags">2304</int>
<array class="NSMutableArray" key="NSSubviews">
<object class="NSTextView" id="372262679">
<reference key="NSNextResponder" ref="603049513"/>
<int key="NSvFlags">2322</int>
<string key="NSFrame">{{0, 1}, {472, 14}}</string>
<reference key="NSSuperview" ref="603049513"/>
<reference key="NSWindow"/>
<object class="NSTextContainer" key="NSTextContainer" id="813596428">
<object class="NSLayoutManager" key="NSLayoutManager">
<object class="NSTextStorage" key="NSTextStorage">
<object class="NSMutableString" key="NSString">
<characters key="NS.bytes"/>
</object>
<nil key="NSDelegate"/>
</object>
<array class="NSMutableArray" key="NSTextContainers">
<reference ref="813596428"/>
</array>
<int key="NSLMFlags">6</int>
<nil key="NSDelegate"/>
</object>
<reference key="NSTextView" ref="372262679"/>
<double key="NSWidth">472</double>
<int key="NSTCFlags">1</int>
</object>
<object class="NSTextViewSharedData" key="NSSharedData">
<int key="NSFlags">11239</int>
<int key="NSTextCheckingTypes">0</int>
<nil key="NSMarkedAttributes"/>
<object class="NSColor" key="NSBackgroundColor" id="416091644">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MQA</bytes>
</object>
<dictionary key="NSSelectedAttributes">
<object class="NSColor" key="NSBackgroundColor">
<int key="NSColorSpace">6</int>
<string key="NSCatalogName">System</string>
<string key="NSColorName">selectedTextBackgroundColor</string>
<object class="NSColor" key="NSColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MC42NjY2NjY2NjY3AA</bytes>
</object>
</object>
<object class="NSColor" key="NSColor">
<int key="NSColorSpace">6</int>
<string key="NSCatalogName">System</string>
<string key="NSColorName">selectedTextColor</string>
<object class="NSColor" key="NSColor" id="157287896">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MAA</bytes>
</object>
</object>
</dictionary>
<reference key="NSInsertionColor" ref="157287896"/>
<dictionary key="NSLinkAttributes">
<object class="NSColor" key="NSColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MCAwIDEAA</bytes>
</object>
<integer value="1" key="NSUnderline"/>
</dictionary>
<nil key="NSDefaultParagraphStyle"/>
</object>
<int key="NSTVFlags">6</int>
<string key="NSMaxSize">{478, 1e+07}</string>
<string key="NSMinize">{114, 0}</string>
<nil key="NSDelegate"/>
</object>
</array>
<string key="NSFrame">{{1, 1}, {472, 596}}</string>
<reference key="NSSuperview" ref="221022647"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="372262679"/>
<reference key="NSDocView" ref="372262679"/>
<reference key="NSBGColor" ref="416091644"/>
<object class="NSCursor" key="NSCursor">
<string key="NSHotSpot">{4, 5}</string>
<object class="NSImage" key="NSImage">
<int key="NSImageFlags">12582912</int>
<array class="NSMutableArray" key="NSReps">
<array>
<integer value="0"/>
<object class="NSBitmapImageRep">
<object class="NSData" key="NSTIFFRepresentation">
<bytes key="NS.bytes">TU0AKgAAAHCAFUqgBVKsAAAAwdVQUqwaEQeIRGJRGFlYqwWLQ+JxuOQpVRmEx2RROKwOQyOUQSPyaUym
SxqWyKXyeYxyZzWbSuJTScRCbz2Nz+gRKhUOfTqeUai0OSxiWTiBQSHSGFquGwekxyAgAAAOAQAAAwAA
AAEAEAAAAQEAAwAAAAEAEAAAAQIAAwAAAAIACAAIAQMAAwAAAAEABQAAAQYAAwAAAAEAAQAAAREABAAA
AAEAAAAIARIAAwAAAAEAAQAAARUAAwAAAAEAAgAAARYAAwAAAAEAEAAAARcABAAAAAEAAABnARwAAwAA
AAEAAQAAAT0AAwAAAAEAAgAAAVIAAwAAAAEAAQAAAVMAAwAAAAIAAQABAAAAAA</bytes>
</object>
</object>
</array>
</array>
<object class="NSColor" key="NSColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MCAwAA</bytes>
</object>
</object>
</object>
<int key="NScvFlags">4</int>
</object>
<object class="NSScroller" id="652222646">
<reference key="NSNextResponder" ref="221022647"/>
<int key="NSvFlags">256</int>
<string key="NSFrame">{{473, 1}, {15, 596}}</string>
<reference key="NSSuperview" ref="221022647"/>
<reference key="NSWindow"/>
<reference key="NSTarget" ref="221022647"/>
<string key="NSAction">_doScroller:</string>
<double key="NSCurValue">1</double>
</object>
<object class="NSScroller" id="682008607">
<reference key="NSNextResponder" ref="221022647"/>
<int key="NSvFlags">-2147483392</int>
<string key="NSFrame">{{-100, -100}, {87, 18}}</string>
<reference key="NSSuperview" ref="221022647"/>
<reference key="NSWindow"/>
<int key="NSsFlags">1</int>
<reference key="NSTarget" ref="221022647"/>
<string key="NSAction">_doScroller:</string>
<double key="NSCurValue">1</double>
<double key="NSPercent">0.94565218687057495</double>
</object>
</array>
<string key="NSFrameSize">{489, 598}</string>
<reference key="NSSuperview" ref="908518746"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="603049513"/>
<int key="NSsFlags">18</int>
<reference key="NSVScroller" ref="652222646"/>
<reference key="NSHScroller" ref="682008607"/>
<reference key="NSContentView" ref="603049513"/>
</object>
</array>
<string key="NSFrameSize">{489, 597}</string>
<reference key="NSSuperview"/>
<reference key="NSWindow"/>
</object>
<string key="NSScreenRect">{{0, 0}, {1920, 1178}}</string>
<string key="NSMinSize">{94, 108}</string>
<string key="NSMaxSize">{1e+13, 1e+13}</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">window</string>
<reference key="source" ref="127645324"/>
<reference key="destination" ref="282058195"/>
</object>
<int key="connectionID">18</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">_textView</string>
<reference key="source" ref="127645324"/>
<reference key="destination" ref="372262679"/>
</object>
<int key="connectionID">23</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">delegate</string>
<reference key="source" ref="282058195"/>
<reference key="destination" ref="127645324"/>
</object>
<int key="connectionID">17</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">delegate</string>
<reference key="source" ref="372262679"/>
<reference key="destination" ref="127645324"/>
</object>
<int key="connectionID">24</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="1021700397"/>
<nil key="parent"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">-2</int>
<reference key="object" ref="127645324"/>
<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="785203460"/>
<reference key="parent" ref="0"/>
<string key="objectName">First Responder</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">5</int>
<reference key="object" ref="282058195"/>
<array class="NSMutableArray" key="children">
<reference ref="908518746"/>
</array>
<reference key="parent" ref="0"/>
<string key="objectName">Window</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">6</int>
<reference key="object" ref="908518746"/>
<array class="NSMutableArray" key="children">
<reference ref="221022647"/>
</array>
<reference key="parent" ref="282058195"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">21</int>
<reference key="object" ref="221022647"/>
<array class="NSMutableArray" key="children">
<reference ref="372262679"/>
<reference ref="682008607"/>
<reference ref="652222646"/>
</array>
<reference key="parent" ref="908518746"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">22</int>
<reference key="object" ref="372262679"/>
<reference key="parent" ref="221022647"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">26</int>
<reference key="object" ref="682008607"/>
<reference key="parent" ref="221022647"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">27</int>
<reference key="object" ref="652222646"/>
<reference key="parent" ref="221022647"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">-3</int>
<reference key="object" ref="328156411"/>
<reference key="parent" ref="0"/>
<string key="objectName">Application</string>
</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="21.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="22.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="26.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="27.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="5.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="6.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">27</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
<object class="IBPartialClassDescription">
<string key="className">MyDocument</string>
<string key="superclassName">NSDocument</string>
<object class="NSMutableDictionary" key="outlets">
<string key="NS.key.0">_textView</string>
<string key="NS.object.0">NSTextView</string>
</object>
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
<string key="NS.key.0">_textView</string>
<object class="IBToOneOutletInfo" key="NS.object.0">
<string key="name">_textView</string>
<string key="candidateClassName">NSTextView</string>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/MyDocument.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSDocument</string>
<dictionary class="NSMutableDictionary" key="actions">
<string key="printDocument:">id</string>
<string key="revertDocumentToSaved:">id</string>
<string key="runPageLayout:">id</string>
<string key="saveDocument:">id</string>
<string key="saveDocumentAs:">id</string>
<string key="saveDocumentTo:">id</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="actionInfosByName">
<object class="IBActionInfo" key="printDocument:">
<string key="name">printDocument:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="revertDocumentToSaved:">
<string key="name">revertDocumentToSaved:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="runPageLayout:">
<string key="name">runPageLayout:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="saveDocument:">
<string key="name">saveDocument:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="saveDocumentAs:">
<string key="name">saveDocumentAs:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="saveDocumentTo:">
<string key="name">saveDocumentTo:</string>
<string key="candidateClassName">id</string>
</object>
</dictionary>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/NSDocument.h</string>
</object>
</object>
</array>
</object>
<int key="IBDocument.localizationMode">0</int>
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencies">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.macosx</string>
<integer value="1060" key="NS.object.0"/>
</object>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
</data>
</archive>

Binary file not shown.

View File

@ -0,0 +1,71 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//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>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>txt</string>
</array>
<key>CFBundleTypeName</key>
<string>txt file</string>
<key>CFBundleTypeOSTypes</key>
<array>
<string>????</string>
</array>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>LSTypeIsPackage</key>
<false/>
<key>NSDocumentClass</key>
<string>MyDocument</string>
<key>NSPersistentStoreTypeKey</key>
<string>Binary</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>text</string>
</array>
<key>CFBundleTypeIconFile</key>
<string></string>
<key>CFBundleTypeName</key>
<string>text file</string>
<key>CFBundleTypeOSTypes</key>
<array>
<string>????</string>
</array>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>LSTypeIsPackage</key>
<false/>
<key>NSDocumentClass</key>
<string>MyDocument</string>
</dict>
</array>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>org.cocotron.TextEditor</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>NSMainNibFile</key>
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
</dict>
</plist>

View File

@ -0,0 +1,17 @@
/* Copyright (c) 2006 Christopher J. W. Lloyd
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#import <Cocoa/Cocoa.h>
@interface MyDocument : NSDocument
{
IBOutlet NSTextView *_textView;
NSString *_string;
}
@end

View File

@ -0,0 +1,51 @@
/* Copyright (c) 2006 Christopher J. W. Lloyd
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#import "MyDocument.h"
@implementation MyDocument
-init {
[super init];
_string=@"";
return self;
}
-(NSString *)windowNibName {
return @"MyDocument";
}
- (void)windowControllerDidLoadNib:(NSWindowController *) aController {
[super windowControllerDidLoadNib:aController];
[[[_textView textStorage] mutableString] setString:_string];
[_string release];
_string=nil;
}
- (NSData *)dataRepresentationOfType:(NSString *)aType {
return [[[_textView textStorage] string] dataUsingEncoding:NSISOLatin1StringEncoding];
}
- (BOOL)loadDataRepresentation:(NSData *)data ofType:(NSString *)aType {
_string=[[NSString alloc] initWithData:data encoding:NSISOLatin1StringEncoding];
if(_textView!=nil){ // for revert
[[[_textView textStorage] mutableString] setString:_string];
[_string release];
_string=nil;
}
return YES;
}
-(void)textDidChange:(NSNotification *)note {
[self updateChangeCount:NSChangeDone];
}
@end

Some files were not shown because too many files have changed in this diff Show More