- si->fading_possible_p = found_any_writable_cells;
-}
-
-
-/* Populate `saver_preferences' with the contents of the resource database.
- Note that this may be called multiple times -- it is re-run each time
- the ~/.xscreensaver file is reloaded.
-
- This function can be very noisy, since it issues resource syntax errors
- and so on.
- */
-void
-get_resources (saver_info *si)
-{
- char *s;
- saver_preferences *p = &si->prefs;
-
- if (si->init_file_date == 0)
- /* The date will be 0 the first time this is called; and when this is
- called subsequent times, the file will have already been reloaded. */
- read_init_file (si);
-
- p->xsync_p = get_boolean_resource ("synchronous", "Synchronous");
- if (p->xsync_p)
- XSynchronize(si->dpy, True);
-
- p->verbose_p = get_boolean_resource ("verbose", "Boolean");
- p->timestamp_p = get_boolean_resource ("timestamp", "Boolean");
- p->lock_p = get_boolean_resource ("lock", "Boolean");
- p->lock_vt_p = get_boolean_resource ("lockVTs", "Boolean");
- p->fade_p = get_boolean_resource ("fade", "Boolean");
- p->unfade_p = get_boolean_resource ("unfade", "Boolean");
- p->fade_seconds = 1000 * get_seconds_resource ("fadeSeconds", "Time");
- p->fade_ticks = get_integer_resource ("fadeTicks", "Integer");
- p->install_cmap_p = get_boolean_resource ("installColormap", "Boolean");
- p->nice_inferior = get_integer_resource ("nice", "Nice");
-
- p->initial_delay = 1000 * get_seconds_resource ("initialDelay", "Time");
- p->splash_duration = 1000 * get_seconds_resource ("splashDuration", "Time");
- p->timeout = 1000 * get_minutes_resource ("timeout", "Time");
- p->lock_timeout = 1000 * get_minutes_resource ("lockTimeout", "Time");
- p->cycle = 1000 * get_minutes_resource ("cycle", "Time");
- p->passwd_timeout = 1000 * get_seconds_resource ("passwdTimeout", "Time");
- p->pointer_timeout = 1000 * get_seconds_resource ("pointerPollTime", "Time");
- p->notice_events_timeout = 1000*get_seconds_resource("windowCreationTimeout",
- "Time");
- p->shell = get_string_resource ("bourneShell", "BourneShell");
-
- p->help_url = get_string_resource("helpURL", "URL");
- p->load_url_command = get_string_resource("loadURL", "LoadURL");
-
- if ((s = get_string_resource ("splash", "Boolean")))
- if (!get_boolean_resource("splash", "Boolean"))
- p->splash_duration = 0;
- if (s) free (s);
-
- if (p->verbose_p && !si->fading_possible_p && (p->fade_p || p->unfade_p))
- {
- fprintf (stderr,
- (si->nscreens == 1
- ? "%s: the screen has no PseudoColor or GrayScale visuals.\n"
- : "%s: no screens have PseudoColor or GrayScale visuals.\n"),
- blurb());
- fprintf (stderr, "%s: ignoring the request for fading/unfading.\n",
- blurb());
- }
-
- /* don't set use_xidle_extension unless it is explicitly specified */
- if ((s = get_string_resource ("xidleExtension", "Boolean")))
- p->use_xidle_extension = get_boolean_resource ("xidleExtension","Boolean");
- else
-#ifdef HAVE_XIDLE_EXTENSION /* pick a default */
- p->use_xidle_extension = True; /* if we have it, use it */
-#else /* !HAVE_XIDLE_EXTENSION */
- p->use_xidle_extension = False;
-#endif /* !HAVE_XIDLE_EXTENSION */
- if (s) free (s);
-
- /* don't set use_mit_extension unless it is explicitly specified */
- if ((s = get_string_resource ("mitSaverExtension", "Boolean")))
- p->use_mit_saver_extension = get_boolean_resource ("mitSaverExtension",
- "Boolean");
- else
-#ifdef HAVE_MIT_SAVER_EXTENSION /* pick a default */
- p->use_mit_saver_extension = False; /* Default false, because it sucks */
-#else /* !HAVE_MIT_SAVER_EXTENSION */
- p->use_mit_saver_extension = False;
-#endif /* !HAVE_MIT_SAVER_EXTENSION */
- if (s) free (s);
-
-
- /* don't set use_mit_extension unless it is explicitly specified */
- if ((s = get_string_resource ("sgiSaverExtension", "Boolean")))
- p->use_sgi_saver_extension = get_boolean_resource ("sgiSaverExtension",
- "Boolean");
- else
-#ifdef HAVE_SGI_SAVER_EXTENSION /* pick a default */
- p->use_sgi_saver_extension = True; /* if we have it, use it */
-#else /* !HAVE_SGI_SAVER_EXTENSION */
- p->use_sgi_saver_extension = False;
-#endif /* !HAVE_SGI_SAVER_EXTENSION */
- if (s) free (s);
-
-
- /* Throttle the various timeouts to reasonable values.
- */
- if (p->passwd_timeout == 0) p->passwd_timeout = 30000; /* 30 secs */
- if (p->timeout < 10000) p->timeout = 10000; /* 10 secs */
- if (p->cycle != 0 && p->cycle < 2000) p->cycle = 2000; /* 2 secs */
- if (p->pointer_timeout == 0) p->pointer_timeout = 5000; /* 5 secs */
- if (p->notice_events_timeout == 0)
- p->notice_events_timeout = 10000; /* 10 secs */
- if (p->fade_seconds == 0 || p->fade_ticks == 0)
- p->fade_p = False;
- if (! p->fade_p) p->unfade_p = False;
-
- p->watchdog_timeout = p->cycle;
- if (p->watchdog_timeout < 30000) p->watchdog_timeout = 30000; /* 30 secs */
- if (p->watchdog_timeout > 3600000) p->watchdog_timeout = 3600000; /* 1 hr */
-
- get_screenhacks (si);
-
- if (p->debug_p)
- {
- XSynchronize(si->dpy, True);
- p->xsync_p = True;
- p->verbose_p = True;
- p->timestamp_p = True;
- p->initial_delay = 0;
- }
-
- blurb_timestamp_p = p->timestamp_p;