curlhandle-cvs Mailing List for CURLHandle Cocoa class wrapping libcurl
Brought to you by:
dan_wood
You can subscribe to this list here.
| 2003 |
Jan
|
Feb
|
Mar
(3) |
Apr
|
May
|
Jun
|
Jul
(7) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|---|
|
From: <ph...@us...> - 2003-07-03 20:03:37
|
Update of /cvsroot/curlhandle/CURLHandleTesterSource/English.lproj/FindPanel.nib
In directory sc8-pr-cvs1:/tmp/cvs-serv9157/English.lproj/FindPanel.nib
Added Files:
classes.nib info.nib keyedobjects.nib objects.nib
Log Message:
Updated to Dan's release canidate for 1.8
--- NEW FILE: classes.nib ---
{
IBClasses = (
{CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
{
ACTIONS = {
findNext = id;
findNextAndOrderFindPanelOut = id;
findPrevious = id;
replace = id;
replaceAll = id;
replaceAndFind = id;
};
CLASS = TextFinder;
LANGUAGE = ObjC;
OUTLETS = {
findNextButton = id;
findTextField = id;
ignoreCaseButton = id;
replaceAllScopeMatrix = id;
replaceTextField = id;
statusField = id;
};
SUPERCLASS = NSObject;
}
);
IBVersion = 1;
}
--- NEW FILE: info.nib ---
<?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>65 594 356 240 0 0 1920 1178 </string>
<key>IBFramework Version</key>
<string>291.0</string>
<key>IBOpenObjects</key>
<array>
<integer>8</integer>
</array>
<key>IBSystem Version</key>
<string>6I32</string>
</dict>
</plist>
--- NEW FILE: keyedobjects.nib ---
(This appears to be a binary file; contents omitted.)
--- NEW FILE: objects.nib ---
(This appears to be a binary file; contents omitted.)
|
|
From: <ph...@us...> - 2003-07-03 20:03:37
|
Update of /cvsroot/curlhandle/CURLHandleTesterSource/CURLHandleTester.pbproj
In directory sc8-pr-cvs1:/tmp/cvs-serv9157/CURLHandleTester.pbproj
Modified Files:
project.pbxproj
Log Message:
Updated to Dan's release canidate for 1.8
Index: project.pbxproj
===================================================================
RCS file: /cvsroot/curlhandle/CURLHandleTesterSource/CURLHandleTester.pbproj/project.pbxproj,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** project.pbxproj 13 Mar 2003 05:45:48 -0000 1.1.1.1
--- project.pbxproj 3 Jul 2003 20:03:34 -0000 1.2
***************
*** 18,21 ****
--- 18,23 ----
F62071650169281B0147E661,
F62071660169281B0147E661,
+ CE01F1D304B2183000A80102,
+ CE01F1D404B2183000A80102,
);
isa = PBXGroup;
***************
*** 111,114 ****
--- 113,117 ----
4A9504CDFFE6A4B311CA0CBA,
);
+ hasScannedForEncodings = 1;
isa = PBXProject;
mainGroup = 29B97314FDCFA39411CA2CEA;
***************
*** 141,144 ****
--- 144,148 ----
};
29B97316FDCFA39411CA2CEA = {
+ fileEncoding = 30;
isa = PBXFileReference;
path = main.m;
***************
*** 149,152 ****
--- 153,157 ----
F6DDB1F4027893A701A80166,
29B97318FDCFA39411CA2CEA,
+ CE01F21E04B21F4C00A80102,
);
isa = PBXGroup;
***************
*** 220,225 ****
productReference = 17587328FF379C6511CA2CBB;
productSettingsXML = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
! <!DOCTYPE plist SYSTEM \"file://localhost/System/Library/DTDs/PropertyList.dtd\">
! <plist version=\"0.9\">
<dict>
<key>CFBundleDevelopmentRegion</key>
--- 225,230 ----
productReference = 17587328FF379C6511CA2CBB;
productSettingsXML = "<?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>
***************
*** 240,248 ****
<string>APPL</string>
<key>CFBundleShortVersionString</key>
! <string>1.6</string>
<key>CFBundleSignature</key>
<string>cURL</string>
<key>CFBundleVersion</key>
! <string>1.6</string>
<key>NSMainNibFile</key>
<string>MainMenu</string>
--- 245,253 ----
<string>APPL</string>
<key>CFBundleShortVersionString</key>
! <string>1.8</string>
<key>CFBundleSignature</key>
<string>cURL</string>
<key>CFBundleVersion</key>
! <string>1.8</string>
<key>NSMainNibFile</key>
<string>MainMenu</string>
***************
*** 252,256 ****
</plist>
";
- shouldUseHeadermap = 1;
};
29B97327FDCFA39411CA2CEA = {
--- 257,260 ----
***************
*** 259,264 ****
--- 263,270 ----
F60C15AA00E547C101000001,
F62071670169281B0147E661,
+ CE01F1D504B2183000A80102,
);
isa = PBXHeadersBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
};
29B97328FDCFA39411CA2CEA = {
***************
*** 267,272 ****
--- 273,280 ----
080E96DCFE201CFB7F000001,
F6DDB1F5027893A701A80166,
+ CE01F22004B21F4C00A80102,
);
isa = PBXResourcesBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
};
29B9732BFDCFA39411CA2CEA = {
***************
*** 276,281 ****
--- 284,291 ----
F60C15AB00E547C101000001,
F62071680169281B0147E661,
+ CE01F1D604B2183000A80102,
);
isa = PBXSourcesBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
};
29B9732CFDCFA39411CA2CEA = {
***************
*** 294,297 ****
--- 304,308 ----
);
isa = PBXFrameworksBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
};
//290
***************
*** 329,332 ****
--- 340,398 ----
//4A3
//4A4
+ //CE0
+ //CE1
+ //CE2
+ //CE3
+ //CE4
+ CE01F1D304B2183000A80102 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = TextFinder.h;
+ refType = 4;
+ };
+ CE01F1D404B2183000A80102 = {
+ fileEncoding = 30;
+ isa = PBXFileReference;
+ path = TextFinder.m;
+ refType = 4;
+ };
+ CE01F1D504B2183000A80102 = {
+ fileRef = CE01F1D304B2183000A80102;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ CE01F1D604B2183000A80102 = {
+ fileRef = CE01F1D404B2183000A80102;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ CE01F21E04B21F4C00A80102 = {
+ children = (
+ CE01F21F04B21F4C00A80102,
+ );
+ isa = PBXVariantGroup;
+ name = FindPanel.nib;
+ path = "";
+ refType = 4;
+ };
+ CE01F21F04B21F4C00A80102 = {
+ isa = PBXFileReference;
+ name = English;
+ path = English.lproj/FindPanel.nib;
+ refType = 4;
+ };
+ CE01F22004B21F4C00A80102 = {
+ fileRef = CE01F21E04B21F4C00A80102;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ //CE0
+ //CE1
+ //CE2
+ //CE3
+ //CE4
//F60
//F61
***************
*** 335,338 ****
--- 401,405 ----
//F64
F60C15A800E547C101000001 = {
+ fileEncoding = 30;
isa = PBXFileReference;
path = TestController.h;
***************
*** 340,343 ****
--- 407,411 ----
};
F60C15A900E547C101000001 = {
+ fileEncoding = 30;
isa = PBXFileReference;
path = TestController.m;
***************
*** 357,360 ****
--- 425,429 ----
};
F62071650169281B0147E661 = {
+ fileEncoding = 30;
isa = PBXFileReference;
path = "NSData+plist.m";
***************
*** 362,365 ****
--- 431,435 ----
};
F62071660169281B0147E661 = {
+ fileEncoding = 30;
isa = PBXFileReference;
path = "NSData+plist.h";
***************
*** 392,395 ****
--- 462,466 ----
);
isa = PBXCopyFilesBuildPhase;
+ runOnlyForDeploymentPostprocessing = 0;
};
F6C1930702761A6A01A80110 = {
|
|
From: <ph...@us...> - 2003-07-03 20:03:37
|
Update of /cvsroot/curlhandle/CURLHandleTesterSource
In directory sc8-pr-cvs1:/tmp/cvs-serv9157
Modified Files:
TestController.m
Added Files:
CURLHandleTester_Prefix.h TextFinder.h TextFinder.m
Log Message:
Updated to Dan's release canidate for 1.8
--- NEW FILE: CURLHandleTester_Prefix.h ---
//
// Prefix header for all source files of the 'CURLHandleTester' target in the 'CURLHandleTester' project
//
#ifdef __OBJC__
#import <Cocoa/Cocoa.h>
#endif
--- NEW FILE: TextFinder.h ---
/*
Reusable find panel functionality (find, replace).
Need one shared instance of TextFinder to which the menu items and widgets in the find panel are connected.
Loads UI lazily.
Works on first responder, assumed to be an NSTextView.
*/
#import <Cocoa/Cocoa.h>
#define Forward YES
#define Backward NO
@interface TextFinder : NSObject {
NSString *findString;
id findTextField;
id replaceTextField;
id ignoreCaseButton;
id findNextButton;
id replaceAllScopeMatrix;
id statusField;
BOOL lastFindWasSuccessful;
}
/* Common way to get a text finder. One instance of TextFinder per app is good enough. */
+ (id)sharedInstance;
/* Main method for external users; does a find in the first responder. Selects found range or beeps. */
- (BOOL)find:(BOOL)direction;
/* Loads UI lazily */
- (NSPanel *)findPanel;
/* Gets the first responder and returns it if it's an NSTextView */
- (NSTextView *)textObjectToSearchIn;
/* Get/set the current find string. Will update UI if UI is loaded */
- (NSString *)findString;
- (void)setFindString:(NSString *)string;
- (void)setFindString:(NSString *)string writeToPasteboard:(BOOL)flag;
/* Misc internal methods */
- (void)appDidActivate:(NSNotification *)notification;
- (void)loadFindStringFromPasteboard;
- (void)loadFindStringToPasteboard;
/* Action methods, sent from the find panel UI; can also be connected to menu items */
- (void)findNext:(id)sender;
- (void)findPrevious:(id)sender;
- (void)findNextAndOrderFindPanelOut:(id)sender;
- (void)replace:(id)sender;
- (void)replaceAndFind:(id)sender;
- (void)replaceAll:(id)sender;
- (void)orderFrontFindPanel:(id)sender;
- (void)takeFindStringFromSelection:(id)sender;
- (void)jumpToSelection:(id)sender;
@end
--- NEW FILE: TextFinder.m ---
/*
TextFinder.m
Copyright (c) 1995-2002 by Apple Computer, Inc., all rights reserved.
Author: Ali Ozer
Find and replace functionality with a minimal panel...
Would be nice to have the buttons in the panel validate; this would allow the
replace buttons to become disabled for readonly docs
*/
/*
IMPORTANT: This Apple software is supplied to you by Apple Computer, Inc. ("Apple") in
consideration of your agreement to the following terms, and your use, installation,
modification or redistribution of this Apple software constitutes acceptance of these
terms. If you do not agree with these terms, please do not use, install, modify or
redistribute this Apple software.
In consideration of your agreement to abide by the following terms, and subject to these
terms, Apple grants you a personal, non-exclusive license, under AppleÕs copyrights in
this original Apple software (the "Apple Software"), to use, reproduce, modify and
redistribute the Apple Software, with or without modifications, in source and/or binary
forms; provided that if you redistribute the Apple Software in its entirety and without
modifications, you must retain this notice and the following text and disclaimers in all
such redistributions of the Apple Software. Neither the name, trademarks, service marks
or logos of Apple Computer, Inc. may be used to endorse or promote products derived from
the Apple Software without specific prior written permission from Apple. Except as expressly
stated in this notice, no other rights or licenses, express or implied, are granted by Apple
herein, including but not limited to any patent rights that may be infringed by your
derivative works or by other works in which the Apple Software may be incorporated.
The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO WARRANTIES,
EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF NON-INFRINGEMENT,
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS
USE AND OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE,
REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND
WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR
OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#import <Cocoa/Cocoa.h>
#import "TextFinder.h"
@interface NSString (NSStringTextFinding)
- (NSRange)findString:(NSString *)string selectedRange:(NSRange)selectedRange options:(unsigned)mask wrap:(BOOL)wrapFlag;
@end
@implementation TextFinder
static id sharedFindObject = nil;
+ (id)sharedInstance {
if (!sharedFindObject) {
[[self allocWithZone:[[NSApplication sharedApplication] zone]] init];
}
return sharedFindObject;
}
- (id)init {
if (sharedFindObject) {
[super dealloc];
return sharedFindObject;
}
if (!(self = [super init])) return nil;
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(appDidActivate:) name:NSApplicationDidBecomeActiveNotification object:[NSApplication sharedApplication]];
[self setFindString:@"" writeToPasteboard:NO];
[self loadFindStringFromPasteboard];
sharedFindObject = self;
return self;
}
- (void)appDidActivate:(NSNotification *)notification {
[self loadFindStringFromPasteboard];
}
- (void)loadFindStringFromPasteboard {
NSPasteboard *pasteboard = [NSPasteboard pasteboardWithName:NSFindPboard];
if ([[pasteboard types] containsObject:NSStringPboardType]) {
NSString *string = [pasteboard stringForType:NSStringPboardType];
if (string && [string length]) {
[self setFindString:string writeToPasteboard:NO];
}
}
}
- (void)loadFindStringToPasteboard {
NSPasteboard *pasteboard = [NSPasteboard pasteboardWithName:NSFindPboard];
[pasteboard declareTypes:[NSArray arrayWithObject:NSStringPboardType] owner:nil];
[pasteboard setString:[self findString] forType:NSStringPboardType];
}
- (void)loadUI {
if (!findTextField) {
if (![NSBundle loadNibNamed:@"FindPanel" owner:self]) {
NSLog(@"Failed to load FindPanel.nib");
NSBeep();
}
if (self == sharedFindObject) [[findTextField window] setFrameAutosaveName:@"Find"];
}
[findTextField setStringValue:[self findString]];
}
- (void)dealloc {
if (self != sharedFindObject) {
[[NSNotificationCenter defaultCenter] removeObserver:self];
[findString release];
[super dealloc];
}
}
- (NSString *)findString {
return findString;
}
- (void)setFindString:(NSString *)string {
[self setFindString:string writeToPasteboard:YES];
}
- (void)setFindString:(NSString *)string writeToPasteboard:(BOOL)flag {
if ([string isEqualToString:findString]) return;
[findString autorelease];
findString = [string copyWithZone:[self zone]];
if (findTextField) {
[findTextField setStringValue:string];
[findTextField selectText:nil];
}
if (flag) [self loadFindStringToPasteboard];
}
- (NSTextView *)textObjectToSearchIn {
id obj = [[NSApp mainWindow] firstResponder];
return (obj && [obj isKindOfClass:[NSTextView class]]) ? obj : nil;
}
- (NSPanel *)findPanel {
if (!findTextField) [self loadUI];
return (NSPanel *)[findTextField window];
}
/* The primitive for finding; this ends up setting the status field (and beeping if necessary)...
*/
- (BOOL)find:(BOOL)direction {
NSTextView *text = [self textObjectToSearchIn];
lastFindWasSuccessful = NO;
if (text) {
NSString *textContents = [text string];
unsigned textLength;
if (textContents && (textLength = [textContents length])) {
NSRange range;
unsigned options = 0;
if (direction == Backward) options |= NSBackwardsSearch;
if (!ignoreCaseButton || [ignoreCaseButton state]) options |= NSCaseInsensitiveSearch;
range = [textContents findString:[self findString] selectedRange:[text selectedRange] options:options wrap:YES];
if (range.length) {
[text setSelectedRange:range];
[text scrollRangeToVisible:range];
lastFindWasSuccessful = YES;
}
}
}
if (!lastFindWasSuccessful) {
NSBeep();
[statusField setStringValue:NSLocalizedStringFromTable(@"Not found", @"FindPanel", @"Status displayed in find panel when the find string is not found.")];
} else {
[statusField setStringValue:@""];
}
return lastFindWasSuccessful;
}
- (void)orderFrontFindPanel:(id)sender {
NSPanel *panel = [self findPanel];
[findTextField selectText:nil];
[panel makeKeyAndOrderFront:nil];
}
/**** Action methods for gadgets in the find panel; these should all end up setting or clearing the status field ****/
- (void)findNextAndOrderFindPanelOut:(id)sender {
[findNextButton performClick:nil];
if (lastFindWasSuccessful) {
[[self findPanel] orderOut:sender];
} else {
[findTextField selectText:nil];
}
}
- (void)findNext:(id)sender {
if (findTextField) [self setFindString:[findTextField stringValue]]; /* findTextField should be set */
(void)[self find:Forward];
}
- (void)findPrevious:(id)sender {
if (findTextField) [self setFindString:[findTextField stringValue]]; /* findTextField should be set */
(void)[self find:Backward];
}
- (void)replace:(id)sender {
NSTextView *text = [self textObjectToSearchIn];
// shouldChangeTextInRange:... should return NO if !isEditable, but doesn't...
if (text && [text isEditable] && [text shouldChangeTextInRange:[text selectedRange] replacementString:[replaceTextField stringValue]]) {
[[text textStorage] replaceCharactersInRange:[text selectedRange] withString:[replaceTextField stringValue]];
[text didChangeText];
} else {
NSBeep();
}
[statusField setStringValue:@""];
}
- (void)replaceAndFind:(id)sender {
[self replace:sender];
[self findNext:sender];
}
#define ReplaceAllScopeEntireFile 42
#define ReplaceAllScopeSelection 43
/* The replaceAll: code is somewhat complex. One reason for this is to support undo well --- To play along with the undo mechanism in the text object, this method goes through the shouldChangeTextInRange:replacementString: mechanism. In order to do that, it precomputes the section of the string that is being updated. An alternative would be for this method to handle the undo for the replaceAll: operation itself, and register the appropriate changes. However, this is simpler...
Turns out this approach of building the new string and inserting it at the appropriate place in the actual text storage also has an added benefit of performance; it avoids copying the contents of the string around on every replace, which is significant in large files with many replacements. Of course there is the added cost of the temporary replacement string, but we try to compute that as tightly as possible beforehand to reduce the memory requirements.
*/
- (void)replaceAll:(id)sender {
NSTextView *text = [self textObjectToSearchIn];
if (!text || ![text isEditable]) {
[statusField setStringValue:@""];
NSBeep();
} else {
NSTextStorage *textStorage = [text textStorage];
NSString *textContents = [text string];
BOOL entireFile = replaceAllScopeMatrix ? ([replaceAllScopeMatrix selectedTag] == ReplaceAllScopeEntireFile) : YES;
NSRange replaceRange = entireFile ? NSMakeRange(0, [textStorage length]) : [text selectedRange];
unsigned searchOption = ((!ignoreCaseButton || [ignoreCaseButton state]) ? NSCaseInsensitiveSearch : 0);
unsigned replaced = 0;
NSRange firstOccurence;
if (findTextField) [self setFindString:[findTextField stringValue]];
// Find the first occurence of the string being replaced; if not found, we're done!
firstOccurence = [textContents rangeOfString:[self findString] options:searchOption range:replaceRange];
if (firstOccurence.length > 0) {
NSAutoreleasePool *pool;
NSString *targetString = [self findString];
NSString *replaceString = [replaceTextField stringValue];
NSMutableAttributedString *temp; /* This is the temporary work string in which we will do the replacements... */
NSRange rangeInOriginalString; /* Range in the original string where we do the searches */
// Find the last occurence of the string and union it with the first occurence to compute the tightest range...
rangeInOriginalString = replaceRange = NSUnionRange(firstOccurence, [textContents rangeOfString:targetString options:NSBackwardsSearch|searchOption range:replaceRange]);
temp = [[NSMutableAttributedString alloc] init];
[temp beginEditing];
// The following loop can execute an unlimited number of times, and it could have autorelease activity.
// To keep things under control, we use a pool, but to be a bit efficient, instead of emptying everytime through
// the loop, we do it every so often. We can only do this as long as autoreleased items are not supposed to
// survive between the invocations of the pool!
pool = [[NSAutoreleasePool alloc] init];
while (rangeInOriginalString.length > 0) {
NSRange foundRange = [textContents rangeOfString:targetString options:searchOption range:rangeInOriginalString];
if (foundRange.length == 0) {
[temp appendAttributedString:[textStorage attributedSubstringFromRange:rangeInOriginalString]]; // Copy the remainder
rangeInOriginalString.length = 0; // And signal that we're done
} else {
NSRange rangeToCopy = NSMakeRange(rangeInOriginalString.location, foundRange.location - rangeInOriginalString.location + 1); // Copy upto the start of the found range plus one char (to maintain attributes with the overlap)...
[temp appendAttributedString:[textStorage attributedSubstringFromRange:rangeToCopy]];
[temp replaceCharactersInRange:NSMakeRange([temp length] - 1, 1) withString:replaceString];
rangeInOriginalString.length -= NSMaxRange(foundRange) - rangeInOriginalString.location;
rangeInOriginalString.location = NSMaxRange(foundRange);
replaced++;
if (replaced % 100 == 0) { // Refresh the pool... See warning above!
[pool release];
pool = [[NSAutoreleasePool alloc] init];
}
}
}
[pool release];
[temp endEditing];
// Now modify the original string
if ([text shouldChangeTextInRange:replaceRange replacementString:[temp string]]) {
[textStorage replaceCharactersInRange:replaceRange withAttributedString:temp];
[text didChangeText];
} else { // For some reason the string didn't want to be modified. Bizarre...
replaced = 0;
}
[temp release];
}
if (replaced == 0) {
NSBeep();
[statusField setStringValue:NSLocalizedStringFromTable(@"Not found", @"FindPanel", @"Status displayed in find panel when the find string is not found.")];
} else {
[statusField setStringValue:[NSString localizedStringWithFormat:NSLocalizedStringFromTable(@"%d replaced", @"FindPanel", @"Status displayed in find panel when indicated number of matches are replaced."), replaced]];
}
}
}
- (void)takeFindStringFromSelection:(id)sender {
NSTextView *textView = [self textObjectToSearchIn];
if (textView) {
NSString *selection = [[textView string] substringWithRange:[textView selectedRange]];
[self setFindString:selection];
}
}
- (void) jumpToSelection:sender {
NSTextView *textView = [self textObjectToSearchIn];
if (textView) {
[textView scrollRangeToVisible:[textView selectedRange]];
}
}
@end
@implementation NSString (NSStringTextFinding)
- (NSRange)findString:(NSString *)string selectedRange:(NSRange)selectedRange options:(unsigned)options wrap:(BOOL)wrap {
BOOL forwards = (options & NSBackwardsSearch) == 0;
unsigned length = [self length];
NSRange searchRange, range;
if (forwards) {
searchRange.location = NSMaxRange(selectedRange);
searchRange.length = length - searchRange.location;
range = [self rangeOfString:string options:options range:searchRange];
if ((range.length == 0) && wrap) { /* If not found look at the first part of the string */
searchRange.location = 0;
searchRange.length = selectedRange.location;
range = [self rangeOfString:string options:options range:searchRange];
}
} else {
searchRange.location = 0;
searchRange.length = selectedRange.location;
range = [self rangeOfString:string options:options range:searchRange];
if ((range.length == 0) && wrap) {
searchRange.location = NSMaxRange(selectedRange);
searchRange.length = length - searchRange.location;
range = [self rangeOfString:string options:options range:searchRange];
}
}
return range;
}
@end
Index: TestController.m
===================================================================
RCS file: /cvsroot/curlhandle/CURLHandleTesterSource/TestController.m,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** TestController.m 13 Mar 2003 05:45:48 -0000 1.1.1.1
--- TestController.m 3 Jul 2003 20:03:34 -0000 1.2
***************
*** 97,101 ****
- (IBAction) useSnoop:(id)sender
{
! [oURL setObjectValue:@"http://www.javaskyline.com/servlet/SnoopServlet"];
}
--- 97,101 ----
- (IBAction) useSnoop:(id)sender
{
! [oURL setObjectValue:@"http://www.pds.nysed.gov/servlet/SnoopServlet?happy=yes"];
}
|
|
From: <ph...@us...> - 2003-07-03 20:03:37
|
Update of /cvsroot/curlhandle/CURLHandleTesterSource/English.lproj/MainMenu.nib
In directory sc8-pr-cvs1:/tmp/cvs-serv9157/English.lproj/MainMenu.nib
Modified Files:
classes.nib info.nib objects.nib
Added Files:
keyedobjects.nib
Log Message:
Updated to Dan's release canidate for 1.8
--- NEW FILE: keyedobjects.nib ---
(This appears to be a binary file; contents omitted.)
Index: classes.nib
===================================================================
RCS file: /cvsroot/curlhandle/CURLHandleTesterSource/English.lproj/MainMenu.nib/classes.nib,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** classes.nib 13 Mar 2003 05:45:48 -0000 1.1.1.1
--- classes.nib 3 Jul 2003 20:03:34 -0000 1.2
***************
*** 30,33 ****
--- 30,57 ----
};
SUPERCLASS = NSObject;
+ },
+ {
+ ACTIONS = {
+ findNext = id;
+ findNextAndOrderFindPanelOut = id;
+ findPrevious = id;
+ jumpToSelection = id;
+ orderFrontFindPanel = id;
+ replace = id;
+ replaceAll = id;
+ replaceAndFind = id;
+ takeFindStringFromSelection = id;
+ };
+ CLASS = TextFinder;
+ LANGUAGE = ObjC;
+ OUTLETS = {
+ findNextButton = id;
+ findTextField = id;
+ ignoreCaseButton = id;
+ replaceAllScopeMatrix = id;
+ replaceTextField = id;
+ statusField = id;
+ };
+ SUPERCLASS = NSObject;
}
);
Index: info.nib
===================================================================
RCS file: /cvsroot/curlhandle/CURLHandleTesterSource/English.lproj/MainMenu.nib/info.nib,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** info.nib 13 Mar 2003 05:45:48 -0000 1.1.1.1
--- info.nib 3 Jul 2003 20:03:34 -0000 1.2
***************
*** 1,21 ****
<?xml version="1.0" encoding="UTF-8"?>
! <!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
! <plist version="0.9">
<dict>
<key>IBDocumentLocation</key>
! <string>77 86 356 240 0 0 1920 1178 </string>
<key>IBEditorPositions</key>
<dict>
<key>29</key>
! <string>300 484 292 44 0 0 1920 1178 </string>
</dict>
<key>IBFramework Version</key>
! <string>263.2</string>
<key>IBOpenObjects</key>
<array>
<integer>21</integer>
</array>
<key>IBSystem Version</key>
! <string>5S60a</string>
</dict>
</plist>
--- 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>210 872 356 240 0 0 1920 1178 </string>
<key>IBEditorPositions</key>
<dict>
<key>29</key>
! <string>164 491 292 44 0 0 1920 1178 </string>
</dict>
<key>IBFramework Version</key>
! <string>291.0</string>
<key>IBOpenObjects</key>
<array>
<integer>21</integer>
+ <integer>29</integer>
</array>
<key>IBSystem Version</key>
! <string>6I32</string>
</dict>
</plist>
Index: objects.nib
===================================================================
RCS file: /cvsroot/curlhandle/CURLHandleTesterSource/English.lproj/MainMenu.nib/objects.nib,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
Binary files /tmp/cvsEtXCrc and /tmp/cvsEnlZye differ
|
|
From: <ph...@us...> - 2003-07-03 19:49:38
|
Update of /cvsroot/curlhandle/CURLHandleTesterSource/English.lproj/FindPanel.nib In directory sc8-pr-cvs1:/tmp/cvs-serv6045/English.lproj/FindPanel.nib Log Message: Directory /cvsroot/curlhandle/CURLHandleTesterSource/English.lproj/FindPanel.nib added to the repository |
|
From: <dan...@us...> - 2003-07-01 21:49:19
|
Update of /cvsroot/curlhandle/CURLHandleSource/CURLHandle.pbproj In directory sc8-pr-cvs1:/tmp/cvs-serv4661/CURLHandle.pbproj Modified Files: project.pbxproj Log Message: 1.8 Index: project.pbxproj =================================================================== RCS file: /cvsroot/curlhandle/CURLHandleSource/CURLHandle.pbproj/project.pbxproj,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** project.pbxproj 13 Mar 2003 05:39:58 -0000 1.1.1.1 --- project.pbxproj 1 Jul 2003 21:15:00 -0000 1.2 *************** *** 63,66 **** --- 63,67 ---- 014CEA450018CDF011CA2923, ); + hasScannedForEncodings = 1; isa = PBXProject; mainGroup = 0867D691FE84028FC02AAC07; *************** *** 131,136 **** productReference = 034768E0FF38A50411DB9C8B; productSettingsXML = "<?xml version=\"1.0\" encoding=\"UTF-8\"?> ! <!DOCTYPE plist SYSTEM \"file://localhost/System/Library/DTDs/PropertyList.dtd\"> ! <plist version=\"0.9\"> <dict> <key>CFBundleDevelopmentRegion</key> --- 132,137 ---- productReference = 034768E0FF38A50411DB9C8B; productSettingsXML = "<?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> *************** *** 147,155 **** <string>FMWK</string> <key>CFBundleShortVersionString</key> ! <string>1.7</string> <key>CFBundleSignature</key> <string>????</string> <key>CFBundleVersion</key> ! <string>1.7</string> <key>NSPrincipalClass</key> <string></string> --- 148,156 ---- <string>FMWK</string> <key>CFBundleShortVersionString</key> ! <string>1.8</string> <key>CFBundleSignature</key> <string>????</string> <key>CFBundleVersion</key> ! <string>1.8</string> <key>NSPrincipalClass</key> <string></string> *************** *** 157,161 **** </plist> "; - shouldUseHeadermap = 1; }; 0867D69DFE84028FC02AAC07 = { --- 158,161 ---- *************** *** 166,169 **** --- 166,170 ---- ); isa = PBXHeadersBuildPhase; + runOnlyForDeploymentPostprocessing = 0; }; 0867D69FFE84028FC02AAC07 = { *************** *** 174,177 **** --- 175,179 ---- ); isa = PBXSourcesBuildPhase; + runOnlyForDeploymentPostprocessing = 0; }; 0867D6A0FE84028FC02AAC07 = { *************** *** 186,189 **** --- 188,192 ---- ); isa = PBXFrameworksBuildPhase; + runOnlyForDeploymentPostprocessing = 0; }; 0867D6A5FE840307C02AAC07 = { *************** *** 248,251 **** --- 251,255 ---- //F54 F54C717B0237234E01A8000B = { + fileEncoding = 30; isa = PBXFileReference; path = CURLHandle.h; *************** *** 253,256 **** --- 257,261 ---- }; F54C717C0237234E01A8000B = { + fileEncoding = 30; isa = PBXFileReference; path = CURLHandle.m; *************** *** 258,261 **** --- 263,267 ---- }; F54C717D0237234E01A8000B = { + fileEncoding = 30; isa = PBXFileReference; path = "CURLHandle+extras.h"; *************** *** 263,266 **** --- 269,273 ---- }; F54C717E0237234E01A8000B = { + fileEncoding = 30; isa = PBXFileReference; path = "CURLHandle+extras.m"; *************** *** 316,319 **** --- 323,327 ---- neededFileNames = ( ); + runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "# Sequence courtesy of Kevin Enderby. Changes common symbol into a definition.\n# The result is in /tmp/curl and you could move it back into /usr/local/lib; we\n# just leave it here and statically link to it. \nmkdir /tmp/curl\ncd /tmp/curl\nar x /usr/local/lib/libcurl.a\nld -r -d hostip.o\nmv a.out hostip.o\nlibtool -o libcurl.a *.o"; |
|
From: <dan...@us...> - 2003-07-01 21:49:14
|
Update of /cvsroot/curlhandle/CURLHandleSource
In directory sc8-pr-cvs1:/tmp/cvs-serv4661
Modified Files:
CURLHandle+extras.m CURLHandle.m
Log Message:
1.8
Index: CURLHandle+extras.m
===================================================================
RCS file: /cvsroot/curlhandle/CURLHandleSource/CURLHandle+extras.m,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** CURLHandle+extras.m 13 Mar 2003 05:39:58 -0000 1.1.1.1
--- CURLHandle+extras.m 1 Jul 2003 21:15:00 -0000 1.2
***************
*** 463,465 ****
--- 463,486 ----
}
+ /*" Sets the accepted encodings. If encodings is a non-zero length string, then it is used as the
+ value for the Accept-encoding header. If it is a zero length string, then all supported
+ encodings are used (gzip, deflate at the time of writing). If it is nil, then the Accept-encoding
+ header is cleared. gzip got support in version 7.10.5 or later of the curl library.
+ "*/
+ - (void)setAcceptEncoding:(NSString *)encodings
+ {
+ [self setString:encodings forKey:CURLOPT_ENCODING];
+ }
+
+ /*" Sets CURL to accept all supported encodings transparently.
+ "*/
+ - (void)setAcceptCompression:(BOOL)yorn
+ {
+ if( yorn )
+ [self setAcceptEncoding:@""];
+ else
+ [self setAcceptEncoding:nil];
+ }
+
+
@end
Index: CURLHandle.m
===================================================================
RCS file: /cvsroot/curlhandle/CURLHandleSource/CURLHandle.m,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** CURLHandle.m 13 Mar 2003 05:39:58 -0000 1.1.1.1
--- CURLHandle.m 1 Jul 2003 21:15:00 -0000 1.2
***************
*** 273,277 ****
[mPort setDelegate:nil];
// And remove the port from the runloop
! [[NSRunLoop currentRunLoop] removePort:mPort forMode:NSDefaultRunLoopMode];
[mPort release];
--- 273,277 ----
[mPort setDelegate:nil];
// And remove the port from the runloop
! [[NSRunLoop currentRunLoop] removePort:mPort forMode:(NSString *)kCFRunLoopCommonModes];
[mPort release];
***************
*** 351,355 ****
#if 1
#warning # this may be leaking ... there are two retains going on here. Apple bug report #2885852
! [[NSRunLoop currentRunLoop] addPort:mPort forMode:NSDefaultRunLoopMode];
#else
#warning # This attempt to compensate for the leak causes crashes....
--- 351,355 ----
#if 1
#warning # this may be leaking ... there are two retains going on here. Apple bug report #2885852
! [[NSRunLoop currentRunLoop] addPort:mPort forMode:(NSString *)kCFRunLoopCommonModes];
#else
#warning # This attempt to compensate for the leak causes crashes....
***************
*** 357,361 ****
int oldCount = [mPort retainCount];
int newCount;
! [[NSRunLoop currentRunLoop] addPort:mPort forMode:NSDefaultRunLoopMode];
newCount = [mPort retainCount];
--- 357,361 ----
int oldCount = [mPort retainCount];
int newCount;
! [[NSRunLoop currentRunLoop] addPort:mPort forMode:(NSString *)kCFRunLoopCommonModes];
newCount = [mPort retainCount];
***************
*** 645,648 ****
--- 645,649 ----
}
}
+ [proxies release];
}
***************
*** 863,873 ****
while ((key = [e nextObject]))
{
NSString *escapedKey
= (NSString *) CFURLCreateStringByAddingPercentEscapes(
! NULL, (CFStringRef) key, NULL, NULL, cfStrEnc);
! NSString *escapedObject
! = (NSString *) CFURLCreateStringByAddingPercentEscapes(
! NULL, (CFStringRef) [[self objectForKey:key] description], NULL, NULL, cfStrEnc);
! [s appendFormat:@"%@=%@&", escapedKey, escapedObject];
}
// Delete final & from the string
--- 864,892 ----
while ((key = [e nextObject]))
{
+ id keyObject = [self objectForKey: key];
+ // conform with rfc 1738 3.3, also escape URL-like characters that might be in the parameters
NSString *escapedKey
= (NSString *) CFURLCreateStringByAddingPercentEscapes(
! NULL, (CFStringRef) key, NULL, (CFStringRef) @";:@&=/", cfStrEnc);
! if ([keyObject respondsToSelector: @selector(objectEnumerator)])
! {
! NSEnumerator *multipleValueEnum = [keyObject objectEnumerator];
! id aValue;
!
! while ((aValue = [multipleValueEnum nextObject]))
! {
! NSString *escapedObject
! = (NSString *) CFURLCreateStringByAddingPercentEscapes(
! NULL, (CFStringRef) [aValue description], NULL, (CFStringRef) @";:@&=/", cfStrEnc);
! [s appendFormat:@"%@=%@&", escapedKey, escapedObject];
! }
! }
! else
! {
! NSString *escapedObject
! = (NSString *) CFURLCreateStringByAddingPercentEscapes(
! NULL, (CFStringRef) [keyObject description], NULL, (CFStringRef) @";:@&=/", cfStrEnc);
! [s appendFormat:@"%@=%@&", escapedKey, escapedObject];
! }
}
// Delete final & from the string
|
|
From: Tim L. <tl...@en...> - 2003-03-13 06:10:50
|
Testing 1, 2, 3 |
|
From: Tim L. <tim...@th...> - 2003-03-13 06:07:06
|
Testing 1, 2, 3 |
|
From: Tim L. <tl...@en...> - 2003-03-13 04:38:37
|
Testing 1, 2, 3 |