[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 05:57:58 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 6b34b0c9030123c35b1f26b32bc4d79c0c56286b
Author: sullivan <sullivan at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Mar 21 19:38:37 2002 +0000

    	Cleaned up defaults registration and use. The class
    	IFPreferences now registers the defaults at load time, early
    	enough that Alexander doesn't have to register them separately
    	as it had been. Also, all the defaults currently in use now
    	have accessor cover methods, which Alexander will use
    	exclusively.
    
    	* WebView.subproj/IFPreferences.mm:
    	New file, registers defaults and implements cover methods.
    
    	* WebView.subproj/IFPreferences.h:
    	This file existed but wasn't being used (contents #ifdeffed out).
    	Now it declares the cover methods, but still has an #ifdeffed
    	section for possible future stuff.
    
    	* WebKit.pbproj/project.pbxproj: Updated for new file.
    
    	* WebView.subproj/IFWebDataSource.mm:
    	(+[IFWebDataSource initialize]): removed defaults-registration
    	from here.
    
    	Reworked access of WebKit preferences. Now they are always accessed through
    	IFPreferences cover methods, never directly.
    
    	* Defaults.plist,
    	* PreferenceKeys.h:
    	Took out all mention of WebKit preferences.
    
    	* Preferences.subproj/ActiveContentPreferences.m: (-[ActiveContentPreferences
    	toggleJavaEnabled:]), (-[ActiveContentPreferences toggleJavaScriptEnabled:]),
    	(-[ActiveContentPreferences toggleJavaScriptCanOpenWindows:]),
    	(-[ActiveContentPreferences updateJavaScriptViews]), (-[ActiveContentPreferences
    	togglePluginsEnabled:]), (-[ActiveContentPreferences initializeFromDefaults]):
    	* Preferences.subproj/TextPreferences.m: (-[TextPreferences defaultFontSize]),
    	(-[TextPreferences setDefaultFontSize:]), (-[TextPreferences
    	updateFontSampleField:]), (-[TextPreferences changeFont:]), (-[TextPreferences
    	takeStandardFontChoiceFrom:]):
    	Rewrote to use IFPreferences for all WebKit preferences.
    
    	* WebBrowser.pbproj/project.pbxproj: version wars
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@793 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index a584519..e932f53 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,26 @@
+2002-03-21  John Sullivan  <sullivan at apple.com>
+
+	Cleaned up defaults registration and use. The class
+	IFPreferences now registers the defaults at load time, early
+	enough that Alexander doesn't have to register them separately
+	as it had been. Also, all the defaults currently in use now
+	have accessor cover methods, which Alexander will use
+	exclusively.
+	
+	* WebView.subproj/IFPreferences.mm:
+	New file, registers defaults and implements cover methods.
+
+	* WebView.subproj/IFPreferences.h:
+	This file existed but wasn't being used (contents #ifdeffed out).
+	Now it declares the cover methods, but still has an #ifdeffed
+	section for possible future stuff.
+
+	* WebKit.pbproj/project.pbxproj: Updated for new file.
+
+	* WebView.subproj/IFWebDataSource.mm:
+	(+[IFWebDataSource initialize]): removed defaults-registration
+	from here.
+
 2002-03-20  John Sullivan  <sullivan at apple.com>
 
 	Added displayTitle field to IFURIEntry. This is intended to hold the string
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index a584519..e932f53 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,3 +1,26 @@
+2002-03-21  John Sullivan  <sullivan at apple.com>
+
+	Cleaned up defaults registration and use. The class
+	IFPreferences now registers the defaults at load time, early
+	enough that Alexander doesn't have to register them separately
+	as it had been. Also, all the defaults currently in use now
+	have accessor cover methods, which Alexander will use
+	exclusively.
+	
+	* WebView.subproj/IFPreferences.mm:
+	New file, registers defaults and implements cover methods.
+
+	* WebView.subproj/IFPreferences.h:
+	This file existed but wasn't being used (contents #ifdeffed out).
+	Now it declares the cover methods, but still has an #ifdeffed
+	section for possible future stuff.
+
+	* WebKit.pbproj/project.pbxproj: Updated for new file.
+
+	* WebView.subproj/IFWebDataSource.mm:
+	(+[IFWebDataSource initialize]): removed defaults-registration
+	from here.
+
 2002-03-20  John Sullivan  <sullivan at apple.com>
 
 	Added displayTitle field to IFURIEntry. This is intended to hold the string
diff --git a/WebKit/WebKit.pbproj/project.pbxproj b/WebKit/WebKit.pbproj/project.pbxproj
index f971a57..c3f1971 100644
--- a/WebKit/WebKit.pbproj/project.pbxproj
+++ b/WebKit/WebKit.pbproj/project.pbxproj
@@ -3,7 +3,7 @@
 	archiveVersion = 1;
 	classes = {
 	};
-	objectVersion = 36;
+	objectVersion = 34;
 	objects = {
 		014CEA440018CDF011CA2923 = {
 			buildRules = (
@@ -230,6 +230,7 @@
 				F5B92B850223191D01C1A525,
 				F5DE3CB5023575AA01A80181,
 				F5D538ED02441FDD01A80181,
+				F5AEBB3E024A527601C1A526,
 			);
 			isa = PBXSourcesBuildPhase;
 		};
@@ -763,6 +764,9 @@
 			fileRef = 3944606E020F50ED0ECA1767;
 			isa = PBXBuildFile;
 			settings = {
+				ATTRIBUTES = (
+					Public,
+				);
 			};
 		};
 		3944608E020F50ED0ECA1767 = {
@@ -941,6 +945,7 @@
 				3944606C020F50ED0ECA1767,
 				3944606D020F50ED0ECA1767,
 				3944606E020F50ED0ECA1767,
+				F5AEBB3D024A527601C1A526,
 				3944606F020F50ED0ECA1767,
 				39446070020F50ED0ECA1767,
 				39446071020F50ED0ECA1767,
@@ -1053,6 +1058,18 @@
 			settings = {
 			};
 		};
+		F5AEBB3D024A527601C1A526 = {
+			isa = PBXFileReference;
+			name = IFPreferences.mm;
+			path = WebView.subproj/IFPreferences.mm;
+			refType = 4;
+		};
+		F5AEBB3E024A527601C1A526 = {
+			fileRef = F5AEBB3D024A527601C1A526;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
 		F5B67130023EDF8901C1A525 = {
 			isa = PBXFileReference;
 			name = url_icon.tiff;
diff --git a/WebKit/WebView.subproj/IFPreferences.h b/WebKit/WebView.subproj/IFPreferences.h
index bbdac0d..31f10d0 100644
--- a/WebKit/WebView.subproj/IFPreferences.h
+++ b/WebKit/WebView.subproj/IFPreferences.h
@@ -1,44 +1,69 @@
 /*	
-        IFWebController.h
+        IFPreferences.h
 	Copyright 2001, Apple, Inc. All rights reserved.
 
         Public header file.
 */
 #import <Cocoa/Cocoa.h>
 
-#ifdef READY_FOR_PRIMETIME
+ at interface IFPreferences: NSObject
+
++ (IFPreferences *)standardPreferences;
+
+- (NSString *)standardFontFamily;
+- (void)setStandardFontFamily:(NSString *)family;
+
+- (NSString *)fixedFontFamily;
+- (void)setFixedFontFamily:(NSString *)family;
+
+- (NSString *)serifFontFamily;
+- (void)setSerifFontFamily:(NSString *)family;
+
+- (NSString *)sansSerifFontFamily;
+- (void)setSansSerifFontFamily:(NSString *)family;
+
+- (NSString *)cursiveFontFamily;
+- (void)setCursiveFontFamily:(NSString *)family;
 
+- (NSString *)fantasyFontFamily;
+- (void)setFantasyFontFamily:(NSString *)family;
 
+- (NSArray *)fontSizes;
+- (void)setFontSizes:(NSArray *)sizes;
 
+- (int)minimumFontSize;
+- (void)setMinimumFontSize:(int)size;
+
+- (BOOL)javaEnabled;
+- (void)setJavaEnabled:(BOOL)flag;
+
+- (BOOL)jScriptEnabled;
+- (void)setJScriptEnabled:(BOOL)flag;
+
+- (BOOL)pluginsEnabled;
+- (void)setPluginsEnabled:(BOOL)flag;
+
+ at end
+
+#ifdef READY_FOR_PRIMETIME
 
 /*
    ============================================================================= 
 
-    This class provides a cover for URL-based preference items. 
+    Here is some not-yet-implemented API that we might want to get around to.
+    Someday we might have preferences on a per-URL basis.
 */
- at interface IFPreferences
+
 + getPreferencesForURL: (NSURL *)url;
 
 // Encoding that will be used in none specified on page? or in header?
 + setEncoding: (NSString *)encoding;
 + (NSString *)encoding;
 
-// Javascript preferences
-- (void)setJScriptEnabled: (BOOL)flag;
-- (BOOL)jScriptEnabled;
-
-// Java preferences
-- (void)setJavaEnabled: (BOOL)flag
-- (BOOL)javaEnabled;
-
 // Document refreshes allowed
 - setRefreshEnabled: (BOOL)flag;
 - (BOOL)refreshEnabled;
 
-// Plugins
-- (void)setPluginsEnabled: (BOOL)flag;
-- (BOOL)pluginEnabled;
-
 // Should images be loaded.
 - (void)setAutoloadImages: (BOOL)flag;
 - (BOOL)autoloadImages;
@@ -52,8 +77,5 @@
 - (void)setOnlyLocalReferences: (BOOL)flag;
 - (BOOL)onlyLocalReferences;
 
- at end
-
-
 #endif
 
diff --git a/WebKit/WebView.subproj/IFPreferences.mm b/WebKit/WebView.subproj/IFPreferences.mm
new file mode 100644
index 0000000..f393ede
--- /dev/null
+++ b/WebKit/WebView.subproj/IFPreferences.mm
@@ -0,0 +1,178 @@
+/*	
+        IFPreferences.mm
+	Copyright 2001, Apple, Inc. All rights reserved.
+*/
+#import "IFPreferences.h"
+
+#import <WebKit/WebKitDebug.h>
+
+// These are private because callers should be using the cover methods
+#define	WebKitLogLevelPreferenceKey		@"WebKitLogLevel"
+#define	WebKitStandardFontPreferenceKey		@"WebKitStandardFont"
+#define	WebKitFixedFontPreferenceKey		@"WebKitFixedFont"
+#define	WebKitSerifFontPreferenceKey		@"WebKitSerifFont"
+#define	WebKitSansSerifFontPreferenceKey	@"WebKitSansSerifFont"
+#define	WebKitCursiveFontPreferenceKey		@"WebKitCursiveFont"
+#define	WebKitFantasyFontPreferenceKey		@"WebKitFantasyFont"
+#define	WebKitMinimumFontSizePreferenceKey	@"WebKitMinimumFontSize"
+#define	WebKitFontSizesPreferenceKey		@"WebKitFontSizes"
+#define	WebKitJavaEnabledPreferenceKey		@"WebKitJavaEnabled"
+#define	WebKitJScriptEnabledPreferenceKey	@"WebKitJScriptEnabled"
+#define	WebKitPluginsEnabledPreferenceKey	@"WebKitPluginsEnabled"
+
+ at implementation IFPreferences
+
+static IFPreferences *_standardPreferences = nil;
+
++ (IFPreferences *)standardPreferences
+{
+    if (_standardPreferences == nil) {
+        _standardPreferences = [[IFPreferences alloc] init];
+    }
+
+    return _standardPreferences;
+}
+
+// if we ever have more than one IFPreferences object, this would move to init
++ (void)load
+{
+    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+
+    NSArray *fontSizeArray = [NSArray arrayWithObjects:@"6", @"8", @"9", @"11", @"14", @"16", @"20", nil];
+    NSNumber *pluginsEnabled = [NSNumber numberWithBool:TRUE];
+    NSNumber *javaEnabled = [NSNumber numberWithBool:FALSE];
+    NSNumber *jScriptEnabled = [NSNumber numberWithBool:TRUE];
+
+    NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:
+        @"0x0", 		WebKitLogLevelPreferenceKey,
+        @"Georgia", 		WebKitStandardFontPreferenceKey,
+        @"Monaco",	  	WebKitFixedFontPreferenceKey,
+        @"Georgia", 		WebKitSerifFontPreferenceKey,
+        @"Arial", 		WebKitSansSerifFontPreferenceKey,
+        @"Apple Chancery", 	WebKitCursiveFontPreferenceKey,
+        @"Papyrus", 		WebKitFantasyFontPreferenceKey,
+        @"6", 			WebKitMinimumFontSizePreferenceKey,
+        fontSizeArray,		WebKitFontSizesPreferenceKey,
+        javaEnabled,		WebKitJavaEnabledPreferenceKey,
+        jScriptEnabled,		WebKitJScriptEnabledPreferenceKey,
+        pluginsEnabled,		WebKitPluginsEnabledPreferenceKey,
+        nil];
+
+    [[NSUserDefaults standardUserDefaults] registerDefaults:dict];
+
+    [pool release];
+}
+
+- (NSString *)standardFontFamily
+{
+    return [[NSUserDefaults standardUserDefaults] stringForKey:WebKitStandardFontPreferenceKey];
+}
+
+- (void)setStandardFontFamily:(NSString *)family
+{
+    [[NSUserDefaults standardUserDefaults] setObject:family forKey:WebKitStandardFontPreferenceKey];
+}
+
+- (NSString *)fixedFontFamily
+{
+    return [[NSUserDefaults standardUserDefaults] stringForKey:WebKitFixedFontPreferenceKey];
+}
+
+- (void)setFixedFontFamily:(NSString *)family
+{
+    [[NSUserDefaults standardUserDefaults] setObject:family forKey:WebKitFixedFontPreferenceKey];
+}
+
+- (NSString *)serifFontFamily
+{
+    return [[NSUserDefaults standardUserDefaults] stringForKey:WebKitSerifFontPreferenceKey];
+}
+
+- (void)setSerifFontFamily:(NSString *)family
+{
+    [[NSUserDefaults standardUserDefaults] setObject:family forKey:WebKitSerifFontPreferenceKey];
+}
+
+- (NSString *)sansSerifFontFamily
+{
+    return [[NSUserDefaults standardUserDefaults] stringForKey:WebKitSansSerifFontPreferenceKey];
+}
+
+- (void)setSansSerifFontFamily:(NSString *)family
+{
+    [[NSUserDefaults standardUserDefaults] setObject:family forKey:WebKitSansSerifFontPreferenceKey];
+}
+
+- (NSString *)cursiveFontFamily
+{
+    return [[NSUserDefaults standardUserDefaults] stringForKey:WebKitCursiveFontPreferenceKey];
+}
+
+- (void)setCursiveFontFamily:(NSString *)family
+{
+    [[NSUserDefaults standardUserDefaults] setObject:family forKey:WebKitCursiveFontPreferenceKey];
+}
+
+- (NSString *)fantasyFontFamily
+{
+    return [[NSUserDefaults standardUserDefaults] stringForKey:WebKitFantasyFontPreferenceKey];
+}
+
+- (void)setFantasyFontFamily:(NSString *)family
+{
+    [[NSUserDefaults standardUserDefaults] setObject:family forKey:WebKitFantasyFontPreferenceKey];
+}
+
+- (NSArray *)fontSizes
+{
+    return [[NSUserDefaults standardUserDefaults] arrayForKey:WebKitFontSizesPreferenceKey];
+}
+
+- (void)setFontSizes:(NSArray *)sizes
+{
+    [[NSUserDefaults standardUserDefaults] setObject:sizes forKey:WebKitFontSizesPreferenceKey];
+}
+
+- (int)minimumFontSize
+{
+    return [[NSUserDefaults standardUserDefaults] integerForKey:WebKitMinimumFontSizePreferenceKey];
+}
+
+- (void)setMinimumFontSize:(int)size
+{
+    [[NSUserDefaults standardUserDefaults] setInteger:size forKey:WebKitMinimumFontSizePreferenceKey];
+}
+
+
+- (BOOL)javaEnabled
+{
+    return [[NSUserDefaults standardUserDefaults] boolForKey:WebKitJavaEnabledPreferenceKey];
+}
+
+- (void)setJavaEnabled:(BOOL)flag
+{
+    [[NSUserDefaults standardUserDefaults] setBool:flag forKey:WebKitJavaEnabledPreferenceKey];
+}
+
+- (BOOL)jScriptEnabled
+{
+    return [[NSUserDefaults standardUserDefaults] boolForKey:WebKitJScriptEnabledPreferenceKey];
+}
+
+- (void)setJScriptEnabled:(BOOL)flag
+{
+    [[NSUserDefaults standardUserDefaults] setBool:flag forKey:WebKitJScriptEnabledPreferenceKey];
+}
+
+- (BOOL)pluginsEnabled
+{
+    return [[NSUserDefaults standardUserDefaults] boolForKey:WebKitPluginsEnabledPreferenceKey];
+}
+
+- (void)setPluginsEnabled:(BOOL)flag
+{
+    [[NSUserDefaults standardUserDefaults] setBool:flag forKey:WebKitPluginsEnabledPreferenceKey];
+}
+
+
+ at end
diff --git a/WebKit/WebView.subproj/IFWebDataSource.mm b/WebKit/WebView.subproj/IFWebDataSource.mm
index 0f8d6fc..6b75c7b 100644
--- a/WebKit/WebView.subproj/IFWebDataSource.mm
+++ b/WebKit/WebView.subproj/IFWebDataSource.mm
@@ -1,5 +1,5 @@
 /*	
-        IFWebDataSource.h
+        IFWebDataSource.mm
 	Copyright 2001, Apple, Inc. All rights reserved.
 */
 #import <WebKit/IFWebDataSource.h>
@@ -23,32 +23,6 @@ static id IFWebDataSourceMake(void *url)
     WCSetIFWebDataSourceMakeFunc(IFWebDataSourceMake);
 }
 
-+ (void)initialize {
-
-    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
-    NSArray *fontSizeArray = [NSArray arrayWithObjects:@"6", @"8", @"9", @"11", @"14", @"16", @"20", nil];
-    NSNumber *pluginsEnabled = [NSNumber numberWithBool:TRUE];
-    NSNumber *javaEnabled = [NSNumber numberWithBool:FALSE];
-    
-    NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:
-//        @"0xffffffff", 		@"WebKitLogLevel",
-        @"0x0", 		@"WebKitLogLevel",
-        @"Georgia", 		@"WebKitStandardFont",
-        @"Andale Mono",  	@"WebKitFixedFont",
-        @"Georgia", 		@"WebKitSerifFont",
-        @"Arial", 		@"WebKitSansSerifFont",
-        @"Apple Chancery", 	@"WebKitCursiveFont",
-        @"Papyrus", 		@"WebKitFantasyFont",
-        @"6", 			@"WebKitMinimumFontSize",
-        fontSizeArray,		@"WebKitFontSizes",
-        pluginsEnabled,		@"WebKitPluginsEnabled",
-        javaEnabled,		@"WebKitJavaEnabled",
-        nil];
-
-    [defaults registerDefaults:dict];
-}
-
-
 - (void)_commonInitialization
 {
     ((IFWebDataSourcePrivate *)_dataSourcePrivate) = [[IFWebDataSourcePrivate alloc] init];
diff --git a/WebKit/WebView.subproj/WebDataSource.m b/WebKit/WebView.subproj/WebDataSource.m
index 0f8d6fc..6b75c7b 100644
--- a/WebKit/WebView.subproj/WebDataSource.m
+++ b/WebKit/WebView.subproj/WebDataSource.m
@@ -1,5 +1,5 @@
 /*	
-        IFWebDataSource.h
+        IFWebDataSource.mm
 	Copyright 2001, Apple, Inc. All rights reserved.
 */
 #import <WebKit/IFWebDataSource.h>
@@ -23,32 +23,6 @@ static id IFWebDataSourceMake(void *url)
     WCSetIFWebDataSourceMakeFunc(IFWebDataSourceMake);
 }
 
