Bug #22337. Make it possible to install private colormap on 8 bit displays. r=pavlov,s=brendan,a=asa

git-svn-id: svn://10.0.0.236/branches/MOZILLA_1_0_BRANCH@121241 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
blizzard%redhat.com
2002-05-10 02:07:00 +00:00
parent 682e0c7c38
commit 052d83d570
3 changed files with 8 additions and 41 deletions

View File

@@ -46,8 +46,6 @@ pref("browser.display.screen_resolution", 0); // System setting
pref("browser.startup.license_accepted", "");
pref("browser.cache.memory.capacity", 4096);
pref("browser.cache.disk.capacity", 50000);
pref("browser.ncols", 0);
pref("browser.installcmap", false);
pref("browser.drag_out_of_frame_style", 1);
pref("mail.signature_file", "~/.signature");
pref("mail.default_fcc", "~/nsmail/Sent");

View File

@@ -185,44 +185,6 @@ static void event_processor_callback(gpointer data,
}
#define PREF_NCOLS "browser.ncols"
#define PREF_INSTALLCMAP "browser.installcmap"
static void
HandleColormapPrefs( void )
{
PRInt32 ivalue = 0;
PRBool bvalue;
nsresult rv;
/* The default is to do nothing. INSTALLCMAP has precedence over
NCOLS. Ignore the fact we can't do this if it fails, as it is
not critical */
nsCOMPtr<nsIPref> prefs = do_GetService(kPrefServiceCID, &rv);
if (NS_FAILED(rv) || (!prefs))
return;
/* first check ncols */
rv = prefs->GetIntPref(PREF_NCOLS, &ivalue);
if (NS_SUCCEEDED(rv) && ivalue >= 0 && ivalue <= 255 ) {
if ( ivalue > 6*6*6 ) // workaround for old GdkRGB's
ivalue = 6*6*6;
gdk_rgb_set_min_colors( ivalue );
return;
}
/* next check installcmap */
rv = prefs->GetBoolPref(PREF_INSTALLCMAP, &bvalue);
if (NS_SUCCEEDED(rv)) {
if ( PR_TRUE == bvalue )
gdk_rgb_set_install( TRUE ); // force it
else
gdk_rgb_set_min_colors( 0 );
}
}
//-------------------------------------------------------------------------
//
// Create the application shell
@@ -255,6 +217,13 @@ NS_IMETHODIMP nsAppShell::Create(int *bac, char **bav)
argv = bav;
}
nsXPIDLCString cmdResult;
rv = cmdLineArgs->GetCmdLineValue("-install", getter_Copies(cmdResult));
if (NS_SUCCEEDED(rv) && cmdResult) {
gdk_rgb_set_install(TRUE);
}
gtk_set_locale ();
gtk_init (&argc, &argv);
@@ -263,7 +232,6 @@ NS_IMETHODIMP nsAppShell::Create(int *bac, char **bav)
gle_init (&argc, &argv);
#endif
HandleColormapPrefs();
gdk_rgb_init();
return NS_OK;

View File

@@ -1496,6 +1496,7 @@ static void DumpHelp(char *appname)
printf("%s--gtk-debug=FLAGS%sGtk+ debugging flags to set\n", HELP_SPACER_1, HELP_SPACER_2);
printf("%s--gtk-no-debug=FLAGS%sGtk+ debugging flags to unset\n", HELP_SPACER_1, HELP_SPACER_2);
printf("%s--gtk-module=MODULE%sLoad an additional Gtk module\n", HELP_SPACER_1, HELP_SPACER_2);
printf("%s-install%sInstall a private colormap\n", HELP_SPACER_1, HELP_SPACER_2);
/* end gtk toolkit options */
#endif /* MOZ_WIDGET_GTK */