Merge with the trunk with a few fixes

- make the JPEG exporters to work by including proper library-installation detection and not using unimplemented API
- disable/comment special observing on addXXX: & removeXXX: method, that throw exceptions when you have some of these methods not using NSSet
- repair the NS<geometry>FromString methods ('{%g,%g}' is a good scan string, not '{"%g","%g"}')
- keep our branch changes on Win32 keyboard handling as it supports dead-keys
This commit is contained in:
Airy ANDRE 2012-11-28 18:34:54 +01:00
commit 8f07b0bdc6
423 changed files with 27659 additions and 10325 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 */
@ -2157,6 +2157,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 */; };
@ -3491,6 +3499,9 @@
FE99DA7B128396B6006D789F /* O2Encoder_PNG.m in Sources */ = {isa = PBXBuildFile; fileRef = FE99DA73128396B6006D789F /* O2Encoder_PNG.m */; };
FE99DA7C128396B6006D789F /* O2Encoder_PNG.h in Headers */ = {isa = PBXBuildFile; fileRef = FE99DA72128396B6006D789F /* O2Encoder_PNG.h */; };
FE99DA7D128396B6006D789F /* O2Encoder_PNG.m in Sources */ = {isa = PBXBuildFile; fileRef = FE99DA73128396B6006D789F /* O2Encoder_PNG.m */; };
FE9ACF13155EF59D002AFCA9 /* O2ImageDecoder_JPEG_libjpeg.m in Sources */ = {isa = PBXBuildFile; fileRef = FE9ACF10155EF59D002AFCA9 /* O2ImageDecoder_JPEG_libjpeg.m */; };
FE9ACF14155EF59D002AFCA9 /* O2ImageDecoder_JPEG_stb.m in Sources */ = {isa = PBXBuildFile; fileRef = FE9ACF11155EF59D002AFCA9 /* O2ImageDecoder_JPEG_stb.m */; };
FE9ACF15155EF59D002AFCA9 /* O2ImageDecoder.m in Sources */ = {isa = PBXBuildFile; fileRef = FE9ACF12155EF59D002AFCA9 /* O2ImageDecoder.m */; };
FE9DB3D50FD6BD5A00A1CE17 /* NSRangeEntries.h in Headers */ = {isa = PBXBuildFile; fileRef = FEA318290FD5961100F480D4 /* NSRangeEntries.h */; };
FE9DB3D60FD6BD5A00A1CE17 /* NSRangeEntries.h in Headers */ = {isa = PBXBuildFile; fileRef = FEA318290FD5961100F480D4 /* NSRangeEntries.h */; };
FE9DB3D70FD6BD5B00A1CE17 /* NSRangeEntries.h in Headers */ = {isa = PBXBuildFile; fileRef = FEA318290FD5961100F480D4 /* NSRangeEntries.h */; };
@ -5027,6 +5038,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; };
@ -5352,6 +5371,9 @@
FE953DD9103B0EA0008A71F0 /* NSEvent_other.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSEvent_other.m; sourceTree = "<group>"; };
FE99DA72128396B6006D789F /* O2Encoder_PNG.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = O2Encoder_PNG.h; sourceTree = "<group>"; };
FE99DA73128396B6006D789F /* O2Encoder_PNG.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = O2Encoder_PNG.m; sourceTree = "<group>"; };
FE9ACF10155EF59D002AFCA9 /* O2ImageDecoder_JPEG_libjpeg.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = O2ImageDecoder_JPEG_libjpeg.m; sourceTree = "<group>"; };
FE9ACF11155EF59D002AFCA9 /* O2ImageDecoder_JPEG_stb.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = O2ImageDecoder_JPEG_stb.m; sourceTree = "<group>"; };
FE9ACF12155EF59D002AFCA9 /* O2ImageDecoder.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = O2ImageDecoder.m; sourceTree = "<group>"; };
FEA25F960EECCE4D008750D0 /* NSSound_win32.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSSound_win32.h; sourceTree = "<group>"; };
FEA25F970EECCE4D008750D0 /* NSSound_win32.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSSound_win32.m; sourceTree = "<group>"; };
FEA2CD1C10D6C1C0003C8FF5 /* O2Surface_cairo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = O2Surface_cairo.h; sourceTree = "<group>"; };
@ -6428,20 +6450,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 */,
);
@ -6560,6 +6590,9 @@
FE5C0EE511638FC600065D1C /* Onyx2D */ = {
isa = PBXGroup;
children = (
FE9ACF10155EF59D002AFCA9 /* O2ImageDecoder_JPEG_libjpeg.m */,
FE9ACF11155EF59D002AFCA9 /* O2ImageDecoder_JPEG_stb.m */,
FE9ACF12155EF59D002AFCA9 /* O2ImageDecoder.m */,
FE5F4BF712A83CA600F5F334 /* platform_Windows */,
49A7975114224021001CE4C2 /* O2Encoder_JPG.h */,
49A7975214224021001CE4C2 /* O2Encoder_JPG.m */,
@ -8990,8 +9023,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 = (
@ -9415,6 +9451,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;
};
@ -10460,6 +10504,9 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
FE9ACF13155EF59D002AFCA9 /* O2ImageDecoder_JPEG_libjpeg.m in Sources */,
FE9ACF14155EF59D002AFCA9 /* O2ImageDecoder_JPEG_stb.m in Sources */,
FE9ACF15155EF59D002AFCA9 /* O2ImageDecoder.m in Sources */,
FE01A9540C5D9BCB00AEA51A /* NSActionCell.m in Sources */,
FE01A9550C5D9BCB00AEA51A /* NSAlertPanel.m in Sources */,
FE01A9560C5D9BCB00AEA51A /* NSApplication.m in Sources */,
@ -11842,6 +11889,7 @@
6E2B57760976075500DA0954 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
};
name = Release;
};
@ -11850,7 +11898,6 @@
baseConfigurationReference = FE70846E1431168800B99A95 /* windows-i386-framework.xcconfig */;
buildSettings = {
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = stabs;
GCC_ENABLE_CPP_EXCEPTIONS = NO;
GCC_ENABLE_CPP_RTTI = NO;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
@ -11894,7 +11941,6 @@
"-Wl,--export-all-symbols",
"-Wl,--out-implib,$TARGET_BUILD_DIR/AppKit.framework/libAppKit.a",
);
PREBINDING = NO;
PRODUCT_NAME = AppKit;
};
name = Debug;
@ -11902,6 +11948,7 @@
7E891F4E0D4967B6008150D3 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
};
name = Debug;
};
@ -11952,7 +11999,6 @@
"-lfreetype",
"-lfontconfig",
);
PREBINDING = NO;
PRODUCT_NAME = AppKit;
STRIP_INSTALLED_PRODUCT = YES;
SYMROOT = build/Linux/i386;
@ -12005,7 +12051,6 @@
"-lfreetype",
"-lfontconfig",
);
PREBINDING = NO;
PRODUCT_NAME = AppKit;
SYMROOT = build/Linux/i386;
};
@ -12027,7 +12072,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,
@ -12062,7 +12107,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;
@ -12085,6 +12129,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,
@ -12119,7 +12164,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;
};
@ -12129,7 +12173,6 @@
isa = XCBuildConfiguration;
baseConfigurationReference = FE70846E1431168800B99A95 /* windows-i386-framework.xcconfig */;
buildSettings = {
DEBUG_INFORMATION_FORMAT = stabs;
GCC_ENABLE_CPP_EXCEPTIONS = NO;
GCC_ENABLE_CPP_RTTI = NO;
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
@ -12186,7 +12229,6 @@
"-Wl,--export-all-symbols",
"-Wl,--out-implib,$TARGET_BUILD_DIR/AppKit.framework/libAppKit.a",
);
PREBINDING = NO;
PRODUCT_NAME = AppKit;
};
name = Release;
@ -12237,7 +12279,6 @@
"-lfreetype",
"-lfontconfig",
);
PREBINDING = NO;
PRODUCT_NAME = AppKit;
STRIP_INSTALLED_PRODUCT = NO;
SYMROOT = build/FreeBSD/i386;
@ -12288,7 +12329,6 @@
"-lfreetype",
"-lfontconfig",
);
PREBINDING = NO;
PRODUCT_NAME = AppKit;
SYMROOT = build/FreeBSD/i386;
};
@ -12327,7 +12367,6 @@
"-framework",
ApplicationServices,
);
PREBINDING = NO;
PRODUCT_NAME = AppKit;
STRIP_INSTALLED_PRODUCT = YES;
SYMROOT = build/MacOS/i386;
@ -12357,7 +12396,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\"";
@ -12382,7 +12421,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,65 @@ 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];
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

