ftp://ftp.swin.edu.au/slackware/slackware-9.1/source/xap/xscreensaver/xscreensaver...
[xscreensaver] / driver / prefs.h
1 /* xscreensaver, Copyright (c) 1993-2003 Jamie Zawinski <jwz@jwz.org>
2  *
3  * Permission to use, copy, modify, distribute, and sell this software and its
4  * documentation for any purpose is hereby granted without fee, provided that
5  * the above copyright notice appear in all copies and that both that
6  * copyright notice and this permission notice appear in supporting
7  * documentation.  No representations are made about the suitability of this
8  * software for any purpose.  It is provided "as is" without express or 
9  * implied warranty.
10  */
11
12 #ifndef __XSCREENSAVER_PREFS_H__
13 #define __XSCREENSAVER_PREFS_H__
14
15 typedef struct screenhack screenhack;
16 struct screenhack {
17   Bool enabled_p;
18   char *visual;
19   char *name;
20   char *command;
21 };
22
23 typedef enum { RANDOM_HACKS, ONE_HACK, BLANK_ONLY, DONT_BLANK } saver_mode;
24
25 typedef struct saver_preferences saver_preferences;
26
27
28 /* This structure holds all the user-specified parameters, read from the
29    command line, the resource database, or entered through a dialog box.
30  */
31 struct saver_preferences {
32
33   XrmDatabase db;               /* The resource database into which the
34                                    init file is merged, and out of which the
35                                    preferences are parsed. */
36
37   time_t init_file_date;        /* The date (from stat()) of the .xscreensaver
38                                    file the last time this process read or
39                                    wrote it. */
40
41   Bool verbose_p;               /* whether to print out lots of status info */
42   Bool timestamp_p;             /* whether to mark messages with a timestamp */
43   Bool capture_stderr_p;        /* whether to redirect stdout/stderr  */
44   Bool ignore_uninstalled_p;    /* whether to avoid displaying or complaining
45                                    about hacks that are not on $PATH */
46   Bool debug_p;                 /* pay no mind to the man behind the curtain */
47   Bool xsync_p;                 /* whether XSynchronize has been called */
48
49   Bool lock_p;                  /* whether to lock as well as save */
50   Bool lock_vt_p;               /* whether to lock VTs too, if possible */
51
52   Bool fade_p;                  /* whether to fade to black, if possible */
53   Bool unfade_p;                /* whether to fade from black, if possible */
54   Time fade_seconds;            /* how long that should take */
55   int fade_ticks;               /* how many ticks should be used */
56   Bool splash_p;                /* whether to do a splash screen at startup */
57
58   Bool install_cmap_p;          /* whether we should use our own colormap
59                                    when using the screen's default visual. */
60
61   Bool quad_p;                  /* whether to run four savers per monitor */
62
63   screenhack **screenhacks;     /* the programs to run */
64   int screenhacks_count;
65
66   saver_mode mode;              /* hack-selection mode */
67   int selected_hack;            /* in one_hack mode, this is the one */
68
69   int nice_inferior;            /* nice value for subprocs */
70   int inferior_memory_limit;    /* setrlimit(LIMIT_AS) value for subprocs */
71
72   Time initial_delay;           /* how long to sleep after launch */
73   Time splash_duration;         /* how long the splash screen stays up */
74   Time timeout;                 /* how much idle time before activation */
75   Time lock_timeout;            /* how long after activation locking starts */
76   Time cycle;                   /* how long each hack should run */
77   Time passwd_timeout;          /* how much time before pw dialog goes down */
78   Time pointer_timeout;         /* how often to check mouse position */
79   Time notice_events_timeout;   /* how long after window creation to select */
80   Time watchdog_timeout;        /* how often to re-raise and re-blank screen */
81
82   Bool dpms_enabled_p;          /* Whether to power down the monitor */
83   Time dpms_standby;            /* how long until monitor goes black */
84   Time dpms_suspend;            /* how long until monitor power-saves */
85   Time dpms_off;                /* how long until monitor powers down */
86
87   Bool grab_desktop_p;          /* These are not used by "xscreensaver" */
88   Bool grab_video_p;            /*  itself: they are used by the external */
89   Bool random_image_p;          /*  "xscreensaver-getimage" program, and set */
90   char *image_directory;        /*  by the "xscreensaver-demo" configurator. */
91
92   Bool use_xidle_extension;     /* which extension to use, if possible */
93   Bool use_mit_saver_extension;
94   Bool use_sgi_saver_extension;
95   Bool use_proc_interrupts;
96
97   char *shell;                  /* where to find /bin/sh */
98
99   char *demo_command;           /* How to enter demo mode. */
100   char *prefs_command;          /* How to edit preferences. */
101   char *help_url;               /* Where the help document resides. */
102   char *load_url_command;       /* How one loads URLs. */
103 };
104
105
106 extern void load_init_file (saver_preferences *p);
107 extern Bool init_file_changed_p (saver_preferences *p);
108 extern int write_init_file (saver_preferences *p, const char *version_string,
109                             Bool verbose_p);
110 const char *init_file_name (void);
111
112 extern screenhack *parse_screenhack (const char *line);
113 extern void free_screenhack (screenhack *hack);
114 extern char *format_hack (screenhack *hack, Bool wrap_p);
115 char *make_hack_name (const char *shell_command);
116
117 /* From dpms.c */
118 extern void sync_server_dpms_settings (Display *dpy, Bool enabled_p,
119                                        int standby_secs, int suspend_secs,
120                                        int off_secs,
121                                        Bool verbose_p);
122
123 #endif /* __XSCREENSAVER_PREFS_H__ */