- Issue #60, Julian Mayer's makeObjectsPerformSelector: fix

- thinker at thinkertons -[NSScanner scanCharactersFromSet:intoString:] fix
- NSOpenGLView display fix
- added simple OpenGL framework for header compatibility
This commit is contained in:
Christopher Lloyd 2008-01-24 18:32:05 +00:00
parent cd258cbd9b
commit 27ebcb2bcb
10 changed files with 322 additions and 35 deletions

View File

@ -16,9 +16,7 @@
if(GetUpdateRect(_windowHandle,&updateRECT,NO)){
BeginPaint(_windowHandle,&paintStruct);
[_view lockFocus];
[_view drawRect:[_view bounds]];
[_view unlockFocus];
[_view display];
EndPaint(_windowHandle,&paintStruct);
}
}

View File

@ -407,18 +407,18 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
-(void)makeObjectsPerformSelector:(SEL)selector {
int count=[self count];
while(--count>=0)
[[self objectAtIndex:count] performSelector:selector];
int i, count = [self count];
for (i = 0; i < count; i++)
[[self objectAtIndex:i] performSelector:selector];
}
-(void)makeObjectsPerformSelector:(SEL)selector withObject:object {
int count=[self count];
while(--count>=0)
[[self objectAtIndex:count] performSelector:selector withObject:object];
int i, count = [self count];
for (i = 0; i < count; i++)
[[self objectAtIndex:i] performSelector:selector withObject:object];
}
-(NSString *)description {

View File

@ -251,10 +251,10 @@ static inline unsigned indexOfObject(NSMutableArray_concrete *self,id object){
}
-(void)makeObjectsPerformSelector:(SEL)selector {
int count=_count;
while(--count>=0)
[_objects[count] performSelector:selector];
int i, count = [self count];
for (i = 0; i < count; i++)
[_objects[i] performSelector:selector];
}
// iterative mergesort based on http://www.inf.fh-flensburg.de/lang/algorithmen/sortieren/merge/mergiter.htm

View File

@ -433,33 +433,43 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
return NO;
}
-(BOOL)scanCharactersFromSet:(NSCharacterSet *)charset intoString:(NSString **)stringp {
-(BOOL)scanCharactersFromSet:(NSCharacterSet *)charset intoString:(NSString **)stringp
{
int length=[_string length];
unichar result[length];
int resultLength = 0;
BOOL scanStarted = NO;
for(;_location<length;_location++) {
unichar unicode=[_string characterAtIndex:_location];
for(;_location<length;_location++)
{
unichar unicode=[_string characterAtIndex:_location];
if ([_skipSet characterIsMember:unicode] && scanStarted == NO)
;
else if ([charset characterIsMember:unicode]) {
scanStarted = YES;
result[resultLength++] = unicode;
}
else
return NO;
}
if ([_skipSet characterIsMember:unicode] && (scanStarted == NO))
{
// do nothing
}
else
{
if ([charset characterIsMember: unicode])
{
scanStarted = YES;
result[resultLength++] = unicode;
}
else
{
break; // used to be "return NO";
}
}
}
if (resultLength > 0) {
if (stringp != NULL)
*stringp = [NSString stringWithCharacters:result length:resultLength];
return YES;
}
else
return NO;
if (scanStarted)
{
if (stringp != NULL)
{
*stringp = [NSString stringWithCharacters:result length:resultLength];
}
}
return scanStarted;
}
-(BOOL)scanUpToCharactersFromSet:(NSCharacterSet *)charset intoString:(NSString **)stringp {

26
OpenGL/Info.plist Normal file
View File

@ -0,0 +1,26 @@
<?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.OpenGL</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleSignature</key>
<string>OBJC</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>

0
OpenGL/OpenGL.h Normal file
View File

2
OpenGL/OpenGL.m Normal file
View File

@ -0,0 +1,2 @@
static void OpenGL(){
}

View File

@ -0,0 +1,249 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 42;
objects = {
/* Begin PBXBuildFile section */
FEF2EB230C878C88001FC5A8 /* OpenGL.h in Headers */ = {isa = PBXBuildFile; fileRef = FEF2EB220C878C88001FC5A8 /* OpenGL.h */; settings = {ATTRIBUTES = (Public, ); }; };
FEF2EB5E0C87B894001FC5A8 /* gl.h in Headers */ = {isa = PBXBuildFile; fileRef = FEF2EB5D0C87B894001FC5A8 /* gl.h */; settings = {ATTRIBUTES = (Public, ); }; };
FEF2EB680C87B8BA001FC5A8 /* glu.h in Headers */ = {isa = PBXBuildFile; fileRef = FEF2EB670C87B8BA001FC5A8 /* glu.h */; settings = {ATTRIBUTES = (Public, ); }; };
FEF2EB8F0C87B987001FC5A8 /* OpenGL.m in Sources */ = {isa = PBXBuildFile; fileRef = FEF2EB8E0C87B987001FC5A8 /* OpenGL.m */; };
/* End PBXBuildFile section */
/* Begin PBXBuildRule section */
FEF2EB380C878DAA001FC5A8 /* 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>"; };
8DC2EF5A0486A6940098B216 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
8DC2EF5B0486A6940098B216 /* OpenGL.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = OpenGL.framework; sourceTree = BUILT_PRODUCTS_DIR; };
FEF2EB220C878C88001FC5A8 /* OpenGL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OpenGL.h; sourceTree = "<group>"; };
FEF2EB5D0C87B894001FC5A8 /* gl.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = gl.h; sourceTree = "<group>"; };
FEF2EB670C87B8BA001FC5A8 /* glu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = glu.h; sourceTree = "<group>"; };
FEF2EB8E0C87B987001FC5A8 /* OpenGL.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = OpenGL.m; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
8DC2EF560486A6940098B216 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
034768DFFF38A50411DB9C8B /* Products */ = {
isa = PBXGroup;
children = (
8DC2EF5B0486A6940098B216 /* OpenGL.framework */,
);
name = Products;
sourceTree = "<group>";
};
0867D691FE84028FC02AAC07 /* OpenGL */ = {
isa = PBXGroup;
children = (
08FB77AEFE84172EC02AAC07 /* Classes */,
32C88DFF0371C24200C91783 /* Other Sources */,
089C1665FE841158C02AAC07 /* Resources */,
0867D69AFE84028FC02AAC07 /* External Frameworks and Libraries */,
034768DFFF38A50411DB9C8B /* Products */,
FEF2EB220C878C88001FC5A8 /* OpenGL.h */,
FEF2EB5D0C87B894001FC5A8 /* gl.h */,
FEF2EB670C87B8BA001FC5A8 /* glu.h */,
FEF2EB8E0C87B987001FC5A8 /* OpenGL.m */,
);
name = OpenGL;
sourceTree = "<group>";
};
0867D69AFE84028FC02AAC07 /* External Frameworks and Libraries */ = {
isa = PBXGroup;
children = (
1058C7B0FEA5585E11CA2CBB /* Linked Frameworks */,
1058C7B2FEA5585E11CA2CBB /* Other Frameworks */,
);
name = "External Frameworks and Libraries";
sourceTree = "<group>";
};
089C1665FE841158C02AAC07 /* Resources */ = {
isa = PBXGroup;
children = (
8DC2EF5A0486A6940098B216 /* Info.plist */,
);
name = Resources;
sourceTree = "<group>";
};
08FB77AEFE84172EC02AAC07 /* Classes */ = {
isa = PBXGroup;
children = (
);
name = Classes;
sourceTree = "<group>";
};
1058C7B0FEA5585E11CA2CBB /* Linked Frameworks */ = {
isa = PBXGroup;
children = (
);
name = "Linked Frameworks";
sourceTree = "<group>";
};
1058C7B2FEA5585E11CA2CBB /* Other Frameworks */ = {
isa = PBXGroup;
children = (
0867D69BFE84028FC02AAC07 /* Foundation.framework */,
);
name = "Other Frameworks";
sourceTree = "<group>";
};
32C88DFF0371C24200C91783 /* Other Sources */ = {
isa = PBXGroup;
children = (
);
name = "Other Sources";
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXHeadersBuildPhase section */
8DC2EF500486A6940098B216 /* Headers */ = {
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
FEF2EB230C878C88001FC5A8 /* OpenGL.h in Headers */,
FEF2EB5E0C87B894001FC5A8 /* gl.h in Headers */,
FEF2EB680C87B8BA001FC5A8 /* glu.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXHeadersBuildPhase section */
/* Begin PBXNativeTarget section */
8DC2EF4F0486A6940098B216 /* OpenGL-Windows-i386 */ = {
isa = PBXNativeTarget;
buildConfigurationList = 1DEB91AD08733DA50010E9CD /* Build configuration list for PBXNativeTarget "OpenGL-Windows-i386" */;
buildPhases = (
8DC2EF500486A6940098B216 /* Headers */,
8DC2EF520486A6940098B216 /* Resources */,
8DC2EF540486A6940098B216 /* Sources */,
8DC2EF560486A6940098B216 /* Frameworks */,
);
buildRules = (
FEF2EB380C878DAA001FC5A8 /* PBXBuildRule */,
);
dependencies = (
);
name = "OpenGL-Windows-i386";
productInstallPath = "$(HOME)/Library/Frameworks";
productName = OpenGL;
productReference = 8DC2EF5B0486A6940098B216 /* OpenGL.framework */;
productType = "com.apple.product-type.framework";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
0867D690FE84028FC02AAC07 /* Project object */ = {
isa = PBXProject;
buildConfigurationList = 1DEB91B108733DA50010E9CD /* Build configuration list for PBXProject "OpenGL" */;
hasScannedForEncodings = 1;
mainGroup = 0867D691FE84028FC02AAC07 /* OpenGL */;
productRefGroup = 034768DFFF38A50411DB9C8B /* Products */;
projectDirPath = "";
targets = (
8DC2EF4F0486A6940098B216 /* OpenGL-Windows-i386 */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
8DC2EF520486A6940098B216 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
8DC2EF540486A6940098B216 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
FEF2EB8F0C87B987001FC5A8 /* OpenGL.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin XCBuildConfiguration section */
1DEB91AE08733DA50010E9CD /* Deployment */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = i386;
DEPLOYMENT_LOCATION = YES;
DSTROOT = /;
EXECUTABLE_SUFFIX = .1.0.dll;
GCC_PRECOMPILE_PREFIX_HEADER = NO;
GCC_PREFIX_HEADER = "";
INFOPLIST_FILE = Info.plist;
INSTALL_PATH = /Developer/Cocotron/1.0/Windows/i386/Frameworks;
OTHER_LDFLAGS = (
"-shared",
"-Wl,--enable-auto-import",
"-Wl,--export-all-symbols",
"-Wl,--out-implib,$TARGET_BUILD_DIR/$(PRODUCT_NAME).framework/lib$(PRODUCT_NAME).a",
);
PREBINDING = NO;
PRODUCT_NAME = OpenGL;
SYMROOT = /Developer/Cocotron/1.0/build/OpenGL/Windows/i386;
WRAPPER_EXTENSION = framework;
ZERO_LINK = YES;
};
name = Deployment;
};
1DEB91B208733DA50010E9CD /* Deployment */ = {
isa = XCBuildConfiguration;
buildSettings = {
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
PREBINDING = NO;
SDKROOT = "";
};
name = Deployment;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
1DEB91AD08733DA50010E9CD /* Build configuration list for PBXNativeTarget "OpenGL-Windows-i386" */ = {
isa = XCConfigurationList;
buildConfigurations = (
1DEB91AE08733DA50010E9CD /* Deployment */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Deployment;
};
1DEB91B108733DA50010E9CD /* Build configuration list for PBXProject "OpenGL" */ = {
isa = XCConfigurationList;
buildConfigurations = (
1DEB91B208733DA50010E9CD /* Deployment */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Deployment;
};
/* End XCConfigurationList section */
};
rootObject = 0867D690FE84028FC02AAC07 /* Project object */;
}

1
OpenGL/gl.h Normal file
View File

@ -0,0 +1 @@
#import <gl/gl.h>

1
OpenGL/glu.h Normal file
View File

@ -0,0 +1 @@
#import <gl/glu.h>