~ubuntu-branches/ubuntu/karmic/xfce4-session/karmic

« back to all changes in this revision

Viewing changes to libxfsm/xfsm-splash-rc.c

  • Committer: Bazaar Package Importer
  • Author(s): Yves-Alexis Perez
  • Date: 2005-11-06 22:01:12 UTC
  • mto: (4.1.1 lenny) (1.3.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: james.westby@ubuntu.com-20051106220112-5rusox237ymjghsp
Tags: upstream-4.2.3
ImportĀ upstreamĀ versionĀ 4.2.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* $Id: xfsm-splash-rc.c 4711 2004-11-01 16:10:55Z benny $ */
 
2
/*-
 
3
 * Copyright (c) 2003-2004 Benedikt Meurer <benny@xfce.org>
 
4
 * All rights reserved.
 
5
 *
 
6
 * This program is free software; you can redistribute it and/or modify
 
7
 * it under the terms of the GNU General Public License as published by
 
8
 * the Free Software Foundation; either version 2, or (at your option)
 
9
 * any later version.
 
10
 *                                                                              
 
11
 * This program is distributed in the hope that it will be useful,
 
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
14
 * GNU General Public License for more details.
 
15
 *                                                                              
 
16
 * You should have received a copy of the GNU General Public License
 
17
 * along with this program; if not, write to the Free Software
 
18
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 
19
 * 02111-1307, USA.
 
20
 */
 
21
 
 
22
#ifdef HAVE_CONFIG_H
 
23
#include <config.h>
 
24
#endif
 
25
 
 
26
#include <libxfsm/xfsm-splash-rc.h>
 
27
 
 
28
 
 
29
struct _XfsmSplashRc
 
30
{
 
31
  gchar  *group;
 
32
  XfceRc *rc;
 
33
};
 
34
 
 
35
 
 
36
XfsmSplashRc*
 
37
xfsm_splash_rc_new (XfceRc      *rc,
 
38
                    const gchar *group)
 
39
{
 
40
  XfsmSplashRc *splash_rc;
 
41
 
 
42
  splash_rc         = g_new (XfsmSplashRc, 1);
 
43
  splash_rc->group  = g_strdup (group);
 
44
  splash_rc->rc     = rc;
 
45
 
 
46
  return splash_rc;
 
47
}
 
48
 
 
49
 
 
50
const gchar*
 
51
xfsm_splash_rc_read_entry (XfsmSplashRc *splash_rc,
 
52
                           const gchar  *key,
 
53
                           const gchar  *fallback)
 
54
{
 
55
  xfce_rc_set_group (splash_rc->rc, splash_rc->group);
 
56
  return xfce_rc_read_entry (splash_rc->rc, key, fallback);
 
57
}
 
58
 
 
59
 
 
60
gint
 
61
xfsm_splash_rc_read_int_entry (XfsmSplashRc *splash_rc,
 
62
                               const gchar  *key,
 
63
                               gint          fallback)
 
64
{
 
65
  xfce_rc_set_group (splash_rc->rc, splash_rc->group);
 
66
  return xfce_rc_read_int_entry (splash_rc->rc, key, fallback);
 
67
}
 
68
 
 
69
 
 
70
gboolean
 
71
xfsm_splash_rc_read_bool_entry (XfsmSplashRc *splash_rc,
 
72
                                const gchar  *key,
 
73
                                gboolean      fallback)
 
74
{
 
75
  xfce_rc_set_group (splash_rc->rc, splash_rc->group);
 
76
  return xfce_rc_read_bool_entry (splash_rc->rc, key, fallback);
 
77
}
 
78
 
 
79
 
 
80
gchar**
 
81
xfsm_splash_rc_read_list_entry (XfsmSplashRc *splash_rc,
 
82
                                const gchar  *key,
 
83
                                const gchar  *delimiter)
 
84
{
 
85
  xfce_rc_set_group (splash_rc->rc, splash_rc->group);
 
86
  return xfce_rc_read_list_entry (splash_rc->rc, key, delimiter);
 
87
}
 
88
 
 
89
 
 
90
void
 
91
xfsm_splash_rc_write_entry (XfsmSplashRc *splash_rc,
 
92
                            const gchar  *key,
 
93
                            const gchar  *value)
 
94
{
 
95
  xfce_rc_set_group (splash_rc->rc, splash_rc->group);
 
96
  xfce_rc_write_entry (splash_rc->rc, key, value);
 
97
}
 
98
 
 
99
 
 
100
void
 
101
xfsm_splash_rc_write_int_entry (XfsmSplashRc *splash_rc,
 
102
                                const gchar  *key,
 
103
                                gint          value)
 
104
{
 
105
  xfce_rc_set_group (splash_rc->rc, splash_rc->group);
 
106
  xfce_rc_write_int_entry (splash_rc->rc, key, value);
 
107
}
 
108
 
 
109
 
 
110
void
 
111
xfsm_splash_rc_write_bool_entry (XfsmSplashRc *splash_rc,
 
112
                                 const gchar  *key,
 
113
                                 gboolean      value)
 
114
{
 
115
  xfce_rc_set_group (splash_rc->rc, splash_rc->group);
 
116
  xfce_rc_write_bool_entry (splash_rc->rc, key, value);
 
117
}
 
118
 
 
119
 
 
120
void
 
121
xfsm_splash_rc_write_list_entry (XfsmSplashRc *splash_rc,
 
122
                                 const gchar  *key,
 
123
                                 gchar       **value,
 
124
                                 const gchar  *delimiter)
 
125
{
 
126
  xfce_rc_set_group (splash_rc->rc, splash_rc->group);
 
127
  xfce_rc_write_list_entry (splash_rc->rc, key, value, delimiter);
 
128
}
 
129
 
 
130
 
 
131
void
 
132
xfsm_splash_rc_free (XfsmSplashRc *splash_rc)
 
133
{
 
134
  g_free (splash_rc->group);
 
135
  g_free (splash_rc);
 
136
}
 
137
 
 
138