@ -598,6 +598,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
-(NSData *)TIFFRepresentationUsingCompression:(NSTIFFCompression)compression factor:(float)factor {
NSMutableArray *bitmaps=[NSMutableArray array];
for(NSImageRep *check in _representations){
if([check isKindOfClass:[NSBitmapImageRep class]]) {
[bitmaps addObject:check];
@ -616,15 +617,17 @@ 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];
// we should probably use -draw here but not all reps implement it, or not?
[check draw];
[self unlockFocus];
[bitmaps addObject:image];
[image release];
}
}
return [NSBitmapImageRep TIFFRepresentationOfImageRepsInArray:bitmaps usingCompression:compression factor:factor];
}
}
return [NSBitmapImageRep TIFFRepresentationOfImageRepsInArray:bitmaps usingCompression:compression factor:factor];
}
-(void)lockFocus {
@ -677,12 +680,13 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
// Some fake view, just so the context knows if it's flipped or not
NSView *view = [[[NSImageCacheView alloc] initWithFlipped:[self isFlipped]] autorelease];
[[context focusStack] addObject:self];
[[context focusStack] addObject:self];
if([self isFlipped]){
CGAffineTransform flip={1,0,0,-1,0,[self size].height};
CGContextConcatCTM(graphicsPort,flip);
}
}
-(void)unlockFocus {

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,20 +6,21 @@ 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 {
[_window release];
[_unprocessedEvents release];
[super dealloc];
}
@ -39,4 +40,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

@ -128,10 +128,16 @@ static NSAppleScrollBarVariant appleScrollBarVariant(NSScroller *self){
return _controlSize; }
-(void)setFloatValue:(float)zeroToOneValue knobProportion:(float)zeroToOneKnob {
_floatValue=zeroToOneValue;
if(_floatValue>1)
_floatValue=1;
if(zeroToOneValue>1)
zeroToOneValue=1;
if(zeroToOneValue<0)
zeroToOneValue=0;
if(zeroToOneKnob>1)
zeroToOneKnob=1;
if(zeroToOneKnob<0)
zeroToOneKnob=0;
_floatValue=zeroToOneValue;
_knobProportion=zeroToOneKnob;
if(_knobProportion>1)
_knobProportion=1;
@ -139,6 +145,21 @@ static NSAppleScrollBarVariant appleScrollBarVariant(NSScroller *self){
[self setNeedsDisplay:YES];
}
-(double)doubleValue {
return _floatValue;
}
-(void)setDoubleValue:(double)zeroToOneValue {
if(zeroToOneValue>1)
zeroToOneValue=1;
if(zeroToOneValue<0)
zeroToOneValue=0;
_floatValue=zeroToOneValue;
[self setNeedsDisplay:YES];
}
-(void)setArrowsPosition:(NSScrollArrowPosition)position {
_arrowsPosition=position;
}
@ -537,4 +558,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 {
@ -241,8 +248,25 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
}
-(void)setStringValue:(NSString *)value {
[super setStringValue:value];
[_currentEditor setString:[self stringValue]];
NSRange selectedRange=[_currentEditor selectedRange];
BOOL isEntireString=NSEqualRanges(selectedRange, NSMakeRange(0, [[_currentEditor string] length]));
[super setStringValue:value];
[_currentEditor setString:[self stringValue]];
NSRange entireString=NSMakeRange(0, [[_currentEditor string] length]);
if(isEntireString) {
// NSTextField will re-select entire string on a setString: if the previous value is completely selected
[_currentEditor setSelectedRange:entireString];
}
else {
// otherwise it will re-select what it can
selectedRange=NSIntersectionRange(selectedRange, entireString);
if(selectedRange.length==0) // 0 on intersection is undefined location, so we have to set it
selectedRange.location=0;
[_currentEditor setSelectedRange:entireString];
}
}
-(void)setFont:(NSFont *)font {

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

@ -268,6 +268,13 @@ NSString * const NSOldSelectedCharacterRange=@"NSOldSelectedCharacterRange";
return YES;
}
-(BOOL)canBecomeKeyView {
if(![self isEditable])
return NO;
return [super canBecomeKeyView];
}
-(BOOL)needsPanelToBecomeKey {
return YES;
}
@ -2314,17 +2321,20 @@ NSString * const NSOldSelectedCharacterRange=@"NSOldSelectedCharacterRange";
if(![self isVerticallyResizable])
size.height=[self frame].size.height;
else {
size.height=MAX([self frame].size.height,size.height);
NSView *clipView=(NSClipView *)[self superview];
if([clipView isKindOfClass:[NSClipView class]]){
if(size.height<[clipView bounds].size.height)
size.height=[clipView bounds].size.height;
if(size.width<[clipView bounds].size.width)
size.width=[clipView bounds].size.width;
}
NSClipView *clipView=(NSClipView *)[self superview];
if([clipView isKindOfClass:[NSClipView class]]){
// if we're in a clip view we should at be at least as big as the clip view
if(size.height<[clipView bounds].size.height)
size.height=[clipView bounds].size.height;
if(size.width<[clipView bounds].size.width)
size.width=[clipView bounds].size.width;
}
else {
// we should at least be our frame size if we're not in a clip view
size.height=MAX([self frame].size.height,size.height);
}
}
if([self isHorizontallyResizable] || [self isVerticallyResizable])
[self setFrameSize:size];
@ -2435,8 +2445,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]];
}
}
@ -2259,23 +2255,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;
@ -1092,7 +1151,7 @@ NSString * const NSWindowDidAnimateNotification=@"NSWindowDidAnimateNotification
}
-(void)setAutorecalculatesKeyViewLoop:(BOOL)value {
_autorecalculatesKeyViewLoop=value;
_autorecalculatesKeyViewLoop=value;
}
-(void)setCanHide:(BOOL)value {
@ -1522,12 +1581,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 +1676,7 @@ NSString * const NSWindowDidAnimateNotification=@"NSWindowDidAnimateNotification
-(void)selectKeyViewFollowingView:(NSView *)view {
NSView *next=[view nextValidKeyView];
[self makeFirstResponder:next];
}
@ -1613,8 +1686,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 +1763,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 +2417,10 @@ NSString * const NSWindowDidAnimateNotification=@"NSWindowDidAnimateNotification
}
}
-(void)platformWindowShouldZoom:(CGWindow *)window {
[self zoom:nil];
}
-(void)miniaturize:sender {
[[self platformWindow] miniaturize];
}
@ -2637,8 +2735,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,19 +2757,21 @@ NSString * const NSWindowDidAnimateNotification=@"NSWindowDidAnimateNotification
}
-(void)platformWindow:(CGWindow *)window frameChanged:(NSRect)frame didSize:(BOOL)didSize {
// Don't allow the platform window changes to violate our window size limits (if we have them)
// Windows (for example) likes to make the platform window very small so it fits in the task bar...
if (NSEqualSizes([self minSize], NSMakeSize(0, 0)) == NO) {
frame.size.width = MAX(NSWidth(frame), [self minSize].width);
frame.size.height = MAX(NSHeight(frame), [self minSize].height);
}
// Don't allow the platform window changes to violate our window size limits (if we have them)
// Windows (for example) likes to make the platform window very small so it fits in the task bar...
if (NSEqualSizes([self minSize], NSMakeSize(0, 0)) == NO) {
frame.size.width = MAX(NSWidth(frame), [self minSize].width);
frame.size.height = MAX(NSHeight(frame), [self minSize].height);
}
if (NSEqualSizes([self maxSize], NSMakeSize(FLT_MAX, FLT_MAX)) == NO) {
frame.size.width = MIN(NSWidth(frame), [self maxSize].width);
frame.size.height = MIN(NSHeight(frame), [self maxSize].height);
}
_frame=frame;
if (NSEqualSizes([self maxSize], NSMakeSize(FLT_MAX, FLT_MAX)) == NO) {
frame.size.width = MIN(NSWidth(frame), [self maxSize].width);
frame.size.height = MIN(NSHeight(frame), [self maxSize].height);
}
// We don't want the miniaturized frame.
if(![self isMiniaturized])
_frame=frame;
_makeSureIsOnAScreen=YES;
@ -2968,7 +3068,7 @@ NSString * const NSWindowDidAnimateNotification=@"NSWindowDidAnimateNotification
return cursorIsSet;
}
-(NSUndoManager *)undoManager {
-(NSUndoManager *)undoManager {
if ([_delegate respondsToSelector:@selector(windowWillReturnUndoManager:)])
return [_delegate windowWillReturnUndoManager:self];
@ -2981,7 +3081,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

@ -58,7 +58,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

@ -157,8 +157,9 @@ static DWORD WINAPI runWaitCursor(LPVOID arg){
_cursorDisplayCount=1;
_cursorCache=[NSMutableDictionary new];
_pastLocation = [self mouseLocation];
_ignoringModifiersString = [NSMutableString new];
_ignoringModifiersString = [NSMutableString new];
[self loadPrivateFonts];
}
return self;
@ -793,18 +794,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;
int bufferSize=0,ignoringBufferSize=0;
BYTE keyState[256];
BYTE *keyState=keyboardState;
// GetKeyboardState(keyState);
// !!!! This code is able to get proper char events even for chars built using dead-keys, but we're loosing contents of KeyUp events.
// No idea why, but we are more in need for proper chars (especially for international users) than for proper KeyUp messages contents
//!!!!!!!!!!!!!!!!!!!!!
GetKeyboardState(keyState);
if (msg.message == WM_CHAR || msg.message == WM_SYSCHAR) {
// wParam is our unicode char
*buffer = msg.wParam;
@ -886,6 +887,7 @@ The values should be upgraded to something which is more generic to implement, p
case VK_INSERT: buffer[bufferSize++]=NSInsertFunctionKey; break;
case VK_DELETE: buffer[bufferSize++]=NSDeleteFunctionKey; break;
case VK_HELP: buffer[bufferSize++]=NSHelpFunctionKey; break;
case VK_LWIN: break;
case VK_RWIN: break;
case VK_APPS: break;
@ -994,18 +996,18 @@ The values should be upgraded to something which is more generic to implement, p
NSEvent *event;
float deltaY=((float)GET_WHEEL_DELTA_WPARAM(msg.wParam));
deltaY /= 120.f; // deltaY comes in units of 120 (for fractional rotations - when all you have is an int..)
deltaY /= 120.f; // deltaY comes in units of 120 (for fractional rotations - when all you have is an int..)
event=[NSEvent mouseEventWithType:type location:location modifierFlags:modifierFlags window:window deltaY:deltaY];
[self postEvent:event atStart:NO];
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)
@ -1051,6 +1053,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];
@ -1088,7 +1100,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;
@ -1103,35 +1115,26 @@ static HWND findWindowForScrollWheel(POINT point){
deviceLocation.y=GET_Y_LPARAM(msg.lParam);
if(msg.message==WM_MOUSEWHEEL) {
// The deviceLocation is relative to the screen - not the window - so we need to translate it into the
// client area
RECT r;
GetWindowRect(windowHandle,&r);
deviceLocation.x-=r.left;
deviceLocation.y-=r.top;
HWND scrollWheelWindow=findWindowForScrollWheel(deviceLocation);
// Scroll wheel events go to the window under the mouse regardless of key. Win32 set hwnd to the active window
// So we look for the window under the mouse and use that for the event.
POINT pt={GET_X_LPARAM(msg.lParam),GET_Y_LPARAM(msg.lParam)};
RECT r;
if(scrollWheelWindow!=NULL) {
windowHandle=scrollWheelWindow;
}
}
GetWindowRect(windowHandle,&r);
pt.x+=r.left;
pt.y+=r.top;
HWND scrollWheelWindow=findWindowForScrollWheel(pt);
if(scrollWheelWindow!=NULL)
windowHandle=scrollWheelWindow;
platformWindow=(id)GetProp(windowHandle,"Win32Window");
if (msg.message == WM_MOUSEWHEEL) {
// We've got more tweakage to do because we're not yet in client space - but now
// we know the window we can find out how thick the frame edges are and compensate for them
CGFloat top;
CGFloat left;
CGFloat bottom;
CGFloat right;
CGNativeBorderFrameWidthsForStyle( [platformWindow styleMask], &top, &left, &bottom, &right);
deviceLocation.x -= left;
deviceLocation.y -= top;
}
}
else {
platformWindow=(id)GetProp(msg.hwnd,"Win32Window");
}
if([platformWindow respondsToSelector:@selector(appkitWindow)])
window=[platformWindow performSelector:@selector(appkitWindow)];
@ -1158,27 +1161,26 @@ static HWND findWindowForScrollWheel(POINT point){
_lastPosition=msg.lParam;
}
TranslateMessage(&msg);
TranslateMessage(&msg);
switch(msg.message){
switch(msg.message){
case WM_KEYDOWN:
case WM_SYSKEYDOWN:
type=NSKeyDown;
break;
case WM_KEYDOWN:
case WM_SYSKEYDOWN:
type=NSKeyDown;
break;
case WM_KEYUP:
case WM_SYSKEYUP:
type=NSKeyUp;
break;
case WM_CHAR:
case WM_SYSCHAR:
type=NSKeyDown;
break;
case WM_KEYUP:
case WM_SYSKEYUP:
type=NSKeyUp;
break;
case WM_MOUSEMOVE:
case WM_CHAR:
case WM_SYSCHAR:
type=NSKeyDown;
break;
case WM_MOUSEMOVE:
[self _unhideCursorForMouseMove];
if(msg.wParam&MK_LBUTTON)
@ -1244,22 +1246,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:
@ -1276,7 +1294,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];
@ -1405,7 +1423,7 @@ static int CALLBACK buildTypeface(const LOGFONTA *lofFont_old,
setup.rtMargin.left = PTS2THOUSANDS([printInfo leftMargin]);
setup.rtMargin.right = PTS2THOUSANDS([printInfo rightMargin]);
setup.rtMargin.bottom = PTS2THOUSANDS([printInfo bottomMargin]);
[self stopWaitCursor];
int check = PageSetupDlg(&setup);
[self startWaitCursor];
@ -1463,18 +1481,18 @@ static int CALLBACK buildTypeface(const LOGFONTA *lofFont_old,
NSRect imageable;
if([context getImageableRect:&imageable])
[attributes setObject:[NSValue valueWithRect:imageable] forKey:@"_imageableRect"];
[attributes setObject:[NSValue valueWithRect:imageable] forKey:@"_imageableRect"];
[attributes setObject:context forKey:@"_KGContext"];
[attributes setObject:context forKey:@"_KGContext"];
[attributes setObject:[NSValue valueWithSize:[context pointSize]] forKey:NSPrintPaperSize];
[attributes setObject:[NSNumber numberWithInt:printProperties.nFromPage] forKey:NSPrintFirstPage];
[attributes setObject:[NSNumber numberWithInt:printProperties.nToPage] forKey:NSPrintLastPage];
// It seems Windows is drawing relatively to the imageable area, not the paper area, like Cocoa does - so translate the context
// to make Cocotron happy
O2AffineTransform translation = O2AffineTransformMakeTranslation(-imageable.origin.x, -imageable.origin.y);
O2ContextConcatCTM(context, translation);
[attributes setObject:[NSValue valueWithSize:[context pointSize]] forKey:NSPrintPaperSize];
[attributes setObject:[NSNumber numberWithInt:printProperties.nFromPage] forKey:NSPrintFirstPage];
[attributes setObject:[NSNumber numberWithInt:printProperties.nToPage] forKey:NSPrintLastPage];
// It seems Windows is drawing relatively to the imageable area, not the paper area, like Cocoa does - so translate the context
// to make Cocotron happy
O2AffineTransform translation = O2AffineTransformMakeTranslation(-imageable.origin.x, -imageable.origin.y);
O2ContextConcatCTM(context, translation);
}
return NSOKButton;

View File

@ -306,7 +306,7 @@ static WORD PaletteSize (VOID FAR * pv)
CGContextRef ctx = CGBitmapContextCreate(NULL, w, h, 8, 4*w, colorspace, kCGBitmapByteOrder32Little|kCGImageAlphaPremultipliedFirst);
CGColorSpaceRelease(colorspace);
// Contexts created on the Win32 platform are supposed to have a "dc" method
HDC dc = [(id)ctx dc];
HDC dc = (HDC)[(id)ctx dc];
if (dc) {
StretchDIBits(
dc,

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);
}

File diff suppressed because it is too large Load Diff

Binary file not shown.

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
@ -47,6 +47,21 @@ typedef struct {
}
@end
#ifdef __clang__
// has to be in sync with the __CFHost interface
struct __CFHost {
CFStringRef _name;
CFHostClientCallBack _callback;
CFHostClientContext _context;
Boolean _hasResolvedAddressing;
CFArrayRef _addressing;
CFHostRequest *_request;
#ifdef WINDOWS
HANDLE _event;
NSHandleMonitor_win32 *_monitor;
#endif
};
#endif
@implementation __CFHost
@ -66,23 +81,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 +107,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 +148,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 +164,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 +186,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 +203,7 @@ static unsigned addressResolverThread(void *arg){
request=NULL;
}
LeaveCriticalSection(&(info->queueLock));
if(request!=NULL){
if(request->_addressList!=NULL)
any_freeaddrinfo(request->_addressList);
@ -202,7 +217,7 @@ static unsigned addressResolverThread(void *arg){
}
}
return 0;
}
-(void)handleMonitorIndicatesSignaled:(NSHandleMonitor_win32 *)monitor {
@ -211,14 +226,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 +244,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 +262,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 +275,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 +322,7 @@ static void queueHostToAddressResolver(CFHostRef host){
}
info->queue[info->queueCount++]=host->_request;
LeaveCriticalSection(&(info->queueLock));
SetEvent(info->queueEvent);
}
}
@ -316,24 +331,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 +357,9 @@ static void cancelHostInAddressResolverIfNeeded(CFHostRef self){
break;
}
}
LeaveCriticalSection(&(info->queueLock));
if(self->_request!=NULL){
NSZoneFree(NULL,self->_request->_name);
NSZoneFree(NULL,self->_request);
@ -375,14 +390,17 @@ CFHostRef CFHostCreateWithAddress(CFAllocatorRef allocator,CFDataRef address) {
return 0;
}
CFHostRef CFHostCreateWithName(CFAllocatorRef allocator,CFStringRef name) {
CFHostRef result=[__CFHost allocWithZone:NULL];
result->_name=CFStringCreateCopy(allocator,name);
return result;
CFHostRef CFHostCreateWithName(CFAllocatorRef allocator, CFStringRef name)
{
CFHostRef result = (CFHostRef)[__CFHost allocWithZone:NULL];
result->_name = CFStringCreateCopy(allocator, name);
return result;
}
-(void)dealloc {
CFRelease(_name);
if(self->_context.info!=NULL && self->_context.release!=NULL)
@ -391,7 +409,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 +453,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 +490,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 +507,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 +524,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 +548,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

@ -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,6 +496,9 @@
/* Begin PBXProject section */
0867D690FE84028FC02AAC07 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0420;
};
buildConfigurationList = 1DEB91B108733DA50010E9CD /* Build configuration list for PBXProject "Cocoa" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
@ -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) {
@ -263,9 +265,9 @@ CFIndex CFArrayBSearchValues(CFArrayRef self,CFRange range,const void *value,CFC
// mutable
CFMutableArrayRef CFArrayCreateMutable(CFAllocatorRef allocator,CFIndex capacity,const CFArrayCallBacks *callBacks) {
return [[__CFArray allocWithZone:NULL] initWithCallBacks:callBacks];
CFMutableArrayRef CFArrayCreateMutable(CFAllocatorRef allocator, CFIndex capacity, const CFArrayCallBacks *callBacks)
{
return (CFMutableArrayRef)[[__CFArray allocWithZone:NULL] initWithCallBacks:callBacks];
}

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

@ -15,7 +15,7 @@ typedef struct __CFMutableData *CFMutableDataRef;
COREFOUNDATION_EXPORT CFTypeID CFDataGetTypeID(void);
COREFOUNDATION_EXPORT CFDataRef CFDataCreate(CFAllocatorRef allocator,const uint8_t *bytes,CFIndex length);
COREFOUNDATION_EXPORT CFDataRef CFDataCreateWithBytesNoCopy(CFAllocatorRef allocator,const uint8_t *bytes,CFIndex length,CFAllocatorRef bytesAllocator);
COREFOUNDATION_EXPORT CFDataRef CFDataCreateWithBytesNoCopy(CFAllocatorRef allocator,const uint8_t *bytes,CFIndex length,CFAllocatorRef bytesDeallocator);
COREFOUNDATION_EXPORT CFDataRef CFDataCreateCopy(CFAllocatorRef allocator,CFDataRef self);

View File

@ -24,9 +24,9 @@ CFDataRef CFDataCreate(CFAllocatorRef allocator,const uint8_t *bytes,CFIndex len
return ToCFData([[NSData allocWithZone:NULL] initWithBytes:bytes length:length]);
}
CFDataRef CFDataCreateWithBytesNoCopy(CFAllocatorRef allocator,const uint8_t *bytes,CFIndex length,CFAllocatorRef bytesAllocator){
NSUnimplementedFunction();
return 0;
CFDataRef CFDataCreateWithBytesNoCopy(CFAllocatorRef allocator,const uint8_t *bytes,CFIndex length,CFAllocatorRef bytesDeallocator){
NSUnimplementedFunction();
return 0;
}
CFDataRef CFDataCreateCopy(CFAllocatorRef allocator,CFDataRef self){

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

@ -6,12 +6,6 @@
#import <Foundation/NSOutputStream_socket.h>
#import <Foundation/NSHost.h>
@interface __CFStream : NSStream
@end
@interface __CFReadStream : NSInputStream
@end
@interface __CFWriteStream : NSOutputStream
@end
const CFStringRef kCFStreamPropertyFileCurrentOffset=(CFStringRef)@"kCFStreamPropertyFileCurrentOffset";
const CFStringRef kCFStreamPropertyAppendToFile=(CFStringRef)@"kCFStreamPropertyAppendToFile";
@ -32,15 +26,20 @@ void CFStreamCreatePairWithSocket(CFAllocatorRef allocator,CFSocketNativeHandle
NSUnimplementedFunction();
}
void CFStreamCreatePairWithSocketToHost(CFAllocatorRef allocator,CFStringRef hostName,CFUInteger port,CFReadStreamRef *readStream,CFWriteStreamRef *writeStream) {
NSHost *host=[NSHost hostWithName:(NSString *)hostName];
[NSStream getStreamsToHost:host port:port inputStream:readStream outputStream:writeStream];
if(readStream!=NULL)
[*readStream retain];
if(writeStream!=NULL)
[*writeStream retain];
void CFStreamCreatePairWithSocketToHost(CFAllocatorRef allocator, CFStringRef hostName, CFUInteger port, CFReadStreamRef *readStream, CFWriteStreamRef *writeStream)
{
NSHost *host = [NSHost hostWithName:(NSString *)hostName];
[NSStream getStreamsToHost:host port:port inputStream:(NSInputStream **)readStream outputStream:(NSOutputStream **)writeStream];
if (readStream != NULL) {
[(id)*readStream retain];
}
if (writeStream!=NULL) {
[(id)*writeStream retain];
}
}
CFTypeID CFReadStreamGetTypeID(void) {
NSUnimplementedFunction();
return 0;
@ -55,47 +54,62 @@ CFReadStreamRef CFReadStreamCreateWithFile(CFAllocatorRef allocator,CFURLRef url
return 0;
}
Boolean CFReadStreamSetClient(CFReadStreamRef self,CFOptionFlags events,CFReadStreamClientCallBack callback,CFStreamClientContext *context) {
if([self isKindOfClass:[NSInputStream_socket class]]){
[(NSInputStream_socket *)self setClientEvents:events callBack:callback context:context];
return TRUE;
}
else {
NSUnimplementedFunction();
return 0;
}
Boolean CFReadStreamSetClient(CFReadStreamRef self, CFOptionFlags events, CFReadStreamClientCallBack callback, CFStreamClientContext *context)
{
if ([(id)self isKindOfClass:[NSInputStream_socket class]]) {
[(NSInputStream_socket *)self setClientEvents:events callBack:callback context:context];
return TRUE;
} else {
NSUnimplementedFunction();
return 0;
}
}
CFTypeRef CFReadStreamCopyProperty(CFReadStreamRef self,CFStringRef key) {
return [[self propertyForKey:(NSString *)key] copy];
CFTypeRef CFReadStreamCopyProperty(CFReadStreamRef self, CFStringRef key)
{
return [[(id)self propertyForKey:(NSString *)key] copy];
}
Boolean CFReadStreamSetProperty(CFReadStreamRef self,CFStringRef key,CFTypeRef value) {
return [self setProperty:(id)value forKey:(NSString *)key];
Boolean CFReadStreamSetProperty(CFReadStreamRef self, CFStringRef key, CFTypeRef value)
{
return [(id)self setProperty:(id)value forKey:(NSString *)key];
}
const uint8_t * CFReadStreamGetBuffer(CFReadStreamRef self,CFIndex limit,CFIndex *available) {
NSUnimplementedFunction();
return 0;
}
Boolean CFReadStreamOpen(CFReadStreamRef self) {
[self open];
return TRUE;
Boolean CFReadStreamOpen(CFReadStreamRef self)
{
[(id)self open];
return TRUE;
}
void CFReadStreamClose(CFReadStreamRef self) {
[self close];
void CFReadStreamClose(CFReadStreamRef self)
{
[(NSInputStream *)self close];
}
Boolean CFReadStreamHasBytesAvailable(CFReadStreamRef self) {
return [self hasBytesAvailable];
Boolean CFReadStreamHasBytesAvailable(CFReadStreamRef self)
{
return [(id)self hasBytesAvailable];
}
CFIndex CFReadStreamRead(CFReadStreamRef self,uint8_t *bytes,CFIndex length) {
return [self read:bytes maxLength:length];
CFIndex CFReadStreamRead(CFReadStreamRef self, uint8_t *bytes, CFIndex length)
{
return [(id)self read:bytes maxLength:length];
}
CFErrorRef CFReadStreamCopyError(CFReadStreamRef self) {
NSUnimplementedFunction();
return 0;
@ -112,14 +126,19 @@ CFStreamStatus CFReadStreamGetStatus(CFReadStreamRef self) {
return 0;
}
void CFReadStreamScheduleWithRunLoop(CFReadStreamRef self,CFRunLoopRef runLoop,CFStringRef mode) {
[self scheduleInRunLoop:(NSRunLoop *)runLoop forMode:(NSString *)mode];
void CFReadStreamScheduleWithRunLoop(CFReadStreamRef self, CFRunLoopRef runLoop, CFStringRef mode)
{
[(id)self scheduleInRunLoop:(NSRunLoop *)runLoop forMode:(NSString *)mode];
}
void CFReadStreamUnscheduleFromRunLoop(CFReadStreamRef self,CFRunLoopRef runLoop,CFStringRef mode) {
[self removeFromRunLoop:(NSRunLoop *)runLoop forMode:(NSString *)mode];
void CFReadStreamUnscheduleFromRunLoop(CFReadStreamRef self, CFRunLoopRef runLoop, CFStringRef mode)
{
[(id)self removeFromRunLoop:(NSRunLoop *)runLoop forMode:(NSString *)mode];
}
CFTypeID CFWriteStreamGetTypeID(void) {
NSUnimplementedFunction();
return 0;
@ -138,41 +157,55 @@ CFWriteStreamRef CFWriteStreamCreateWithFile(CFAllocatorRef allocator,CFURLRef u
return 0;
}
Boolean CFWriteStreamSetClient(CFWriteStreamRef self,CFOptionFlags events,CFWriteStreamClientCallBack callback,CFStreamClientContext *context) {
if([self isKindOfClass:[NSOutputStream_socket class]]){
[(NSOutputStream_socket *)self setClientEvents:events callBack:callback context:context];
Boolean CFWriteStreamSetClient(CFWriteStreamRef self, CFOptionFlags events, CFWriteStreamClientCallBack callback, CFStreamClientContext *context)
{
if ([(id)self isKindOfClass:[NSOutputStream_socket class]]) {
[(NSOutputStream_socket *)self setClientEvents:events callBack:callback context:context];
return TRUE;
} else {
NSUnimplementedFunction();
return 0;
}
}
CFTypeRef CFWriteStreamCopyProperty(CFWriteStreamRef self, CFStringRef key)
{
return [[(id)self propertyForKey:(NSString *)key] copy];
}
Boolean CFWriteStreamSetProperty(CFWriteStreamRef self, CFStringRef key, CFTypeRef value)
{
return [(id)self setProperty:(id)value forKey:(NSString *)key];
}
Boolean CFWriteStreamOpen(CFWriteStreamRef self)
{
[(id)self open];
return TRUE;
}
else {
NSUnimplementedFunction();
return 0;
}
}
CFTypeRef CFWriteStreamCopyProperty(CFWriteStreamRef self,CFStringRef key) {
return [[self propertyForKey:(NSString *)key] copy];
void CFWriteStreamClose(CFWriteStreamRef self)
{
[(NSOutputStream *)self close];
}
Boolean CFWriteStreamSetProperty(CFWriteStreamRef self,CFStringRef key,CFTypeRef value) {
return [self setProperty:(id)value forKey:(NSString *)key];
Boolean CFWriteStreamCanAcceptBytes(CFWriteStreamRef self)
{
return [(id)self hasSpaceAvailable];
}
Boolean CFWriteStreamOpen(CFWriteStreamRef self) {
[self open];
return TRUE;
CFIndex CFWriteStreamWrite(CFWriteStreamRef self, const uint8_t *bytes, CFIndex length)
{
return [(id)self write:bytes maxLength:length];
}
void CFWriteStreamClose(CFWriteStreamRef self) {
[self close];
}
Boolean CFWriteStreamCanAcceptBytes(CFWriteStreamRef self) {
return [self hasSpaceAvailable];
}
CFIndex CFWriteStreamWrite(CFWriteStreamRef self,const uint8_t *bytes,CFIndex length) {
return [self write:bytes maxLength:length];
}
CFErrorRef CFWriteStreamCopyError(CFReadStreamRef self) {
NSUnimplementedFunction();
@ -190,10 +223,14 @@ CFStreamStatus CFWriteStreamGetStatus(CFWriteStreamRef self) {
return 0;
}
void CFWriteStreamScheduleWithRunLoop(CFWriteStreamRef self,CFRunLoopRef runLoop,CFStringRef mode) {
[self scheduleInRunLoop:(NSRunLoop *)runLoop forMode:(NSString *)mode];
void CFWriteStreamScheduleWithRunLoop(CFWriteStreamRef self, CFRunLoopRef runLoop, CFStringRef mode)
{
[(id)self scheduleInRunLoop:(NSRunLoop *)runLoop forMode:(NSString *)mode];
}
void CFWriteStreamUnscheduleFromRunLoop(CFWriteStreamRef self,CFRunLoopRef runLoop,CFStringRef mode) {
[self removeFromRunLoop:(NSRunLoop *)runLoop forMode:(NSString *)mode];
void CFWriteStreamUnscheduleFromRunLoop(CFWriteStreamRef self, CFRunLoopRef runLoop, CFStringRef mode)
{
[(id)self removeFromRunLoop:(NSRunLoop *)runLoop forMode:(NSString *)mode];
}

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

@ -18,7 +18,7 @@ void CGDataProviderRelease(CGDataProviderRef provider) {
}
CGDataProviderRef CGDataProviderCreateWithCFData(CFDataRef data) {
return O2DataProviderCreateWithCFData((NSData *)data);
return O2DataProviderCreateWithCFData(data);
}
COREGRAPHICS_EXPORT CGDataProviderRef CGDataProviderCreateWithData(void *info,const void *data,size_t size,CGDataProviderReleaseDataCallback releaseCallback) {

View File

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

View File

@ -70,7 +70,7 @@ bool CGFontGetGlyphAdvances(CGFontRef self,const CGGlyph *glyphs,size_t cou
}
CGGlyph CGFontGetGlyphWithGlyphName(CGFontRef self,CFStringRef name) {
return O2FontGetGlyphWithGlyphName(self,(NSString *)name);
return O2FontGetGlyphWithGlyphName(self,name);
}
CFStringRef CGFontCopyGlyphNameForGlyph(CGFontRef self,CGGlyph glyph) {

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

@ -1,5 +1,5 @@
typedef struct _O2ImageDestination *CGImageDestinationRef;
typedef struct O2ImageDestination *CGImageDestinationRef;
#import <CoreGraphics/CGImage.h>
#import <CoreGraphics/CGImageSource.h>

View File

@ -3,7 +3,7 @@
#import <Onyx2D/O2ImageSource.h>
const CFStringRef kCGImageDestinationLossyCompressionQuality=(CFStringRef)@"kCGImageDestinationLossyCompressionQuality";
const CFStringRef kCGImageDestinationBackgroundColor=(CFStringRef)@"kCGImageDestinationLossyCompressionQuality";
const CFStringRef kCGImageDestinationBackgroundColor=(CFStringRef)@"kCGImageDestinationBackgroundColor";
CFTypeID CGImageDestinationGetTypeID(void) {
return O2ImageDestinationGetTypeID();
@ -14,32 +14,32 @@ CFArrayRef CGImageDestinationCopyTypeIdentifiers(void) {
}
CGImageDestinationRef CGImageDestinationCreateWithData(CFMutableDataRef data,CFStringRef type,size_t imageCount,CFDictionaryRef options) {
return O2ImageDestinationCreateWithData(data,type,imageCount,options);
return (CGImageDestinationRef)O2ImageDestinationCreateWithData(data,type,imageCount,options);
}
CGImageDestinationRef CGImageDestinationCreateWithDataConsumer(CGDataConsumerRef dataConsumer,CFStringRef type,size_t imageCount,CFDictionaryRef options) {
return O2ImageDestinationCreateWithDataConsumer(dataConsumer,type,imageCount,options);
return (CGImageDestinationRef)O2ImageDestinationCreateWithDataConsumer(dataConsumer,type,imageCount,options);
}
CGImageDestinationRef CGImageDestinationCreateWithURL(CFURLRef url,CFStringRef type,size_t imageCount,CFDictionaryRef options) {
return O2ImageDestinationCreateWithURL(url,type,imageCount,options);
return (CGImageDestinationRef)O2ImageDestinationCreateWithURL(url,type,imageCount,options);
}
void CGImageDestinationSetProperties(CGImageDestinationRef self,CFDictionaryRef properties) {
O2ImageDestinationSetProperties(self,properties);
O2ImageDestinationSetProperties((O2ImageDestinationRef)self,properties);
}
void CGImageDestinationAddImage(CGImageDestinationRef self,CGImageRef image,CFDictionaryRef properties) {
O2ImageDestinationAddImage(self,image,properties);
O2ImageDestinationAddImage((O2ImageDestinationRef)self,image,properties);
}
void CGImageDestinationAddImageFromSource(CGImageDestinationRef self,CGImageSourceRef imageSource,size_t index,CFDictionaryRef properties) {
O2ImageDestinationAddImageFromSource(self,imageSource,index,properties);
O2ImageDestinationAddImageFromSource((O2ImageDestinationRef)self,imageSource,index,properties);
}
bool CGImageDestinationFinalize(CGImageDestinationRef self) {
return O2ImageDestinationFinalize(self);
return O2ImageDestinationFinalize((O2ImageDestinationRef)self);
}

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 */
@ -343,6 +343,15 @@
FE8C021C10C59BB300FE4072 /* CGImageDestination.h in Headers */ = {isa = PBXBuildFile; fileRef = FE8C020A10C59BB300FE4072 /* CGImageDestination.h */; settings = {ATTRIBUTES = (Public, ); }; };
FE8C021E10C59BB300FE4072 /* O2Encoder_TIFF.h in Headers */ = {isa = PBXBuildFile; fileRef = FE8C020C10C59BB300FE4072 /* O2Encoder_TIFF.h */; };
FE8C022010C59BB300FE4072 /* O2ImageDestination.h in Headers */ = {isa = PBXBuildFile; fileRef = FE8C020E10C59BB300FE4072 /* O2ImageDestination.h */; };
FE9ACFEB15614CE4002AFCA9 /* O2ImageDecoder_JPEG_libjpeg.m in Sources */ = {isa = PBXBuildFile; fileRef = FE9ACFE715614CE4002AFCA9 /* O2ImageDecoder_JPEG_libjpeg.m */; };
FE9ACFEC15614CE4002AFCA9 /* O2ImageDecoder_JPEG_libjpeg.m in Sources */ = {isa = PBXBuildFile; fileRef = FE9ACFE715614CE4002AFCA9 /* O2ImageDecoder_JPEG_libjpeg.m */; };
FE9ACFED15614CE4002AFCA9 /* O2ImageDecoder_JPEG_libjpeg.m in Sources */ = {isa = PBXBuildFile; fileRef = FE9ACFE715614CE4002AFCA9 /* O2ImageDecoder_JPEG_libjpeg.m */; };
FE9ACFEF15614CE4002AFCA9 /* O2ImageDecoder_JPEG_stb.m in Sources */ = {isa = PBXBuildFile; fileRef = FE9ACFE815614CE4002AFCA9 /* O2ImageDecoder_JPEG_stb.m */; };
FE9ACFF015614CE4002AFCA9 /* O2ImageDecoder_JPEG_stb.m in Sources */ = {isa = PBXBuildFile; fileRef = FE9ACFE815614CE4002AFCA9 /* O2ImageDecoder_JPEG_stb.m */; };
FE9ACFF115614CE4002AFCA9 /* O2ImageDecoder_JPEG_stb.m in Sources */ = {isa = PBXBuildFile; fileRef = FE9ACFE815614CE4002AFCA9 /* O2ImageDecoder_JPEG_stb.m */; };
FE9ACFF315614CE4002AFCA9 /* O2ImageDecoder.m in Sources */ = {isa = PBXBuildFile; fileRef = FE9ACFE915614CE4002AFCA9 /* O2ImageDecoder.m */; };
FE9ACFF415614CE4002AFCA9 /* O2ImageDecoder.m in Sources */ = {isa = PBXBuildFile; fileRef = FE9ACFE915614CE4002AFCA9 /* O2ImageDecoder.m */; };
FE9ACFF515614CE4002AFCA9 /* O2ImageDecoder.m in Sources */ = {isa = PBXBuildFile; fileRef = FE9ACFE915614CE4002AFCA9 /* O2ImageDecoder.m */; };
FE9DB4610FD6C38300A1CE17 /* CGDataConsumer.h in Headers */ = {isa = PBXBuildFile; fileRef = FE9DB45F0FD6C38300A1CE17 /* CGDataConsumer.h */; settings = {ATTRIBUTES = (Public, ); }; };
FE9DB4630FD6C38300A1CE17 /* CGDataConsumer.h in Headers */ = {isa = PBXBuildFile; fileRef = FE9DB45F0FD6C38300A1CE17 /* CGDataConsumer.h */; settings = {ATTRIBUTES = (Public, ); }; };
FE9DB4650FD6C38300A1CE17 /* CGDataConsumer.h in Headers */ = {isa = PBXBuildFile; fileRef = FE9DB45F0FD6C38300A1CE17 /* CGDataConsumer.h */; settings = {ATTRIBUTES = (Public, ); }; };
@ -490,14 +499,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 */
@ -764,6 +765,9 @@
FE8C020D10C59BB300FE4072 /* O2Encoder_TIFF.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = O2Encoder_TIFF.m; path = ../Onyx2D/O2Encoder_TIFF.m; sourceTree = "<group>"; };
FE8C020E10C59BB300FE4072 /* O2ImageDestination.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = O2ImageDestination.h; path = ../Onyx2D/O2ImageDestination.h; sourceTree = "<group>"; };
FE8C020F10C59BB300FE4072 /* O2ImageDestination.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = O2ImageDestination.m; path = ../Onyx2D/O2ImageDestination.m; sourceTree = "<group>"; };
FE9ACFE715614CE4002AFCA9 /* O2ImageDecoder_JPEG_libjpeg.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = O2ImageDecoder_JPEG_libjpeg.m; sourceTree = "<group>"; };
FE9ACFE815614CE4002AFCA9 /* O2ImageDecoder_JPEG_stb.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = O2ImageDecoder_JPEG_stb.m; sourceTree = "<group>"; };
FE9ACFE915614CE4002AFCA9 /* O2ImageDecoder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = O2ImageDecoder.m; sourceTree = "<group>"; };
FE9DB45F0FD6C38300A1CE17 /* CGDataConsumer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CGDataConsumer.h; sourceTree = "<group>"; };
FE9DB4600FD6C38300A1CE17 /* CGDataConsumer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CGDataConsumer.m; sourceTree = "<group>"; };
FEA313490FD5642000F480D4 /* Foundation.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Foundation.framework; sourceTree = BUILT_PRODUCTS_DIR; };
@ -1126,6 +1130,9 @@
FE5C0A1D1162953300065D1C /* Onyx2D */ = {
isa = PBXGroup;
children = (
FE9ACFE715614CE4002AFCA9 /* O2ImageDecoder_JPEG_libjpeg.m */,
FE9ACFE815614CE4002AFCA9 /* O2ImageDecoder_JPEG_stb.m */,
FE9ACFE915614CE4002AFCA9 /* O2ImageDecoder.m */,
FE39C40C120357EA00A80A71 /* O2ClipState.h */,
FE39C40D120357EA00A80A71 /* O2ClipState.m */,
FE43BE4511FFBAC100119833 /* O2PDFBlock.h */,
@ -1822,7 +1829,6 @@
8DC2EF560486A6940098B216 /* Frameworks */,
);
buildRules = (
FEC11B9C0FD4B74C00082282 /* PBXBuildRule */,
);
dependencies = (
FE6F7BD70FD5573B00C3244F /* PBXTargetDependency */,
@ -1908,8 +1914,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 = (
@ -2124,6 +2133,9 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
FE9ACFED15614CE4002AFCA9 /* O2ImageDecoder_JPEG_libjpeg.m in Sources */,
FE9ACFF115614CE4002AFCA9 /* O2ImageDecoder_JPEG_stb.m in Sources */,
FE9ACFF515614CE4002AFCA9 /* O2ImageDecoder.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -2131,6 +2143,9 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
FE9ACFEB15614CE4002AFCA9 /* O2ImageDecoder_JPEG_libjpeg.m in Sources */,
FE9ACFEF15614CE4002AFCA9 /* O2ImageDecoder_JPEG_stb.m in Sources */,
FE9ACFF315614CE4002AFCA9 /* O2ImageDecoder.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -2138,6 +2153,9 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
FE9ACFEC15614CE4002AFCA9 /* O2ImageDecoder_JPEG_libjpeg.m in Sources */,
FE9ACFF015614CE4002AFCA9 /* O2ImageDecoder_JPEG_stb.m in Sources */,
FE9ACFF415614CE4002AFCA9 /* O2ImageDecoder.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -2214,7 +2232,6 @@
"-D__LITTLE_ENDIAN__",
"-Wreturn-type",
);
PREBINDING = NO;
PRODUCT_NAME = CoreGraphics;
};
name = Release;
@ -2254,7 +2271,6 @@
"-shared",
"-lm",
);
PREBINDING = NO;
PRODUCT_NAME = CoreGraphics;
STRIP_INSTALLED_PRODUCT = YES;
SYMROOT = build/FreeBSD/i386;
@ -2290,7 +2306,6 @@
"-shared",
"-lm",
);
PREBINDING = NO;
PRODUCT_NAME = CoreGraphics;
STRIP_INSTALLED_PRODUCT = YES;
SYMROOT = build/FreeBSD/i386;
@ -2326,7 +2341,6 @@
"-shared",
"-lm",
);
PREBINDING = NO;
PRODUCT_NAME = CoreGraphics;
STRIP_INSTALLED_PRODUCT = YES;
SYMROOT = build/Linux/i386;
@ -2360,7 +2374,6 @@
"-shared",
"-lm",
);
PREBINDING = NO;
PRODUCT_NAME = CoreGraphics;
STRIP_INSTALLED_PRODUCT = YES;
SYMROOT = build/Darwin/i386;
@ -2390,7 +2403,6 @@
"-D__LITTLE_ENDIAN__",
"-Wreturn-type",
);
PREBINDING = NO;
PRODUCT_NAME = CoreGraphics;
};
name = Debug;
@ -2424,7 +2436,6 @@
"-shared",
"-lm",
);
PREBINDING = NO;
PRODUCT_NAME = CoreGraphics;
STRIP_INSTALLED_PRODUCT = YES;
SYMROOT = build/Linux/i386;
@ -2458,7 +2469,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>

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