summaryrefslogtreecommitdiff
path: root/gnome-settings-daemon
diff options
context:
space:
mode:
Diffstat (limited to 'gnome-settings-daemon')
-rw-r--r--gnome-settings-daemon/.cvsignore8
-rw-r--r--gnome-settings-daemon/ChangeLog717
-rw-r--r--gnome-settings-daemon/GNOME_SettingsDaemon.server.in9
-rw-r--r--gnome-settings-daemon/Makefile.am92
-rw-r--r--gnome-settings-daemon/factory.c57
-rw-r--r--gnome-settings-daemon/gnome-settings-accessibility-keyboard.c432
-rw-r--r--gnome-settings-daemon/gnome-settings-accessibility-keyboard.h32
-rw-r--r--gnome-settings-daemon/gnome-settings-background.c118
-rw-r--r--gnome-settings-daemon/gnome-settings-background.h33
-rw-r--r--gnome-settings-daemon/gnome-settings-daemon.c454
-rw-r--r--gnome-settings-daemon/gnome-settings-daemon.h74
-rw-r--r--gnome-settings-daemon/gnome-settings-default-editor.c127
-rw-r--r--gnome-settings-daemon/gnome-settings-default-editor.h18
-rw-r--r--gnome-settings-daemon/gnome-settings-font.c208
-rw-r--r--gnome-settings-daemon/gnome-settings-font.h25
-rw-r--r--gnome-settings-daemon/gnome-settings-gtk1theme.c220
-rw-r--r--gnome-settings-daemon/gnome-settings-gtk1theme.h34
-rw-r--r--gnome-settings-daemon/gnome-settings-keybindings.c434
-rw-r--r--gnome-settings-daemon/gnome-settings-keybindings.h31
-rw-r--r--gnome-settings-daemon/gnome-settings-keyboard.c157
-rw-r--r--gnome-settings-daemon/gnome-settings-keyboard.h34
-rw-r--r--gnome-settings-daemon/gnome-settings-locate-pointer.c227
-rw-r--r--gnome-settings-daemon/gnome-settings-locate-pointer.h22
-rw-r--r--gnome-settings-daemon/gnome-settings-mouse.c282
-rw-r--r--gnome-settings-daemon/gnome-settings-mouse.h25
-rw-r--r--gnome-settings-daemon/gnome-settings-screensaver.c120
-rw-r--r--gnome-settings-daemon/gnome-settings-screensaver.h33
-rw-r--r--gnome-settings-daemon/gnome-settings-sound.c191
-rw-r--r--gnome-settings-daemon/gnome-settings-sound.h33
-rw-r--r--gnome-settings-daemon/gnome-settings-typing-break.c97
-rw-r--r--gnome-settings-daemon/gnome-settings-typing-break.h25
-rw-r--r--gnome-settings-daemon/gnome-settings-xrdb.c338
-rw-r--r--gnome-settings-daemon/gnome-settings-xrdb.h33
-rw-r--r--gnome-settings-daemon/gnome-settings-xsettings.c445
-rw-r--r--gnome-settings-daemon/gnome-settings-xsettings.h33
-rw-r--r--gnome-settings-daemon/reaper.c305
-rw-r--r--gnome-settings-daemon/reaper.h64
-rw-r--r--gnome-settings-daemon/xrdb/.cvsignore2
-rw-r--r--gnome-settings-daemon/xrdb/Editres.ad6
-rw-r--r--gnome-settings-daemon/xrdb/Emacs.ad24
-rw-r--r--gnome-settings-daemon/xrdb/General.ad5
-rw-r--r--gnome-settings-daemon/xrdb/Makefile.am10
-rw-r--r--gnome-settings-daemon/xrdb/Motif.ad81
-rw-r--r--gnome-settings-daemon/xrdb/Tk.ad107
-rw-r--r--gnome-settings-daemon/xrdb/Xaw.ad41
-rw-r--r--gnome-settings-daemon/xsettings-common.c264
-rw-r--r--gnome-settings-daemon/xsettings-common.h110
-rw-r--r--gnome-settings-daemon/xsettings-manager.c424
-rw-r--r--gnome-settings-daemon/xsettings-manager.h71
49 files changed, 0 insertions, 6732 deletions
diff --git a/gnome-settings-daemon/.cvsignore b/gnome-settings-daemon/.cvsignore
deleted file mode 100644
index a8958ede6..000000000
--- a/gnome-settings-daemon/.cvsignore
+++ /dev/null
@@ -1,8 +0,0 @@
-Makefile
-Makefile.in
-gnome-settings-daemon
-GNOME_SettingsDaemon-common.c
-GNOME_SettingsDaemon-skels.c
-GNOME_SettingsDaemon-stubs.c
-GNOME_SettingsDaemon.h
-GNOME_SettingsDaemon.server
diff --git a/gnome-settings-daemon/ChangeLog b/gnome-settings-daemon/ChangeLog
deleted file mode 100644
index 20794c965..000000000
--- a/gnome-settings-daemon/ChangeLog
+++ /dev/null
@@ -1,717 +0,0 @@
-2003-10-28 Jody Goldberg <jody@gnome.org>
-
- * Release 2.5.0
-
-Fri Aug 1 14:51:02 2003 Jonathan Blandford <jrb@redhat.com>
-
- * gnome-settings-mouse.c (set_locate_pointer): move declarations
- around. Patch from Damien Carbery <damien.carbery@sun.com>,
- #118860
-
-Thu Jul 31 14:22:38 2003 Jonathan Blandford <jrb@redhat.com>
-
- * gnome-settings-xsettings.c (translate_string_string_toolbar):
- Patch from Anders Carlsson to special case "both-horiz".
-
-Thu Jul 31 14:06:51 2003 Jonathan Blandford <jrb@redhat.com>
-
- * gnome-settings-mouse.c: Patch from Satyajit Kanungo
- <satyajit.kanungo@wipro.com> to make locate pointer work in
- a multi-screen environment.
-
-2003-07-17 Richard Hult <richard@imendio.com>
-
- * gnome-settings-typing-break.c (setup_typing_break): Start with
- -n to avoid the warning about notification area.
- (gnome_settings_typing_break_init): Fix a warning.
-
-2003-07-07 Jody Goldberg <jody@gnome.org>
-
- * Release 2.3.4
-
-2003-07-03 Bastien Nocera <hadess@hadess.net>
-
- * gnome-settings-keybindings.c: (get_screens_list),
- (screen_exec_display_string), (grab_key), (do_grab),
- (gnome_settings_keybindings_load): grab keys on all the screens for the
- current display
-
-Thu Jun 26 07:37:20 2003 Jonathan Blandford <jrb@gnome.org>
-
- * gnome-settings-typing-break.c: new module to handle the
- typing-break-monitor.
-
-2003-06-24 Jody Goldberg <jody@gnome.org>
-
- * Release 2.3.3
-
-2003-06-12 Michael Meeks <michael@ximian.com>
-
- * Makefile.am: Make IDL compile depend on compiler too.
-
-Mon Jun 2 13:23:25 2003 Jonathan Blandford <jrb@redhat.com>
-
- * gnome-settings-xrdb.c (append_xresources): Patch from Jens
- Granseuer <jensgr@gmx.net> to fix on non-C99 compilers.
-
-2003-05-07 Jody Goldberg <jody@gnome.org>
-
- * Release 2.3.1
-
-2003-05-07 Jody Goldberg <jody@gnome.org>
-
- * xrdb/Makefile.am (EXTRA_DIST) : EXTRA_DIST the data files
-
-2003-05-02 Ross Burton <ross@burtonini.com>
-
- * gnome-settings-xrdb.c (scan_for_files):
- If ~/.gnome2/xrdb doesn't exist, don't stop.
-
- * xrdb/.cvsignore:
- Added.
-
-2003-05-02 Ross Burton <ross@burtonini.com>
-
- * xrdb/Makefile.am (xrdbdir):
- $(datadir) is lowercase not uppercase! :(
-
-2003-05-01 Ross Burton <ross@burtonini.com>
-
- * gnome-settings-xrdb.[ch]:
- Using the current GTK+ theme as a base for colours, set a bunch of
- properties in the X resource database. And as if by magic, legacy
- apps (Xaw, Tk, Motif) match GNOME!
-
- * xrdb/*.ad:
- Data files for above.
-
-Thu Feb 6 16:43:33 2003 Jonathan Blandford <jrb@redhat.com>
-
- * gnome-settings-font.c (load_xcursor_theme): handle xcursor so
- that we support Xcursor files.
-
- * gnome-settings-daemon.c: move
- gnome_settings_daemon_spawn_with_input here so multiple modules
- can use it.
-
-Tue Feb 4 17:09:18 2003 Jonathan Blandford <jrb@redhat.com>
-
- * Release 2.2.0.1
-
-Tue Jan 21 01:15:14 2003 Jonathan Blandford <jrb@gnome.org>
-
- * Release 2.2.0
-
-2003-01-19 Alex Duggan <aldug@astrolinux.com>
-
- * gnome-settings-mouse.c (filter), (set_locate_pointer):
- make the right control key also locate the mouse pointer.
- Fixes #87426
-
-Thu Jan 16 02:41:09 2003 Jonathan Blandford <jrb@gnome.org>
-
- * Release 2.1.7
-
-2003-01-10 Jody Goldberg <jody@gnome.org>
-
- * Release 2.1.6
-
-2002-12-18 Jody Goldberg <jody@gnome.org>
-
- * Release 2.1.5
-
-2002-11-23 Jody Goldberg <jody@gnome.org>
-
- * Release 2.1.3
-
-2002-11-08 Mark McLoughlin <mark@skynet.ie>
-
- Create a XSettingsManager for every available
- screen and apply settings changes to each.
-
- * gnome-settings-daemon.c:
- (manager_event_filter): make this a per-window filter
- and ask the appropriate xsettings manager to filter
- the event.
- (finalize): dispose of every manager.
- (gnome_settings_daemon_new): create a settings manager
- for each screen.
-
- * gnome-settings-xsettings.c:
- (translate_bool_int), (translate_int_int),
- (translate_string_string), (process_value),
- (xsettings_callback), (xft_callback),
- (gnome_xft_settings_set_xsettings),
- (gnome_settings_xsettings_load): apply settings to
- every available settings manager.
-
-2002-11-02 Jody Goldberg <jody@gnome.org>
-
- * Release 2.1.2
-
-2002-10-31 Jody Goldberg <jody@gnome.org>
-
- * gnome-settings-accessibility-keyboard.c
- (gnome_settings_accessibility_keyboard_init) : register the gconf
- handler early.
- (gnome_settings_accessibility_keyboard_load) : not here where it is
- too late.
-
-2002-10-26 Havoc Pennington <hp@pobox.com>
-
- * gnome-settings-wm.c, gnome-settings-wm.h: blow this away
-
- * gnome-settings-daemon.c: don't init WM stuff
-
-Sun Oct 27 09:00:46 2002 Jonathan Blandford <jrb@gnome.org>
-
- * gnome-settings-xsettings.c: add Gtk/CanChangeAccels to xsettings
-
-2002-10-21 Jody Goldberg <jody@gnome.org>
-
- * Release 2.1.1
-
-2002-02-07 Anders Carlsson <andersca@gnu.org>
-
- * gdk/x11/xsettings-common.c (xsettings_setting_free): Free
- the setting name.
-
-2002-10-20 Mark McLoughlin <mark@skynet.ie>
-
- * factory.c: (main): don't connect to the session manager.
-
-2002-10-18 Erwann Chenede - <erwann.chenede@sun.com>
-
- * gnome-settings-keybindings.c
- (screen_exec_display_string) : added function to get display
- string from an XEvent.
- (keybindings_filter) : set a fully qualified DISPLAY env variable
- when spawing a keybinding action.
-
-2002-10-08 Jody Goldberg <jody@gnome.org>
-
- http://bugzilla.gnome.org/show_bug.cgi?id=91535
- * gnome-settings-sound.c : as michael points out it is silly to start
- the daemon just so that we can stop it. Dunno much about esound
- code so the funky logic is left untouched.
-
-2002-10-08 Jody Goldberg <jody@gnome.org>
-
- http://bugzilla.gnome.org/show_bug.cgi?id=95179
- * gnome-settings-accessibility-keyboard.c
- (gnome_settings_accessibility_keyboard_init) : do nothing here.
- (gnome_settings_accessibility_keyboard_load) : install the filter
- here, _after_ loading the gconf settings.
- (set_gconf_from_server) : check to see if anything has actually
- changed before sending off the changeset.
-
-2002-10-01 Jody Goldberg <jody@gnome.org>
-
- * Release 2.1.0.1
-
-Tue Sep 24 15:47:29 2002 HideToshi Tajima <hidetoshi.tajima@sun.com>
-
- disable/enable preedit/status in GtkIMContextXIM (#59076)
-
- * gnome-settings-xsettings.c: added two new xsettings
- for GTK+ input method preedit and status styles.
-
- With the other patch for gtk+, the preedit and status styles of
- GTK+ input method are configurable with associated gconf schemas
- keys:
- "/desktop/gnome/interface/gtk-im-preedit-style"
- "/desktop/gnome/interface/gtk-im-status-style"
-
- Both are set to "callback" by default, and platform's
- packging can have different default by changing
- libgnome's desktop_gnome_interface.schemas.
-
-2002-09-11 Jody Goldberg <jody@gnome.org>
-
- * gnome-settings-accessibility-keyboard.c (set_server_from_gconf) :
- set the timeout options fully.
-
-2002-09-10 Jody Goldberg <jody@gnome.org>
-
- * gnome-settings-wm.c (gnome_settings_wm_load) : protect against NULL.
-
-2002-09-09 Jody Goldberg <jody@gnome.org>
-
- http://bugzilla.gnome.org/show_bug.cgi?id=91223
- * gnome-settings-wm.c (gnome_settings_wm_load) : add some valdation to
- ensure that we don't set the number of workspaces to 0
- (which pisses off kde). Also apply fcrozat's patch to restore the
- names.
-
- * gnome-settings-accessibility-keyboard.c (set_server_from_gconf) :
- the feature beep is not related the the feature timeout.
-
-2002-08-21 Jody Goldberg <jody@gnome.org>
-
- * Release 2.1.0
-
-2002-08-15 Jody Goldberg <jody@gnome.org>
-
- http://bugzilla.gnome.org/show_bug.cgi?id=90778
- * gnome-settings-accessibility-keyboard.c (set_gconf_from_server) :
- Add a heuristic so that we do not disable features in gconf just
- because they are disabled in the X server. If the master switch is
- already disabled in gconf we can guess that most of the time it
- means that people want to keep their flags.
-
-2002-08-14 Jody Goldberg <jody@gnome.org>
-
- http://bugzilla.gnome.org/show_bug.cgi?id=90778
- * gnome-settings-default-editor.c (vfs_change_cb) : be more careful
-
-2002-08-07 Michael Meeks <michael@ximian.com>
-
- * gnome-settings-sound.c (stop_esd): flag that
- we scuppered the remote daemon.
- (apply_settings): resume it if we killed it,
- don't kill it more than once.
- Don't iterate over all the sounds and try to
- push to the server if we have sound disabled,
- saves a chunk of time.
- This fixes the 'toggle sound a lot breaks it' bug.
-
-2002-08-03 Jody Goldberg <jody@gnome.org>
-
- http://bugzilla.gnome.org/show_bug.cgi?id=88634
- * gnome-settings-mouse.c (set_left_handed) : merge in a variant of the
- proposed patch.
-
-2002-07-27 Mark McLoughlin <mark@skynet.ie>
-
- Add multiscreen support for background rendering.
-
- * gnome-settings-background.c:
- (background_callback): apply prefs to all screens.
- (gnome_settings_background_init): create a BGApplier for
- each screen.
- (gnome_settings_background_load): apply prefs to all
- screens.
-
-2002-07-22 jacob berkman <jacob@ximian.com>
-
- * gnome-settings-background.c (gnome_settings_background_load): if
- nautilus is drawing the desktop, just return
-
-2002-06-19 jacob berkman <jacob@ximian.com>
-
- * Makefile.am: fix build
-
-2002-06-17 Jody Goldberg <jody@gnome.org>
-
- * Release 2.0.0
-
-2002-06-17 Jody Goldberg <jody@gnome.org>
-
- http://bugzilla.gnome.org/show_bug.cgi?id=85327
- * gnome-settings-xsettings.c (translate_string_string) : These strings
- do look wrong. The capplet is setting the keys from the schema.
- we were not mapping them to the write xsettings. It did not really
- matter because we were not using xsettings to communicate these
- values.
-
-2002-06-10 Jody Goldberg <jody@gnome.org>
-
- * gnome-settings-accessibility-keyboard.c (set_server_from_gconf) :
- add some bounds checking.
-
-2002-06-06 Kjartan Maraas <kmaraas@gnome.org>
-
- * gnome-settings-keybindings.c: Make the last string consistent
- with the rest in this file.
-
-2002-06-06 Erwann Chenede - <erwann.chenede@sun.com>
-
- * gnome-settings-keybindings.c (keybindings_filter) :
- do not quit gnome-settings-daemon when pressing Ok
- when the warning dialog appears. fix bug #84364
- Added localization hooks.
-
-2002-05-30 Jody Goldberg <jody@gnome.org>
-
- * gnome-settings-keyboard.c (xkb_set_keyboard_autorepeat_rate) : Add
- some bounds checking.
-
-Wed May 29 20:23:13 2002 Jonathan Blandford <jrb@redhat.com>
-
- * Makefile.am: Add gnome-settings-keybinding
- * gnome-settings-daemon.c: (gnome_settings_daemon_new): initialize
- keybindings support
- * gnome-settings-keybindings.[ch]: Patch to add support for custom
- keybindings. Thanks to Erwann Chenede <Erwann.Chenede@sun.com>
- for the patch.
-
-2002-05-22 Jody Goldberg <jody@gnome.org>
-
- * gnome-settings-accessibility-keyboard.c (set_server_from_gconf) :
- disable some debug spew.
- (set_gconf_from_server) : ditto.
-
-2002-05-22 jacob berkman <jacob@ximian.com>
-
- * gnome-settings-font.c (load_cursor): run the mkfontdir command
- synchronously to avoid a possible race. extra precaution for
- #78023
-
- * gnome-settings-daemon.c (gnome_settings_daemon_new): run
- background settings after everything else, as some of those spawn
- processes (xscreensaver) and background settings nices itself
-
- should fix #78742
-
- * factory.c (main): quit when we get the die signal from the SM
-
-2002-05-16 Jody Goldberg <jody@gnome.org>
-
- http://bugzilla.gnome.org/show_bug.cgi?id=80325
- * gnome-settings-keyboard.c (apply_settings) : although we may not be
- able to support the autorepeat rate setting we can enable/disable
- autorepeat.
-
-2002-05-16 jacob berkman <jacob@ximian.com>
-
- * gnome-settings-keyboard.c (apply_settings): load from the
- correct key for whether the bell should be on or not
- (apply_settings): pass the right flags to XChangeKeyboardControl()
-
- fixes #78016 and 78015
-
- * Makefile.am:
- * gnome-settings-default-editor.[ch]: keep text/plain and text*
- using the same mime type (#78037)
-
- * gnome-settings-daemon.c (gnome_settings_daemon_new): load editor
- and keyboard settings (bugs #78037 and #78016)
-
-Tue May 14 14:50:34 2002 Jonathan Blandford <jrb@redhat.com>
-
- * gnome-settings-*.c: Remove all debug print statements, #76085
-
-Mon May 13 17:05:22 2002 Jonathan Blandford <jrb@redhat.com>
-
- * gnome-settings-font.c (load_cursor): s/.gnome/.gnome2/g
-
-2002-05-12 Anders Carlsson <andersca@gnu.org>
-
- * gnome-settings-xsettings.c:
- Watch the dnd threshold xsetting.
-
-2002-04-30 Kjartan Maraas <kmaraas@gnome.org>
-
- * factory.c: Add calls to bindtext* for i18n.
- * Makefile.am: Add -DGNOMELOCALEDIR="\".....\""
- * gnome-settings-font.c: Mark strings and add #includes.
- * gnome-settings-screensaver.c: Same
- * gnome-settings-sound.c: Same.
- * gnome-settings-xsettings.c: Same.
- * gnome-settings-wm.c: Fix a warning.
-
-2002-04-24 Jody Goldberg <jody@gnome.org>
-
- * gnome-settings-accessibility-keyboard.c (set_server_from_gconf) :
- max speed is in pixels per _event_ not relative to time. double
- check that we don't set 0.
-
-2002-04-24 Jody Goldberg <jody@gnome.org>
-
- * gnome-settings-accessibility-keyboard.c
- (gnome_settings_accessibility_keyboard_init) : we're only interested
- in control changes.
- (set_gconf_from_server) : set both XkbAccessXKeysMask|XkbAccessXFeedbackMask
- when we enable accessX, and fix typo.
-
-2002-04-23 Jody Goldberg <jody@gnome.org>
-
- * gnome-settings-accessibility-keyboard.c (get_xkb_desc_rec) :
- suppress warning.
-
-2002-04-17 Rachel Hestilow <hestilow@ximian.com>
-
- * GNOME_SettingsDaemon.server.in: s/gnome2/gnome
-
-Tue Apr 16 17:09:02 2002 Jonathan Blandford <jrb@redhat.com>
-
- * factory.c (main): Patch from Akira Tagoh <tagoh@gnome-db.org> to
- change the restart command from gnome2-settings-daemon to
- gnome-settings-daemon.
-
-2002-04-12 Jody Goldberg <jody@gnome.org>
-
- * gnome-settings-accessibility-keyboard.c (set_server_from_gconf) :
- Doh! We need to clear the flags if they are disabled.
-
-2002-04-11 jacob berkman <jacob@ximian.com>
-
- * gnome-settings-accessibility-keyboard.c: only do xkb calls if
- xkb is present (better fix for previous commit)
-
-2002-04-11 Jody Goldberg <jody@gnome.org>
-
- * gnome-settings-accessibility-keyboard.c (set_server_from_gconf) : be
- even more anal.
-
-2002-04-10 Jody Goldberg <jody@gnome.org>
-
- * Makefile.am (gnome_settings_daemon_LDADD) : remove XF86MISC_LIBS
-
-2002-04-01 Jody Goldberg <jody@gnome.org>
-
- http://bugzilla.gnome.org/show_bug.cgi?id=77203
- * gnome-settings-accessibility-keyboard.c (set_gconf_from_server) : be
- more anal about server failure.
- (set_server_from_gconf) : ditto.
-
-2002-03-30 Jody Goldberg <jody@gnome.org>
-
- * gnome-settings-xsettings.c (translations) : reorder to match gdk.
- This simplifies maintenance.
-
-Tue Apr 9 11:58:10 2002 Jonathan Blandford <jrb@gnome.org>
-
- * Makefile.am: Add commented out disk support until I finish the code.
-
-2002-04-04 jacob berkman <jacob@ximian.com>
-
- * gnome-settings-accessibility-keyboard.c (set_server_from_gconf):
- prefer gdk_flush() to XFlush() (fixes bug #77208)
-
-2002-03-29 Jody Goldberg <jody@gnome.org>
-
- * gnome-settings-accessibility-keyboard.c
- (gnome_settings_accessibility_keyboard_init) : get really anal about
- potential X errors.
- (set_gconf_from_server) : ditto.
-
-2002-03-29 Jody Goldberg <jody@gnome.org>
-
- * gnome-settings-accessibility-keyboard.c (set_server_from_gconf) :
- Add a gdk_error_trap just in case.
-
- * gnome-settings-keyboard.c (apply_settings) : don't init things to
- bogus values unless it is ncessary. Add a gdk_error_trap around the
- X settings to avoid causing the server to exit if something goes
- wrong. Be sure to flush before we pop the handler.
-
- * gnome-settings-accessibility-keyboard.c (set_server_from_gconf) :
- fix spelling error in schema.
-
- * gnome-settings-font.c (load_cursor) : add missing NULL terminator.
-
- * gnome-settings-keyboard.c (apply_settings) : click volume is an
- integer from 0..100, schema is an int too. Remove float and double
- and add some bounds checking.
-
- * gnome-settings-accessibility-keyboard.c : make the debug spew optional
- (set_server_from_gconf) : typo that only applied settings when we
- shouldn't.
- (set_server_from_gconf) : set the mouse key accel flag when mk is
- enabled so that we can actually set the accel parms. How did this
- work in X11R6 ?
- (set_server_from_gconf) : scale mk_time_to_max by mk_interval so that
- it is actually in msec.
- (set_gconf_from_server) : do the inverse here.
-
-2002-03-28 jacob berkman <jacob@ximian.com>
-
- * gnome-settings-accessibility-keyboard.c (set_server_from_gconf):
- fix a typo
-
-Thu Mar 28 09:18:40 2002 Jonathan Blandford <jrb@redhat.com>
-
- * gnome-settings-daemon.c: somehow the font settings were
- removed. Re add.
-
-2002-03-26 jacob berkman <jacob@ximian.com>
-
- * gnome-settings-screensaver.[ch]
- (gnome_settings_screensaver_load): start xscreensaver, and display
- an error dialog if it failed
-
- * gnome-settings-daemon.c (gnome_settings_daemon_new): init/load
- screensaver
-
-2002-03-25 jacob berkman <jacob@ximian.com>
-
- * factory.c (main): tell the SM to restart us only after we know
- we're unique with bonobo-activation
-
-2002-03-17 Jonathan Blandford <jrb@redhat.com>
-
- * gnome-settings-xsettings.c: Add keybindingtheme
-
-2002-03-17 Kjartan Maraas <kmaraas@gnome.org>
-
- * factory.c: Move include <config.h> to the top.
-
-2002-03-13 jacob berkman <jacob@ximian.com>
-
- * gnome-settings-daemon.c (_GnomeSettingsDaemonPrivate): add a
- dummy field
- (gnome_settings_daemon_register_callback): cast functions to
- gpointers as forte does not like this (bug #74349)
-
-2002-03-07 Lauris Kaplinski <lauris@ximian.com>
-
- * gnome-settings-keyboard.c (apply_settings): Use correct GConf keys,
- click volume is of type float, not int
-
-2002-03-10 Seth Nickell <snickell@stanford.edu>
-
- * GNOME_SettingsDaemon.server.in:
-
- Dum de dum. Forgot to cvs add.
-
-2002-03-10 Seth Nickell <snickell@stanford.edu>
-
- Make the settings daemon a singleton BonoboObject so capplets
- can detect whether its running and activate it if its not.
-
- * Makefile.am:
- * factory.c: (main):
- * gnome-settings-daemon.c: (awake_impl), (finalize),
- (gnome_settings_daemon_class_init), (gnome_settings_daemon_init),
- (gnome_settings_daemon_new):
- * gnome-settings-daemon.h:
-
- Convert the settings-daemon into a BonoboObject and add code to
- register it with bonobo-activation. Still has a main loop that can
- be run normally to launch the settings daemon.
-
-2002-03-06 Miles Lane <miles@megapathdsl.net>
-
- * gnome-settings-daemon.c -- Correct the gnome_program_init()
- call to specify the correct program name. Specify the
- restart command, so that the session manager knows how
- to restart the daemon if it is killed for any reason.
-
-2002-03-04 Anders Carlsson <andersca@gnu.org>
-
- * Makefile.am:
- * gnome-settings-daemon.c: (main):
- * gnome-settings-wm.c: (set_number_of_workspaces),
- (set_workspace_names), (wm_callback), (gnome_settings_wm_init),
- (gnome_settings_wm_load):
- * gnome-settings-wm.h:
- Add support for bridging WM settings, currently supports
- _NET_NUMBER_OF_DESKTOPS and _NET_DESKTOP_NAMES.
-
-Tue Feb 19 23:53:06 2002 Jonathan Blandford <jrb@redhat.com>
-
- * gnome-settings-font.c: set the font path and handle cursors.
-
-2002-02-13 Lauris Kaplinski <lauris@ximian.com>
-
- * gnome-settings-xsettings.c: #include <string.h> to kill warning
-
-Tue Feb 12 01:34:19 2002 Jonathan Blandford <jrb@redhat.com>
-
- * gnome-settings-daemon.c (main): add session management.
-
-2002-02-10 Richard Hestilow <hestilow@ximian.com>
-
- * gnome-settings-xsettings.c: Added font setting.
-
-2002-02-04 Lauris Kaplinski <lauris@ximian.com>
-
- * gnome-settings-locate-pointer.c (locate_pointer_expose): Return
- FALSE on default case, instead of nothing
- (setup_window): Replace deprecated methods
-
- * gnome-settings-sound.c (reload_foreach_cb): Replace deprecated
- methods
-
-2002-01-13 Seth Nickell <snickell@stanford.edu>
-
- reviewed by: <delete if not using a buddy>
-
- * Makefile.am:
-
-2002-01-28 Richard Hestilow <hestilow@ximian.com>
-
- * Link to libbackground.la.
-
-2002-01-21 Anders Carlsson <andersca@gnu.org>
-
- * gnome-settings-xsettings.c: Add support for changing themes.
-
-Mon Jan 21 01:29:57 2002 Jonathan Blandford <jrb@redhat.com>
-
- * gnome-settings-keyboard.c: Move locate_pointer out.
-
- * gnome-settings-mouse.c: Move locate_pointer in. Clean up code.
- Remove print statements.
-
-2002-01-14 Bradford Hovinen <hovinen@ximian.com>
-
- * Makefile.am (INCLUDES): Added missing -I$(top_srcdir)
- (bin_PROGRAMS): Rename binary gnome2-settings-daemon
-
- * gnome-settings-daemon.c (main): Enable code to load settings;
- call gnome_settings_background_load too
-
- * gnome-settings-background.c (gnome_settings_background_init):
- Use the correct key to register the callback
-
-Wed Jan 9 21:22:30 2002 Jonathan Blandford <jrb@redhat.com>
-
- * gnome-settings-keyboard.c (filter): weee! locate_cursor works
- now!!!!
- * gnome-settings-locate-pointer: speed up animation.
-
-2002-01-09 Anders Carlsson <andersca@gnu.org>
-
- * gnome-settings-daemon.c (main): Call gconf_client_add_dir.
-
-Tue Jan 8 15:50:59 2002 Jonathan Blandford <jrb@redhat.com>
-
- * Makefile.am: Add locate-pointer.
- * gnome-settings-keyboard.c: Initial attempt at locate-pointer.
- Don't understand XKB enough to figure it out.
- * gnome-settings-locate-pointer.[ch]: Draw the locate pointer
- box. Pretty snazzy for a useless (but fun) feature.
- * gnome-settings-mouse.c: Move locate pointer to it's own file.
-
-2002-01-08 Richard Hestilow <hestilow@ximian.com>
-
- * gnome-settings-daemon.c (main): Initialize libgnomeui,
- and load sounds.
-
- * gnome-settings-sound.c (stop_esd): Just tell esd to let go
- of /dev/dsp.
-
-2002-01-04 Bradford Hovinen <hovinen@ximian.com>
-
- * all: Convert from GConfEngine to GConfClient
-
-2001-01-04 Richard Hestilow <hestilow@ximian.com>
-
- * gnome-settings-sound.[ch]: Added.
-
- * Makefile.am: Add gnome-settings-sound sources, link to libsounds.
-
- * gnome-settings-daemon.c: Call gnome_settings_sound_init.
-
-2001-12-20 Bradford Hovinen <hovinen@ximian.com>
-
- * All: Eliminate compiler warnings
-
- * gnome-settings-daemon.h: Use __GNOME_SETTINGS_DAEMON_H for the
- enclosing macro
-
- * gnome-settings-background.c: Update
-
-2001-12-19 Bradford Hovinen <hovinen@ximian.com>
-
- * Makefile.am
- (gnome_settings_daemon_SOURCES): Add
- gnome-settings-{keyboard|background}.[ch]
- (INCLUDES): Add -I$(top_srcdir)/libbackground
- (gnome_settings_daemon_LDADD): Add
- $(top_builddir)/libbackground/libbackground.a
-
- * gnome-settings-daemon.c (main): Initialize keyboard and
- background subsystems
diff --git a/gnome-settings-daemon/GNOME_SettingsDaemon.server.in b/gnome-settings-daemon/GNOME_SettingsDaemon.server.in
deleted file mode 100644
index 727d7a01e..000000000
--- a/gnome-settings-daemon/GNOME_SettingsDaemon.server.in
+++ /dev/null
@@ -1,9 +0,0 @@
-<oaf_info>
- <oaf_server iid="OAFIID:GNOME_SettingsDaemon"
- type="exe" location="gnome-settings-daemon">
- <oaf_attribute name="repo_ids" type="stringv">
- <item value="IDL:Bonobo/Unknown:1.0"/>
- <item value="IDL:GNOME/SettingsDaemon:1.0"/>
- </oaf_attribute>
- </oaf_server>
-</oaf_info>
diff --git a/gnome-settings-daemon/Makefile.am b/gnome-settings-daemon/Makefile.am
deleted file mode 100644
index aa31e1ad9..000000000
--- a/gnome-settings-daemon/Makefile.am
+++ /dev/null
@@ -1,92 +0,0 @@
-SUBDIRS = xrdb
-
-INCLUDES=$(GNOME_SETTINGS_DAEMON_CFLAGS) -I$(top_srcdir)/libbackground -I$(top_srcdir) \
- -DGNOMELOCALEDIR="\"$(datadir)/locale\"" \
- -DESD_SERVER="\"$(ESD_SERVER)\"" \
- -DDATADIR="\"$(datadir)\""
-bin_PROGRAMS=gnome-settings-daemon
-
-gnome_settings_daemon_SOURCES = \
- factory.c \
- gnome-settings-daemon.h \
- gnome-settings-daemon.c \
- gnome-settings-font.h \
- gnome-settings-font.c \
- gnome-settings-mouse.h \
- gnome-settings-mouse.c \
- gnome-settings-keyboard.h \
- gnome-settings-keyboard.c \
- gnome-settings-background.h \
- gnome-settings-background.c \
- gnome-settings-xsettings.c \
- gnome-settings-xsettings.h \
- gnome-settings-locate-pointer.c \
- gnome-settings-locate-pointer.h \
- gnome-settings-sound.c \
- gnome-settings-sound.h \
- gnome-settings-accessibility-keyboard.h \
- gnome-settings-accessibility-keyboard.c \
- gnome-settings-screensaver.h \
- gnome-settings-screensaver.c \
- gnome-settings-default-editor.c \
- gnome-settings-default-editor.h \
- gnome-settings-gtk1theme.c \
- gnome-settings-gtk1theme.h \
- gnome-settings-xrdb.c \
- gnome-settings-xrdb.h \
- xsettings-common.c \
- xsettings-manager.c \
- xsettings-common.h \
- xsettings-manager.h \
- gnome-settings-keybindings.c \
- gnome-settings-keybindings.h \
- gnome-settings-typing-break.c \
- gnome-settings-typing-break.h \
- reaper.c \
- reaper.h \
- $(CORBA_GENERATED)
-
-# $(AccessX_files)
-
-gnome_settings_daemon_LDADD = \
- $(GNOME_SETTINGS_DAEMON_LIBS) \
- $(top_builddir)/libbackground/libbackground.la \
- $(top_builddir)/libsounds/libsounds.a \
- -L$(top_builddir)/libwindow-settings/ -lgnome-window-settings \
- $(XF86MISC_LIBS)
-
-#AccessX_files = \
-# AccessXcomm.c \
-# extutil.h \
-# AccessXproto.h \
-# AccessXlibint.h
-
-CORBA_GENERATED_HEADER_FILES = GNOME_SettingsDaemon.h
-
-CORBA_GENERATED = \
- $(CORBA_GENERATED_HEADER_FILES) \
- GNOME_SettingsDaemon-common.c \
- GNOME_SettingsDaemon-stubs.c \
- GNOME_SettingsDaemon-skels.c
-
-BUILT_SOURCES=$(CORBA_GENERATED)
-
-idl_dir = $(top_srcdir)/idl
-
-IDL_FLAGS = -D__GNOME_SettingsDaemon_COMPILATION -I $(idl_dir) -I $(datadir)/idl \
- -I $(LIBBONOBO_IDL_DIR) \
- -I $(BONOBO_ACTIVATION_IDL_DIR)
-
-$(CORBA_GENERATED): $(idl_dir)/GNOME_SettingsDaemon.idl $(ORBIT_IDL)
- $(ORBIT_IDL) $(IDL_FLAGS) $(idl_dir)/GNOME_SettingsDaemon.idl
-
-serverdir = $(libdir)/bonobo/servers
-server_in_files = GNOME_SettingsDaemon.server.in
-server_DATA = $(server_in_files:.server.in=.server)
-
-@INTLTOOL_SERVER_RULE@
-
-CLEANFILES = $(BUILT_SOURCES)
-
-EXTRA_DIST = \
- $(server_in_files) \
diff --git a/gnome-settings-daemon/factory.c b/gnome-settings-daemon/factory.c
deleted file mode 100644
index fb868a6d1..000000000
--- a/gnome-settings-daemon/factory.c
+++ /dev/null
@@ -1,57 +0,0 @@
-#include <config.h>
-
-#include "gnome-settings-daemon.h"
-
-#include <bonobo.h>
-#include <bonobo/bonobo-object.h>
-#include <bonobo/bonobo-generic-factory.h>
-
-#include <libgnome/gnome-init.h>
-#include <libgnomeui/gnome-ui-init.h>
-#include <libgnomeui/gnome-client.h>
-
-static BonoboObject *services_server = NULL;
-
-int main (int argc, char *argv [])
-{
- GnomeClient *session;
- Bonobo_RegistrationResult ret;
- gchar *restart_argv[] = { "gnome-settings-daemon", *argv, 0 };
-
- bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
- bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
- textdomain (GETTEXT_PACKAGE);
-
- gnome_program_init ("gnome-settings-daemon", VERSION,
- LIBGNOMEUI_MODULE,
- argc, argv,
- GNOME_CLIENT_PARAM_SM_CONNECT, FALSE,
- NULL);
-
- if (!bonobo_init (&argc, argv)) {
- g_error (_("Could not initialize Bonobo"));
- }
-
- gconf_init (argc, argv, NULL); /* exits w/ message on failure */
-
- /* start the settings daemon */
- services_server = BONOBO_OBJECT (gnome_settings_daemon_new ());
-
- ret = bonobo_activation_active_server_register ("OAFIID:GNOME_SettingsDaemon",
- BONOBO_OBJREF (services_server));
- if (ret != Bonobo_ACTIVATION_REG_SUCCESS) {
- g_warning ("Encountered problems registering the settings daemon with bonobo-activation. "
- "Clients may not detect that the settings daemon is already running.");
- }
-
- session = gnome_master_client ();
- gnome_client_set_restart_command (session, 2, restart_argv);
- gnome_client_set_restart_style (session, GNOME_RESTART_IMMEDIATELY);
- gnome_client_set_priority (session, 5);
- g_signal_connect (session, "die",
- G_CALLBACK (gtk_main_quit), NULL);
-
- gtk_main();
-
- return -1;
-}
diff --git a/gnome-settings-daemon/gnome-settings-accessibility-keyboard.c b/gnome-settings-daemon/gnome-settings-accessibility-keyboard.c
deleted file mode 100644
index 0c79d902c..000000000
--- a/gnome-settings-daemon/gnome-settings-accessibility-keyboard.c
+++ /dev/null
@@ -1,432 +0,0 @@
-/* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/* gnome-settings-keyboard.c
- *
- * Copyright © 2001 Ximian, Inc.
- *
- * Written by Jody Goldberg <jody@gnome.org>
- *
- * 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.
- */
-
-#include "config.h"
-
-#include <gdk/gdk.h>
-#include <gdk/gdkx.h>
-#include <gconf/gconf-client.h>
-
-#include "gnome-settings-accessibility-keyboard.h"
-#include "gnome-settings-daemon.h"
-
-#ifdef HAVE_X11_EXTENSIONS_XKB_H
-# include <X11/XKBlib.h>
-# include <X11/extensions/XKBstr.h>
-
-#define CONFIG_ROOT "/desktop/gnome/accessibility/keyboard"
-
-#undef DEBUG_ACCESSIBILITY
-#ifdef DEBUG_ACCESSIBILITY
-#define d(str) fprintf (stderr, str)
-#else
-#define d(str) do { } while (0)
-#endif
-
-static gboolean we_are_changing_xkb_state = FALSE;
-static int xkbEventBase;
-
-static gboolean
-xkb_enabled (void)
-{
- static gboolean initialized = 0;
- static gboolean have_xkb = 0;
-
- int opcode, errorBase, major, minor;
-
- if (initialized)
- return have_xkb;
-
- gdk_error_trap_push ();
- have_xkb = XkbQueryExtension (GDK_DISPLAY (),
- &opcode, &xkbEventBase, &errorBase, &major, &minor)
- && XkbUseExtension (GDK_DISPLAY (), &major, &minor);
- XSync (GDK_DISPLAY (), FALSE);
- gdk_error_trap_pop ();
-
- return have_xkb;
-}
-
-static XkbDescRec *
-get_xkb_desc_rec (void)
-{
- XkbDescRec *desc;
- Status status = Success; /* Any bogus value, to suppress warning */
-
- if (!xkb_enabled ())
- return NULL;
-
- gdk_error_trap_push ();
- desc = XkbGetMap (GDK_DISPLAY (), XkbAllMapComponentsMask, XkbUseCoreKbd);
- if (desc != NULL) {
- desc->ctrls = NULL;
- status = XkbGetControls (GDK_DISPLAY (), XkbAllControlsMask, desc);
- }
- XSync (GDK_DISPLAY (), FALSE);
- gdk_error_trap_pop ();
-
- g_return_val_if_fail (desc != NULL, NULL);
- g_return_val_if_fail (desc->ctrls != NULL, NULL);
- g_return_val_if_fail (status == Success, NULL);
-
- return desc;
-}
-
-static int
-get_int (GConfClient *client, char const *key)
-{
- int res = gconf_client_get_int (client, key, NULL);
- if (res <= 0)
- res = 1;
- return res;
-}
-
-static gboolean
-set_int (GConfClient *client, GConfChangeSet *cs,
- char const *key, int val)
-{
- gconf_change_set_set_int (cs, key, val);
- if (val != gconf_client_get_int (client, key, NULL)) {
- g_warning ("%s changed", key);
- }
- return val != gconf_client_get_int (client, key, NULL);
-}
-
-static gboolean
-set_bool (GConfClient *client, GConfChangeSet *cs,
- gboolean in_gconf, char const *key, int val)
-{
- if (in_gconf || val) {
- gconf_change_set_set_bool (cs, key, val ? TRUE : FALSE);
- if (val != gconf_client_get_bool (client, key, NULL)) {
- g_warning ("%s changed", key);
- }
- return val != gconf_client_get_bool (client, key, NULL);
- }
- return FALSE;
-}
-
-static unsigned long
-set_clear (gboolean flag, unsigned long value, unsigned long mask)
-{
- if (flag)
- return value | mask;
- return value & ~mask;
-}
-
-static gboolean
-set_ctrl_from_gconf (XkbDescRec *desc, GConfClient *client,
- char const *key, unsigned long mask, gboolean flag)
-{
- gboolean result = flag && gconf_client_get_bool (client, key, NULL);
- desc->ctrls->enabled_ctrls =
- set_clear (result, desc->ctrls->enabled_ctrls, mask);
- return result;
-}
-
-static void
-set_server_from_gconf (GConfEntry *ignored)
-{
- GConfClient *client = gconf_client_get_default ();
- XkbDescRec *desc;
- gboolean enable_accessX;
-
- desc = get_xkb_desc_rec ();
- if (!desc) {
- d ("No XKB present\n");
- return;
- }
-
- if (we_are_changing_xkb_state) {
- d ("We changed gconf accessibility state\n");
- return;
- } else
- d ("Someone changed gconf accessibility state\n");
-
- /* general */
- enable_accessX = gconf_client_get_bool (client, CONFIG_ROOT "/enable", NULL);
-
- desc->ctrls->enabled_ctrls = set_clear (enable_accessX,
- desc->ctrls->enabled_ctrls,
- XkbAccessXKeysMask | XkbAccessXFeedbackMask);
-
- if (set_ctrl_from_gconf (desc, client, CONFIG_ROOT "/timeout_enable",
- XkbAccessXTimeoutMask, enable_accessX)) {
- desc->ctrls->ax_timeout = get_int (client,
- CONFIG_ROOT "/timeout");
- /* disable only the master flag via the server we will disable
- * the rest on the rebound without affecting gconf state
- * don't change the option flags at all.
- */
- desc->ctrls->axt_ctrls_mask = \
- XkbAccessXKeysMask |
- XkbAccessXFeedbackMask;
- desc->ctrls->axt_ctrls_values = 0;
- desc->ctrls->axt_opts_mask = 0;
- }
-
- desc->ctrls->ax_options = set_clear (enable_accessX &&
- gconf_client_get_bool (client, CONFIG_ROOT "/feature_state_change_beep", NULL),
- desc->ctrls->ax_options, XkbAX_FeatureFBMask | XkbAX_SlowWarnFBMask);
-
- /* bounce keys */
- if (set_ctrl_from_gconf (desc, client, CONFIG_ROOT "/bouncekeys_enable",
- XkbBounceKeysMask, enable_accessX)) {
- desc->ctrls->debounce_delay = get_int (client,
- CONFIG_ROOT "/bouncekeys_delay");
- desc->ctrls->ax_options = set_clear (
- gconf_client_get_bool (client, CONFIG_ROOT "/bouncekeys_beep_reject", NULL),
- desc->ctrls->ax_options, XkbAX_BKRejectFBMask);
- }
-
- /* mouse keys */
- if (set_ctrl_from_gconf (desc, client, CONFIG_ROOT "/mousekeys_enable",
- XkbMouseKeysMask | XkbMouseKeysAccelMask, enable_accessX)) {
- desc->ctrls->mk_interval = 100; /* msec between mousekey events */
- desc->ctrls->mk_curve = 50;
-
- /* We store pixels / sec, XKB wants pixels / event */
- desc->ctrls->mk_max_speed = get_int (client,
- CONFIG_ROOT "/mousekeys_max_speed") / (1000 / desc->ctrls->mk_interval);
- if (desc->ctrls->mk_max_speed <= 0)
- desc->ctrls->mk_max_speed = 1;
-
- desc->ctrls->mk_time_to_max = get_int (client, /* events before max */
- CONFIG_ROOT "/mousekeys_accel_time") / desc->ctrls->mk_interval;
- if (desc->ctrls->mk_time_to_max <= 0)
- desc->ctrls->mk_time_to_max = 1;
-
- desc->ctrls->mk_delay = get_int (client, /* ms before 1st event */
- CONFIG_ROOT "/mousekeys_init_delay");
- }
-
- /* slow keys */
- if (set_ctrl_from_gconf (desc, client, CONFIG_ROOT "/slowkeys_enable",
- XkbSlowKeysMask, enable_accessX)) {
- desc->ctrls->ax_options = set_clear (
- gconf_client_get_bool (client, CONFIG_ROOT "/slowkeys_beep_press", NULL),
- desc->ctrls->ax_options, XkbAX_SKPressFBMask);
- desc->ctrls->ax_options = set_clear (
- gconf_client_get_bool (client, CONFIG_ROOT "/slowkeys_beep_accept", NULL),
- desc->ctrls->ax_options, XkbAX_SKAcceptFBMask);
- desc->ctrls->ax_options = set_clear (
- gconf_client_get_bool (client, CONFIG_ROOT "/slowkeys_beep_reject", NULL),
- desc->ctrls->ax_options, XkbAX_SKRejectFBMask);
- desc->ctrls->slow_keys_delay = get_int (client,
- CONFIG_ROOT "/slowkeys_delay");
- /* anything larger than 500 seems to loose all keyboard input */
- if (desc->ctrls->slow_keys_delay > 500)
- desc->ctrls->slow_keys_delay = 500;
- }
-
- /* sticky keys */
- if (set_ctrl_from_gconf (desc, client, CONFIG_ROOT "/stickykeys_enable",
- XkbStickyKeysMask, enable_accessX)) {
- desc->ctrls->ax_options |= XkbAX_LatchToLockMask;
- desc->ctrls->ax_options = set_clear (
- gconf_client_get_bool (client, CONFIG_ROOT "/stickykeys_two_key_off", NULL),
- desc->ctrls->ax_options, XkbAX_TwoKeysMask);
- desc->ctrls->ax_options = set_clear (
- gconf_client_get_bool (client, CONFIG_ROOT "/stickykeys_modifier_beep", NULL),
- desc->ctrls->ax_options, XkbAX_StickyKeysFBMask);
- }
-
- /* toggle keys */
- desc->ctrls->ax_options = set_clear (enable_accessX &&
- gconf_client_get_bool (client, CONFIG_ROOT "/togglekeys_enable", NULL),
- desc->ctrls->ax_options, XkbAX_IndicatorFBMask);
-
- /*
- fprintf (stderr, "CHANGE to : 0x%x\n", desc->ctrls->enabled_ctrls);
- fprintf (stderr, "CHANGE to : 0x%x (2)\n", desc->ctrls->ax_options);
- */
- /* guard against reloading gconf when the X server notices that the XKB
- * state has changed and calls us.
- */
- g_return_if_fail (!we_are_changing_xkb_state);
-
- we_are_changing_xkb_state = TRUE;
- gdk_error_trap_push ();
- XkbSetControls (GDK_DISPLAY (),
- XkbSlowKeysMask |
- XkbBounceKeysMask |
- XkbStickyKeysMask |
- XkbMouseKeysMask |
- XkbMouseKeysAccelMask |
- XkbAccessXKeysMask |
- XkbAccessXTimeoutMask |
- XkbAccessXFeedbackMask |
- XkbControlsEnabledMask,
- desc);
- XSync (GDK_DISPLAY (), FALSE);
- gdk_error_trap_pop ();
- we_are_changing_xkb_state = FALSE;
-}
-
-static void
-set_gconf_from_server (GConfEntry *ignored)
-{
- gboolean in_gconf;
- GConfClient *client = gconf_client_get_default ();
- GConfChangeSet *cs = gconf_change_set_new ();
- XkbDescRec *desc = get_xkb_desc_rec ();
- gboolean changed = FALSE;
-
- if (!desc) {
- d ("No XKB present\n");
- return;
- }
-
- /*
- fprintf (stderr, "changed to : 0x%x\n", desc->ctrls->enabled_ctrls);
- fprintf (stderr, "changed to : 0x%x (2)\n", desc->ctrls->ax_options);
- */
-
- /* guard against reloading the server when gconf notices that the state
- * has changed and calls us.
- */
- g_return_if_fail (!we_are_changing_xkb_state);
- we_are_changing_xkb_state = TRUE;
-
- /* always toggle this irrespective of the state */
- changed |= set_bool (client, cs, TRUE, CONFIG_ROOT "/enable",
- desc->ctrls->enabled_ctrls & (XkbAccessXKeysMask | XkbAccessXFeedbackMask));
-
- /* if master is disabled in gconf do not change gconf state of subordinates
- * to match the server. However, we should enable the master if one of the subordinates
- * get enabled.
- */
- in_gconf = gconf_client_get_bool (client, CONFIG_ROOT "/enable", NULL);
-
- changed |= set_bool (client, cs, in_gconf, CONFIG_ROOT "/feature_state_change_beep",
- desc->ctrls->ax_options & (XkbAX_FeatureFBMask | XkbAX_SlowWarnFBMask));
- changed |= set_bool (client, cs, in_gconf, CONFIG_ROOT "/timeout_enable",
- desc->ctrls->enabled_ctrls & XkbAccessXTimeoutMask);
- changed |= set_int (client, cs, CONFIG_ROOT "/timeout",
- desc->ctrls->ax_timeout);
-
- changed |= set_bool (client, cs, in_gconf, CONFIG_ROOT "/bouncekeys_enable",
- desc->ctrls->enabled_ctrls & XkbBounceKeysMask);
- changed |= set_int (client, cs, CONFIG_ROOT "/bouncekeys_delay",
- desc->ctrls->debounce_delay);
- changed |= set_bool (client, cs, TRUE, CONFIG_ROOT "/bouncekeys_beep_reject",
- desc->ctrls->ax_options & XkbAX_BKRejectFBMask);
-
- changed |= set_bool (client, cs, in_gconf, CONFIG_ROOT "/mousekeys_enable",
- desc->ctrls->enabled_ctrls & XkbMouseKeysMask);
- changed |= set_int (client, cs, CONFIG_ROOT "/mousekeys_max_speed",
- desc->ctrls->mk_max_speed * (1000 / desc->ctrls->mk_interval));
- /* NOTE : mk_time_to_max is measured in events not time */
- changed |= set_int (client, cs, CONFIG_ROOT "/mousekeys_accel_time",
- desc->ctrls->mk_time_to_max * desc->ctrls->mk_interval);
- changed |= set_int (client, cs, CONFIG_ROOT "/mousekeys_init_delay",
- desc->ctrls->mk_delay);
-
- changed |= set_bool (client, cs, in_gconf, CONFIG_ROOT "/slowkeys_enable",
- desc->ctrls->enabled_ctrls & XkbSlowKeysMask);
- changed |= set_bool (client, cs, TRUE, CONFIG_ROOT "/slowkeys_beep_press",
- desc->ctrls->ax_options & XkbAX_SKPressFBMask);
- changed |= set_bool (client, cs, TRUE, CONFIG_ROOT "/slowkeys_beep_accept",
- desc->ctrls->ax_options & XkbAX_SKAcceptFBMask);
- changed |= set_bool (client, cs, TRUE, CONFIG_ROOT "/slowkeys_beep_reject",
- desc->ctrls->ax_options & XkbAX_SKRejectFBMask);
- changed |= set_int (client, cs, CONFIG_ROOT "/slowkeys_delay",
- desc->ctrls->slow_keys_delay);
-
- changed |= set_bool (client, cs, in_gconf, CONFIG_ROOT "/stickykeys_enable",
- desc->ctrls->enabled_ctrls & XkbStickyKeysMask);
- changed |= set_bool (client, cs, TRUE, CONFIG_ROOT "/stickykeys_two_key_off",
- desc->ctrls->ax_options & XkbAX_TwoKeysMask);
- changed |= set_bool (client, cs, TRUE, CONFIG_ROOT "/stickykeys_modifier_beep",
- desc->ctrls->ax_options & XkbAX_StickyKeysFBMask);
-
- changed |= set_bool (client, cs, in_gconf, CONFIG_ROOT "/togglekeys_enable",
- desc->ctrls->ax_options & XkbAX_IndicatorFBMask);
-
- if (changed) {
- gconf_client_commit_change_set (client, cs, FALSE, NULL);
- gconf_client_suggest_sync (client, NULL);
- }
- gconf_change_set_unref (cs);
- we_are_changing_xkb_state = FALSE;
-}
-
-static GdkFilterReturn
-cb_xkb_event_filter (GdkXEvent *xevent, GdkEvent *ignored1, gpointer ignored2)
-{
- XEvent *xev = (XEvent *) xevent;
- XkbEvent *xkbEv = (XkbEvent *) xevent;
- if (xev->xany.type == (xkbEventBase + XkbEventCode) &&
- xkbEv->any.xkb_type == XkbControlsNotify) {
- if (!we_are_changing_xkb_state) {
- d ("Someone changed XKB state\n");
- set_gconf_from_server (NULL);
- } else
- d ("We changed XKB state\n");
- }
-
- return GDK_FILTER_CONTINUE;
-}
-
-void
-gnome_settings_accessibility_keyboard_load (GConfClient *client)
-{
- static gboolean has_filter = FALSE;
- if (!xkb_enabled ())
- return;
-
- /* be sure to init before starting to monitor the server */
- set_server_from_gconf (NULL);
-
- /* be careful not to install multipled filters */
- if (has_filter)
- return;
-
- gdk_error_trap_push ();
- XkbSelectEvents (GDK_DISPLAY (),
- XkbUseCoreKbd, XkbControlsNotifyMask, XkbControlsNotifyMask);
-
- XSync (GDK_DISPLAY (), FALSE);
- gdk_error_trap_pop ();
-
- gdk_window_add_filter (NULL, &cb_xkb_event_filter, NULL);
-}
-
-
-void
-gnome_settings_accessibility_keyboard_init (GConfClient *client)
-{
- gnome_settings_daemon_register_callback (CONFIG_ROOT, &set_server_from_gconf);
-}
-#else
-
-void
-gnome_settings_accessibility_keyboard_load (GConfClient *client)
-{
- g_warning ("Unsupported in this build");
-}
-void
-gnome_settings_accessibility_keyboard_init (GConfClient *client)
-{
-}
-#endif
diff --git a/gnome-settings-daemon/gnome-settings-accessibility-keyboard.h b/gnome-settings-daemon/gnome-settings-accessibility-keyboard.h
deleted file mode 100644
index e38cb7ba8..000000000
--- a/gnome-settings-daemon/gnome-settings-accessibility-keyboard.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/* gnome-settings-accessibility-keyboard.h
- *
- * Copyright © 2002 Ximian, Inc.
- *
- * Written by Jody Goldberg <jody@gnome.org>
- *
- * 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 __GNOME_SETTINGS_ACCESSIBILITY_KEYBOARD_H
-#define __GNOME_SETTINGS_ACCESSIBILITY_KEYBOARD_H
-
-#include <gconf/gconf.h>
-#include <gconf/gconf-client.h>
-
-void gnome_settings_accessibility_keyboard_init (GConfClient *client);
-void gnome_settings_accessibility_keyboard_load (GConfClient *client);
-
-#endif /* __GNOME_SETTINGS_ACCESSIBILITY_KEYBOARD_H */
diff --git a/gnome-settings-daemon/gnome-settings-background.c b/gnome-settings-daemon/gnome-settings-background.c
deleted file mode 100644
index 269b90498..000000000
--- a/gnome-settings-daemon/gnome-settings-background.c
+++ /dev/null
@@ -1,118 +0,0 @@
-/* -*- mode: c; style: linux -*- */
-
-/* gnome-settings-background.c
- *
- * Copyright © 2001 Ximian, Inc.
- *
- * Written by Bradford Hovinen <hovinen@ximian.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.
- */
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <gdk/gdk.h>
-#include <gdk/gdkx.h>
-#include <gconf/gconf.h>
-
-#include "gnome-settings-keyboard.h"
-#include "gnome-settings-daemon.h"
-
-#include "preferences.h"
-#include "applier.h"
-
-#ifdef HAVE_GTK_MULTIHEAD
-static BGApplier **bg_appliers;
-#else
-static BGApplier *bg_applier;
-#endif
-static BGPreferences *prefs;
-
-static void
-background_callback (GConfEntry *entry)
-{
-#ifdef HAVE_GTK_MULTIHEAD
- int i;
-#endif
-
- bg_preferences_merge_entry (prefs, entry);
-
-#ifdef HAVE_GTK_MULTIHEAD
- for (i = 0; bg_appliers [i]; i++)
- bg_applier_apply_prefs (bg_appliers [i], prefs);
-#else
- bg_applier_apply_prefs (bg_applier, prefs);
-#endif
-}
-
-void
-gnome_settings_background_init (GConfClient *client)
-{
-#ifdef HAVE_GTK_MULTIHEAD
- GdkDisplay *display;
- int n_screens;
- int i;
-
- display = gdk_display_get_default ();
- n_screens = gdk_display_get_n_screens (display);
-
- bg_appliers = g_new (BGApplier *, n_screens + 1);
-
- for (i = 0; i < n_screens; i++) {
- GdkScreen *screen;
-
- screen = gdk_display_get_screen (display, i);
-
- bg_appliers [i] = BG_APPLIER (bg_applier_new_for_screen (BG_APPLIER_ROOT, screen));
- }
- bg_appliers [i] = NULL;
-#else
- bg_applier = BG_APPLIER (bg_applier_new (BG_APPLIER_ROOT));
-#endif
-
- prefs = BG_PREFERENCES (bg_preferences_new ());
- bg_preferences_load (prefs);
-
- gnome_settings_daemon_register_callback ("/desktop/gnome/background", background_callback);
-}
-
-void
-gnome_settings_background_load (GConfClient *client)
-{
-#ifdef HAVE_GTK_MULTIHEAD
- int i;
-#endif
-
- /* If this is set, nautilus will draw the background and is
- * almost definitely in our session. however, it may not be
- * running yet (so is_nautilus_running() will fail). so, on
- * startup, just don't do anything if this key is set so we
- * don't waste time setting the background only to have
- * nautilus overwrite it.
- */
-
- if (gconf_client_get_bool (client, "/apps/nautilus/preferences/show_desktop", NULL))
- return;
-
-#ifdef HAVE_GTK_MULTIHEAD
- for (i = 0; bg_appliers [i]; i++)
- bg_applier_apply_prefs (bg_appliers [i], prefs);
-#else
- bg_applier_apply_prefs (bg_applier, prefs);
-#endif
-}
diff --git a/gnome-settings-daemon/gnome-settings-background.h b/gnome-settings-daemon/gnome-settings-background.h
deleted file mode 100644
index 74aead612..000000000
--- a/gnome-settings-daemon/gnome-settings-background.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/* -*- mode: c; style: linux -*- */
-
-/* gnome-settings-background.h
- *
- * Copyright © 2001 Ximian, Inc.
- *
- * Written by Bradford Hovinen <hovinen@ximian.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 __GNOME_SETTINGS_BACKGROUND_H
-#define __GNOME_SETTINGS_BACKGROUND_H
-
-#include <gconf/gconf.h>
-
-void gnome_settings_background_init (GConfClient *client);
-void gnome_settings_background_load (GConfClient *client);
-
-#endif
diff --git a/gnome-settings-daemon/gnome-settings-daemon.c b/gnome-settings-daemon/gnome-settings-daemon.c
deleted file mode 100644
index 590094de5..000000000
--- a/gnome-settings-daemon/gnome-settings-daemon.c
+++ /dev/null
@@ -1,454 +0,0 @@
-/*
- * Copyright © 2001 Red Hat, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Red Hat not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission. Red Hat makes no representations about the
- * suitability of this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- *
- * RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL RED HAT
- * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * Authors: Owen Taylor, Havoc Pennington
- */
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-#include <gtk/gtk.h>
-#include <gdk/gdkx.h>
-
-#include <gconf/gconf.h>
-#include <libgnome/gnome-init.h>
-#include <libgnomeui/gnome-ui-init.h>
-#include <config.h>
-
-#include <errno.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <unistd.h>
-
-#include "xsettings-manager.h"
-#include "gnome-settings-daemon.h"
-
-/*#include "gnome-settings-disk.h"*/
-#include "gnome-settings-font.h"
-#include "gnome-settings-xsettings.h"
-#include "gnome-settings-mouse.h"
-#include "gnome-settings-keyboard.h"
-#include "gnome-settings-background.h"
-#include "gnome-settings-sound.h"
-#include "gnome-settings-accessibility-keyboard.h"
-#include "gnome-settings-screensaver.h"
-#include "gnome-settings-default-editor.h"
-#include "gnome-settings-keybindings.h"
-#include "gnome-settings-gtk1theme.h"
-#include "gnome-settings-xrdb.h"
-#include "gnome-settings-typing-break.h"
-
-#include "GNOME_SettingsDaemon.h"
-
-static GObjectClass *parent_class = NULL;
-
-struct _GnomeSettingsDaemonPrivate {
- int dummy;
-};
-
-static GSList *directories = NULL;
-XSettingsManager **managers = NULL;
-
-typedef struct DirElement
-{
- char *dir;
- GSList *callbacks;
-} DirElement;
-
-void
-gnome_settings_daemon_register_callback (const char *dir,
- KeyCallbackFunc func)
-{
- GSList *list;
- gboolean dir_found = FALSE;
-
- for (list = directories; list; list = list->next)
- {
- DirElement *dir_element = list->data;
-
- if (! strcmp (dir_element->dir, dir))
- {
- dir_element->callbacks = g_slist_prepend (dir_element->callbacks, (gpointer)func);
- dir_found = TRUE;
- break;
- }
- }
- if (! dir_found)
- {
- DirElement *dir_element = g_new0 (DirElement, 1);
-
- dir_element->dir = g_strdup (dir);
- dir_element->callbacks = g_slist_prepend (dir_element->callbacks, (gpointer)func);
- directories = g_slist_prepend (directories, dir_element);
- }
-}
-
-GtkWidget *
-gnome_settings_daemon_get_invisible (void)
-{
- static GtkWidget *invisible = NULL;
- if (invisible == NULL)
- invisible = gtk_invisible_new ();
- return invisible;
-}
-
-static void
-config_notify (GConfClient *client,
- guint cnxn_id,
- GConfEntry *entry,
- gpointer user_data)
-{
- GSList *list;
-
- for (list = directories; list; list = list->next)
- {
- DirElement *dir_element = list->data;
-
- if (! strncmp (dir_element->dir, entry->key, strlen (dir_element->dir)))
- {
- GSList *func_list;
- for (func_list = dir_element->callbacks; func_list; func_list = func_list->next)
- {
- ((KeyCallbackFunc) func_list->data) (entry);
- }
- }
- }
-}
-
-static void
-terminate_cb (void *data)
-{
- gboolean *terminated = data;
-
- if (*terminated)
- return;
-
- *terminated = TRUE;
- gtk_main_quit ();
-}
-
-static GdkFilterReturn
-manager_event_filter (GdkXEvent *xevent,
- GdkEvent *event,
- gpointer data)
-{
- int screen_num = GPOINTER_TO_INT (data);
-
- g_return_val_if_fail (managers != NULL, GDK_FILTER_CONTINUE);
-
- if (xsettings_manager_process_event (managers [screen_num], (XEvent *)xevent))
- return GDK_FILTER_REMOVE;
- else
- return GDK_FILTER_CONTINUE;
-}
-
-CORBA_boolean
-awake_impl (PortableServer_Servant servant,
- const CORBA_char *service,
- CORBA_Environment *ev)
-{
-#if 0
- printf ("I received an activate request for %s\n", service);
-#endif
- return TRUE;
-}
-
-
-static void
-finalize (GObject *object)
-{
- GnomeSettingsDaemon *daemon;
- int i;
-
- daemon = GNOME_SETTINGS_DAEMON (object);
- if (daemon->private == NULL) {
- return;
- }
-
- for (i = 0; managers && managers [i]; i++)
- xsettings_manager_destroy (managers [i]);
-
- g_free (daemon->private);
- daemon->private = NULL;
-
- G_OBJECT_CLASS (parent_class)->finalize (object);
-}
-
-static void
-gnome_settings_daemon_class_init (GnomeSettingsDaemonClass *klass)
-{
- GObjectClass *object_class;
-
- object_class = G_OBJECT_CLASS (klass);
-
- object_class->finalize = finalize;
-
- klass->epv.awake = awake_impl;
-
- parent_class = g_type_class_peek_parent (klass);
-}
-
-static void
-gnome_settings_daemon_init (GnomeSettingsDaemon *settings)
-{
- settings->private = g_new (GnomeSettingsDaemonPrivate, 1);
-}
-
-BONOBO_TYPE_FUNC_FULL(GnomeSettingsDaemon, GNOME_SettingsDaemon,
- BONOBO_TYPE_OBJECT, gnome_settings_daemon)
-
-GObject *
-gnome_settings_daemon_new (void)
-{
- gboolean terminated = FALSE;
- GConfClient *client;
- GSList *list;
- GnomeSettingsDaemon *daemon;
- GdkDisplay *display;
- int i;
- int n_screens;
-
- display = gdk_display_get_default ();
- n_screens = gdk_display_get_n_screens (display);
-
- daemon = g_object_new (gnome_settings_daemon_get_type (), NULL);
-
- if (xsettings_manager_check_running (
- gdk_x11_display_get_xdisplay (display),
- gdk_screen_get_number (gdk_screen_get_default ())))
- {
- fprintf (stderr, "You can only run one xsettings manager at a time; exiting\n");
- exit (1);
- }
-
- if (!terminated)
- {
- managers = g_new (XSettingsManager *, n_screens + 1);
-
- for (i = 0; i < n_screens; i++)
- {
- GdkScreen *screen;
-
- screen = gdk_display_get_screen (display, i);
-
- managers [i] = xsettings_manager_new (
- gdk_x11_display_get_xdisplay (display),
- gdk_screen_get_number (screen),
- terminate_cb, &terminated);
- if (!managers [i])
- {
- fprintf (stderr, "Could not create xsettings manager for screen %d!\n", i);
- exit (1);
- }
- }
-
- g_assert (i == n_screens);
- managers [i] = NULL;
- }
-
- /* We use GConfClient not GConfClient because a cache isn't useful
- * for us
- */
- client = gconf_client_get_default ();
-
-/* gnome_settings_disk_init (client);*/
- gnome_settings_font_init (client);
- gnome_settings_xsettings_init (client);
- gnome_settings_mouse_init (client);
- gnome_settings_keyboard_init (client);
- gnome_settings_sound_init (client);
- gnome_settings_accessibility_keyboard_init (client);
- gnome_settings_screensaver_init (client);
- gnome_settings_default_editor_init (client);
- gnome_settings_background_init (client);
- gnome_settings_keybindings_init (client);
- gnome_settings_gtk1_theme_init (client);
- gnome_settings_xrdb_init (client);
- gnome_settings_typing_break_init (client);
-
- for (list = directories; list; list = list->next)
- {
- GError *error = NULL;
- DirElement *dir_element = list->data;
-
- gconf_client_add_dir (client,
- dir_element->dir,
- GCONF_CLIENT_PRELOAD_ONELEVEL,
- NULL);
-
- gconf_client_notify_add (client,
- dir_element->dir,
- config_notify,
- NULL,
- NULL,
- &error);
-
- if (error)
- {
- fprintf (stderr, "Could not listen for changes to configuration in '%s': %s\n",
- dir_element->dir, error->message);
- g_error_free (error);
- }
- }
-
- for (i = 0; i < n_screens; i++)
- {
- GdkScreen *screen;
-
- screen = gdk_display_get_screen (display, i);
- gdk_window_add_filter (
- gdk_screen_get_root_window (screen),
- manager_event_filter, GINT_TO_POINTER (i));
- }
-
-/* gnome_settings_disk_load (client);*/
- gnome_settings_font_load (client);
- gnome_settings_xsettings_load (client);
- gnome_settings_mouse_load (client);
- gnome_settings_keyboard_load (client);
- gnome_settings_sound_load (client);
- gnome_settings_accessibility_keyboard_load (client);
- gnome_settings_screensaver_load (client);
- gnome_settings_default_editor_load (client);
- gnome_settings_background_load (client);
- gnome_settings_keybindings_load (client);
- gnome_settings_gtk1_theme_load (client);
- gnome_settings_xrdb_load (client);
- gnome_settings_typing_break_load (client);
-
- return G_OBJECT (daemon);
-}
-
-
-/* Helper functions */
-
-/*
- * Helper function for spawn_with_input() - wait for a child
- * to exit.
- */
-gboolean
-wait_for_child (int pid,
- int *status)
-{
- gint ret;
-
- again:
- ret = waitpid (pid, status, 0);
-
- if (ret < 0)
- {
- if (errno == EINTR)
- goto again;
- else
- {
- g_warning ("Unexpected error in waitpid() (%s)",
- g_strerror (errno));
- return FALSE;
- }
- }
-
- return TRUE;
-}
-
-
-/*
- * Helper function for spawn_with_input() - write an entire
- * string to a fd.
- */
-static gboolean
-write_all (int fd,
- const char *buf,
- gsize to_write)
-{
- while (to_write > 0)
- {
- gssize count = write (fd, buf, to_write);
- if (count < 0)
- {
- if (errno != EINTR)
- return FALSE;
- }
- else
- {
- to_write -= count;
- buf += count;
- }
- }
-
- return TRUE;
-}
-
-/**
- * gnome_settings_daemon-spawn_with_input:
- * @argv: command line to run
- * @input: string to write to the child process.
- *
- * Spawns a child process specified by @argv, writes the text in
- * @input to it, then waits for the child to exit. Any failures
- * are output through g_warning(); if you wanted to use this in
- * cases where errors need to be presented to the user, some
- * modification would be needed.
- **/
-void
-gnome_settings_daemon_spawn_with_input (char **argv,
- const char *input)
-{
- int exit_status;
- int child_pid;
- int inpipe;
- GError *err = NULL;
-
- if (!g_spawn_async_with_pipes (NULL /* working directory */, argv, NULL /* envp */,
- G_SPAWN_SEARCH_PATH | G_SPAWN_DO_NOT_REAP_CHILD,
- NULL, NULL, /* child setup and data */
- &child_pid,
- &inpipe, NULL, NULL, /* stdin, stdout, stderr */
- &err))
- {
- gchar *command = g_strjoinv (" ", argv);
- g_warning ("Could not execute %s: %s", command, err->message);
- g_error_free (err);
- g_free (command);
-
- return;
- }
-
- if (input)
- {
- if (!write_all (inpipe, input, strlen (input)))
- {
- gchar *command = g_strjoinv (" ", argv);
- g_warning ("Could not write input to %s", command);
- g_free (command);
- }
-
- close (inpipe);
- }
-
- wait_for_child (child_pid, &exit_status);
-
- if (!WIFEXITED (exit_status) || WEXITSTATUS (exit_status))
- {
- gchar *command = g_strjoinv (" ", argv);
- g_warning ("Command %s failed", command);
- g_free (command);
- }
-
-}
diff --git a/gnome-settings-daemon/gnome-settings-daemon.h b/gnome-settings-daemon/gnome-settings-daemon.h
deleted file mode 100644
index 8908977ba..000000000
--- a/gnome-settings-daemon/gnome-settings-daemon.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright 2001 Red Hat, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Red Hat not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission. Red Hat makes no representations about the
- * suitability of this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- *
- * RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL RED HAT
- * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * Authors: Jonathan Blandford
- */
-
-#ifndef __GNOME_SETTINGS_DAEMON_H
-#define __GNOME_SETTINGS_DAEMON_H
-
-#include <gconf/gconf.h>
-#include <gconf/gconf-client.h>
-#include <gtk/gtk.h>
-
-#include <bonobo/bonobo-object.h>
-
-#include "GNOME_SettingsDaemon.h"
-
-typedef void (* KeyCallbackFunc) (GConfEntry *entry);
-
-void gnome_settings_daemon_register_callback (const char *dir,
- KeyCallbackFunc func);
-GtkWidget *gnome_settings_daemon_get_invisible (void);
-
-
-G_BEGIN_DECLS
-
-#define GNOME_SETTINGS_DAEMON_TYPE (gnome_settings_daemon_get_type ())
-#define GNOME_SETTINGS_DAEMON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNOME_SETTINGS_DAEMON_TYPE, GnomeSettingsDaemon))
-#define GNOME_SETTINGS_DAEMON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNOME_SETTINGS_DAEMON_TYPE, GnomeSettingsDaemonClass))
-#define IS_GNOME_SETTINGS_DAEMON(obj) (GTK_TYPE_CHECK_INSTANCE_TYPE ((obj), GNOME_SETTINGS_DAEMON_TYPE))
-#define IS_GNOME_SETTINGS_DAEMON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNOME_SETTINGS_DAEMON_TYPE))
-#define GNOME_SETTINGS_DAEMON_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNOME_SETTINGS_DAEMON_TYPE, GnomeSettingsDaemonClass))
-
-typedef struct _GnomeSettingsDaemon GnomeSettingsDaemon;
-typedef struct _GnomeSettingsDaemonClass GnomeSettingsDaemonClass;
-typedef struct _GnomeSettingsDaemonPrivate GnomeSettingsDaemonPrivate;
-
-struct _GnomeSettingsDaemon
-{
- BonoboObject parent_instance;
- GnomeSettingsDaemonPrivate *private;
-};
-
-struct _GnomeSettingsDaemonClass
-{
- BonoboObjectClass parent_class;
- POA_GNOME_SettingsDaemon__epv epv;
-};
-
-GType gnome_settings_daemon_get_type (void);
-GObject *gnome_settings_daemon_new (void);
-void gnome_settings_daemon_spawn_with_input (char **argv,
- const char *input);
-
-G_END_DECLS
-
-#endif /* __GNOME_SETTINGS_DAEMON_H */
diff --git a/gnome-settings-daemon/gnome-settings-default-editor.c b/gnome-settings-daemon/gnome-settings-default-editor.c
deleted file mode 100644
index 89b9b957d..000000000
--- a/gnome-settings-daemon/gnome-settings-default-editor.c
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * gnome-settings-default-editor.h: sync default editor changes to mime database
- *
- * Copyright 2002 Sun Microsystems, Inc.
- *
- * Author: jacob berkman <jacob@ximian.com>
- *
- */
-
-/*
- * WARNING: This is a hack.
- *
- * All it does is keep the "text / *" and "text/plain" mime type
- * handlers in sync with each other. The reason we do this is because
- * there is no UI for editing the text / * handler, and this is probably
- * what the user actually wants to do.
- */
-
-#include <config.h>
-
-#include "gnome-settings-daemon.h"
-#include "gnome-settings-default-editor.h"
-
-#include <libgnomevfs/gnome-vfs-mime-handlers.h>
-#include <libgnomevfs/gnome-vfs-mime-monitor.h>
-
-#include <string.h>
-
-/* #define DE_DEBUG */
-
-#define SYNC_CHANGES_KEY "/apps/gnome_settings_daemon/default_editor/sync_text_types"
-
-static gboolean sync_changes;
-
-#if DE_DEBUG
-static void
-print_mime_app (const char *mime_type)
-{
- GnomeVFSMimeApplication *mime_app;
-
- mime_app = gnome_vfs_mime_get_default_application (mime_type);
-
- g_message ("Default info for %s (%p):\n"
- "\t id: %s\n"
- "\t name: %s\n"
- "\t command: %s\n"
- "\tneeds term: %s\n",
- mime_type, mime_app,
- mime_app->id,
- mime_app->name,
- mime_app->command,
- mime_app->requires_terminal ? "Yes" : "No");
-}
-
-static void
-print_state (void)
-{
- if (sync_changes)
- g_message ("Synching changes.");
- else
- g_message ("Not synching changes.");
-
- print_mime_app ("text/*");
- print_mime_app ("text/plain");
-}
-#define PRINT_STATE print_state()
-#else
-#define PRINT_STATE
-#endif
-
-static void
-sync_changes_cb (GConfEntry *entry)
-{
- GConfValue *value = gconf_entry_get_value (entry);
- sync_changes = gconf_value_get_bool (value);
-
- PRINT_STATE;
-}
-
-static void
-vfs_change_cb (GnomeVFSMIMEMonitor *monitor, GConfClient *client)
-{
- GnomeVFSMimeApplication *star_app, *plain_app;
- GnomeVFSMimeActionType action;
-
- PRINT_STATE;
-
- if (!sync_changes_cb)
- return;
-
-
- star_app = gnome_vfs_mime_get_default_application ("text/*");
- plain_app = gnome_vfs_mime_get_default_application ("text/plain");
-
- if (star_app == NULL || plain_app == NULL)
- return;
- if (!strcmp (star_app->id, plain_app->id))
- return;
-
-#if DE_DEBUG
- g_message ("Synching text/plain to text/*...");
-#endif
-
- action = gnome_vfs_mime_get_default_action_type ("text/plain");
-
- gnome_vfs_mime_set_default_application ("text/*", plain_app->id);
- gnome_vfs_mime_set_default_action_type ("text/*", action);
-
- PRINT_STATE;
-}
-
-void
-gnome_settings_default_editor_init (GConfClient *client)
-{
- sync_changes = gconf_client_get_bool (client, SYNC_CHANGES_KEY, NULL);
-
- gnome_settings_daemon_register_callback (SYNC_CHANGES_KEY, sync_changes_cb);
-
- g_signal_connect (gnome_vfs_mime_monitor_get (), "data_changed",
- G_CALLBACK (vfs_change_cb), client);
-}
-
-void
-gnome_settings_default_editor_load (GConfClient *client)
-{
- vfs_change_cb (NULL, client);
-}
diff --git a/gnome-settings-daemon/gnome-settings-default-editor.h b/gnome-settings-daemon/gnome-settings-default-editor.h
deleted file mode 100644
index fd510fa94..000000000
--- a/gnome-settings-daemon/gnome-settings-default-editor.h
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * gnome-settings-default-editor.h: sync default editor changes to mime database
- *
- * Copyright 2002 Sun Microsystems, Inc.
- *
- * Author: jacob berkman <jacob@ximian.com>
- *
- */
-
-#ifndef GNOME_SETTINGS_DEFAULT_EDITOR_H
-#define GNOME_SETTINGS_DEFAULT_EDITOR_H
-
-#include <gconf/gconf-client.h>
-
-void gnome_settings_default_editor_init (GConfClient *client);
-void gnome_settings_default_editor_load (GConfClient *client);
-
-#endif /* GNOME_SETTINGS_DEFAULT_EDITOR_H */
diff --git a/gnome-settings-daemon/gnome-settings-font.c b/gnome-settings-daemon/gnome-settings-font.c
deleted file mode 100644
index dd02c608d..000000000
--- a/gnome-settings-daemon/gnome-settings-font.c
+++ /dev/null
@@ -1,208 +0,0 @@
-#include <config.h>
-#include <gdk/gdkx.h>
-#include <gconf/gconf.h>
-#include <libgnome/gnome-i18n.h>
-#include "gnome-settings-daemon.h"
-#include <dirent.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <dirent.h>
-#include <string.h>
-
-
-static void
-load_xcursor_theme (GConfClient *client)
-{
- gchar *cursor_theme;
- gint size;
- char *add[] = { "xrdb", "-merge", NULL };
- GString *add_string = g_string_new (NULL);
-
- cursor_theme = gconf_client_get_string (client,
- "/desktop/gnome/peripherals/mouse/cursor_theme",
- NULL);
- size = gconf_client_get_int (client,
- "/desktop/gnome/peripherals/mouse/cursor_size",
- NULL);
- if (cursor_theme == NULL || size <= 0)
- return;
-
- g_string_append_printf (add_string,
- "Xcursor.theme: %s\n", cursor_theme);
- g_string_append (add_string, "Xcursor.theme_core: true\n");
- g_string_append_printf (add_string,
- "Xcursor.size: %d\n", size);
-
- gnome_settings_daemon_spawn_with_input (add, add_string->str);
-
- g_string_free (add_string, TRUE);
-}
-
-static void
-load_cursor (GConfClient *client)
-{
- DIR *dir;
- gchar *font_dir_name;
- gchar *dir_name;
- struct dirent *file_dirent;
- gchar *cursor_font;
- gchar **font_path;
- gchar **new_font_path;
- gint n_fonts;
- gint new_n_fonts;
- gint i;
- gchar *mkfontdir_cmd;
-
- /* setting up the dir */
- font_dir_name = g_build_path (G_DIR_SEPARATOR_S, g_get_home_dir (), ".gnome2", NULL);
- if (! g_file_test (font_dir_name, G_FILE_TEST_EXISTS))
- mkdir (font_dir_name, 0755);
- g_free (font_dir_name);
-
- font_dir_name = g_build_path (G_DIR_SEPARATOR_S, g_get_home_dir (), ".gnome2/share", NULL);
- if (! g_file_test (font_dir_name, G_FILE_TEST_EXISTS))
- mkdir (font_dir_name, 0755);
- g_free (font_dir_name);
-
- font_dir_name = g_build_path (G_DIR_SEPARATOR_S, g_get_home_dir (), ".gnome2/share/fonts", NULL);
- if (! g_file_test (font_dir_name, G_FILE_TEST_EXISTS))
- mkdir (font_dir_name, 0755);
-
- if (! g_file_test (font_dir_name, G_FILE_TEST_IS_DIR))
- {
- GtkWidget *dialog;
-
- dialog = gtk_message_dialog_new (NULL,
- 0,
- GTK_MESSAGE_ERROR,
- GTK_BUTTONS_CLOSE,
- "Cannot create the directory \"%s\".\n"\
- "This is needed to allow changing cursors.",
- font_dir_name);
- gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
- g_free (font_dir_name);
-
- return;
- }
-
- dir_name = g_build_path (G_DIR_SEPARATOR_S, g_get_home_dir (), ".gnome2/share/cursor-fonts", NULL);
- if (! g_file_test (dir_name, G_FILE_TEST_EXISTS))
- mkdir (dir_name, 0755);
-
- if (! g_file_test (dir_name, G_FILE_TEST_IS_DIR))
- {
- GtkWidget *dialog;
-
- dialog = gtk_message_dialog_new (NULL,
- 0,
- GTK_MESSAGE_ERROR,
- GTK_BUTTONS_CLOSE,
- (_("Cannot create the directory \"%s\".\n"\
- "This is needed to allow changing cursors.")),
- dir_name);
- gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
- g_free (dir_name);
-
- return;
- }
-
- dir = opendir (dir_name);
-
- while ((file_dirent = readdir (dir)) != NULL)
- {
- struct stat st;
- gchar *link_name;
-
- link_name = g_build_filename (dir_name, file_dirent->d_name, NULL);
- if (lstat (link_name, &st))
- {
- g_free (link_name);
- continue;
- }
-
- if (S_ISLNK (st.st_mode))
- unlink (link_name);
- }
-
- closedir (dir);
-
- cursor_font = gconf_client_get_string (client,
- "/desktop/gnome/peripherals/mouse/cursor_font",
- NULL);
-
- if ((cursor_font != NULL) &&
- (g_file_test (cursor_font, G_FILE_TEST_IS_REGULAR)) &&
- (g_path_is_absolute (cursor_font)))
- {
- gchar *newpath;
- gchar *font_name;
-
- font_name = strrchr (cursor_font, G_DIR_SEPARATOR);
- newpath = g_build_filename (dir_name, font_name, NULL);
- symlink (cursor_font, newpath);
- g_free (newpath);
- }
- g_free (cursor_font);
-
-
- /* run mkfontdir */
- mkfontdir_cmd = g_strdup_printf ("mkfontdir %s %s", dir_name, font_dir_name);
- /* maybe check for error...
- * also, it's not going to like that if there are spaces in dir_name/font_dir_name.
- */
- g_spawn_command_line_sync (mkfontdir_cmd, NULL, NULL, NULL, NULL);
- g_free (mkfontdir_cmd);
-
- /* Set the font path */
- font_path = XGetFontPath (gdk_x11_get_default_xdisplay (), &n_fonts);
- new_n_fonts = n_fonts;
- if (n_fonts == 0 || strcmp (font_path[0], dir_name))
- new_n_fonts++;
- if (n_fonts == 0 || strcmp (font_path[n_fonts-1], font_dir_name))
- new_n_fonts++;
-
- new_font_path = g_new0 (gchar*, new_n_fonts);
- if (n_fonts == 0 || strcmp (font_path[0], dir_name))
- {
- new_font_path[0] = dir_name;
- for (i = 0; i < n_fonts; i++)
- new_font_path [i+1] = font_path [i];
- }
- else
- {
- for (i = 0; i < n_fonts; i++)
- new_font_path [i] = font_path [i];
- }
-
- if (n_fonts == 0 || strcmp (font_path[n_fonts-1], font_dir_name))
- {
- new_font_path[new_n_fonts-1] = font_dir_name;
- }
-
- gdk_error_trap_push ();
- XSetFontPath (gdk_display, new_font_path, new_n_fonts);
- gdk_flush ();
- gdk_error_trap_pop ();
-
- XFreeFontPath (font_path);
-
- g_free (new_font_path);
- g_free (font_dir_name);
- g_free (dir_name);
-}
-
-void
-gnome_settings_font_init (GConfClient *client)
-{
- load_xcursor_theme (client);
- load_cursor (client);
-}
-
-void
-gnome_settings_font_load (GConfClient *client)
-{
-
-}
diff --git a/gnome-settings-daemon/gnome-settings-font.h b/gnome-settings-daemon/gnome-settings-font.h
deleted file mode 100644
index 330e6c734..000000000
--- a/gnome-settings-daemon/gnome-settings-font.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Copyright © 2001 Jonathan Blandford <jrb@gnome.org>
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Red Hat not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission. Red Hat makes no representations about the
- * suitability of this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- *
- * Authors: Jonathan Blandford
- */
-
-#ifndef FONT_SETTINGS_H
-#define FONT_SETTINGS_H
-
-#include <gconf/gconf.h>
-
-void gnome_settings_font_init (GConfClient *client);
-void gnome_settings_font_load (GConfClient *client);
-
-#endif
diff --git a/gnome-settings-daemon/gnome-settings-gtk1theme.c b/gnome-settings-daemon/gnome-settings-gtk1theme.c
deleted file mode 100644
index f4b05280e..000000000
--- a/gnome-settings-daemon/gnome-settings-gtk1theme.c
+++ /dev/null
@@ -1,220 +0,0 @@
-/* -*- mode: c; style: linux -*- */
-
-/* gnome-settings-gtk1theme.c
- *
- * Copyright © 2002 Red Hat, Inc.
- *
- * Written by Owen Taylor <otaylor@redhat.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.
- */
-
-#include <errno.h>
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "gnome-settings-daemon.h"
-#include "gnome-settings-gtk1theme.h"
-
-#define GTK_THEME_KEY "/desktop/gnome/interface/gtk_theme"
-
-/* Given the theme filename, return the needed contents for the RC file
- * in the user's home directory
- */
-static char *
-make_contents (const char *filename)
-{
- GString *result = g_string_new (NULL);
-
- g_string_append (result,
- "# Autowritten by gnome-settings-daemon. Do not edit\n"
- "\n");
- if (filename)
- g_string_append_printf (result,
- "include \"%s\"\n"
- "\n",
- filename);
- g_string_append_printf (result,
- "include \"%s/.gtkrc.mine\"\n",
- g_get_home_dir ());
-
- return g_string_free (result, FALSE);
-}
-
-/* Writes @contents to @rc_filename atomically (using rename); returns
- * %TRUE on sucess
- */
-static gboolean
-write_contents (const char *rc_filename,
- const char *contents)
-{
- char *tmp_filename = g_strconcat (rc_filename, ".new", NULL);
- GIOChannel *channel;
- GError *err = NULL;
-
- channel = g_io_channel_new_file (tmp_filename, "w", &err);
- if (!channel) {
- g_warning ("Cannot open %s: %s", tmp_filename, err->message);
- goto bail2;
- }
-
- if (g_io_channel_write_chars (channel, contents, -1, NULL, &err) != G_IO_STATUS_NORMAL) {
- g_warning ("Cannot open %s: %s", tmp_filename, err->message);
- goto bail0;
- }
-
- if (g_io_channel_flush (channel, &err) != G_IO_STATUS_NORMAL) {
- g_warning ("Error flushing %s: %s", tmp_filename, err->message);
- goto bail0;
- }
-
- if (g_io_channel_shutdown (channel, TRUE, &err) != G_IO_STATUS_NORMAL) {
- g_warning ("Error closing %s: %s", tmp_filename, err->message);
- goto bail1;
- }
-
- if (rename (tmp_filename, rc_filename) < 0) {
- g_warning ("Cannot move %s to %s: %s", tmp_filename, rc_filename, g_strerror (errno));
- goto bail1;
-
- }
-
- g_free (tmp_filename);
-
- return TRUE;
-
- bail0:
- g_io_channel_shutdown (channel, FALSE, NULL);
- bail1:
- unlink (tmp_filename);
- bail2:
- g_clear_error (&err);
- g_free (tmp_filename);
-
- return FALSE;
-}
-
-/* Send a client message telling GTK+-1.2 apps to reread their RC files
- */
-static void
-send_change_message (void)
-{
- GdkEventClient sev;
- int i;
-
- for(i = 0; i < 5; i++)
- sev.data.l[i] = 0;
-
- sev.data_format = 32;
- sev.message_type = gdk_atom_intern("_GTK_READ_RCFILES", FALSE);
-
- gdk_event_send_clientmessage_toall ((GdkEvent *) &sev);
-}
-
-/* See if a theme called @theme exists in @base_dir. Takes ownership of @base_dir
- */
-static char *
-check_filename (char *base_dir,
- const char *theme)
-{
- char *theme_filename = g_build_filename (base_dir, theme, "gtk", "gtkrc", NULL);
-
- if (!g_file_test (theme_filename, G_FILE_TEST_EXISTS)) {
- g_free (theme_filename);
- theme_filename = NULL;
- }
-
- g_free (base_dir);
-
- return theme_filename;
-}
-
-static void
-apply_settings (void)
-{
- GConfClient *client = gconf_client_get_default ();
- gchar *current_theme;
- gchar *theme_filename;
- gchar *rc_filename;
- gchar *current_contents;
- gint current_length;
- gchar *new_contents;
- GError *err = NULL;
-
- current_theme = gconf_client_get_string (client, GTK_THEME_KEY, NULL);
- if (!current_theme)
- current_theme = g_strdup ("Default");
-
- /* Translate Default into Raleigh, since it's a better
- * match than the default gtk1 theme.
- */
- if (strcmp (current_theme, "Default") == 0) {
- g_free (current_theme);
- current_theme = g_strdup ("Raleigh");
- }
-
- /* Now look for a gtk1 theme with the name
- */
- theme_filename = check_filename (g_build_filename (g_get_home_dir (),".themes", NULL),
- current_theme);
-
- if (!theme_filename) {
- theme_filename = check_filename (g_build_filename (DATADIR, "themes", NULL),
- current_theme);
- }
-
- /* If we don't find a match, use Raleigh
- */
- if (!theme_filename) {
- theme_filename = check_filename (g_build_filename (DATADIR, "themes", NULL),
- "Raleigh");
- }
-
- rc_filename = g_build_filename (g_get_home_dir(), ".gtkrc-1.2-gnome2", NULL);
-
- if (!g_file_get_contents (rc_filename, &current_contents, &current_length, &err) &&
- !g_error_matches (err, G_FILE_ERROR, G_FILE_ERROR_NOENT)) {
- g_warning ("Can't get contents of %s: %s", rc_filename, err->message);
- g_clear_error (&err);
- }
-
- new_contents = make_contents (theme_filename);
-
- if (!current_contents ||
- current_length != strlen (new_contents) ||
- memcmp (current_contents, new_contents, current_length) != 0) {
- if (write_contents (rc_filename, new_contents))
- send_change_message ();
- }
-
- g_object_unref (client);
- g_free (new_contents);
- g_free (current_contents);
- g_free (rc_filename);
-}
-
-void
-gnome_settings_gtk1_theme_init (GConfClient *client)
-{
- gnome_settings_daemon_register_callback (GTK_THEME_KEY, (KeyCallbackFunc) apply_settings);
-}
-
-void
-gnome_settings_gtk1_theme_load (GConfClient *client)
-{
- apply_settings ();
-}
diff --git a/gnome-settings-daemon/gnome-settings-gtk1theme.h b/gnome-settings-daemon/gnome-settings-gtk1theme.h
deleted file mode 100644
index 36cd2354c..000000000
--- a/gnome-settings-daemon/gnome-settings-gtk1theme.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/* -*- mode: c; style: linux -*- */
-
-/* gnome-settings-keyboard.h
- *
- * Copyright © 2002 Red Hat, Inc.
- *
- * Written by Owen Taylor <otaylor@redhat.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 __GNOME_SETTINGS_GTK1THEME_H
-#define __GNOME_SETTINGS_GTK1THEME_H
-
-#include <gconf/gconf.h>
-#include <gconf/gconf-client.h>
-
-void gnome_settings_gtk1_theme_init (GConfClient *client);
-void gnome_settings_gtk1_theme_load (GConfClient *client);
-
-#endif
diff --git a/gnome-settings-daemon/gnome-settings-keybindings.c b/gnome-settings-daemon/gnome-settings-keybindings.c
deleted file mode 100644
index 22e3c8412..000000000
--- a/gnome-settings-daemon/gnome-settings-keybindings.c
+++ /dev/null
@@ -1,434 +0,0 @@
-#include <config.h>
-
-#include <string.h>
-#include <X11/keysym.h>
-#include <gdk/gdk.h>
-#include <gtk/gtk.h>
-#include <gdk/gdkx.h>
-#include <libgnome/gnome-i18n.h>
-#include "gnome-settings-daemon.h"
-#include "gnome-settings-keybindings.h"
-
-/* we exclude shift, GDK_CONTROL_MASK and GDK_MOD1_MASK since we know what
- these modifiers mean
- these are the mods whose combinations are bound by the keygrabbing code */
-#define IGNORED_MODS (0x2000 /*Xkb modifier*/ | GDK_LOCK_MASK | \
- GDK_MOD2_MASK | GDK_MOD3_MASK | GDK_MOD4_MASK | GDK_MOD5_MASK)
-/* these are the ones we actually use for global keys, we always only check
- * for these set */
-#define USED_MODS (GDK_SHIFT_MASK | GDK_CONTROL_MASK | GDK_MOD1_MASK)
-
-#define GCONF_BINDING_DIR "/desktop/gnome/keybindings"
-
-typedef struct {
- guint keysym;
- guint state;
- guint keycode;
-} Key;
-
-typedef struct {
- char *binding_str;
- char *action;
- char *gconf_key;
- Key key;
- Key previous_key;
-} Binding;
-
-static GSList *binding_list = NULL;
-static GSList *screens = NULL;
-
-static GSList *
-get_screens_list (void)
-{
- GdkDisplay *display = gdk_display_get_default();
- GSList *list = NULL;
- int i;
-
- if (gdk_display_get_n_screens (display) == 1) {
- list = g_slist_append (list, gdk_screen_get_default ());
- } else {
- for (i = 0; i < gdk_display_get_n_screens (display); i++) {
- GdkScreen *screen;
-
- screen = gdk_display_get_screen (display, i);
- if (screen != NULL) {
- list = g_slist_append (list, screen);
- }
- }
- }
-
- return list;
-}
-
-char *
-screen_exec_display_string (XEvent *xevent)
-{
- GString *str;
- const char *old_display;
- char *retval;
- char *p;
-
- GdkScreen *screen = NULL;
-
- GdkWindow *window = gdk_xid_table_lookup (xevent->xkey.root);
-
- if (window)
- screen = gdk_drawable_get_screen (GDK_DRAWABLE (window));
-
- g_assert (GDK_IS_SCREEN (screen));
-
- old_display = gdk_display_get_name (gdk_screen_get_display (screen));
-
- str = g_string_new ("DISPLAY=");
- g_string_append (str, old_display);
-
- p = strrchr (str->str, '.');
- if (p && p > strchr (str->str, ':'))
- g_string_truncate (str, p - str->str);
-
- g_string_append_printf (str, ".%d", gdk_screen_get_number (screen));
-
- retval = str->str;
-
- g_string_free (str, FALSE);
-
- return retval;
-}
-
-static gint
-compare_bindings (gconstpointer a, gconstpointer b)
-{
- Binding *key_a = (Binding*) a;
- char *key_b = (char*) b;
-
- return strcmp (key_b, key_a->gconf_key);
-}
-
-static gboolean
-parse_binding (Binding *binding)
-{
- g_return_val_if_fail (binding != NULL, FALSE);
-
- binding->key.keysym = 0;
- binding->key.state = 0;
-
- if (binding->binding_str == NULL ||
- binding->binding_str[0] == '\0' ||
- strcmp (binding->binding_str, "Disabled") == 0)
- return FALSE;
-
- gtk_accelerator_parse (binding->binding_str, &binding->key.keysym, &binding->key.state);
-
- if (binding->key.keysym == 0)
- return FALSE;
-
- binding->key.keycode = XKeysymToKeycode (GDK_DISPLAY (), binding->key.keysym);
-
- return TRUE;
-}
-
-gboolean
-bindings_get_entry (char *subdir)
-{
- GConfValue *value;
- Binding *new_binding;
- GSList *tmp_elem = NULL, *list = NULL, *li;
- char *gconf_key;
- char *action = NULL;
- char *key = NULL;
-
- g_return_val_if_fail (subdir != NULL, FALSE);
-
- /* value = gconf_entry_get_value (entry); */
- gconf_key = g_path_get_basename (subdir);
-
- if (!gconf_key)
- return FALSE;
-
- /* Get entries for this binding */
- list = gconf_client_all_entries (gconf_client_get_default (), subdir, NULL);
-
- for (li = list; li != NULL; li = li->next)
- {
- GConfEntry *entry = li->data;
- char *key_name = g_path_get_basename (gconf_entry_get_key (entry));
- if (strcmp (key_name, "action") == 0)
- {
- if (!action)
- {
- value = gconf_entry_get_value (entry);
- if (value->type != GCONF_VALUE_STRING)
- return FALSE;
- action = g_strdup (gconf_value_get_string (value));
- }
- else
- g_warning (_("Key Binding (%s) has its action defined multiple times\n"),
- gconf_key);
- }
- if (strcmp (key_name, "binding") == 0)
- {
- if (!key)
- {
- value = gconf_entry_get_value (entry);
- if (value->type != GCONF_VALUE_STRING)
- return FALSE;
- key = g_strdup (gconf_value_get_string (value));
- }
- else
- g_warning (_("Key Binding (%s) has its binding defined multiple times\n"),
- gconf_key);
- }
- }
- if (!action || !key)
- {
- g_warning (_("Key Binding (%s) is incomplete\n"), gconf_key);
- return FALSE;
- }
-
- tmp_elem = g_slist_find_custom (binding_list, gconf_key,
- compare_bindings);
-
- if (!tmp_elem)
- new_binding = g_new0 (Binding, 1);
- else
- {
- new_binding = (Binding*) tmp_elem->data;
- g_free (new_binding->binding_str);
- g_free (new_binding->action);
- }
-
- new_binding->binding_str = key;
- new_binding->action = action;
- new_binding->gconf_key = gconf_key;
-
- new_binding->previous_key.keysym = new_binding->key.keysym;
- new_binding->previous_key.state = new_binding->key.state;
- new_binding->previous_key.keycode = new_binding->key.keycode;
-
- if (parse_binding (new_binding))
- binding_list = g_slist_append (binding_list, new_binding);
- else
- {
- g_warning (_("Key Binding (%s) is invalid\n"), gconf_key);
- g_free (new_binding->binding_str);
- g_free (new_binding->action);
- return FALSE;
- }
- return TRUE;
-}
-
-static gboolean
-key_already_used (Binding *binding)
-{
- GSList *li;
-
- for (li = binding_list; li != NULL; li = li->next)
- {
- Binding *tmp_binding = (Binding*) li->data;
-
- if (tmp_binding != binding && tmp_binding->key.keycode == binding->key.keycode &&
- tmp_binding->key.state == binding->key.state)
- return TRUE;
- }
- return FALSE;
-}
-
-static void
-grab_key (GdkWindow *root, Key *key, int result, gboolean grab)
-{
- gdk_error_trap_push ();
- if (grab)
- XGrabKey (GDK_DISPLAY(), key->keycode, (result | key->state),
- GDK_WINDOW_XID (root), True, GrabModeAsync, GrabModeAsync);
- else
- XUngrabKey(GDK_DISPLAY(), key->keycode, (result | key->state),
- GDK_WINDOW_XID (root));
- gdk_flush ();
- if (gdk_error_trap_pop ()) {
- g_warning (_("It seems that another application already has"
- " access to key '%d'."), key->keycode);
- }
-}
-
-/* inspired from all_combinations from gnome-panel/gnome-panel/global-keys.c */
-#define N_BITS 32
-static void
-do_grab (gboolean grab,
- Key *key)
-{
- int indexes[N_BITS];/*indexes of bits we need to flip*/
- int i, bit, bits_set_cnt;
- int uppervalue;
- guint mask_to_traverse = IGNORED_MODS & ~ key->state;
-
- bit = 0;
- for (i = 0; i < N_BITS; i++) {
- if (mask_to_traverse & (1<<i))
- indexes[bit++]=i;
- }
-
- bits_set_cnt = bit;
-
- uppervalue = 1<<bits_set_cnt;
- for (i = 0; i < uppervalue; i++) {
- GSList *l;
- int j, result = 0;
-
- for (j = 0; j < bits_set_cnt; j++) {
- if (i & (1<<j))
- result |= (1<<indexes[j]);
- }
-
- for (l = screens; l ; l = l->next) {
- GdkScreen *screen = l->data;
- grab_key (gdk_screen_get_root_window (screen), key, result,
- grab);
- }
- }
-}
-
-void
-binding_register_keys ()
-{
- GSList *li;
-
- gdk_error_trap_push();
-
- /* Now check for changes and grab new key if not already used */
- for (li = binding_list ; li != NULL; li = li->next)
- {
- Binding *binding = (Binding *) li->data;
-
- if (binding->previous_key.keycode != binding->key.keycode ||
- binding->previous_key.state != binding->key.state)
- {
- /* Ungrab key if it changed and not clashing with previously set binding */
- if (!key_already_used (binding))
- {
- if (binding->previous_key.keycode)
- do_grab (FALSE, &binding->previous_key);
- do_grab (TRUE, &binding->key);
-
- binding->previous_key.keysym = binding->key.keysym;
- binding->previous_key.state = binding->key.state;
- binding->previous_key.keycode = binding->key.keycode;
- }
- else
- g_warning (_("Key Binding (%s) is already in use\n"), binding->binding_str);
- }
- }
- gdk_flush ();
- gdk_error_trap_pop();
-}
-
-static void
-bindings_callback (GConfEntry *entry)
-{
- /* ensure we get binding dir not a sub component */
- gchar** key_elems = g_strsplit (gconf_entry_get_key (entry), "/", 15);
- gchar* binding_entry = g_strdup_printf ("/%s/%s/%s/%s", key_elems[1],
- key_elems[2], key_elems[3],
- key_elems[4]);
- g_strfreev (key_elems);
-
- bindings_get_entry (binding_entry);
- g_free (binding_entry);
-
- binding_register_keys ();
-}
-
-GdkFilterReturn
-keybindings_filter (GdkXEvent *gdk_xevent,
- GdkEvent *event,
- gpointer data)
-{
- XEvent *xevent = (XEvent *)gdk_xevent;
- guint keycode, state;
- GSList *li;
-
- if(xevent->type != KeyPress)
- return GDK_FILTER_CONTINUE;
-
- keycode = xevent->xkey.keycode;
- state = xevent->xkey.state;
-
- for (li = binding_list; li != NULL; li = li->next)
- {
- Binding *binding = (Binding*) li->data;
-
- if (keycode == binding->key.keycode &&
- (state & USED_MODS) == binding->key.state)
- {
- GError* error = NULL;
- gboolean retval;
- gchar **argv = NULL;
- gchar **envp = NULL;
-
- g_return_val_if_fail (binding->action != NULL, GDK_FILTER_CONTINUE);
-
- if (!g_shell_parse_argv (binding->action,
- NULL, &argv,
- &error))
- return GDK_FILTER_CONTINUE;
-
- envp = g_new0 (gchar *, 2);
- envp [0] = screen_exec_display_string (xevent);
- envp [1] = NULL;
-
- retval = g_spawn_async (NULL,
- argv,
- envp,
- G_SPAWN_SEARCH_PATH,
- NULL,
- NULL,
- NULL,
- &error);
- g_strfreev (argv);
- g_strfreev (envp);
-
- if (!retval)
- {
- GtkWidget *dialog = gtk_message_dialog_new (NULL, 0, GTK_MESSAGE_WARNING,
- GTK_BUTTONS_CLOSE,
- _("Error while trying to run (%s)\n"\
- "which is linked to the key (%s)"),
- binding->action,
- binding->binding_str);
- g_signal_connect (dialog, "response",
- G_CALLBACK (gtk_widget_destroy),
- NULL);
- gtk_widget_show (dialog);
- }
- return GDK_FILTER_REMOVE;
- }
- }
- return GDK_FILTER_CONTINUE;
-}
-
-void
-gnome_settings_keybindings_init (GConfClient *client)
-{
- gnome_settings_daemon_register_callback (GCONF_BINDING_DIR, bindings_callback);
-
- gdk_window_add_filter (gdk_get_default_root_window (),
- keybindings_filter,
- NULL);
-}
-
-void
-gnome_settings_keybindings_load (GConfClient *client)
-{
- GSList *list, *li;
-
- list = gconf_client_all_dirs (client, GCONF_BINDING_DIR, NULL);
- screens = get_screens_list ();
-
- for (li = list; li != NULL; li = li->next)
- {
- char *subdir = li->data;
- li->data = NULL;
- bindings_get_entry (subdir);
- }
- binding_register_keys ();
-}
-
diff --git a/gnome-settings-daemon/gnome-settings-keybindings.h b/gnome-settings-daemon/gnome-settings-keybindings.h
deleted file mode 100644
index 3579cd685..000000000
--- a/gnome-settings-daemon/gnome-settings-keybindings.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/* gnome-settings-sound.h
- *
- * Copyright (C) 2002 Sun Microsystems Inc.
- *
- * 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.
- *
- * Author: Erwann Chénedé <erwann.chenede@sun.com>
- */
-
-
-#ifndef __GNOME_SETTINGS_KEYBINDINGS_H__
-#define __GNOME_SETTINGS_KEYBINDINGS_H__
-
-#include <gconf/gconf.h>
-void gnome_settings_keybindings_init (GConfClient *client);
-void gnome_settings_keybindings_load (GConfClient *client);
-
-#endif /*__GNOME_SETTINGS_KEYBINDINGS_H__*/
diff --git a/gnome-settings-daemon/gnome-settings-keyboard.c b/gnome-settings-daemon/gnome-settings-keyboard.c
deleted file mode 100644
index 7efc8bab1..000000000
--- a/gnome-settings-daemon/gnome-settings-keyboard.c
+++ /dev/null
@@ -1,157 +0,0 @@
-/* -*- mode: c; style: linux -*- */
-
-/* gnome-settings-keyboard.c
- *
- * Copyright © 2001 Ximian, Inc.
- *
- * Written by Bradford Hovinen <hovinen@ximian.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.
- */
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <gdk/gdk.h>
-#include <gdk/gdkx.h>
-#include <gconf/gconf-client.h>
-
-#include "gnome-settings-keyboard.h"
-#include "gnome-settings-daemon.h"
-
-#ifdef HAVE_X11_EXTENSIONS_XF86MISC_H
-# include <X11/extensions/xf86misc.h>
-#endif
-#ifdef HAVE_X11_EXTENSIONS_XKB_H
-#include <X11/XKBlib.h>
-#endif
-
-#include <string.h>
-
-#ifdef HAVE_X11_EXTENSIONS_XF86MISC_H
-static gboolean
-xfree86_set_keyboard_autorepeat_rate (int delay, int rate)
-{
- gboolean res = FALSE;
- int event_base_return, error_base_return;
-
- if (XF86MiscQueryExtension (GDK_DISPLAY (),
- &event_base_return,
- &error_base_return) == True)
- {
- /* load the current settings */
- XF86MiscKbdSettings kbdsettings;
- XF86MiscGetKbdSettings (GDK_DISPLAY (), &kbdsettings);
-
- /* assign the new values */
- kbdsettings.delay = delay;
- kbdsettings.rate = rate;
- XF86MiscSetKbdSettings (GDK_DISPLAY (), &kbdsettings);
- res = TRUE;
- }
-
- return res;
-}
-#endif /* HAVE_X11_EXTENSIONS_XF86MISC_H */
-#ifdef HAVE_X11_EXTENSIONS_XKB_H
-static gboolean
-xkb_set_keyboard_autorepeat_rate (int delay, int rate)
-{
- int interval = (rate <= 0) ? 1000000 : 1000/rate;
- if (delay <= 0) delay = 1;
- return XkbSetAutoRepeatRate (GDK_DISPLAY (), XkbUseCoreKbd,
- delay, interval);
-}
-#endif
-
-static void
-apply_settings (void)
-{
- GConfClient *client;
-
- gboolean repeat, click;
- int rate, delay;
- int click_volume, bell_volume, bell_pitch, bell_duration;
- const char *volume_string;
-
- XKeyboardControl kbdcontrol;
-
- client = gconf_client_get_default ();
-
- repeat = gconf_client_get_bool (client, "/desktop/gnome/peripherals/keyboard/repeat", NULL);
- click = gconf_client_get_bool (client, "/desktop/gnome/peripherals/keyboard/click", NULL);
- rate = gconf_client_get_int (client, "/desktop/gnome/peripherals/keyboard/rate", NULL);
- delay = gconf_client_get_int (client, "/desktop/gnome/peripherals/keyboard/delay", NULL);
- click_volume = gconf_client_get_int (client, "/desktop/gnome/peripherals/keyboard/click_volume", NULL);
-#if 0
- bell_volume = gconf_client_get_int (client, "/desktop/gnome/peripherals/keyboard/bell_volume", NULL);
-#endif
- bell_pitch = gconf_client_get_int (client, "/desktop/gnome/peripherals/keyboard/bell_pitch", NULL);
- bell_duration = gconf_client_get_int (client, "/desktop/gnome/peripherals/keyboard/bell_duration", NULL);
-
- volume_string = gconf_client_get_string (client, "/desktop/gnome/peripherals/keyboard/bell_mode", NULL);
- bell_volume = (volume_string && !strcmp (volume_string, "on")) ? 50 : 0;
-
- gdk_error_trap_push ();
- if (repeat) {
- gboolean rate_set = FALSE;
-
- XAutoRepeatOn (GDK_DISPLAY ());
- /* Use XKB in preference */
-#if defined (HAVE_X11_EXTENSIONS_XKB_H)
- rate_set = xkb_set_keyboard_autorepeat_rate (delay, rate);
-#endif
-#ifdef HAVE_X11_EXTENSIONS_XF86MISC_H
- if (!rate_set)
- rate_set = xfree86_set_keyboard_autorepeat_rate (delay, rate);
-#endif
- if (!rate_set)
- g_warning ("Neither XKeyboard not Xfree86's keyboard extensions are available,\n"
- "no way to support keyboard autorepeat rate settings");
- } else
- XAutoRepeatOff (GDK_DISPLAY ());
-
- /* as percentage from 0..100 inclusive */
- if (click_volume < 0)
- click_volume = 0;
- else if (click_volume > 100)
- click_volume = 100;
- kbdcontrol.key_click_percent = click ? click_volume : 0;
- kbdcontrol.bell_percent = bell_volume;
- kbdcontrol.bell_pitch = bell_pitch;
- kbdcontrol.bell_duration = bell_duration;
- XChangeKeyboardControl (GDK_DISPLAY (),
- KBKeyClickPercent | KBBellPercent | KBBellPitch | KBBellDuration,
- &kbdcontrol);
-
- XSync (GDK_DISPLAY (), FALSE);
- gdk_error_trap_pop ();
-}
-
-
-void
-gnome_settings_keyboard_init (GConfClient *client)
-{
- gnome_settings_daemon_register_callback ("/desktop/gnome/peripherals/keyboard", (KeyCallbackFunc) apply_settings);
-}
-
-void
-gnome_settings_keyboard_load (GConfClient *client)
-{
- apply_settings ();
-}
-
diff --git a/gnome-settings-daemon/gnome-settings-keyboard.h b/gnome-settings-daemon/gnome-settings-keyboard.h
deleted file mode 100644
index 503081bea..000000000
--- a/gnome-settings-daemon/gnome-settings-keyboard.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/* -*- mode: c; style: linux -*- */
-
-/* gnome-settings-keyboard.h
- *
- * Copyright © 2001 Ximian, Inc.
- *
- * Written by Bradford Hovinen <hovinen@ximian.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 __GNOME_SETTINGS_KEYBOARD_H
-#define __GNOME_SETTINGS_KEYBOARD_H
-
-#include <gconf/gconf.h>
-#include <gconf/gconf-client.h>
-
-void gnome_settings_keyboard_init (GConfClient *client);
-void gnome_settings_keyboard_load (GConfClient *client);
-
-#endif
diff --git a/gnome-settings-daemon/gnome-settings-locate-pointer.c b/gnome-settings-daemon/gnome-settings-locate-pointer.c
deleted file mode 100644
index 0ae80eb99..000000000
--- a/gnome-settings-daemon/gnome-settings-locate-pointer.c
+++ /dev/null
@@ -1,227 +0,0 @@
-#include <gtk/gtk.h>
-
-#include "gnome-settings-locate-pointer.h"
-#include "gnome-settings-daemon.h"
-
-#define LARGE_SIZE 101
-#define SMALL_SIZE 51
-
-typedef enum {
- STAGE_ONE,
- STAGE_TWO,
- STAGE_THREE,
- STAGE_FOUR,
- STAGE_DONE
-} LocatePointerStage;
-
-static LocatePointerStage stage;
-static GdkWindow *window = NULL;
-static gint cursor_x, cursor_y;
-static guint locate_pointer_id = 0;
-
-static gint
-locate_pointer_expose (GtkWidget *widget,
- GdkEventExpose *event,
- gpointer data)
-{
- gint size;
- GdkPoint points[4];
-
- if (event->window != window)
- return FALSE;
-
- switch (stage)
- {
- case STAGE_ONE:
- case STAGE_TWO:
- size = LARGE_SIZE;
- break;
- case STAGE_THREE:
- case STAGE_FOUR:
- size = SMALL_SIZE;
- break;
- default:
- return FALSE;
- }
-
- gdk_draw_rectangle (event->window,
- widget->style->black_gc,
- TRUE,
- 0, 0, size, size);
- switch (stage)
- {
- case STAGE_ONE:
- case STAGE_THREE:
- gdk_draw_rectangle (event->window,
- widget->style->white_gc,
- FALSE,
- 1, 1, size - 3, size - 3);
- break;
- case STAGE_TWO:
- case STAGE_FOUR:
- points[0].x = size/2;
- points[0].y = 0 + 1;
- points[1].x = size - 2;
- points[1].y = size/2;
- points[2].x = size/2;
- points[2].y = size - 2;
- points[3].x = 0 + 1;
- points[3].y = size/2;
- gdk_draw_polygon (event->window,
- widget->style->white_gc,
- FALSE, points, 4);
- break;
- default:
- g_assert_not_reached ();
- }
-
- return TRUE;
-}
-
-static void
-setup_window (void)
-{
- gint size;
- GdkBitmap *mask;
- GdkGC *gc;
- GdkColor col;
- GdkPoint points[4];
-
- gdk_window_hide (window);
- switch (stage)
- {
- case STAGE_ONE:
- case STAGE_TWO:
- size = LARGE_SIZE;
- break;
- case STAGE_THREE:
- case STAGE_FOUR:
- size = SMALL_SIZE;
- break;
- default:
- return;
- }
-
- gdk_window_move_resize (window,
- cursor_x - size/2,
- cursor_y - size/2,
- size, size);
- mask = gdk_pixmap_new (window, size, size, 1);
- gc = gdk_gc_new (mask);
- switch (stage)
- {
- case STAGE_ONE:
- case STAGE_THREE:
- col.pixel = 1;
- gdk_gc_set_foreground (gc, &col);
- gdk_draw_rectangle (mask, gc, TRUE, 0, 0, size, size);
- col.pixel = 0;
- gdk_gc_set_foreground (gc, &col);
- gdk_draw_rectangle (mask, gc, TRUE, 3, 3, size - 6, size - 6);
- break;
- case STAGE_TWO:
- case STAGE_FOUR:
- col.pixel = 0;
- gdk_gc_set_foreground (gc, &col);
- gdk_draw_rectangle (mask, gc, TRUE, 0, 0, size, size);
- col.pixel = 1;
- gdk_gc_set_foreground (gc, &col);
- points[0].x = size/2;
- points[0].y = 0;
- points[1].x = size - 1;
- points[1].y = size/2;
- points[2].x = size/2;
- points[2].y = size - 1;
- points[3].x = 0;
- points[3].y = size/2;
- gdk_draw_polygon (mask, gc, FALSE, points, 4);
- points[0].x = size/2;
- points[0].y = 0 + 1;
- points[1].x = size - 2;
- points[1].y = size/2;
- points[2].x = size/2;
- points[2].y = size - 2;
- points[3].x = 0 + 1;
- points[3].y = size/2;
- gdk_draw_polygon (mask, gc, FALSE, points, 4);
- points[0].x = size/2;
- points[0].y = 0 + 2;
- points[1].x = size - 3;
- points[1].y = size/2;
- points[2].x = size/2;
- points[2].y = size - 3;
- points[3].x = 0 + 2;
- points[3].y = size/2;
- gdk_draw_polygon (mask, gc, FALSE, points, 4);
- break;
- default:
- g_assert_not_reached ();
- }
-
- gdk_window_shape_combine_mask (window, mask, 0, 0);
- g_object_unref (G_OBJECT (gc));
- g_object_unref (G_OBJECT (mask));
- gdk_window_show (window);
-}
-
-static void
-create_window (GdkScreen *screen)
-{
- GdkWindowAttr attributes;
- GtkWidget *invisible;
-
- invisible = gtk_invisible_new_for_screen (screen);
-
- attributes.window_type = GDK_WINDOW_TEMP;
- attributes.wclass = GDK_INPUT_OUTPUT;
- attributes.visual = gtk_widget_get_visual (invisible);
- attributes.colormap = gtk_widget_get_colormap (invisible);
- attributes.event_mask = GDK_VISIBILITY_NOTIFY_MASK | GDK_EXPOSURE_MASK;
- attributes.width = 1;
- attributes.height = 1;
- window = gdk_window_new (gdk_screen_get_root_window (screen),
- &attributes,
- GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP);
- gdk_window_set_user_data (window, invisible);
- g_signal_connect (G_OBJECT (invisible),
- "expose_event",
- (GCallback) locate_pointer_expose,
- NULL);
-}
-
-static gboolean
-locate_pointer_timeout (gpointer data)
-{
- stage++;
- if (stage == STAGE_DONE)
- {
- gdk_window_hide (window);
- locate_pointer_id = 0;
- return FALSE;
- }
- setup_window ();
- return TRUE;
-}
-
-void
-gnome_settings_locate_pointer (GdkScreen *screen)
-{
- gdk_window_get_pointer (gdk_screen_get_root_window (screen), &cursor_x, &cursor_y, NULL);
-
- if (locate_pointer_id)
- gtk_timeout_remove (locate_pointer_id);
-
- /* Create the window if it is not created OR if it is not for the
- * current screen.
- */
-
- if (window == NULL)
- create_window (screen);
- else if( gdk_screen_get_number (screen) != gdk_screen_get_number (gdk_drawable_get_screen (window)))
- create_window (screen);
-
- stage = STAGE_ONE;
- setup_window ();
- gdk_window_show (window);
- locate_pointer_id = gtk_timeout_add (100, locate_pointer_timeout, NULL);
-}
diff --git a/gnome-settings-daemon/gnome-settings-locate-pointer.h b/gnome-settings-daemon/gnome-settings-locate-pointer.h
deleted file mode 100644
index e07f14f61..000000000
--- a/gnome-settings-daemon/gnome-settings-locate-pointer.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Copyright © 2001 Jonathan Blandford <jrb@gnome.org>
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Red Hat not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission. Red Hat makes no representations about the
- * suitability of this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- *
- * Authors: Jonathan Blandford
- */
-
-#ifndef LOCATE_POINTER_H
-#define LOCATE_POINTER_H
-
-void gnome_settings_locate_pointer (GdkScreen *screen);
-
-#endif
diff --git a/gnome-settings-daemon/gnome-settings-mouse.c b/gnome-settings-daemon/gnome-settings-mouse.c
deleted file mode 100644
index e056aae1b..000000000
--- a/gnome-settings-daemon/gnome-settings-mouse.c
+++ /dev/null
@@ -1,282 +0,0 @@
-#include <gdk/gdk.h>
-#include <gdk/gdkx.h>
-#include <gconf/gconf.h>
-#include <math.h>
-#include <gdk/gdkkeysyms.h>
-#include <X11/keysym.h>
-#include <string.h>
-#include "gnome-settings-locate-pointer.h"
-#include "gnome-settings-daemon.h"
-
-#define DEFAULT_PTR_MAP_SIZE 128
-
-static void
-set_left_handed (gboolean left_handed)
-{
- unsigned char *buttons;
- gint n_buttons, i;
- gint idx_1 = 0, idx_3 = 1;
-
- buttons = g_alloca (DEFAULT_PTR_MAP_SIZE);
- n_buttons = XGetPointerMapping (GDK_DISPLAY (), buttons, DEFAULT_PTR_MAP_SIZE);
- if (n_buttons > DEFAULT_PTR_MAP_SIZE) {
- buttons = g_alloca (n_buttons);
- n_buttons = XGetPointerMapping (GDK_DISPLAY (), buttons, n_buttons);
- }
-
- for (i = 0; i < n_buttons; i++)
- {
- if (buttons[i] == 1)
- idx_1 = i;
- else if (buttons[i] == ((n_buttons < 3) ? 2 : 3))
- idx_3 = i;
- }
-
- if ((left_handed && idx_1 < idx_3) ||
- (!left_handed && idx_1 > idx_3))
- {
- buttons[idx_1] = ((n_buttons < 3) ? 2 : 3);
- buttons[idx_3] = 1;
- }
-
- XSetPointerMapping (GDK_DISPLAY (), buttons, n_buttons);
-}
-
-static void
-set_motion_acceleration (gfloat motion_acceleration)
-{
- gint numerator, denominator;
-
- if (motion_acceleration >= 1.0)
- {
- /* we want to get the acceleration, with a resolution of 0.5
- */
- if ((motion_acceleration - floor (motion_acceleration)) < 0.25)
- {
- numerator = floor (motion_acceleration);
- denominator = 1;
- }
- else if ((motion_acceleration - floor (motion_acceleration)) < 0.5)
- {
- numerator = ceil (2.0 * motion_acceleration);
- denominator = 2;
- }
- else if ((motion_acceleration - floor (motion_acceleration)) < 0.75)
- {
- numerator = floor (2.0 *motion_acceleration);
- denominator = 2;
- }
- else
- {
- numerator = ceil (motion_acceleration);
- denominator = 1;
- }
- }
- else if (motion_acceleration < 1.0 && motion_acceleration > 0)
- {
- /* This we do to 1/10ths */
- numerator = floor (motion_acceleration * 10) + 1;
- denominator= 10;
- }
- else
- {
- numerator = -1;
- denominator = -1;
- }
-
- XChangePointerControl (GDK_DISPLAY (), True, False,
- numerator, denominator,
- 0);
-}
-
-static void
-set_motion_threshold (gint motion_threshold)
-{
- XChangePointerControl (GDK_DISPLAY (), False, True,
- 0, 0, motion_threshold);
-}
-
-
-#define KEYBOARD_GROUP_SHIFT 13
-#define KEYBOARD_GROUP_MASK ((1 << 13) | (1 << 14))
-
-/* Owen magic */
-static GdkFilterReturn
-filter (GdkXEvent *xevent,
- GdkEvent *event,
- gpointer data)
-{
- XEvent *xev = (XEvent *) xevent;
- guint keyval;
- gint group;
-
- GdkScreen *screen = (GdkScreen *)data;
-
- if (xev->type == KeyPress ||
- xev->type == KeyRelease)
- {
- /* get the keysym */
- group = (xev->xkey.state & KEYBOARD_GROUP_MASK) >> KEYBOARD_GROUP_SHIFT;
- gdk_keymap_translate_keyboard_state (gdk_keymap_get_default (),
- xev->xkey.keycode,
- xev->xkey.state,
- group,
- &keyval,
- NULL, NULL, NULL);
- if (keyval == GDK_Control_L || keyval == GDK_Control_R)
- {
- if (xev->type == KeyPress)
- {
- XAllowEvents (gdk_x11_get_default_xdisplay (),
- SyncKeyboard,
- xev->xkey.time);
- }
- else
- {
- XAllowEvents (gdk_x11_get_default_xdisplay (),
- AsyncKeyboard,
- xev->xkey.time);
- gnome_settings_locate_pointer (screen);
- }
- }
- else
- {
- XAllowEvents (gdk_x11_get_default_xdisplay (),
- ReplayKeyboard,
- xev->xkey.time);
- XUngrabKeyboard (gdk_x11_get_default_xdisplay (),
- xev->xkey.time);
- }
-
- return GDK_FILTER_REMOVE;
- }
- return GDK_FILTER_CONTINUE;
-}
-
-static void
-set_locate_pointer (gboolean locate_pointer)
-{
- GdkKeymapKey *keys;
- GdkDisplay *display;
- int n_screens;
- int n_keys;
- gboolean has_entries;
- static const guint keyvals[] = { GDK_Control_L, GDK_Control_R };
- unsigned j;
-
- display = gdk_display_get_default ();
- n_screens = gdk_display_get_n_screens (display);
-
- for (j = 0 ; j < G_N_ELEMENTS (keyvals) ; j++) {
- has_entries = gdk_keymap_get_entries_for_keyval (gdk_keymap_get_default (),
- keyvals[j],
- &keys,
- &n_keys);
- if (has_entries)
- {
- gint i, j;
-
- for (i = 0; i < n_keys; i++)
- {
- for(j=0; j< n_screens; j++)
- {
- GdkScreen *screen = gdk_display_get_screen (display, j);
- Window xroot = gdk_x11_drawable_get_xid (gdk_screen_get_root_window (screen));
-
- if (locate_pointer)
- {
- XGrabKey (GDK_DISPLAY_XDISPLAY (display),
- keys[i].keycode,
- 0,
- xroot,
- False,
- GrabModeAsync,
- GrabModeSync);
- XGrabKey (GDK_DISPLAY_XDISPLAY (display),
- keys[i].keycode,
- LockMask,
- xroot,
- False,
- GrabModeAsync,
- GrabModeSync);
- }
- else
- {
- XUngrabKey (GDK_DISPLAY_XDISPLAY (display),
- keys[i].keycode,
- LockMask,
- xroot);
- XUngrabKey (GDK_DISPLAY_XDISPLAY (display),
- keys[i].keycode,
- 0,
- xroot);
- }
- }
- }
- g_free (keys);
- if (locate_pointer)
- {
- for (i = 0; i < n_screens; i++)
- {
- GdkScreen *screen;
- screen = gdk_display_get_screen (display, i);
- gdk_window_add_filter (gdk_screen_get_root_window (screen),
- filter,
- screen);
- }
- }
- else
- {
- for (i = 0; i < n_screens; i++)
- {
- GdkScreen *screen;
- screen = gdk_display_get_screen (display, i);
- gdk_window_remove_filter (gdk_screen_get_root_window (screen),
- filter,
- screen);
- }
- }
- }
- }
-}
-
-static void
-mouse_callback (GConfEntry *entry)
-{
- if (! strcmp (entry->key, "/desktop/gnome/peripherals/mouse/left_handed"))
- {
- if (entry->value->type == GCONF_VALUE_BOOL)
- set_left_handed (gconf_value_get_bool (entry->value));
- }
- else if (! strcmp (entry->key, "/desktop/gnome/peripherals/mouse/motion_acceleration"))
- {
- if (entry->value->type == GCONF_VALUE_FLOAT)
- set_motion_acceleration (gconf_value_get_float (entry->value));
- }
- else if (! strcmp (entry->key, "/desktop/gnome/peripherals/mouse/motion_threshold"))
- {
- if (entry->value->type == GCONF_VALUE_INT)
- set_motion_threshold (gconf_value_get_int (entry->value));
- }
- else if (! strcmp (entry->key, "/desktop/gnome/peripherals/mouse/locate_pointer"))
- {
- if (entry->value->type == GCONF_VALUE_BOOL)
- set_locate_pointer (gconf_value_get_bool (entry->value));
- }
-}
-
-void
-gnome_settings_mouse_init (GConfClient *client)
-{
- gnome_settings_daemon_register_callback ("/desktop/gnome/peripherals/mouse", mouse_callback);
-}
-
-
-void
-gnome_settings_mouse_load (GConfClient *client)
-{
- set_left_handed (gconf_client_get_bool (client, "/desktop/gnome/peripherals/mouse/left_handed", NULL));
- set_motion_acceleration (gconf_client_get_float (client, "/desktop/gnome/peripherals/mouse/motion_acceleration", NULL));
- set_motion_threshold (gconf_client_get_int (client, "/desktop/gnome/peripherals/mouse/motion_threshold", NULL));
- set_locate_pointer (gconf_client_get_bool (client, "/desktop/gnome/peripherals/mouse/locate_pointer", NULL));
-}
diff --git a/gnome-settings-daemon/gnome-settings-mouse.h b/gnome-settings-daemon/gnome-settings-mouse.h
deleted file mode 100644
index 5974a6090..000000000
--- a/gnome-settings-daemon/gnome-settings-mouse.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Copyright © 2001 Jonathan Blandford <jrb@gnome.org>
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Red Hat not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission. Red Hat makes no representations about the
- * suitability of this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- *
- * Authors: Jonathan Blandford
- */
-
-#ifndef MOUSE_SETTINGS_H
-#define MOUSE_SETTINGS_H
-
-#include <gconf/gconf.h>
-
-void gnome_settings_mouse_init (GConfClient *client);
-void gnome_settings_mouse_load (GConfClient *client);
-
-#endif
diff --git a/gnome-settings-daemon/gnome-settings-screensaver.c b/gnome-settings-daemon/gnome-settings-screensaver.c
deleted file mode 100644
index 535420ab9..000000000
--- a/gnome-settings-daemon/gnome-settings-screensaver.c
+++ /dev/null
@@ -1,120 +0,0 @@
-/* -*- mode: c; style: linux -*- */
-
-/* gnome-settings-screensaver.c
- *
- * Copyright (C) 2002 Sun Microsystems, Inc.
- *
- * Written by Jacob Berkman <jacob@ximian.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.
- */
-
-#include <config.h>
-
-#include <libgnome/gnome-i18n.h>
-#include "gnome-settings-screensaver.h"
-
-#include <gtk/gtkcheckbutton.h>
-#include <gtk/gtkbox.h>
-#include <gtk/gtkmessagedialog.h>
-
-#define START_SCREENSAVER_KEY "/apps/gnome_settings_daemon/screensaver/start_screensaver"
-#define SHOW_STARTUP_ERRORS_KEY "/apps/gnome_settings_daemon/screensaver/show_startup_errors"
-#define XSCREENSAVER_COMMAND "xscreensaver -nosplash"
-
-void
-gnome_settings_screensaver_init (GConfClient *client)
-{
- /*
- * do nothing.
- *
- * our settings only apply to startup, and the screensaver
- * settings are all in xscreensaver and not gconf.
- *
- * we could have xscreensaver-demo run gconftool-2 directly,
- * and start / stop xscreensaver here
- *
- */
-}
-
-static void
-key_toggled_cb (GtkWidget *toggle, gpointer data)
-{
- GConfClient *client;
-
- client = gconf_client_get_default ();
- gconf_client_set_bool (client,
- SHOW_STARTUP_ERRORS_KEY,
- gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (toggle))
- ? 0 : 1,
- NULL);
-}
-
-void
-gnome_settings_screensaver_load (GConfClient *client)
-{
- GError *gerr = NULL;
- gboolean start_screensaver;
- gboolean show_error;
- GtkWidget *dialog, *toggle;
-
- start_screensaver = gconf_client_get_bool (client, START_SCREENSAVER_KEY, NULL);
-
- if (!start_screensaver)
- return;
-
- if (g_spawn_command_line_async (XSCREENSAVER_COMMAND, &gerr))
- return;
-
- show_error = gconf_client_get_bool (client, SHOW_STARTUP_ERRORS_KEY, NULL);
- if (!show_error) {
- g_error_free (gerr);
- return;
- }
-
- dialog = gtk_message_dialog_new (NULL,
- 0,
- GTK_MESSAGE_ERROR,
- GTK_BUTTONS_OK,
- _("There was an error starting up the screensaver:\n\n"
- "%s\n\n"
- "Screensaver functionality will not work in this session."),
- gerr->message);
-
- g_signal_connect (dialog, "response",
- G_CALLBACK (gtk_widget_destroy),
- NULL);
-
- toggle = gtk_check_button_new_with_mnemonic (
- _("_Do not show this message again"));
- gtk_widget_show (toggle);
-
- if (gconf_client_key_is_writable (client, SHOW_STARTUP_ERRORS_KEY, NULL))
- g_signal_connect (toggle, "toggled",
- G_CALLBACK (key_toggled_cb),
- NULL);
- else
- gtk_widget_set_sensitive (toggle, FALSE);
-
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox),
- toggle,
- FALSE, FALSE, 0);
-
- gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK);
-
- gtk_widget_show (dialog);
-}
-
diff --git a/gnome-settings-daemon/gnome-settings-screensaver.h b/gnome-settings-daemon/gnome-settings-screensaver.h
deleted file mode 100644
index 2b8846506..000000000
--- a/gnome-settings-daemon/gnome-settings-screensaver.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/* -*- mode: c; style: linux -*- */
-
-/* gnome-settings-screensaver.h
- *
- * Copyright (C) 2002 Sun Microsystems, Inc.
- *
- * Written by Jacob Berkman <jacob@ximian.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 GNOME_SETTINGS_SCREENSAVER_H
-#define GNOME_SETTINGS_SCREENSAVER_H
-
-#include <gconf/gconf-client.h>
-
-void gnome_settings_screensaver_init (GConfClient *client);
-void gnome_settings_screensaver_load (GConfClient *client);
-
-#endif
diff --git a/gnome-settings-daemon/gnome-settings-sound.c b/gnome-settings-daemon/gnome-settings-sound.c
deleted file mode 100644
index 8cdad2c53..000000000
--- a/gnome-settings-daemon/gnome-settings-sound.c
+++ /dev/null
@@ -1,191 +0,0 @@
-/* -*- mode: c; style: linux -*- */
-
-/* gnome-settings-sound.c
- *
- * Copyright © 2001 Ximian, Inc.
- *
- * Written by Rachel Hestilow <hestilow@ximian.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.
- */
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <string.h>
-#include <stdlib.h>
-#include <time.h>
-#include <esd.h>
-#include <sys/types.h>
-
-#include <gconf/gconf-client.h>
-#include <libgnome/gnome-i18n.h>
-#include <libgnome/gnome-sound.h>
-#include <libgnome/gnome-util.h>
-#include <libgnome/gnome-exec.h>
-#include <libgnomeui/gnome-client.h>
-#include "libsounds/sound-properties.h"
-#include "gnome-settings-sound.h"
-#include "gnome-settings-daemon.h"
-
-/* start_esd
- *
- * Start the Enlightenment Sound Daemon.
- */
-static void
-start_esd (void)
-{
- int esdpid;
- static const char *esd_cmdline[] = {ESD_SERVER, "-nobeeps", NULL};
- char *tmpargv[3];
- char argbuf[32];
- time_t starttime;
- GnomeClient *client = gnome_master_client ();
-
- esdpid = gnome_execute_async (NULL, 2, (char **)esd_cmdline);
- g_snprintf (argbuf, sizeof (argbuf), "%d", esdpid);
- tmpargv[0] = "kill"; tmpargv[1] = argbuf; tmpargv[2] = NULL;
- gnome_client_set_shutdown_command (client, 2, tmpargv);
- starttime = time (NULL);
- gnome_sound_init (NULL);
-
- while (gnome_sound_connection_get () < 0
- && ((time(NULL) - starttime) < 4))
- {
-#ifdef HAVE_USLEEP
- usleep(1000);
-#endif
- gnome_sound_init(NULL);
- }
-}
-
-static gboolean set_standby = TRUE;
-
-/* stop_esd
- *
- * Stop the Enlightenment Sound Daemon.
- */
-static void
-stop_esd (void)
-{
- /* Can't think of a way to do this reliably, so we fake it for now */
- esd_standby (gnome_sound_connection_get ());
- set_standby = TRUE;
-}
-
-/* reload_foreach_cb
- *
- * For a given SoundEvent, reload the sound file associate with the event.
- */
-static void
-reload_foreach_cb (SoundEvent *event, gpointer data)
-{
- gchar *file, *tmp, *key;
- int sid;
-
- key = sound_event_compose_key (event);
- /* We need to free up the old sample, because
- * esd allows multiple samples with the same name,
- * putting memory to waste. */
- sid = esd_sample_getid(gnome_sound_connection_get (), key);
- if (sid >= 0)
- esd_sample_free(gnome_sound_connection_get (), sid);
-
- if (!event->file || !strcmp (event->file, ""))
- return;
-
- file = g_strdup (event->file);
- if (file[0] != '/')
- {
- tmp = gnome_program_locate_file (NULL, GNOME_FILE_DOMAIN_SOUND, file, TRUE, NULL);
- g_free (file);
- file = tmp;
- }
-
- if (!file)
- {
- g_free (key);
- return;
- }
-
- sid = gnome_sound_sample_load (key, file);
-
- if (sid < 0)
- g_warning (_("Couldn't load sound file %s as sample %s"),
- file, key);
-
- g_free (key);
-}
-
-
-static void
-apply_settings (void)
-{
- GConfClient *client;
- static gboolean inited = FALSE;
- static int event_changed_old = 0;
- int event_changed_new;
-
- gboolean enable_esd;
- gboolean event_sounds;
-
- client = gconf_client_get_default ();
-
- enable_esd = gconf_client_get_bool (client, "/desktop/gnome/sound/enable_esd", NULL);
- event_sounds = gconf_client_get_bool (client, "/desktop/gnome/sound/event_sounds", NULL);
- event_changed_new = gconf_client_get_int (client, "/desktop/gnome/sound/event_changed", NULL);
-
- if (enable_esd) {
- if (gnome_sound_connection_get () < 0)
- start_esd ();
-
- else if (set_standby) {
- esd_resume (gnome_sound_connection_get ());
- set_standby = FALSE;
- }
-
- } else if (!enable_esd && !set_standby)
- stop_esd ();
-
- if ((enable_esd && event_sounds) &&
- (!inited || event_changed_old != event_changed_new))
- {
- SoundProperties *props;
-
- inited = TRUE;
- event_changed_old = event_changed_new;
-
- props = sound_properties_new ();
- sound_properties_add_defaults (props, NULL);
- sound_properties_foreach (props, reload_foreach_cb, NULL);
- gtk_object_destroy (GTK_OBJECT (props));
- }
-
- g_object_unref (client);
-}
-
-void
-gnome_settings_sound_init (GConfClient *client)
-{
- gnome_settings_daemon_register_callback ("/desktop/gnome/sound", (KeyCallbackFunc) apply_settings);
-}
-
-void
-gnome_settings_sound_load (GConfClient *client)
-{
- apply_settings ();
-}
diff --git a/gnome-settings-daemon/gnome-settings-sound.h b/gnome-settings-daemon/gnome-settings-sound.h
deleted file mode 100644
index 0c81962bf..000000000
--- a/gnome-settings-daemon/gnome-settings-sound.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/* -*- mode: c; style: linux -*- */
-
-/* gnome-settings-sound.h
- *
- * Copyright © 2001 Ximian, Inc.
- *
- * Written by Rachel Hestilow <hestilow@ximian.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 __GNOME_SETTINGS_SOUND_H__
-#define __GNOME_SETTINGS_SOUND_H__
-
-#include <gconf/gconf.h>
-
-void gnome_settings_sound_init (GConfClient *client);
-void gnome_settings_sound_load (GConfClient *client);
-
-#endif /* __GNOME_SETTINGS_SOUND_H__ */
diff --git a/gnome-settings-daemon/gnome-settings-typing-break.c b/gnome-settings-daemon/gnome-settings-typing-break.c
deleted file mode 100644
index fbb9ec9c8..000000000
--- a/gnome-settings-daemon/gnome-settings-typing-break.c
+++ /dev/null
@@ -1,97 +0,0 @@
-#include "gnome-settings-daemon.h"
-#include "gnome-settings-typing-break.h"
-#include <unistd.h>
-#include <sys/types.h>
-#include <signal.h>
-#include "reaper.h"
-#include <string.h>
-
-pid_t typing_monitor_pid = 0;
-guint typing_monitor_idle_id = 0;
-
-static gboolean
-typing_break_timeout (gpointer data)
-{
- if (typing_monitor_pid > 0)
- kill (typing_monitor_pid, SIGKILL);
-
- typing_monitor_idle_id = 0;
-
- return FALSE;
-}
-
-static void
-setup_typing_break (gboolean enabled)
-{
- if (enabled)
- {
- if (typing_monitor_idle_id != 0)
- g_source_remove (typing_monitor_idle_id);
- if (typing_monitor_pid == 0)
- {
- GError *error = NULL;
- gchar *argv[] = { "gnome-typing-monitor", "-n", NULL };
-
- if (! g_spawn_async ("/",
- argv, NULL,
- G_SPAWN_STDOUT_TO_DEV_NULL | G_SPAWN_STDERR_TO_DEV_NULL |
- G_SPAWN_SEARCH_PATH | G_SPAWN_DO_NOT_REAP_CHILD,
- NULL, NULL,
- &typing_monitor_pid,
- &error))
- {
- /* FIXME: put up a warning */
- g_print ("failed: %s\n", error->message);
- g_error_free (error);
- typing_monitor_pid = 0;
- }
- }
- }
- else
- {
- if (typing_monitor_pid != 0)
- {
- typing_monitor_idle_id = g_timeout_add (3000, typing_break_timeout, NULL);
- }
- }
-}
-
-static void
-child_exited_callback (VteReaper *reaper,
- gint pid,
- gint exit_status,
- gpointer user_data)
-{
- if (pid == typing_monitor_pid)
- {
- typing_monitor_pid = 0;
- }
-}
-
-static void
-typing_break_callback (GConfEntry *entry)
-{
- if (! strcmp (entry->key, "/desktop/gnome/typing_break/enabled"))
- {
- if (entry->value->type == GCONF_VALUE_BOOL)
- setup_typing_break (gconf_value_get_bool (entry->value));
- }
-}
-
-void
-gnome_settings_typing_break_init (GConfClient *client)
-{
- VteReaper *reaper;
-
- reaper = vte_reaper_get();
- g_signal_connect (reaper, "child_exited", G_CALLBACK (child_exited_callback), NULL);
- gnome_settings_daemon_register_callback ("/desktop/gnome/typing_break", typing_break_callback);
-}
-
-
-void
-gnome_settings_typing_break_load (GConfClient *client)
-{
- if (gconf_client_get_bool (client, "/desktop/gnome/typing_break/enabled", NULL))
- setup_typing_break (TRUE);
-}
diff --git a/gnome-settings-daemon/gnome-settings-typing-break.h b/gnome-settings-daemon/gnome-settings-typing-break.h
deleted file mode 100644
index 92f8feaf2..000000000
--- a/gnome-settings-daemon/gnome-settings-typing-break.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Copyright © 2003 Jonathan Blandford <jrb@gnome.org>
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Red Hat not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission. Red Hat makes no representations about the
- * suitability of this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- *
- * Authors: Jonathan Blandford
- */
-
-#ifndef TYPING_BREAK_SETTINGS_H
-#define TYPING_BREAK_SETTINGS_H
-
-#include <gconf/gconf.h>
-
-void gnome_settings_typing_break_init (GConfClient *client);
-void gnome_settings_typing_break_load (GConfClient *client);
-
-#endif
diff --git a/gnome-settings-daemon/gnome-settings-xrdb.c b/gnome-settings-daemon/gnome-settings-xrdb.c
deleted file mode 100644
index aace108a9..000000000
--- a/gnome-settings-daemon/gnome-settings-xrdb.c
+++ /dev/null
@@ -1,338 +0,0 @@
-/* -*- Mode: C; indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; style: linux -*- */
-
-/* gnome-settings-xrdb.c
- *
- * Copyright © 2003 Ross Burton
- *
- * Written by Ross Burton <ross@burtonini.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.
- */
-
-#include <errno.h>
-#include <stdio.h>
-#include <string.h>
-#include <libgnome/gnome-i18n.h>
-#include <gconf/gconf-client.h>
-
-#include "gnome-settings-daemon.h"
-#include "gnome-settings-xrdb.h"
-
-#define SYSTEM_AD_DIR DATADIR "/control-center-2.0/xrdb"
-#define GENERAL_AD SYSTEM_AD_DIR "/General.ad"
-#define USER_AD_DIR ".gnome2/xrdb"
-#define USER_X_RESOURCES ".Xresources"
-
-#define GTK_THEME_KEY "/desktop/gnome/interface/gtk_theme"
-
-GtkWidget *widget;
-
-/*
- * Theme colour functions
- */
-
-/*
- * TODO: replace with the code from Smooth? (which should really be
- * public in GTK+)
- */
-static GdkColor*
-colour_shade (GdkColor *a, gdouble shade, GdkColor *b)
-{
- guint16 red, green, blue;
-
- red = CLAMP ((a->red) * shade, 0, 0xFFFF);
- green = CLAMP ((a->green) * shade, 0, 0xFFFF);
- blue = CLAMP ((a->blue) * shade, 0, 0xFFFF);
-
- b->red = red;
- b->green = green;
- b->blue = blue;
-
- return b;
-}
-
-static void
-append_colour_define (GString *string, const gchar* name, const GdkColor* colour)
-{
- g_return_if_fail (string != NULL);
- g_return_if_fail (name != NULL);
- g_return_if_fail (colour != NULL);
-
- g_string_append_printf (string, "#define %s #%2.2hx%2.2hx%2.2hx\n",
- name, colour->red>>8, colour->green>>8, colour->blue>>8);
-}
-
-static void
-append_theme_colours (GtkStyle *style, GString *string)
-{
- GdkColor tmp;
-
- g_return_if_fail (style != NULL);
- g_return_if_fail (string != NULL);
-
- append_colour_define(string, "BACKGROUND",
- &style->bg[GTK_STATE_NORMAL]);
- append_colour_define(string, "FOREGROUND",
- &style->fg[GTK_STATE_NORMAL]);
- append_colour_define(string, "SELECT_BACKGROUND",
- &style->bg[GTK_STATE_SELECTED]);
- append_colour_define(string, "SELECT_FOREGROUND",
- &style->text[GTK_STATE_SELECTED]);
- append_colour_define(string, "WINDOW_BACKGROUND",
- &style->base[GTK_STATE_NORMAL]);
- append_colour_define(string, "WINDOW_FOREGROUND",
- &style->text[GTK_STATE_NORMAL]);
-
- append_colour_define(string, "INACTIVE_BACKGROUND",
- &style->bg[GTK_STATE_INSENSITIVE]);
- append_colour_define(string, "INACTIVE_FOREGROUND",
- &style->text[GTK_STATE_INSENSITIVE]);
-
- append_colour_define(string, "ACTIVE_BACKGROUND",
- &style->bg[GTK_STATE_SELECTED]);
- append_colour_define(string, "ACTIVE_FOREGROUND",
- &style->text[GTK_STATE_SELECTED]);
-
- append_colour_define(string, "HIGHLIGHT",
- colour_shade (&style->bg[GTK_STATE_NORMAL],
- 1.2, &tmp));
- append_colour_define(string, "LOWLIGHT",
- colour_shade (&style->bg[GTK_STATE_NORMAL],
- 2.0/3.0, &tmp));
- return;
-}
-
-/*
- * Directory scanning functions
- */
-
-/**
- * Compare two file names on their base names.
- */
-static gint
-compare_basenames (gconstpointer a, gconstpointer b)
-{
- char *base_a, *base_b;
- int res;
- base_a = g_path_get_basename (a);
- base_b = g_path_get_basename (b);
- res = strcmp (base_a, base_b);
- g_free (base_a);
- g_free (base_b);
- return res;
-}
-
-/**
- * Append the contents of a file onto the end of a GString
- */
-static void
-append_file (const char* file, GString *string, GError **error)
-{
- gchar *contents;
-
- g_return_if_fail (string != NULL);
- g_return_if_fail (file != NULL);
-
- if (g_file_get_contents (file, &contents, NULL, error)) {
- g_string_append (string, contents);
- g_free (contents);
- }
-}
-
-/**
- * Scan a single directory for .ad files, and return them all in a
- * GSList*
- */
-static GSList*
-scan_ad_directory (const char *path, GError **error)
-{
- GSList *list = NULL;
- GDir *dir;
- const gchar *entry;
-
- g_return_val_if_fail (path != NULL, NULL);
- dir = g_dir_open (path, 0, error);
- if (*error) {
- return NULL;
- }
- while ((entry = g_dir_read_name (dir)) != NULL) {
- int len;
- len = strlen (entry);
- if (g_str_has_suffix (entry, ".ad")) {
- list = g_slist_prepend (list, g_strdup_printf ("%s/%s", path, entry));
- }
- }
- g_dir_close (dir);
- /* TODO: sort still? */
- return g_slist_sort (list, (GCompareFunc)strcmp);
-}
-
-/**
- * Scan the user and system paths, and return a list of strings in the
- * right order for processing.
- */
-static GSList*
-scan_for_files (GError **error)
-{
- const char* home_dir;
-
- GSList *user_list = NULL, *system_list = NULL;
- GSList *list = NULL, *p;
-
- system_list = scan_ad_directory (SYSTEM_AD_DIR, error);
- if (*error) return NULL;
-
- home_dir = g_get_home_dir ();
- if (home_dir) {
- char *user_ad = g_build_filename (home_dir, USER_AD_DIR, NULL);
- if (g_file_test (user_ad, G_FILE_TEST_IS_DIR)) {
- user_list = scan_ad_directory (user_ad, error);
- if (*error) {
- g_slist_foreach (system_list, (GFunc)g_free, NULL);
- g_slist_free (system_list);
- g_free (user_ad);
- return NULL;
- }
- }
- g_free (user_ad);
- } else {
- g_warning (_("Cannot determine user's home directory"));
- }
-
- /* An alternative approach would be to strdup() the strings
- and free the entire contents of these lists, but that is a
- little inefficient for my liking - RB */
- for (p = system_list; p != NULL; p = g_slist_next (p)) {
- if (strcmp (p->data, GENERAL_AD) == 0) {
- /* We ignore this, free the data now */
- g_free (p->data);
- continue;
- }
- if (g_slist_find_custom (user_list, p->data, compare_basenames)) {
- /* Ditto */
- g_free (p->data);
- continue;
- }
- list = g_slist_prepend (list, p->data);
- }
- g_slist_free (system_list);
-
- for (p = user_list; p != NULL; p = g_slist_next (p)) {
- list = g_slist_prepend (list, p->data);
- }
- g_slist_free (user_list);
-
- /* Reverse the order so it is the correct way */
- list = g_slist_reverse (list);
-
- /* Add the initial file */
- list = g_slist_prepend (list, g_strdup (GENERAL_AD));
-
- return list;
-}
-
-/**
- * Append the users .Xresources file if it exists
- */
-static void
-append_xresources (GString *string, GError **error)
-{
- const char* home_path;
- char *xresources;
-
- g_return_if_fail (string != NULL);
-
- home_path = g_get_home_dir ();
- if (home_path == NULL) {
- g_warning (_("Cannot determine user's home directory"));
- return;
- }
-
- xresources = g_build_filename (home_path, USER_X_RESOURCES, NULL);
- if (g_file_test (xresources, G_FILE_TEST_EXISTS)) {
- append_file (xresources, string, error);
- if (*error) {
- g_warning ("%s", (*error)->message);
- g_error_free (*error);
- error = NULL;
- }
- }
- g_free (xresources);
-}
-
-/*
- * Entry point
- */
-static void
-apply_settings (GtkStyle *style)
-{
- char *xrdb[] = { "xrdb", "-merge", NULL };
- GString *string;
- GSList *list = NULL, *p;
- GError *error = NULL;
-
- string = g_string_sized_new (256);
- append_theme_colours (style, string);
-
- list = scan_for_files (&error);
- if (error) {
- g_warning (error->message);
- g_error_free (error);
- error = NULL;
- }
- for (p = list; p != NULL; p=g_slist_next (p)) {
- append_file (p->data, string, &error);
- if (error) {
- g_warning (error->message);
- g_error_free (error);
- error = NULL;
- }
- }
-
- g_slist_foreach (list, (GFunc)g_free, NULL);
- g_slist_free (list);
-
- append_xresources (string, &error);
- if (error) {
- g_warning (error->message);
- g_error_free (error);
- error = NULL;
- }
-
- gnome_settings_daemon_spawn_with_input (xrdb, string->str);
- g_string_free (string, TRUE);
- return;
-}
-
-static void
-style_set_cb (GtkWidget *widget, GtkStyle *s, gpointer data)
-{
- apply_settings (gtk_widget_get_style (widget));
-}
-
-void
-gnome_settings_xrdb_init (GConfClient *client)
-{
- widget = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- g_signal_connect (widget, "style-set", (GCallback)style_set_cb, NULL);
- gtk_widget_ensure_style (widget);
-}
-
-void
-gnome_settings_xrdb_load (GConfClient *client)
-{
- style_set_cb (widget, NULL, NULL);
-}
diff --git a/gnome-settings-daemon/gnome-settings-xrdb.h b/gnome-settings-daemon/gnome-settings-xrdb.h
deleted file mode 100644
index 8bc1d1e5f..000000000
--- a/gnome-settings-daemon/gnome-settings-xrdb.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/* -*- mode: c; style: linux -*- */
-
-/* gnome-settings-xrdb
- *
- * Copyright © 2003 Ross Burton
- *
- * Written by Ross Burton <ross@burtonini.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 __GNOME_SETTINGS_XRDB_H
-#define __GNOME_SETTINGS_XRDB_H
-
-#include <gconf/gconf-client.h>
-
-void gnome_settings_xrdb_init (GConfClient *client);
-void gnome_settings_xrdb_load (GConfClient *client);
-
-#endif
diff --git a/gnome-settings-daemon/gnome-settings-xsettings.c b/gnome-settings-daemon/gnome-settings-xsettings.c
deleted file mode 100644
index fefa7f563..000000000
--- a/gnome-settings-daemon/gnome-settings-xsettings.c
+++ /dev/null
@@ -1,445 +0,0 @@
-#include <config.h>
-#include <string.h>
-#include <stdio.h>
-#include <glib.h>
-#include <libgnome/gnome-i18n.h>
-#include <locale.h>
-
-#include "gnome-settings-daemon.h"
-#include "gnome-settings-xsettings.h"
-#include "xsettings-manager.h"
-
-extern XSettingsManager **managers;
-
-#ifdef HAVE_XFT2
-#define FONT_RENDER_DIR "/desktop/gnome/font_rendering"
-#define FONT_ANTIALIASING_KEY FONT_RENDER_DIR "/antialiasing"
-#define FONT_HINTING_KEY FONT_RENDER_DIR "/hinting"
-#define FONT_RGBA_ORDER_KEY FONT_RENDER_DIR "/rgba_order"
-#define FONT_DPI_KEY FONT_RENDER_DIR "/dpi"
-#endif /* HAVE_XFT2 */
-
-typedef struct _TranslationEntry TranslationEntry;
-typedef void (* TranslationFunc) (TranslationEntry *trans,
- GConfValue *value);
-struct _TranslationEntry
-{
- const char *gconf_key;
- const char *xsetting_name;
-
- GConfValueType gconf_type;
- TranslationFunc translate;
-};
-
-#ifdef HAVE_XFT2
-static void gnome_settings_update_xft (GConfClient *client);
-static void xft_callback (GConfEntry *entry);
-#endif /* HAVE_XFT2 */
-
-static void
-translate_bool_int (TranslationEntry *trans,
- GConfValue *value)
-{
- int i;
-
- g_assert (value->type == trans->gconf_type);
-
- for (i = 0; managers [i]; i++)
- xsettings_manager_set_int (managers [i], trans->xsetting_name,
- gconf_value_get_bool (value));
-}
-
-static void
-translate_int_int (TranslationEntry *trans,
- GConfValue *value)
-{
- int i;
-
- g_assert (value->type == trans->gconf_type);
-
- for (i = 0; managers [i]; i++)
- xsettings_manager_set_int (managers [i], trans->xsetting_name,
- gconf_value_get_int (value));
-}
-
-static void
-translate_string_string (TranslationEntry *trans,
- GConfValue *value)
-{
- int i;
-
- g_assert (value->type == trans->gconf_type);
-
- for (i = 0; managers [i]; i++)
- xsettings_manager_set_string (managers [i],
- trans->xsetting_name,
- gconf_value_get_string (value));
-}
-
-static void
-translate_string_string_toolbar (TranslationEntry *trans,
- GConfValue *value)
-{
- int i;
- const char *tmp;
-
- g_assert (value->type == trans->gconf_type);
-
- /* This is kind of a workaround since GNOME expects the key value to be
- * "both_horiz" and gtk+ wants the XSetting to be "both-horiz".
- */
- tmp = gconf_value_get_string (value);
- if (tmp && strcmp (tmp, "both_horiz") == 0)
- tmp = "both-horiz";
-
- for (i = 0; managers [i]; i++)
- xsettings_manager_set_string (managers [i],
- trans->xsetting_name,
- tmp);
-}
-
-static TranslationEntry translations [] = {
- { "/desktop/gnome/peripherals/mouse/double_click", "Net/DoubleClickTime",
- GCONF_VALUE_INT, translate_int_int },
- { "/desktop/gnome/peripherals/mouse/drag_threshold", "Net/DndDragThreshold",
- GCONF_VALUE_INT, translate_int_int },
- { "/desktop/gnome/gtk-color-palette", "Gtk/ColorPalette",
- GCONF_VALUE_STRING, translate_string_string },
- { "/desktop/gnome/interface/font_name", "Gtk/FontName",
- GCONF_VALUE_STRING, translate_string_string },
- { "/desktop/gnome/interface/gtk_key_theme", "Gtk/KeyThemeName",
- GCONF_VALUE_STRING, translate_string_string },
- { "/desktop/gnome/interface/toolbar_style", "Gtk/ToolbarStyle",
- GCONF_VALUE_STRING, translate_string_string_toolbar },
- { "/desktop/gnome/interface/toolbar_icon_size", "Gtk/ToolbarIconSize",
- GCONF_VALUE_STRING, translate_string_string },
- { "/desktop/gnome/interface/can_change_accels", "Gtk/CanChangeAccels",
- GCONF_VALUE_BOOL, translate_bool_int },
- { "/desktop/gnome/interface/cursor_blink", "Net/CursorBlink",
- GCONF_VALUE_BOOL, translate_bool_int },
- { "/desktop/gnome/interface/cursor_blink_time", "Net/CursorBlinkTime",
- GCONF_VALUE_INT, translate_int_int },
- { "/desktop/gnome/interface/gtk_theme", "Net/ThemeName",
- GCONF_VALUE_STRING, translate_string_string },
- { "/desktop/gnome/interface/gtk-im-preedit-style", "Gtk/IMPreeditStyle",
- GCONF_VALUE_STRING, translate_string_string },
- { "/desktop/gnome/interface/gtk-im-status-style", "Gtk/IMStatusStyle",
- GCONF_VALUE_STRING, translate_string_string }
-};
-
-static TranslationEntry*
-find_translation_entry (const char *gconf_key)
-{
- int i;
-
- i = 0;
- while (i < G_N_ELEMENTS (translations))
- {
- if (strcmp (translations[i].gconf_key, gconf_key) == 0)
- return &translations[i];
-
- ++i;
- }
-
- return NULL;
-}
-
-static const gchar*
-type_to_string (GConfValueType type)
-{
- switch (type)
- {
- case GCONF_VALUE_INT:
- return "int";
- break;
- case GCONF_VALUE_STRING:
- return "string";
- break;
- case GCONF_VALUE_FLOAT:
- return "float";
- break;
- case GCONF_VALUE_BOOL:
- return "bool";
- break;
- case GCONF_VALUE_SCHEMA:
- return "schema";
- break;
- case GCONF_VALUE_LIST:
- return "list";
- break;
- case GCONF_VALUE_PAIR:
- return "pair";
- break;
- case GCONF_VALUE_INVALID:
- return "*invalid*";
- break;
- default:
- g_assert_not_reached();
- return NULL; /* for warnings */
- break;
- }
-}
-
-static void
-process_value (TranslationEntry *trans,
- GConfValue *val)
-{
- if (val == NULL)
- {
- int i;
-
- for (i = 0; managers [i]; i++)
- xsettings_manager_delete_setting (managers [i], trans->xsetting_name);
- }
- else
- {
- if (val->type == trans->gconf_type)
- {
- (* trans->translate) (trans, val);
- }
- else
- {
- g_warning (_("GConf key %s set to type %s but its expected type was %s\n"),
- trans->gconf_key,
- type_to_string (val->type),
- type_to_string (trans->gconf_type));
- }
- }
-}
-
-static void
-xsettings_callback (GConfEntry *entry)
-{
- TranslationEntry *trans;
- int i;
-
- trans = find_translation_entry (entry->key);
- if (trans == NULL)
- return;
-
- process_value (trans, entry->value);
-
- for (i = 0; managers [i]; i++)
- xsettings_manager_notify (managers [i]);
-}
-
-void
-gnome_settings_xsettings_init (GConfClient *client)
-{
- gnome_settings_daemon_register_callback ("/desktop/gnome/peripherals/mouse", xsettings_callback);
- gnome_settings_daemon_register_callback ("/desktop/gtk", xsettings_callback);
- gnome_settings_daemon_register_callback ("/desktop/gnome/interface", xsettings_callback);
-
-#ifdef HAVE_XFT2
- gnome_settings_daemon_register_callback (FONT_RENDER_DIR, xft_callback);
-#endif /* HAVE_XFT2 */
-}
-
-#ifdef HAVE_XFT2
-static void
-xft_callback (GConfEntry *entry)
-{
- GConfClient *client;
- int i;
-
- client = gconf_client_get_default ();
-
- gnome_settings_update_xft (client);
-
- for (i = 0; managers [i]; i++)
- xsettings_manager_notify (managers [i]);
-}
-
-typedef struct
-{
- gboolean antialias;
- gboolean hinting;
- int dpi;
- const char *rgba;
- const char *hintstyle;
-} GnomeXftSettings;
-
-static const char *rgba_types[] = { "rgb", "bgr", "vbgr", "vrgb" };
-
-/* Read GConf settings and determine the appropriate Xft settings based on them
- * This probably could be done a bit more cleanly with gconf_string_to_enum
- */
-static void
-gnome_xft_settings_get (GConfClient *client,
- GnomeXftSettings *settings)
-{
- char *antialiasing = gconf_client_get_string (client, FONT_ANTIALIASING_KEY, NULL);
- char *hinting = gconf_client_get_string (client, FONT_HINTING_KEY, NULL);
- char *rgba_order = gconf_client_get_string (client, FONT_RGBA_ORDER_KEY, NULL);
- double dpi = gconf_client_get_float (client, FONT_DPI_KEY, NULL);
-
- settings->antialias = TRUE;
- settings->hinting = TRUE;
- settings->hintstyle = "hintfull";
- settings->dpi = 96;
- settings->rgba = "rgb";
-
- if ((int)(1024 * dpi + 0.5) > 0)
- settings->dpi = (int)(1024 * dpi + 0.5);
-
- if (rgba_order)
- {
- int i;
- gboolean found = FALSE;
-
- for (i = 0; i < G_N_ELEMENTS (rgba_types) && !found; i++)
- if (strcmp (rgba_order, rgba_types[i]) == 0)
- {
- settings->rgba = rgba_types[i];
- found = TRUE;
- }
-
- if (!found)
- g_warning ("Invalid value for " FONT_RGBA_ORDER_KEY ": '%s'",
- rgba_order);
- }
-
- if (hinting)
- {
- if (strcmp (hinting, "none") == 0)
- {
- settings->hinting = 0;
- settings->hintstyle = "hintnone";
- }
- else if (strcmp (hinting, "slight") == 0)
- {
- settings->hinting = 1;
- settings->hintstyle = "hintslight";
- }
- else if (strcmp (hinting, "medium") == 0)
- {
- settings->hinting = 1;
- settings->hintstyle = "hintmedium";
- }
- else if (strcmp (hinting, "full") == 0)
- {
- settings->hinting = 1;
- settings->hintstyle = "hintfull";
- }
- else
- g_warning ("Invalid value for " FONT_HINTING_KEY ": '%s'",
- hinting);
- }
-
- if (antialiasing)
- {
- gboolean use_rgba = FALSE;
-
- if (strcmp (antialiasing, "none") == 0)
- settings->antialias = 0;
- else if (strcmp (antialiasing, "grayscale") == 0)
- settings->antialias = 1;
- else if (strcmp (antialiasing, "rgba") == 0)
- {
- settings->antialias = 1;
- use_rgba = TRUE;
- }
- else
- g_warning ("Invalid value for " FONT_ANTIALIASING_KEY " : '%s'",
- antialiasing);
-
- if (!use_rgba)
- settings->rgba = "none";
- }
-
- g_free (rgba_order);
- g_free (hinting);
- g_free (antialiasing);
-}
-
-static void
-gnome_xft_settings_set_xsettings (GnomeXftSettings *settings)
-{
- int i;
- for (i = 0; managers [i]; i++)
- {
- xsettings_manager_set_int (managers [i], "Xft/Antialias", settings->antialias);
- xsettings_manager_set_int (managers [i], "Xft/Hinting", settings->hinting);
- xsettings_manager_set_string (managers [i], "Xft/HintStyle", settings->hintstyle);
- xsettings_manager_set_int (managers [i], "Xft/DPI", settings->dpi);
- xsettings_manager_set_string (managers [i], "Xft/RGBA", settings->rgba);
- }
-}
-
-static void
-gnome_xft_settings_set_xresources (GnomeXftSettings *settings)
-{
- char *add[] = { "xrdb", "-merge", NULL };
- GString *add_string = g_string_new (NULL);
- char *old_locale = g_strdup (setlocale (LC_NUMERIC, NULL));
-
- setlocale (LC_NUMERIC, "C");
- g_string_append_printf (add_string,
- "Xft.dpi: %f\n", settings->dpi / 1024.);
- g_string_append_printf (add_string,
- "Xft.antialias: %d\n", settings->antialias);
- g_string_append_printf (add_string,
- "Xft.hinting: %d\n", settings->hinting);
- g_string_append_printf (add_string,
- "Xft.hintstyle: %s\n", settings->hintstyle);
- g_string_append_printf (add_string,
- "Xft.rgba: %s\n", settings->rgba);
-
- gnome_settings_daemon_spawn_with_input (add, add_string->str);
-
- g_string_free (add_string, TRUE);
- setlocale (LC_NUMERIC, old_locale);
- g_free (old_locale);
-}
-
-/* We mirror the Xft properties both through XSETTINGS and through
- * X resources
- */
-static void
-gnome_settings_update_xft (GConfClient *client)
-{
- GnomeXftSettings settings;
-
- gnome_xft_settings_get (client, &settings);
- gnome_xft_settings_set_xsettings (&settings);
- gnome_xft_settings_set_xresources (&settings);
-}
-#endif /* HAVE_XFT2 */
-
-void
-gnome_settings_xsettings_load (GConfClient *client)
-{
- int i;
-
- i = 0;
- while (i < G_N_ELEMENTS (translations))
- {
- GConfValue *val;
- GError *err;
-
- err = NULL;
- val = gconf_client_get (client,
- translations[i].gconf_key,
- &err);
-
- if (err != NULL)
- {
- fprintf (stderr, "Error getting value for %s: %s\n",
- translations[i].gconf_key, err->message);
- g_error_free (err);
- }
- else
- {
- process_value (&translations[i], val);
- }
-
- ++i;
- }
-
-#ifdef HAVE_XFT2
- gnome_settings_update_xft (client);
-#endif /* HAVE_XFT */
-
- for (i = 0; managers [i]; i++)
- xsettings_manager_notify (managers [i]);
-}
diff --git a/gnome-settings-daemon/gnome-settings-xsettings.h b/gnome-settings-daemon/gnome-settings-xsettings.h
deleted file mode 100644
index 259258c29..000000000
--- a/gnome-settings-daemon/gnome-settings-xsettings.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright 2001 Red Hat, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Red Hat not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission. Red Hat makes no representations about the
- * suitability of this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- *
- * RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL RED HAT
- * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * Authors: Jonathan Blandford
- */
-
-#ifndef GNOME_SETTINGS_XSETTINGS_H
-#define GNOME_SETTINGS_XSETTINGS_H
-
-#include <gconf/gconf.h>
-
-void gnome_settings_xsettings_init (GConfClient *client);
-void gnome_settings_xsettings_load (GConfClient *client);
-
-
-#endif /* GNOME_SETTINGS_XSETTINGS_H */
diff --git a/gnome-settings-daemon/reaper.c b/gnome-settings-daemon/reaper.c
deleted file mode 100644
index c31adea4b..000000000
--- a/gnome-settings-daemon/reaper.c
+++ /dev/null
@@ -1,305 +0,0 @@
-/*
- * Copyright (C) 2002 Red Hat, Inc.
- *
- * This is free software; you can redistribute it and/or modify it under
- * the terms of the GNU Library General Public License as published by
- * the Free Software Foundation; either version 2 of the License, 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 Library General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#ident "$Id$"
-#include "../config.h"
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <signal.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <glib.h>
-#include <glib-object.h>
-#include <gtk/gtk.h>
-#include <gtk/gtkmarshal.h>
-#include "reaper.h"
-
-#ifdef HAVE_LOCALE_H
-#include <locale.h>
-#else
-#define bindtextdomain(package,dir)
-#endif
-
-#ifdef ENABLE_NLS
-#include <libintl.h>
-#define _(String) dgettext(PACKAGE, String)
-#else
-#define _(String) String
-#endif
-
-static VteReaper *singleton_reaper = NULL;
-struct reaper_info {
- int signum;
- pid_t pid;
- int status;
-};
-
-static void
-vte_reaper_signal_handler(int signum)
-{
- struct reaper_info info;
- int status;
-
- /* This might become more general-purpose in the future, but for now
- * just forget about signals other than SIGCHLD. */
- info.signum = signum;
- if (signum != SIGCHLD) {
- return;
- }
-
- if ((singleton_reaper != NULL) && (singleton_reaper->iopipe[0] != -1)) {
- info.pid = waitpid(-1, &status, WNOHANG);
- if (info.pid != -1) {
- info.status = status;
- if (write(singleton_reaper->iopipe[1], "", 0) == 0) {
- write(singleton_reaper->iopipe[1],
- &info, sizeof(info));
- }
- }
- }
-}
-
-static gboolean
-vte_reaper_emit_signal(GIOChannel *channel, GIOCondition condition,
- gpointer data)
-{
- struct reaper_info info;
- if (condition != G_IO_IN) {
- return FALSE;
- }
- g_assert(data == singleton_reaper);
- read(singleton_reaper->iopipe[0], &info, sizeof(info));
- if (info.signum == SIGCHLD) {
- g_signal_emit_by_name(data, "child-exited",
- info.pid, info.status);
- }
- return TRUE;
-}
-
-static void
-vte_reaper_channel_destroyed(gpointer data)
-{
- /* no-op */
-}
-
-static void
-vte_reaper_init(VteReaper *reaper, gpointer *klass)
-{
- struct sigaction action;
- int ret;
-
- /* Open the signal pipe. */
- ret = pipe(reaper->iopipe);
- if (ret == -1) {
- g_error(_("Error creating signal pipe."));
- }
-
- /* Create the channel. */
- reaper->channel = g_io_channel_unix_new(reaper->iopipe[0]);
-
- /* Add the channel to the source list. */
- g_io_add_watch_full(reaper->channel,
- G_PRIORITY_HIGH,
- G_IO_IN,
- vte_reaper_emit_signal,
- reaper,
- vte_reaper_channel_destroyed);
-
- /* Set the signal handler. */
- action.sa_handler = vte_reaper_signal_handler;
- sigemptyset(&action.sa_mask);
- action.sa_flags = SA_RESTART | SA_NOCLDSTOP;
- sigaction(SIGCHLD, &action, NULL);
-}
-
-static void
-vte_reaper_finalize(GObject *reaper)
-{
- GObjectClass *object_class;
- struct sigaction action, old_action;
-
- /* Reset the signal handler if we still have it hooked. */
- action.sa_handler = SIG_DFL;
- sigemptyset(&action.sa_mask);
- action.sa_flags = SA_RESTART | SA_NOCLDSTOP;
- sigaction(SIGCHLD, NULL, &old_action);
- if (old_action.sa_handler == vte_reaper_signal_handler) {
- sigaction(SIGCHLD, &action, NULL);
- }
-
- /* Remove the channel from the source list. */
- g_source_remove_by_user_data(reaper);
-
- /* Remove the channel. */
- g_io_channel_unref((VTE_REAPER(reaper))->channel);
-
- /* Close the pipes. */
- close((VTE_REAPER(reaper))->iopipe[1]);
- close((VTE_REAPER(reaper))->iopipe[0]);
-
- /* Call the inherited destructor. */
- object_class = g_type_class_peek(G_TYPE_OBJECT);
- if (G_OBJECT_CLASS(object_class)->finalize) {
- (G_OBJECT_CLASS(object_class))->finalize(reaper);
- }
- singleton_reaper = NULL;
-}
-
-static void
-vte_reaper_class_init(VteReaperClass *klass, gpointer data)
-{
- GObjectClass *gobject_class;
-
- klass->child_exited_signal = g_signal_new("child-exited",
- G_OBJECT_CLASS_TYPE(klass),
- G_SIGNAL_RUN_LAST,
- 0,
- NULL,
- NULL,
- gtk_marshal_NONE__INT_INT,
- G_TYPE_NONE,
- 2, G_TYPE_INT, G_TYPE_INT);
-
- gobject_class = G_OBJECT_CLASS(klass);
- gobject_class->finalize = vte_reaper_finalize;
-}
-
-GType
-vte_reaper_get_type(void)
-{
- static GType reaper_type = 0;
- static GTypeInfo reaper_type_info = {
- sizeof(VteReaperClass),
-
- (GBaseInitFunc)NULL,
- (GBaseFinalizeFunc)NULL,
-
- (GClassInitFunc)vte_reaper_class_init,
- (GClassFinalizeFunc)NULL,
- NULL,
-
- sizeof(VteReaper),
- 0,
- (GInstanceInitFunc) vte_reaper_init,
-
- (const GTypeValueTable *) NULL,
- };
- if (reaper_type == 0) {
- reaper_type = g_type_register_static(G_TYPE_OBJECT,
- "VteReaper",
- &reaper_type_info,
- 0);
- }
- return reaper_type;
-}
-
-/**
- * vte_reaper_get:
- *
- * Finds the address of the global #VteReaper object, creating the object if
- * necessary.
- *
- * Returns: the global #VteReaper object, which should not be unreffed.
- */
-VteReaper *
-vte_reaper_get(void)
-{
- if (!VTE_IS_REAPER(singleton_reaper)) {
- singleton_reaper = g_object_new(VTE_TYPE_REAPER, NULL);
- }
- return singleton_reaper;
-}
-
-#ifdef REAPER_MAIN
-GMainContext *context;
-GMainLoop *loop;
-pid_t child;
-
-static void
-child_exited(GObject *object, int pid, int status, gpointer data)
-{
- g_print("[parent] Child with pid %d exited with code %d, "
- "was waiting for %d.\n", pid, status, GPOINTER_TO_INT(data));
- if (child == pid) {
- g_print("[parent] Quitting.\n");
- g_main_loop_quit(loop);
- }
-}
-
-int
-main(int argc, char **argv)
-{
- VteReaper *reaper;
- pid_t p, q;
-
- _vte_debug_parse_string(getenv("VTE_DEBUG_FLAGS"));
-
- g_type_init();
- context = g_main_context_default();
- loop = g_main_loop_new(context, FALSE);
- reaper = vte_reaper_get();
-
- g_print("[parent] Forking.\n");
- p = fork();
- switch (p) {
- case -1:
- g_print("[parent] Fork failed.\n");
- g_assert_not_reached();
- break;
- case 0:
- g_print("[child] Going to sleep.\n");
- sleep(10);
- g_print("[child] Quitting.\n");
- _exit(30);
- break;
- default:
- g_print("[parent] Starting to wait for %d.\n", p);
- child = p;
- g_signal_connect(G_OBJECT(reaper),
- "child-exited",
- G_CALLBACK(child_exited),
- GINT_TO_POINTER(child));
- break;
- }
-
- g_print("[parent] Forking.\n");
- q = fork();
- switch (q) {
- case -1:
- g_print("[parent] Fork failed.\n");
- g_assert_not_reached();
- break;
- case 0:
- g_print("[child] Going to sleep.\n");
- sleep(5);
- _exit(5);
- break;
- default:
- g_print("[parent] Not waiting for %d.\n", q);
- break;
- }
-
-
- g_main_loop_run(loop);
-
- reaper = vte_reaper_get();
- g_object_unref(VTE_REAPER(reaper));
-
- return 0;
-}
-#endif
diff --git a/gnome-settings-daemon/reaper.h b/gnome-settings-daemon/reaper.h
deleted file mode 100644
index fb8521f69..000000000
--- a/gnome-settings-daemon/reaper.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (C) 2002 Red Hat, Inc.
- *
- * This is free software; you can redistribute it and/or modify it under
- * the terms of the GNU Library General Public License as published by
- * the Free Software Foundation; either version 2 of the License, 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 Library General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#ifndef vte_reaper_h_included
-#define vte_reaper_h_included
-
-#ident "$Id$"
-
-#include <sys/wait.h>
-#include <signal.h>
-#include <glib.h>
-#include <glib-object.h>
-
-G_BEGIN_DECLS
-
-struct _VteReaper {
- GObject object;
- GIOChannel *channel;
- int iopipe[2];
-};
-typedef struct _VteReaper VteReaper;
-
-struct _VteReaperClass {
- GObjectClass parent_class;
- guint child_exited_signal;
-};
-typedef struct _VteReaperClass VteReaperClass;
-
-GType vte_reaper_get_type(void);
-
-#define VTE_TYPE_REAPER (vte_reaper_get_type())
-#define VTE_REAPER(obj) (GTK_CHECK_CAST((obj), \
- VTE_TYPE_REAPER, \
- VteReaper))
-#define VTE_REAPER_CLASS(klass) GTK_CHECK_CLASS_CAST((klass), \
- VTE_TYPE_REAPER, \
- VteReaperClass)
-#define VTE_IS_REAPER(obj) GTK_CHECK_TYPE((obj), VTE_TYPE_REAPER)
-#define VTE_IS_REAPER_CLASS(klass) GTK_CHECK_CLASS_TYPE((klass), \
- VTE_TYPE_REAPER)
-#define VTE_REAPER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), \
- VTE_TYPE_REAPER, \
- VteReaperClass))
-
-VteReaper *vte_reaper_get(void);
-
-G_END_DECLS
-
-#endif
diff --git a/gnome-settings-daemon/xrdb/.cvsignore b/gnome-settings-daemon/xrdb/.cvsignore
deleted file mode 100644
index 282522db0..000000000
--- a/gnome-settings-daemon/xrdb/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-Makefile
-Makefile.in
diff --git a/gnome-settings-daemon/xrdb/Editres.ad b/gnome-settings-daemon/xrdb/Editres.ad
deleted file mode 100644
index 9cd3e582b..000000000
--- a/gnome-settings-daemon/xrdb/Editres.ad
+++ /dev/null
@@ -1,6 +0,0 @@
-!Editres*Font: FONT
-Editres*Tree.Background: WINDOW_BACKGROUND
-Editres*Tree.Foreground: WINDOW_FOREGROUND
-Editres*Tree.Toggle.Foreground: FOREGROUND
-Editres*Tree.Toggle.Background: BACKGROUND
-Editres*Panner.Background: BACKGROUND
diff --git a/gnome-settings-daemon/xrdb/Emacs.ad b/gnome-settings-daemon/xrdb/Emacs.ad
deleted file mode 100644
index 31850fc5b..000000000
--- a/gnome-settings-daemon/xrdb/Emacs.ad
+++ /dev/null
@@ -1,24 +0,0 @@
-Emacs.default.attributeForeground: WINDOW_FOREGROUND
-Emacs.default.attributeBackground: WINDOW_BACKGROUND
-
-Emacs*Foreground: WINDOW_FOREGROUND
-Emacs*Background: WINDOW_BACKGROUND
-Emacs*menubar*foreground: FOREGROUND
-Emacs*menubar*background: BACKGROUND
-Emacs*popup*Foreground: FOREGROUND
-Emacs*popup*Background: BACKGROUND
-Emacs*Dialog*foreground: FOREGROUND
-Emacs*Dialog*background: BACKGROUND
-Emacs*XlwScrollBar.Foreground: FOREGROUND
-Emacs*XlwScrollBar.Background: BACKGROUND
-Emacs*topToolBarShadowColor: BACKGROUND
-Emacs*bottomToolBarShadowColor: BACKGROUND
-Emacs*backgroundToolBarColor: BACKGROUND
-Emacs*toolBarShadowThickness: 0
-
-!Emacs*font: FIXED_FONT
-!Emacs*menubar*Font: FONT
-!Emacs*popup*Font: FONT
-!Emacs*Dialog*Font: FONT
-!Emacs.default.attributeFont: FIXED_FONT
-
diff --git a/gnome-settings-daemon/xrdb/General.ad b/gnome-settings-daemon/xrdb/General.ad
deleted file mode 100644
index f088091ce..000000000
--- a/gnome-settings-daemon/xrdb/General.ad
+++ /dev/null
@@ -1,5 +0,0 @@
-*background: BACKGROUND
-*foreground: FOREGROUND
-!*Font: FONT
-!*font: FONT
-!*fontList: FONTLIST
diff --git a/gnome-settings-daemon/xrdb/Makefile.am b/gnome-settings-daemon/xrdb/Makefile.am
deleted file mode 100644
index 6b2aa5d0d..000000000
--- a/gnome-settings-daemon/xrdb/Makefile.am
+++ /dev/null
@@ -1,10 +0,0 @@
-xrdbdir = $(datadir)/control-center-2.0/xrdb
-xrdb_DATA = \
- General.ad \
- Editres.ad \
- Emacs.ad \
- Motif.ad \
- Tk.ad \
- Xaw.ad
-
-EXTRA_DIST = $(xrdb_DATA)
diff --git a/gnome-settings-daemon/xrdb/Motif.ad b/gnome-settings-daemon/xrdb/Motif.ad
deleted file mode 100644
index 2db820cf6..000000000
--- a/gnome-settings-daemon/xrdb/Motif.ad
+++ /dev/null
@@ -1,81 +0,0 @@
-*XmScrollBar.background: BACKGROUND
-*XmScrollBar.foreground: FOREGROUND
-
-*XmSash.background: BACKGROUND
-*XmSash.foreground: FOREGROUND
-
-*XmLabel.background: BACKGROUND
-*XmLabel.foreground: FOREGROUND
-*XmLabelGadget.background: BACKGROUND
-*XmLabelGadget.foreground: FOREGROUND
-
-*XmCascadeButton.background: BACKGROUND
-*XmCascadeButton.foreground: FOREGROUND
-*XmCascadeButtonGadget.background: BACKGROUND
-*XmCascadeButtonGadget.foreground: FOREGROUND
-
-*XmToggleButton.background: BACKGROUND
-*XmToggleButton.foreground: FOREGROUND
-*XmToggleButtonGadget.background: BACKGROUND
-*XmToggleButtonGadget.foreground: FOREGROUND
-
-*XmPushButton.background: BACKGROUND
-*XmPushButton.foreground: FOREGROUND
-*XmPushButtonGadget.background: BACKGROUND
-*XmPushButtonGadget.foreground: FOREGROUND
-
-*XmSeparator.background: BACKGROUND
-*XmSeparator.foreground: FOREGROUND
-*XmSeparatorGadget.background: BACKGROUND
-*XmSeparatorGadget.foreground: FOREGROUND
-
-*XmTearOffButton.background: BACKGROUND
-*XmTearOffButton.foreground: FOREGROUND
-*XmTearOffButtonGadget.background: BACKGROUND
-*XmTearOffButtonGadget.foreground: FOREGROUND
-
-*XmMenuShell.background: BACKGROUND
-*XmMenuShell.foreground: FOREGROUND
-
-*XmDialogShell.background: BACKGROUND
-*XmDialogShell.foreground: FOREGROUND
-
-*XmFileSelectionBox.background: BACKGROUND
-*XmFileSelectionBox.foreground: FOREGROUND
-
-*XmSelectionBox.background: BACKGROUND
-*XmSelectionBox.foreground: FOREGROUND
-
-*XmMessageBox.background: BACKGROUND
-*XmMessageBox.foreground: FOREGROUND
-
-*XmRowColumn.background: BACKGROUND
-*XmRowColumn.foreground: FOREGROUND
-
-*XmFrame.background: BACKGROUND
-*XmFrame.foreground: FOREGROUND
-
-*XmForm.background: BACKGROUND
-*XmForm.foreground: FOREGROUND
-
-*XmScrolledWindow.background: BACKGROUND
-*XmScrolledWindow.foreground: FOREGROUND
-
-*XmPanedWindow.background: BACKGROUND
-*XmPanedWindow.foreground: FOREGROUND
-
-*XmText.background: WINDOW_BACKGROUND
-*XmText.foreground: WINDOW_FOREGROUND
-
-*XmTextField.background: WINDOW_BACKGROUND
-*XmTextField.foreground: WINDOW_FOREGROUND
-
-*XmList.background: WINDOW_BACKGROUND
-*XmList.foreground: WINDOW_FOREGROUND
-
-!! Use fixed font in motif lists and textfields
-!! If you don't want this, copy this file into the
-!! $HOME/.grdb directory and comment out these lines.
-!*XmTextField.fontList: FIXED_FONT
-!*XmText.fontList: FIXED_FONT
-!*XmList*fontList: FIXED_FONT
diff --git a/gnome-settings-daemon/xrdb/Tk.ad b/gnome-settings-daemon/xrdb/Tk.ad
deleted file mode 100644
index 33a12009f..000000000
--- a/gnome-settings-daemon/xrdb/Tk.ad
+++ /dev/null
@@ -1,107 +0,0 @@
-*Toplevel.background: BACKGROUND
-*Toplevel.foreground: FOREGROUND
-*Toplevel.highlightBackground: BACKGROUND
-*Toplevel.highlightColor: FOREGROUND
-*Toplevel.activeBackground: BACKGROUND
-*Toplevel.activeForeground: FOREGROUND
-
-*Button.background: BACKGROUND
-*Button.foreground: FOREGROUND
-*Button.highlightBackground: BACKGROUND
-*Button.highlightColor: FOREGROUND
-*Button.activeBackground: BACKGROUND
-*Button.activeForeground: FOREGROUND
-
-*Menubutton.background: BACKGROUND
-*Menubutton.foreground: FOREGROUND
-*Menubutton.highlightBackground: BACKGROUND
-*Menubutton.highlightColor: FOREGROUND
-*Menubutton.activeBackground: BACKGROUND
-*Menubutton.activeForeground: FOREGROUND
-
-*Checkbutton.background: BACKGROUND
-*Checkbutton.foreground: FOREGROUND
-*Checkbutton.highlightBackground: BACKGROUND
-*Checkbutton.highlightColor: FOREGROUND
-*Checkbutton.activeBackground: BACKGROUND
-*Checkbutton.activeForeground: FOREGROUND
-
-*Radiobutton.background: BACKGROUND
-*Radiobutton.foreground: FOREGROUND
-*Radiobutton.highlightBackground: BACKGROUND
-*Radiobutton.highlightColor: FOREGROUND
-*Radiobutton.activeBackground: BACKGROUND
-*Radiobutton.activeForeground: FOREGROUND
-
-!*Label.background: BACKGROUND
-!*Label.foreground: FOREGROUND
-*Label.highlightBackground: BACKGROUND
-*Label.highlightColor: FOREGROUND
-*Label.activeBackground: BACKGROUND
-*Label.activeForeground: FOREGROUND
-
-*Menu.background: BACKGROUND
-*Menu.foreground: FOREGROUND
-*Menu.highlightBackground: BACKGROUND
-*Menu.highlightColor: FOREGROUND
-*Menu.activeBackground: BACKGROUND
-*Menu.activeForeground: FOREGROUND
-
-*Frame.background: BACKGROUND
-*Frame.foreground: FOREGROUND
-*Frame.highlightBackground: BACKGROUND
-*Frame.highlightColor: FOREGROUND
-*Frame.activeBackground: BACKGROUND
-*Frame.activeForeground: FOREGROUND
-
-!*Scrollbar.background: BACKGROUND
-!*Scrollbar.foreground: FOREGROUND
-*Scrollbar.highlightBackground: BACKGROUND
-*Scrollbar.highlightColor: FOREGROUND
-*Scrollbar.activeBackground: BACKGROUND
-*Scrollbar.activeForeground: FOREGROUND
-*Scrollbar.troughColor: BACKGROUND
-
-*Scale.background: BACKGROUND
-*Scale.foreground: FOREGROUND
-*Scale.highlightBackground: BACKGROUND
-*Scale.highlightColor: FOREGROUND
-*Scale.activeBackground: BACKGROUND
-*Scale.activeForeground: FOREGROUND
-*Scale.troughColor: BACKGROUND
-
-*Entry.background: WINDOW_BACKGROUND
-*Entry.foreground: WINDOW_FOREGROUND
-*Entry.highlightBackground: WINDOW_BACKGROUND
-*Entry.highlightColor: WINDOW_FOREGROUND
-*Entry.activeBackground: WINDOW_BACKGROUND
-*Entry.activeForeground: WINDOW_FOREGROUND
-*Entry.selectBackground: SELECT_BACKGROUND
-*Entry.selectForeground: SELECT_FOREGROUND
-
-!*Text.background: WINDOW_BACKGROUND
-!*Text.foreground: WINDOW_FOREGROUND
-*Text.highlightBackground: WINDOW_BACKGROUND
-*Text.highlightColor: WINDOW_FOREGROUND
-*Text.activeBackground: WINDOW_BACKGROUND
-*Text.activeForeground: WINDOW_FOREGROUND
-*Text.selectBackground: SELECT_BACKGROUND
-*Text.selectForeground: SELECT_FOREGROUND
-
-*Listbox.background: WINDOW_BACKGROUND
-*Listbox.foreground: WINDOW_FOREGROUND
-*Listbox.highlightBackground: WINDOW_BACKGROUND
-*Listbox.highlightColor: WINDOW_FOREGROUND
-*Listbox.activeBackground: WINDOW_BACKGROUND
-*Listbox.activeForeground: WINDOW_FOREGROUND
-*Listbox.selectBackground: SELECT_BACKGROUND
-*Listbox.selectForeground: SELECT_FOREGROUND
-
-*Canvas.background: WINDOW_BACKGROUND
-*Canvas.foreground: WINDOW_FOREGROUND
-*Canvas.highlightBackground: WINDOW_BACKGROUND
-*Canvas.highlightColor: WINDOW_FOREGROUND
-*Canvas.activeBackground: WINDOW_BACKGROUND
-*Canvas.activeForeground: WINDOW_FOREGROUND
-*Canvas.selectbackground: SELECT_BACKGROUND
-*Canvas.selectforeground: SELECT_FOREGROUND
diff --git a/gnome-settings-daemon/xrdb/Xaw.ad b/gnome-settings-daemon/xrdb/Xaw.ad
deleted file mode 100644
index c88213841..000000000
--- a/gnome-settings-daemon/xrdb/Xaw.ad
+++ /dev/null
@@ -1,41 +0,0 @@
-*beNiceToColormap: false
-*borderColor: black
-
-*MenuButton.background: BACKGROUND
-*Command.background: BACKGROUND
-*Toggle.background: BACKGROUND
-*Label.background: BACKGROUND
-*Scrollbar*background: BACKGROUND
-*SimpleMenu*background: BACKGROUND
-*Box.background: BACKGROUND
-*Form.background: BACKGROUND
-*Dialog.background: BACKGROUND
-*Text.background: WINDOW_BACKGROUND
-*List.background: WINDOW_BACKGROUND
-
-*MenuButton.foreground: FOREGROUND
-*Command.foreground: FOREGROUND
-*Toggle.foreground: FOREGROUND
-*Label.foreground: FOREGROUND
-*Scrollbar.foreground: FOREGROUND
-*SimpleMenu*foreground: FOREGROUND
-*Box.foreground: FOREGROUND
-*Form.foreground: FOREGROUND
-*Dialog.foreground: FOREGROUND
-*Text.foreground: WINDOW_FOREGROUND
-*List.foreground: WINDOW_FOREGROUND
-
-*ScrollbarBackground: BACKGROUND
-*Scrollbar*width: 15
-*Scrollbar*height: 15
-*Scrollbar*shadowWidth: 2
-*Scrollbar*cursorName: left_ptr
-*Scrollbar*pushThumb: false
-*ShapeStyle: Rectangle
-*SmeBSB*shadowWidth: 3
-*Scrollbar*Cursor: left_ptr
-*Command.translations: \
- <LeaveWindow>: reset()\n\
- <Btn1Down>: set()\n\
- <Btn1Up>: notify() unset()
-
diff --git a/gnome-settings-daemon/xsettings-common.c b/gnome-settings-daemon/xsettings-common.c
deleted file mode 100644
index 992175a11..000000000
--- a/gnome-settings-daemon/xsettings-common.c
+++ /dev/null
@@ -1,264 +0,0 @@
-/*
- * Copyright © 2001 Red Hat, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Red Hat not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission. Red Hat makes no representations about the
- * suitability of this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- *
- * RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL RED HAT
- * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * Author: Owen Taylor, Red Hat, Inc.
- */
-#include "string.h"
-#include "stdlib.h"
-
-#include <X11/Xlib.h>
-#include <X11/Xmd.h> /* For CARD32 */
-
-#include "xsettings-common.h"
-
-XSettingsSetting *
-xsettings_setting_copy (XSettingsSetting *setting)
-{
- XSettingsSetting *result;
- size_t str_len;
-
- result = malloc (sizeof *result);
- if (!result)
- return NULL;
-
- str_len = strlen (setting->name);
- result->name = malloc (str_len + 1);
- if (!result->name)
- goto err;
-
- memcpy (result->name, setting->name, str_len + 1);
-
- result->type = setting->type;
-
- switch (setting->type)
- {
- case XSETTINGS_TYPE_INT:
- result->data.v_int = setting->data.v_int;
- break;
- case XSETTINGS_TYPE_COLOR:
- result->data.v_color = setting->data.v_color;
- break;
- case XSETTINGS_TYPE_STRING:
- str_len = strlen (setting->data.v_string);
- result->data.v_string = malloc (str_len + 1);
- if (!result->data.v_string)
- goto err;
-
- memcpy (result->data.v_string, setting->data.v_string, str_len + 1);
- break;
- }
-
- result->last_change_serial = setting->last_change_serial;
-
- return result;
-
- err:
- if (result->name)
- free (result->name);
- free (result);
-
- return NULL;
-}
-
-XSettingsList *
-xsettings_list_copy (XSettingsList *list)
-{
- XSettingsList *new = NULL;
- XSettingsList *old_iter = list;
- XSettingsList *new_iter = NULL;
-
- while (old_iter)
- {
- XSettingsList *new_node;
-
- new_node = malloc (sizeof *new_node);
- if (!new_node)
- goto error;
-
- new_node->setting = xsettings_setting_copy (old_iter->setting);
- if (!new_node->setting)
- {
- free (new_node);
- goto error;
- }
-
- if (new_iter)
- new_iter->next = new_node;
- else
- new = new_node;
-
- new_iter = new_node;
-
- old_iter = old_iter->next;
- }
-
- return new;
-
- error:
- xsettings_list_free (new);
- return NULL;
-}
-
-int
-xsettings_setting_equal (XSettingsSetting *setting_a,
- XSettingsSetting *setting_b)
-{
- if (setting_a->type != setting_b->type)
- return 0;
-
- if (strcmp (setting_a->name, setting_b->name) != 0)
- return 0;
-
- switch (setting_a->type)
- {
- case XSETTINGS_TYPE_INT:
- return setting_a->data.v_int == setting_b->data.v_int;
- case XSETTINGS_TYPE_COLOR:
- return (setting_a->data.v_color.red == setting_b->data.v_color.red &&
- setting_a->data.v_color.green == setting_b->data.v_color.green &&
- setting_a->data.v_color.blue == setting_b->data.v_color.blue &&
- setting_a->data.v_color.alpha == setting_b->data.v_color.alpha);
- case XSETTINGS_TYPE_STRING:
- return strcmp (setting_a->data.v_string, setting_b->data.v_string) == 0;
- }
-
- return 0;
-}
-
-void
-xsettings_setting_free (XSettingsSetting *setting)
-{
- if (setting->type == XSETTINGS_TYPE_STRING)
- free (setting->data.v_string);
-
- if (setting->name)
- free (setting->name);
-
- free (setting);
-}
-
-void
-xsettings_list_free (XSettingsList *list)
-{
- while (list)
- {
- XSettingsList *next = list->next;
-
- xsettings_setting_free (list->setting);
- free (list);
-
- list = next;
- }
-}
-
-XSettingsResult
-xsettings_list_insert (XSettingsList **list,
- XSettingsSetting *setting)
-{
- XSettingsList *node;
- XSettingsList *iter;
- XSettingsList *last = NULL;
-
- node = malloc (sizeof *node);
- if (!node)
- return XSETTINGS_NO_MEM;
- node->setting = setting;
-
- iter = *list;
- while (iter)
- {
- int cmp = strcmp (setting->name, iter->setting->name);
-
- if (cmp < 0)
- break;
- else if (cmp == 0)
- {
- free (node);
- return XSETTINGS_DUPLICATE_ENTRY;
- }
-
- last = iter;
- iter = iter->next;
- }
-
- if (last)
- last->next = node;
- else
- *list = node;
-
- node->next = iter;
-
- return XSETTINGS_SUCCESS;
-}
-
-XSettingsResult
-xsettings_list_delete (XSettingsList **list,
- const char *name)
-{
- XSettingsList *iter;
- XSettingsList *last = NULL;
-
- iter = *list;
- while (iter)
- {
- if (strcmp (name, iter->setting->name) == 0)
- {
- if (last)
- last->next = iter->next;
- else
- *list = iter->next;
-
- xsettings_setting_free (iter->setting);
- free (iter);
-
- return XSETTINGS_SUCCESS;
- }
-
- last = iter;
- iter = iter->next;
- }
-
- return XSETTINGS_FAILED;
-}
-
-XSettingsSetting *
-xsettings_list_lookup (XSettingsList *list,
- const char *name)
-{
- XSettingsList *iter;
-
- iter = list;
- while (iter)
- {
- if (strcmp (name, iter->setting->name) == 0)
- return iter->setting;
-
- iter = iter->next;
- }
-
- return NULL;
-}
-
-char
-xsettings_byte_order (void)
-{
- CARD32 myint = 0x01020304;
- return (*(char *)&myint == 1) ? MSBFirst : LSBFirst;
-}
diff --git a/gnome-settings-daemon/xsettings-common.h b/gnome-settings-daemon/xsettings-common.h
deleted file mode 100644
index e3af4a662..000000000
--- a/gnome-settings-daemon/xsettings-common.h
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * Copyright © 2001 Red Hat, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Red Hat not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission. Red Hat makes no representations about the
- * suitability of this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- *
- * RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL RED HAT
- * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * Author: Owen Taylor, Red Hat, Inc.
- */
-#ifndef XSETTINGS_COMMON_H
-#define XSETTINGS_COMMON_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-typedef struct _XSettingsBuffer XSettingsBuffer;
-typedef struct _XSettingsColor XSettingsColor;
-typedef struct _XSettingsList XSettingsList;
-typedef struct _XSettingsSetting XSettingsSetting;
-
-/* Types of settings possible. Enum values correspond to
- * protocol values.
- */
-typedef enum
-{
- XSETTINGS_TYPE_INT = 0,
- XSETTINGS_TYPE_STRING = 1,
- XSETTINGS_TYPE_COLOR = 2
-} XSettingsType;
-
-typedef enum
-{
- XSETTINGS_SUCCESS,
- XSETTINGS_NO_MEM,
- XSETTINGS_ACCESS,
- XSETTINGS_FAILED,
- XSETTINGS_NO_ENTRY,
- XSETTINGS_DUPLICATE_ENTRY
-} XSettingsResult;
-
-struct _XSettingsBuffer
-{
- char byte_order;
- size_t len;
- unsigned char *data;
- unsigned char *pos;
-};
-
-struct _XSettingsColor
-{
- unsigned short red, green, blue, alpha;
-};
-
-struct _XSettingsList
-{
- XSettingsSetting *setting;
- XSettingsList *next;
-};
-
-struct _XSettingsSetting
-{
- char *name;
- XSettingsType type;
-
- union {
- int v_int;
- char *v_string;
- XSettingsColor v_color;
- } data;
-
- unsigned long last_change_serial;
-};
-
-XSettingsSetting *xsettings_setting_copy (XSettingsSetting *setting);
-void xsettings_setting_free (XSettingsSetting *setting);
-int xsettings_setting_equal (XSettingsSetting *setting_a,
- XSettingsSetting *setting_b);
-
-void xsettings_list_free (XSettingsList *list);
-XSettingsList *xsettings_list_copy (XSettingsList *list);
-XSettingsResult xsettings_list_insert (XSettingsList **list,
- XSettingsSetting *setting);
-XSettingsSetting *xsettings_list_lookup (XSettingsList *list,
- const char *name);
-XSettingsResult xsettings_list_delete (XSettingsList **list,
- const char *name);
-
-char xsettings_byte_order (void);
-
-#define XSETTINGS_PAD(n,m) ((n + m - 1) & (~(m-1)))
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* XSETTINGS_COMMON_H */
diff --git a/gnome-settings-daemon/xsettings-manager.c b/gnome-settings-daemon/xsettings-manager.c
deleted file mode 100644
index 98c800c0d..000000000
--- a/gnome-settings-daemon/xsettings-manager.c
+++ /dev/null
@@ -1,424 +0,0 @@
-/*
- * Copyright © 2001 Red Hat, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Red Hat not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission. Red Hat makes no representations about the
- * suitability of this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- *
- * RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL RED HAT
- * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * Author: Owen Taylor, Red Hat, Inc.
- */
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <X11/Xmd.h> /* For CARD16 */
-
-#include "xsettings-manager.h"
-
-struct _XSettingsManager
-{
- Display *display;
- int screen;
-
- Window window;
- Atom manager_atom;
- Atom selection_atom;
- Atom xsettings_atom;
-
- XSettingsTerminateFunc terminate;
- void *cb_data;
-
- XSettingsList *settings;
- unsigned long serial;
-};
-
-XSettingsList *settings;
-
-typedef struct
-{
- Window window;
- Atom timestamp_prop_atom;
-} TimeStampInfo;
-
-static Bool
-timestamp_predicate (Display *display,
- XEvent *xevent,
- XPointer arg)
-{
- TimeStampInfo *info = (TimeStampInfo *)arg;
-
- if (xevent->type == PropertyNotify &&
- xevent->xproperty.window == info->window &&
- xevent->xproperty.atom == info->timestamp_prop_atom)
- return True;
-
- return False;
-}
-
-/**
- * get_server_time:
- * @display: display from which to get the time
- * @window: a #Window, used for communication with the server.
- * The window must have PropertyChangeMask in its
- * events mask or a hang will result.
- *
- * Routine to get the current X server time stamp.
- *
- * Return value: the time stamp.
- **/
-static Time
-get_server_time (Display *display,
- Window window)
-{
- unsigned char c = 'a';
- XEvent xevent;
- TimeStampInfo info;
-
- info.timestamp_prop_atom = XInternAtom (display, "_TIMESTAMP_PROP", False);
- info.window = window;
-
- XChangeProperty (display, window,
- info.timestamp_prop_atom, info.timestamp_prop_atom,
- 8, PropModeReplace, &c, 1);
-
- XIfEvent (display, &xevent,
- timestamp_predicate, (XPointer)&info);
-
- return xevent.xproperty.time;
-}
-
-Bool
-xsettings_manager_check_running (Display *display,
- int screen)
-{
- char buffer[256];
- Atom selection_atom;
-
- sprintf(buffer, "_XSETTINGS_S%d", screen);
- selection_atom = XInternAtom (display, buffer, False);
-
- if (XGetSelectionOwner (display, selection_atom))
- return True;
- else
- return False;
-}
-
-XSettingsManager *
-xsettings_manager_new (Display *display,
- int screen,
- XSettingsTerminateFunc terminate,
- void *cb_data)
-{
- XSettingsManager *manager;
- Time timestamp;
- XClientMessageEvent xev;
-
- char buffer[256];
-
- manager = malloc (sizeof *manager);
- if (!manager)
- return NULL;
-
- manager->display = display;
- manager->screen = screen;
-
- sprintf(buffer, "_XSETTINGS_S%d", screen);
- manager->selection_atom = XInternAtom (display, buffer, False);
- manager->xsettings_atom = XInternAtom (display, "_XSETTINGS_SETTINGS", False);
- manager->manager_atom = XInternAtom (display, "MANAGER", False);
-
- manager->terminate = terminate;
- manager->cb_data = cb_data;
-
- manager->settings = NULL;
- manager->serial = 0;
-
- manager->window = XCreateSimpleWindow (display,
- RootWindow (display, screen),
- 0, 0, 10, 10, 0,
- WhitePixel (display, screen),
- WhitePixel (display, screen));
-
- XSelectInput (display, manager->window, PropertyChangeMask);
- timestamp = get_server_time (display, manager->window);
-
- XSetSelectionOwner (display, manager->selection_atom,
- manager->window, timestamp);
-
- /* Check to see if we managed to claim the selection. If not,
- * we treat it as if we got it then immediately lost it
- */
-
- if (XGetSelectionOwner (display, manager->selection_atom) ==
- manager->window)
- {
- xev.type = ClientMessage;
- xev.window = RootWindow (display, screen);
- xev.message_type = manager->manager_atom;
- xev.format = 32;
- xev.data.l[0] = timestamp;
- xev.data.l[1] = manager->selection_atom;
- xev.data.l[2] = manager->window;
- xev.data.l[3] = 0; /* manager specific data */
- xev.data.l[4] = 0; /* manager specific data */
-
- XSendEvent (display, RootWindow (display, screen),
- False, StructureNotifyMask, (XEvent *)&xev);
- }
- else
- {
- manager->terminate (manager->cb_data);
- }
-
- return manager;
-}
-
-void
-xsettings_manager_destroy (XSettingsManager *manager)
-{
- XDestroyWindow (manager->display, manager->window);
-
- xsettings_list_free (manager->settings);
- free (manager);
-}
-
-Window
-xsettings_manager_get_window (XSettingsManager *manager)
-{
- return manager->window;
-}
-
-Bool
-xsettings_manager_process_event (XSettingsManager *manager,
- XEvent *xev)
-{
- if (xev->xany.window == manager->window &&
- xev->xany.type == SelectionClear &&
- xev->xselectionclear.selection == manager->selection_atom)
- {
- manager->terminate (manager->cb_data);
- return True;
- }
-
- return False;
-}
-
-XSettingsResult
-xsettings_manager_delete_setting (XSettingsManager *manager,
- const char *name)
-{
- return xsettings_list_delete (&settings, name);
-}
-
-XSettingsResult
-xsettings_manager_set_setting (XSettingsManager *manager,
- XSettingsSetting *setting)
-{
- XSettingsSetting *old_setting = xsettings_list_lookup (settings, setting->name);
- XSettingsSetting *new_setting;
- XSettingsResult result;
-
- if (old_setting)
- {
- if (xsettings_setting_equal (old_setting, setting))
- return XSETTINGS_SUCCESS;
-
- xsettings_list_delete (&settings, setting->name);
- }
-
- new_setting = xsettings_setting_copy (setting);
- if (!new_setting)
- return XSETTINGS_NO_MEM;
-
- new_setting->last_change_serial = manager->serial;
-
- result = xsettings_list_insert (&settings, new_setting);
-
- if (result != XSETTINGS_SUCCESS)
- xsettings_setting_free (new_setting);
-
- return result;
-}
-
-XSettingsResult
-xsettings_manager_set_int (XSettingsManager *manager,
- const char *name,
- int value)
-{
- XSettingsSetting setting;
-
- setting.name = (char *)name;
- setting.type = XSETTINGS_TYPE_INT;
- setting.data.v_int = value;
-
- return xsettings_manager_set_setting (manager, &setting);
-}
-
-XSettingsResult
-xsettings_manager_set_string (XSettingsManager *manager,
- const char *name,
- const char *value)
-{
- XSettingsSetting setting;
-
- setting.name = (char *)name;
- setting.type = XSETTINGS_TYPE_STRING;
- setting.data.v_string = (char *)value;
-
- return xsettings_manager_set_setting (manager, &setting);
-}
-
-XSettingsResult
-xsettings_manager_set_color (XSettingsManager *manager,
- const char *name,
- XSettingsColor *value)
-{
- XSettingsSetting setting;
-
- setting.name = (char *)name;
- setting.type = XSETTINGS_TYPE_COLOR;
- setting.data.v_color = *value;
-
- return xsettings_manager_set_setting (manager, &setting);
-}
-
-size_t
-setting_length (XSettingsSetting *setting)
-{
- size_t length = 8; /* type + pad + name-len + last-change-serial */
- length += XSETTINGS_PAD (strlen (setting->name), 4);
-
- switch (setting->type)
- {
- case XSETTINGS_TYPE_INT:
- length += 4;
- break;
- case XSETTINGS_TYPE_STRING:
- length += 4 + XSETTINGS_PAD (strlen (setting->data.v_string), 4);
- break;
- case XSETTINGS_TYPE_COLOR:
- length += 8;
- break;
- }
-
- return length;
-}
-
-void
-setting_store (XSettingsSetting *setting,
- XSettingsBuffer *buffer)
-{
- size_t string_len;
- size_t length;
-
- *(buffer->pos++) = setting->type;
- *(buffer->pos++) = 0;
-
- string_len = strlen (setting->name);
- *(CARD16 *)(buffer->pos) = string_len;
- buffer->pos += 2;
-
- length = XSETTINGS_PAD (string_len, 4);
- memcpy (buffer->pos, setting->name, string_len);
- length -= string_len;
- buffer->pos += string_len;
-
- while (length > 0)
- {
- *(buffer->pos++) = 0;
- length--;
- }
-
- *(CARD32 *)(buffer->pos) = setting->last_change_serial;
- buffer->pos += 4;
-
- switch (setting->type)
- {
- case XSETTINGS_TYPE_INT:
- *(CARD32 *)(buffer->pos) = setting->data.v_int;
- buffer->pos += 4;
- break;
- case XSETTINGS_TYPE_STRING:
- string_len = strlen (setting->data.v_string);
- *(CARD32 *)(buffer->pos) = string_len;
- buffer->pos += 4;
-
- length = XSETTINGS_PAD (string_len, 4);
- memcpy (buffer->pos, setting->data.v_string, string_len);
- length -= string_len;
- buffer->pos += string_len;
-
- while (length > 0)
- {
- *(buffer->pos++) = 0;
- length--;
- }
- break;
- case XSETTINGS_TYPE_COLOR:
- *(CARD16 *)(buffer->pos) = setting->data.v_color.red;
- *(CARD16 *)(buffer->pos + 2) = setting->data.v_color.green;
- *(CARD16 *)(buffer->pos + 4) = setting->data.v_color.blue;
- *(CARD16 *)(buffer->pos + 6) = setting->data.v_color.alpha;
- buffer->pos += 8;
- break;
- }
-}
-
-XSettingsResult
-xsettings_manager_notify (XSettingsManager *manager)
-{
- XSettingsBuffer buffer;
- XSettingsList *iter;
- int n_settings = 0;
-
- buffer.len = 12; /* byte-order + pad + SERIAL + N_SETTINGS */
-
- iter = settings;
- while (iter)
- {
- buffer.len += setting_length (iter->setting);
- n_settings++;
- iter = iter->next;
- }
-
- buffer.data = buffer.pos = malloc (buffer.len);
- if (!buffer.data)
- return XSETTINGS_NO_MEM;
-
- *buffer.pos = xsettings_byte_order ();
-
- buffer.pos += 4;
- *(CARD32 *)buffer.pos = manager->serial++;
- buffer.pos += 4;
- *(CARD32 *)buffer.pos = n_settings;
- buffer.pos += 4;
-
- iter = settings;
- while (iter)
- {
- setting_store (iter->setting, &buffer);
- iter = iter->next;
- }
-
- XChangeProperty (manager->display, manager->window,
- manager->xsettings_atom, manager->xsettings_atom,
- 8, PropModeReplace, buffer.data, buffer.len);
-
- free (buffer.data);
-
- return XSETTINGS_SUCCESS;
-}
-
diff --git a/gnome-settings-daemon/xsettings-manager.h b/gnome-settings-daemon/xsettings-manager.h
deleted file mode 100644
index f309768b1..000000000
--- a/gnome-settings-daemon/xsettings-manager.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright © 2001 Red Hat, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of Red Hat not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission. Red Hat makes no representations about the
- * suitability of this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- *
- * RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL RED HAT
- * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * Author: Owen Taylor, Red Hat, Inc.
- */
-#ifndef XSETTINGS_MANAGER_H
-#define XSETTINGS_MANAGER_H
-
-#include <X11/Xlib.h>
-#include "xsettings-common.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-typedef struct _XSettingsManager XSettingsManager;
-
-typedef void (*XSettingsTerminateFunc) (void *cb_data);
-
-Bool xsettings_manager_check_running (Display *display,
- int screen);
-
-XSettingsManager *xsettings_manager_new (Display *display,
- int screen,
- XSettingsTerminateFunc terminate,
- void *cb_data);
-
-void xsettings_manager_destroy (XSettingsManager *manager);
-Window xsettings_manager_get_window (XSettingsManager *manager);
-Bool xsettings_manager_process_event (XSettingsManager *manager,
- XEvent *xev);
-
-XSettingsResult xsettings_manager_delete_setting (XSettingsManager *manager,
- const char *name);
-XSettingsResult xsettings_manager_set_setting (XSettingsManager *manager,
- XSettingsSetting *setting);
-XSettingsResult xsettings_manager_set_int (XSettingsManager *manager,
- const char *name,
- int value);
-XSettingsResult xsettings_manager_set_string (XSettingsManager *manager,
- const char *name,
- const char *value);
-XSettingsResult xsettings_manager_set_color (XSettingsManager *manager,
- const char *name,
- XSettingsColor *value);
-XSettingsResult xsettings_manager_notify (XSettingsManager *manager);
-
-
-
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* XSETTINGS_MANAGER_H */