nsCString mStr( value ); PRUnichar *ustring = mStr.ToNewUnicode(); moz->MyBrowser->mPrefs->SetUnicharPref( "browser.display.foreground_color", ustring );
moz->MyBrowser->mPrefs->SetUnicharPref( "browser.display.foreground_color", NS_ConvertASCIItoUCS2(value).get() );
static void mozilla_set_pref( PtWidget_t *widget, char *option, char *value ) {	PtMozillaWidget_t *moz = ( PtMozillaWidget_t * ) widget;	char buffer[1024];	mozilla_get_pref( widget, option, buffer );	if( buffer[0] && !strcmp( value, buffer ) ) {		return; /* the option is already set */		}/* HTML Options */	if( !strcmp( option, "A:visited color" ) ) {		nsCString mStr( value );		PRUnichar *ustring = mStr.ToNewUnicode();		moz->MyBrowser->mPrefs->SetUnicharPref( "browser.visited_color", ustring );		}	else if( !strcmp( option, "A:link color" ) ) {		nsCString mStr( value );		PRUnichar *ustring = mStr.ToNewUnicode();		moz->MyBrowser->mPrefs->SetUnicharPref( "browser.anchor_color", ustring );		}/* the mozserver already has A:link color == browser.anchor_color for this *///	else if( !strcmp( option, "A:active color" ) ) {//		nsCString mStr( value );//		PRUnichar *ustring = mStr.ToNewUnicode();//		moz->MyBrowser->mPrefs->SetUnicharPref( "browser.anchor_color", ustring );//		}	else if( !strcmp( option, "BODY color" ) ) {		nsCString mStr( value );		PRUnichar *ustring = mStr.ToNewUnicode();		moz->MyBrowser->mPrefs->SetUnicharPref( "browser.display.foreground_color", ustring );		}	else if( !strcmp( option, "BODY background" ) ) {		nsCString mStr( value );		PRUnichar *ustring = mStr.ToNewUnicode();		moz->MyBrowser->mPrefs->SetUnicharPref( "browser.display.background_color", ustring );		}	else if( !strcmp( option, "bIgnoreDocumentAttributes" ) )		moz->MyBrowser->mPrefs->SetBoolPref( "browser.display.use_document_colors", stricmp( value, "TRUE" ) ? PR_FALSE : PR_TRUE );	else if( !strcmp( option, "bUnderlineLinks" ) ) {		moz->MyBrowser->mPrefs->SetBoolPref( "browser.underline_anchors", !stricmp( value, "TRUE" ) ? PR_TRUE : PR_FALSE );		}	else if( !strcmp( option, "iUserTextSize" ) ) {		int n = atoi( value );		/* map our n= 0...4 value into a mozilla font value */		/* see xpfe/components/prefwindow/resources/content/pref-fonts.xul, they are also hard-coded there */		switch( n ) {			case 0: n = VOYAGER_TEXTSIZE0; break;			case 1: n = VOYAGER_TEXTSIZE1; break;			case 2: n = VOYAGER_TEXTSIZE2; break;			case 3: n = VOYAGER_TEXTSIZE3; break;			case 4: n = VOYAGER_TEXTSIZE4; break;			}//		moz->MyBrowser->mPrefs->SetIntPref( "font.size.fixed.x-western", n );		moz->MyBrowser->mPrefs->SetIntPref( "font.size.variable.x-western", n );		}	else if( !strcmp( option, "BODY font-family" ) ) {		/* set the current font */		char *font_default = NULL;		char preference[256];		moz->MyBrowser->mPrefs->CopyCharPref( "font.default", &font_default );		if( !font_default ) font_default = "serif";		sprintf( preference, "font.name.%s.x-western", font_default );		moz->MyBrowser->mPrefs->SetCharPref( preference, value );		}	else if( !strcmp( option, "PRE font-family" ) || !strcmp( option, "H* font-family" ) ) {		/* do not set these - use the BODY font-family instead */		}/* SOCKS options */	else if( !strcmp( option, "socks_server" ) )		moz->MyBrowser->mPrefs->SetCharPref( "network.hosts.socks_server", value );	else if( !strcmp( option, "socks_port" ) )		moz->MyBrowser->mPrefs->SetCharPref( "network.hosts.socks_serverport", value );	else if( !strcmp( option, "socks_user" ) ) 		; /* not used */	else if( !strcmp( option, "socks_app" ) ) 		; /* not used *//* HTTP options */	else if( !strcmp( option, "http_proxy_host" ) )		moz->MyBrowser->mPrefs->SetCharPref( "network.proxy.http", value );	else if( !strcmp( option, "http_proxy_port" ) )		moz->MyBrowser->mPrefs->SetCharPref( "network.proxy.http_port", value );	else if( !strcmp( option, "proxy_overrides" ) )		moz->MyBrowser->mPrefs->SetCharPref( "network.proxy.no_proxies_on", value );/* FTP options */	else if( !strcmp( option, "ftp_proxy_host" ) )		moz->MyBrowser->mPrefs->SetCharPref( "network.proxy.ftp", value );	else if( !strcmp( option, "ftp_proxy_port" ) )		moz->MyBrowser->mPrefs->SetCharPref( "network.proxy.ftp_port", value );	else if( !strcmp( option, "email_address" ) )		; /* not used *//* Gopher options */	else if( !strcmp( option, "gopher_proxy_host" ) )		moz->MyBrowser->mPrefs->SetCharPref( "network.proxy.gopher", value );	else if( !strcmp( option, "gopher_proxy_port" ) )		moz->MyBrowser->mPrefs->SetCharPref( "network.proxy.gopher_port", value );/* TCP/IP options */	else if( !strcmp( option, "socket_timeout" ) )		moz->MyBrowser->mPrefs->SetIntPref( "network.http.connect.timeout", atoi( value ) );	else if( !strcmp( option, "max_connections" ) )		moz->MyBrowser->mPrefs->SetIntPref( "network.http.max-connections", atoi( value ) );/* Disk-cache options */	else if( !strcmp( option, "main_cache_kb_size" ) )		moz->MyBrowser->mPrefs->SetIntPref( "browser.cache.disk_cache_size", atoi( value ) );	else if( !strcmp( option, "enable_disk_cache" ) )		moz->MyBrowser->mPrefs->SetBoolPref( "browser.cache.disk.enable", !stricmp( value, "TRUE" ) ? PR_TRUE : PR_FALSE );	else if( !strcmp( option, "dcache_verify_policy" ) ) {		int n = atoi( value ), moz_value;		if( n == 0 ) moz_value = 2; /* never */		else if( n == 1 ) moz_value = 0; /* once */		else moz_value = 1; /* always */		moz->MyBrowser->mPrefs->SetIntPref( "browser.cache.check_doc_frequency", atoi( value ) );		}	else if( !strcmp( option, "main_cache_dir" ) ) 		; /* not used */	else if( !strcmp( option, "main_index_file" ) ) 		; /* not used */	else if( !strcmp( option, "clear_main_cache_on_exit" ) ) 		; /* not used */	else if( !strcmp( option, "keep_index_file_updated" ) ) 		; /* not used *//* Miscellaneous options */	else if( !strcmp( option, "History_Expire" ) )		moz->MyBrowser->mPrefs->SetIntPref( "browser.history_expire_days", atoi( value ) );	else if( !strcmp( option, "Page_History_Length" ) )		moz->MyBrowser->mPrefs->SetIntPref( "browser.sessionhistory.max_entries", atoi( value ) );/* HTML Options */	else if( !strcmp( option, "bAutoLoadImages" ) )			; /* not used */	else if( !strcmp( option, "iReformatHandling" ) )		; /* not used */	else if( !strcmp( option, "BODY margin-top" ) )		; /* not used */	else if( !strcmp( option, "BODY margin-right" ) )		; /* not used */	else if( !strcmp( option, "iScrollbarSize" ) )		; /* not used */	else if( !strcmp( option, "top_focus_color" ) )		; /* not used */	else if( !strcmp( option, "bot_focus_color" ) )		; /* not used */	else if( !strcmp( option, "top_border_color" ) )		; /* not used */	else if( !strcmp( option, "bot_border_color" ) )		; /* not used */	else if( !strcmp( option, "bview_source" ) )		; /* not used */	else if( !strcmp( option, "underline_width" ) )		; /* not used */	else if( !strcmp( option, "bkey_mode" ) )		; /* not used */	else if( !strcmp( option, "mono_form_font" ) )		; /* not used */	else if( !strcmp( option, "form_font" ) )		; /* not used */	else if( !strcmp( option, "frame_spacing" ) )		; /* not used */	else if( !strcmp( option, "disable_new_windows" ) )		; /* not used */	else if( !strcmp( option, "disable_exception_dlg" ) )		; /* not used */	else if( !strcmp( option, "bDisableHighlight" ) )		; /* not used *//* HTTP cookie options */	else if( !strcmp( option, "cookiejar_path" ) )		; /* not used */	else if( !strcmp( option, "cookiejar_name" ) )		; /* not used */	else if( !strcmp( option, "cookiejar_size" ) )		; /* not used */	else if( !strcmp( option, "cookiejar_save_always" ) )		; /* not used *//* Authentication options */	else if( !strcmp( option, "max_password_guesses" ) )		; /* not used *//* File options */	else if( !strcmp( option, "file_display_dir" ) )		; /* not used *//* Image options */	else if( !strcmp( option, "bProgressiveImageDisplay" ) ) 		; /* not used */	else if( !strcmp( option, "quantize_jpegs" ) ) 		; /* not used */	else if( !strcmp( option, "concurrent_decodes" ) ) 		; /* not used *//* Print options */	else if( !strcmp( option, "Print_Header_Font" ) ) 		; /* not used */	else if( !strcmp( option, "Print_Header_Font_Size" ) ) 		; /* not used */	else if( !strcmp( option, "Print_Left_Header_String" ) ) 		; /* not used */	else if( !strcmp( option, "Print_Right_Header_String" ) ) 		; /* not used */	else if( !strcmp( option, "Print_Left_Footer_String" ) ) 		; /* not used */	else if( !strcmp( option, "Print_Right_Footer_String" ) ) 		; /* not used *//* Miscellaneous options */	else if( !strcmp( option, "Global_History_File" ) ) 		; /* not used */	else if( !strcmp( option, "IBeam_Cursor" ) ) 		; /* not used */	else if( !strcmp( option, "Image_Cache_Size_KB" ) ) 		; /* not used */	else if( !strcmp( option, "ImageMap_Cursor" ) ) 		; /* not used */	else if( !strcmp( option, "ImageMap_Cursor_NoLink" ) ) 		; /* not used */	else if( !strcmp( option, "Link_Cursor" ) ) 		; /* not used */	else if( !strcmp( option, "LinkWait_Cursor" ) ) 		; /* not used */	else if( !strcmp( option, "Normal_Cursor" ) ) 		; /* not used */	else if( !strcmp( option, "NormalWait_Cursor" ) ) 		; /* not used */	else if( !strcmp( option, "Page_Cache_Size" ) ) 		; /* not used */	else if( !strcmp( option, "Safe_Memory_Free" ) ) 		; /* not used */	else if( !strcmp( option, "Site_History_Length" ) ) 		; /* not used */	else if( !strcmp( option, "Show_Server_Errors" ) ) 		; /* not used */	else if( !strcmp( option, "Use_Anti_Alias" ) ) 		; /* not used */	else if( !strcmp( option, "Use_Explicit_Accept_Headers" ) ) 		; /* not used */	else if( !strcmp( option, "Visitation_Horizon" ) ) 		; /* not used */	}