+
+
+ /* =======================================================================
+ blanking
+ ======================================================================= */
+
+ Bool screen_blanked_p; /* Whether the saver is currently active. */
+ Window mouse_grab_window; /* Window holding our mouse grab */
+ Window keyboard_grab_window; /* Window holding our keyboard grab */
+ Bool fading_possible_p; /* Whether fading to/from black is possible. */
+
+
+ /* =======================================================================
+ locking and runtime privileges
+ ======================================================================= */
+
+ Bool locked_p; /* Whether the screen is currently locked. */
+ Bool dbox_up_p; /* Whether the demo-mode or passwd dialogs
+ are currently visible */
+
+ Bool locking_disabled_p; /* Sometimes locking is impossible. */
+ char *nolock_reason; /* This is why. */
+
+ char *orig_uid; /* What uid/gid we had at startup, before
+ discarding privileges. */
+ char *uid_message; /* Any diagnostics from our attempt to
+ discard privileges (printed only in
+ -verbose mode.) */
+ Bool dangerous_uid_p; /* Set to true if we're running as a user id
+ which is known to not be a normal, non-
+ privileged user. */
+
+ Window passwd_dialog; /* The password dialog, if its up. */
+ passwd_dialog_data *pw_data; /* Other info necessary to draw it. */
+
+
+ /* =======================================================================
+ demoing
+ ======================================================================= */
+
+ Bool demo_mode_p; /* Whether demo-mode is active */
+ char *demo_hack; /* The hack that has been selected from the
+ dialog box, which should be run next. */
+
+ Window splash_dialog; /* The splash dialog, if its up. */
+ splash_dialog_data *sp_data; /* Other info necessary to draw it. */
+
+
+ /* =======================================================================
+ timers
+ ======================================================================= */
+
+ XtIntervalId lock_id; /* Timer to implement `prefs.lock_timeout' */
+ XtIntervalId cycle_id; /* Timer to implement `prefs.cycle' */
+ XtIntervalId timer_id; /* Timer to implement `prefs.timeout' */
+ XtIntervalId watchdog_id; /* Timer to implement `prefs.watchdog */
+ XtIntervalId check_pointer_timer_id; /* `prefs.pointer_timeout' */
+
+ time_t last_activity_time; /* Used only when no server exts. */
+ saver_screen_info *last_activity_screen;
+
+
+ /* =======================================================================
+ remote control
+ ======================================================================= */
+
+ int selection_mode; /* Set to -1 if the NEXT ClientMessage has just
+ been received; set to -2 if PREV has just
+ been received; set to N if SELECT has
+ been received. (This is kind of nasty.) */
+
+ /* =======================================================================
+ subprocs
+ ======================================================================= */
+
+ XtIntervalId stderr_popup_timer;
+
+};
+
+
+/* This structure holds all the data that applies to the screen-specific parts
+ of the display connection; if the display has multiple screens, there will
+ be one of these for each screen.
+ */
+struct saver_screen_info {
+ saver_info *global;
+
+ Screen *screen;
+ Widget toplevel_shell;
+
+ /* =======================================================================
+ blanking
+ ======================================================================= */
+
+ Window screensaver_window; /* The window that will impersonate the root,
+ when the screensaver activates. Note that
+ the window stored here may change, as we
+ destroy and recreate it on different
+ visuals. */
+ Colormap cmap; /* The colormap that goes with the window. */
+ Bool install_cmap_p; /* whether we should use our own colormap.
+ This can be overridden on a per-hack basis.
+ */
+ Visual *current_visual; /* The visual of the window. */
+ Visual *default_visual; /* visual to use when none other specified */
+ int current_depth; /* How deep the visual (and the window) are. */
+
+ Window real_vroot; /* The original virtual-root window. */
+ Window real_vroot_value; /* What was in the __SWM_VROOT property. */
+
+ Cursor cursor; /* A blank cursor that goes with the
+ real root window. */
+ unsigned long black_pixel; /* Black, allocated from `cmap'. */
+
+# ifdef HAVE_MIT_SAVER_EXTENSION
+ Window server_mit_saver_window;
+# endif
+
+
+ /* =======================================================================
+ demoing
+ ======================================================================= */
+
+ Colormap demo_cmap; /* The colormap that goes with the dialogs:
+ this might be the same as `cmap' so care
+ must be taken not to free it while it's
+ still in use. */
+
+ /* =======================================================================
+ timers
+ ======================================================================= */
+
+ int poll_mouse_last_root_x; /* Used only when no server exts. */
+ int poll_mouse_last_root_y;
+ Window poll_mouse_last_child;
+ unsigned int poll_mouse_last_mask;
+
+
+ /* =======================================================================
+ subprocs
+ ======================================================================= */
+
+ int current_hack; /* Index into `prefs.screenhacks' */
+ pid_t pid;
+
+ int stderr_text_x;
+ int stderr_text_y;
+ int stderr_line_height;
+ XFontStruct *stderr_font;
+ GC stderr_gc;
+ Window stderr_overlay_window; /* Used if the server has overlay planes */
+ Colormap stderr_cmap;
+};
+
+
+\f
+
+/* =======================================================================
+ server extensions and virtual roots
+ ======================================================================= */
+
+extern void restore_real_vroot (saver_info *si);
+extern void disable_builtin_screensaver (saver_info *si, Bool turn_off_p);
+extern Bool ensure_no_screensaver_running (Display *, Screen *);
+
+#ifdef HAVE_MIT_SAVER_EXTENSION
+extern Bool query_mit_saver_extension (saver_info *);
+#endif
+#ifdef HAVE_SGI_SAVER_EXTENSION
+extern Bool query_sgi_saver_extension (saver_info *);
+#endif
+
+/* Display Power Management System (DPMS) interface. */
+extern Bool monitor_powered_on_p (saver_info *si);
+extern void monitor_power_on (saver_info *si);
+
+
+/* =======================================================================
+ blanking
+ ======================================================================= */
+
+extern void initialize_screensaver_window (saver_info *si);
+extern void raise_window (saver_info *si,
+ Bool inhibit_fade, Bool between_hacks_p,
+ Bool dont_clear);
+extern void blank_screen (saver_info *si);
+extern void unblank_screen (saver_info *si);
+extern void grab_keyboard_and_mouse (saver_info *si, Window, Cursor);
+extern void ungrab_keyboard_and_mouse (saver_info *si);
+
+/* =======================================================================
+ locking
+ ======================================================================= */
+
+#ifndef NO_LOCKING
+extern Bool unlock_p (saver_info *si);
+extern Bool lock_init (int argc, char **argv);
+extern Bool passwd_valid_p (const char *typed_passwd);
+
+extern void make_passwd_window (saver_info *si);
+extern void draw_passwd_window (saver_info *si);
+extern void update_passwd_window (saver_info *si, const char *printed_passwd,
+ float ratio);
+extern void destroy_passwd_window (saver_info *si);
+
+#endif /* NO_LOCKING */
+
+/* =======================================================================
+ runtime privileges
+ ======================================================================= */
+
+extern void hack_uid (saver_info *si);
+extern void describe_uids (saver_info *si, FILE *out);
+
+/* =======================================================================
+ demoing
+ ======================================================================= */
+
+extern void draw_shaded_rectangle (Display *dpy, Window window,
+ int x, int y,
+ int width, int height,
+ int thickness,
+ unsigned long top_color,
+ unsigned long bottom_color);
+extern int string_width (XFontStruct *font, char *s);
+
+
+#ifndef NO_DEMO_MODE
+extern void demo_mode (saver_info *si);
+extern void demo_mode_restart_process (saver_info *si);
+extern void create_demo_dialog (Widget, Visual *, Colormap);
+extern void create_resources_dialog (Widget, Visual *, Colormap);