[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
sullivan
sullivan at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 07:29:29 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit 5cf7da96cffe800631c13fa94725b82544b27421
Author: sullivan <sullivan at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Mar 13 20:11:20 2003 +0000
WebKit:
Removed all the bookmarks code from WebKit; put it
in WebBrowser instead.
Reviewed by Darin
* Bookmarks.subproj/WebBookmark.h: Removed.
* Bookmarks.subproj/WebBookmark.m: Removed.
* Bookmarks.subproj/WebBookmarkGroup.h: Removed.
* Bookmarks.subproj/WebBookmarkGroup.m: Removed.
* Bookmarks.subproj/WebBookmarkGroupPrivate.h: Removed.
* Bookmarks.subproj/WebBookmarkImporter.h: Removed.
* Bookmarks.subproj/WebBookmarkImporter.m: Removed.
* Bookmarks.subproj/WebBookmarkLeaf.h: Removed.
* Bookmarks.subproj/WebBookmarkLeaf.m: Removed.
* Bookmarks.subproj/WebBookmarkList.h: Removed.
* Bookmarks.subproj/WebBookmarkList.m: Removed.
* Bookmarks.subproj/WebBookmarkPrivate.h: Removed.
* Bookmarks.subproj/WebBookmarkProxy.h: Removed.
* Bookmarks.subproj/WebBookmarkProxy.m: Removed.
* WebKit.exp:
removed all bookmark-related symbols
* WebKit.pbproj/project.pbxproj:
updated for removed files
WebBrowser:
Moved all the bookmarks code that was in WebKit
into WebBrowser. No code changes other than fixing
up #imports to make everything compile.
Reviewed by Darin
* ABHomePagesController.m:
* BookmarkSource.m:
* BookmarksController.m:
* BookmarksViewController.m:
* BrowserDocument.m:
* BrowserNSViewExtras.m:
* BrowserWebBookmarkExtras.h:
* BrowserWebBookmarkExtras.m:
* BrowserWindowController.m:
* ContextMenuHandler.m:
* FavoritesBar.m:
* FavoritesBarView.m:
* GlobalHistory.m:
* LocationTextField.m:
* NewBookmarksController.m:
* RendezvousController.m:
* TitleBarButton.m:
* URLCompletionController.m:
Just fixed up #imports for moved bookmarks files.
* WebBookmark.m:
* WebBookmarkGroup.h:
* WebBookmarkGroup.m:
* WebBookmarkGroupPrivate.h:
* WebBookmarkImporter.m:
* WebBookmarkLeaf.h:
* WebBookmarkLeaf.m:
* WebBookmarkList.h:
* WebBookmarkList.m:
* WebBookmarkPrivate.h:
* WebBookmarkProxy.h:
These are the files that were moved (and had their #imports
changed also). They don't say "New" because I moved the
cvs history on the server first.
* WebBrowser.pbproj/project.pbxproj:
updated for files added to project
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3820 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit/Bookmarks.subproj/WebBookmark.h b/WebKit/Bookmarks.subproj/WebBookmark.h
deleted file mode 100644
index c13ab37..0000000
--- a/WebKit/Bookmarks.subproj/WebBookmark.h
+++ /dev/null
@@ -1,93 +0,0 @@
-//
-// WebBookmark.h
-// WebKit
-//
-// Created by John Sullivan on Tue Apr 30 2002.
-// Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
-//
-
-#import <Cocoa/Cocoa.h>
-
- at class WebBookmarkGroup;
-
-typedef enum {
- WebBookmarkTypeLeaf,
- WebBookmarkTypeList,
- WebBookmarkTypeProxy,
-} WebBookmarkType;
-
- at interface WebBookmark : NSObject <NSCopying> {
- WebBookmark *_parent;
- WebBookmarkGroup *_group;
- NSString *_identifier;
- NSString *_UUID;
-}
-
-+ (WebBookmark *)bookmarkFromDictionaryRepresentation:(NSDictionary *)dict withGroup:(WebBookmarkGroup *)group;
-+ (WebBookmark *)bookmarkOfType:(WebBookmarkType)type;
-
-- (id)initFromDictionaryRepresentation:(NSDictionary *)dict withGroup:(WebBookmarkGroup *)group;
-// Note: this returns an NSMutableDictionary for subclasses' sake; other callers should treat it as non-mutable
-- (NSDictionary *)dictionaryRepresentation;
-
-- (NSString *)title;
-- (void)setTitle:(NSString *)title;
-
-- (NSImage *)icon;
-
-// The type of bookmark
-- (WebBookmarkType)bookmarkType;
-
-// String intended to represent URL for leaf bookmarks. May not be a valid URL string.
-// This is nil if bookmarkType is not WebBookmarkTypeLeaf.
-- (NSString *)URLString;
-
-// Sets the string intended to represent URL for leaf bookmarks. URLString need not be
-// a valid URL string. Does nothing if bookmarkType is not WebBookmarkTypeLeaf.
-- (void)setURLString:(NSString *)URLString;
-
-// String for client use; it is nil unless specified with setIdentifier
-- (NSString *)identifier;
-
-// Sets a string that can be retrieved later with -identifier. Not used internally
-// in any way; clients can use it as they see fit.
-- (void)setIdentifier:(NSString *)identifier;
-
-// Globally unique ID for this bookmark.
-- (NSString *)UUID;
-
-// Set a globally unique ID for this bookmark. If any existing bookmark in this
-// group has this UUID, the existing one will be changed. Normally clients do
-// not need to call this; it is handled internally automatically. Occasionally
-// a client might want to assign a specific UUID to a specific bookmark.
-- (void)setUUID:(NSString *)newUUID;
-
-// Array of child WebBookmarks. Returns nil if bookmarkType is not WebBookmarkTypeList.
-// This creates a copy of the internal data structure, and thus is safe to (for example),
-// iterate through, removing items from their parent as you go.
-- (NSArray *)children;
-
-// Array of child WebBookmarks. Returns nil if bookmarkType is not WebBookmarkTypeList.
-// This returns the internal data structure itself. This array should not be modified,
-// and operations that alter the children of this bookmark will affect the contents of this array.
-- (NSArray *)rawChildren;
-
-// Number of children. Returns 0 if bookmarkType is not WebBookmarkTypeList.
-- (unsigned)numberOfChildren;
-
-// Insert a bookmark into the list. Does nothing if bookmarkType is not WebBookmarkTypeList.
-- (void)insertChild:(WebBookmark *)bookmark atIndex:(unsigned)index;
-
-// Remove a bookmark from the list. Does nothing if bookmarkType is not WebBookmarkTypeList.
-- (void)removeChild:(WebBookmark *)bookmark;
-
-// The parent of this bookmark, or nil if this is the top bookmark in a group
-- (WebBookmark *)parent;
-
-// The group that this bookmark belongs to.
-- (WebBookmarkGroup *)group;
-
-// Compare the content (all information other than parent/group) to another bookmark
-- (BOOL)contentMatches:(WebBookmark *)otherBookmark;
-
- at end
diff --git a/WebKit/Bookmarks.subproj/WebBookmark.m b/WebKit/Bookmarks.subproj/WebBookmark.m
deleted file mode 100644
index 88d0dfd..0000000
--- a/WebKit/Bookmarks.subproj/WebBookmark.m
+++ /dev/null
@@ -1,301 +0,0 @@
-//
-// WebBookmark.m
-// WebKit
-//
-// Created by John Sullivan on Tue Apr 30 2002.
-// Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
-//
-
-#import <WebKit/WebBookmark.h>
-#import <WebKit/WebBookmarkPrivate.h>
-#import <WebKit/WebBookmarkGroup.h>
-#import <WebKit/WebBookmarkGroupPrivate.h>
-#import <WebKit/WebBookmarkLeaf.h>
-#import <WebKit/WebBookmarkList.h>
-#import <WebKit/WebBookmarkProxy.h>
-#import <WebFoundation/WebAssertions.h>
-
-// to get NSRequestConcreteImplementation
-#import <Foundation/NSPrivateDecls.h>
-
- at implementation WebBookmark
-
-- (void)dealloc
-{
- // a bookmark must be removed from its group before this,
- // so the UUID table removes its (optional) entry for the bookmark.
- ASSERT (_group == nil);
-
- [_identifier release];
- [_UUID release];
-
- [super dealloc];
-}
-
-- (id)copyWithZone:(NSZone *)zone
-{
- WebBookmark *copy = NSCopyObject(self, 0, zone);
- copy->_group = nil;
- copy->_parent = nil;
- copy->_identifier = nil;
- copy->_UUID = nil;
-
- [copy setIdentifier:[self identifier]];
-
- // UUID starts the same as the original, which is OK
- // since the copy isn't in a group yet. When it's added
- // to a group, the UUID will be uniqued if necessary at that time.
- if ([self _hasUUID]) {
- [copy setUUID:[self UUID]];
- }
-
- // parent and group are left nil for fresh copies
-
- return copy;
-}
-
-- (NSString *)title
-{
- NSRequestConcreteImplementation(self, _cmd, [self class]);
- return nil;
-}
-
-- (void)setTitle:(NSString *)title
-{
- NSRequestConcreteImplementation(self, _cmd, [self class]);
-}
-
-- (NSImage *)icon
-{
- NSRequestConcreteImplementation(self, _cmd, [self class]);
- return nil;
-}
-
-- (WebBookmarkType)bookmarkType
-{
- NSRequestConcreteImplementation(self, _cmd, [self class]);
- return WebBookmarkTypeLeaf;
-}
-
-- (NSString *)URLString
-{
- return nil;
-}
-
-- (void)setURLString:(NSString *)URLString
-{
- NSRequestConcreteImplementation(self, _cmd, [self class]);
-}
-
-- (NSString *)identifier
-{
- return [[_identifier copy] autorelease];
-}
-
-- (void)setIdentifier:(NSString *)identifier
-{
- if (identifier == _identifier) {
- return;
- }
-
- [_identifier release];
- _identifier = [identifier copy];
-}
-
-- (NSArray *)children
-{
- return nil;
-}
-
-- (NSArray *)rawChildren
-{
- return nil;
-}
-
-- (unsigned)numberOfChildren
-{
- return 0;
-}
-
-- (unsigned)_numberOfDescendants
-{
- return 0;
-}
-
-- (void)insertChild:(WebBookmark *)bookmark atIndex:(unsigned)index
-{
- NSRequestConcreteImplementation(self, _cmd, [self class]);
-}
-
-- (void)removeChild:(WebBookmark *)bookmark
-{
- NSRequestConcreteImplementation(self, _cmd, [self class]);
-}
-
-- (WebBookmark *)parent
-{
- return _parent;
-}
-
-- (void)_setParent:(WebBookmark *)parent
-{
- // Don't retain parent, to avoid circular ownership that prevents dealloc'ing
- // when a parent with children is removed from a group and has no other references.
- _parent = parent;
-}
-
-- (void)setUUID:(NSString *)UUID
-{
- if (UUID == _UUID || [UUID isEqualToString:_UUID]) {
- return;
- }
-
- NSString *oldUUID = _UUID;
- _UUID = [UUID copy];
-
- [[self group] _bookmark:self changedUUIDFrom:oldUUID to:_UUID];
- [oldUUID release];
-}
-
-- (NSString *)UUID
-{
- // lazily generate
- if (_UUID == nil) {
- CFUUIDRef UUIDRef = CFUUIDCreate(kCFAllocatorDefault);
- _UUID = (NSString *)CFUUIDCreateString(kCFAllocatorDefault, UUIDRef);
- [[self group] _bookmark:self changedUUIDFrom:nil to:_UUID];
- CFRelease(UUIDRef);
- }
-
- return _UUID;
-}
-
-- (BOOL)_hasUUID
-{
- return _UUID != nil;
-}
-
-- (WebBookmarkGroup *)group
-{
- return _group;
-}
-
-- (void)_setGroup:(WebBookmarkGroup *)group
-{
- if (group == _group) {
- return;
- }
-
- [_group release];
-
- _group = [group retain];
-}
-
-+ (WebBookmark *)bookmarkOfType:(WebBookmarkType)type
-{
- if (type == WebBookmarkTypeList) {
- return [[[WebBookmarkList alloc] init] autorelease];
- } else if (type == WebBookmarkTypeLeaf) {
- return [[[WebBookmarkLeaf alloc] init] autorelease];
- } else if (type == WebBookmarkTypeProxy) {
- return [[[WebBookmarkProxy alloc] init] autorelease];
- }
-
- return nil;
-}
-
-
-+ (WebBookmark *)bookmarkFromDictionaryRepresentation:(NSDictionary *)dict withGroup:(WebBookmarkGroup *)group
-{
- NSString *typeString = [dict objectForKey:WebBookmarkTypeKey];
-
- if (![typeString isKindOfClass:[NSString class]]) {
- ERROR("bad dictionary");
- return nil;
- }
-
- Class class = nil;
-
- if ([typeString isEqualToString:WebBookmarkTypeListValue]) {
- class = [WebBookmarkList class];
- } else if ([typeString isEqualToString:WebBookmarkTypeLeafValue]) {
- class = [WebBookmarkLeaf class];
- } else if ([typeString isEqualToString:WebBookmarkTypeProxyValue]) {
- class = [WebBookmarkProxy class];
- }
-
- if (class) {
- return [[[class alloc] initFromDictionaryRepresentation:dict
- withGroup:group] autorelease];
- }
-
- return nil;
-}
-
-- (id)initFromDictionaryRepresentation:(NSDictionary *)dict withGroup:(WebBookmarkGroup *)group
-{
- [self init];
-
- [self setIdentifier:[dict objectForKey:WebBookmarkIdentifierKey]];
- [self setUUID:[dict objectForKey:WebBookmarkUUIDKey]];
- [group _addBookmark:self];
-
- return self;
-}
-
-- (NSDictionary *)dictionaryRepresentation
-{
- NSMutableDictionary *dict = [NSMutableDictionary dictionary];
- if ([self identifier] != nil) {
- [dict setObject:[self identifier] forKey:WebBookmarkIdentifierKey];
- }
- // UUID is generated lazily; guaranteed to be non-nil
- [dict setObject:[self UUID] forKey:WebBookmarkUUIDKey];
-
- return dict;
-}
-
-- (BOOL)contentMatches:(WebBookmark *)otherBookmark
-{
- WebBookmarkType bookmarkType = [self bookmarkType];
- if (bookmarkType != [otherBookmark bookmarkType]) {
- return NO;
- }
-
- if (![[self title] isEqualToString:[otherBookmark title]]) {
- return NO;
- }
-
- NSString *thisURLString = [self URLString];
- NSString *thatURLString = [otherBookmark URLString];
- // handle case where both are nil
- if (thisURLString != thatURLString && ![thisURLString isEqualToString:thatURLString]) {
- return NO;
- }
-
- NSString *thisIdentifier = [self identifier];
- NSString *thatIdentifier = [otherBookmark identifier];
- // handle case where both are nil
- if (thisIdentifier != thatIdentifier && ![thisIdentifier isEqualToString:thatIdentifier]) {
- return NO;
- }
-
- unsigned thisCount = [self numberOfChildren];
- if (thisCount != [otherBookmark numberOfChildren]) {
- return NO;
- }
-
- unsigned childIndex;
- for (childIndex = 0; childIndex < thisCount; ++childIndex) {
- NSArray *theseChildren = [self rawChildren];
- NSArray *thoseChildren = [otherBookmark rawChildren];
- if (![[theseChildren objectAtIndex:childIndex] contentMatches:[thoseChildren objectAtIndex:childIndex]]) {
- return NO;
- }
- }
-
- return YES;
-}
-
-
- at end
diff --git a/WebKit/Bookmarks.subproj/WebBookmarkGroup.h b/WebKit/Bookmarks.subproj/WebBookmarkGroup.h
deleted file mode 100644
index 54ed7e5..0000000
--- a/WebKit/Bookmarks.subproj/WebBookmarkGroup.h
+++ /dev/null
@@ -1,73 +0,0 @@
-//
-// WebBookmarkGroup.h
-// WebKit
-//
-// Created by John Sullivan on Tue Apr 30 2002.
-// Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
-//
-
-#import <Cocoa/Cocoa.h>
-#import <WebKit/WebBookmark.h>
-
-// Notifications sent when bookmarks are added/removed from group, or when bookmarks in group are modified
-extern NSString *WebBookmarksWereAddedNotification;
-extern NSString *WebBookmarksWereRemovedNotification;
-extern NSString *WebBookmarkWillChangeNotification;
-extern NSString *WebBookmarkDidChangeNotification;
-extern NSString *WebBookmarksWillBeReloadedNotification;
-extern NSString *WebBookmarksWereReloadedNotification;
-
-// keys for userInfo for the above notifications.
-
-// The lowest common ancestor of all the WebBookmark objects that changed. This is the
-// parent for adds and removes.
-extern NSString *WebModifiedBookmarkKey;
-// For adds and removes, the children that were added. Value is always an array.
-extern NSString *WebBookmarkChildrenKey;
-
- at interface WebBookmarkGroup : NSObject
-{
- NSString *_tag;
- NSString *_file;
- WebBookmark *_topBookmark;
- NSMutableDictionary *_bookmarksByUUID;
- BOOL _loading;
-}
-
-+ (WebBookmarkGroup *)bookmarkGroupWithFile: (NSString *)file;
-- (id)initWithFile: (NSString *)file;
-
-// examining contents
-- (WebBookmark *)topBookmark;
-
-// modifying contents
-- (WebBookmark *)insertNewBookmarkAtIndex:(unsigned)index
- ofBookmark:(WebBookmark *)parent
- withTitle:(NSString *)newTitle
- URLString:(NSString *)newURLString
- type:(WebBookmarkType)bookmarkType;
-- (WebBookmark *)addNewBookmarkToBookmark:(WebBookmark *)parent
- withTitle:(NSString *)newTitle
- URLString:(NSString *)newURLString
- type:(WebBookmarkType)bookmarkType;
-
-// storing contents on disk
-
-// The file path used for storing this WebBookmarkGroup, specified in -[WebBookmarkGroup initWithFile:] or +[WebBookmarkGroup bookmarkGroupWithFile:]
-- (NSString *)file;
-
-// Load bookmark group from file. This happens automatically at init time, and need not normally be called.
-- (BOOL)loadBookmarkGroup;
-
-// Marker for bookmark group, read from file. This cannot be changed in the current implementation.
-// It can be used to see whether one file represents the same WebBookmarkGroup as another. If no
-// tag is stored in the file, returns nil.
-- (NSString *)tag;
-
-// Save bookmark group to file. It is the client's responsibility to call this at appropriate times.
-- (BOOL)saveBookmarkGroup;
-
-// Return the existing bookmark with the given UUID, or nil if none
-- (WebBookmark *)bookmarkForUUID:(NSString *)UUID;
-
- at end
diff --git a/WebKit/Bookmarks.subproj/WebBookmarkGroup.m b/WebKit/Bookmarks.subproj/WebBookmarkGroup.m
deleted file mode 100644
index 738eac3..0000000
--- a/WebKit/Bookmarks.subproj/WebBookmarkGroup.m
+++ /dev/null
@@ -1,360 +0,0 @@
-//
-// WebBookmarkGroup.m
-// WebKit
-//
-// Created by John Sullivan on Tue Apr 30 2002.
-// Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
-//
-
-#import <WebKit/WebBookmarkGroup.h>
-#import <WebKit/WebBookmarkGroupPrivate.h>
-#import <WebKit/WebBookmarkPrivate.h>
-#import <WebKit/WebBookmarkList.h>
-#import <WebKit/WebBookmarkLeaf.h>
-#import <WebKit/WebBookmarkProxy.h>
-#import <WebKit/WebKitLogging.h>
-
-NSString *WebBookmarksWereAddedNotification = @"WebBookmarksWereAddedNotification";
-NSString *WebBookmarksWereRemovedNotification = @"WebBookmarksWereRemovedNotification";
-NSString *WebBookmarkDidChangeNotification = @"WebBookmarkDidChangeNotification";
-NSString *WebBookmarkWillChangeNotification = @"WebBookmarkWillChangeNotification";
-NSString *WebBookmarksWillBeReloadedNotification = @"WebBookmarksWillBeReloadedNotification";
-NSString *WebBookmarksWereReloadedNotification = @"WebBookmarksWereReloadedNotification";
-NSString *WebModifiedBookmarkKey = @"WebModifiedBookmarkKey";
-NSString *WebBookmarkChildrenKey = @"WebBookmarkChildrenKey";
-NSString *TagKey = @"WebBookmarkGroupTag";
-
- at interface WebBookmarkGroup (WebForwardDeclarations)
-- (void)_setTopBookmark:(WebBookmark *)newTopBookmark;
- at end
-
- at implementation WebBookmarkGroup
-
-+ (WebBookmarkGroup *)bookmarkGroupWithFile: (NSString *)file
-{
- return [[[WebBookmarkGroup alloc] initWithFile:file] autorelease];
-}
-
-- (id)init
-{
- ERROR("[WebBookmarkGroup init] not supported, use initWithFile: instead");
- [self release];
- return nil;
-}
-
-- (id)initWithFile: (NSString *)file
-{
- if (![super init]) {
- return nil;
- }
-
- _file = [file copy];
- [self _setTopBookmark:nil];
- _bookmarksByUUID = [[NSMutableDictionary alloc] init];
-
- // read history from disk
- [self loadBookmarkGroup];
-
- return self;
-}
-
-- (void)dealloc
-{
- [_bookmarksByUUID release];
- [_file release];
- [_tag release];
- [_topBookmark release];
- [super dealloc];
-}
-
-- (WebBookmark *)bookmarkForUUID:(NSString *)UUID
-{
- return [_bookmarksByUUID objectForKey:UUID];
-}
-
-- (void)_addBookmark:(WebBookmark *)bookmark
-{
- if ([bookmark group] == self) {
- return;
- }
-
- ASSERT([bookmark group] == nil);
-
- if ([bookmark _hasUUID]) {
- NSString *UUID = [bookmark UUID];
- // Clear UUID on former owner of this UUID (if any) -- new copy gets to keep it
- // FIXME 3153832: this means copy/paste transfers the UUID to the new bookmark.
- [[_bookmarksByUUID objectForKey:UUID] setUUID:nil];
- [_bookmarksByUUID setObject:bookmark forKey:UUID];
- }
-
- [bookmark _setGroup:self];
-
- // Recurse with bookmark's children
- NSArray *rawChildren = [bookmark rawChildren];
- unsigned count = [rawChildren count];
- unsigned childIndex;
- for (childIndex = 0; childIndex < count; ++childIndex) {
- [self _addBookmark:[rawChildren objectAtIndex:childIndex]];
- }
-}
-
-- (void)_bookmark:(WebBookmark *)bookmark changedUUIDFrom:(NSString *)oldUUID to:(NSString *)newUUID
-{
- ASSERT([bookmark group] == self);
-
- if (oldUUID != nil) {
- [_bookmarksByUUID removeObjectForKey:oldUUID];
- }
-
- if (newUUID != nil) {
- [_bookmarksByUUID setObject:bookmark forKey:newUUID];
- }
-}
-
-- (void)_removeBookmark:(WebBookmark *)bookmark
-{
- ASSERT([bookmark group] == self);
-
- if ([bookmark _hasUUID]) {
- ASSERT([_bookmarksByUUID objectForKey:[bookmark UUID]] == bookmark);
- [_bookmarksByUUID removeObjectForKey:[bookmark UUID]];
- }
-
- [bookmark _setGroup:nil];
-
- // Recurse with bookmark's children
- NSArray *rawChildren = [bookmark rawChildren];
- unsigned count = [rawChildren count];
- unsigned childIndex;
- for (childIndex = 0; childIndex < count; ++childIndex) {
- [self _removeBookmark:[rawChildren objectAtIndex:childIndex]];
- }
-}
-
-- (NSString *)tag
-{
- return _tag;
-}
-
-- (WebBookmark *)topBookmark
-{
- return _topBookmark;
-}
-
-- (void)_sendNotification:(NSString *)name forBookmark:(WebBookmark *)bookmark children:(NSArray *)kids
-{
- NSDictionary *userInfo;
-
- // Some notifications (e.g. WillBeReloaded/WereReloaded) have no bookmark parameter. But
- // if there's a kids parameter, there must be a bookmark parameter also.
- ASSERT(bookmark != nil || kids == nil);
-
- if (_loading) {
- return;
- }
-
- userInfo = [NSDictionary dictionaryWithObjectsAndKeys:
- bookmark, WebModifiedBookmarkKey,
- kids, WebBookmarkChildrenKey, // kids==nil will conveniently terminate the arg list
- nil];
-
- [[NSNotificationCenter defaultCenter] postNotificationName:name object:self userInfo:userInfo];
-}
-
-- (void)_setTopBookmark:(WebBookmark *)newTopBookmark
-{
- ASSERT_ARG(newTopBookmark, newTopBookmark == nil ||
- [newTopBookmark bookmarkType] == WebBookmarkTypeList);
-
- [newTopBookmark retain];
-
- if (_topBookmark != nil) {
- [self _removeBookmark:_topBookmark];
- }
- [_topBookmark release];
-
- if (newTopBookmark) {
- _topBookmark = newTopBookmark;
- } else {
- _topBookmark = [[WebBookmarkList alloc] initWithTitle:nil group:self];
- }
-}
-
-- (void)_bookmarkWillChange:(WebBookmark *)bookmark
-{
- [self _sendNotification:WebBookmarkWillChangeNotification forBookmark:bookmark children:nil];
-}
-
-- (void)_bookmarkDidChange:(WebBookmark *)bookmark
-{
- [self _sendNotification:WebBookmarkDidChangeNotification forBookmark:bookmark children:nil];
-}
-
-- (void)_bookmarkChildren:(NSArray *)kids wereAddedToParent:(WebBookmark *)bookmark
-{
- ASSERT_ARG(bookmark, [bookmark bookmarkType] == WebBookmarkTypeList);
- [self _sendNotification:WebBookmarksWereAddedNotification forBookmark:bookmark children:kids];
-}
-
-- (void)_bookmarkChildren:(NSArray *)kids wereRemovedFromParent:(WebBookmark *)bookmark
-{
- ASSERT_ARG(bookmark, [bookmark bookmarkType] == WebBookmarkTypeList);
- [self _sendNotification:WebBookmarksWereRemovedNotification forBookmark:bookmark children:kids];
-}
-
-- (void)_bookmarksWillBeReloaded
-{
- [self _sendNotification:WebBookmarksWillBeReloadedNotification forBookmark:nil children:nil];
-}
-
-- (void)_bookmarksWereReloaded
-{
- [self _sendNotification:WebBookmarksWereReloadedNotification forBookmark:nil children:nil];
-}
-
-- (WebBookmark *)addNewBookmarkToBookmark:(WebBookmark *)parent
- withTitle:(NSString *)newTitle
- URLString:(NSString *)newURLString
- type:(WebBookmarkType)bookmarkType
-{
- return [self insertNewBookmarkAtIndex:[parent numberOfChildren]
- ofBookmark:parent
- withTitle:newTitle
- URLString:newURLString
- type:bookmarkType];
-}
-
-- (WebBookmark *)insertNewBookmarkAtIndex:(unsigned)index
- ofBookmark:(WebBookmark *)parent
- withTitle:(NSString *)newTitle
- URLString:(NSString *)newURLString
- type:(WebBookmarkType)bookmarkType
-{
- WebBookmark *bookmark = nil;
-
- ASSERT_ARG(parent, [parent group] == self);
- ASSERT_ARG(parent, [parent bookmarkType] == WebBookmarkTypeList);
- ASSERT_ARG(newURLString, bookmarkType == WebBookmarkTypeLeaf || (newURLString == nil));
-
- switch (bookmarkType) {
- case WebBookmarkTypeLeaf:
- bookmark = [[WebBookmarkLeaf alloc] initWithURLString:newURLString
- title:newTitle
- group:self];
- break;
- case WebBookmarkTypeList:
- bookmark = [[WebBookmarkList alloc] initWithTitle:newTitle
- group:self];
- break;
- case WebBookmarkTypeProxy:
- bookmark = [[WebBookmarkProxy alloc] initWithTitle:newTitle
- group:self];
- break;
- }
-
- [parent insertChild:bookmark atIndex:index];
- return [bookmark autorelease];
-}
-
-- (NSString *)file
-{
- return _file;
-}
-
-- (BOOL)_loadBookmarkGroupGuts
-{
- NSString *path;
- NSDictionary *dictionary;
- WebBookmarkList *newTopBookmark;
-
- path = [self file];
- if (path == nil) {
- ERROR("couldn't load bookmarks; couldn't find or create directory to store it in");
- return NO;
- }
-
- dictionary = [NSDictionary dictionaryWithContentsOfFile: path];
- if (dictionary == nil) {
- if ([[NSFileManager defaultManager] fileExistsAtPath: path]) {
- ERROR("attempt to read bookmarks from %@ failed; perhaps contents are corrupted", path);
- }
- // else file doesn't exist, which is normal the first time
- return NO;
- }
-
- // If the bookmark group has a tag, it's in the root-level dictionary.
- NSString *tagFromFile = [dictionary objectForKey:TagKey];
- // we don't trust data read from disk, so double-check
- if ([tagFromFile isKindOfClass:[NSString class]]) {
- _tag = [tagFromFile retain];
- }
-
- [self _bookmarksWillBeReloaded];
-
- _loading = YES;
- newTopBookmark = [[WebBookmarkList alloc] initFromDictionaryRepresentation:dictionary withGroup:self];
- [self _setTopBookmark:newTopBookmark];
- [newTopBookmark release];
- _loading = NO;
-
- [self _bookmarksWereReloaded];
-
- return YES;
-}
-
-- (BOOL)loadBookmarkGroup
-{
- double start, duration;
- BOOL result;
-
- start = CFAbsoluteTimeGetCurrent();
- result = [self _loadBookmarkGroupGuts];
-
- if (result) {
- duration = CFAbsoluteTimeGetCurrent() - start;
- LOG(Timing, "loading %d bookmarks from %@ took %f seconds",
- [[self topBookmark] _numberOfDescendants], [self file], duration);
- }
-
- return result;
-}
-
-- (BOOL)_saveBookmarkGroupGuts
-{
- NSString *path;
- NSDictionary *dictionary;
-
- path = [self file];
- if (path == nil) {
- ERROR("couldn't save bookmarks; couldn't find or create directory to store it in");
- return NO;
- }
-
- dictionary = [[self topBookmark] dictionaryRepresentation];
- if (![dictionary writeToFile:path atomically:YES]) {
- ERROR("attempt to save bookmarks to %@ failed", path);
- return NO;
- }
-
- return YES;
-}
-
-- (BOOL)saveBookmarkGroup
-{
- double start, duration;
- BOOL result;
-
- start = CFAbsoluteTimeGetCurrent();
- result = [self _saveBookmarkGroupGuts];
-
- if (result) {
- duration = CFAbsoluteTimeGetCurrent() - start;
- LOG(Timing, "saving %d bookmarks to %@ took %f seconds",
- [[self topBookmark] _numberOfDescendants], [self file], duration);
- }
-
- return result;
-}
-
- at end
diff --git a/WebKit/Bookmarks.subproj/WebBookmarkGroupPrivate.h b/WebKit/Bookmarks.subproj/WebBookmarkGroupPrivate.h
deleted file mode 100644
index 157f361..0000000
--- a/WebKit/Bookmarks.subproj/WebBookmarkGroupPrivate.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * WebBookmarkGroupPrivate.h
- * WebKit
- *
- * Created by John Sullivan on Thu May 2 2002.
- * Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
- *
- */
-
-#import <WebKit/WebBookmarkGroup.h>
-
- at interface WebBookmarkGroup(WebPrivate)
-
-- (void)_bookmarkWillChange:(WebBookmark *)bookmark;
-- (void)_bookmarkDidChange:(WebBookmark *)bookmark;
-- (void)_bookmarkChildren:(NSArray *)kids wereAddedToParent:(WebBookmark *)bookmark;
-- (void)_bookmarkChildren:(NSArray *)kids wereRemovedFromParent:(WebBookmark *)bookmark;
-
-- (void)_addBookmark:(WebBookmark *)bookmark;
-- (void)_removeBookmark:(WebBookmark *)bookmark;
-- (void)_bookmark:(WebBookmark *)bookmark changedUUIDFrom:(NSString *)oldUUID to:(NSString *)newUUID;
-
- at end
-
diff --git a/WebKit/Bookmarks.subproj/WebBookmarkImporter.h b/WebKit/Bookmarks.subproj/WebBookmarkImporter.h
deleted file mode 100644
index c236889..0000000
--- a/WebKit/Bookmarks.subproj/WebBookmarkImporter.h
+++ /dev/null
@@ -1,36 +0,0 @@
-//
-// WebBookmarkImporter.h
-// WebKit
-//
-// Created by Ken Kocienda on Sun Nov 17 2002.
-// Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
-//
-
-#import <Cocoa/Cocoa.h>
-
- at class WebError;
- at class WebBookmark;
-
-#define InternetExplorerBookmarksPath \
- ([NSString stringWithFormat:@"%@/%@", NSHomeDirectory(), @"Library/Preferences/Explorer/Favorites.html"])
-
-#define NetscapeAndMozillaDefaultProfilePath \
- ([NSString stringWithFormat:@"%@/%@", NSHomeDirectory(), @"Library/Mozilla/Profiles/default"])
-
-#define NetscapeAndMozillaRandomDirExt \
- (@".slt")
-
-#define NetscapeAndMozillaBookmarkFileName \
- (@"bookmarks.html")
-
- at interface WebBookmarkImporter : NSObject
-{
- WebBookmark *topBookmark;
- WebError *error;
-}
-
--(id)initWithPath:(NSString *)path;
--(WebBookmark *)topBookmark;
--(WebError *)error;
-
- at end
diff --git a/WebKit/Bookmarks.subproj/WebBookmarkImporter.m b/WebKit/Bookmarks.subproj/WebBookmarkImporter.m
deleted file mode 100644
index f0cf3ec..0000000
--- a/WebKit/Bookmarks.subproj/WebBookmarkImporter.m
+++ /dev/null
@@ -1,277 +0,0 @@
-//
-// WebBookmarkImporter.m
-// WebKit
-//
-// Created by Ken Kocienda on Sun Nov 17 2002.
-// Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
-//
-
-#import "WebBookmarkImporter.h"
-
-#import <WebFoundation/WebAssertions.h>
-#import <WebFoundation/WebError.h>
-#import <WebFoundation/WebLocalizableStrings.h>
-#import <WebFoundation/WebNSStringExtras.h>
-
-#import <WebKit/WebBookmark.h>
-#import <WebKit/WebBookmarkPrivate.h>
-#import <WebKit/WebKitErrors.h>
-
-static NSMutableArray *_breakStringIntoLines(NSString *string)
-{
- NSMutableArray *lines = [NSMutableArray array];
-
- unsigned length = [string length];
- unsigned index = 0;
- unsigned lineStart = 0;
- unsigned lineEnd = 0;
- BOOL blankLine = YES;
-
- while (index < length) {
- BOOL crlf = NO;
- unichar c = [string characterAtIndex:index];
- switch (c) {
- case '\r':
- if (index < length - 1) {
- if ([string characterAtIndex:index + 1] == '\n') {
- index++;
- crlf = YES;
- }
- }
- // fall through
- case '\n':
- case 0x2028: // unicode line break character
- case 0x2029: // ditto
- if (!blankLine) {
- NSString *line = [[string substringWithRange:NSMakeRange(lineStart, lineEnd - lineStart + 1)]
- _web_stringByTrimmingWhitespace];
-
- // Simple hack to make parsing work better: Break lines before any <DT> or </DL>.
- while (1) {
- unsigned lineBreakLocation = 0;
-
- // Break before the first <DT> or </DL>.
- NSRange rangeOfDT = [line rangeOfString:@"<DT>" options:(NSCaseInsensitiveSearch | NSLiteralSearch)];
- if (rangeOfDT.location != NSNotFound) {
- lineBreakLocation = rangeOfDT.location;
- }
- NSRange rangeOfDL = [line rangeOfString:@"</DL>" options:(NSCaseInsensitiveSearch | NSLiteralSearch)];
- if (rangeOfDL.location != NSNotFound && rangeOfDL.location < lineBreakLocation) {
- lineBreakLocation = rangeOfDL.location;
- }
-
- if (lineBreakLocation == 0) {
- break;
- }
-
- // Turn the part before the break into a line.
- [lines addObject:[[line substringToIndex:lineBreakLocation] _web_stringByTrimmingWhitespace]];
-
- // Keep going with the part after the break.
- line = [[line substringFromIndex:lineBreakLocation] _web_stringByTrimmingWhitespace];
- }
-
- [lines addObject:line];
- blankLine = YES;
- }
- lineStart = index + 1;
- if (crlf) {
- lineStart++;
- }
- break;
- default:
- blankLine = NO;
- lineEnd = index;
- break;
- }
-
- index++;
- }
-
- return lines;
-}
-
-static NSString *_HREFTextFromSpec(NSString *spec)
-{
- NSRange startRange = [spec rangeOfString:@"HREF=\"" options:(NSCaseInsensitiveSearch | NSLiteralSearch)];
- if (startRange.location == NSNotFound) {
- return nil;
- }
-
- NSRange remainder;
- remainder.location = startRange.location + startRange.length;
- remainder.length = [spec length] - remainder.location;
-
- NSRange endRange = [spec rangeOfString:@"\"" options:NSLiteralSearch range:remainder];
- if (endRange.location == NSNotFound) {
- return nil;
- }
-
- return [spec substringWithRange:NSMakeRange(remainder.location, endRange.location - remainder.location)];
-}
-
-static NSRange _linkTextRangeFromSpec(NSString *spec)
-{
- NSRange result;
- unsigned startIndex;
- unsigned endIndex;
- int closeBrackets;
- int openBrackets;
- int length;
- int i;
- unichar c;
-
- result.location = NSNotFound;
- result.length = -1;
- length = [spec length];
- startIndex = 0;
- endIndex = 0;
-
- closeBrackets = 0;
- for (i = 0; i < length; i++) {
- c = [spec characterAtIndex:i];
- if (c == '>') {
- closeBrackets++;
- }
- else if (closeBrackets == 2 && startIndex == 0) {
- startIndex = i;
- break;
- }
- }
-
- openBrackets = 0;
- for (i = length - 1; i > 0; i--) {
- c = [spec characterAtIndex:i];
- if (c == '<') {
- openBrackets = 1;
- }
- else if (openBrackets == 1) {
- endIndex = i + 1;
- break;
- }
- }
-
- if (startIndex > 0 && endIndex > startIndex) {
- result.location = startIndex;
- result.length = endIndex - startIndex;
- }
-
- return result;
-}
-
-static NSString *_linkTextFromSpec(NSString *spec)
-{
- NSString *result = nil;
-
- NSRange range = _linkTextRangeFromSpec(spec);
-
- if (range.location != NSNotFound) {
- result = [spec substringWithRange:range];
- }
-
- return result;
-}
-
-
- at implementation WebBookmarkImporter
-
-- (id)initWithPath:(NSString *)path
-{
- self = [super init];
- if (!self) {
- return nil;
- }
-
- NSData *data = [[NSData alloc] initWithContentsOfFile:path];
- if (!data) {
- error = [[WebError alloc] initWithErrorCode:WebKitErrorCannotOpenFile inDomain:WebErrorDomainWebKit failingURL:path];
- return self;
- }
-
- NSString *string = [[NSString alloc] initWithData:data encoding:NSISOLatin1StringEncoding];
- NSArray *lines = _breakStringIntoLines(string);
- int lineCount = [lines count];
- int i;
-
- WebBookmark *bookmark;
- WebBookmark *currentBookmarkList;
- NSMutableArray *bookmarkLists = [NSMutableArray array];
- unsigned numberOfChildren;
-
- // create the top-level folder
- topBookmark = [[WebBookmark bookmarkOfType:WebBookmarkTypeList] retain];
- [bookmarkLists addObject:topBookmark];
-
- for (i = 0; i < lineCount; i++) {
- NSString *line = [lines objectAtIndex:i];
-
- if ([line _web_hasCaseInsensitivePrefix:@"<DT><H"]) {
- // a bookmark folder specifier
- bookmark = [WebBookmark bookmarkOfType:WebBookmarkTypeList];
- currentBookmarkList = [bookmarkLists lastObject];
- // find the folder name
- NSString *title = _linkTextFromSpec(line);
- if (!title) {
- // Rather than skipping the folder altogether, make one so we don't get unbalanced with </DL>.
- title = @"?";
- }
- [bookmark setTitle:title];
- numberOfChildren = [currentBookmarkList numberOfChildren];
- [currentBookmarkList insertChild:bookmark atIndex:numberOfChildren];
- [bookmarkLists addObject:bookmark];
- }
- else if ([line _web_hasCaseInsensitivePrefix:@"<DT><A"]) {
- // a bookmark or folder specifier
- bookmark = [WebBookmark bookmarkOfType:WebBookmarkTypeLeaf];
- currentBookmarkList = [bookmarkLists lastObject];
- // find the folder name
- NSString *title = _linkTextFromSpec(line);
- if (!title) {
- continue;
- }
- if ([title isEqualToString:@"-"]) {
- // skip dividers
- continue;
- }
- [bookmark setTitle:title];
- NSString *href = _HREFTextFromSpec(line);
- if (!href) {
- continue;
- }
- [bookmark setURLString:href];
- numberOfChildren = [currentBookmarkList numberOfChildren];
- [currentBookmarkList insertChild:bookmark atIndex:numberOfChildren];
- }
- else if ([line _web_hasCaseInsensitivePrefix:@"</DL>"]) {
- // ends a bookmark list
- if ([bookmarkLists count] == 0) {
- ERROR("unbalanced </DL>, doesn't match the number of <DT><H we saw");
- } else {
- [bookmarkLists removeLastObject];
- }
- }
- }
-
- return self;
-}
-
--(WebBookmark *)topBookmark
-{
- return topBookmark;
-}
-
--(WebError *)error
-{
- return error;
-}
-
--(void)dealloc
-{
- [topBookmark release];
- [error release];
-
- [super dealloc];
-}
-
- at end
-
diff --git a/WebKit/Bookmarks.subproj/WebBookmarkLeaf.h b/WebKit/Bookmarks.subproj/WebBookmarkLeaf.h
deleted file mode 100644
index 3d4233e..0000000
--- a/WebKit/Bookmarks.subproj/WebBookmarkLeaf.h
+++ /dev/null
@@ -1,22 +0,0 @@
-//
-// WebBookmarkLeaf.h
-// WebKit
-//
-// Created by John Sullivan on Tue Apr 30 2002.
-// Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
-//
-
-#import <WebKit/WebBookmark.h>
-
- at class WebHistoryItem;
-
- at interface WebBookmarkLeaf : WebBookmark {
- WebHistoryItem *_entry;
- NSString *_URLString;
-}
-
-- (id)initWithURLString:(NSString *)URLString
- title:(NSString *)title
- group:(WebBookmarkGroup *)group;
-
- at end
diff --git a/WebKit/Bookmarks.subproj/WebBookmarkLeaf.m b/WebKit/Bookmarks.subproj/WebBookmarkLeaf.m
deleted file mode 100644
index efdd2ab..0000000
--- a/WebKit/Bookmarks.subproj/WebBookmarkLeaf.m
+++ /dev/null
@@ -1,166 +0,0 @@
-//
-// WebBookmarkLeaf.m
-// WebKit
-//
-// Created by John Sullivan on Tue Apr 30 2002.
-// Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
-//
-
-#import <WebKit/WebBookmarkLeaf.h>
-#import <WebKit/WebBookmarkPrivate.h>
-#import <WebKit/WebBookmarkGroup.h>
-#import <WebKit/WebBookmarkGroupPrivate.h>
-#import <WebKit/WebHistoryItem.h>
-#import <WebKit/WebHistoryItemPrivate.h>
-#import <WebFoundation/WebAssertions.h>
-
-#import <WebFoundation/WebNSURLExtras.h>
-
-#define URIDictionaryKey @"URIDictionary"
-#define URLStringKey @"URLString"
-
-// FIXME. This class really shouldn't be using a WebHistoryItem to hold
-// it's URL, title and icon. WebHistoryItem has significantly evolved from
-// it original implementation and is no longer appropriate.
- at implementation WebBookmarkLeaf
-
-- (id)init
-{
- return [self initWithURLString:nil title:nil group:nil];
-}
-
-- (id)initWithURLString:(NSString *)URLString
- title:(NSString *)title
- group:(WebBookmarkGroup *)group;
-{
- [super init];
-
- // Since our URLString may not be valid for creating an NSURL object,
- // just hang onto the string separately and don't bother creating
- // an NSURL object for the WebHistoryItem.
- _entry = [[WebHistoryItem alloc] init];
- [_entry setTitle:title]; // to avoid sending notifications, don't call setTitle or setURL
- _URLString = [URLString copy];
- [_entry setURL:[NSURL _web_URLWithString:_URLString]];
- [group _addBookmark:self];
-
- return self;
-}
-
-- (id)initFromDictionaryRepresentation:(NSDictionary *)dict withGroup:(WebBookmarkGroup *)group
-{
- ASSERT_ARG(dict, dict != nil);
-
- self = [super initFromDictionaryRepresentation:dict withGroup:group];
-
- if (![[dict objectForKey:URIDictionaryKey] isKindOfClass:[NSDictionary class]]
- || ![[dict objectForKey:URLStringKey] isKindOfClass:[NSString class]]) {
- ERROR("bad dictionary");
- [self release];
- return nil;
- }
-
- // _entry was already created in initWithURLString:title:group, called from super.
- // Releasing it here and creating a new one is inelegant, and we should probably
- // improve this someday (but timing tests show no noticeable slowdown).
- [_entry release];
- _entry = [[WebHistoryItem alloc] initFromDictionaryRepresentation:
- [dict objectForKey:URIDictionaryKey]];
- _URLString = [[dict objectForKey:URLStringKey] copy];
-
- return self;
-}
-
-- (NSDictionary *)dictionaryRepresentation
-{
- NSMutableDictionary *dict = (NSMutableDictionary *)[super dictionaryRepresentation];
-
- [dict setObject:WebBookmarkTypeLeafValue forKey:WebBookmarkTypeKey];
- [dict setObject:[_entry dictionaryRepresentation] forKey:URIDictionaryKey];
- if (_URLString != nil) {
- [dict setObject:_URLString forKey:URLStringKey];
- }
-
- return dict;
-}
-
-- (void)dealloc
-{
- [_entry release];
- [_URLString release];
- [super dealloc];
-}
-
-- (id)copyWithZone:(NSZone *)zone
-{
- WebBookmarkLeaf *copy = [super copyWithZone:zone];
-
- copy->_entry = [[WebHistoryItem alloc] init];
- [copy->_entry setTitle:[self title]];
- copy->_URLString = [[self URLString] copy];
- [copy->_entry setURL:[NSURL _web_URLWithString:_URLString]];
-
- return copy;
-}
-
-- (NSString *)title
-{
- return [_entry title];
-}
-
-- (void)setTitle:(NSString *)title
-{
- if ([title isEqualToString:[self title]]) {
- return;
- }
-
- ASSERT(_entry != nil);
-
- [[self group] _bookmarkWillChange:self];
-
- [_entry setTitle:title];
-
- [[self group] _bookmarkDidChange:self];
-}
-
-- (NSImage *)icon
-{
- return [_entry icon];
-}
-
-- (WebBookmarkType)bookmarkType
-{
- return WebBookmarkTypeLeaf;
-}
-
-- (NSString *)URLString
-{
- return _URLString;
-}
-
-- (void)setURLString:(NSString *)URLString
-{
- if (URLString == nil) {
- URLString = @"";
- }
-
- if ([URLString isEqualToString:_URLString]) {
- return;
- }
-
- [[self group] _bookmarkWillChange:self];
-
- [_URLString release];
- _URLString = [URLString copy];
-
- [_entry setURL:[NSURL _web_URLWithString:_URLString]];
-
- [[self group] _bookmarkDidChange:self];
-}
-
-- (NSString *)description
-{
- return [NSString stringWithFormat:@"%@: %@", [super description], _URLString];
-}
-
- at end
diff --git a/WebKit/Bookmarks.subproj/WebBookmarkList.h b/WebKit/Bookmarks.subproj/WebBookmarkList.h
deleted file mode 100644
index 77f09cb..0000000
--- a/WebKit/Bookmarks.subproj/WebBookmarkList.h
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// WebBookmarkList.h
-// WebKit
-//
-// Created by John Sullivan on Tue Apr 30 2002.
-// Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
-//
-
-#import <WebKit/WebBookmark.h>
-
- at interface WebBookmarkList : WebBookmark {
- NSString *_title;
- NSMutableArray *_list;
-}
-
-- (id)initWithTitle:(NSString *)title group:(WebBookmarkGroup *)group;
-
- at end
diff --git a/WebKit/Bookmarks.subproj/WebBookmarkList.m b/WebKit/Bookmarks.subproj/WebBookmarkList.m
deleted file mode 100644
index fc08bd1..0000000
--- a/WebKit/Bookmarks.subproj/WebBookmarkList.m
+++ /dev/null
@@ -1,214 +0,0 @@
-//
-// WebBookmarkList.m
-// WebKit
-//
-// Created by John Sullivan on Tue Apr 30 2002.
-// Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
-//
-
-#import <WebKit/WebBookmarkList.h>
-#import <WebKit/WebBookmarkLeaf.h>
-#import <WebKit/WebBookmarkPrivate.h>
-#import <WebKit/WebBookmarkGroupPrivate.h>
-#import <WebFoundation/WebAssertions.h>
-
-#define TitleKey @"Title"
-#define ChildrenKey @"Children"
-
- at implementation WebBookmarkList
-
-- (id)init
-{
- return [self initWithTitle:nil group:nil];
-}
-
-- (id)initWithTitle:(NSString *)title
- group:(WebBookmarkGroup *)group
-{
- [super init];
-
- _list = [[NSMutableArray alloc] init];
- _title = [title copy];
- [group _addBookmark:self];
-
- return self;
-}
-
-- (id)initFromDictionaryRepresentation:(NSDictionary *)dict withGroup:(WebBookmarkGroup *)group
-{
- ASSERT_ARG(dict, dict != nil);
-
- self = [super initFromDictionaryRepresentation:dict withGroup:group];
-
- if (![[dict objectForKey:WebBookmarkTypeKey] isKindOfClass:[NSString class]]
- || ([dict objectForKey:TitleKey] && ![[dict objectForKey:TitleKey] isKindOfClass:[NSString class]])
- || ([dict objectForKey:ChildrenKey] && ![[dict objectForKey:ChildrenKey] isKindOfClass:[NSArray class]])) {
- ERROR("bad dictionary");
- [self release];
- return nil;
- }
-
- if (![[dict objectForKey:WebBookmarkTypeKey] isEqualToString:WebBookmarkTypeListValue]) {
- ERROR("Can't initialize Bookmark list from non-list type");
- [self release];
- return nil;
- }
-
- _title = [[dict objectForKey:TitleKey] copy];
-
- NSArray *storedChildren = [dict objectForKey:ChildrenKey];
- unsigned count = [storedChildren count];
- unsigned indexRead;
- unsigned indexWritten = 0;
- for (indexRead = 0; indexRead < count; ++indexRead) {
- WebBookmark *child = [WebBookmark bookmarkFromDictionaryRepresentation:[storedChildren objectAtIndex:indexRead]
- withGroup:group];
- if (child != nil) {
- [self insertChild:child atIndex:indexWritten++];
- }
- }
-
- return self;
-}
-
-- (NSDictionary *)dictionaryRepresentation
-{
- NSMutableDictionary *dict = (NSMutableDictionary *)[super dictionaryRepresentation];
-
- if (_title != nil) {
- [dict setObject:_title forKey:TitleKey];
- }
-
- [dict setObject:WebBookmarkTypeListValue forKey:WebBookmarkTypeKey];
-
- unsigned childCount = [self numberOfChildren];
- if (childCount > 0) {
- NSMutableArray *childrenAsDictionaries = [NSMutableArray arrayWithCapacity:childCount];
-
- unsigned index;
- for (index = 0; index < childCount; ++index) {
- WebBookmark *child;
-
- child = [_list objectAtIndex:index];
- [childrenAsDictionaries addObject:[child dictionaryRepresentation]];
- }
-
- [dict setObject:childrenAsDictionaries forKey:ChildrenKey];
- }
-
- return dict;
-}
-
-- (void)dealloc
-{
- [_title release];
- [_list release];
- [super dealloc];
-}
-
-- (id)copyWithZone:(NSZone *)zone
-{
- WebBookmarkList *copy = [super copyWithZone:zone];
- copy->_title = [_title copy];
- copy->_list = [[NSMutableArray alloc] init];
-
- unsigned index;
- unsigned count = [self numberOfChildren];
- for (index = 0; index < count; ++index) {
- WebBookmark *childCopy = [[_list objectAtIndex:index] copyWithZone:zone];
- [copy insertChild:childCopy atIndex:index];
- [childCopy release];
- }
-
- return copy;
-}
-
-- (NSString *)title
-{
- return _title;
-}
-
-- (void)setTitle:(NSString *)title
-{
- if ([title isEqualToString:_title]) {
- return;
- }
-
- [[self group] _bookmarkWillChange:self];
-
- [_title release];
- _title = [title copy];
-
- [[self group] _bookmarkDidChange:self];
-}
-
-- (NSImage *)icon
-{
- return nil;
-}
-
-- (WebBookmarkType)bookmarkType
-{
- return WebBookmarkTypeList;
-}
-
-- (NSArray *)children
-{
- return [NSArray arrayWithArray:_list];
-}
-
-- (NSArray *)rawChildren
-{
- return _list;
-}
-
-- (unsigned)numberOfChildren
-{
- return [_list count];
-}
-
-- (unsigned)_numberOfDescendants
-{
- unsigned result;
- unsigned index, count;
- WebBookmark *child;
-
- count = [self numberOfChildren];
- result = count;
-
- for (index = 0; index < count; ++index) {
- child = [_list objectAtIndex:index];
- result += [child _numberOfDescendants];
- }
-
- return result;
-}
-
-- (void)removeChild:(WebBookmark *)bookmark
-{
- ASSERT_ARG(bookmark, [bookmark parent] == self);
- ASSERT_ARG(bookmark, [_list indexOfObjectIdenticalTo:bookmark] != NSNotFound);
-
- [bookmark retain];
- [_list removeObjectIdenticalTo:bookmark];
- [bookmark _setParent:nil];
- [[bookmark group] _removeBookmark:bookmark];
- [bookmark release];
-
- [[self group] _bookmarkChildren:[NSArray arrayWithObject:bookmark] wereRemovedFromParent:self];
-}
-
-
-- (void)insertChild:(WebBookmark *)bookmark atIndex:(unsigned)index
-{
- ASSERT_ARG(bookmark, [bookmark parent] == nil);
- ASSERT_ARG(bookmark, [_list indexOfObjectIdenticalTo:bookmark] == NSNotFound);
-
- [_list insertObject:bookmark atIndex:index];
- [bookmark _setParent:self];
- [[self group] _addBookmark:bookmark];
-
- [[self group] _bookmarkChildren:[NSArray arrayWithObject:bookmark] wereAddedToParent:self];
-}
-
- at end
diff --git a/WebKit/Bookmarks.subproj/WebBookmarkPrivate.h b/WebKit/Bookmarks.subproj/WebBookmarkPrivate.h
deleted file mode 100644
index d6a9b75..0000000
--- a/WebKit/Bookmarks.subproj/WebBookmarkPrivate.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * WebBookmarkPrivate.h
- * WebKit
- *
- * Created by John Sullivan on Tue Apr 30 2002.
- * Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
- *
- */
-
-#import <WebKit/WebBookmark.h>
-
-#define WebBookmarkTypeKey @"WebBookmarkType"
-#define WebBookmarkTypeLeafValue @"WebBookmarkTypeLeaf"
-#define WebBookmarkTypeListValue @"WebBookmarkTypeList"
-#define WebBookmarkTypeProxyValue @"WebBookmarkTypeProxy"
-
-#define WebBookmarkIdentifierKey @"WebBookmarkIdentifier"
-#define WebBookmarkUUIDKey @"WebBookmarkUUID"
-
- at interface WebBookmark(WebPrivate)
-
-- (void)_setParent:(WebBookmark *)parent;
-- (void)_setGroup:(WebBookmarkGroup *)group;
-
-// Returns YES if UUID is non-nil; can't simply use -[WebBookmark UUID] because
-// it will generate a UUID if there isn't one already.
-- (BOOL)_hasUUID;
-
-
-- (unsigned)_numberOfDescendants;
-
- at end
-
diff --git a/WebKit/Bookmarks.subproj/WebBookmarkProxy.h b/WebKit/Bookmarks.subproj/WebBookmarkProxy.h
deleted file mode 100644
index 341c9dd..0000000
--- a/WebKit/Bookmarks.subproj/WebBookmarkProxy.h
+++ /dev/null
@@ -1,18 +0,0 @@
-//
-// WebBookmarkProxy.h
-// WebKit
-//
-// Created by John Sullivan on Fri Oct 11 2002.
-// Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
-//
-
-#import <WebKit/WebBookmark.h>
-
-
- at interface WebBookmarkProxy : WebBookmark {
- NSString *_title;
-}
-
-- (id)initWithTitle:(NSString *)title group:(WebBookmarkGroup *)group;
-
- at end
diff --git a/WebKit/Bookmarks.subproj/WebBookmarkProxy.m b/WebKit/Bookmarks.subproj/WebBookmarkProxy.m
deleted file mode 100644
index 5670e26..0000000
--- a/WebKit/Bookmarks.subproj/WebBookmarkProxy.m
+++ /dev/null
@@ -1,106 +0,0 @@
-//
-// WebBookmarkProxy.m
-// WebKit
-//
-// Created by John Sullivan on Fri Oct 11 2002.
-// Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
-//
-
-#import "WebBookmarkProxy.h"
-
-#import "WebBookmarkPrivate.h"
-#import "WebBookmarkGroupPrivate.h"
-#import <WebFoundation/WebAssertions.h>
-
-#define TitleKey @"Title"
-
- at implementation WebBookmarkProxy
-
-- (id)init
-{
- return [self initWithTitle:nil group:nil];
-}
-
-- (id)initWithTitle:(NSString *)title group:(WebBookmarkGroup *)group;
-{
- [super init];
- [group _addBookmark:self];
- _title = [title copy]; // to avoid sending notifications, don't call setTitle
-
- return self;
-}
-
-- (id)initFromDictionaryRepresentation:(NSDictionary *)dict withGroup:(WebBookmarkGroup *)group
-{
- self = [super initFromDictionaryRepresentation:dict withGroup:group];
-
- if (![[dict objectForKey:WebBookmarkTypeKey] isKindOfClass:[NSString class]]) {
- ERROR("bad dictionary");
- [self release];
- return nil;
- }
- if (![[dict objectForKey:WebBookmarkTypeKey] isEqualToString:WebBookmarkTypeProxyValue]) {
- ERROR("Can't initialize Bookmark proxy from non-proxy type");
- [self release];
- return nil;
- }
-
- _title = [[dict objectForKey:TitleKey] copy];
-
- return self;
-}
-
-- (void)dealloc
-{
- [_title release];
- [super dealloc];
-}
-
-- (NSDictionary *)dictionaryRepresentation
-{
- NSMutableDictionary *dict = (NSMutableDictionary *)[super dictionaryRepresentation];
- [dict setObject:WebBookmarkTypeProxyValue forKey:WebBookmarkTypeKey];
- if (_title != nil) {
- [dict setObject:_title forKey:TitleKey];
- }
-
- return dict;
-}
-
-- (WebBookmarkType)bookmarkType
-{
- return WebBookmarkTypeProxy;
-}
-
-- (id)copyWithZone:(NSZone *)zone
-{
- WebBookmarkProxy *copy = [super copyWithZone:zone];
- copy->_title = [_title copy];
- return copy;
-}
-
-- (NSString *)title
-{
- return _title;
-}
-
-- (void)setTitle:(NSString *)newTitle
-{
- if (_title == newTitle) {
- return;
- }
-
- [[self group] _bookmarkWillChange:self];
-
- [_title release];
- _title = [newTitle copy];
-
- [[self group] _bookmarkDidChange:self];
-}
-
-- (NSImage *)icon
-{
- return nil;
-}
-
- at end
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index a31e2e9..91139ed 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,29 @@
+2003-03-13 John Sullivan <sullivan at apple.com>
+
+ Removed all the bookmarks code from WebKit; put it
+ in WebBrowser instead.
+
+ Reviewed by Darin
+
+ * Bookmarks.subproj/WebBookmark.h: Removed.
+ * Bookmarks.subproj/WebBookmark.m: Removed.
+ * Bookmarks.subproj/WebBookmarkGroup.h: Removed.
+ * Bookmarks.subproj/WebBookmarkGroup.m: Removed.
+ * Bookmarks.subproj/WebBookmarkGroupPrivate.h: Removed.
+ * Bookmarks.subproj/WebBookmarkImporter.h: Removed.
+ * Bookmarks.subproj/WebBookmarkImporter.m: Removed.
+ * Bookmarks.subproj/WebBookmarkLeaf.h: Removed.
+ * Bookmarks.subproj/WebBookmarkLeaf.m: Removed.
+ * Bookmarks.subproj/WebBookmarkList.h: Removed.
+ * Bookmarks.subproj/WebBookmarkList.m: Removed.
+ * Bookmarks.subproj/WebBookmarkPrivate.h: Removed.
+ * Bookmarks.subproj/WebBookmarkProxy.h: Removed.
+ * Bookmarks.subproj/WebBookmarkProxy.m: Removed.
+ * WebKit.exp:
+ removed all bookmark-related symbols
+ * WebKit.pbproj/project.pbxproj:
+ updated for removed files
+
=== Safari-67 ===
2003-03-12 Chris Blumenberg <cblu at apple.com>
diff --git a/WebKit/WebKit.exp b/WebKit/WebKit.exp
index 820f9d6..d856de3 100644
--- a/WebKit/WebKit.exp
+++ b/WebKit/WebKit.exp
@@ -1,7 +1,4 @@
.objc_class_name_WebBackForwardList
-.objc_class_name_WebBookmark
-.objc_class_name_WebBookmarkGroup
-.objc_class_name_WebBookmarkImporter
.objc_class_name_WebContentTypes
.objc_class_name_WebController
.objc_class_name_WebCoreStatistics
@@ -36,13 +33,6 @@ _WebActionModifierFlagsKey
_WebActionNavigationTypeKey
_WebActionNavigationTypeKey
_WebActionOriginalURLKey
-_WebBookmarkChildrenKey
-_WebBookmarkDidChangeNotification
-_WebBookmarkWillChangeNotification
-_WebBookmarksWereAddedNotification
-_WebBookmarksWereRemovedNotification
-_WebBookmarksWereReloadedNotification
-_WebBookmarksWillBeReloadedNotification
_WebElementFrameKey
_WebElementImageKey
_WebElementImageRectKey
@@ -62,7 +52,6 @@ _WebIconLargeSize
_WebIconMediumSize
_WebIconNotificationUserInfoURLKey
_WebIconSmallSize
-_WebModifiedBookmarkKey
_WebURLNamePboardType
_WebURLPboardType
diff --git a/WebKit/WebKit.pbproj/project.pbxproj b/WebKit/WebKit.pbproj/project.pbxproj
index a9232ca..01b6a6e 100644
--- a/WebKit/WebKit.pbproj/project.pbxproj
+++ b/WebKit/WebKit.pbproj/project.pbxproj
@@ -86,7 +86,6 @@
};
0867D691FE84028FC02AAC07 = {
children = (
- F5065217027F555001C1A526,
F52CA6C002DF9D78018635CA,
F57D194A034E732C01A80180,
832E269E036F952E005E2B4F,
@@ -188,14 +187,6 @@
0867D69DFE84028FC02AAC07 = {
buildActionMask = 2147483647;
files = (
- F5065222027F557E01C1A526,
- F5065224027F557E01C1A526,
- F50AD3880282028B01C1A526,
- BED907780389380000CA289C,
- F5065226027F557E01C1A526,
- F5065228027F557E01C1A526,
- F5065221027F557E01C1A526,
- 657D8FAA03666B5200FA1ED0,
657D8FA6036669FC00FA1ED0,
657D8FA7036669FF00FA1ED0,
657D8FA803666A0200FA1ED0,
@@ -334,12 +325,6 @@
0867D69FFE84028FC02AAC07 = {
buildActionMask = 2147483647;
files = (
- F5065223027F557E01C1A526,
- F5065225027F557E01C1A526,
- BED907790389380000CA289C,
- F5065227027F557E01C1A526,
- F5065229027F557E01C1A526,
- EDD9134003576AFF00C1A526,
F57D1954034E734901A80180,
F57D1956034E734901A80180,
F57D195A034E734901A80180,
@@ -1580,12 +1565,6 @@
settings = {
};
};
- 657D8FAA03666B5200FA1ED0 = {
- fileRef = EDD9133D03576ADA00C1A526;
- isa = PBXBuildFile;
- settings = {
- };
- };
658CF8C003851FB5008C2A4B = {
fileEncoding = 30;
isa = PBXFileReference;
@@ -2624,43 +2603,6 @@
//9C2
//9C3
//9C4
-//BE0
-//BE1
-//BE2
-//BE3
-//BE4
- BED907760389380000CA289C = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = WebBookmarkImporter.h;
- refType = 4;
- };
- BED907770389380000CA289C = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = WebBookmarkImporter.m;
- refType = 4;
- };
- BED907780389380000CA289C = {
- fileRef = BED907760389380000CA289C;
- isa = PBXBuildFile;
- settings = {
- ATTRIBUTES = (
- Private,
- );
- };
- };
- BED907790389380000CA289C = {
- fileRef = BED907770389380000CA289C;
- isa = PBXBuildFile;
- settings = {
- };
- };
-//BE0
-//BE1
-//BE2
-//BE3
-//BE4
//ED0
//ED1
//ED2
@@ -2693,24 +2635,6 @@
settings = {
};
};
- EDD9133D03576ADA00C1A526 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = WebBookmarkProxy.h;
- refType = 4;
- };
- EDD9133F03576AFF00C1A526 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = WebBookmarkProxy.m;
- refType = 4;
- };
- EDD9134003576AFF00C1A526 = {
- fileRef = EDD9133F03576AFF00C1A526;
- isa = PBXBuildFile;
- settings = {
- };
- };
//ED0
//ED1
//ED2
@@ -2721,142 +2645,6 @@
//F52
//F53
//F54
- F5065217027F555001C1A526 = {
- children = (
- F5065219027F557E01C1A526,
- F5065218027F557E01C1A526,
- F506521A027F557E01C1A526,
- F506521B027F557E01C1A526,
- F50AD3870282028B01C1A526,
- F506521C027F557E01C1A526,
- BED907760389380000CA289C,
- BED907770389380000CA289C,
- F506521D027F557E01C1A526,
- F506521E027F557E01C1A526,
- F506521F027F557E01C1A526,
- F5065220027F557E01C1A526,
- EDD9133D03576ADA00C1A526,
- EDD9133F03576AFF00C1A526,
- );
- isa = PBXGroup;
- name = Bookmarks;
- path = Bookmarks.subproj;
- refType = 2;
- };
- F5065218027F557E01C1A526 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = WebBookmarkPrivate.h;
- refType = 4;
- };
- F5065219027F557E01C1A526 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = WebBookmark.h;
- refType = 4;
- };
- F506521A027F557E01C1A526 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = WebBookmark.m;
- refType = 4;
- };
- F506521B027F557E01C1A526 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = WebBookmarkGroup.h;
- refType = 4;
- };
- F506521C027F557E01C1A526 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = WebBookmarkGroup.m;
- refType = 4;
- };
- F506521D027F557E01C1A526 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = WebBookmarkLeaf.h;
- refType = 4;
- };
- F506521E027F557E01C1A526 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = WebBookmarkLeaf.m;
- refType = 4;
- };
- F506521F027F557E01C1A526 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = WebBookmarkList.h;
- refType = 4;
- };
- F5065220027F557E01C1A526 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = WebBookmarkList.m;
- refType = 4;
- };
- F5065221027F557E01C1A526 = {
- fileRef = F5065218027F557E01C1A526;
- isa = PBXBuildFile;
- settings = {
- };
- };
- F5065222027F557E01C1A526 = {
- fileRef = F5065219027F557E01C1A526;
- isa = PBXBuildFile;
- settings = {
- ATTRIBUTES = (
- Private,
- );
- };
- };
- F5065223027F557E01C1A526 = {
- fileRef = F506521A027F557E01C1A526;
- isa = PBXBuildFile;
- settings = {
- };
- };
- F5065224027F557E01C1A526 = {
- fileRef = F506521B027F557E01C1A526;
- isa = PBXBuildFile;
- settings = {
- ATTRIBUTES = (
- Private,
- );
- };
- };
- F5065225027F557E01C1A526 = {
- fileRef = F506521C027F557E01C1A526;
- isa = PBXBuildFile;
- settings = {
- };
- };
- F5065226027F557E01C1A526 = {
- fileRef = F506521D027F557E01C1A526;
- isa = PBXBuildFile;
- settings = {
- };
- };
- F5065227027F557E01C1A526 = {
- fileRef = F506521E027F557E01C1A526;
- isa = PBXBuildFile;
- settings = {
- };
- };
- F5065228027F557E01C1A526 = {
- fileRef = F506521F027F557E01C1A526;
- isa = PBXBuildFile;
- settings = {
- };
- };
- F5065229027F557E01C1A526 = {
- fileRef = F5065220027F557E01C1A526;
- isa = PBXBuildFile;
- settings = {
- };
- };
F508946902B71D59018A9CD4 = {
fileEncoding = 4;
isa = PBXFileReference;
@@ -2884,18 +2672,6 @@
settings = {
};
};
- F50AD3870282028B01C1A526 = {
- fileEncoding = 30;
- isa = PBXFileReference;
- path = WebBookmarkGroupPrivate.h;
- refType = 4;
- };
- F50AD3880282028B01C1A526 = {
- fileRef = F50AD3870282028B01C1A526;
- isa = PBXBuildFile;
- settings = {
- };
- };
F5143A370221DCCE01A80181 = {
fileEncoding = 4;
isa = PBXFileReference;
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list