2000-07-31 20:06:12 +00:00
|
|
|
/* -*- mode: c; style: linux -*- */
|
|
|
|
|
|
|
|
/* preferences.h
|
|
|
|
* Copyright (C) 2000 Helix Code, Inc.
|
|
|
|
*
|
|
|
|
* Written by Bradford Hovinen <hovinen@helixcode.com>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2, or (at your option)
|
|
|
|
* any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
|
|
|
* 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __PREFERENCES_H
|
|
|
|
#define __PREFERENCES_H
|
|
|
|
|
|
|
|
#include <sys/time.h>
|
|
|
|
#include <gtk/gtk.h>
|
2001-12-02 04:54:32 +00:00
|
|
|
#include <libxml/tree.h>
|
2000-07-31 20:06:12 +00:00
|
|
|
|
|
|
|
enum _SelectionMode {
|
|
|
|
SM_DISABLE_SCREENSAVER,
|
|
|
|
SM_BLANK_SCREEN,
|
|
|
|
SM_ONE_SCREENSAVER_ONLY,
|
|
|
|
SM_CHOOSE_FROM_LIST,
|
|
|
|
SM_CHOOSE_RANDOMLY
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef enum _SelectionMode SelectionMode;
|
|
|
|
|
|
|
|
#define SCREENSAVER(obj) ((Screensaver *) obj)
|
|
|
|
|
|
|
|
typedef struct _Screensaver Screensaver;
|
|
|
|
|
|
|
|
struct _Screensaver
|
|
|
|
{
|
|
|
|
guint id;
|
|
|
|
gchar *name;
|
Install all pixmaps. (pixmaps_DATA): Add blank-screen.png.
2001-08-09 Richard Hestilow <hestilow@ximian.com>
* Makeflie.am (EXTRA_DIST): Install all pixmaps.
(pixmaps_DATA): Add blank-screen.png.
* pref-file.c: Replace "programs" value with a regenerated
string.
(print_aligned_row): Added.
(print_list_to_str): Added.
* preferences.h (Screensaver): Add new fields "filename",
"compat_command_line", "fakepreview", and "fakes",
to deal with the new xml storage.
(Preferences): Add new fields "savers_hash" and "invalidsavers".
* preferences.c (screensaver_list_prepend_dir): Added.
(screensaver_cmp_func): Added.
(screensaver_list_load): Added.
(preferences_new): Initialize savers_hash.
(clean_saver_list): Added.
(preferences_load): Load screensavers from xml.
(parse_arg_default): Added.
(screensaver_read_xml): Updated for the new format.
(screensaver_new_from_file): Added.
* prefs-widget.c (double_click_cb): Added.
(): Remove right click menu, add double click handler.
(model_is_cell_editable): Fix for etable bug.
(random_timeout_cb): Avoid vidwhacker and webcollage.
* preview.c: Optionally show fakepreview if set, and
deal with compat_command_line, and refresh pixbufs.
(command_exists): Renamed to rc_command_exists.
* rc-parse.c: (parse_screensaver_list): Merely update
the existing entries, via the provided hash.
* screensaver-prefs-dialog.c (get_argument_data): Just
find the xml file using ::filename.
* screensavers/magic.pl.in: Added.
* screensavers/Makefile.am: Generate .xml.h files for translators,
and install all .xml files and .png files, and run magic.pl on
make install.
2001-08-10 03:36:17 +00:00
|
|
|
gchar *filename;
|
2000-07-31 20:06:12 +00:00
|
|
|
gchar *label;
|
|
|
|
gchar *description;
|
|
|
|
gchar *command_line;
|
Install all pixmaps. (pixmaps_DATA): Add blank-screen.png.
2001-08-09 Richard Hestilow <hestilow@ximian.com>
* Makeflie.am (EXTRA_DIST): Install all pixmaps.
(pixmaps_DATA): Add blank-screen.png.
* pref-file.c: Replace "programs" value with a regenerated
string.
(print_aligned_row): Added.
(print_list_to_str): Added.
* preferences.h (Screensaver): Add new fields "filename",
"compat_command_line", "fakepreview", and "fakes",
to deal with the new xml storage.
(Preferences): Add new fields "savers_hash" and "invalidsavers".
* preferences.c (screensaver_list_prepend_dir): Added.
(screensaver_cmp_func): Added.
(screensaver_list_load): Added.
(preferences_new): Initialize savers_hash.
(clean_saver_list): Added.
(preferences_load): Load screensavers from xml.
(parse_arg_default): Added.
(screensaver_read_xml): Updated for the new format.
(screensaver_new_from_file): Added.
* prefs-widget.c (double_click_cb): Added.
(): Remove right click menu, add double click handler.
(model_is_cell_editable): Fix for etable bug.
(random_timeout_cb): Avoid vidwhacker and webcollage.
* preview.c: Optionally show fakepreview if set, and
deal with compat_command_line, and refresh pixbufs.
(command_exists): Renamed to rc_command_exists.
* rc-parse.c: (parse_screensaver_list): Merely update
the existing entries, via the provided hash.
* screensaver-prefs-dialog.c (get_argument_data): Just
find the xml file using ::filename.
* screensavers/magic.pl.in: Added.
* screensavers/Makefile.am: Generate .xml.h files for translators,
and install all .xml files and .png files, and run magic.pl on
make install.
2001-08-10 03:36:17 +00:00
|
|
|
gchar *compat_command_line;
|
2000-07-31 20:06:12 +00:00
|
|
|
gchar *visual;
|
|
|
|
gboolean enabled;
|
|
|
|
GList *link;
|
Install all pixmaps. (pixmaps_DATA): Add blank-screen.png.
2001-08-09 Richard Hestilow <hestilow@ximian.com>
* Makeflie.am (EXTRA_DIST): Install all pixmaps.
(pixmaps_DATA): Add blank-screen.png.
* pref-file.c: Replace "programs" value with a regenerated
string.
(print_aligned_row): Added.
(print_list_to_str): Added.
* preferences.h (Screensaver): Add new fields "filename",
"compat_command_line", "fakepreview", and "fakes",
to deal with the new xml storage.
(Preferences): Add new fields "savers_hash" and "invalidsavers".
* preferences.c (screensaver_list_prepend_dir): Added.
(screensaver_cmp_func): Added.
(screensaver_list_load): Added.
(preferences_new): Initialize savers_hash.
(clean_saver_list): Added.
(preferences_load): Load screensavers from xml.
(parse_arg_default): Added.
(screensaver_read_xml): Updated for the new format.
(screensaver_new_from_file): Added.
* prefs-widget.c (double_click_cb): Added.
(): Remove right click menu, add double click handler.
(model_is_cell_editable): Fix for etable bug.
(random_timeout_cb): Avoid vidwhacker and webcollage.
* preview.c: Optionally show fakepreview if set, and
deal with compat_command_line, and refresh pixbufs.
(command_exists): Renamed to rc_command_exists.
* rc-parse.c: (parse_screensaver_list): Merely update
the existing entries, via the provided hash.
* screensaver-prefs-dialog.c (get_argument_data): Just
find the xml file using ::filename.
* screensavers/magic.pl.in: Added.
* screensavers/Makefile.am: Generate .xml.h files for translators,
and install all .xml files and .png files, and run magic.pl on
make install.
2001-08-10 03:36:17 +00:00
|
|
|
|
|
|
|
gchar *fakepreview;
|
|
|
|
GList *fakes;
|
2000-07-31 20:06:12 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct _Preferences
|
|
|
|
{
|
|
|
|
time_t init_file_date;
|
|
|
|
|
|
|
|
gboolean verbose;
|
|
|
|
gboolean lock;
|
|
|
|
|
|
|
|
gboolean fade;
|
|
|
|
gboolean unfade;
|
|
|
|
time_t fade_seconds;
|
|
|
|
guint fade_ticks;
|
|
|
|
|
|
|
|
gboolean install_colormap;
|
|
|
|
|
|
|
|
gint nice;
|
|
|
|
|
|
|
|
gdouble timeout;
|
|
|
|
gdouble lock_timeout;
|
|
|
|
gdouble cycle;
|
|
|
|
|
|
|
|
gchar *programs_list; /* Programs resource, in JWZ's format */
|
|
|
|
|
|
|
|
SelectionMode selection_mode;
|
|
|
|
|
|
|
|
GList *screensavers;
|
Install all pixmaps. (pixmaps_DATA): Add blank-screen.png.
2001-08-09 Richard Hestilow <hestilow@ximian.com>
* Makeflie.am (EXTRA_DIST): Install all pixmaps.
(pixmaps_DATA): Add blank-screen.png.
* pref-file.c: Replace "programs" value with a regenerated
string.
(print_aligned_row): Added.
(print_list_to_str): Added.
* preferences.h (Screensaver): Add new fields "filename",
"compat_command_line", "fakepreview", and "fakes",
to deal with the new xml storage.
(Preferences): Add new fields "savers_hash" and "invalidsavers".
* preferences.c (screensaver_list_prepend_dir): Added.
(screensaver_cmp_func): Added.
(screensaver_list_load): Added.
(preferences_new): Initialize savers_hash.
(clean_saver_list): Added.
(preferences_load): Load screensavers from xml.
(parse_arg_default): Added.
(screensaver_read_xml): Updated for the new format.
(screensaver_new_from_file): Added.
* prefs-widget.c (double_click_cb): Added.
(): Remove right click menu, add double click handler.
(model_is_cell_editable): Fix for etable bug.
(random_timeout_cb): Avoid vidwhacker and webcollage.
* preview.c: Optionally show fakepreview if set, and
deal with compat_command_line, and refresh pixbufs.
(command_exists): Renamed to rc_command_exists.
* rc-parse.c: (parse_screensaver_list): Merely update
the existing entries, via the provided hash.
* screensaver-prefs-dialog.c (get_argument_data): Just
find the xml file using ::filename.
* screensavers/magic.pl.in: Added.
* screensavers/Makefile.am: Generate .xml.h files for translators,
and install all .xml files and .png files, and run magic.pl on
make install.
2001-08-10 03:36:17 +00:00
|
|
|
GHashTable *savers_hash;
|
2000-07-31 20:06:12 +00:00
|
|
|
|
2001-04-25 01:00:46 +00:00
|
|
|
gint frozen; /* TRUE if we shouldn't reflect
|
2000-07-31 20:06:12 +00:00
|
|
|
* preference changes in capplet */
|
|
|
|
GTree *config_db; /* key-value database of config options */
|
|
|
|
|
Install all pixmaps. (pixmaps_DATA): Add blank-screen.png.
2001-08-09 Richard Hestilow <hestilow@ximian.com>
* Makeflie.am (EXTRA_DIST): Install all pixmaps.
(pixmaps_DATA): Add blank-screen.png.
* pref-file.c: Replace "programs" value with a regenerated
string.
(print_aligned_row): Added.
(print_list_to_str): Added.
* preferences.h (Screensaver): Add new fields "filename",
"compat_command_line", "fakepreview", and "fakes",
to deal with the new xml storage.
(Preferences): Add new fields "savers_hash" and "invalidsavers".
* preferences.c (screensaver_list_prepend_dir): Added.
(screensaver_cmp_func): Added.
(screensaver_list_load): Added.
(preferences_new): Initialize savers_hash.
(clean_saver_list): Added.
(preferences_load): Load screensavers from xml.
(parse_arg_default): Added.
(screensaver_read_xml): Updated for the new format.
(screensaver_new_from_file): Added.
* prefs-widget.c (double_click_cb): Added.
(): Remove right click menu, add double click handler.
(model_is_cell_editable): Fix for etable bug.
(random_timeout_cb): Avoid vidwhacker and webcollage.
* preview.c: Optionally show fakepreview if set, and
deal with compat_command_line, and refresh pixbufs.
(command_exists): Renamed to rc_command_exists.
* rc-parse.c: (parse_screensaver_list): Merely update
the existing entries, via the provided hash.
* screensaver-prefs-dialog.c (get_argument_data): Just
find the xml file using ::filename.
* screensavers/magic.pl.in: Added.
* screensavers/Makefile.am: Generate .xml.h files for translators,
and install all .xml files and .png files, and run magic.pl on
make install.
2001-08-10 03:36:17 +00:00
|
|
|
GList *invalidsavers;
|
|
|
|
|
2000-07-31 20:06:12 +00:00
|
|
|
/* Settings that are not stored in .xscreensaver ... */
|
|
|
|
|
|
|
|
gboolean power_management;
|
|
|
|
time_t standby_time;
|
|
|
|
time_t suspend_time;
|
|
|
|
time_t power_down_time;
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct _Preferences Preferences;
|
|
|
|
|
|
|
|
Preferences *preferences_new (void);
|
2001-05-06 17:33:27 +00:00
|
|
|
Preferences *preferences_clone (Preferences *prefs);
|
2000-07-31 20:06:12 +00:00
|
|
|
void preferences_destroy (Preferences *prefs);
|
|
|
|
|
|
|
|
void preferences_load (Preferences *prefs);
|
|
|
|
void preferences_save (Preferences *prefs);
|
|
|
|
|
2000-08-16 22:40:02 +00:00
|
|
|
Preferences *preferences_read_xml (xmlDocPtr xml_doc);
|
|
|
|
xmlDocPtr preferences_write_xml (Preferences *prefs);
|
|
|
|
|
2000-07-31 20:06:12 +00:00
|
|
|
Screensaver *screensaver_new (void);
|
Install all pixmaps. (pixmaps_DATA): Add blank-screen.png.
2001-08-09 Richard Hestilow <hestilow@ximian.com>
* Makeflie.am (EXTRA_DIST): Install all pixmaps.
(pixmaps_DATA): Add blank-screen.png.
* pref-file.c: Replace "programs" value with a regenerated
string.
(print_aligned_row): Added.
(print_list_to_str): Added.
* preferences.h (Screensaver): Add new fields "filename",
"compat_command_line", "fakepreview", and "fakes",
to deal with the new xml storage.
(Preferences): Add new fields "savers_hash" and "invalidsavers".
* preferences.c (screensaver_list_prepend_dir): Added.
(screensaver_cmp_func): Added.
(screensaver_list_load): Added.
(preferences_new): Initialize savers_hash.
(clean_saver_list): Added.
(preferences_load): Load screensavers from xml.
(parse_arg_default): Added.
(screensaver_read_xml): Updated for the new format.
(screensaver_new_from_file): Added.
* prefs-widget.c (double_click_cb): Added.
(): Remove right click menu, add double click handler.
(model_is_cell_editable): Fix for etable bug.
(random_timeout_cb): Avoid vidwhacker and webcollage.
* preview.c: Optionally show fakepreview if set, and
deal with compat_command_line, and refresh pixbufs.
(command_exists): Renamed to rc_command_exists.
* rc-parse.c: (parse_screensaver_list): Merely update
the existing entries, via the provided hash.
* screensaver-prefs-dialog.c (get_argument_data): Just
find the xml file using ::filename.
* screensavers/magic.pl.in: Added.
* screensavers/Makefile.am: Generate .xml.h files for translators,
and install all .xml files and .png files, and run magic.pl on
make install.
2001-08-10 03:36:17 +00:00
|
|
|
Screensaver *screensaver_new_from_file (const gchar *filename);
|
2000-07-31 20:06:12 +00:00
|
|
|
void screensaver_destroy (Screensaver *saver);
|
|
|
|
|
|
|
|
GList *screensaver_add (Screensaver *saver, GList *screensavers);
|
|
|
|
GList *screensaver_remove (Screensaver *saver, GList *screensavers);
|
|
|
|
|
2000-08-16 22:40:02 +00:00
|
|
|
Screensaver *screensaver_read_xml (xmlNodePtr node);
|
|
|
|
xmlNodePtr screensaver_write_xml (Screensaver *saver);
|
|
|
|
|
2000-07-31 20:06:12 +00:00
|
|
|
char *screensaver_get_desc (Screensaver *saver);
|
|
|
|
|
2000-08-07 16:04:33 +00:00
|
|
|
char *screensaver_get_label (gchar *name);
|
|
|
|
|
2000-07-31 20:06:12 +00:00
|
|
|
#endif /* __PREFERENCES_H */
|