diff options
Diffstat (limited to 'libempathy-gtk')
-rw-r--r-- | libempathy-gtk/Makefile.am | 1 | ||||
-rw-r--r-- | libempathy-gtk/empathy-ui-utils.c | 41 | ||||
-rw-r--r-- | libempathy-gtk/empathy-ui-utils.h | 8 |
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, |