aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@src.gnome.org>2008-12-12 23:49:15 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2008-12-12 23:49:15 +0800
commit37d437ae1c69c8c70f5a289ec59363fe21836255 (patch)
treeb9743323a1a94c6ecf84cbe87892f6bbd38a6b19 /libempathy-gtk
parent7e20ee7f05f61981933be27e4332698a19cc04e6 (diff)
downloadgsoc2013-empathy-37d437ae1c69c8c70f5a289ec59363fe21836255.tar
gsoc2013-empathy-37d437ae1c69c8c70f5a289ec59363fe21836255.tar.gz
gsoc2013-empathy-37d437ae1c69c8c70f5a289ec59363fe21836255.tar.bz2
gsoc2013-empathy-37d437ae1c69c8c70f5a289ec59363fe21836255.tar.lz
gsoc2013-empathy-37d437ae1c69c8c70f5a289ec59363fe21836255.tar.xz
gsoc2013-empathy-37d437ae1c69c8c70f5a289ec59363fe21836255.tar.zst
gsoc2013-empathy-37d437ae1c69c8c70f5a289ec59363fe21836255.zip
Add empathy_init(), empathy_gtk_init() and empathy_gtk_init_with_args(). They have to be called by any process using libempathy.
svn path=/trunk/; revision=1966
Diffstat (limited to 'libempathy-gtk')
-rw-r--r--libempathy-gtk/Makefile.am1
-rw-r--r--libempathy-gtk/empathy-ui-utils.c41
-rw-r--r--libempathy-gtk/empathy-ui-utils.h8
3 files changed, 50 insertions, 0 deletions
diff --git a/libempathy-gtk/Makefile.am b/libempathy-gtk/Makefile.am
index 17cfa4dc6..d2801762d 100644
--- a/libempathy-gtk/Makefile.am
+++ b/libempathy-gtk/Makefile.am
@@ -2,6 +2,7 @@ AM_CPPFLAGS = \
-I. \
-I$(top_srcdir) \
-DDATADIR=\""$(datadir)"\" \
+ -DPKGDATADIR=\""$(pkgdatadir)"\" \
$(EMPATHY_CFLAGS) \
$(ENCHANT_CFLAGS) \
$(WARN_CFLAGS)
diff --git a/libempathy-gtk/empathy-ui-utils.c b/libempathy-gtk/empathy-ui-utils.c
index cd5cf0766..693bd8137 100644
--- a/libempathy-gtk/empathy-ui-utils.c
+++ b/libempathy-gtk/empathy-ui-utils.c
@@ -49,6 +49,47 @@
#include <libempathy/empathy-utils.h>
#include <libempathy/empathy-dispatcher.h>
+void
+empathy_gtk_init (int *argc, char ***argv)
+{
+ static gboolean initialized = FALSE;
+
+ if (initialized)
+ return;
+
+ empathy_init ();
+ gtk_init (argc, argv);
+ gtk_icon_theme_append_search_path (gtk_icon_theme_get_default (),
+ PKGDATADIR G_DIR_SEPARATOR_S "icons");
+
+ initialized = TRUE;
+}
+
+gboolean
+empathy_gtk_init_with_args (int *argc,
+ char ***argv,
+ char *parameter_string,
+ GOptionEntry *entries,
+ char *translation_domain,
+ GError **error)
+{
+ static gboolean initialized = FALSE;
+ gboolean ret;
+
+ if (initialized)
+ return TRUE;
+
+ empathy_init ();
+ ret = gtk_init_with_args (argc, argv, parameter_string, entries,
+ translation_domain, error);
+ gtk_icon_theme_append_search_path (gtk_icon_theme_get_default (),
+ PKGDATADIR G_DIR_SEPARATOR_S "icons");
+
+ initialized = TRUE;
+
+ return ret;
+}
+
struct SizeData {
gint width;
gint height;
diff --git a/libempathy-gtk/empathy-ui-utils.h b/libempathy-gtk/empathy-ui-utils.h
index 4a6efc6d0..777ce8ee0 100644
--- a/libempathy-gtk/empathy-ui-utils.h
+++ b/libempathy-gtk/empathy-ui-utils.h
@@ -46,6 +46,14 @@ G_BEGIN_DECLS
#define G_STR_EMPTY(x) ((x) == NULL || (x)[0] == '\0')
+void empathy_gtk_init (int *argc,
+ char ***argv);
+gboolean empathy_gtk_init_with_args (int *argc,
+ char ***argv,
+ char *parameter_string,
+ GOptionEntry *entries,
+ char *translation_domain,
+ GError **error);
/* Glade */
void empathy_glade_get_file_simple (const gchar *filename,
const gchar *root,