[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
rjw
rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 07:43:07 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit d39f8a9fb67b69c496acdfd55e9f953f5f01f7ea
Author: rjw <rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri May 23 23:56:48 2003 +0000
Tweaks for IB.
Updated WebView and WebPreferences to use
keyed archiving.
Added private method to export settable user
defaults keys.
Reviewed by Ken.
* WebView.subproj/WebPreferences.m:
(-[WebPreferences initWithCoder:]):
(+[WebPreferences _userDefaultsKeysForIB]):
* WebView.subproj/WebPreferencesPrivate.h:
* WebView.subproj/WebView.m:
(-[WebView initWithCoder:]):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@4422 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index c8c14a9..3605e7c 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,5 +1,22 @@
2003-05-23 Richard Williamson <rjw at apple.com>
+ Tweaks for IB.
+ Updated WebView and WebPreferences to use
+ keyed archiving.
+ Added private method to export settable user
+ defaults keys.
+
+ Reviewed by Ken.
+
+ * WebView.subproj/WebPreferences.m:
+ (-[WebPreferences initWithCoder:]):
+ (+[WebPreferences _userDefaultsKeysForIB]):
+ * WebView.subproj/WebPreferencesPrivate.h:
+ * WebView.subproj/WebView.m:
+ (-[WebView initWithCoder:]):
+
+2003-05-23 Richard Williamson <rjw at apple.com>
+
Added export of _WebHistoryItemChangedNotification.
* WebKit.exp:
diff --git a/WebKit/WebView.subproj/WebPreferences.m b/WebKit/WebView.subproj/WebPreferences.m
index c30e9a9..3c59416 100644
--- a/WebKit/WebView.subproj/WebPreferences.m
+++ b/WebKit/WebView.subproj/WebPreferences.m
@@ -97,41 +97,60 @@ enum { WebPreferencesVersion = 1 };
- (id)initWithCoder:(NSCoder *)decoder
{
+ volatile id result = nil;
+
NS_DURING
- int version;
- id result = nil;
+ int version;
_private = [[WebPreferencesPrivate alloc] init];
- [decoder decodeValueOfObjCType:@encode(int) at:&version];
- if (version == 1){
- _private->identifier = [decoder decodeObject];
-
- // If we load a nib multiple times, or have instances in multiple
- // nibs with the same name, the first guy up wins.
- WebPreferences *instance = [[self class] _getInstanceForIdentifier:_private->identifier];
- if (instance){
- [self release];
- result = instance;
- }
- else {
- _private->values = [decoder decodeObject];
- result = self;
+
+ if ([decoder allowsKeyedCoding]){
+ _private->identifier = [[decoder decodeObjectForKey:@"Identifier"] retain];
+ _private->values = [[decoder decodeObjectForKey:@"Values"] retain];
+ }
+ else {
+ [decoder decodeValueOfObjCType:@encode(int) at:&version];
+ if (version == 1){
+ _private->identifier = [[decoder decodeObject] retain];
+ _private->values = [[decoder decodeObject] retain];
}
}
- return result;
+
+ // If we load a nib multiple times, or have instances in multiple
+ // nibs with the same name, the first guy up wins.
+ WebPreferences *instance = [[self class] _getInstanceForIdentifier:_private->identifier];
+ if (instance){
+ [self autorelease];
+ result = instance;
+ }
+ else {
+ [[self class] _setInstance:self forIdentifier:_private->identifier];
+ result = self;
+ }
+
NS_HANDLER
- [self release];
- return nil;
+
+ result = nil;
+ [self autorelease];
+
NS_ENDHANDLER
+
+ return result;
}
- (void)encodeWithCoder:(NSCoder *)encoder
{
- int version = WebPreferencesVersion;
- [encoder encodeValueOfObjCType:@encode(int) at:&version];
- [encoder encodeObject:_private->identifier];
- [encoder encodeObject:_private->values];
+ if ([encoder allowsKeyedCoding]){
+ [encoder encodeObject:_private->identifier forKey:@"Identifier"];
+ [encoder encodeObject:_private->values forKey:@"Values"];
+ }
+ else {
+ int version = WebPreferencesVersion;
+ [encoder encodeValueOfObjCType:@encode(int) at:&version];
+ [encoder encodeObject:_private->identifier];
+ [encoder encodeObject:_private->values];
+ }
}
+ (WebPreferences *)standardPreferences
@@ -520,6 +539,29 @@ static NSMutableDictionary *webPreferencesInstances = nil;
userInfo:nil];
}
++ (NSArray *)_userDefaultsKeysForIB
+{
+ return [NSArray arrayWithObjects:
+ WebKitStandardFontPreferenceKey,
+ WebKitFixedFontPreferenceKey,
+ WebKitSerifFontPreferenceKey,
+ WebKitSansSerifFontPreferenceKey,
+ WebKitCursiveFontPreferenceKey,
+ WebKitFantasyFontPreferenceKey,
+ WebKitMinimumFontSizePreferenceKey,
+ WebKitDefaultFontSizePreferenceKey,
+ WebKitDefaultFixedFontSizePreferenceKey,
+ WebKitDefaultTextEncodingNamePreferenceKey,
+ WebKitJavaEnabledPreferenceKey,
+ WebKitJavaScriptEnabledPreferenceKey,
+ WebKitJavaScriptCanOpenWindowsAutomaticallyPreferenceKey,
+ WebKitPluginsEnabledPreferenceKey,
+ WebKitAllowAnimatedImagesPreferenceKey,
+ WebKitAllowAnimatedImageLoopingPreferenceKey,
+ WebKitDisplayImagesKey,
+ nil
+ ];
+}
@end
diff --git a/WebKit/WebView.subproj/WebPreferencesPrivate.h b/WebKit/WebView.subproj/WebPreferencesPrivate.h
index 1c0ffd0..abae4c1 100644
--- a/WebKit/WebView.subproj/WebPreferencesPrivate.h
+++ b/WebKit/WebView.subproj/WebPreferencesPrivate.h
@@ -18,5 +18,6 @@
+ (WebPreferences *)_getInstanceForIdentifier:(NSString *)identifier;
+ (void)_setInstance:(WebPreferences *)instance forIdentifier:(NSString *)identifier;
+ (void)_removeReferenceForIdentifier:(NSString *)identifier;
++ (NSArray *)_userDefaultsKeysForIB;
@end
diff --git a/WebKit/WebView.subproj/WebView.m b/WebKit/WebView.subproj/WebView.m
index 5d74b62..8c9ea11 100644
--- a/WebKit/WebView.subproj/WebView.m
+++ b/WebKit/WebView.subproj/WebView.m
@@ -131,39 +131,58 @@ enum { WebViewVersion = 1 };
- (id)initWithCoder:(NSCoder *)decoder
{
-NS_DURING
+ volatile id result = nil;
- id result = nil;
- int version;
+NS_DURING
result = [super initWithCoder:decoder];
-
- [decoder decodeValueOfObjCType:@encode(int) at:&version];
- if (version == 1){
- NSString *frameName = [decoder decodeObject];
- NSString *groupName = [decoder decodeObject];
+ // We don't want any of the archived subviews.
+ [[result subviews] makeObjectsPerformSelector:@selector(removeFromSuperview)];
+
+ if ([decoder allowsKeyedCoding]){
+ NSString *frameName = [decoder decodeObjectForKey:@"FrameName"];
+ NSString *groupName = [decoder decodeObjectForKey:@"GroupName"];
[result _commonInitializationFrameName:frameName groupName:groupName];
- [result setPreferences: [decoder decodeObject]];
+ [result setPreferences: [decoder decodeObjectForKey:@"Preferences"]];
+ }
+ else {
+ int version;
+
+ [decoder decodeValueOfObjCType:@encode(int) at:&version];
+ if (version == 1){
+ NSString *frameName = [decoder decodeObject];
+ NSString *groupName = [decoder decodeObject];
+ [result _commonInitializationFrameName:frameName groupName:groupName];
+ [result setPreferences: [decoder decodeObject]];
+ }
}
- return result;
NS_HANDLER
- [self release];
- return nil;
+ result = nil;
+ [self autorelease];
NS_ENDHANDLER
+
+ return result;
}
- (void)encodeWithCoder:(NSCoder *)encoder
{
[super encodeWithCoder:encoder];
- int version = WebViewVersion;
- [encoder encodeValueOfObjCType:@encode(int) at:&version];
- [encoder encodeObject:[[self mainFrame] name]];
- [encoder encodeObject:[self groupName]];
- [encoder encodeObject:[self preferences]];
+ if ([encoder allowsKeyedCoding]){
+ [encoder encodeObject:[[self mainFrame] name] forKey:@"FrameName"];
+ [encoder encodeObject:[self groupName] forKey:@"GroupName"];
+ [encoder encodeObject:[self preferences] forKey:@"Preferences"];
+ }
+ else {
+ int version = WebViewVersion;
+ [encoder encodeValueOfObjCType:@encode(int) at:&version];
+ [encoder encodeObject:[[self mainFrame] name]];
+ [encoder encodeObject:[self groupName]];
+ [encoder encodeObject:[self preferences]];
+ }
}
- (void)dealloc
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list