[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
trey
trey at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 07:10:24 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit edb8fdb4247359d2653a8527bebd088a4e3b0906
Author: trey <trey at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Mon Dec 2 17:59:50 2002 +0000
WebKit:
Refined bookmark notifications to be more detailed. We now have added, removed,
willChange and didChange.
* Bookmarks.subproj/WebBookmarkGroup.h: New API.
* Bookmarks.subproj/WebBookmarkGroup.m:
(-[WebBookmarkGroup _sendNotification:forBookmark:children:]):
(-[WebBookmarkGroup _setTopBookmark:]):
(-[WebBookmarkGroup _bookmarkWillChange:]):
(-[WebBookmarkGroup _bookmarkDidChange:]):
(-[WebBookmarkGroup _bookmarkChildren:wereAddedToParent:]):
(-[WebBookmarkGroup _bookmarkChildren:wereRemovedToParent:]):
All just small pieces of flow control for posting the notes.
* Bookmarks.subproj/WebBookmarkGroupPrivate.h: Internal methods for posting the notes.
* Bookmarks.subproj/WebBookmarkLeaf.m:
(-[WebBookmarkLeaf setTitle:]): Post da note
(-[WebBookmarkLeaf setURLString:]): Post da note
(-[WebBookmarkLeaf description]): Added for debugging.
* Bookmarks.subproj/WebBookmarkList.m:
(-[WebBookmarkList setTitle:]): Post da note
(-[WebBookmarkList removeChild:]): Post da note
(-[WebBookmarkList insertChild:atIndex:]): Post da note
* Bookmarks.subproj/WebBookmarkProxy.m:
(-[WebBookmarkProxy setTitle:]): Post da note
* English.lproj/StringsNotToBeLocalized.txt: New strings.
* WebKit.exp: New strings.
WebBrowser:
The auto-complete DB properly tracks HistoryItems and Bookmarks coming and going.
We have only one DB entry for a given URL, with a ref count. HistoryItems replace
Bookmarks in the DB, so we have a well-defined place to keep stats like visitCount
or recent times accessed.
* BookmarksController.m:
(-[BookmarksController awakeFromNib]): Adopt new API for bookmark notifications.
* BookmarksViewController.m: Adopt new API for bookmark notifications.
* CompletionController.m:
(+[CompletionController _tree_create]): Set refCount of root node.
(_keyStringFromItem): Nuke redundant code.
(_keyStringFromNode): Deleted nodes must retain their key string to function
properly in the DB.
(_findPotentialNode): Test for deleted nodes using new bit.
(+[CompletionController _tree_addItem:]): New rules for handing a collision on
add. Bump ref count, replace Bookmarks with HistoryItems.
(+[CompletionController _tree_deleteItem:]): Obey refcounting.
(+[CompletionController _tree_nextItemUsingCursor:]): Test for deleted nodes using new bit.
(DumpAutoCompleteTree): Debugging nit.
(+[CompletionController _removeBookmarkTree:]): New utility routine.
(+[CompletionController _loadDB]): Debugging nits.
(-[CompletionController _executeQuery]): Bandaid fix for user typing "www.".
(+[CompletionController _registerForNotifications]): Register for bookmark notes.
(+[CompletionController _bookmarksAdded:]): Receive bookmark note.
(+[CompletionController _bookmarksRemoved:]): Receive bookmark note.
(+[CompletionController _bookmarkWillChange:]): Receive bookmark note.
(+[CompletionController _bookmarkDidChange:]): Receive bookmark note.
(-[CompletionController _positionWindow]): Small code rearranging.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2903 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit/Bookmarks.subproj/WebBookmarkGroup.h b/WebKit/Bookmarks.subproj/WebBookmarkGroup.h
index 4ca03a6..3f84e8c 100644
--- a/WebKit/Bookmarks.subproj/WebBookmarkGroup.h
+++ b/WebKit/Bookmarks.subproj/WebBookmarkGroup.h
@@ -9,17 +9,19 @@
#import <Cocoa/Cocoa.h>
#import <WebKit/WebBookmark.h>
-// notification sent when bookmarks are added/removed from group, or when bookmarks in group are modified
-#define WebBookmarkGroupChangedNotification @"WebBookmarkGroupChangedNotification"
-
-// keys for userInfo for WebBookmarkGroupChangedNotification. These are always present.
-
-// The lowest common ancestor of all the WebBookmark objects that changed.
-#define WebModifiedBookmarkKey @"WebModifiedBookmarkKey"
-
-// An NSNumber object representing a boolean that distinguishes changes
-// to the bookmark itself from changes to its children.
-#define WebBookmarkChildrenChangedKey @"WebBookmarkChildrenChangedKey"
+// 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;
+
+// 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;
@interface WebBookmarkGroup : NSObject
{
diff --git a/WebKit/Bookmarks.subproj/WebBookmarkGroup.m b/WebKit/Bookmarks.subproj/WebBookmarkGroup.m
index 2297bd5..c62c78a 100644
--- a/WebKit/Bookmarks.subproj/WebBookmarkGroup.m
+++ b/WebKit/Bookmarks.subproj/WebBookmarkGroup.m
@@ -14,6 +14,13 @@
#import <WebKit/WebBookmarkProxy.h>
#import <WebKit/WebKitLogging.h>
+NSString *WebBookmarksWereAddedNotification = @"WebBookmarksWereAddedNotification";
+NSString *WebBookmarksWereRemovedNotification = @"WebBookmarksWereRemovedNotification";
+NSString *WebBookmarkDidChangeNotification = @"WebBookmarkDidChangeNotification";
+NSString *WebBookmarkWillChangeNotification = @"WebBookmarkWillChangeNotification";
+NSString *WebModifiedBookmarkKey = @"WebModifiedBookmarkKey";
+NSString *WebBookmarkChildrenKey = @"WebBookmarkChildrenKey";
+
@interface WebBookmarkGroup (WebForwardDeclarations)
- (void)_setTopBookmark:(WebBookmark *)newTopBookmark;
@end
@@ -52,8 +59,7 @@
return _topBookmark;
}
-- (void)_sendChangeNotificationForBookmark:(WebBookmark *)bookmark
- childrenChanged:(BOOL)flag
+- (void)_sendNotification:(NSString *)name forBookmark:(WebBookmark *)bookmark children:(NSArray *)kids
{
NSDictionary *userInfo;
@@ -65,13 +71,10 @@
userInfo = [NSDictionary dictionaryWithObjectsAndKeys:
bookmark, WebModifiedBookmarkKey,
- [NSNumber numberWithBool:flag], WebBookmarkChildrenChangedKey,
+ kids, WebBookmarkChildrenKey, // kids==nil will conveniently terminate the arg list
nil];
- [[NSNotificationCenter defaultCenter]
- postNotificationName:WebBookmarkGroupChangedNotification
- object:self
- userInfo:userInfo];
+ [[NSNotificationCenter defaultCenter] postNotificationName:name object:self userInfo:userInfo];
}
- (void)_setTopBookmark:(WebBookmark *)newTopBookmark
@@ -89,20 +92,28 @@
} else {
_topBookmark = [[WebBookmarkList alloc] initWithTitle:nil group:self];
}
+}
- [self _sendChangeNotificationForBookmark:_topBookmark childrenChanged:YES];
+- (void)_bookmarkWillChange:(WebBookmark *)bookmark
+{
+ [self _sendNotification:WebBookmarkWillChangeNotification forBookmark:bookmark children:nil];
}
- (void)_bookmarkDidChange:(WebBookmark *)bookmark
{
- [self _sendChangeNotificationForBookmark:bookmark childrenChanged:NO];
+ [self _sendNotification:WebBookmarkDidChangeNotification forBookmark:bookmark children:nil];
}
-- (void)_bookmarkChildrenDidChange:(WebBookmark *)bookmark
+- (void)_bookmarkChildren:(NSArray *)kids wereAddedToParent:(WebBookmark *)bookmark
{
ASSERT_ARG(bookmark, [bookmark bookmarkType] == WebBookmarkTypeList);
-
- [self _sendChangeNotificationForBookmark:bookmark childrenChanged:YES];
+ [self _sendNotification:WebBookmarksWereAddedNotification forBookmark:bookmark children:kids];
+}
+
+- (void)_bookmarkChildren:(NSArray *)kids wereRemovedToParent:(WebBookmark *)bookmark
+{
+ ASSERT_ARG(bookmark, [bookmark bookmarkType] == WebBookmarkTypeList);
+ [self _sendNotification:WebBookmarksWereRemovedNotification forBookmark:bookmark children:kids];
}
- (WebBookmark *)addNewBookmarkToBookmark:(WebBookmark *)parent
diff --git a/WebKit/Bookmarks.subproj/WebBookmarkGroupPrivate.h b/WebKit/Bookmarks.subproj/WebBookmarkGroupPrivate.h
index 2812cd4..74dbf21 100644
--- a/WebKit/Bookmarks.subproj/WebBookmarkGroupPrivate.h
+++ b/WebKit/Bookmarks.subproj/WebBookmarkGroupPrivate.h
@@ -11,8 +11,10 @@
@interface WebBookmarkGroup(WebPrivate)
+- (void)_bookmarkWillChange:(WebBookmark *)bookmark;
- (void)_bookmarkDidChange:(WebBookmark *)bookmark;
-- (void)_bookmarkChildrenDidChange:(WebBookmark *)bookmark;
+- (void)_bookmarkChildren:(NSArray *)kids wereAddedToParent:(WebBookmark *)bookmark;
+- (void)_bookmarkChildren:(NSArray *)kids wereRemovedToParent:(WebBookmark *)bookmark;
@end
diff --git a/WebKit/Bookmarks.subproj/WebBookmarkLeaf.m b/WebKit/Bookmarks.subproj/WebBookmarkLeaf.m
index 4f72553..08d9d0f 100644
--- a/WebKit/Bookmarks.subproj/WebBookmarkLeaf.m
+++ b/WebKit/Bookmarks.subproj/WebBookmarkLeaf.m
@@ -36,8 +36,9 @@
// 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.
- [self setTitle:title];
- [self setURLString:URLString];
+ [_entry setTitle:title]; // to avoid sending notifications, don't call setTitle or setURL
+ _URLString = [URLString copy];
+ [_entry setURL:[NSURL _web_URLWithString:_URLString]];
[self _setGroup:group];
return self;
@@ -111,6 +112,9 @@
}
ASSERT(_entry != nil);
+
+ [[self group] _bookmarkWillChange:self];
+
[_entry setTitle:title];
[[self group] _bookmarkDidChange:self];
@@ -141,12 +145,19 @@
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];
+}
+
@end
diff --git a/WebKit/Bookmarks.subproj/WebBookmarkList.m b/WebKit/Bookmarks.subproj/WebBookmarkList.m
index b629330..c14bea6 100644
--- a/WebKit/Bookmarks.subproj/WebBookmarkList.m
+++ b/WebKit/Bookmarks.subproj/WebBookmarkList.m
@@ -149,6 +149,8 @@
return;
}
+ [[self group] _bookmarkWillChange:self];
+
[_title release];
_title = [title copy];
@@ -202,7 +204,7 @@
[bookmark _setParent:nil];
[bookmark release];
- [[self group] _bookmarkChildrenDidChange:self];
+ [[self group] _bookmarkChildren:[NSArray arrayWithObject:bookmark] wereRemovedToParent:self];
}
@@ -214,8 +216,8 @@
[_list insertObject:bookmark atIndex:index];
[bookmark _setParent:self];
[bookmark _setGroup:[self group]];
-
- [[self group] _bookmarkChildrenDidChange:self];
+
+ [[self group] _bookmarkChildren:[NSArray arrayWithObject:bookmark] wereAddedToParent:self];
}
- (void)_setGroup:(WebBookmarkGroup *)group
diff --git a/WebKit/Bookmarks.subproj/WebBookmarkProxy.m b/WebKit/Bookmarks.subproj/WebBookmarkProxy.m
index cfaeb0e..43e6ac4 100644
--- a/WebKit/Bookmarks.subproj/WebBookmarkProxy.m
+++ b/WebKit/Bookmarks.subproj/WebBookmarkProxy.m
@@ -20,7 +20,7 @@
{
[super init];
[self _setGroup:group];
- [self setTitle:title];
+ _title = [title copy]; // to avoid sending notifications, don't call setTitle
return self;
}
@@ -84,8 +84,11 @@
return;
}
+ [[self group] _bookmarkWillChange:self];
+
[_title release];
_title = [newTitle copy];
+
[[self group] _bookmarkDidChange:self];
}
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index aa30bb4..6b1d666 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,31 @@
+2002-12-02 Trey Matteson <trey at apple.com>
+
+ Refined bookmark notifications to be more detailed. We now have added, removed,
+ willChange and didChange.
+
+ * Bookmarks.subproj/WebBookmarkGroup.h: New API.
+ * Bookmarks.subproj/WebBookmarkGroup.m:
+ (-[WebBookmarkGroup _sendNotification:forBookmark:children:]):
+ (-[WebBookmarkGroup _setTopBookmark:]):
+ (-[WebBookmarkGroup _bookmarkWillChange:]):
+ (-[WebBookmarkGroup _bookmarkDidChange:]):
+ (-[WebBookmarkGroup _bookmarkChildren:wereAddedToParent:]):
+ (-[WebBookmarkGroup _bookmarkChildren:wereRemovedToParent:]):
+ All just small pieces of flow control for posting the notes.
+ * Bookmarks.subproj/WebBookmarkGroupPrivate.h: Internal methods for posting the notes.
+ * Bookmarks.subproj/WebBookmarkLeaf.m:
+ (-[WebBookmarkLeaf setTitle:]): Post da note
+ (-[WebBookmarkLeaf setURLString:]): Post da note
+ (-[WebBookmarkLeaf description]): Added for debugging.
+ * Bookmarks.subproj/WebBookmarkList.m:
+ (-[WebBookmarkList setTitle:]): Post da note
+ (-[WebBookmarkList removeChild:]): Post da note
+ (-[WebBookmarkList insertChild:atIndex:]): Post da note
+ * Bookmarks.subproj/WebBookmarkProxy.m:
+ (-[WebBookmarkProxy setTitle:]): Post da note
+ * English.lproj/StringsNotToBeLocalized.txt: New strings.
+ * WebKit.exp: New strings.
+
2002-12-02 Maciej Stachowiak <mjs at apple.com>
- added original URL field to action dictionary so that policy delegates
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index aa30bb4..6b1d666 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,3 +1,31 @@
+2002-12-02 Trey Matteson <trey at apple.com>
+
+ Refined bookmark notifications to be more detailed. We now have added, removed,
+ willChange and didChange.
+
+ * Bookmarks.subproj/WebBookmarkGroup.h: New API.
+ * Bookmarks.subproj/WebBookmarkGroup.m:
+ (-[WebBookmarkGroup _sendNotification:forBookmark:children:]):
+ (-[WebBookmarkGroup _setTopBookmark:]):
+ (-[WebBookmarkGroup _bookmarkWillChange:]):
+ (-[WebBookmarkGroup _bookmarkDidChange:]):
+ (-[WebBookmarkGroup _bookmarkChildren:wereAddedToParent:]):
+ (-[WebBookmarkGroup _bookmarkChildren:wereRemovedToParent:]):
+ All just small pieces of flow control for posting the notes.
+ * Bookmarks.subproj/WebBookmarkGroupPrivate.h: Internal methods for posting the notes.
+ * Bookmarks.subproj/WebBookmarkLeaf.m:
+ (-[WebBookmarkLeaf setTitle:]): Post da note
+ (-[WebBookmarkLeaf setURLString:]): Post da note
+ (-[WebBookmarkLeaf description]): Added for debugging.
+ * Bookmarks.subproj/WebBookmarkList.m:
+ (-[WebBookmarkList setTitle:]): Post da note
+ (-[WebBookmarkList removeChild:]): Post da note
+ (-[WebBookmarkList insertChild:atIndex:]): Post da note
+ * Bookmarks.subproj/WebBookmarkProxy.m:
+ (-[WebBookmarkProxy setTitle:]): Post da note
+ * English.lproj/StringsNotToBeLocalized.txt: New strings.
+ * WebKit.exp: New strings.
+
2002-12-02 Maciej Stachowiak <mjs at apple.com>
- added original URL field to action dictionary so that policy delegates
diff --git a/WebKit/English.lproj/StringsNotToBeLocalized.txt b/WebKit/English.lproj/StringsNotToBeLocalized.txt
index d1078f7..159c8f1 100644
--- a/WebKit/English.lproj/StringsNotToBeLocalized.txt
+++ b/WebKit/English.lproj/StringsNotToBeLocalized.txt
@@ -86,12 +86,17 @@
"WebAuthenticationPanel"
"WebBackForwardList:\n"
"WebBookmarkChildrenChangedKey"
+"WebBookmarkChildrenKey"
+"WebBookmarkDidChangeNotification"
"WebBookmarkGroupChangedNotification"
"WebBookmarkIdentifier"
"WebBookmarkType"
"WebBookmarkTypeLeaf"
"WebBookmarkTypeList"
"WebBookmarkTypeProxy"
+"WebBookmarkWillChangeNotification"
+"WebBookmarksWereAddedNotification"
+"WebBookmarksWereRemovedNotification"
"WebCurrentFrameState"
"WebElementFrame"
"WebElementImage"
diff --git a/WebKit/WebKit.exp b/WebKit/WebKit.exp
index f0f9a86..6384f34 100644
--- a/WebKit/WebKit.exp
+++ b/WebKit/WebKit.exp
@@ -25,6 +25,15 @@
.objc_class_name_WebTextView
.objc_class_name_WebURLsWithTitles
.objc_class_name_WebView
+_WebActionButtonKey
+_WebActionElementKey
+_WebActionModifierFlagsKey
+_WebActionNavigationTypeKey
+_WebBookmarkChildrenKey
+_WebBookmarkDidChangeNotification
+_WebBookmarkWillChangeNotification
+_WebBookmarksWereAddedNotification
+_WebBookmarksWereRemovedNotification
_WebElementFrameKey
_WebElementImageKey
_WebElementImageURLKey
@@ -42,6 +51,7 @@ _WebIconLargeSize
_WebIconMediumSize
_WebIconNotificationUserInfoSiteURLKey
_WebIconSmallSize
+_WebModifiedBookmarkKey
_WebURLNamePboardType
_WebURLPboardType
_WebActionNavigationTypeKey
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list