ftp://ftp.krokus.ru/pub/OpenBSD/distfiles/xscreensaver-4.21.tar.gz
[xscreensaver] / driver / prefs.h
1 /* xscreensaver, Copyright (c) 1993-2005 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 {
24   RANDOM_HACKS, ONE_HACK, BLANK_ONLY, DONT_BLANK, RANDOM_HACKS_SAME
25 } saver_mode;
26
27 typedef enum {
28   TEXT_DATE, TEXT_LITERAL, TEXT_FILE, TEXT_PROGRAM, TEXT_URL
29 } text_mode;
30
31 typedef struct saver_preferences saver_preferences;
32
33
34 /* This structure holds all the user-specified parameters, read from the
35    command line, the resource database, or entered through a dialog box.
36  */
37 struct saver_preferences {
38
39   XrmDatabase db;               /* The resource database into which the
40                                    init file is merged, and out of which the
41                                    preferences are parsed. */
42
43   time_t init_file_date;        /* The date (from stat()) of the .xscreensaver
44                                    file the last time this process read or
45                                    wrote it. */
46
47   Bool verbose_p;               /* whether to print out lots of status info */
48   Bool timestamp_p;             /* whether to mark messages with a timestamp */
49   Bool capture_stderr_p;        /* whether to redirect stdout/stderr  */
50   Bool ignore_uninstalled_p;    /* whether to avoid displaying or complaining
51                                    about hacks that are not on $PATH */
52   Bool debug_p;                 /* pay no mind to the man behind the curtain */
53   Bool xsync_p;                 /* whether XSynchronize has been called */
54
55   Bool lock_p;                  /* whether to lock as well as save */
56   Bool lock_vt_p;               /* whether to lock VTs too, if possible */
57
58   Bool fade_p;                  /* whether to fade to black, if possible */
59   Bool unfade_p;                /* whether to fade from black, if possible */
60   Time fade_seconds;            /* how long that should take */
61   int fade_ticks;               /* how many ticks should be used */
62   Bool splash_p;                /* whether to do a splash screen at startup */
63
64   Bool install_cmap_p;          /* whether we should use our own colormap
65                                    when using the screen's default visual. */
66
67   Bool quad_p;                  /* whether to run four savers per monitor */
68
69   screenhack **screenhacks;     /* the programs to run */
70   int screenhacks_count;
71
72   saver_mode mode;              /* hack-selection mode */
73   int selected_hack;            /* in one_hack mode, this is the one */
74
75   int nice_inferior;            /* nice value for subprocs */
76   int inferior_memory_limit;    /* setrlimit(LIMIT_AS) value for subprocs */
77
78   Time initial_delay;           /* how long to sleep after launch */
79   Time splash_duration;         /* how long the splash screen stays up */
80   Time timeout;                 /* how much idle time before activation */
81   Time lock_timeout;            /* how long after activation locking starts */
82   Time cycle;                   /* how long each hack should run */
83   Time passwd_timeout;          /* how much time before pw dialog goes down */
84   Time pointer_timeout;         /* how often to check mouse position */
85   Time notice_events_timeout;   /* how long after window creation to select */
86   Time watchdog_timeout;        /* how often to re-raise and re-blank screen */
87   int pointer_hysteresis;       /* mouse motions less than N/sec are ignored */
88
89   Bool dpms_enabled_p;          /* Whether to power down the monitor */
90   Time dpms_standby;            /* how long until monitor goes black */
91   Time dpms_suspend;            /* how long until monitor power-saves */
92   Time dpms_off;                /* how long until monitor powers down */
93
94   Bool grab_desktop_p;          /* These are not used by "xscreensaver" */
95   Bool grab_video_p;            /*  itself: they are used by the external */
96   Bool random_image_p;          /*  "xscreensaver-getimage" program, and set */
97   char *image_directory;        /*  by the "xscreensaver-demo" configurator. */
98
99   text_mode tmode;              /* How we generate text to display. */
100   char *text_literal;           /* used when tmode is TEXT_LITERAL. */
101   char *text_file;              /* used when tmode is TEXT_FILE.    */
102   char *text_program;           /* used when tmode is TEXT_PROGRAM. */
103   char *text_url;               /* used when tmode is TEXT_URL.     */
104
105   Bool use_xidle_extension;     /* which extension to use, if possible */
106   Bool use_mit_saver_extension;
107   Bool use_sgi_saver_extension;
108   Bool use_proc_interrupts;
109
110   Bool getviewport_full_of_lies_p; /* XFree86 bug #421 */
111
112   char *shell;                  /* where to find /bin/sh */
113
114   char *demo_command;           /* How to enter demo mode. */
115   char *prefs_command;          /* How to edit preferences. */
116   char *help_url;               /* Where the help document resides. */
117   char *load_url_command;       /* How one loads URLs. */
118   char *new_login_command;      /* Command for the "New Login" button. */
119 };
120
121
122 extern void load_init_file (saver_preferences *p);
123 extern Bool init_file_changed_p (saver_preferences *p);
124 extern int write_init_file (saver_preferences *p, const char *version_string,
125                             Bool verbose_p);
126 const char *init_file_name (void);
127
128 extern screenhack *parse_screenhack (const char *line);
129 extern void free_screenhack (screenhack *hack);
130 extern char *format_hack (screenhack *hack, Bool wrap_p);
131 char *make_hack_name (const char *shell_command);
132
133 /* From dpms.c */
134 extern void sync_server_dpms_settings (Display *dpy, Bool enabled_p,
135                                        int standby_secs, int suspend_secs,
136                                        int off_secs,
137                                        Bool verbose_p);
138
139 #endif /* __XSCREENSAVER_PREFS_H__ */