1 /* vim: set sts=2 sw=2 et: */
3 * Copyright (C) 2008 Jari Tenhunen <jari.tenhunen@iki.fi>
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
15 * You should have received a copy of the GNU Library General Public
16 * License along with this library; if not, write to the
17 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 * Boston, MA 02111-1307, USA.
27 static GConfClient * client = NULL;
33 client = gconf_client_get_default ();
40 settings_get_display_keepalive (gboolean default_value)
42 GConfValue * value = NULL;
44 gboolean val = default_value;
46 value = gconf_client_get (get_client (), GCONF_KEY_DISPLAY_KEEPALIVE, &err);
52 if (value->type == GCONF_VALUE_BOOL)
53 val = gconf_value_get_bool (value);
55 gconf_value_free (value);
62 settings_set_disp_keepalive (gboolean val)
64 return gconf_client_set_bool (get_client (), GCONF_KEY_DISPLAY_KEEPALIVE, val, NULL);
68 settings_get_algorithm (gint default_value)
70 GConfValue * value = NULL;
72 gint val = default_value;
74 value = gconf_client_get (get_client (), GCONF_KEY_ALGORITHM, &err);
80 if (value->type == GCONF_VALUE_INT)
81 val = gconf_value_get_int (value);
83 gconf_value_free (value);
90 settings_set_algorithm (gint val)
92 return gconf_client_set_int (get_client (), GCONF_KEY_ALGORITHM, val, NULL);
96 settings_get_calibration (gint default_value)
101 val = gconf_client_get_int (get_client (), GCONF_KEY_CALIBRATION, &err);
113 settings_set_calibration (gint value)
115 return gconf_client_set_int (get_client (), GCONF_KEY_CALIBRATION, value, NULL);
119 settings_init (GConfClientNotifyFunc func, gpointer user_data)
121 gconf_client_add_dir (get_client (), GCONF_ROOT, GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
122 gconf_client_notify_add (get_client (), GCONF_ROOT, func, user_data, NULL, NULL);