[
glib-2.0 >= $GLIB_REQUIRED
gobject-2.0
- gconf-2.0 >= $GCONF_REQUIRED
libxml-2.0
libtelepathy >= $TELEPATHY_REQUIRED
telepathy-glib >= $TELEPATHY_GLIB_REQUIRED
<xi:include href="xml/empathy-chat.xml"/>
<xi:include href="xml/empathy-chat-view.xml"/>
<xi:include href="xml/empathy-chat-window.xml"/>
+ <xi:include href="xml/empathy-conf.xml"/>
<xi:include href="xml/empathy-contact-dialogs.xml"/>
<xi:include href="xml/empathy-contact-list-store.xml"/>
<xi:include href="xml/empathy-contact-list-view.xml"/>
<xi:include href="xml/empathy-chandler.xml"/>
<xi:include href="xml/empathy-chatroom-manager.xml"/>
<xi:include href="xml/empathy-chatroom.xml"/>
- <xi:include href="xml/empathy-conf.xml"/>
<xi:include href="xml/empathy-contact-factory.xml"/>
<xi:include href="xml/empathy-contact-groups.xml"/>
<xi:include href="xml/empathy-contact-list.xml"/>
ephy-spinner.c ephy-spinner.h \
empathy-main-window.c \
empathy-status-icon.c \
+ empathy-conf.c \
empathy-contact-widget.c \
empathy-contact-dialogs.c \
empathy-accounts-dialog.c \
empathy-images.h \
empathy-main-window.h \
empathy-status-icon.h \
+ empathy-conf.h \
empathy-contact-widget.h \
empathy-contact-dialogs.h \
empathy-accounts-dialog.h \
#include <libgnomevfs/gnome-vfs-ops.h>
#include <libempathy/empathy-debug.h>
-#include <libempathy/empathy-conf.h>
+
#include "empathy-avatar-chooser.h"
+#include "empathy-conf.h"
#include "empathy-preferences.h"
#include "empathy-ui-utils.h"
#include <libempathy/empathy-utils.h>
#include <libempathy/empathy-debug.h>
-#include <libempathy/empathy-conf.h>
#include "empathy-chat-view.h"
#include "empathy-chat.h"
+#include "empathy-conf.h"
#include "empathy-preferences.h"
#include "empathy-theme-manager.h"
#include "empathy-ui-utils.h"
#include <libempathy/empathy-contact.h>
#include <libempathy/empathy-debug.h>
#include <libempathy/empathy-message.h>
-#include <libempathy/empathy-conf.h>
#include <libempathy/empathy-utils.h>
#include "empathy-chat-window.h"
#include "empathy-contact-dialogs.h"
#include "empathy-log-window.h"
#include "empathy-new-chatroom-dialog.h"
+#include "empathy-conf.h"
#include "empathy-preferences.h"
#include "empathy-private-chat.h"
#include "empathy-group-chat.h"
#include <libempathy/empathy-log-manager.h>
#include <libempathy/empathy-debug.h>
#include <libempathy/empathy-utils.h>
-#include <libempathy/empathy-conf.h>
#include <libempathy/empathy-marshal.h>
#include "empathy-chat.h"
#include "empathy-chat-window.h"
#include "empathy-geometry.h"
+#include "empathy-conf.h"
#include "empathy-preferences.h"
#include "empathy-spell.h"
#include "empathy-spell-dialog.h"
--- /dev/null
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * Copyright (C) 2006 Imendio AB
+ *
+ * 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 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 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.
+ *
+ * Authors: Richard Hult <richard@imendio.com>
+ */
+
+#include "config.h"
+
+#include <string.h>
+
+#include <gconf/gconf-client.h>
+
+#include <libempathy/empathy-debug.h>
+
+#include "empathy-conf.h"
+
+#define DEBUG_DOMAIN "Config"
+
+#define EMPATHY_CONF_ROOT "/apps/empathy"
+#define DESKTOP_INTERFACE_ROOT "/desktop/gnome/interface"
+
+#define GET_PRIV(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), EMPATHY_TYPE_CONF, EmpathyConfPriv))
+
+typedef struct {
+ GConfClient *gconf_client;
+} EmpathyConfPriv;
+
+typedef struct {
+ EmpathyConf *conf;
+ EmpathyConfNotifyFunc func;
+ gpointer user_data;
+} EmpathyConfNotifyData;
+
+static void conf_finalize (GObject *object);
+
+G_DEFINE_TYPE (EmpathyConf, empathy_conf, G_TYPE_OBJECT);
+
+static EmpathyConf *global_conf = NULL;
+
+static void
+empathy_conf_class_init (EmpathyConfClass *class)
+{
+ GObjectClass *object_class;
+
+ object_class = G_OBJECT_CLASS (class);
+
+ object_class->finalize = conf_finalize;
+
+ g_type_class_add_private (object_class, sizeof (EmpathyConfPriv));
+}
+
+static void
+empathy_conf_init (EmpathyConf *conf)
+{
+ EmpathyConfPriv *priv;
+
+ priv = GET_PRIV (conf);
+
+ priv->gconf_client = gconf_client_get_default ();
+
+ gconf_client_add_dir (priv->gconf_client,
+ EMPATHY_CONF_ROOT,
+ GCONF_CLIENT_PRELOAD_ONELEVEL,
+ NULL);
+ gconf_client_add_dir (priv->gconf_client,
+ DESKTOP_INTERFACE_ROOT,
+ GCONF_CLIENT_PRELOAD_NONE,
+ NULL);
+}
+
+static void
+conf_finalize (GObject *object)
+{
+ EmpathyConfPriv *priv;
+
+ priv = GET_PRIV (object);
+
+ gconf_client_remove_dir (priv->gconf_client,
+ EMPATHY_CONF_ROOT,
+ NULL);
+ gconf_client_remove_dir (priv->gconf_client,
+ DESKTOP_INTERFACE_ROOT,
+ NULL);
+
+ g_object_unref (priv->gconf_client);
+
+ G_OBJECT_CLASS (empathy_conf_parent_class)->finalize (object);
+}
+
+EmpathyConf *
+empathy_conf_get (void)
+{
+ if (!global_conf) {
+ global_conf = g_object_new (EMPATHY_TYPE_CONF, NULL);
+ }
+
+ return global_conf;
+}
+
+void
+empathy_conf_shutdown (void)
+{
+ if (global_conf) {
+ g_object_unref (global_conf);
+ global_conf = NULL;
+ }
+}
+
+gboolean
+empathy_conf_set_int (EmpathyConf *conf,
+ const gchar *key,
+ gint value)
+{
+ EmpathyConfPriv *priv;
+
+ g_return_val_if_fail (EMPATHY_IS_CONF (conf), FALSE);
+
+ empathy_debug (DEBUG_DOMAIN, "Setting int:'%s' to %d", key, value);
+
+ priv = GET_PRIV (conf);
+
+ return gconf_client_set_int (priv->gconf_client,
+ key,
+ value,
+ NULL);
+}
+
+gboolean
+empathy_conf_get_int (EmpathyConf *conf,
+ const gchar *key,
+ gint *value)
+{
+ EmpathyConfPriv *priv;
+ GError *error = NULL;
+
+ *value = 0;
+
+ g_return_val_if_fail (EMPATHY_IS_CONF (conf), FALSE);
+ g_return_val_if_fail (value != NULL, FALSE);
+
+ priv = GET_PRIV (conf);
+
+ *value = gconf_client_get_int (priv->gconf_client,
+ key,
+ &error);
+
+ if (error) {
+ g_error_free (error);
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+gboolean
+empathy_conf_set_bool (EmpathyConf *conf,
+ const gchar *key,
+ gboolean value)
+{
+ EmpathyConfPriv *priv;
+
+ g_return_val_if_fail (EMPATHY_IS_CONF (conf), FALSE);
+
+ empathy_debug (DEBUG_DOMAIN, "Setting bool:'%s' to %d ---> %s",
+ key, value, value ? "true" : "false");
+
+ priv = GET_PRIV (conf);
+
+ return gconf_client_set_bool (priv->gconf_client,
+ key,
+ value,
+ NULL);
+}
+
+gboolean
+empathy_conf_get_bool (EmpathyConf *conf,
+ const gchar *key,
+ gboolean *value)
+{
+ EmpathyConfPriv *priv;
+ GError *error = NULL;
+
+ *value = FALSE;
+
+ g_return_val_if_fail (EMPATHY_IS_CONF (conf), FALSE);
+ g_return_val_if_fail (value != NULL, FALSE);
+
+ priv = GET_PRIV (conf);
+
+ *value = gconf_client_get_bool (priv->gconf_client,
+ key,
+ &error);
+
+ if (error) {
+ g_error_free (error);
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+gboolean
+empathy_conf_set_string (EmpathyConf *conf,
+ const gchar *key,
+ const gchar *value)
+{
+ EmpathyConfPriv *priv;
+
+ g_return_val_if_fail (EMPATHY_IS_CONF (conf), FALSE);
+
+ empathy_debug (DEBUG_DOMAIN, "Setting string:'%s' to '%s'",
+ key, value);
+
+ priv = GET_PRIV (conf);
+
+ return gconf_client_set_string (priv->gconf_client,
+ key,
+ value,
+ NULL);
+}
+
+gboolean
+empathy_conf_get_string (EmpathyConf *conf,
+ const gchar *key,
+ gchar **value)
+{
+ EmpathyConfPriv *priv;
+ GError *error = NULL;
+
+ *value = NULL;
+
+ g_return_val_if_fail (EMPATHY_IS_CONF (conf), FALSE);
+
+ priv = GET_PRIV (conf);
+
+ *value = gconf_client_get_string (priv->gconf_client,
+ key,
+ &error);
+
+ if (error) {
+ g_error_free (error);
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+gboolean
+empathy_conf_set_string_list (EmpathyConf *conf,
+ const gchar *key,
+ GSList *value)
+{
+ EmpathyConfPriv *priv;
+
+ g_return_val_if_fail (EMPATHY_IS_CONF (conf), FALSE);
+
+ priv = GET_PRIV (conf);
+
+ return gconf_client_set_list (priv->gconf_client,
+ key,
+ GCONF_VALUE_STRING,
+ value,
+ NULL);
+}
+
+gboolean
+empathy_conf_get_string_list (EmpathyConf *conf,
+ const gchar *key,
+ GSList **value)
+{
+ EmpathyConfPriv *priv;
+ GError *error = NULL;
+
+ *value = NULL;
+
+ g_return_val_if_fail (EMPATHY_IS_CONF (conf), FALSE);
+
+ priv = GET_PRIV (conf);
+
+ *value = gconf_client_get_list (priv->gconf_client,
+ key,
+ GCONF_VALUE_STRING,
+ &error);
+ if (error) {
+ g_error_free (error);
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+static void
+conf_notify_data_free (EmpathyConfNotifyData *data)
+{
+ g_object_unref (data->conf);
+ g_slice_free (EmpathyConfNotifyData, data);
+}
+
+static void
+conf_notify_func (GConfClient *client,
+ guint id,
+ GConfEntry *entry,
+ gpointer user_data)
+{
+ EmpathyConfNotifyData *data;
+
+ data = user_data;
+
+ data->func (data->conf,
+ gconf_entry_get_key (entry),
+ data->user_data);
+}
+
+guint
+empathy_conf_notify_add (EmpathyConf *conf,
+ const gchar *key,
+ EmpathyConfNotifyFunc func,
+ gpointer user_data)
+{
+ EmpathyConfPriv *priv;
+ guint id;
+ EmpathyConfNotifyData *data;
+
+ g_return_val_if_fail (EMPATHY_IS_CONF (conf), 0);
+
+ priv = GET_PRIV (conf);
+
+ data = g_slice_new (EmpathyConfNotifyData);
+ data->func = func;
+ data->user_data = user_data;
+ data->conf = g_object_ref (conf);
+
+ id = gconf_client_notify_add (priv->gconf_client,
+ key,
+ conf_notify_func,
+ data,
+ (GFreeFunc) conf_notify_data_free,
+ NULL);
+
+ return id;
+}
+
+gboolean
+empathy_conf_notify_remove (EmpathyConf *conf,
+ guint id)
+{
+ EmpathyConfPriv *priv;
+
+ g_return_val_if_fail (EMPATHY_IS_CONF (conf), FALSE);
+
+ priv = GET_PRIV (conf);
+
+ gconf_client_notify_remove (priv->gconf_client, id);
+
+ return TRUE;
+}
+
--- /dev/null
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * Copyright (C) 2006 Imendio AB
+ *
+ * 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 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 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 __EMPATHY_CONF_H__
+#define __EMPATHY_CONF_H__
+
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+
+#define EMPATHY_TYPE_CONF (empathy_conf_get_type ())
+#define EMPATHY_CONF(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), EMPATHY_TYPE_CONF, EmpathyConf))
+#define EMPATHY_CONF_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), EMPATHY_TYPE_CONF, EmpathyConfClass))
+#define EMPATHY_IS_CONF(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), EMPATHY_TYPE_CONF))
+#define EMPATHY_IS_CONF_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), EMPATHY_TYPE_CONF))
+#define EMPATHY_CONF_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), EMPATHY_TYPE_CONF, EmpathyConfClass))
+
+typedef struct _EmpathyConf EmpathyConf;
+typedef struct _EmpathyConfClass EmpathyConfClass;
+
+struct _EmpathyConf {
+ GObject parent;
+};
+
+struct _EmpathyConfClass {
+ GObjectClass parent_class;
+};
+
+typedef void (*EmpathyConfNotifyFunc) (EmpathyConf *conf,
+ const gchar *key,
+ gpointer user_data);
+
+GType empathy_conf_get_type (void) G_GNUC_CONST;
+EmpathyConf *empathy_conf_get (void);
+void empathy_conf_shutdown (void);
+guint empathy_conf_notify_add (EmpathyConf *conf,
+ const gchar *key,
+ EmpathyConfNotifyFunc func,
+ gpointer data);
+gboolean empathy_conf_notify_remove (EmpathyConf *conf,
+ guint id);
+gboolean empathy_conf_set_int (EmpathyConf *conf,
+ const gchar *key,
+ gint value);
+gboolean empathy_conf_get_int (EmpathyConf *conf,
+ const gchar *key,
+ gint *value);
+gboolean empathy_conf_set_bool (EmpathyConf *conf,
+ const gchar *key,
+ gboolean value);
+gboolean empathy_conf_get_bool (EmpathyConf *conf,
+ const gchar *key,
+ gboolean *value);
+gboolean empathy_conf_set_string (EmpathyConf *conf,
+ const gchar *key,
+ const gchar *value);
+gboolean empathy_conf_get_string (EmpathyConf *conf,
+ const gchar *key,
+ gchar **value);
+gboolean empathy_conf_set_string_list (EmpathyConf *conf,
+ const gchar *key,
+ GSList *value);
+gboolean empathy_conf_get_string_list (EmpathyConf *conf,
+ const gchar *key,
+ GSList **value);
+
+G_END_DECLS
+
+#endif /* __EMPATHY_CONF_H__ */
+
#include <libempathy/empathy-contact.h>
#include <libempathy/empathy-utils.h>
#include <libempathy/empathy-debug.h>
-#include <libempathy/empathy-conf.h>
#include "empathy-group-chat.h"
#include "empathy-chat.h"
//#include "empathy-sound.h"
#include "empathy-images.h"
#include "empathy-ui-utils.h"
+#include "empathy-conf.h"
#include "empathy-preferences.h"
#define DEBUG_DOMAIN "GroupChat"
#include <glade/glade.h>
#include <glib/gi18n.h>
-#include <libempathy/empathy-conf.h>
#include <libempathy/empathy-contact.h>
#include <libempathy/empathy-debug.h>
#include <libempathy/empathy-utils.h>
#include "empathy-presence-chooser.h"
#include "empathy-ui-utils.h"
#include "empathy-geometry.h"
+#include "empathy-conf.h"
#include "empathy-preferences.h"
#include "empathy-accounts-dialog.h"
#include "empathy-about-dialog.h"
#include <glade/glade.h>
#include <glib/gi18n.h>
-#include <libempathy/empathy-conf.h>
-
+#include "empathy-conf.h"
#include "empathy-preferences.h"
#include "empathy-ui-utils.h"
#include "empathy-theme-manager.h"
#endif
#include <libempathy/empathy-debug.h>
-#include <libempathy/empathy-conf.h>
#include "empathy-spell.h"
+#include "empathy-conf.h"
#include "empathy-preferences.h"
#define DEBUG_DOMAIN "Spell"
#include <libempathy/empathy-tp-chat.h>
#include <libempathy/empathy-debug.h>
#include <libempathy/empathy-utils.h>
-#include <libempathy/empathy-conf.h>
#include <libempathy/empathy-idle.h>
#include <libempathy/empathy-filter.h>
#include "empathy-status-icon.h"
#include "empathy-contact-dialogs.h"
#include "empathy-presence-chooser.h"
+#include "empathy-conf.h"
#include "empathy-preferences.h"
#include "empathy-ui-utils.h"
#include "empathy-accounts-dialog.h"
#include <gtk/gtk.h>
#include <libempathy/empathy-utils.h>
-#include <libempathy/empathy-conf.h>
#include "empathy-chat-view.h"
+#include "empathy-conf.h"
#include "empathy-preferences.h"
#include "empathy-theme.h"
#include "empathy-theme-boxes.h"
#include <glib/gi18n.h>
#include <gtk/gtk.h>
-#include <libempathy/empathy-conf.h>
#include <libempathy/empathy-debug.h>
#include <libempathy/empathy-utils.h>
#include <libempathy/empathy-marshal.h>
#include "empathy-chat.h"
+#include "empathy-conf.h"
#include "empathy-preferences.h"
#include "empathy-theme.h"
#include "empathy-smiley-manager.h"
lib_LTLIBRARIES = libempathy.la
libempathy_la_SOURCES = \
- empathy-conf.c \
empathy-avatar.c \
empathy-time.c \
empathy-presence.c \
-version-info ${LIBEMPATHY_CURRENT}:${LIBEMPATHY_REVISION}:${LIBEMPATHY_AGE}
libempathy_headers = \
- empathy-conf.h \
empathy-avatar.h \
empathy-time.h \
empathy-presence.h \
+++ /dev/null
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Copyright (C) 2006 Imendio AB
- *
- * 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 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 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.
- *
- * Authors: Richard Hult <richard@imendio.com>
- */
-
-#include "config.h"
-
-#include <string.h>
-
-#include <gconf/gconf-client.h>
-
-#include "empathy-conf.h"
-#include "empathy-debug.h"
-
-#define DEBUG_DOMAIN "Config"
-
-#define EMPATHY_CONF_ROOT "/apps/empathy"
-#define DESKTOP_INTERFACE_ROOT "/desktop/gnome/interface"
-
-#define GET_PRIV(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), EMPATHY_TYPE_CONF, EmpathyConfPriv))
-
-typedef struct {
- GConfClient *gconf_client;
-} EmpathyConfPriv;
-
-typedef struct {
- EmpathyConf *conf;
- EmpathyConfNotifyFunc func;
- gpointer user_data;
-} EmpathyConfNotifyData;
-
-static void conf_finalize (GObject *object);
-
-G_DEFINE_TYPE (EmpathyConf, empathy_conf, G_TYPE_OBJECT);
-
-static EmpathyConf *global_conf = NULL;
-
-static void
-empathy_conf_class_init (EmpathyConfClass *class)
-{
- GObjectClass *object_class;
-
- object_class = G_OBJECT_CLASS (class);
-
- object_class->finalize = conf_finalize;
-
- g_type_class_add_private (object_class, sizeof (EmpathyConfPriv));
-}
-
-static void
-empathy_conf_init (EmpathyConf *conf)
-{
- EmpathyConfPriv *priv;
-
- priv = GET_PRIV (conf);
-
- priv->gconf_client = gconf_client_get_default ();
-
- gconf_client_add_dir (priv->gconf_client,
- EMPATHY_CONF_ROOT,
- GCONF_CLIENT_PRELOAD_ONELEVEL,
- NULL);
- gconf_client_add_dir (priv->gconf_client,
- DESKTOP_INTERFACE_ROOT,
- GCONF_CLIENT_PRELOAD_NONE,
- NULL);
-}
-
-static void
-conf_finalize (GObject *object)
-{
- EmpathyConfPriv *priv;
-
- priv = GET_PRIV (object);
-
- gconf_client_remove_dir (priv->gconf_client,
- EMPATHY_CONF_ROOT,
- NULL);
- gconf_client_remove_dir (priv->gconf_client,
- DESKTOP_INTERFACE_ROOT,
- NULL);
-
- g_object_unref (priv->gconf_client);
-
- G_OBJECT_CLASS (empathy_conf_parent_class)->finalize (object);
-}
-
-EmpathyConf *
-empathy_conf_get (void)
-{
- if (!global_conf) {
- global_conf = g_object_new (EMPATHY_TYPE_CONF, NULL);
- }
-
- return global_conf;
-}
-
-void
-empathy_conf_shutdown (void)
-{
- if (global_conf) {
- g_object_unref (global_conf);
- global_conf = NULL;
- }
-}
-
-gboolean
-empathy_conf_set_int (EmpathyConf *conf,
- const gchar *key,
- gint value)
-{
- EmpathyConfPriv *priv;
-
- g_return_val_if_fail (EMPATHY_IS_CONF (conf), FALSE);
-
- empathy_debug (DEBUG_DOMAIN, "Setting int:'%s' to %d", key, value);
-
- priv = GET_PRIV (conf);
-
- return gconf_client_set_int (priv->gconf_client,
- key,
- value,
- NULL);
-}
-
-gboolean
-empathy_conf_get_int (EmpathyConf *conf,
- const gchar *key,
- gint *value)
-{
- EmpathyConfPriv *priv;
- GError *error = NULL;
-
- *value = 0;
-
- g_return_val_if_fail (EMPATHY_IS_CONF (conf), FALSE);
- g_return_val_if_fail (value != NULL, FALSE);
-
- priv = GET_PRIV (conf);
-
- *value = gconf_client_get_int (priv->gconf_client,
- key,
- &error);
-
- if (error) {
- g_error_free (error);
- return FALSE;
- }
-
- return TRUE;
-}
-
-gboolean
-empathy_conf_set_bool (EmpathyConf *conf,
- const gchar *key,
- gboolean value)
-{
- EmpathyConfPriv *priv;
-
- g_return_val_if_fail (EMPATHY_IS_CONF (conf), FALSE);
-
- empathy_debug (DEBUG_DOMAIN, "Setting bool:'%s' to %d ---> %s",
- key, value, value ? "true" : "false");
-
- priv = GET_PRIV (conf);
-
- return gconf_client_set_bool (priv->gconf_client,
- key,
- value,
- NULL);
-}
-
-gboolean
-empathy_conf_get_bool (EmpathyConf *conf,
- const gchar *key,
- gboolean *value)
-{
- EmpathyConfPriv *priv;
- GError *error = NULL;
-
- *value = FALSE;
-
- g_return_val_if_fail (EMPATHY_IS_CONF (conf), FALSE);
- g_return_val_if_fail (value != NULL, FALSE);
-
- priv = GET_PRIV (conf);
-
- *value = gconf_client_get_bool (priv->gconf_client,
- key,
- &error);
-
- if (error) {
- g_error_free (error);
- return FALSE;
- }
-
- return TRUE;
-}
-
-gboolean
-empathy_conf_set_string (EmpathyConf *conf,
- const gchar *key,
- const gchar *value)
-{
- EmpathyConfPriv *priv;
-
- g_return_val_if_fail (EMPATHY_IS_CONF (conf), FALSE);
-
- empathy_debug (DEBUG_DOMAIN, "Setting string:'%s' to '%s'",
- key, value);
-
- priv = GET_PRIV (conf);
-
- return gconf_client_set_string (priv->gconf_client,
- key,
- value,
- NULL);
-}
-
-gboolean
-empathy_conf_get_string (EmpathyConf *conf,
- const gchar *key,
- gchar **value)
-{
- EmpathyConfPriv *priv;
- GError *error = NULL;
-
- *value = NULL;
-
- g_return_val_if_fail (EMPATHY_IS_CONF (conf), FALSE);
-
- priv = GET_PRIV (conf);
-
- *value = gconf_client_get_string (priv->gconf_client,
- key,
- &error);
-
- if (error) {
- g_error_free (error);
- return FALSE;
- }
-
- return TRUE;
-}
-
-gboolean
-empathy_conf_set_string_list (EmpathyConf *conf,
- const gchar *key,
- GSList *value)
-{
- EmpathyConfPriv *priv;
-
- g_return_val_if_fail (EMPATHY_IS_CONF (conf), FALSE);
-
- priv = GET_PRIV (conf);
-
- return gconf_client_set_list (priv->gconf_client,
- key,
- GCONF_VALUE_STRING,
- value,
- NULL);
-}
-
-gboolean
-empathy_conf_get_string_list (EmpathyConf *conf,
- const gchar *key,
- GSList **value)
-{
- EmpathyConfPriv *priv;
- GError *error = NULL;
-
- *value = NULL;
-
- g_return_val_if_fail (EMPATHY_IS_CONF (conf), FALSE);
-
- priv = GET_PRIV (conf);
-
- *value = gconf_client_get_list (priv->gconf_client,
- key,
- GCONF_VALUE_STRING,
- &error);
- if (error) {
- g_error_free (error);
- return FALSE;
- }
-
- return TRUE;
-}
-
-static void
-conf_notify_data_free (EmpathyConfNotifyData *data)
-{
- g_object_unref (data->conf);
- g_slice_free (EmpathyConfNotifyData, data);
-}
-
-static void
-conf_notify_func (GConfClient *client,
- guint id,
- GConfEntry *entry,
- gpointer user_data)
-{
- EmpathyConfNotifyData *data;
-
- data = user_data;
-
- data->func (data->conf,
- gconf_entry_get_key (entry),
- data->user_data);
-}
-
-guint
-empathy_conf_notify_add (EmpathyConf *conf,
- const gchar *key,
- EmpathyConfNotifyFunc func,
- gpointer user_data)
-{
- EmpathyConfPriv *priv;
- guint id;
- EmpathyConfNotifyData *data;
-
- g_return_val_if_fail (EMPATHY_IS_CONF (conf), 0);
-
- priv = GET_PRIV (conf);
-
- data = g_slice_new (EmpathyConfNotifyData);
- data->func = func;
- data->user_data = user_data;
- data->conf = g_object_ref (conf);
-
- id = gconf_client_notify_add (priv->gconf_client,
- key,
- conf_notify_func,
- data,
- (GFreeFunc) conf_notify_data_free,
- NULL);
-
- return id;
-}
-
-gboolean
-empathy_conf_notify_remove (EmpathyConf *conf,
- guint id)
-{
- EmpathyConfPriv *priv;
-
- g_return_val_if_fail (EMPATHY_IS_CONF (conf), FALSE);
-
- priv = GET_PRIV (conf);
-
- gconf_client_notify_remove (priv->gconf_client, id);
-
- return TRUE;
-}
-
+++ /dev/null
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * Copyright (C) 2006 Imendio AB
- *
- * 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 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 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 __EMPATHY_CONF_H__
-#define __EMPATHY_CONF_H__
-
-#include <glib-object.h>
-
-G_BEGIN_DECLS
-
-#define EMPATHY_TYPE_CONF (empathy_conf_get_type ())
-#define EMPATHY_CONF(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), EMPATHY_TYPE_CONF, EmpathyConf))
-#define EMPATHY_CONF_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), EMPATHY_TYPE_CONF, EmpathyConfClass))
-#define EMPATHY_IS_CONF(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), EMPATHY_TYPE_CONF))
-#define EMPATHY_IS_CONF_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), EMPATHY_TYPE_CONF))
-#define EMPATHY_CONF_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), EMPATHY_TYPE_CONF, EmpathyConfClass))
-
-typedef struct _EmpathyConf EmpathyConf;
-typedef struct _EmpathyConfClass EmpathyConfClass;
-
-struct _EmpathyConf {
- GObject parent;
-};
-
-struct _EmpathyConfClass {
- GObjectClass parent_class;
-};
-
-typedef void (*EmpathyConfNotifyFunc) (EmpathyConf *conf,
- const gchar *key,
- gpointer user_data);
-
-GType empathy_conf_get_type (void) G_GNUC_CONST;
-EmpathyConf *empathy_conf_get (void);
-void empathy_conf_shutdown (void);
-guint empathy_conf_notify_add (EmpathyConf *conf,
- const gchar *key,
- EmpathyConfNotifyFunc func,
- gpointer data);
-gboolean empathy_conf_notify_remove (EmpathyConf *conf,
- guint id);
-gboolean empathy_conf_set_int (EmpathyConf *conf,
- const gchar *key,
- gint value);
-gboolean empathy_conf_get_int (EmpathyConf *conf,
- const gchar *key,
- gint *value);
-gboolean empathy_conf_set_bool (EmpathyConf *conf,
- const gchar *key,
- gboolean value);
-gboolean empathy_conf_get_bool (EmpathyConf *conf,
- const gchar *key,
- gboolean *value);
-gboolean empathy_conf_set_string (EmpathyConf *conf,
- const gchar *key,
- const gchar *value);
-gboolean empathy_conf_get_string (EmpathyConf *conf,
- const gchar *key,
- gchar **value);
-gboolean empathy_conf_set_string_list (EmpathyConf *conf,
- const gchar *key,
- GSList *value);
-gboolean empathy_conf_get_string_list (EmpathyConf *conf,
- const gchar *key,
- GSList **value);
-
-G_END_DECLS
-
-#endif /* __EMPATHY_CONF_H__ */
-
(gtype-id "EMPATHY_TYPE_CHATROOM_MANAGER")
)
-(define-object Conf
- (in-module "Empathy")
- (parent "GObject")
- (c-name "EmpathyConf")
- (gtype-id "EMPATHY_TYPE_CONF")
-)
-
(define-object Contact
(in-module "Empathy")
(parent "GObject")
-;; From empathy-chandler-glue.h
-
-(define-function dbus_glib_marshal_empathy_chandler_BOOLEAN__STRING_BOXED_STRING_BOXED_UINT_UINT_POINTER
- (c-name "dbus_glib_marshal_empathy_chandler_BOOLEAN__STRING_BOXED_STRING_BOXED_UINT_UINT_POINTER")
- (return-type "none")
- (parameters
- '("GClosure*" "closure")
- '("GValue*-return_value" "G_GNUC_UNUSED")
- '("guint" "n_param_values")
- '("const-GValue*" "param_values")
- '("gpointer-invocation_hint" "G_GNUC_UNUSED")
- '("gpointer" "marshal_data")
- )
-)
-
-
-
;; From empathy-chandler.h
(define-function empathy_chandler_get_type
-;; From empathy-conf.h
-
-(define-function empathy_conf_get_type
- (c-name "empathy_conf_get_type")
- (return-type "GType")
-)
-
-(define-function empathy_conf_get
- (c-name "empathy_conf_get")
- (return-type "EmpathyConf*")
-)
-
-(define-function empathy_conf_shutdown
- (c-name "empathy_conf_shutdown")
- (return-type "none")
-)
-
-(define-method notify_add
- (of-object "EmpathyConf")
- (c-name "empathy_conf_notify_add")
- (return-type "guint")
- (parameters
- '("const-gchar*" "key")
- '("EmpathyConfNotifyFunc" "func")
- '("gpointer" "data")
- )
-)
-
-(define-method notify_remove
- (of-object "EmpathyConf")
- (c-name "empathy_conf_notify_remove")
- (return-type "gboolean")
- (parameters
- '("guint" "id")
- )
-)
-
-(define-method set_int
- (of-object "EmpathyConf")
- (c-name "empathy_conf_set_int")
- (return-type "gboolean")
- (parameters
- '("const-gchar*" "key")
- '("gint" "value")
- )
-)
-
-(define-method get_int
- (of-object "EmpathyConf")
- (c-name "empathy_conf_get_int")
- (return-type "gboolean")
- (parameters
- '("const-gchar*" "key")
- '("gint*" "value")
- )
-)
-
-(define-method set_bool
- (of-object "EmpathyConf")
- (c-name "empathy_conf_set_bool")
- (return-type "gboolean")
- (parameters
- '("const-gchar*" "key")
- '("gboolean" "value")
- )
-)
-
-(define-method get_bool
- (of-object "EmpathyConf")
- (c-name "empathy_conf_get_bool")
- (return-type "gboolean")
- (parameters
- '("const-gchar*" "key")
- '("gboolean*" "value")
- )
-)
-
-(define-method set_string
- (of-object "EmpathyConf")
- (c-name "empathy_conf_set_string")
- (return-type "gboolean")
- (parameters
- '("const-gchar*" "key")
- '("const-gchar*" "value")
- )
-)
-
-(define-method get_string
- (of-object "EmpathyConf")
- (c-name "empathy_conf_get_string")
- (return-type "gboolean")
- (parameters
- '("const-gchar*" "key")
- '("gchar**" "value")
- )
-)
-
-(define-method set_string_list
- (of-object "EmpathyConf")
- (c-name "empathy_conf_set_string_list")
- (return-type "gboolean")
- (parameters
- '("const-gchar*" "key")
- '("GSList*" "value")
- )
-)
-
-(define-method get_string_list
- (of-object "EmpathyConf")
- (c-name "empathy_conf_get_string_list")
- (return-type "gboolean")
- (parameters
- '("const-gchar*" "key")
- '("GSList**" "value")
- )
-)
-
-
-
;; From empathy-contact-factory.h
(define-function empathy_contact_factory_get_type
-;; From empathy-enum-types.h
-
-(define-function empathy_reg_ex_type_get_type
- (c-name "empathy_reg_ex_type_get_type")
- (return-type "GType")
-)
-
-(define-function empathy_message_type_get_type
- (c-name "empathy_message_type_get_type")
- (return-type "GType")
-)
-
-(define-function empathy_capabilities_get_type
- (c-name "empathy_capabilities_get_type")
- (return-type "GType")
-)
-
-(define-function empathy_tp_call_status_get_type
- (c-name "empathy_tp_call_status_get_type")
- (return-type "GType")
-)
-
-
-
-;; From empathy-filter-glue.h
-
-(define-function dbus_glib_marshal_empathy_filter_BOOLEAN__STRING_BOXED_STRING_BOXED_UINT_UINT_UINT_POINTER
- (c-name "dbus_glib_marshal_empathy_filter_BOOLEAN__STRING_BOXED_STRING_BOXED_UINT_UINT_UINT_POINTER")
- (return-type "none")
- (parameters
- '("GClosure*" "closure")
- '("GValue*-return_value" "G_GNUC_UNUSED")
- '("guint" "n_param_values")
- '("const-GValue*" "param_values")
- '("gpointer-invocation_hint" "G_GNUC_UNUSED")
- '("gpointer" "marshal_data")
- )
-)
-
-
-
;; From empathy-filter.h
(define-function empathy_filter_get_type
-;; From empathy-marshal.h
-
-
-
;; From empathy-message.h
(define-function empathy_message_get_gtype
-;; From stamp-empathy-enum-types.h
-
-
-
;; From tp-stream-engine-gen.h
(define-function dbus_g_proxy_begin_call
#include "empathy-chandler.h"
#include "empathy-chatroom-manager.h"
#include "empathy-chatroom.h"
-#include "empathy-conf.h"
#include "empathy-contact-groups.h"
#include "empathy-contact-list.h"
#include "empathy-contact-manager.h"
(gtype-id "EMPATHY_TYPE_CHAT_WINDOW")
)
+(define-object Conf
+ (in-module "Empathy")
+ (parent "GObject")
+ (c-name "EmpathyConf")
+ (gtype-id "EMPATHY_TYPE_CONF")
+)
+
(define-object ContactListStore
(in-module "Empathy")
(parent "GtkTreeStore")
+;; From empathy-conf.h
+
+(define-function empathy_conf_get_type
+ (c-name "empathy_conf_get_type")
+ (return-type "GType")
+)
+
+(define-function empathy_conf_get
+ (c-name "empathy_conf_get")
+ (return-type "EmpathyConf*")
+)
+
+(define-function empathy_conf_shutdown
+ (c-name "empathy_conf_shutdown")
+ (return-type "none")
+)
+
+(define-method notify_add
+ (of-object "EmpathyConf")
+ (c-name "empathy_conf_notify_add")
+ (return-type "guint")
+ (parameters
+ '("const-gchar*" "key")
+ '("EmpathyConfNotifyFunc" "func")
+ '("gpointer" "data")
+ )
+)
+
+(define-method notify_remove
+ (of-object "EmpathyConf")
+ (c-name "empathy_conf_notify_remove")
+ (return-type "gboolean")
+ (parameters
+ '("guint" "id")
+ )
+)
+
+(define-method set_int
+ (of-object "EmpathyConf")
+ (c-name "empathy_conf_set_int")
+ (return-type "gboolean")
+ (parameters
+ '("const-gchar*" "key")
+ '("gint" "value")
+ )
+)
+
+(define-method get_int
+ (of-object "EmpathyConf")
+ (c-name "empathy_conf_get_int")
+ (return-type "gboolean")
+ (parameters
+ '("const-gchar*" "key")
+ '("gint*" "value")
+ )
+)
+
+(define-method set_bool
+ (of-object "EmpathyConf")
+ (c-name "empathy_conf_set_bool")
+ (return-type "gboolean")
+ (parameters
+ '("const-gchar*" "key")
+ '("gboolean" "value")
+ )
+)
+
+(define-method get_bool
+ (of-object "EmpathyConf")
+ (c-name "empathy_conf_get_bool")
+ (return-type "gboolean")
+ (parameters
+ '("const-gchar*" "key")
+ '("gboolean*" "value")
+ )
+)
+
+(define-method set_string
+ (of-object "EmpathyConf")
+ (c-name "empathy_conf_set_string")
+ (return-type "gboolean")
+ (parameters
+ '("const-gchar*" "key")
+ '("const-gchar*" "value")
+ )
+)
+
+(define-method get_string
+ (of-object "EmpathyConf")
+ (c-name "empathy_conf_get_string")
+ (return-type "gboolean")
+ (parameters
+ '("const-gchar*" "key")
+ '("gchar**" "value")
+ )
+)
+
+(define-method set_string_list
+ (of-object "EmpathyConf")
+ (c-name "empathy_conf_set_string_list")
+ (return-type "gboolean")
+ (parameters
+ '("const-gchar*" "key")
+ '("GSList*" "value")
+ )
+)
+
+(define-method get_string_list
+ (of-object "EmpathyConf")
+ (c-name "empathy_conf_get_string_list")
+ (return-type "gboolean")
+ (parameters
+ '("const-gchar*" "key")
+ '("GSList**" "value")
+ )
+)
+
+
+
;; From empathy-contact-dialogs.h
(define-function empathy_subscription_dialog_show
-;; From empathy-gtk-enum-types.h
-
-(define-function empathy_contact_widget_flags_get_type
- (c-name "empathy_contact_widget_flags_get_type")
- (return-type "GType")
-)
-
-(define-function empathy_contact_list_store_sort_get_type
- (c-name "empathy_contact_list_store_sort_get_type")
- (return-type "GType")
-)
-
-(define-function empathy_contact_list_store_col_get_type
- (c-name "empathy_contact_list_store_col_get_type")
- (return-type "GType")
-)
-
-(define-function empathy_contact_list_features_get_type
- (c-name "empathy_contact_list_features_get_type")
- (return-type "GType")
-)
-
-(define-function empathy_chat_view_block_get_type
- (c-name "empathy_chat_view_block_get_type")
- (return-type "GType")
-)
-
-
-
;; From empathy-images.h
)
-
-;; From stamp-empathy-gtk-enum-types.h
-
-
#include "empathy-chatrooms-window.h"
#include "empathy-chat-view.h"
#include "empathy-chat-window.h"
+#include "empathy-conf.h"
#include "empathy-contact-dialogs.h"
#include "empathy-contact-list-store.h"
#include "empathy-contact-list-view.h"