-+ (void)initialize {
-
-    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
-    NSArray *fontSizeArray = [NSArray arrayWithObjects:@"6", @"8", @"9", @"11", @"14", @"16", @"20", nil];
-    NSNumber *pluginsEnabled = [NSNumber numberWithBool:TRUE];
-    NSNumber *javaEnabled = [NSNumber numberWithBool:FALSE];
-    
-    NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:
-//        @"0xffffffff", 		@"WebKitLogLevel",
-        @"0x0", 		@"WebKitLogLevel",
-        @"Georgia", 		@"WebKitStandardFont",
-        @"Andale Mono",  	@"WebKitFixedFont",
-        @"Georgia", 		@"WebKitSerifFont",
-        @"Arial", 		@"WebKitSansSerifFont",
-        @"Apple Chancery", 	@"WebKitCursiveFont",
-        @"Papyrus", 		@"WebKitFantasyFont",
-        @"6", 			@"WebKitMinimumFontSize",
-        fontSizeArray,		@"WebKitFontSizes",
-        pluginsEnabled,		@"WebKitPluginsEnabled",
-        javaEnabled,		@"WebKitJavaEnabled",
-        nil];
-
-    [defaults registerDefaults:dict];
-}
-
-
 - (void)_commonInitialization
 {
     ((IFWebDataSourcePrivate *)_dataSourcePrivate) = [[IFWebDataSourcePrivate alloc] init];
diff --git a/WebKit/WebView.subproj/WebPreferences.h b/WebKit/WebView.subproj/WebPreferences.h
index bbdac0d..31f10d0 100644
--- a/WebKit/WebView.subproj/WebPreferences.h
+++ b/WebKit/WebView.subproj/WebPreferences.h
@@ -1,44 +1,69 @@
 /*	
-        IFWebController.h
+        IFPreferences.h
 	Copyright 2001, Apple, Inc. All rights reserved.
 
         Public header file.
 */
 #import <Cocoa/Cocoa.h>
 
-#ifdef READY_FOR_PRIMETIME
+ at interface IFPreferences: NSObject
+
++ (IFPreferences *)standardPreferences;
+
+- (NSString *)standardFontFamily;
+- (void)setStandardFontFamily:(NSString *)family;
+
+- (NSString *)fixedFontFamily;
+- (void)setFixedFontFamily:(NSString *)family;
+
+- (NSString *)serifFontFamily;
+- (void)setSerifFontFamily:(NSString *)family;
+
+- (NSString *)sansSerifFontFamily;
+- (void)setSansSerifFontFamily:(NSString *)family;
+
+- (NSString *)cursiveFontFamily;
+- (void)setCursiveFontFamily:(NSString *)family;
 
+- (NSString *)fantasyFontFamily;
+- (void)setFantasyFontFamily:(NSString *)family;
 
+- (NSArray *)fontSizes;
+- (void)setFontSizes:(NSArray *)sizes;
 
+- (int)minimumFontSize;
+- (void)setMinimumFontSize:(int)size;
+
+- (BOOL)javaEnabled;
+- (void)setJavaEnabled:(BOOL)flag;
+
+- (BOOL)jScriptEnabled;
+- (void)setJScriptEnabled:(BOOL)flag;
+
+- (BOOL)pluginsEnabled;
+- (void)setPluginsEnabled:(BOOL)flag;
+
+ at end
+
+#ifdef READY_FOR_PRIMETIME
 
 /*
    ============================================================================= 
 
-    This class provides a cover for URL-based preference items. 
+    Here is some not-yet-implemented API that we might want to get around to.
+    Someday we might have preferences on a per-URL basis.
 */
- at interface IFPreferences
+
 + getPreferencesForURL: (NSURL *)url;
 
 // Encoding that will be used in none specified on page? or in header?
 + setEncoding: (NSString *)encoding;
 + (NSString *)encoding;
 
-// Javascript preferences
-- (void)setJScriptEnabled: (BOOL)flag;
-- (BOOL)jScriptEnabled;
-
-// Java preferences
-- (void)setJavaEnabled: (BOOL)flag
-- (BOOL)javaEnabled;
-
 // Document refreshes allowed
 - setRefreshEnabled: (BOOL)flag;
 - (BOOL)refreshEnabled;
 
-// Plugins
-- (void)setPluginsEnabled: (BOOL)flag;
-- (BOOL)pluginEnabled;
-
 // Should images be loaded.
 - (void)setAutoloadImages: (BOOL)flag;
 - (BOOL)autoloadImages;
@@ -52,8 +77,5 @@
 - (void)setOnlyLocalReferences: (BOOL)flag;
 - (BOOL)onlyLocalReferences;
 
- at end
-
-
 #endif
 
diff --git a/WebKit/WebView.subproj/WebPreferences.m b/WebKit/WebView.subproj/WebPreferences.m
new file mode 100644
index 0000000..f393ede
--- /dev/null
+++ b/WebKit/WebView.subproj/WebPreferences.m
@@ -0,0 +1,178 @@
+/*	
+        IFPreferences.mm
+	Copyright 2001, Apple, Inc. All rights reserved.
+*/
+#import "IFPreferences.h"
+
+#import <WebKit/WebKitDebug.h>
+
+// These are private because callers should be using the cover methods
+#define	WebKitLogLevelPreferenceKey		@"WebKitLogLevel"
+#define	WebKitStandardFontPreferenceKey		@"WebKitStandardFont"
+#define	WebKitFixedFontPreferenceKey		@"WebKitFixedFont"
+#define	WebKitSerifFontPreferenceKey		@"WebKitSerifFont"
+#define	WebKitSansSerifFontPreferenceKey	@"WebKitSansSerifFont"
+#define	WebKitCursiveFontPreferenceKey		@"WebKitCursiveFont"
+#define	WebKitFantasyFontPreferenceKey		@"WebKitFantasyFont"
+#define	WebKitMinimumFontSizePreferenceKey	@"WebKitMinimumFontSize"
+#define	WebKitFontSizesPreferenceKey		@"WebKitFontSizes"
+#define	WebKitJavaEnabledPreferenceKey		@"WebKitJavaEnabled"
+#define	WebKitJScriptEnabledPreferenceKey	@"WebKitJScriptEnabled"
+#define	WebKitPluginsEnabledPreferenceKey	@"WebKitPluginsEnabled"
+
+ at implementation IFPreferences
+
+static IFPreferences *_standardPreferences = nil;
+
++ (IFPreferences *)standardPreferences
+{
+    if (_standardPreferences == nil) {
+        _standardPreferences = [[IFPreferences alloc] init];
+    }
+
+    return _standardPreferences;
+}
+
+// if we ever have more than one IFPreferences object, this would move to init
++ (void)load
+{
+    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+
+    NSArray *fontSizeArray = [NSArray arrayWithObjects:@"6", @"8", @"9", @"11", @"14", @"16", @"20", nil];
+    NSNumber *pluginsEnabled = [NSNumber numberWithBool:TRUE];
+    NSNumber *javaEnabled = [NSNumber numberWithBool:FALSE];
+    NSNumber *jScriptEnabled = [NSNumber numberWithBool:TRUE];
+
+    NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:
+        @"0x0", 		WebKitLogLevelPreferenceKey,
+        @"Georgia", 		WebKitStandardFontPreferenceKey,
+        @"Monaco",	  	WebKitFixedFontPreferenceKey,
+        @"Georgia", 		WebKitSerifFontPreferenceKey,
+        @"Arial", 		WebKitSansSerifFontPreferenceKey,
+        @"Apple Chancery", 	WebKitCursiveFontPreferenceKey,
+        @"Papyrus", 		WebKitFantasyFontPreferenceKey,
+        @"6", 			WebKitMinimumFontSizePreferenceKey,
+        fontSizeArray,		WebKitFontSizesPreferenceKey,
+        javaEnabled,		WebKitJavaEnabledPreferenceKey,
+        jScriptEnabled,		WebKitJScriptEnabledPreferenceKey,
+        pluginsEnabled,		WebKitPluginsEnabledPreferenceKey,
+        nil];
+
+    [[NSUserDefaults standardUserDefaults] registerDefaults:dict];
+
+    [pool release];
+}
+
+- (NSString *)standardFontFamily
+{
+    return [[NSUserDefaults standardUserDefaults] stringForKey:WebKitStandardFontPreferenceKey];
+}
+
+- (void)setStandardFontFamily:(NSString *)family
+{
+    [[NSUserDefaults standardUserDefaults] setObject:family forKey:WebKitStandardFontPreferenceKey];
+}
+
+- (NSString *)fixedFontFamily
+{
+    return [[NSUserDefaults standardUserDefaults] stringForKey:WebKitFixedFontPreferenceKey];
+}
+
+- (void)setFixedFontFamily:(NSString *)family
+{
+    [[NSUserDefaults standardUserDefaults] setObject:family forKey:WebKitFixedFontPreferenceKey];
+}
+
+- (NSString *)serifFontFamily
+{
+    return [[NSUserDefaults standardUserDefaults] stringForKey:WebKitSerifFontPreferenceKey];
+}
+
+- (void)setSerifFontFamily:(NSString *)family
+{
+    [[NSUserDefaults standardUserDefaults] setObject:family forKey:WebKitSerifFontPreferenceKey];
+}
+
+- (NSString *)sansSerifFontFamily
+{
+    return [[NSUserDefaults standardUserDefaults] stringForKey:WebKitSansSerifFontPreferenceKey];
+}
+
+- (void)setSansSerifFontFamily:(NSString *)family
+{
+    [[NSUserDefaults standardUserDefaults] setObject:family forKey:WebKitSansSerifFontPreferenceKey];
+}
+
+- (NSString *)cursiveFontFamily
+{
+    return [[NSUserDefaults standardUserDefaults] stringForKey:WebKitCursiveFontPreferenceKey];
+}
+
+- (void)setCursiveFontFamily:(NSString *)family
+{
+    [[NSUserDefaults standardUserDefaults] setObject:family forKey:WebKitCursiveFontPreferenceKey];
+}
+
+- (NSString *)fantasyFontFamily
+{
+    return [[NSUserDefaults standardUserDefaults] stringForKey:WebKitFantasyFontPreferenceKey];
+}
+
+- (void)setFantasyFontFamily:(NSString *)family
+{
+    [[NSUserDefaults standardUserDefaults] setObject:family forKey:WebKitFantasyFontPreferenceKey];
+}
+
+- (NSArray *)fontSizes
+{
+    return [[NSUserDefaults standardUserDefaults] arrayForKey:WebKitFontSizesPreferenceKey];
+}
+
+- (void)setFontSizes:(NSArray *)sizes
+{
+    [[NSUserDefaults standardUserDefaults] setObject:sizes forKey:WebKitFontSizesPreferenceKey];
+}
+
+- (int)minimumFontSize
+{
+    return [[NSUserDefaults standardUserDefaults] integerForKey:WebKitMinimumFontSizePreferenceKey];
+}
+
+- (void)setMinimumFontSize:(int)size
+{
+    [[NSUserDefaults standardUserDefaults] setInteger:size forKey:WebKitMinimumFontSizePreferenceKey];
+}
+
+
+- (BOOL)javaEnabled
+{
+    return [[NSUserDefaults standardUserDefaults] boolForKey:WebKitJavaEnabledPreferenceKey];
+}
+
+- (void)setJavaEnabled:(BOOL)flag
+{
+    [[NSUserDefaults standardUserDefaults] setBool:flag forKey:WebKitJavaEnabledPreferenceKey];
+}
+
+- (BOOL)jScriptEnabled
+{
+    return [[NSUserDefaults standardUserDefaults] boolForKey:WebKitJScriptEnabledPreferenceKey];
+}
+
+- (void)setJScriptEnabled:(BOOL)flag
+{
+    [[NSUserDefaults standardUserDefaults] setBool:flag forKey:WebKitJScriptEnabledPreferenceKey];
+}
+
+- (BOOL)pluginsEnabled
+{
+    return [[NSUserDefaults standardUserDefaults] boolForKey:WebKitPluginsEnabledPreferenceKey];
+}
+
+- (void)setPluginsEnabled:(BOOL)flag
+{
+    [[NSUserDefaults standardUserDefaults] setBool:flag forKey:WebKitPluginsEnabledPreferenceKey];
+}
+
+
+ at end

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list